1 #include <MediaTrack.h> 2 #include "MediaPlugin.h" 3 4 namespace BPrivate { namespace media { 5 6 class Reader 7 { 8 public: 9 Reader(); 10 virtual ~Reader(); 11 12 virtual const char *Copyright() = 0; 13 14 virtual status_t Sniff(int32 *streamCount) = 0; 15 16 virtual status_t AllocateCookie(int32 streamNumber, void **cookie) = 0; 17 virtual status_t FreeCookie(void *cookie) = 0; 18 19 virtual status_t GetStreamInfo(void *cookie, int64 *frameCount, bigtime_t *duration, 20 media_format *format, void **infoBuffer, int32 *infoSize) = 0; 21 22 virtual status_t Seek(void *cookie, 23 media_seek_type seekTo, 24 int64 *frame, bigtime_t *time) = 0; 25 26 virtual status_t GetNextChunk(void *cookie, 27 void **chunkBuffer, int32 *chunkSize, 28 media_header *mediaHeader) = 0; 29 30 BDataIO * Source(); 31 32 private: 33 void Setup(BDataIO *source); 34 35 BDataIO * fSource; 36 }; 37 38 39 class ReaderPlugin : public MediaPlugin 40 { 41 public: 42 virtual Reader *NewReader() = 0; 43 }; 44 45 MediaPlugin *instantiate_plugin(); 46 47 } } // namespace BPrivate::media 48 49 using namespace BPrivate::media; 50 51