vlc | branch: master | Christopher Mueller <christopher.muel...@itec.aau.at> | Mon Jan 30 14:48:29 2012 +0100| [e8bfbde17c5f5f3517dcc0dad447428492634e18] | committer: Hugo Beauzée-Luyssen
dash: added IS namespace and getprofile to domparser Signed-off-by: Hugo Beauzée-Luyssen <beauz...@gmail.com> > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=e8bfbde17c5f5f3517dcc0dad447428492634e18 --- modules/stream_filter/dash/xml/DOMParser.cpp | 25 ++++++++++++++++++++----- modules/stream_filter/dash/xml/DOMParser.h | 1 + 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/modules/stream_filter/dash/xml/DOMParser.cpp b/modules/stream_filter/dash/xml/DOMParser.cpp index 4a63d70..a2f54d2 100644 --- a/modules/stream_filter/dash/xml/DOMParser.cpp +++ b/modules/stream_filter/dash/xml/DOMParser.cpp @@ -28,6 +28,7 @@ #include "DOMParser.h" using namespace dash::xml; +using namespace dash::mpd; DOMParser::DOMParser (stream_t *stream) : root( NULL ), @@ -132,21 +133,35 @@ void DOMParser::print (Node *node, int offset) this->print(node->getSubNodes().at(i), offset); } } - void DOMParser::print () { this->print(this->root, 0); } - bool DOMParser::isDash (stream_t *stream) { - const char* psz_namespace = "urn:mpeg:mpegB:schema:DASH:MPD:DIS2011"; + const char* psz_namespaceDIS = "urn:mpeg:mpegB:schema:DASH:MPD:DIS2011"; + const char* psz_namespaceIS = "urn:mpeg:DASH:schema:MPD:2011"; const uint8_t *peek; int peek_size = stream_Peek(stream, &peek, 1024); - if (peek_size < (int)strlen(psz_namespace)) + if (peek_size < (int)strlen(psz_namespaceDIS)) return false; std::string header((const char*)peek, peek_size); - return header.find(psz_namespace) != std::string::npos; + return (header.find(psz_namespaceDIS) != std::string::npos) || (header.find(psz_namespaceIS) != std::string::npos); +} +Profile DOMParser::getProfile () +{ + if(this->root == NULL) + return dash::mpd::UnknownProfile; + + const std::string profile = this->root->getAttributeValue("profiles"); + + if(!profile.compare("urn:mpeg:mpegB:profile:dash:isoff-basic-on-demand:cm")) + return dash::mpd::BasicCM; + + if(!profile.compare("urn:mpeg:dash:profile:isoff-main:2011")) + return dash::mpd::IsoffMain; + + return dash::mpd::UnknownProfile; } diff --git a/modules/stream_filter/dash/xml/DOMParser.h b/modules/stream_filter/dash/xml/DOMParser.h index e138efc..7b5891b 100644 --- a/modules/stream_filter/dash/xml/DOMParser.h +++ b/modules/stream_filter/dash/xml/DOMParser.h @@ -55,6 +55,7 @@ namespace dash Node* getRootNode (); void print (); static bool isDash (stream_t *stream); + mpd::Profile getProfile (); private: Node *root; _______________________________________________ vlc-commits mailing list vlc-commits@videolan.org http://mailman.videolan.org/listinfo/vlc-commits