Shaka Player Embedded
Namespaces | Classes | Typedefs | Enumerations | Functions | Variables
shaka::media Namespace Reference

Namespaces

 apple
 
 ffmpeg
 
 ios
 

Classes

class  AppleAudioRenderer
 
class  AppleVideoRenderer
 
struct  AudioConfiguration
 
class  AudioRenderer
 
class  AudioRendererCommon
 
class  BaseFrame
 
struct  BufferedRange
 
class  DecodedFrame
 
class  Decoder
 
class  DecoderThread
 
class  DefaultMediaPlayer
 
class  Demuxer
 
class  DemuxerFactory
 
class  DemuxerThread
 
class  EncodedFrame
 
struct  KeySystemTrackConfiguration
 
struct  MediaCapabilitiesInfo
 
struct  MediaCapabilitiesKeySystemConfiguration
 
struct  MediaDecodingConfiguration
 
class  MediaPlayer
 
class  MediaTrack
 
class  MseMediaPlayer
 
class  PipelineManager
 
class  PipelineMonitor
 
class  ProxyMediaPlayer
 
class  Renderer
 
class  SdlAudioRenderer
 
class  SdlManualVideoRenderer
 
class  SdlThreadVideoRenderer
 
class  Stream
 
class  StreamBase
 
class  StreamInfo
 
class  TextTrack
 
struct  VideoConfiguration
 
struct  VideoPlaybackQuality
 
class  VideoRenderer
 
class  VideoRendererCommon
 
class  VTTCue
 

Typedefs

using ElementaryStream = Stream< EncodedFrame, true >
 
using DecodedStream = Stream< DecodedFrame, false >
 
using BufferedRanges = std::vector< BufferedRange >
 

Enumerations

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

Functions

std::ostream & operator<< (std::ostream &os, PixelFormat format)
 
std::ostream & operator<< (std::ostream &os, SampleFormat format)
 
std::ostream & operator<< (std::ostream &os, variant< PixelFormat, SampleFormat > format)
 
bool IsPlanarFormat (variant< PixelFormat, SampleFormat > format)
 
size_t GetPlaneCount (variant< PixelFormat, SampleFormat > format, size_t channels)
 
std::string to_string (VideoReadyState state)
 
std::ostream & operator<< (std::ostream &os, VideoReadyState state)
 
std::string to_string (VideoPlaybackState state)
 
std::ostream & operator<< (std::ostream &os, VideoPlaybackState state)
 
bool ParseMimeType (const std::string &source, std::string *type, std::string *subtype, std::unordered_map< std::string, std::string > *params)
 
std::string NormalizeContainer (const std::string &container)
 
std::string NormalizeCodec (const std::string &codec)
 
BufferedRanges IntersectionOfBufferedRanges (const std::vector< BufferedRanges > &sources)
 
MediaDecodingConfiguration ConvertMimeToDecodingConfiguration (const std::string &mime_type, MediaDecodingType type)
 
std::pair< uint32_t, uint32_t > GetScreenResolution ()
 

Variables

constexpr const char * kCodecMimeParam = "codecs"
 

Typedef Documentation

§ BufferedRanges

using shaka::media::BufferedRanges = typedef std::vector<BufferedRange>

Definition at line 26 of file types.h.

§ DecodedStream

Definition at line 201 of file streams.h.

§ ElementaryStream

Definition at line 200 of file streams.h.

Enumeration Type Documentation

§ FrameLocation

enum shaka::media::FrameLocation : uint8_t
strong
Enumerator
KeyFrameBefore 

Locates the first keyframe that starts before or at the given time.

Near 

Locates the frame that starts closest to the given time.

After 

Locates the frame that starts after the given time.

Definition at line 28 of file streams.h.

Function Documentation

§ ConvertMimeToDecodingConfiguration()

MediaDecodingConfiguration shaka::media::ConvertMimeToDecodingConfiguration ( const std::string &  mime_type,
MediaDecodingType  type 
)

Converts a MIME type to a MediaDecodingConfiguration that is usable with the media capabilities API.

Definition at line 173 of file media_utils.cc.

§ GetPlaneCount()

size_t shaka::media::GetPlaneCount ( variant< PixelFormat, SampleFormat format,
size_t  channels 
)
Parameters
formatThe format to check.
channelsThe number of audio channels; ignored for video formats.
Returns
The number of planes for the given format.

Definition at line 92 of file frames.cc.

§ GetScreenResolution()

std::pair< uint32_t, uint32_t > shaka::media::GetScreenResolution ( )
Returns
the resolution of the screen.

Definition at line 196 of file media_utils.cc.

§ IntersectionOfBufferedRanges()

BufferedRanges shaka::media::IntersectionOfBufferedRanges ( const std::vector< BufferedRanges > &  sources)

Returns the buffered ranges that represent the regions that are buffered in all of the given sources.

Note this doesn't account for key frames, so this may not represent the actual playable regions.

Definition at line 144 of file media_utils.cc.

§ IsPlanarFormat()

bool shaka::media::IsPlanarFormat ( variant< PixelFormat, SampleFormat format)
Returns
Whether the given format is a planar format.

Definition at line 68 of file frames.cc.

§ NormalizeCodec()

std::string shaka::media::NormalizeCodec ( const std::string &  codec)
Returns
The codec converted to the name FFmpeg expects.

Definition at line 135 of file media_utils.cc.

§ NormalizeContainer()

std::string shaka::media::NormalizeContainer ( const std::string &  container)
Returns
The container converted to the name FFmpeg expects.

Definition at line 128 of file media_utils.cc.

§ operator<<() [1/5]

std::ostream& shaka::media::operator<< ( std::ostream &  os,
VideoReadyState  state 
)
inline

Definition at line 81 of file media_player.h.

§ operator<<() [2/5]

std::ostream & shaka::media::operator<< ( std::ostream &  os,
PixelFormat  format 
)

Definition at line 22 of file frames.cc.

§ operator<<() [3/5]

std::ostream& shaka::media::operator<< ( std::ostream &  os,
VideoPlaybackState  state 
)
inline

Definition at line 139 of file media_player.h.

§ operator<<() [4/5]

std::ostream & shaka::media::operator<< ( std::ostream &  os,
SampleFormat  format 
)

Definition at line 41 of file frames.cc.

§ operator<<() [5/5]

std::ostream& shaka::media::operator<< ( std::ostream &  os,
variant< PixelFormat, SampleFormat format 
)
inline

Definition at line 161 of file frames.h.

§ ParseMimeType()

bool shaka::media::ParseMimeType ( const std::string &  source,
std::string *  type,
std::string *  subtype,
std::unordered_map< std::string, std::string > *  params 
)

Parses a MIME type string into the type, subtype, and parameters. e.g.: "video/mp4; codecs=vp9"

Parameters
sourceThe MIME string to parse.
type[OUT] Where to put the type (e.g. 'video').
subtype[OUT] Where to put the subtype (e.g. 'mp4').
params[OUT] Where to put a map of parameters.
Returns
True on success, false on parsing errors.

Definition at line 62 of file media_utils.cc.

§ to_string() [1/2]

std::string shaka::media::to_string ( VideoReadyState  state)

Definition at line 32 of file media_player.cc.

§ to_string() [2/2]

std::string shaka::media::to_string ( VideoPlaybackState  state)

Definition at line 50 of file media_player.cc.

Variable Documentation

§ kCodecMimeParam

constexpr const char* shaka::media::kCodecMimeParam = "codecs"

The name of the MIME parameter that contains the codecs.

Definition at line 33 of file media_utils.h.