MediaProcessors
Functions
proc_frame_2_ffmpeg.c File Reference
#include "proc_frame_2_ffmpeg.h"
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <libavformat/avformat.h>
#include <libmediaprocsutils/log.h>
#include <libmediaprocsutils/stat_codes.h>
#include <libmediaprocsutils/check_utils.h>
#include <libmediaprocsutils/mem_utils.h>
#include <libmediaprocs/proc_if.h>
Include dependency graph for proc_frame_2_ffmpeg.c:

Go to the source code of this file.

Functions

static int proc_sample_fmt_2_ffmpegfmt (proc_sample_fmt_t proc_sample_fmt)
 
static proc_sample_fmt_t ffmpegfmt_2_proc_sample_fmt (int ffmpegfmt)
 
void * proc_frame_ctx_2_avframe (const proc_frame_ctx_t *proc_frame_ctx)
 
AVFrame * allocate_frame_video (int pix_fmt, int width, int height)
 
void avframe_release (void **ref_avfame)
 
proc_frame_ctx_tavpacket_2_proc_frame_ctx (const void *avpacket_arg)
 
void * proc_frame_ctx_2_avpacket (const proc_frame_ctx_t *proc_frame_ctx)
 
void avpacket_release (void **ref_avpacket)
 
proc_frame_ctx_tavframe_2_proc_frame_ctx (const void *avframe_arg)
 

Detailed Description

Author
Rafael Antoniello

Definition in file proc_frame_2_ffmpeg.c.

Function Documentation

AVFrame* allocate_frame_video ( int  pix_fmt,
int  width,
int  height 
)

Allocate an FFmpeg's AVFrame structure for video encoding. This is a wrapper function of the FFmpeg's 'av_frame_alloc()' for allocating an AVFrame structure.

Parameters
pix_fmtFFmpeg's video pixel-format identifier.
widthVideo frame width.
heightVideo frame height. return Pointer to the allocated AVFrame structure.

Definition at line 185 of file proc_frame_2_ffmpeg.c.

proc_frame_ctx_t* avframe_2_proc_frame_ctx ( const void *  avframe)

Transform FFmpeg's AVFrame structure to a processor frame context structure (type proc_frame_ctx_t).

Parameters
avframeOpaque pointer to the AVFrame structure. return Pointer to the processor frame context structure.

Definition at line 325 of file proc_frame_2_ffmpeg.c.

void avframe_release ( void **  ref_avfame)

Release FFmpeg's AVFrame structure. This function is a wrapper of FFmpeg's 'av_frame_free()'.

Parameters
ref_avfameOpaque reference to a pointer to an AVFrame structure to be released.

Definition at line 228 of file proc_frame_2_ffmpeg.c.

proc_frame_ctx_t* avpacket_2_proc_frame_ctx ( const void *  avpacket_arg)

Transform FFmpeg's AVPacket structure to a processor frame context structure (type proc_frame_ctx_t).

Parameters
avpacket_argOpaque pointer to the AVPacket structure. return Pointer to the processor frame context structure.

Definition at line 236 of file proc_frame_2_ffmpeg.c.

void avpacket_release ( void **  ref_avpacket)

Release FFmpeg's AVPacket structure. This function is a wrapper of FFmpeg's 'av_packet_free()'.

Parameters
ref_avpacketOpaque reference to a pointer to an AVPacket structure to be released.

Definition at line 316 of file proc_frame_2_ffmpeg.c.

void* proc_frame_ctx_2_avframe ( const proc_frame_ctx_t proc_frame_ctx)

Transform a processor frame context structure (type proc_frame_ctx_t) to an FFmpeg's AVFrame structure.

Parameters
proc_frame_ctxPointer to the processor frame context structure. return Opaque pointer that actually can be casted to an AVFrame structure.

Definition at line 47 of file proc_frame_2_ffmpeg.c.

void* proc_frame_ctx_2_avpacket ( const proc_frame_ctx_t proc_frame_ctx)

Transform a processor frame context structure (type proc_frame_ctx_t) to an FFmpeg's AVPacket structure.

Parameters
proc_frame_ctxPointer to the processor frame context structure. return Opaque pointer that actually can be casted to an AVPacket structure.

Definition at line 273 of file proc_frame_2_ffmpeg.c.