20 #ifndef GNASH_MEDIAPARSER_FFMPEG_H
21 #define GNASH_MEDIAPARSER_FFMPEG_H
23 #include <boost/scoped_array.hpp>
25 #include <boost/optional.hpp>
88 virtual bool seek(boost::uint32_t&);
96 virtual boost::optional<Id3Info>
getId3Info()
const;
102 void initializeParser();
109 size_t _nextVideoFrame;
116 size_t _nextAudioFrame;
122 bool parseNextFrame();
125 int readPacket(boost::uint8_t* buf,
int buf_size);
128 static int readPacketWrapper(
void* opaque, boost::uint8_t* buf,
int buf_size);
131 boost::int64_t seekMedia(boost::int64_t offset,
int whence);
134 static boost::int64_t seekMediaWrapper(
void *opaque, boost::int64_t offset,
int whence);
137 AVInputFormat* probeStream();
139 AVInputFormat* _inputFmt;
142 AVFormatContext *_formatCtx;
145 int _videoStreamIndex;
148 AVStream* _videoStream;
151 int _audioStreamIndex;
154 AVStream* _audioStream;
157 ByteIOContext _byteIOCxt;
164 static const size_t byteIOBufferSize = 1024;
166 boost::scoped_array<unsigned char> _byteIOBuffer;
169 boost::uint64_t _lastParsedPosition;
175 boost::uint16_t SampleFormatToSampleSize(SampleFormat fmt);
179 bool parseVideoFrame(AVPacket& packet);
182 bool parseAudioFrame(AVPacket& packet);
184 boost::optional<Id3Info> _id3Object;
192 #endif // __MEDIAPARSER_FFMPEG_H__