MediaProcessors
Functions | Variables
audio_settings.c File Reference
#include "audio_settings.h"
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <libcjson/cJSON.h>
#include <libmediaprocsutils/uri_parser.h>
#include <libmediaprocsutils/log.h>
#include <libmediaprocsutils/stat_codes.h>
#include <libmediaprocsutils/check_utils.h>
#include <libmediaprocs/proc_if.h>
Include dependency graph for audio_settings.c:

Go to the source code of this file.

Functions

audio_settings_enc_ctx_taudio_settings_enc_ctx_allocate ()
 
void audio_settings_enc_ctx_release (audio_settings_enc_ctx_t **ref_audio_settings_enc_ctx)
 
int audio_settings_enc_ctx_init (volatile audio_settings_enc_ctx_t *audio_settings_enc_ctx)
 
void audio_settings_enc_ctx_deinit (volatile audio_settings_enc_ctx_t *audio_settings_enc_ctx)
 
int audio_settings_enc_ctx_cpy (const audio_settings_enc_ctx_t *audio_settings_enc_ctx_src, audio_settings_enc_ctx_t *audio_settings_enc_ctx_dst)
 
int audio_settings_enc_ctx_restful_put (volatile audio_settings_enc_ctx_t *audio_settings_enc_ctx, const char *str, log_ctx_t *log_ctx)
 
int audio_settings_enc_ctx_restful_get (volatile audio_settings_enc_ctx_t *audio_settings_enc_ctx, cJSON **ref_cjson_rest, log_ctx_t *log_ctx)
 
audio_settings_dec_ctx_taudio_settings_dec_ctx_allocate ()
 
void audio_settings_dec_ctx_release (audio_settings_dec_ctx_t **ref_audio_settings_dec_ctx)
 
int audio_settings_dec_ctx_init (volatile audio_settings_dec_ctx_t *audio_settings_dec_ctx)
 
void audio_settings_dec_ctx_deinit (volatile audio_settings_dec_ctx_t *audio_settings_dec_ctx)
 
int audio_settings_dec_ctx_cpy (const audio_settings_dec_ctx_t *audio_settings_dec_ctx_src, audio_settings_dec_ctx_t *audio_settings_dec_ctx_dst)
 
int audio_settings_dec_ctx_restful_put (volatile audio_settings_dec_ctx_t *audio_settings_dec_ctx, const char *str, log_ctx_t *log_ctx)
 
int audio_settings_dec_ctx_restful_get (volatile audio_settings_dec_ctx_t *audio_settings_dec_ctx, cJSON **ref_cjson_rest, log_ctx_t *log_ctx)
 

Variables

static const char * supported_samples_format_oput_array_dec []
 

Detailed Description

Author
Rafael Antoniello

Definition in file audio_settings.c.

Function Documentation

audio_settings_dec_ctx_t* audio_settings_dec_ctx_allocate ( )

Allocate generic audio decoder settings context structure.

Returns
Pointer to the generic audio decoder settings context structure.

Definition at line 218 of file audio_settings.c.

int audio_settings_dec_ctx_cpy ( const audio_settings_dec_ctx_t audio_settings_dec_ctx_src,
audio_settings_dec_ctx_t audio_settings_dec_ctx_dst 
)

Copy audio decoder generic settings members, duplicating any existent heap allocation.

Parameters
audio_settings_dec_ctx_srcPointer to the generic audio decoder settings context structure to be copied (namely, the source structure).
audio_settings_dec_ctx_dstPointer to the generic audio decoder settings context structure that holds the copy (namely, the destination structure).
Returns
Status code (STAT_SUCCESS code in case of success, for other code values please refer to .stat_codes.h).

Definition at line 275 of file audio_settings.c.

void audio_settings_dec_ctx_deinit ( volatile audio_settings_dec_ctx_t audio_settings_dec_ctx)

De-initialize audio decoder generic settings. This function release any heap-allocated field or structure member.

Parameters
audio_settings_dec_ctxPointer to the generic audio decoder settings context structure to be de-initialized.

Definition at line 256 of file audio_settings.c.

int audio_settings_dec_ctx_init ( volatile audio_settings_dec_ctx_t audio_settings_dec_ctx)

Initialize audio decoder generic settings to defaults.

Parameters
audio_settings_dec_ctxPointer to the generic audio decoder settings context structure to be initialized.
Returns
Status code (STAT_SUCCESS code in case of success, for other code values please refer to .stat_codes.h).

Definition at line 242 of file audio_settings.c.

void audio_settings_dec_ctx_release ( audio_settings_dec_ctx_t **  ref_audio_settings_dec_ctx)

Release generic audio decoder settings context structure previously allocated by 'audio_settings_dec_ctx_allocate()'.

Parameters
ref_audio_settings_dec_ctx

Definition at line 224 of file audio_settings.c.

int audio_settings_dec_ctx_restful_get ( volatile audio_settings_dec_ctx_t audio_settings_dec_ctx,
cJSON **  ref_cjson_rest,
log_ctx_t log_ctx 
)

Translate and get the audio decoder generic settings in a cJSON structure.

Parameters
audio_settings_dec_ctxPointer to the generic audio decoder settings context structure to be translated.
ref_cjson_restReference to a pointer to a cJSON structure in which the translated settings are returned (by argument).
log_ctxExternally defined LOG module context structure.
Returns
Status code (STAT_SUCCESS code in case of success, for other code values please refer to .stat_codes.h).

Definition at line 399 of file audio_settings.c.

int audio_settings_dec_ctx_restful_put ( volatile audio_settings_dec_ctx_t audio_settings_dec_ctx,
const char *  str,
log_ctx_t log_ctx 
)

Put new settings passed by argument in query-string or JSON format.

Parameters
audio_settings_dec_ctxPointer to the generic audio decoder settings context structure to be modified.
strNew parameters passed in query-string or JSON format.
log_ctxExternally defined LOG module context structure.
Returns
Status code (STAT_SUCCESS code in case of success, for other code values please refer to .stat_codes.h).

Definition at line 298 of file audio_settings.c.

audio_settings_enc_ctx_t* audio_settings_enc_ctx_allocate ( )

Allocate generic audio encoder settings context structure.

Returns
Pointer to the generic audio encoder settings context structure.

Definition at line 48 of file audio_settings.c.

int audio_settings_enc_ctx_cpy ( const audio_settings_enc_ctx_t audio_settings_enc_ctx_src,
audio_settings_enc_ctx_t audio_settings_enc_ctx_dst 
)

Copy audio encoder generic settings members, duplicating any existent heap allocation.

Parameters
audio_settings_enc_ctx_srcPointer to the generic audio encoder settings context structure to be copied (namely, the source structure).
audio_settings_enc_ctx_dstPointer to the generic audio encoder settings context structure that holds the copy (namely, the destination structure).
Returns
Status code (STAT_SUCCESS code in case of success, for other code values please refer to .stat_codes.h).

Definition at line 90 of file audio_settings.c.

void audio_settings_enc_ctx_deinit ( volatile audio_settings_enc_ctx_t audio_settings_enc_ctx)

De-initialize audio encoder generic settings. This function release any heap-allocated field or structure member.

Parameters
audio_settings_enc_ctxPointer to the generic audio encoder settings context structure to be de-initialized.

Definition at line 83 of file audio_settings.c.

int audio_settings_enc_ctx_init ( volatile audio_settings_enc_ctx_t audio_settings_enc_ctx)

Initialize audio encoder generic settings to defaults.

Parameters
audio_settings_enc_ctxPointer to the generic audio encoder settings context structure to be initialized.
Returns
Status code (STAT_SUCCESS code in case of success, for other code values please refer to .stat_codes.h).

Definition at line 69 of file audio_settings.c.

void audio_settings_enc_ctx_release ( audio_settings_enc_ctx_t **  ref_audio_settings_enc_ctx)

Release generic audio encoder settings context structure previously allocated by 'audio_settings_enc_ctx_allocate()'.

Parameters
ref_audio_settings_enc_ctx

Definition at line 54 of file audio_settings.c.

int audio_settings_enc_ctx_restful_get ( volatile audio_settings_enc_ctx_t audio_settings_enc_ctx,
cJSON **  ref_cjson_rest,
log_ctx_t log_ctx 
)

Translate and get the audio encoder generic settings in a cJSON structure.

Parameters
audio_settings_enc_ctxPointer to the generic audio encoder settings context structure to be translated.
ref_cjson_restReference to a pointer to a cJSON structure in which the translated settings are returned (by argument).
log_ctxExternally defined LOG module context structure.
Returns
Status code (STAT_SUCCESS code in case of success, for other code values please refer to .stat_codes.h).

Definition at line 173 of file audio_settings.c.

int audio_settings_enc_ctx_restful_put ( volatile audio_settings_enc_ctx_t audio_settings_enc_ctx,
const char *  str,
log_ctx_t log_ctx 
)

Put new settings passed by argument in query-string or JSON format.

Parameters
audio_settings_enc_ctxPointer to the generic audio encoder settings context structure to be modified.
strNew parameters passed in query-string or JSON format.
log_ctxExternally defined LOG module context structure.
Returns
Status code (STAT_SUCCESS code in case of success, for other code values please refer to .stat_codes.h).

Definition at line 109 of file audio_settings.c.

Variable Documentation

const char* supported_samples_format_oput_array_dec[]
static
Initial value:
= {
"planar_signed_16b",
"interleaved_signed_16b",
NULL
}

Array of character string specifying the supported sample-formats for the audio decoder output.

Definition at line 42 of file audio_settings.c.