Common encoder interface API prototypes.
More...
#include <stdint.h>
#include <stdio.h>
|
#define | CEI_ENCODER_ENCODEERR -1 |
| Common encoder error.
|
|
|
typedef int(* | CeiFnGetMemorySize) (uint8_t channels) |
| Defines a function returning a memory size to be allocated.
|
|
typedef int(* | CeiFnEncoderInit) (void *memory, uint32_t sampleRate, uint8_t channels) |
| Defines a function initializing an encoder.
|
|
typedef int(* | CeiFnEncoderGetConfig) (void *memory, void *config) |
| Defines a function retrieving encoder configuration.
|
|
typedef int(* | CeiFnEncoderSetConfig) (void *memory, void *config) |
| Defines a function applying configuration to an encoder.
|
|
typedef int(* | CeiFnEncode) (void *memory, BufferInfo *source, BufferInfo *dest) |
| Defines a function which encodes data in a given input buffer to a given output buffer. Input buffer will contain 16-bit signed interleaved little-endian samples (s16le).
|
|
◆ CeiFnGetMemorySize
typedef int(* CeiFnGetMemorySize) (uint8_t channels) |
- Parameters
-
channels | Number of channels, which the encoder will encode. |
- Returns
- The number of bytes to be allocated.
◆ CeiFnEncoderInit
typedef int(* CeiFnEncoderInit) (void *memory, uint32_t sampleRate, uint8_t channels) |
- Parameters
-
memory | Pointer to memory previously allocated to hold encoder structures. |
sampleRate | The source sample rate. |
channels | Number of channels which the encoder will encode. |
- Returns
- 0 if encoder was initialized successfully, anything other otherwise.
◆ CeiFnEncoderGetConfig
typedef int(* CeiFnEncoderGetConfig) (void *memory, void *config) |
- Parameters
-
memory | Pointer to previously allocated memory with encoder structures. Can be NULL if default configuration is desired. |
config | Pointer to an encoder-specific configuration structure. |
- Returns
- 0 if configuration gathered successfully, anything other otherwise.
◆ CeiFnEncoderSetConfig
typedef int(* CeiFnEncoderSetConfig) (void *memory, void *config) |
- Parameters
-
memory | Pointer to previously allocated memory with encoder structures. |
config | Pointer to an encoder-specific configuration structure. |
- Returns
- 0 if configuration applied successfully, anything other otherwise.
◆ CeiFnEncode
- Parameters
-
memory | Pointer to previously allocated memory with encoder structures. |
source | Contains information about the input buffer. |
dest | Contains information about the output buffer. |
- Returns
- Number of produced bytes or CEI_ENCODER_ENCODEERR. 0 constitutes an EOS condition.