1 #include "MediaStreamDecoder.h" 2 3 MediaStreamDecoder::MediaStreamDecoder(get_next_chunk_func next_chunk, void *cookie) 4 : BMediaDecoder() 5 , fCookie(cookie) 6 , fGetNextChunk(next_chunk) 7 { 8 } 9 10 11 status_t 12 MediaStreamDecoder::SetInputFormat(const media_format &in_format) 13 { 14 status_t err = BMediaDecoder::InitCheck(); 15 if (err) 16 return err; 17 18 return BMediaDecoder::SetTo(&in_format); 19 } 20 21 22 status_t 23 MediaStreamDecoder::SetOutputFormat(media_format *output_format) 24 { 25 status_t err = BMediaDecoder::InitCheck(); 26 if (err) 27 return err; 28 29 return BMediaDecoder::SetOutputFormat(output_format); 30 } 31 32 33 status_t 34 MediaStreamDecoder::Decode(void *out_buffer, int64 *out_frameCount, 35 media_header *out_mh, media_decode_info *info) 36 { 37 return BMediaDecoder::Decode(out_buffer, out_frameCount, out_mh, info); 38 } 39 40 41 status_t 42 MediaStreamDecoder::GetNextChunk(const void **chunkData, size_t *chunkLen, media_header *mh) 43 { 44 return (*fGetNextChunk)(chunkData, chunkLen, mh, fCookie); 45 } 46