API Documentation

BMediaBufferDecoder

BMediaBufferDecoder

Constructor and Destructor

BMediaBufferDecoder()

BMediaBufferDecoder::BMediaBufferDecoder()
BMediaBufferDecoder::BMediaBufferDecoder(const media_format *inFormat, const void *info = NULL, size_t infoSize = 0)
BMediaBufferDecoder::BMediaBufferDecoder(const media_codec_info *mci)

The constructor sets up the BMediaBufferDecoder. If you use the empty form of the constructor, you’ll have to call SetTo() to establish the format to be decoded before calling Decode().

The second form accepts a media_format structure, inFormat, that indicates the type of media data that will be input into the decoder. info, if specified, will be filled out with text information about the node; you must specify a buffer infoSize bytes long.

The third form of the constructor accepts a media_codec_info structure, mci, that determines which codec should be used.

Note

If you use either the media_format or media_codec_info form of the constructor, you must call InitCheck() to ensure that construction was successful before using any other functions in this class.

~BMediaBufferDecoder()

virtual BMediaBufferDecoder::~BMediaBufferDecoder()

Releases the decoder add-on being used by the BMediaBufferDecoder.

Member Functions

DecodeBuffer()

status_t BMediaBufferDecoder::DecodeBuffer(const void *inputBuffer, size_t inputSize, void *outBuffer, int64 *outFrameCount, media_header *outMH, media_decode_info *info)

Decodes a chunk of media data from the input buffer inputBuffer into the output buffer specified by outBuffer. The input buffer contains inputSize bytes of media data. On return, outFrameCount is set to indicate how many frames of data were decoded, and outMH is the header for the decoded buffer.

The media_decode_info structure info is used on input to specify decoding parameters.

Return Code

Description

B_OK

No error.

Other errors.

The decoder’s Decode() function can return errors.

GetNextChunk()

status_t BMediaBufferDecoder::GetNextChunk(const void **chunkData, size_t *chunkLen, media_header *mh) = 0

Implementation detail. This function is implemented to fetch memory from the input buffer specified by the call to DecodeBuffer().

InitCheck()

status_t BMediaBufferDecoder::InitCheck() const

Returns a status_t value indicating whether or not construction was successful. You must call this function after construction before calling any other BMediaBufferDecoder functions.

Return Code

Description

B_OK

The constructor was successful.

Other errors.

See BMediaDecoder’s SetTo() function.