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

#include <demuxer.h>

Inheritance diagram for shaka::media::DemuxerFactory:
shaka::media::ffmpeg::FFmpegDemuxerFactory

Public Member Functions

 DemuxerFactory ()
 
virtual ~ DemuxerFactory ()
 
 DemuxerFactory (const DemuxerFactory &)=delete
 
DemuxerFactoryoperator= (const DemuxerFactory &)=delete
 
 DemuxerFactory (DemuxerFactory &&)=delete
 
DemuxerFactoryoperator= (DemuxerFactory &&)=delete
 
virtual bool IsTypeSupported (const std::string &mime_type) const =0
 
virtual bool IsCodecVideo (const std::string &codec) const =0
 
virtual bool CanSwitchType (const std::string &old_mime_type, const std::string &new_mime_type) const
 
virtual std::unique_ptr< DemuxerCreate (const std::string &mime_type, Demuxer::Client *client) const =0
 

Static Public Member Functions

static const DemuxerFactoryGetFactory ()
 
static void SetFactory (const DemuxerFactory *factory)
 

Detailed Description

Defines a factory used to create Demuxer instances and to query supported content types.

Definition at line 110 of file demuxer.h.

Constructor & Destructor Documentation

§ DemuxerFactory() [1/3]

shaka::media::DemuxerFactory::DemuxerFactory ( )

§ ~ DemuxerFactory()

virtual shaka::media::DemuxerFactory::~ DemuxerFactory ( )
virtual

§ DemuxerFactory() [2/3]

shaka::media::DemuxerFactory::DemuxerFactory ( const DemuxerFactory )
delete

§ DemuxerFactory() [3/3]

shaka::media::DemuxerFactory::DemuxerFactory ( DemuxerFactory &&  )
delete

Member Function Documentation

§ CanSwitchType()

bool shaka::media::DemuxerFactory::CanSwitchType ( const std::string &  old_mime_type,
const std::string &  new_mime_type 
) const
virtual

Determines whether you can call Demuxer::SwitchType to switch between the given MIME types.

Parameters
old_mime_typeThe full MIME type the Demuxer was using before.
new_mime_typeThe full MIME type we are switching to.
Returns
True if this is supported, false if not supported.

Definition at line 71 of file demuxer.cc.

§ Create()

virtual std::unique_ptr<Demuxer> shaka::media::DemuxerFactory::Create ( const std::string &  mime_type,
Demuxer::Client client 
) const
pure virtual

Creates a new Demuxer instance to initially read the given type of content.

Parameters
mime_typeThe full MIME type of the content being parsed.
clientA client object to raise events to; this will live as long as the resulting Demuxer instance.
Returns
The resulting Demuxer instance, or nullptr on error.

Implemented in shaka::media::ffmpeg::FFmpegDemuxerFactory.

§ GetFactory()

Doxygen_Skip const DemuxerFactory * shaka::media::DemuxerFactory::GetFactory ( )
static
Returns
The current DemuxerFactory instance.

Definition at line 53 of file demuxer.cc.

§ IsCodecVideo()

virtual bool shaka::media::DemuxerFactory::IsCodecVideo ( const std::string &  codec) const
pure virtual

Determines if the given codec string represents a video codec. This is only given a single codec, not a MIME type. This is only called when IsTypeSupported returns true.

Parameters
codecThe codec to check.
Returns
True if the codec is for video, false for audio.

Implemented in shaka::media::ffmpeg::FFmpegDemuxerFactory.

§ IsTypeSupported()

virtual bool shaka::media::DemuxerFactory::IsTypeSupported ( const std::string &  mime_type) const
pure virtual

Determines whether the given MIME type can be demuxed.

Parameters
mime_typeThe full MIME type to check.
Returns
True if the content can be demuxed, false otherwise.

Implemented in shaka::media::ffmpeg::FFmpegDemuxerFactory.

§ operator=() [1/2]

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

§ operator=() [2/2]

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

§ SetFactory()

void shaka::media::DemuxerFactory::SetFactory ( const DemuxerFactory factory)
static

Sets the current DemuxerFactory instance. This is used to query and create all future Demuxer instances. This can be changed at any time, but will only affect new Demuxer instances. Passing nullptr will reset to the default factory.

Parameters
factoryThe new DemuxerFactory instance to use.

Definition at line 67 of file demuxer.cc.


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