Shaka Player Embedded
Modules | Classes | Enumerations
MediaPlayer Implementations

Modules

 Media Capabilities
 

Classes

class  shaka::media::AppleAudioRenderer
 
class  shaka::media::AppleVideoRenderer
 
class  shaka::media::Decoder
 
class  shaka::media::DefaultMediaPlayer
 
class  shaka::media::Demuxer
 
class  shaka::media::BaseFrame
 
class  shaka::media::EncodedFrame
 
class  shaka::media::DecodedFrame
 
struct  shaka::media::VideoPlaybackQuality
 
class  shaka::media::MediaPlayer
 
class  shaka::media::MediaTrack
 
class  shaka::media::ProxyMediaPlayer
 
class  shaka::media::Renderer
 
class  shaka::media::AudioRenderer
 
class  shaka::media::VideoRenderer
 
class  shaka::media::SdlAudioRenderer
 
class  shaka::media::SdlManualVideoRenderer
 
class  shaka::media::SdlThreadVideoRenderer
 
class  shaka::media::StreamInfo
 
class  shaka::media::StreamBase
 
class  shaka::media::Stream< T, OrderByDts >
 
class  shaka::media::TextTrack
 
class  shaka::media::VTTCue
 

Enumerations

enum  shaka::media::MediaStatus : uint8_t { shaka::media::MediaStatus::Success, shaka::media::MediaStatus::FatalError, shaka::media::MediaStatus::KeyNotFound }
 
enum  shaka::media::PixelFormat : uint8_t {
  shaka::media::PixelFormat::Unknown, shaka::media::PixelFormat::YUV420P, shaka::media::PixelFormat::NV12, shaka::media::PixelFormat::RGB24,
  shaka::media::PixelFormat::VideoToolbox, shaka::media::PixelFormat::AppFormat1 = 128, shaka::media::PixelFormat::AppFormat2 = 129, shaka::media::PixelFormat::AppFormat3 = 130,
  shaka::media::PixelFormat::AppFormat4 = 131
}
 
enum  shaka::media::SampleFormat : uint8_t {
  shaka::media::SampleFormat::Unknown, shaka::media::SampleFormat::PackedU8, shaka::media::SampleFormat::PackedS16, shaka::media::SampleFormat::PackedS32,
  shaka::media::SampleFormat::PackedS64, shaka::media::SampleFormat::PackedFloat, shaka::media::SampleFormat::PackedDouble, shaka::media::SampleFormat::PlanarU8,
  shaka::media::SampleFormat::PlanarS16, shaka::media::SampleFormat::PlanarS32, shaka::media::SampleFormat::PlanarS64, shaka::media::SampleFormat::PlanarFloat,
  shaka::media::SampleFormat::PlanarDouble, shaka::media::SampleFormat::AppFormat1 = 128, shaka::media::SampleFormat::AppFormat2 = 129, shaka::media::SampleFormat::AppFormat3 = 130,
  shaka::media::SampleFormat::AppFormat4 = 131
}
 
enum  shaka::media::VideoReadyState : int8_t {
  shaka::media::VideoReadyState::NotAttached = -1, shaka::media::VideoReadyState::HaveNothing = 0, shaka::media::VideoReadyState::HaveMetadata = 1, shaka::media::VideoReadyState::HaveCurrentData = 2,
  shaka::media::VideoReadyState::HaveFutureData = 3, shaka::media::VideoReadyState::HaveEnoughData = 4
}
 
enum  shaka::media::VideoPlaybackState : uint8_t {
  shaka::media::VideoPlaybackState::Detached, shaka::media::VideoPlaybackState::Initializing, shaka::media::VideoPlaybackState::Paused, shaka::media::VideoPlaybackState::Seeking,
  shaka::media::VideoPlaybackState::Buffering, shaka::media::VideoPlaybackState::WaitingForKey, shaka::media::VideoPlaybackState::Playing, shaka::media::VideoPlaybackState::Ended,
  shaka::media::VideoPlaybackState::Errored
}
 
enum  shaka::media::MediaTrackKind : uint8_t {
  shaka::media::MediaTrackKind::Unknown, shaka::media::MediaTrackKind::Alternative, shaka::media::MediaTrackKind::Captions, shaka::media::MediaTrackKind::Descriptions,
  shaka::media::MediaTrackKind::Main, shaka::media::MediaTrackKind::MainDesc, shaka::media::MediaTrackKind::Sign, shaka::media::MediaTrackKind::Subtitles,
  shaka::media::MediaTrackKind::Translation, shaka::media::MediaTrackKind::Commentary
}
 
enum  shaka::media::TextTrackKind : uint8_t {
  shaka::media::TextTrackKind::Subtitles, shaka::media::TextTrackKind::Captions, shaka::media::TextTrackKind::Descriptions, shaka::media::TextTrackKind::Chapters,
  shaka::media::TextTrackKind::Metadata
}
 
enum  shaka::media::TextTrackMode : uint8_t { shaka::media::TextTrackMode::Disabled, shaka::media::TextTrackMode::Hidden, shaka::media::TextTrackMode::Showing }
 
enum  shaka::media::DirectionSetting : uint8_t { shaka::media::DirectionSetting::Horizontal, shaka::media::DirectionSetting::LeftToRight, shaka::media::DirectionSetting::RightToLeft }
 
enum  shaka::media::LineAlignSetting : uint8_t { shaka::media::LineAlignSetting::Start, shaka::media::LineAlignSetting::Center, shaka::media::LineAlignSetting::End }
 
enum  shaka::media::PositionAlignSetting : uint8_t { shaka::media::PositionAlignSetting::LineLeft, shaka::media::PositionAlignSetting::Center, shaka::media::PositionAlignSetting::LineRight, shaka::media::PositionAlignSetting::Auto }
 
enum  shaka::media::AlignSetting : uint8_t {
  shaka::media::AlignSetting::Start, shaka::media::AlignSetting::Center, shaka::media::AlignSetting::End, shaka::media::AlignSetting::Left,
  shaka::media::AlignSetting::Right
}
 

Detailed Description

Interfaces for defining custom MediaPlayer implementations.

Enumeration Type Documentation

§ AlignSetting

enum shaka::media::AlignSetting : uint8_t
strong

Represents the alignment of text within the cue box.

See also
https://w3c.github.io/webvtt/#webvtt-cue-text-alignment
Enumerator
Start 

The text of each line is individually aligned towards the start side of the box.

Center 

The text is aligned centered between the box’s start and end sides.

End 

The text of each line is individually aligned towards the end side of the box.

Left 

The text is aligned to the box’s left side (for horizontal cues) or top side (otherwise).

Right 

The text is aligned to the box’s right side (for horizontal cues) or bottom side (otherwise).

Definition at line 110 of file vtt_cue.h.

§ DirectionSetting

enum shaka::media::DirectionSetting : uint8_t
strong

Represents the direction to write the text.

See also
https://w3c.github.io/webvtt/#webvtt-cue-writing-direction
Enumerator
Horizontal 

A line extends horizontally and is offset vertically from the video viewport’s top edge, with consecutive lines displayed below each other.

LeftToRight 

A line extends vertically and is offset horizontally from the video viewport’s left edge, with consecutive lines displayed to the right of each other.

RightToLeft 

A line extends vertically and is offset horizontally from the video viewport’s right edge, with consecutive lines displayed to the left of each other.

Definition at line 31 of file vtt_cue.h.

§ LineAlignSetting

enum shaka::media::LineAlignSetting : uint8_t
strong

Represents the alignment of the cue box.

See also
https://w3c.github.io/webvtt/#webvtt-cue-line-alignment
Enumerator
Start 

The cue box’s top side (for horizontal cues), left side (for vertical growing right), or right side (for vertical growing left) is aligned at the line.

Center 

The cue box is centered at the line.

End 

The cue box’s bottom side (for horizontal cues), right side (for vertical growing right), or left side (for vertical growing left) is aligned at the line.

Definition at line 58 of file vtt_cue.h.

§ MediaStatus

enum shaka::media::MediaStatus : uint8_t
strong

Defines possible status results from media operations.

Enumerator
Success 
FatalError 

A fatal error occurred and there is no way to recover.

KeyNotFound 

Decryption failed since the required keys weren't found. Decoding could continue if the same frame was given again when the key is added.

Definition at line 35 of file frames.h.

§ MediaTrackKind

enum shaka::media::MediaTrackKind : uint8_t
strong

Represents the type of the audio/video track.

See also
https://html.spec.whatwg.org/multipage/media.html#dom-audiotrack-kind
Enumerator
Unknown 
Alternative 

A possible alternative to the main track, e.g. a different take of a song (audio), or a different angle (video).

Captions 

A version of the main video track with captions burnt in. (For legacy content; new content would use text tracks.)

Descriptions 

An audio description of a video track.

Main 

The primary audio or video track.

MainDesc 

The primary audio track, mixed with audio descriptions.

Sign 

A sign-language interpretation of an audio track.

Subtitles 

A version of the main video track with subtitles burnt in. (For legacy content; new content would use text tracks.)

Translation 

A translated version of the main audio track.

Commentary 

Commentary on the primary audio or video track, e.g. a director's commentary.

Definition at line 31 of file media_track.h.

§ PixelFormat

enum shaka::media::PixelFormat : uint8_t
strong

Defines possible binary formats of raw texture data.

Enumerator
Unknown 
YUV420P 

Planar YUV 4:2:0, 12bpp. This is FFmpeg's AV_PIX_FMT_YUV420P.

The first plane holds the Y values for each pixel; each pixel has one byte. The second and third planes hold U and V data respectively. Each byte in the row represents a 2x2 pixel region on the image. This means that the second and third planes have half as many bytes in each row.

NV12 

Planar YUV 4:2:0, 12bpp, using interleaved U/V components. This is FFmpeg's AV_PIX_FMT_NV12.

The first plane holds Y values for each pixel, as a single byte. The second plane holds interleaved U/V components. Each byte is alternating U/V data where each pair represent a 2x2 pixel region on the image.

RGB24 

Packed RGB 8:8:8, 24bpp. This is FFmpeg's AV_PIX_FMT_RGB24.

There is only one plane holding the data. Each pixel is represented by three bytes for R-G-B.

VideoToolbox 

A VideoToolbox hardware encoded frame. data[0] will contain a CVPixelBufferRef object containing the texture.

AppFormat1 

Apps can define custom pixel formats and use any values above 128. This library doesn't care about the PixelFormat outside of the Decoder and the VideoRenderer.

AppFormat2 
AppFormat3 
AppFormat4 

Definition at line 53 of file frames.h.

§ PositionAlignSetting

enum shaka::media::PositionAlignSetting : uint8_t
strong

Represents where the position anchors the cue box.

See also
https://w3c.github.io/webvtt/#webvtt-cue-position-alignment
Enumerator
LineLeft 

The cue box’s left side (for horizontal cues) or top side (otherwise) is aligned at the position.

Center 

The cue box is centered at the position.

LineRight 

The cue box’s right side (for horizontal cues) or bottom side (otherwise) is aligned at the position.

Auto 

The cue box’s alignment depends on the value of the text alignment of the cue.

Definition at line 82 of file vtt_cue.h.

§ SampleFormat

enum shaka::media::SampleFormat : uint8_t
strong

Defines possible binary formats of raw audio data.

For all formats, these are stored in native-endian byte order and assume the volume has a range of [-1.0, 1.0].

For planar data, each channel is stored in a different plane; for packed formats, channels are stored interleaved.

Enumerator
Unknown 
PackedU8 

Packed unsigned 8-bits.

PackedS16 

Packed signed 16-bits.

PackedS32 

Packed signed 32-bits.

PackedS64 

Packed signed 64-bits.

PackedFloat 

Packed 32-bit floats.

PackedDouble 

Packed 64-bits floats.

PlanarU8 

Planar unsigned 8-bits.

PlanarS16 

Planar signed 16-bits.

PlanarS32 

Planar signed 32-bits.

PlanarS64 

Planar signed 64-bits.

PlanarFloat 

Planar 32-bit floats.

PlanarDouble 

Planar 64-bit floats.

AppFormat1 

Apps can define custom sample formats and use any values above 128. This library doesn't care about the SampleFormat outside of the Decoder and the AudioRenderer.

AppFormat2 
AppFormat3 
AppFormat4 

Definition at line 117 of file frames.h.

§ TextTrackKind

enum shaka::media::TextTrackKind : uint8_t
strong

Represents the type of the text track.

See also
https://html.spec.whatwg.org/multipage/media.html#text-track-kind
Enumerator
Subtitles 

The track defines subtitles.

Captions 

The text track defines dialogue and sound effects, for the deaf.

Descriptions 

The text track defines a textual description of the video, for the blind.

Chapters 

The text track defines chapter titles, for navigation.

Metadata 

The text track defines content for use by scripts, which will not be viewed by users.

Definition at line 33 of file text_track.h.

§ TextTrackMode

enum shaka::media::TextTrackMode : uint8_t
strong

Represents the current state of the text track.

See also
https://html.spec.whatwg.org/multipage/media.html#text-track-mode
Enumerator
Disabled 

The text track is currently disabled. The user agent is completely ignoring it.

Hidden 

The text track is active, but the cues are not being displayed. Events will still fire as appropriate.

Showing 

The text track is enabled and visible.

Definition at line 60 of file text_track.h.

§ VideoPlaybackState

enum shaka::media::VideoPlaybackState : uint8_t
strong

Defines possible playback states the video can be in. This defines how the playhead is moving or why it isn't moving.

Enumerator
Detached 

There is no playback attached.

Initializing 

Waiting for the initial segment data.

Paused 

The video is paused by user action (i.e. the MediaPlayer::Pause method).

Seeking 

The video is seeking to another time. It will remain in this state until content is available at the new time.

Buffering 

The video is waiting for new content; if there was content available, this would be Playing.

WaitingForKey 

The video is waiting for an encryption key; if the key was available, this would be Playing.

Playing 

The video is moving forward and playing content.

Ended 

The video has reached the end of the content. This doesn't happen when reaching the end of available content (i.e. the end of a buffer), but when reaching the duration of the video.

Errored 

The video has had a fatal error and cannot play. Playback cannot recover from this state unless it is unloaded and new content is loaded.

Definition at line 91 of file media_player.h.

§ VideoReadyState

enum shaka::media::VideoReadyState : int8_t
strong

Defines possible content states the video can be in. This defines how much content is loaded around the current playhead time. This is similar to the "readyState" attribute from HTML. Not all states need to be used and this is mainly used to report to JavaScript.

Enumerator
NotAttached 

There is no content and we haven't attached to a playback instance. This is negative so the other values have the same numerical values as JavaScript. This also preserves total ordering of the states where not attached is less than attached with nothing loaded.

HaveNothing 

Playback has been attached, but nothing has been loaded yet.

HaveMetadata 

Playback has been attached and the metadata has been loaded.

HaveCurrentData 

Playback has been attached and there is media data at the current time.

HaveFutureData 

Playback has been attached and there is media data at the current time and up to a short time in the future. Playback could move forward if playing.

HaveEnoughData 

Playback has been attached and there is media data at the current time and up to a long time in the future. Playback is expected to continue without buffering.

Definition at line 48 of file media_player.h.