Gnash
0.8.11dev
|
The MediaHandler class acts as a factory to provide parser and decoders. More...
#include <MediaHandler.h>
Public Member Functions | |
virtual | ~MediaHandler () |
virtual std::string | description () const =0 |
Return a description of this media handler. More... | |
virtual std::unique_ptr< MediaParser > | createMediaParser (std::unique_ptr< IOChannel > stream) |
Return an appropriate MediaParser for given input. More... | |
virtual std::unique_ptr< VideoDecoder > | createVideoDecoder (const VideoInfo &info)=0 |
Create a VideoDecoder for decoding what's specified in the VideoInfo. More... | |
virtual std::unique_ptr< AudioDecoder > | createAudioDecoder (const AudioInfo &info)=0 |
Create an AudioDecoder for decoding what's specified in the AudioInfo. More... | |
virtual std::unique_ptr< VideoConverter > | createVideoConverter (ImgBuf::Type4CC srcFormat, ImgBuf::Type4CC dstFormat)=0 |
Create an VideoConverter for converting between color spaces. More... | |
virtual VideoInput * | getVideoInput (size_t index)=0 |
Return a VideoInput. More... | |
virtual AudioInput * | getAudioInput (size_t index)=0 |
virtual void | cameraNames (std::vector< std::string > &names) const =0 |
Return a list of available cameras. More... | |
virtual size_t | getInputPaddingSize () const |
Return the number of bytes padding needed for input buffers. More... | |
Protected Member Functions | |
MediaHandler () | |
Base constructor. More... | |
std::unique_ptr< AudioDecoder > | createFlashAudioDecoder (const AudioInfo &info) |
Create an AudioDecoder for CODEC_TYPE_FLASH codecs. More... | |
bool | isFLV (IOChannel &stream) |
Return true if input stream is an FLV. More... | |
The MediaHandler class acts as a factory to provide parser and decoders.
|
inlinevirtual |
References names.
|
inlineprotected |
Base constructor.
This is an abstract base class, so not instantiable anyway.
|
pure virtual |
Return a list of available cameras.
This is re-generated every time the function is called.
Implemented in gnash::media::haiku::MediaHandlerHaiku, gnash::media::ffmpeg::MediaHandlerFfmpeg, and gnash::media::gst::MediaHandlerGst.
|
pure virtual |
Create an AudioDecoder for decoding what's specified in the AudioInfo.
info | AudioInfo class with all the info needed to decode the sound correctly. |
Implemented in gnash::media::haiku::MediaHandlerHaiku, gnash::media::ffmpeg::MediaHandlerFfmpeg, and gnash::media::gst::MediaHandlerGst.
Referenced by gnash::sound::LiveSound::LiveSound(), and gnash::NetStream_as::play().
|
protected |
Create an AudioDecoder for CODEC_TYPE_FLASH codecs.
This method is attempted as a fallback in case a mediahandler-specific audio decoder couldn't be created for a CODEC_TYPE_FLASH codec.
a | MediaException if it can't create a decoder |
info | Informations about the audio. It is required for info.type to be media::CODEC_TYPE_FLASH (caller should check that before calling this). |
References _, gnash::media::AUDIO_CODEC_ADPCM, gnash::media::AUDIO_CODEC_RAW, gnash::media::AUDIO_CODEC_SPEEX, gnash::media::AUDIO_CODEC_UNCOMPRESSED, gnash::media::AudioInfo::codec, gnash::media::CODEC_TYPE_FLASH, and gnash::media::AudioInfo::type.
Referenced by gnash::media::gst::MediaHandlerGst::createAudioDecoder(), gnash::media::ffmpeg::MediaHandlerFfmpeg::createAudioDecoder(), and gnash::media::haiku::MediaHandlerHaiku::createAudioDecoder().
|
virtual |
Return an appropriate MediaParser for given input.
stream | Input stream, ownership transferred |
NOTE: the default implementation returns an FLVParser for FLV input or 0 for others.
Reimplemented in gnash::media::ffmpeg::MediaHandlerFfmpeg, and gnash::media::gst::MediaHandlerGst.
References _, isFLV(), gnash::log_error(), and gnash::key::m.
Referenced by gnash::NetStream_as::play().
|
pure virtual |
Create an VideoConverter for converting between color spaces.
srcFormat | The source image color space |
dstFormat | The destination image color space |
Implemented in gnash::media::gst::MediaHandlerGst, gnash::media::haiku::MediaHandlerHaiku, and gnash::media::ffmpeg::MediaHandlerFfmpeg.
|
pure virtual |
Create a VideoDecoder for decoding what's specified in the VideoInfo.
info | VideoInfo class with all the info needed to decode the image stream correctly. |
Implemented in gnash::media::haiku::MediaHandlerHaiku, gnash::media::ffmpeg::MediaHandlerFfmpeg, and gnash::media::gst::MediaHandlerGst.
Referenced by gnash::NetStream_as::play().
|
pure virtual |
Return a description of this media handler.
Implemented in gnash::media::ffmpeg::MediaHandlerFfmpeg, gnash::media::haiku::MediaHandlerHaiku, and gnash::media::gst::MediaHandlerGst.
Referenced by gnash::GtkGui::showAboutDialog().
|
pure virtual |
|
inlinevirtual |
Return the number of bytes padding needed for input buffers.
Bitstream readers are optimized to read several bytes at a time, and this should be used to allocate a large enough input buffer.
Reimplemented in gnash::media::ffmpeg::MediaHandlerFfmpeg.
Referenced by gnash::SWF::define_sound_loader(), and gnash::SWF::StreamSoundBlockTag::loader().
|
pure virtual |
Return a VideoInput.
This is always owned by the MediaHandler, but will remain alive as long as it is referenced by a Camera object.
index | The index of the VideoInput to return. |
Implemented in gnash::media::haiku::MediaHandlerHaiku, gnash::media::ffmpeg::MediaHandlerFfmpeg, and gnash::media::gst::MediaHandlerGst.
|
protected |
Return true if input stream is an FLV.
If this cannot read the necessary 3 bytes, it throws an IOException.
References _, gnash::equal(), gnash::IOChannel::read(), and gnash::IOChannel::seek().
Referenced by gnash::media::gst::MediaHandlerGst::createMediaParser(), gnash::media::ffmpeg::MediaHandlerFfmpeg::createMediaParser(), gnash::media::haiku::MediaHandlerHaiku::createMediaParser(), and createMediaParser().