Rialto 0.1
Rialto media pipeline API
Loading...
Searching...
No Matches
MediaCommon.h
Go to the documentation of this file.
1/*
2 * If not stated otherwise in this file or this component's LICENSE file the
3 * following copyright and licenses apply:
4 *
5 * Copyright 2022 Sky UK
6 *
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
10 *
11 * http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 */
19
20#ifndef FIREBOLT_RIALTO_MEDIA_COMMON_H_
21#define FIREBOLT_RIALTO_MEDIA_COMMON_H_
22
30#include <limits>
31#include <optional>
32#include <stddef.h>
33#include <stdint.h>
34#include <utility>
35#include <vector>
36
37namespace firebolt::rialto
38{
42constexpr int32_t kInvalidSessionId{-1};
43
47constexpr uint32_t kInvalidAudioChannels{0};
48
52constexpr uint32_t kInvalidAudioSampleRate{0};
53
57constexpr int32_t kUndefinedSize{0};
58
62constexpr uint32_t kInvalidLimitBuffering{std::numeric_limits<uint32_t>::max()};
63
67constexpr uint64_t kUndefinedPosition{std::numeric_limits<uint64_t>::max()};
68
73{
74 UNKNOWN,
75 AUDIO,
76 VIDEO,
77 SUBTITLE
78};
79
84{
85 UNKNOWN,
86 AUDIO,
87 VIDEO,
88 VIDEO_DOLBY_VISION,
89 SUBTITLE
90};
91
95enum class AudioEaseType
96{
97 LINEAR = 0,
98 INCUBIC,
99 OUTCUBIC
100};
101
105enum class MediaType
106{
107 UNKNOWN,
108 MSE
109};
110
116{
117 OK,
118 EOS,
119 ERROR,
123};
124
137enum class NetworkState
138{
139 UNKNOWN,
140 IDLE,
141 BUFFERING,
143 BUFFERED,
144 STALLED,
148};
149
160{
161 UNKNOWN,
162 IDLE,
163 PLAYING,
164 PAUSED,
165 SEEKING,
166 SEEK_DONE,
167 STOPPED,
169 FAILURE
170};
171
175enum class Format
176{
177 S8,
178 U8,
179 S16LE,
180 S16BE,
181 U16LE,
182 U16BE,
183 S24_32LE,
184 S24_32BE,
185 U24_32LE,
186 U24_32BE,
187 S32LE,
188 S32BE,
189 U32LE,
190 U32BE,
191 S24LE,
192 S24BE,
193 U24LE,
194 U24BE,
195 S20LE,
196 S20BE,
197 U20LE,
198 U20BE,
199 S18LE,
200 S18BE,
201 U18LE,
202 U18BE,
203 F32LE,
204 F32BE,
205 F64LE,
206 F64BE
207};
208
212enum class Layout
213{
214 INTERLEAVED,
215 NON_INTERLEAVED
216};
217
222{
225 std::vector<uint8_t> codecSpecificConfig;
226 std::optional<Format> format;
227 std::optional<Layout> layout;
228 std::optional<uint64_t> channelMask;
229 std::vector<std::vector<uint8_t>> streamHeader;
230 std::optional<bool>
232};
233
240{
241 OK,
242 NO_SPACE,
243 ERROR
244};
245
251{
254};
255
260{
261 uint32_t maxWidth;
262 uint32_t maxHeight;
263};
264
275
280{
281 uint64_t processed;
282 uint64_t dropped;
283};
284
299
304{
305 UNKNOWN,
306 TEMPORARY,
309};
310
314enum class InitDataType
315{
316 UNKNOWN,
317 CENC,
318 KEY_IDS,
319 WEBM,
320 DRMHEADER
321};
322
326enum class KeyStatus
327{
328 USABLE,
329 EXPIRED,
331 PENDING,
332 INTERNAL_ERROR,
333 RELEASED
334};
335
340{
341 UNDEFINED,
342 NAL,
343 AU
344};
345
349enum class StreamFormat
350{
351 UNDEFINED,
352 RAW,
353 AVC,
354 BYTE_STREAM,
355 HVC1,
356 HEV1
357};
358
362typedef std::vector<std::pair<std::vector<unsigned char>, KeyStatus>> KeyStatusVector;
363
368{
369 uint32_t offsetMain;
370 uint32_t lengthMain;
371 uint32_t offsetWrap;
372 uint32_t lengthWrap;
373};
374
379{
380 uint32_t rate;
381 uint32_t channels;
382 uint32_t sampleSize;
384 bool isSigned;
385 bool isFloat;
386};
387
398
403{
404 UNKNOWN,
405 IDLE,
406 PLAYING,
407 PAUSED,
409 FAILURE
410};
411
415enum class CipherMode
416{
417 UNKNOWN,
418 CENC, /* AES-CTR scheme */
419 CBC1, /* AES-CBC scheme */
420 CENS, /* AES-CTR subsample pattern encryption scheme */
421 CBCS /* AES-CBC subsample pattern encryption scheme */
422};
423
428{
429 int32_t numerator;
430 int32_t denominator;
431};
432
437{
438 BUFFER,
439 STRING
440};
441
446{
447 std::vector<uint8_t> data{};
448 CodecDataType type{CodecDataType::BUFFER};
449};
450
455{
456 UNKNOWN,
457 DECRYPTION, /* Player failed to decrypt a buffer and the frame has been dropped */
458 OUTPUT_PROTECTION /* HDCP output protection failure */
459};
460
464enum class EaseType
465{
466 EASE_LINEAR,
467 EASE_IN_CUBIC,
468 EASE_OUT_CUBIC
469};
470
475{
476 int64_t currentPosition{-1};
477 double volume{1.0};
478};
479
484{
486 ENABLED,
487 DISABLED
488};
489} // namespace firebolt::rialto
490
491#endif // FIREBOLT_RIALTO_MEDIA_COMMON_H_
AddSegmentStatus
AddSegmentStatus.
Definition MediaCommon.h:240
CodecDataType
Codec data type.
Definition MediaCommon.h:437
EaseType
Ease type for audio volume changes.
Definition MediaCommon.h:465
SegmentAlignment
The alignment of media segment.
Definition MediaCommon.h:340
NetworkState
The Network State.
Definition MediaCommon.h:138
constexpr uint64_t kUndefinedPosition
The value of undefined position.
Definition MediaCommon.h:67
MediaType
The media type of media to be played.
Definition MediaCommon.h:106
SourceConfigType
Shows the types of source configuration.
Definition MediaCommon.h:84
PlaybackError
None fatal asynchronous errors reported by the player.
Definition MediaCommon.h:455
constexpr uint32_t kInvalidAudioSampleRate
The value of an invalid audio sampling rate.
Definition MediaCommon.h:52
StreamFormat
The Stream Format of media segment.
Definition MediaCommon.h:350
constexpr uint32_t kInvalidAudioChannels
The value of an invalid audio channels number.
Definition MediaCommon.h:47
LimitedDurationLicense
Limited duration license state.
Definition MediaCommon.h:484
constexpr uint32_t kInvalidLimitBuffering
The value of an invalid limitBuffering.
Definition MediaCommon.h:62
PlaybackState
The Playback State.
Definition MediaCommon.h:160
KeySessionType
The media key session type.
Definition MediaCommon.h:304
WebAudioPlayerState
The Web Audio Player State.
Definition MediaCommon.h:403
CipherMode
Cipher mode for common encryption, see https://www.iso.org/obp/ui/#iso:std:iso-iec:23001:-7:ed-3:v1:e...
Definition MediaCommon.h:416
AudioEaseType
The supported audio ease types.
Definition MediaCommon.h:96
std::vector< std::pair< std::vector< unsigned char >, KeyStatus > > KeyStatusVector
A vector of key ID/key status pairs.
Definition MediaCommon.h:362
constexpr int32_t kUndefinedSize
The value of an undefined size.
Definition MediaCommon.h:57
MediaSourceType
The supported types of media source.
Definition MediaCommon.h:73
constexpr int32_t kInvalidSessionId
The value of an invalid key session.
Definition MediaCommon.h:42
Format
The Format of the audio samples. Used by the raw audio media types.
Definition MediaCommon.h:176
MediaKeyErrorStatus
The error return status for session management methods.
Definition MediaCommon.h:289
MediaSourceStatus
The media source status. This is the status of the source after a read.
Definition MediaCommon.h:116
Layout
The layout of channels within a buffer. Used by the raw audio media types.
Definition MediaCommon.h:213
InitDataType
The init data type.
Definition MediaCommon.h:315
KeyStatus
The key status.
Definition MediaCommon.h:327
Audio specific configuration.
Definition MediaCommon.h:222
std::vector< std::vector< uint8_t > > streamHeader
Definition MediaCommon.h:229
std::vector< uint8_t > codecSpecificConfig
Definition MediaCommon.h:225
uint32_t numberOfChannels
Definition MediaCommon.h:223
std::optional< uint64_t > channelMask
Definition MediaCommon.h:228
std::optional< Layout > layout
Definition MediaCommon.h:227
uint32_t sampleRate
Definition MediaCommon.h:224
std::optional< Format > format
Definition MediaCommon.h:226
std::optional< bool > framed
Definition MediaCommon.h:231
Codec data with type.
Definition MediaCommon.h:446
CodecDataType type
Definition MediaCommon.h:448
std::vector< uint8_t > data
Definition MediaCommon.h:447
Fraction type.
Definition MediaCommon.h:428
int32_t denominator
Definition MediaCommon.h:430
int32_t numerator
Definition MediaCommon.h:429
Information about the shared memory required for writting data.
Definition MediaCommon.h:269
uint32_t mediaDataOffset
Definition MediaCommon.h:272
uint32_t metadataOffset
Definition MediaCommon.h:271
uint32_t maxMetadataBytes
Definition MediaCommon.h:270
uint32_t maxMediaBytes
Definition MediaCommon.h:273
Struct containing current playback information.
Definition MediaCommon.h:475
int64_t currentPosition
Definition MediaCommon.h:476
double volume
Definition MediaCommon.h:477
The information provided in a QOS update.
Definition MediaCommon.h:280
uint64_t dropped
Definition MediaCommon.h:282
uint64_t processed
Definition MediaCommon.h:281
A pair describing the clear and encrypted bytes in a sub-sample.
Definition MediaCommon.h:251
size_t numClearBytes
Definition MediaCommon.h:252
size_t numEncryptedBytes
Definition MediaCommon.h:253
Video decoder requirements used to allocate a suitable decoder for a MediaPipeline session.
Definition MediaCommon.h:260
uint32_t maxHeight
Definition MediaCommon.h:262
uint32_t maxWidth
Definition MediaCommon.h:261
Pcm config information.
Definition MediaCommon.h:379
uint32_t rate
Definition MediaCommon.h:380
uint32_t sampleSize
Definition MediaCommon.h:382
bool isSigned
Definition MediaCommon.h:384
bool isFloat
Definition MediaCommon.h:385
uint32_t channels
Definition MediaCommon.h:381
bool isBigEndian
Definition MediaCommon.h:383
Information about the shared memory required for writting data for the web audio playback.
Definition MediaCommon.h:368
uint32_t offsetMain
Definition MediaCommon.h:369
uint32_t lengthMain
Definition MediaCommon.h:370
uint32_t offsetWrap
Definition MediaCommon.h:371
uint32_t lengthWrap
Definition MediaCommon.h:372
Type dependent configuration data.
Definition MediaCommon.h:392
WebAudioPcmConfig pcm
PCM audio configuration.
Definition MediaCommon.h:396