Commit 98df0fd9 authored by Francois Cartegnie's avatar Francois Cartegnie

demux: dash: parse program info

parent 01e36efe
......@@ -29,6 +29,7 @@
#include "IsoffMainParser.h"
#include "SegmentTemplate.h"
#include "SegmentInfoDefault.h"
#include "ProgramInformation.h"
#include "xml/DOMHelper.h"
#include <vlc_strings.h>
#include <vlc_stream.h>
......@@ -50,6 +51,7 @@ bool IsoffMainParser::parse (Profile profile)
{
mpd = new MPD(p_stream, profile);
setMPDAttributes();
parseProgramInformation(DOMHelper::getFirstChildElementByName(root, "ProgramInformation"), mpd);
setMPDBaseUrl(root);
parsePeriods(root);
......@@ -329,6 +331,33 @@ void IsoffMainParser::setInitSegment (dash::xml::Node *segBaseNode, Segme
}
}
void IsoffMainParser::parseProgramInformation(Node * node, MPD *mpd)
{
if(!node)
return;
ProgramInformation *info = new (std::nothrow) ProgramInformation();
if (info)
{
Node *child = DOMHelper::getFirstChildElementByName(node, "Title");
if(child)
info->setTitle(child->getText());
child = DOMHelper::getFirstChildElementByName(node, "Source");
if(child)
info->setSource(child->getText());
child = DOMHelper::getFirstChildElementByName(node, "Copyright");
if(child)
info->setCopyright(child->getText());
if(node->hasAttribute("moreInformationURL"))
info->setMoreInformationUrl(node->getAttributeValue("moreInformationURL"));
mpd->setProgramInformation(info);
}
}
void IsoffMainParser::print ()
{
if(mpd)
......
......@@ -59,6 +59,7 @@ namespace dash
void parseSegmentBase (dash::xml::Node *, SegmentInformation *);
size_t parseSegmentList (dash::xml::Node *, SegmentInformation *);
size_t parseSegmentTemplate(dash::xml::Node *, SegmentInformation *);
void parseProgramInformation(dash::xml::Node *, MPD *);
};
class IsoTime
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment