diff options
author | Luca Muscariello <lumuscar+fdio@cisco.com> | 2017-02-25 23:42:31 +0100 |
---|---|---|
committer | Luca Muscariello <lumuscar+fdio@cisco.com> | 2017-02-25 23:42:31 +0100 |
commit | 05c1a838c881ea502888659848d8792843b28718 (patch) | |
tree | cf0b05b58bd725a1eb6c80325ba986c63dea42aa /libdash/source/mpd/SegmentTemplate.h | |
parent | 9b30fc10fb1cbebe651e5a107e8ca5b24de54675 (diff) |
Initial commit: video player - viper
Change-Id: Id5aa33598ce34659bad4a7a9ae5006bfb84f9bd1
Signed-off-by: Luca Muscariello <lumuscar+fdio@cisco.com>
Diffstat (limited to 'libdash/source/mpd/SegmentTemplate.h')
-rw-r--r-- | libdash/source/mpd/SegmentTemplate.h | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/libdash/source/mpd/SegmentTemplate.h b/libdash/source/mpd/SegmentTemplate.h new file mode 100644 index 00000000..e5782a83 --- /dev/null +++ b/libdash/source/mpd/SegmentTemplate.h @@ -0,0 +1,61 @@ +/* + * SegmentTemplate.h + ***************************************************************************** + * Copyright (C) 2012, bitmovin Softwareentwicklung OG, All Rights Reserved + * + * Email: libdash-dev@vicky.bitmovin.net + * + * This source code and its use and distribution, is subject to the terms + * and conditions of the applicable license agreement. + *****************************************************************************/ + +#ifndef SEGMENTTEMPLATE_H_ +#define SEGMENTTEMPLATE_H_ + +#include "config.h" + +#include "ISegmentTemplate.h" +#include "MultipleSegmentBase.h" +#include "../helpers/String.h" + +namespace dash +{ + namespace mpd + { + class SegmentTemplate : public ISegmentTemplate, public MultipleSegmentBase + { + public: + SegmentTemplate (); + virtual ~SegmentTemplate (); + + const std::string& Getmedia () const; + const std::string& Getindex () const; + const std::string& Getinitialization () const; + const std::string& GetbitstreamSwitching () const; + ISegment* ToInitializationSegment (const std::vector<IBaseUrl *>& baseurls, const std::string& representationID, uint32_t bandwidth) const; + ISegment* ToBitstreamSwitchingSegment (const std::vector<IBaseUrl *>& baseurls, const std::string& representationID, uint32_t bandwidth) const; + ISegment* GetMediaSegmentFromNumber (const std::vector<IBaseUrl *>& baseurls, const std::string& representationID, uint32_t bandwidth, uint32_t number) const; + ISegment* GetIndexSegmentFromNumber (const std::vector<IBaseUrl *>& baseurls, const std::string& representationID, uint32_t bandwidth, uint32_t number) const; + ISegment* GetMediaSegmentFromTime (const std::vector<IBaseUrl *>& baseurls, const std::string& representationID, uint32_t bandwidth, uint32_t time) const; + ISegment* GetIndexSegmentFromTime (const std::vector<IBaseUrl *>& baseurls, const std::string& representationID, uint32_t bandwidth, uint32_t time) const; + + void SetMedia (const std::string& media); + void SetIndex (const std::string& index); + void SetInitialization (const std::string& initialization); + void SetBitstreamSwitching (const std::string& bitstreamSwichting); + + private: + std::string ReplaceParameters (const std::string& uri, const std::string& representationID, uint32_t bandwidth, uint32_t number, uint32_t time) const; + void FormatChunk (std::string& uri, uint32_t number) const; + ISegment* ToSegment (const std::string& uri, const std::vector<IBaseUrl *>& baseurls, const std::string& representationID, uint32_t bandwidth, + dash::metrics::HTTPTransactionType type, uint32_t number = 0, uint32_t time = 0) const; + + std::string media; + std::string index; + std::string initialization; + std::string bitstreamSwitching; + }; + } +} + +#endif /* SEGMENTTEMPLATE_H_ */ |