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 return BMediaDecoder::SetTo(&in_format); 15 } 16 17 18 status_t 19 MediaStreamDecoder::SetOutputFormat(media_format *output_format) 20 { 21 status_t err = BMediaDecoder::InitCheck(); 22 if (err) 23 return err; 24 25 return BMediaDecoder::SetOutputFormat(output_format); 26 } 27 28 29 status_t 30 MediaStreamDecoder::Decode(void *out_buffer, int64 *out_frameCount, 31 media_header *out_mh, media_decode_info *info) 32 { 33 return BMediaDecoder::Decode(out_buffer, out_frameCount, out_mh, info); 34 } 35 36 37 status_t 38 MediaStreamDecoder::GetNextChunk(const void **chunkData, size_t *chunkLen, media_header *mh) 39 { 40 return (*fGetNextChunk)(chunkData, chunkLen, mh, fCookie); 41 } 42