1 #ifndef _DECODER_PLUGIN_H 2 #define _DECODER_PLUGIN_H 3 4 #include <MediaTrack.h> 5 #include <MediaFormats.h> 6 #include "MediaPlugin.h" 7 8 class AddOnManager; 9 10 namespace BPrivate { namespace media { 11 12 class ChunkProvider { 13 public: 14 virtual status_t GetNextChunk(const void **chunkBuffer, size_t *chunkSize, 15 media_header *mediaHeader) = 0; 16 }; 17 18 class Decoder 19 { 20 public: 21 Decoder(); 22 virtual ~Decoder(); 23 24 virtual void GetCodecInfo(media_codec_info *codecInfo) = 0; 25 26 // Setup get's called with the info data from Reader::GetStreamInfo 27 virtual status_t Setup(media_format *ioEncodedFormat, const void *infoBuffer, size_t infoSize) = 0; 28 29 virtual status_t NegotiateOutputFormat(media_format *ioDecodedFormat) = 0; 30 31 virtual status_t Seek(uint32 seekTo, 32 int64 seekFrame, int64 *frame, 33 bigtime_t seekTime, bigtime_t *time) = 0; 34 35 virtual status_t Decode(void *buffer, int64 *frameCount, 36 media_header *mediaHeader, media_decode_info *info = 0) = 0; 37 38 status_t GetNextChunk(const void **chunkBuffer, size_t *chunkSize, 39 media_header *mediaHeader); 40 41 void Setup(ChunkProvider *provider); 42 private: 43 ChunkProvider * fChunkProvider; 44 }; 45 46 47 class DecoderPlugin : public virtual MediaPlugin 48 { 49 public: 50 DecoderPlugin(); 51 52 virtual Decoder *NewDecoder(uint index) = 0; 53 virtual status_t GetSupportedFormats(media_format ** formats, size_t * count) = 0; 54 }; 55 56 } } // namespace BPrivate::media 57 58 using namespace BPrivate::media; 59 60 #endif 61