libosmocodec UNKNOWN
Osmocom codec library
Loading...
Searching...
No Matches
ecu.c File Reference
#include <string.h>
#include <errno.h>
#include <osmocom/codec/ecu.h>
#include <osmocom/core/talloc.h>

Functions

struct osmo_ecu_stateosmo_ecu_init (void *ctx, enum osmo_ecu_codec codec)
 initialize an ECU instance for given codec.
void osmo_ecu_destroy (struct osmo_ecu_state *st)
 destroy an ECU instance
int osmo_ecu_frame_in (struct osmo_ecu_state *st, bool bfi, const uint8_t *frame, unsigned int frame_bytes)
 process a received frame a substitute/erroneous frame.
int osmo_ecu_frame_out (struct osmo_ecu_state *st, uint8_t *frame_out)
 generate output data for a substitute/erroneous frame.
bool osmo_ecu_is_dtx_pause (struct osmo_ecu_state *st)
 check if the current state of this ECU is a DTX pause.
int osmo_ecu_register (const struct osmo_ecu_ops *ops, enum osmo_ecu_codec codec)
 register an ECU implementation for a given codec

Variables

static const struct osmo_ecu_opsg_ecu_ops [_NUM_OSMO_ECU_CODECS]

Function Documentation

◆ osmo_ecu_destroy()

void osmo_ecu_destroy ( struct osmo_ecu_state * st)

destroy an ECU instance

References osmo_ecu_state::codec, and g_ecu_ops.

◆ osmo_ecu_frame_in()

int osmo_ecu_frame_in ( struct osmo_ecu_state * st,
bool bfi,
const uint8_t * frame,
unsigned int frame_bytes )

process a received frame a substitute/erroneous frame.

Parameters
[in]stECU state/instance on which to operate
[in]bfiBad Frame Indication
[in]framereceived codec frame to be processed
[in]frame_bytesnumber of bytes available in frame

References osmo_ecu_state::codec, and g_ecu_ops.

◆ osmo_ecu_frame_out()

int osmo_ecu_frame_out ( struct osmo_ecu_state * st,
uint8_t * frame_out )

generate output data for a substitute/erroneous frame.

Parameters
[in]stECU state/instance on which to operate
[out]frame_outbuffer for generated output frame
Returns
number of bytes written to frame_out; negative on error

References osmo_ecu_state::codec, and g_ecu_ops.

◆ osmo_ecu_init()

struct osmo_ecu_state * osmo_ecu_init ( void * ctx,
enum osmo_ecu_codec codec )

initialize an ECU instance for given codec.

Parameters
[in]ctxtalloc context from which to allocate
[in]codeccodec for which to initialize/create ECU

References osmo_ecu_state::codec, and g_ecu_ops.

◆ osmo_ecu_is_dtx_pause()

bool osmo_ecu_is_dtx_pause ( struct osmo_ecu_state * st)

check if the current state of this ECU is a DTX pause.

Parameters
[in]stECU state/instance on which to operate
Returns
true if DTX pause, false otherwise

References osmo_ecu_state::codec, and g_ecu_ops.

◆ osmo_ecu_register()

int osmo_ecu_register ( const struct osmo_ecu_ops * ops,
enum osmo_ecu_codec codec )

register an ECU implementation for a given codec

References osmo_ecu_state::codec, and g_ecu_ops.

Referenced by __attribute__().

Variable Documentation

◆ g_ecu_ops