vfs: check userland buffers before reading them.
[haiku.git] / src / add-ons / media / media-add-ons / dvb / MediaStreamDecoder.h
blobc77e5408945bb25e443fcd8d041d28d1bee1dc80
1 #ifndef __MEDIA_STREAM_DECODER_H
2 #define __MEDIA_STREAM_DECODER_H
4 #include <media/MediaDecoder.h>
5 #include "MediaStreamDecoder.h"
7 typedef status_t (*get_next_chunk_func)(const void **chunkData, size_t *chunkLen, media_header *mh, void *cookie);
10 class MediaStreamDecoder : private BMediaDecoder
12 public:
13 MediaStreamDecoder(get_next_chunk_func next_chunk, void *cookie);
15 status_t SetInputFormat(const media_format &in_format);
16 status_t SetOutputFormat(media_format *output_format);
18 status_t Decode(void *out_buffer, int64 *out_frameCount,
19 media_header *out_mh, media_decode_info *info);
21 private:
22 void * fCookie;
23 get_next_chunk_func fGetNextChunk;
25 private:
26 status_t GetNextChunk(const void **chunkData, size_t *chunkLen, media_header *mh);
29 #endif