Shaka Player Embedded
Public Member Functions | Static Public Member Functions | List of all members
shaka::media::Decoder Class Referenceabstract

#include <decoder.h>

Inheritance diagram for shaka::media::Decoder:
shaka::media::apple::AppleDecoder shaka::media::ffmpeg::FFmpegDecoder

Public Member Functions

 Decoder ()
 
virtual ~ Decoder ()
 
 Decoder (const Decoder &)=delete
 
Decoderoperator= (const Decoder &)=delete
 
 Decoder (Decoder &&)=delete
 
Decoderoperator= (Decoder &&)=delete
 
virtual MediaCapabilitiesInfo DecodingInfo (const MediaDecodingConfiguration &config) const =0
 
virtual void ResetDecoder ()=0
 
virtual MediaStatus Decode (std::shared_ptr< EncodedFrame > input, const eme::Implementation *eme, std::vector< std::shared_ptr< DecodedFrame >> *frames, std::string *extra_info)=0
 

Static Public Member Functions

static std::unique_ptr< DecoderCreateDefaultDecoder ()
 

Detailed Description

This is used by the DefaultMediaPlayer to decode EncodedFrame objects into DecodedFrame objects. If using a custom MediaPlayer, this type doesn't have to be used.

This object is used to decode a single stream type (e.g. audio or video), but this needs to support switching between different streams for adaptation.

With the exception of DecodingInfo, this is only used on a single background thread.

Definition at line 42 of file decoder.h.

Constructor & Destructor Documentation

§ Decoder() [1/3]

shaka::media::Decoder::Decoder ( )

§ ~ Decoder()

virtual shaka::media::Decoder::~ Decoder ( )
virtual

§ Decoder() [2/3]

shaka::media::Decoder::Decoder ( const Decoder )
delete

§ Decoder() [3/3]

shaka::media::Decoder::Decoder ( Decoder &&  )
delete

Member Function Documentation

§ CreateDefaultDecoder()

Doxygen_Skip std::unique_ptr< Decoder > shaka::media::Decoder::CreateDefaultDecoder ( )
static

Creates a new instance of the built-in decoder. This returns nullptr if the built-in decoder was removed from the build.

Definition at line 31 of file decoder.cc.

§ Decode()

virtual MediaStatus shaka::media::Decoder::Decode ( std::shared_ptr< EncodedFrame input,
const eme::Implementation eme,
std::vector< std::shared_ptr< DecodedFrame >> *  frames,
std::string *  extra_info 
)
pure virtual

Attempts to decode the given frame into some number of full frames.

This is given frames in DTS order, starting with a keyframe. The caller will call ResetDecoder if there is a seek before passing new frames. This may be given frames from different sub-streams, but changes will always start with a keyframe.

Parameters
inputThe frame to decode. This can be nullptr to flush the decoder.
emeThe EME implementation used to decrypt frames, or nullptr if not using EME.
frames[OUT] Where to insert newly created frames.
extra_info[OUT] If this returns FatalError, this argument will be set to a description of what error happened.
Returns
The status of the decode operation.

Implemented in shaka::media::apple::AppleDecoder, and shaka::media::ffmpeg::FFmpegDecoder.

§ DecodingInfo()

virtual MediaCapabilitiesInfo shaka::media::Decoder::DecodingInfo ( const MediaDecodingConfiguration config) const
pure virtual

§ operator=() [1/2]

Decoder& shaka::media::Decoder::operator= ( Decoder &&  )
delete

§ operator=() [2/2]

Decoder& shaka::media::Decoder::operator= ( const Decoder )
delete

§ ResetDecoder()

virtual void shaka::media::Decoder::ResetDecoder ( )
pure virtual

Resets any internal state due to a seek. The next frame given will be a keyframe. This is not called for changing sub-streams.

Implemented in shaka::media::apple::AppleDecoder, and shaka::media::ffmpeg::FFmpegDecoder.


The documentation for this class was generated from the following files: