[vlc-devel] [PATCH]
Oleksandr Dmukh
alexdmukh at gmail.com
Tue Feb 3 11:32:28 CET 2015
Log Message:
[PATCH] added baseUrl to segment templates link to test:http://dash.edgesuite.net/dash264/TestCases/5b/1/manifest.mpd <http://dash.edgesuite.net/dash264/TestCases/5b/1/manifest.mpd>
From 77462339e0c22cd4c34165c20891cebcc2b4e8c6 Mon Sep 17 00:00:00 2001
From: Alex Dmukh <alexdmukh at gmail.com>
Date: Tue, 3 Feb 2015 12:27:41 +0200
Subject: [PATCH] [PATCH] added baseUrl to segment templates(edited) Link to
test: http://dash.edgesuite.net/dash264/TestCases/5b/1/manifest.mpd
---
modules/demux/dash/mpd/IsoffMainParser.cpp | 8 ++++++++
modules/demux/dash/mpd/Period.cpp | 15 +++++++++++++--
modules/demux/dash/mpd/Period.h | 2 +-
3 files changed, 22 insertions(+), 3 deletions(-)
diff --git a/modules/demux/dash/mpd/IsoffMainParser.cpp b/modules/demux/dash/mpd/IsoffMainParser.cpp
index 2e7a45c..0792304 100644
--- a/modules/demux/dash/mpd/IsoffMainParser.cpp
+++ b/modules/demux/dash/mpd/IsoffMainParser.cpp
@@ -104,6 +104,14 @@ void IsoffMainParser::parsePeriods(Node *root)
Period *period = new (std::nothrow) Period(mpd);
if (!period)
continue;
+
+ if((*it)->hasAttribute("duration"))
+ period->duration.Set(IsoTime((*it)->getAttributeValue("duration")));
+
+ Node* baseURLNode = DOMHelper::getFirstChildElementByName(*it, "BaseURL");
+ if(baseURLNode)
+ period->baseUrl = BaseUrl(baseURLNode->getText());
+
parseSegmentInformation(*it, period);
if((*it)->hasAttribute("start"))
period->startTime.Set(IsoTime((*it)->getAttributeValue("start")));
diff --git a/modules/demux/dash/mpd/Period.cpp b/modules/demux/dash/mpd/Period.cpp
index 904107b..6a5e24b 100644
--- a/modules/demux/dash/mpd/Period.cpp
+++ b/modules/demux/dash/mpd/Period.cpp
@@ -35,7 +35,8 @@
using namespace dash::mpd;
Period::Period(MPD *mpd) :
- SegmentInformation( mpd )
+ SegmentInformation( mpd ),
+ baseUrl( "" )
{
duration.Set(0);
startTime.Set(0);
@@ -86,7 +87,10 @@ AdaptationSet * Period::getAdaptationSet(Streams::Type type) const
Url Period::getUrlSegment() const
{
- return getParentUrlSegment();
+ if(baseUrl.getUrl().length() > 0)
+ return Url( baseUrl.getUrl() );
+ else
+ return getParentUrlSegment();
}
std::vector<std::string> Period::toString(int indent) const
@@ -94,6 +98,13 @@ std::vector<std::string> Period::toString(int indent) const
std::vector<std::string> ret;
std::string text(indent, ' ');
text.append("Period");
+
+ std::ostringstream ss;
+ ss << " - Duration:" << duration.Get();
+ ss << ", StartTime:" << startTime.Get();
+ ss << ", baseURL=" << baseUrl.getUrl();
+ text.append(ss.str());
+
ret.push_back(text);
std::vector<AdaptationSet *>::const_iterator k;
for(k = adaptationSets.begin(); k != adaptationSets.end(); k++)
diff --git a/modules/demux/dash/mpd/Period.h b/modules/demux/dash/mpd/Period.h
index 06304dd..0c0867d 100644
--- a/modules/demux/dash/mpd/Period.h
+++ b/modules/demux/dash/mpd/Period.h
@@ -57,7 +57,7 @@ namespace dash
Property<mtime_t> duration;
Property<mtime_t> startTime;
-
+ BaseUrl baseUrl;
private:
std::vector<AdaptationSet *> adaptationSets;
};
--
2.2.1
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20150203/2b3ed241/attachment.html>
More information about the vlc-devel
mailing list