Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef GNASH_MEDIAHANDLER_H
00021 #define GNASH_MEDIAHANDLER_H
00022
00023 #include "MediaParser.h"
00024 #include "dsodefs.h"
00025 #include "VideoConverter.h"
00026 #include "GnashFactory.h"
00027
00028 #include <vector>
00029 #include <memory>
00030 #include <map>
00031 #include <string>
00032
00033
00034 namespace gnash {
00035 class IOChannel;
00036 namespace media {
00037 class VideoDecoder;
00038 class AudioDecoder;
00039 class AudioInfo;
00040 class VideoInfo;
00041 class VideoInput;
00042 class AudioInput;
00043 class MediaHandler;
00044 }
00045 }
00046
00047 namespace gnash {
00048
00050
00058 namespace media {
00059
00060 struct DSOEXPORT RegisterAllHandlers
00061 {
00062 RegisterAllHandlers();
00063 };
00064
00065 typedef GnashFactory<MediaHandler, RegisterAllHandlers> MediaFactory;
00066
00068 class DSOEXPORT MediaHandler
00069 {
00070 public:
00071
00072 virtual ~MediaHandler() {}
00073
00075 virtual std::string description() const = 0;
00076
00078
00087 virtual std::auto_ptr<MediaParser>
00088 createMediaParser(std::auto_ptr<IOChannel> stream);
00089
00091
00096 virtual std::auto_ptr<VideoDecoder>
00097 createVideoDecoder(const VideoInfo& info)=0;
00098
00100
00105 virtual std::auto_ptr<AudioDecoder>
00106 createAudioDecoder(const AudioInfo& info)=0;
00107
00109
00115 virtual std::auto_ptr<VideoConverter>
00116 createVideoConverter(ImgBuf::Type4CC srcFormat,
00117 ImgBuf::Type4CC dstFormat)=0;
00118
00120
00123
00127 virtual VideoInput* getVideoInput(size_t index) = 0;
00128
00129 virtual AudioInput* getAudioInput(size_t index) = 0;
00130
00132
00134 virtual void cameraNames(std::vector<std::string>& names) const = 0;
00135
00137
00140 virtual size_t getInputPaddingSize() const { return 0; }
00141
00142 protected:
00143
00145
00147 MediaHandler() {}
00148
00150
00162 std::auto_ptr<AudioDecoder> createFlashAudioDecoder(const AudioInfo& info);
00163
00165
00167 bool isFLV(IOChannel& stream) throw (IOException);
00168
00169 };
00170
00171
00172 }
00173 }
00174
00175 #endif