1 /* 2 * Copyright 2009, Stephan Aßmus <superstippi@gmx.de> 3 * All rights reserved. Distributed under the terms of the GNU L-GPL license. 4 */ 5 #ifndef AV_FORMAT_READER_H 6 #define AV_FORMAT_READER_H 7 8 9 #include <Reader.h> 10 #include <Locker.h> 11 #include <String.h> 12 13 using namespace BCodecKit; 14 15 16 class AVFormatReader : public BReader { 17 public: 18 AVFormatReader(); 19 ~AVFormatReader(); 20 21 virtual status_t Sniff(int32* streamCount); 22 23 virtual void GetFileFormatInfo(media_file_format* mff); 24 virtual status_t GetMetaData(BMetaData* data); 25 26 virtual status_t AllocateCookie(int32 streamNumber, 27 void** cookie); 28 virtual status_t FreeCookie(void* cookie); 29 30 virtual status_t GetStreamInfo(void* cookie, int64* frameCount, 31 bigtime_t* duration, media_format* format, 32 const void** infoBuffer, 33 size_t* infoSize); 34 35 virtual status_t GetStreamMetaData(void* cookie, 36 BMetaData* data); 37 38 virtual status_t Seek(void* cookie, uint32 flags, int64* frame, 39 bigtime_t* time); 40 virtual status_t FindKeyFrame(void* cookie, uint32 flags, 41 int64* frame, bigtime_t* time); 42 43 virtual status_t GetNextChunk(void* cookie, 44 const void** chunkBuffer, 45 size_t* chunkSize, 46 media_header* mediaHeader); 47 48 private: 49 class Stream; 50 51 BString fCopyright; 52 Stream** fStreams; 53 BLocker fSourceLock; 54 }; 55 56 57 #endif // AV_FORMAT_READER_H 58