1 #include "DecoderPlugin.h" 2 3 class RawDecoder : public Decoder 4 { 5 public: 6 void GetCodecInfo(media_codec_info *info); 7 8 status_t Setup(media_format *ioEncodedFormat, 9 const void *infoBuffer, int32 infoSize); 10 11 status_t NegotiateOutputFormat(media_format *ioDecodedFormat); 12 13 status_t Seek(uint32 seekTo, 14 int64 seekFrame, int64 *frame, 15 bigtime_t seekTime, bigtime_t *time); 16 17 status_t Decode(void *buffer, int64 *frameCount, 18 media_header *mediaHeader, media_decode_info *info); 19 20 private: 21 status_t NegotiateVideoOutputFormat(media_format *ioDecodedFormat); 22 status_t NegotiateAudioOutputFormat(media_format *ioDecodedFormat); 23 24 private: 25 int32 fFrameRate; 26 int32 fInputFrameSize; 27 int32 fOutputFrameSize; 28 int32 fInputSampleSize; 29 int32 fOutputSampleSize; 30 int32 fOutputBufferFrameCount; 31 void (*fSwapInput)(void *data, int32 count); 32 void (*fConvert)(void *dst, void *src, int32 count); 33 void (*fSwapOutput)(void *data, int32 count); 34 35 char * fChunkBuffer; 36 int32 fChunkSize; 37 38 bigtime_t fStartTime; 39 40 media_format fInputFormat; 41 }; 42 43 44 class RawDecoderPlugin : public DecoderPlugin 45 { 46 public: 47 Decoder * NewDecoder(uint index); 48 status_t GetSupportedFormats(media_format ** formats, size_t * count); 49 }; 50