1 #include <MediaTrack.h> 2 #include "MediaPlugin.h" 3 4 namespace BPrivate { namespace media { 5 6 class Decoder 7 { 8 public: 9 Decoder(); 10 virtual ~Decoder(); 11 12 // Sniff get's called with the data from Reader::GetStreamInfo 13 virtual status_t Sniff(media_format *format, void **infoBuffer, int32 *infoSize) = 0; 14 15 virtual status_t GetOutputFormat(media_format *format) = 0; 16 17 virtual status_t Seek(media_seek_type seekTo, 18 int64 *frame, bigtime_t *time) = 0; 19 20 virtual status_t Decode(void *buffer, int64 *frameCount, 21 media_header *mediaHeader, media_decode_info *info) = 0; 22 23 status_t GetNextChunk(void **chunkBuffer, int32 *chunkSize, 24 media_header *mediaHeader); 25 26 private: 27 void Setup(BMediaTrack *reader); 28 BMediaTrack * fReader; 29 }; 30 31 32 class DecoderPlugin : public MediaPlugin 33 { 34 public: 35 virtual Decoder *NewDecoder() = 0; 36 }; 37 38 MediaPlugin *instantiate_plugin(); 39 40 } } // namespace BPrivate::media 41 42 using namespace BPrivate::media; 43 44