diff options
author | jacko <jsamain+fdio@cisco.com> | 2017-06-23 16:12:18 +0200 |
---|---|---|
committer | jacko <jsamain+fdio@cisco.com> | 2017-06-23 16:12:18 +0200 |
commit | a644414fd2c3a3f7f41e716b6875a78981e4cfe1 (patch) | |
tree | 13fc8ff2f6072add96f987a1a68a15c22d68d911 /MPD/AdaptationSetStream.cpp | |
parent | f8907f0a7a84928800adbbfd8e66e500794aa5d5 (diff) |
adding mpd live handling + automatic mpd fetching
Change-Id: I2c05bdf6a4d940ad22bb8632268f4b63a08a80a8
Signed-off-by: jacko <jsamain+fdio@cisco.com>
Diffstat (limited to 'MPD/AdaptationSetStream.cpp')
-rw-r--r-- | MPD/AdaptationSetStream.cpp | 111 |
1 files changed, 57 insertions, 54 deletions
diff --git a/MPD/AdaptationSetStream.cpp b/MPD/AdaptationSetStream.cpp index 62bc1912..94f97df9 100644 --- a/MPD/AdaptationSetStream.cpp +++ b/MPD/AdaptationSetStream.cpp @@ -14,69 +14,72 @@ using namespace libdash::framework::mpd; using namespace dash::mpd; -AdaptationSetStream::AdaptationSetStream(IMPD *mpd, IPeriod *period, IAdaptationSet *adaptationSet) : - mpd (mpd), - period (period), - adaptationSet (adaptationSet) +AdaptationSetStream::AdaptationSetStream(viper::managers::StreamType type, MPDWrapper *mpdWrapper) : + mpdWrapper (mpdWrapper), + type (type) +// period (period), +// adaptationSet (adaptationSet) { initialize(); } AdaptationSetStream::~AdaptationSetStream() { - std::map<IRepresentation *, IRepresentationStream *>::iterator iter; - for (iter = representations.begin(); iter != representations.end(); ++iter) - { - delete(iter->second); - } + this->mpdWrapper->destroyAdaptationSetStream(type); +// std::map<IRepresentation *, IRepresentationStream *>::iterator iter; +// for (iter = representations.begin(); iter != representations.end(); ++iter) +// { +// delete(iter->second); +// } } -IRepresentationStream* AdaptationSetStream::getRepresentationStream(IRepresentation *representation) -{ - return this->representations.find(representation)->second; -} - -RepresentationStreamType AdaptationSetStream::determineRepresentationStreamType (IRepresentation *representation) -{ - /* check on Representation Level */ - if (representation->GetSegmentList()) - return libdash::framework::mpd::SegmentList; - - if (representation->GetSegmentTemplate()) - return libdash::framework::mpd::SegmentTemplate; - - if (representation->GetSegmentBase() || representation->GetBaseURLs().size() > 0) - return libdash::framework::mpd::SingleMediaSegment; - - /* check on AdaptationSet Level */ - if (this->adaptationSet->GetSegmentList()) - return libdash::framework::mpd::SegmentList; - - if (this->adaptationSet->GetSegmentTemplate()) - return libdash::framework::mpd::SegmentTemplate; - - if (this->adaptationSet->GetSegmentBase()) - return libdash::framework::mpd::SingleMediaSegment; - - /* check on Period Level */ - if (this->period->GetSegmentList()) - return libdash::framework::mpd::SegmentList; - - if (this->period->GetSegmentTemplate()) - return libdash::framework::mpd::SegmentTemplate; - - if (this->period->GetSegmentBase()) - return libdash::framework::mpd::SingleMediaSegment; - - return libdash::framework::mpd::UNDEFINED; -} +//IRepresentationStream* AdaptationSetStream::getRepresentationStream(IRepresentation *representation) +//{ +// return this->representations.find(representation)->second; +//} + +//RepresentationStreamType AdaptationSetStream::determineRepresentationStreamType (IRepresentation *representation) +//{ +// /* check on Representation Level */ +// if (representation->GetSegmentList()) +// return libdash::framework::mpd::SegmentList; +// +// if (representation->GetSegmentTemplate()) +// return libdash::framework::mpd::SegmentTemplate; +// +// if (representation->GetSegmentBase() || representation->GetBaseURLs().size() > 0) +// return libdash::framework::mpd::SingleMediaSegment; +// +// /* check on AdaptationSet Level */ +// if (this->adaptationSet->GetSegmentList()) +// return libdash::framework::mpd::SegmentList; +// +// if (this->adaptationSet->GetSegmentTemplate()) +// return libdash::framework::mpd::SegmentTemplate; +// +// if (this->adaptationSet->GetSegmentBase()) +// return libdash::framework::mpd::SingleMediaSegment; +// +// /* check on Period Level */ +// if (this->period->GetSegmentList()) +// return libdash::framework::mpd::SegmentList; +// +// if (this->period->GetSegmentTemplate()) +// return libdash::framework::mpd::SegmentTemplate; +// +// if (this->period->GetSegmentBase()) +// return libdash::framework::mpd::SingleMediaSegment; +// +// return libdash::framework::mpd::UNDEFINED; +//} void AdaptationSetStream::initialize() { - for (size_t i = 0; i < adaptationSet->GetRepresentation().size(); i++) - { - IRepresentation *representation = adaptationSet->GetRepresentation().at(i); - RepresentationStreamType type = determineRepresentationStreamType(representation); - representations[representation] = RepresentationStreamFactory::create(type, mpd, period, adaptationSet, representation); - } + this->mpdWrapper->initializeAdaptationSetStream(type); +// for (size_t i = 0; i < adaptationSet->GetRepresentation().size(); i++) +// { +// IRepresentation *representation = adaptationSet->GetRepresentation().at(i); +// RepresentationStreamType type = determineRepresentationStreamType(representation); +// representations[representation] = RepresentationStreamFactory::create(type, mpd, period, adaptationSet, representation); +// } } |