MediaProcessors
|
Generic processor module context (see type proc_ctx_t) extension for video encoders and decoders. More...
#include <libmediaprocsutils/mem_utils.h>
#include <libmediaprocs/proc.h>
Go to the source code of this file.
Classes | |
struct | ffmpeg_video_enc_ctx_s |
struct | ffmpeg_video_dec_ctx_s |
Macros | |
#define | SCALE_FLAGS SWS_BICUBIC |
Typedefs | |
typedef struct AVCodec | AVCodec |
typedef struct AVCodecContext | AVCodecContext |
typedef struct AVFrame | AVFrame |
typedef struct AVPacket | AVPacket |
typedef struct AVDictionary | AVDictionary |
typedef struct SwsContext | SwsContext |
typedef struct video_settings_enc_ctx_s | video_settings_enc_ctx_t |
typedef struct video_settings_dec_ctx_s | video_settings_dec_ctx_t |
typedef struct ffmpeg_video_enc_ctx_s | ffmpeg_video_enc_ctx_t |
typedef struct ffmpeg_video_dec_ctx_s | ffmpeg_video_dec_ctx_t |
Functions | |
int | ffmpeg_video_enc_ctx_init (ffmpeg_video_enc_ctx_t *ffmpeg_video_enc_ctx, int avcodecid, const video_settings_enc_ctx_t *video_settings_enc_ctx, log_ctx_t *log_ctx) |
void | ffmpeg_video_enc_ctx_deinit (ffmpeg_video_enc_ctx_t *ffmpeg_video_enc_ctx, log_ctx_t *log_ctx) |
int | ffmpeg_video_enc_frame (ffmpeg_video_enc_ctx_t *ffmpeg_video_enc_ctx, AVFrame *avframe_iput, fifo_ctx_t *oput_fifo_ctx, log_ctx_t *log_ctx) |
int | ffmpeg_video_dec_ctx_init (ffmpeg_video_dec_ctx_t *ffmpeg_video_dec_ctx, int avcodecid, const video_settings_dec_ctx_t *video_settings_dec_ctx, log_ctx_t *log_ctx) |
void | ffmpeg_video_dec_ctx_deinit (ffmpeg_video_dec_ctx_t *ffmpeg_video_dec_ctx, log_ctx_t *log_ctx) |
int | ffmpeg_video_dec_frame (ffmpeg_video_dec_ctx_t *ffmpeg_video_dec_ctx, AVPacket *avpacket_iput, fifo_ctx_t *oput_fifo_ctx, log_ctx_t *log_ctx) |
void | ffmpeg_video_reset_on_new_settings (proc_ctx_t *proc_ctx, volatile void *video_settings_opaque, int flag_is_encoder, log_ctx_t *log_ctx) |
Generic processor module context (see type proc_ctx_t) extension for video encoders and decoders.
Definition in file ffmpeg_video.h.
typedef struct ffmpeg_video_dec_ctx_s ffmpeg_video_dec_ctx_t |
FFmpeg video decoding common context structure.
typedef struct ffmpeg_video_enc_ctx_s ffmpeg_video_enc_ctx_t |
FFmpeg video encoding common context structure.
void ffmpeg_video_dec_ctx_deinit | ( | ffmpeg_video_dec_ctx_t * | ffmpeg_video_dec_ctx, |
log_ctx_t * | log_ctx | ||
) |
De-initialize FFmpeg's video decoding common context structure previously allocated by a call to 'ffmpeg_video_dec_ctx_init()'. This function release any heap-allocated field or structure member.
ffmpeg_video_dec_ctx | Pointer to the video decoding common context structure to be de-initialized. |
log_ctx | Externally defined LOG module context structure. |
Definition at line 403 of file ffmpeg_video.c.
int ffmpeg_video_dec_ctx_init | ( | ffmpeg_video_dec_ctx_t * | ffmpeg_video_dec_ctx, |
int | avcodecid, | ||
const video_settings_dec_ctx_t * | video_settings_dec_ctx, | ||
log_ctx_t * | log_ctx | ||
) |
Initialize FFmpeg's video decoding common context structure.
ffmpeg_video_dec_ctx | Pointer to the video decoding common context structure to be initialized. |
avcodecid | Unambiguous decoder identifier (namely, the decoder type Id.). |
video_settings_dec_ctx | Pointer to the initial generic video decoder settings context structure. |
log_ctx | Externally defined LOG module context structure. |
Definition at line 348 of file ffmpeg_video.c.
int ffmpeg_video_dec_frame | ( | ffmpeg_video_dec_ctx_t * | ffmpeg_video_dec_ctx, |
AVPacket * | avpacket_iput, | ||
fifo_ctx_t * | oput_fifo_ctx, | ||
log_ctx_t * | log_ctx | ||
) |
Decode a complete video frame. If an output frame is produced, is written to the output FIFO buffer.
ffmpeg_video_dec_ctx | Pointer to the video 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 413 of file ffmpeg_video.c.
void ffmpeg_video_enc_ctx_deinit | ( | ffmpeg_video_enc_ctx_t * | ffmpeg_video_enc_ctx, |
log_ctx_t * | log_ctx | ||
) |
De-initialize FFmpeg's video encoding common context structure previously allocated by a call to 'ffmpeg_video_enc_ctx_init()'. This function release any heap-allocated field or structure member.
ffmpeg_video_enc_ctx | Pointer to the video encoding common context structure to be de-initialized. |
log_ctx | Externally defined LOG module context structure. |
Definition at line 163 of file ffmpeg_video.c.
int ffmpeg_video_enc_ctx_init | ( | ffmpeg_video_enc_ctx_t * | ffmpeg_video_enc_ctx, |
int | avcodecid, | ||
const video_settings_enc_ctx_t * | video_settings_enc_ctx, | ||
log_ctx_t * | log_ctx | ||
) |
Initialize FFmpeg's video encoding common context structure.
ffmpeg_video_enc_ctx | Pointer to the video encoding common context structure to be initialized. |
avcodecid | Unambiguous encoder identifier (namely, the encoder type Id.). |
video_settings_enc_ctx | Pointer to the initial generic video encoder settings context structure. |
log_ctx | Externally defined LOG module context structure. |
Definition at line 53 of file ffmpeg_video.c.
int ffmpeg_video_enc_frame | ( | ffmpeg_video_enc_ctx_t * | ffmpeg_video_enc_ctx, |
AVFrame * | avframe_iput, | ||
fifo_ctx_t * | oput_fifo_ctx, | ||
log_ctx_t * | log_ctx | ||
) |
Encode a complete video frame. If an output frame is produced, is written to the output FIFO buffer.
ffmpeg_video_enc_ctx | Pointer to the video 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 186 of file ffmpeg_video.c.
void ffmpeg_video_reset_on_new_settings | ( | proc_ctx_t * | proc_ctx, |
volatile void * | video_settings_opaque, | ||
int | flag_is_encoder, | ||
log_ctx_t * | log_ctx | ||
) |
FFmpeg video 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 |
video_settings_opaque | Opaque pointer to be casted either to an encoder or decoder video 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 496 of file ffmpeg_video.c.