haiku/headers/os/media/MediaDecoder.h
Barrett17 278d03da22 media_kit: Remove most private dependencies from codec_kit
* Move to BCodecKit namespace and make extensive use
of BCodecRoster.
* This is a first step in the right direction of
decreasing private dependencies. Some APIs are being
translated to the CodecKit. I am doing an investigation
on which APIs are really used among apps, so that the new
kit can be more slim and oriented toward easy development
and can be extended in the right direction instead to
continue maintaning unuseful code.
* BMediaFormats needs still a bit of love.
* General improvements in style and code maintainability.
2018-11-27 11:38:05 +01:00

90 lines
3.1 KiB
C++

#ifndef MEDIADECODER_H
#define MEDIADECODER_H
#include <MediaFormats.h>
namespace BCodecKit {
class BDecoder;
}
class BMediaDecoder {
public:
BMediaDecoder();
BMediaDecoder(const media_format *in_format,
const void *info = NULL, size_t info_size = 0);
BMediaDecoder(const media_codec_info *mci);
virtual ~BMediaDecoder();
status_t InitCheck() const;
status_t SetTo(const media_format *in_format,
const void *info = NULL, size_t info_size = 0);
status_t SetTo(const media_codec_info *mci);
status_t SetInputFormat(const media_format *in_format,
const void *in_info = NULL, size_t in_size = 0);
status_t SetOutputFormat(media_format *output_format);
// Set output format to closest acceptable format, returns the
// format used.
status_t Decode(void *out_buffer, int64 *out_frameCount,
media_header *out_mh, media_decode_info *info);
status_t GetDecoderInfo(media_codec_info *out_info) const;
protected:
virtual status_t GetNextChunk(const void **chunkData, size_t *chunkLen,
media_header *mh) = 0;
private:
// unimplemented
BMediaDecoder(const BMediaDecoder &);
BMediaDecoder & operator=(const BMediaDecoder &);
status_t AttachToDecoder();
BCodecKit::BDecoder* fDecoder;
status_t fInitStatus;
/* fbc data and virtuals */
uint32 _reserved_BMediaDecoder_[33];
virtual status_t _Reserved_BMediaDecoder_0(int32 arg, ...);
virtual status_t _Reserved_BMediaDecoder_1(int32 arg, ...);
virtual status_t _Reserved_BMediaDecoder_2(int32 arg, ...);
virtual status_t _Reserved_BMediaDecoder_3(int32 arg, ...);
virtual status_t _Reserved_BMediaDecoder_4(int32 arg, ...);
virtual status_t _Reserved_BMediaDecoder_5(int32 arg, ...);
virtual status_t _Reserved_BMediaDecoder_6(int32 arg, ...);
virtual status_t _Reserved_BMediaDecoder_7(int32 arg, ...);
virtual status_t _Reserved_BMediaDecoder_8(int32 arg, ...);
virtual status_t _Reserved_BMediaDecoder_9(int32 arg, ...);
virtual status_t _Reserved_BMediaDecoder_10(int32 arg, ...);
virtual status_t _Reserved_BMediaDecoder_11(int32 arg, ...);
virtual status_t _Reserved_BMediaDecoder_12(int32 arg, ...);
virtual status_t _Reserved_BMediaDecoder_13(int32 arg, ...);
virtual status_t _Reserved_BMediaDecoder_14(int32 arg, ...);
virtual status_t _Reserved_BMediaDecoder_15(int32 arg, ...);
};
class BMediaBufferDecoder : public BMediaDecoder {
public:
BMediaBufferDecoder();
BMediaBufferDecoder(const media_format *in_format,
const void *info = NULL, size_t info_size = 0);
BMediaBufferDecoder(const media_codec_info *mci);
status_t DecodeBuffer(const void *input_buffer, size_t input_size,
void *out_buffer, int64 *out_frameCount,
media_header *out_mh,
media_decode_info *info = NULL);
protected:
virtual status_t GetNextChunk(const void **chunkData, size_t *chunkLen,
media_header *mh);
const void *fBuffer;
int32 fBufferSize;
};
#endif