This file contains the CCI decoder interface APIs definitions.
More...
#include "audio_cfg.h"
#include "codec_interface.h"
#include <stdio.h>
|
int32_t | codec_get_io_frame_size (audio_stream_type_t stream_type, int32_t *in_size, int32_t *out_size) |
| codec get input/output frame size in bytes.
|
|
int32_t | codec_get_mem_info (audio_stream_type_t stream_type) |
| codec get memory information function.
|
|
int32_t | codec_init (audio_stream_type_t stream_type, int32_t *memory[], int32_t *callback_fn[], int32_t *user_data) |
| codec initialization function.
|
|
int32_t | codec_decode (audio_stream_type_t stream_type, int32_t *memory[], int32_t *sample_produced, int32_t *buf_out) |
| codec decoding function.
|
|
int32_t | codec_get_pcm_samples (audio_stream_type_t stream_type, int32_t *memory[], int32_t *sample_produced, int32_t *buf_out) |
| codec get pcm samples function.
|
|
int32_t | codec_reset (audio_stream_type_t stream_type, int32_t *memory[]) |
| codec reset function.
|
|
int32_t | codec_seek (audio_stream_type_t stream_type, int32_t *memory[], int32_t byte_to_seek) |
| codec seek function.
|
|
◆ codec_get_io_frame_size()
int32_t codec_get_io_frame_size |
( |
audio_stream_type_t | stream_type, |
|
|
int32_t * | in_size, |
|
|
int32_t * | out_size ) |
- Parameters
-
[in] | stream_type | Audio Stream Type. |
[out] | in_size | Input Frame Size. |
[out] | out_size | Output Frame Size. |
- Return values
-
0 | when actual input/output frame size in bytes of the codec is get through in_size, out_size pointers |
CODEC_UNSUPPORTED_FUNCTION | If this function is not supported for streamtype. |
◆ codec_get_mem_info()
- Parameters
-
[in] | stream_type | Audio Stream Type. |
- Return values
-
int | Size of the codec. |
CODEC_UNSUPPORTED_FUNCTION | If this function is not supported for streamtype. |
◆ codec_init()
int32_t codec_init |
( |
audio_stream_type_t | stream_type, |
|
|
int32_t * | memory[], |
|
|
int32_t * | callback_fn[], |
|
|
int32_t * | user_data ) |
- Parameters
-
[in] | stream_type | Audio Stream Type. |
[in] | memory | This is pointer to the decoder memory. |
[in] | callback_fn | This is pointer to the decoder callback functions. |
[in] | user_data | This is pointer to the user specific data. |
- Return values
-
CODEC_SUCCESS | if codec initializes successfully. |
CODEC_INIT_ERROR | if codec fails to initialize. |
CODEC_UNSUPPORTED_FUNCTION | If this function is not supported for streamtype |
◆ codec_decode()
int32_t codec_decode |
( |
audio_stream_type_t | stream_type, |
|
|
int32_t * | memory[], |
|
|
int32_t * | sample_produced, |
|
|
int32_t * | buf_out ) |
- Parameters
-
[in] | stream_type | Audio Stream Type. |
[in] | memory | This is pointer to the decoder memory. |
[in] | sample_produced | This is pointer to the samples produced by the codec. |
[in] | buf_out | This is pointer to the decoder output pcm buffer. |
- Return values
-
CODEC_SUCCESS | if codec decodes frame successfully. |
CODEC_DECODE_ERROR | if codec fails to decode frame. |
CODEC_END_OF_DECODE | if decoding of input file is done. |
CODEC_UNSUPPORTED_FUNCTION | If this function is not supported for streamtype |
◆ codec_get_pcm_samples()
int32_t codec_get_pcm_samples |
( |
audio_stream_type_t | stream_type, |
|
|
int32_t * | memory[], |
|
|
int32_t * | sample_produced, |
|
|
int32_t * | buf_out ) |
- Parameters
-
[in] | stream_type | Audio Stream Type. |
[in] | memory | This is pointer to the decoder memory. |
[in] | sample_produced | This is pointer to the samples produced by the codec. |
[in] | buf_out | This is pointer to the user specific data. |
- Return values
-
int32_t | It returns number of samples got from the codec. |
◆ codec_reset()
- Parameters
-
[in] | stream_type | Audio Stream Type. |
[in] | memory | This is pointer to the decoder memory. |
- Return values
-
CODEC_SUCCESS | if codec resets successfully. |
CODEC_RESET_ERROR | if codec fails to reset. |
CODEC_UNSUPPORTED_FUNCTION | If this function is not supported for streamtype |
◆ codec_seek()
int32_t codec_seek |
( |
audio_stream_type_t | stream_type, |
|
|
int32_t * | memory[], |
|
|
int32_t | byte_to_seek ) |
- Parameters
-
[in] | stream_type | Audio Stream Type. |
[in] | memory | Pointer to decoder memory allocated based on codec_get_mem_info() and passed in by caller. |
[in] | byte_to_seek | Number of bytes to seek. |
- Return values
-
int32_t | frame boundary align offset. |
CODEC_UNSUPPORTED_FUNCTION | If this function is not supported for streamtype |