MediaProcessors
|
Generic processor module context (see type proc_ctx_t) extension for audio encoders and decoders. More...
#include <libmediaprocsutils/mem_utils.h>
#include <libmediaprocs/proc.h>
Go to the source code of this file.
Classes | |
struct | ffmpeg_audio_enc_ctx_s |
struct | ffmpeg_audio_dec_ctx_s |
Typedefs | |
typedef struct AVCodec | AVCodec |
typedef struct AVCodecContext | AVCodecContext |
typedef struct AVFrame | AVFrame |
typedef struct AVPacket | AVPacket |
typedef struct audio_settings_enc_ctx_s | audio_settings_enc_ctx_t |
typedef struct audio_settings_dec_ctx_s | audio_settings_dec_ctx_t |
typedef struct ffmpeg_audio_enc_ctx_s | ffmpeg_audio_enc_ctx_t |
typedef struct ffmpeg_audio_dec_ctx_s | ffmpeg_audio_dec_ctx_t |
Functions | |
int | ffmpeg_audio_enc_ctx_init (ffmpeg_audio_enc_ctx_t *ffmpeg_audio_enc_ctx, int avcodecid, const audio_settings_enc_ctx_t *audio_settings_enc_ctx, log_ctx_t *log_ctx) |
void | ffmpeg_audio_enc_ctx_deinit (ffmpeg_audio_enc_ctx_t *ffmpeg_audio_enc_ctx, log_ctx_t *log_ctx) |
int | ffmpeg_audio_enc_frame (ffmpeg_audio_enc_ctx_t *ffmpeg_audio_enc_ctx, AVFrame *avframe_iput, fifo_ctx_t *oput_fifo_ctx, log_ctx_t *log_ctx) |
int | ffmpeg_audio_dec_ctx_init (ffmpeg_audio_dec_ctx_t *ffmpeg_audio_dec_ctx, int avcodecid, const audio_settings_dec_ctx_t *audio_settings_dec_ctx, log_ctx_t *log_ctx) |
void | ffmpeg_audio_dec_ctx_deinit (ffmpeg_audio_dec_ctx_t *ffmpeg_audio_dec_ctx, log_ctx_t *log_ctx) |
int | ffmpeg_audio_dec_frame (ffmpeg_audio_dec_ctx_t *ffmpeg_audio_dec_ctx, AVPacket *avpacket_iput, fifo_ctx_t *oput_fifo_ctx, log_ctx_t *log_ctx) |
void | ffmpeg_audio_reset_on_new_settings (proc_ctx_t *proc_ctx, volatile void *audio_settings_opaque, int flag_is_encoder, log_ctx_t *log_ctx) |
Generic processor module context (see type proc_ctx_t) extension for audio encoders and decoders.
Definition in file ffmpeg_audio.h.
typedef struct ffmpeg_audio_dec_ctx_s ffmpeg_audio_dec_ctx_t |
FFmpeg audio decoding common context structure.
typedef struct ffmpeg_audio_enc_ctx_s ffmpeg_audio_enc_ctx_t |
FFmpeg audio encoding common context structure.
void ffmpeg_audio_dec_ctx_deinit | ( | ffmpeg_audio_dec_ctx_t * | ffmpeg_audio_dec_ctx, |
log_ctx_t * | log_ctx | ||
) |
De-initialize FFmpeg's audio decoding common context structure previously allocated by a call to 'ffmpeg_audio_dec_ctx_init()'. This function release any heap-allocated field or structure member.
ffmpeg_audio_dec_ctx | Pointer to the audio decoding common context structure to be de-initialized. |
log_ctx | Externally defined LOG module context structure. |
Definition at line 301 of file ffmpeg_audio.c.
int ffmpeg_audio_dec_ctx_init | ( | ffmpeg_audio_dec_ctx_t * | ffmpeg_audio_dec_ctx, |
int | avcodecid, | ||
const audio_settings_dec_ctx_t * | audio_settings_dec_ctx, | ||
log_ctx_t * | log_ctx | ||
) |
Initialize FFmpeg's audio decoding common context structure.
ffmpeg_audio_dec_ctx | Pointer to the audio decoding common context structure to be initialized. |
avcodecid | Unambiguous decoder identifier (namely, the decoder type Id.). |
audio_settings_dec_ctx | Pointer to the initial generic audio decoder settings context structure. |
log_ctx | Externally defined LOG module context structure. |
Definition at line 229 of file ffmpeg_audio.c.
int ffmpeg_audio_dec_frame | ( | ffmpeg_audio_dec_ctx_t * | ffmpeg_audio_dec_ctx, |
AVPacket * | avpacket_iput, | ||
fifo_ctx_t * | oput_fifo_ctx, | ||
log_ctx_t * | log_ctx | ||
) |
Decode a complete audio frame. If an output frame is produced, is written to the output FIFO buffer.
ffmpeg_audio_dec_ctx | Pointer to the audio decoding common context structure. |
avpacket_iput | Pointer to the (FFmpeg's) input packet structure. |
oput_fifo_ctx | Pointer to the output FIFO buffer context structure. |
log_ctx | Externally defined LOG module context structure. |
Definition at line 311 of file ffmpeg_audio.c.
void ffmpeg_audio_enc_ctx_deinit | ( | ffmpeg_audio_enc_ctx_t * | ffmpeg_audio_enc_ctx, |
log_ctx_t * | log_ctx | ||
) |
De-initialize FFmpeg's audio encoding common context structure previously allocated by a call to 'ffmpeg_audio_enc_ctx_init()'. This function release any heap-allocated field or structure member.
ffmpeg_audio_enc_ctx | Pointer to the audio encoding common context structure to be de-initialized. |
log_ctx | Externally defined LOG module context structure. |
Definition at line 139 of file ffmpeg_audio.c.
int ffmpeg_audio_enc_ctx_init | ( | ffmpeg_audio_enc_ctx_t * | ffmpeg_audio_enc_ctx, |
int | avcodecid, | ||
const audio_settings_enc_ctx_t * | audio_settings_enc_ctx, | ||
log_ctx_t * | log_ctx | ||
) |
Initialize FFmpeg's audio encoding common context structure.
ffmpeg_audio_enc_ctx | Pointer to the audio encoding common context structure to be initialized. |
avcodecid | Unambiguous encoder identifier (namely, the encoder type Id.). |
audio_settings_enc_ctx | Pointer to the initial generic audio encoder settings context structure. |
log_ctx | Externally defined LOG module context structure. |
Definition at line 55 of file ffmpeg_audio.c.
int ffmpeg_audio_enc_frame | ( | ffmpeg_audio_enc_ctx_t * | ffmpeg_audio_enc_ctx, |
AVFrame * | avframe_iput, | ||
fifo_ctx_t * | oput_fifo_ctx, | ||
log_ctx_t * | log_ctx | ||
) |
Encode a complete audio frame. If an output frame is produced, is written to the output FIFO buffer.
ffmpeg_audio_enc_ctx | Pointer to the audio encoding common context structure. |
avframe_iput | Pointer to the (FFmpeg's) input frame structure. |
oput_fifo_ctx | Pointer to the output FIFO buffer context structure. |
log_ctx | Externally defined LOG module context structure. |
Definition at line 149 of file ffmpeg_audio.c.
void ffmpeg_audio_reset_on_new_settings | ( | proc_ctx_t * | proc_ctx, |
volatile void * | audio_settings_opaque, | ||
int | flag_is_encoder, | ||
log_ctx_t * | log_ctx | ||
) |
FFmpeg audio CODECS are not generally designed to accept changing settings on run-time. Thus, we have to reset (that is, de-initialize and re-initialize) the CODEC to set new settings while running the processor.
proc_ctx | Pointer to the processor (PROC) context structure |
audio_settings_opaque | Opaque pointer to be casted either to an encoder or decoder audio settings context structure. |
flag_is_encoder | Set to non-zero to signal that we are resetting an encoder, set to zero to identify a decoder. |
log_ctx | Pointer to the LOG module context structure. |
Definition at line 392 of file ffmpeg_audio.c.