Gnash
0.8.10
|
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. | |
virtual std::auto_ptr < MediaParser > | createMediaParser (std::auto_ptr< IOChannel > stream) |
Return an appropriate MediaParser for given input. | |
virtual std::auto_ptr < VideoDecoder > | createVideoDecoder (const VideoInfo &info)=0 |
Create a VideoDecoder for decoding what's specified in the VideoInfo. | |
virtual std::auto_ptr < AudioDecoder > | createAudioDecoder (const AudioInfo &info)=0 |
Create an AudioDecoder for decoding what's specified in the AudioInfo. | |
virtual std::auto_ptr < VideoConverter > | createVideoConverter (ImgBuf::Type4CC srcFormat, ImgBuf::Type4CC dstFormat)=0 |
Create an VideoConverter for converting between color spaces. | |
virtual VideoInput * | getVideoInput (size_t index)=0 |
Return a VideoInput. | |
virtual AudioInput * | getAudioInput (size_t index)=0 |
virtual void | cameraNames (std::vector< std::string > &names) const =0 |
Return a list of available cameras. | |
virtual size_t | getInputPaddingSize () const |
Return the number of bytes padding needed for input buffers. | |
Protected Member Functions | |
MediaHandler () | |
Base constructor. | |
std::auto_ptr< AudioDecoder > | createFlashAudioDecoder (const AudioInfo &info) |
Create an AudioDecoder for CODEC_TYPE_FLASH codecs. | |
bool | isFLV (IOChannel &stream) |
Return true if input stream is an FLV. |
The MediaHandler class acts as a factory to provide parser and decoders.
virtual gnash::media::MediaHandler::~MediaHandler | ( | ) | [inline, virtual] |
gnash::media::MediaHandler::MediaHandler | ( | ) | [inline, protected] |
Base constructor.
This is an abstract base class, so not instantiable anyway.
virtual void gnash::media::MediaHandler::cameraNames | ( | std::vector< std::string > & | names | ) | const [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.
virtual std::auto_ptr<AudioDecoder> gnash::media::MediaHandler::createAudioDecoder | ( | const AudioInfo & | info | ) | [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.
std::auto_ptr< AudioDecoder > gnash::media::MediaHandler::createFlashAudioDecoder | ( | const AudioInfo & | info | ) | [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 assert, gnash::media::AudioInfo::type, gnash::media::CODEC_TYPE_FLASH, gnash::media::AudioInfo::codec, gnash::media::AUDIO_CODEC_ADPCM, gnash::media::AUDIO_CODEC_RAW, gnash::media::AUDIO_CODEC_UNCOMPRESSED, gnash::media::AUDIO_CODEC_SPEEX, and _.
Referenced by gnash::media::ffmpeg::MediaHandlerFfmpeg::createAudioDecoder(), gnash::media::gst::MediaHandlerGst::createAudioDecoder(), and gnash::media::haiku::MediaHandlerHaiku::createAudioDecoder().
std::auto_ptr< MediaParser > gnash::media::MediaHandler::createMediaParser | ( | std::auto_ptr< IOChannel > | stream | ) | [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::haiku::MediaHandlerHaiku, gnash::media::ffmpeg::MediaHandlerFfmpeg, and gnash::media::gst::MediaHandlerGst.
References isFLV(), _, gnash::key::m, and assert.
virtual std::auto_ptr<VideoConverter> gnash::media::MediaHandler::createVideoConverter | ( | ImgBuf::Type4CC | srcFormat, |
ImgBuf::Type4CC | dstFormat | ||
) | [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.
virtual std::auto_ptr<VideoDecoder> gnash::media::MediaHandler::createVideoDecoder | ( | const VideoInfo & | info | ) | [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::Video::Video().
virtual std::string gnash::media::MediaHandler::description | ( | ) | const [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().
virtual AudioInput* gnash::media::MediaHandler::getAudioInput | ( | size_t | index | ) | [pure virtual] |
virtual size_t gnash::media::MediaHandler::getInputPaddingSize | ( | ) | const [inline, virtual] |
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::StreamSoundBlockTag::loader(), and gnash::SWF::define_sound_loader().
virtual VideoInput* gnash::media::MediaHandler::getVideoInput | ( | size_t | index | ) | [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.
bool gnash::media::MediaHandler::isFLV | ( | IOChannel & | stream | ) | [protected] |
Return true if input stream is an FLV.
If this cannot read the necessary 3 bytes, it throws an IOException.
References gnash::IOChannel::seek(), gnash::IOChannel::read(), _, and gnash::equal().
Referenced by createMediaParser(), gnash::media::ffmpeg::MediaHandlerFfmpeg::createMediaParser(), gnash::media::gst::MediaHandlerGst::createMediaParser(), and gnash::media::haiku::MediaHandlerHaiku::createMediaParser().