2003-11-24 02:50:27 +03:00
|
|
|
#ifndef _DECODER_PLUGIN_H
|
|
|
|
#define _DECODER_PLUGIN_H
|
|
|
|
|
2003-10-18 03:55:19 +04:00
|
|
|
#include <MediaTrack.h>
|
2003-11-23 21:17:35 +03:00
|
|
|
#include <MediaFormats.h>
|
2003-10-18 03:55:19 +04:00
|
|
|
#include "MediaPlugin.h"
|
|
|
|
|
2003-12-14 22:23:16 +03:00
|
|
|
class AddOnManager;
|
|
|
|
|
2003-10-18 03:55:19 +04:00
|
|
|
namespace BPrivate { namespace media {
|
|
|
|
|
2004-01-18 10:37:21 +03:00
|
|
|
class ChunkProvider {
|
|
|
|
public:
|
|
|
|
virtual status_t GetNextChunk(void **chunkBuffer, int32 *chunkSize,
|
|
|
|
media_header *mediaHeader) = 0;
|
|
|
|
};
|
|
|
|
|
2003-10-18 03:55:19 +04:00
|
|
|
class Decoder
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
Decoder();
|
|
|
|
virtual ~Decoder();
|
2004-01-23 10:24:51 +03:00
|
|
|
|
2004-01-31 04:00:11 +03:00
|
|
|
virtual void GetCodecInfo(media_codec_info *codecInfo) = 0;
|
2004-01-23 10:24:51 +03:00
|
|
|
|
2003-11-23 21:17:35 +03:00
|
|
|
// Setup get's called with the info data from Reader::GetStreamInfo
|
2003-12-07 02:21:23 +03:00
|
|
|
virtual status_t Setup(media_format *ioEncodedFormat, const void *infoBuffer, int32 infoSize) = 0;
|
|
|
|
|
|
|
|
virtual status_t NegotiateOutputFormat(media_format *ioDecodedFormat) = 0;
|
2003-10-18 03:55:19 +04:00
|
|
|
|
2003-11-24 01:19:21 +03:00
|
|
|
virtual status_t Seek(uint32 seekTo,
|
2003-11-23 21:17:35 +03:00
|
|
|
int64 seekFrame, int64 *frame,
|
|
|
|
bigtime_t seekTime, bigtime_t *time) = 0;
|
2003-10-18 03:55:19 +04:00
|
|
|
|
|
|
|
virtual status_t Decode(void *buffer, int64 *frameCount,
|
2003-11-24 01:19:21 +03:00
|
|
|
media_header *mediaHeader, media_decode_info *info = 0) = 0;
|
2003-10-18 03:55:19 +04:00
|
|
|
|
|
|
|
status_t GetNextChunk(void **chunkBuffer, int32 *chunkSize,
|
|
|
|
media_header *mediaHeader);
|
|
|
|
|
2004-01-18 10:37:21 +03:00
|
|
|
void Setup(ChunkProvider *provider);
|
2003-10-18 03:55:19 +04:00
|
|
|
private:
|
2004-01-18 10:37:21 +03:00
|
|
|
ChunkProvider * fChunkProvider;
|
2003-10-18 03:55:19 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2004-01-18 05:42:10 +03:00
|
|
|
class DecoderPlugin : public virtual MediaPlugin
|
2003-10-18 03:55:19 +04:00
|
|
|
{
|
2004-01-23 10:24:51 +03:00
|
|
|
public:
|
|
|
|
DecoderPlugin();
|
2003-11-23 21:17:35 +03:00
|
|
|
|
2004-02-02 08:26:40 +03:00
|
|
|
virtual Decoder *NewDecoder(uint index) = 0;
|
|
|
|
virtual status_t GetSupportedFormats(media_format ** formats, size_t * count) = 0;
|
2003-10-18 03:55:19 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
} } // namespace BPrivate::media
|
|
|
|
|
|
|
|
using namespace BPrivate::media;
|
2003-11-24 02:50:27 +03:00
|
|
|
|
|
|
|
#endif
|