1 #ifndef __MEDIA_STREAM_DECODER_H 2 #define __MEDIA_STREAM_DECODER_H 3 4 #include <media/MediaDecoder.h> 5 #include "MediaStreamDecoder.h" 6 7 typedef status_t (*get_next_chunk_func)(const void **chunkData, size_t *chunkLen, media_header *mh, void *cookie); 8 9 10 class MediaStreamDecoder : private BMediaDecoder 11 { 12 public: 13 MediaStreamDecoder(get_next_chunk_func next_chunk, void *cookie); 14 15 status_t SetInputFormat(const media_format &in_format); 16 status_t SetOutputFormat(media_format *output_format); 17 18 status_t Decode(void *out_buffer, int64 *out_frameCount, 19 media_header *out_mh, media_decode_info *info); 20 21 private: 22 void * fCookie; 23 get_next_chunk_func fGetNextChunk; 24 25 private: 26 status_t GetNextChunk(const void **chunkData, size_t *chunkLen, media_header *mh); 27 }; 28 29 #endif 30