aboutsummaryrefslogtreecommitdiffstats
path: root/src/libdash/source/mpd/SegmentTemplate.h
diff options
context:
space:
mode:
authorAngelo Mantellini (manangel) <angelo.mantellini@irt-systemx.fr>2017-03-29 18:00:06 +0200
committerAngelo Mantellini (manangel) <angelo.mantellini@irt-systemx.fr>2017-03-30 18:58:33 +0200
commit3137acdd5a45285dab9903f9d41560c63eca8523 (patch)
tree38bd8525a9e214d848a73fc40e81ddb182cf91b6 /src/libdash/source/mpd/SegmentTemplate.h
parent9b30fc10fb1cbebe651e5a107e8ca5b24de54675 (diff)
first commit
Change-Id: I8412b8e7d966c2fbc508b537fd9a9bbcfc628ca8 Signed-off-by: Angelo Mantellini (manangel) <angelo.mantellini@irt-systemx.fr>
Diffstat (limited to 'src/libdash/source/mpd/SegmentTemplate.h')
-rw-r--r--src/libdash/source/mpd/SegmentTemplate.h61
1 files changed, 61 insertions, 0 deletions
diff --git a/src/libdash/source/mpd/SegmentTemplate.h b/src/libdash/source/mpd/SegmentTemplate.h
new file mode 100644
index 00000000..e5782a83
--- /dev/null
+++ b/src/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_ */