Files
haiku-beta6/headers/os/codec/Decoder.h
T

95 lines
2.0 KiB
C++
Raw Normal View History

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