Commit 98df0fd9 authored by François Cartegnie's avatar François Cartegnie 🤞
Browse files

demux: dash: parse program info

parent 01e36efe
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
#include "IsoffMainParser.h" #include "IsoffMainParser.h"
#include "SegmentTemplate.h" #include "SegmentTemplate.h"
#include "SegmentInfoDefault.h" #include "SegmentInfoDefault.h"
#include "ProgramInformation.h"
#include "xml/DOMHelper.h" #include "xml/DOMHelper.h"
#include <vlc_strings.h> #include <vlc_strings.h>
#include <vlc_stream.h> #include <vlc_stream.h>
...@@ -50,6 +51,7 @@ bool IsoffMainParser::parse (Profile profile) ...@@ -50,6 +51,7 @@ bool IsoffMainParser::parse (Profile profile)
{ {
mpd = new MPD(p_stream, profile); mpd = new MPD(p_stream, profile);
setMPDAttributes(); setMPDAttributes();
parseProgramInformation(DOMHelper::getFirstChildElementByName(root, "ProgramInformation"), mpd);
setMPDBaseUrl(root); setMPDBaseUrl(root);
parsePeriods(root); parsePeriods(root);
...@@ -329,6 +331,33 @@ void IsoffMainParser::setInitSegment (dash::xml::Node *segBaseNode, Segme ...@@ -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 () void IsoffMainParser::print ()
{ {
if(mpd) if(mpd)
......
...@@ -59,6 +59,7 @@ namespace dash ...@@ -59,6 +59,7 @@ namespace dash
void parseSegmentBase (dash::xml::Node *, SegmentInformation *); void parseSegmentBase (dash::xml::Node *, SegmentInformation *);
size_t parseSegmentList (dash::xml::Node *, SegmentInformation *); size_t parseSegmentList (dash::xml::Node *, SegmentInformation *);
size_t parseSegmentTemplate(dash::xml::Node *, SegmentInformation *); size_t parseSegmentTemplate(dash::xml::Node *, SegmentInformation *);
void parseProgramInformation(dash::xml::Node *, MPD *);
}; };
class IsoTime class IsoTime
......
Supports Markdown
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