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 #if LIBAVFORMAT_VERSION_INT < AV_VERSION_INT(52,107,0)
160 ByteIOContext _byteIOCxt;
162 AVIOContext* _avIOCxt;
170 static const size_t byteIOBufferSize = 1024;
172 boost::scoped_array<unsigned char> _byteIOBuffer;
175 boost::uint64_t _lastParsedPosition;
181 boost::uint16_t SampleFormatToSampleSize(AVSampleFormat fmt);
185 bool parseVideoFrame(AVPacket& packet);
188 bool parseAudioFrame(AVPacket& packet);
190 boost::optional<Id3Info> _id3Object;
198 #endif // __MEDIAPARSER_FFMPEG_H__