Native Player  1.0
dash_manifest.h
Go to the documentation of this file.
1 // ----------------------------------------------------------------------------
2 //
3 // Copyright (c) 2016, Samsung Electronics Co., Ltd
4 //
5 // Permission is hereby granted, free of charge, to any person obtaining a copy
6 // of this software and associated documentation files (the "Software"), to
7 // deal in the Software without restriction, including without limitation the
8 // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
9 // sell copies of the Software, and to permit persons to whom the Software is
10 // furnished to do so, subject to the following conditions:
11 //
12 // The above copyright notice and this permission notice shall be included in
13 // all copies or substantial portions of the Software.
14 //
15 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM
20 // , OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 // THE SOFTWARE.
22 //
23 // @author Adam Bujalski
24 //
25 // ----------------------------------------------------------------------------
26 
27 #ifndef NATIVE_PLAYER_INC_PLAYER_ES_DASH_PLAYER_DASH_DASH_MANIFEST_H_
28 #define NATIVE_PLAYER_INC_PLAYER_ES_DASH_PLAYER_DASH_DASH_MANIFEST_H_
29 
30 #include <memory>
31 #include <string>
32 #include <vector>
33 
36 #include "dash/media_stream.h"
37 
38 namespace dash {
39 
40 class IDASHManager;
41 
42 namespace mpd {
43 
44 class IMPD;
45 
46 }
47 }
48 
51 
74 class DashManifest {
75  template <typename T, class... Args>
76  friend std::unique_ptr<T> MakeUnique(Args&&... args);
77 
78  public:
80  ~DashManifest();
81 
89  static std::unique_ptr<DashManifest> ParseMPD(
90  const std::string& url, ContentProtectionVisitor* visitor = nullptr);
91 
96  std::vector<AudioStream> GetAudioStreams() const;
97 
102  std::vector<VideoStream> GetVideoStreams() const;
103 
114  std::unique_ptr<MediaSegmentSequence> GetSequence(MediaStreamType type,
115  uint32_t id);
116 
124  std::unique_ptr<MediaSegmentSequence> GetAudioSequence(uint32_t id);
125 
133  std::unique_ptr<MediaSegmentSequence> GetVideoSequence(uint32_t id);
134 
151  const std::string& GetDuration() const;
152 
153  private:
154  DashManifest(std::unique_ptr<dash::IDASHManager> manager,
155  std::unique_ptr<dash::mpd::IMPD> mpd,
156  ContentProtectionVisitor* visitor);
157 
158  DashManifest(const DashManifest&) = delete;
159  DashManifest(DashManifest&&) = delete;
160 
161  DashManifest operator=(const DashManifest&) = delete;
162  DashManifest operator=(DashManifest&&) = delete;
163 
164  class Impl;
165  std::unique_ptr<Impl> pimpl_;
166 };
167 
168 #endif // NATIVE_PLAYER_INC_PLAYER_ES_DASH_PLAYER_DASH_DASH_MANIFEST_H_
This file defines the MediaStreamType enum and CommonStreamDescription, AudioStream, VideoStream structs.
This is an interface for classes provided by the application parsing DRM information from the DASH ma...
This file defines MediaSegmentSequence class.
This file defines ContentProtectionDescriptor and ContentProtectionVisitor classes.
MediaStreamType
Describes available stream types supported by the DASH parser.
Definition: media_stream.h:42
This class is responsible for parsing DASH manifest file from the given URL.
Definition: dash_manifest.h:74
std::unique_ptr< T > MakeUnique(Args &&...args)
Definition: common.h:46