2003-11-24 02:50:27 +03:00
|
|
|
#ifndef _DECODER_PLUGIN_H
|
|
|
|
#define _DECODER_PLUGIN_H
|
|
|
|
|
2018-10-28 17:45:44 +03:00
|
|
|
|
2003-10-18 03:55:19 +04:00
|
|
|
#include <MediaTrack.h>
|
2003-11-23 21:17:35 +03:00
|
|
|
#include <MediaFormats.h>
|
2018-10-29 11:41:21 +03:00
|
|
|
|
2003-10-18 03:55:19 +04:00
|
|
|
#include "MediaPlugin.h"
|
|
|
|
|
2003-12-14 22:23:16 +03:00
|
|
|
|
2018-11-26 15:18:35 +03:00
|
|
|
namespace BCodecKit {
|
|
|
|
|
|
|
|
namespace BPrivate {
|
|
|
|
class PluginManager;
|
|
|
|
}
|
2003-10-18 03:55:19 +04:00
|
|
|
|
2009-06-07 22:11:05 +04:00
|
|
|
|
2018-11-25 14:40:49 +03:00
|
|
|
class BChunkProvider {
|
2004-01-18 10:37:21 +03:00
|
|
|
public:
|
2018-11-25 16:07:46 +03:00
|
|
|
BChunkProvider();
|
|
|
|
virtual ~BChunkProvider();
|
|
|
|
|
|
|
|
protected:
|
|
|
|
friend class BDecoder;
|
|
|
|
|
2009-06-07 22:11:05 +04:00
|
|
|
virtual status_t GetNextChunk(const void** chunkBuffer,
|
|
|
|
size_t* chunkSize,
|
|
|
|
media_header* mediaHeader) = 0;
|
2004-01-18 10:37:21 +03:00
|
|
|
};
|
|
|
|
|
2018-10-28 18:14:25 +03:00
|
|
|
|
2018-11-25 14:40:49 +03:00
|
|
|
class BDecoder {
|
2003-10-18 03:55:19 +04:00
|
|
|
public:
|
2009-06-07 22:11:05 +04:00
|
|
|
virtual void GetCodecInfo(media_codec_info* codecInfo) = 0;
|
2004-01-23 10:24:51 +03:00
|
|
|
|
2009-06-07 22:11:05 +04:00
|
|
|
// Setup get's called with the info data from Reader::GetStreamInfo
|
|
|
|
virtual status_t Setup(media_format* ioEncodedFormat,
|
|
|
|
const void* infoBuffer,
|
|
|
|
size_t infoSize) = 0;
|
2003-12-07 02:21:23 +03:00
|
|
|
|
2009-06-07 22:11:05 +04:00
|
|
|
virtual status_t NegotiateOutputFormat(
|
|
|
|
media_format* ioDecodedFormat) = 0;
|
2003-10-18 03:55:19 +04:00
|
|
|
|
2010-09-18 18:44:22 +04:00
|
|
|
virtual status_t SeekedTo(int64 frame, bigtime_t time) = 0;
|
2003-10-18 03:55:19 +04:00
|
|
|
|
2009-06-07 22:11:05 +04:00
|
|
|
virtual status_t Decode(void* buffer, int64* frameCount,
|
|
|
|
media_header* mediaHeader,
|
|
|
|
media_decode_info* info = 0) = 0;
|
2003-10-18 03:55:19 +04:00
|
|
|
|
2009-06-07 22:11:05 +04:00
|
|
|
status_t GetNextChunk(const void** chunkBuffer,
|
|
|
|
size_t* chunkSize,
|
|
|
|
media_header* mediaHeader);
|
|
|
|
|
2018-11-25 14:40:49 +03:00
|
|
|
void SetChunkProvider(BChunkProvider* provider);
|
2009-06-07 22:11:05 +04:00
|
|
|
|
2018-11-18 14:05:48 +03:00
|
|
|
virtual status_t Perform(perform_code code, void* data);
|
|
|
|
|
2018-11-22 11:27:54 +03:00
|
|
|
protected:
|
2018-11-25 14:40:49 +03:00
|
|
|
BDecoder();
|
|
|
|
virtual ~BDecoder();
|
2018-11-22 11:27:54 +03:00
|
|
|
|
|
|
|
|
2003-10-18 03:55:19 +04:00
|
|
|
private:
|
2018-11-25 14:40:49 +03:00
|
|
|
BChunkProvider* fChunkProvider;
|
2009-06-07 22:11:05 +04:00
|
|
|
|
2018-11-25 14:40:49 +03:00
|
|
|
BMediaPlugin* fMediaPlugin;
|
2018-10-29 11:41:21 +03:00
|
|
|
|
2009-06-07 22:11:05 +04:00
|
|
|
// needed for plug-in reference count management
|
2018-11-26 15:18:35 +03:00
|
|
|
friend class BCodecKit::BPrivate::PluginManager;
|
2009-06-07 22:11:05 +04:00
|
|
|
|
2018-10-28 17:45:44 +03:00
|
|
|
virtual void _ReservedDecoder1();
|
|
|
|
virtual void _ReservedDecoder2();
|
|
|
|
virtual void _ReservedDecoder3();
|
|
|
|
virtual void _ReservedDecoder4();
|
|
|
|
virtual void _ReservedDecoder5();
|
|
|
|
|
2009-06-07 22:11:05 +04:00
|
|
|
uint32 fReserved[5];
|
2003-10-18 03:55:19 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2018-11-25 14:40:49 +03:00
|
|
|
class BDecoderPlugin : public virtual BMediaPlugin {
|
2009-06-07 22:11:05 +04:00
|
|
|
public:
|
2018-11-25 14:40:49 +03:00
|
|
|
BDecoderPlugin();
|
2003-11-23 21:17:35 +03:00
|
|
|
|
2018-11-25 14:40:49 +03:00
|
|
|
virtual BDecoder* NewDecoder(uint index) = 0;
|
2009-06-07 22:11:05 +04:00
|
|
|
virtual status_t GetSupportedFormats(media_format** formats,
|
2009-07-29 20:24:00 +04:00
|
|
|
size_t* count) = 0;
|
2003-10-18 03:55:19 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2018-11-26 15:18:35 +03:00
|
|
|
} // namespace BCodecKit
|
|
|
|
|
2003-11-24 02:50:27 +03:00
|
|
|
|
2009-06-07 22:11:05 +04:00
|
|
|
#endif // _DECODER_PLUGIN_H
|