2012-03-17 06:59:21 +00:00
|
|
|
#ifndef GAME_SOUND_FFMPEG_DECODER_H
|
|
|
|
#define GAME_SOUND_FFMPEG_DECODER_H
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
|
|
|
|
extern "C"
|
|
|
|
{
|
|
|
|
#include <avcodec.h>
|
|
|
|
#include <avformat.h>
|
|
|
|
}
|
|
|
|
|
|
|
|
#include "sound_decoder.hpp"
|
|
|
|
|
|
|
|
|
|
|
|
namespace MWSound
|
|
|
|
{
|
|
|
|
class FFmpeg_Decoder : public Sound_Decoder
|
|
|
|
{
|
2012-03-18 18:47:15 +00:00
|
|
|
virtual void open(const std::string &fname);
|
|
|
|
virtual void close();
|
2012-03-17 06:59:21 +00:00
|
|
|
|
2012-03-18 18:47:15 +00:00
|
|
|
virtual void getInfo(int *samplerate, ChannelConfig *chans, SampleType *type);
|
2012-03-19 15:48:25 +00:00
|
|
|
|
2012-03-18 18:47:15 +00:00
|
|
|
virtual size_t read(char *buffer, size_t bytes);
|
2012-03-19 15:48:25 +00:00
|
|
|
virtual void rewind();
|
2012-03-17 09:51:46 +00:00
|
|
|
|
2012-03-17 06:59:21 +00:00
|
|
|
FFmpeg_Decoder();
|
|
|
|
virtual ~FFmpeg_Decoder();
|
|
|
|
|
|
|
|
friend class SoundManager;
|
|
|
|
};
|
|
|
|
#ifndef DEFAULT_DECODER
|
|
|
|
#define DEFAULT_DECODER (::MWSound::FFmpeg_Decoder)
|
|
|
|
#endif
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|