Native Player  1.0
media_stream.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 SRC_PLAYER_ES_DASH_PLAYER_DASH_MEDIA_STREAM_H_
28 #define SRC_PLAYER_ES_DASH_PLAYER_DASH_MEDIA_STREAM_H_
29 
30 #include <string>
31 #include <memory>
32 
34 
39 
42 enum class MediaStreamType : int32_t {
43  Unknown = -1,
44  Video = 0,
45  Audio = 1,
46  MaxTypes
47 };
48 
61  uint32_t id;
62 
65  uint32_t bitrate;
66 
69  std::shared_ptr<ContentProtectionDescriptor> content_protection;
70 
72  CommonStreamDescription() : id(0), bitrate(0) {}
73 
75  CommonStreamDescription(const CommonStreamDescription& other) = default;
76 
80 
82  CommonStreamDescription& operator=(const CommonStreamDescription& other) =
83  default;
84 
87  CommonStreamDescription& operator=(CommonStreamDescription&& other) = default;
88 
90  ~CommonStreamDescription() = default;
91 };
92 
101 struct AudioStream {
103  std::string language;
104 };
105 
114 struct VideoStream {
116  uint32_t width;
117  uint32_t height;
118 
120  VideoStream() : width(0), height(0) {}
121 
123  VideoStream(const VideoStream& other) = default;
124 
127  VideoStream(VideoStream&& other) = default;
128 
130  VideoStream& operator=(const VideoStream& other) = default;
131 
133  VideoStream& operator=(VideoStream&& other) = default;
134 
136  ~VideoStream() = default;
137 };
138 
139 #endif // SRC_PLAYER_ES_DASH_PLAYER_DASH_MEDIA_STREAM_H_
std::shared_ptr< ContentProtectionDescriptor > content_protection
Definition: media_stream.h:69
Describes the audio stream.
Definition: media_stream.h:101
CommonStreamDescription()
Constructs a CommonStreamDescription with 0 values.
Definition: media_stream.h:72
std::string language
Definition: media_stream.h:103
Describes a media stream common part for the audio and video streams used in their description...
Definition: media_stream.h:56
uint32_t height
Definition: media_stream.h:117
VideoStream()
Constructs a VideoStream with 0 values.
Definition: media_stream.h:120
CommonStreamDescription description
Definition: media_stream.h:115
This file defines ContentProtectionDescriptor and ContentProtectionVisitor classes.
MediaStreamType
Describes available stream types supported by the DASH parser.
Definition: media_stream.h:42
uint32_t width
Definition: media_stream.h:116
CommonStreamDescription description
Definition: media_stream.h:102
Describes the video stream.
Definition: media_stream.h:114