MediaProcessors
Classes | Typedefs | Functions | Variables
ffmpeg_m2v.c File Reference
#include "ffmpeg_m2v.h"
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <pthread.h>
#include <libcjson/cJSON.h>
#include <libavcodec/avcodec.h>
#include <libmediaprocsutils/log.h>
#include <libmediaprocsutils/stat_codes.h>
#include <libmediaprocsutils/check_utils.h>
#include <libmediaprocsutils/fifo.h>
#include <libmediaprocs/proc_if.h>
#include <libmediaprocs/proc.h>
#include "ffmpeg_video.h"
#include "proc_frame_2_ffmpeg.h"
#include "video_settings.h"
Include dependency graph for ffmpeg_m2v.c:

Go to the source code of this file.

Classes

struct  ffmpeg_m2v_enc_settings_ctx_s
 
struct  ffmpeg_m2v_enc_ctx_s
 
struct  ffmpeg_m2v_dec_settings_ctx_s
 
struct  ffmpeg_m2v_dec_ctx_s
 

Typedefs

typedef struct ffmpeg_m2v_enc_settings_ctx_s ffmpeg_m2v_enc_settings_ctx_t
 
typedef struct ffmpeg_m2v_enc_ctx_s ffmpeg_m2v_enc_ctx_t
 
typedef struct ffmpeg_m2v_dec_settings_ctx_s ffmpeg_m2v_dec_settings_ctx_t
 
typedef struct ffmpeg_m2v_dec_ctx_s ffmpeg_m2v_dec_ctx_t
 

Functions

static proc_ctx_tffmpeg_m2v_enc_open (const proc_if_t *proc_if, const char *settings_str, log_ctx_t *log_ctx, va_list arg)
 
static void ffmpeg_m2v_enc_close (proc_ctx_t **ref_proc_ctx)
 
static int ffmpeg_m2v_enc_process_frame (proc_ctx_t *proc_ctx, fifo_ctx_t *iput_fifo_ctx, fifo_ctx_t *oput_fifo_ctx)
 
static int ffmpeg_m2v_enc_rest_put (proc_ctx_t *proc_ctx, const char *str)
 
static int ffmpeg_m2v_enc_rest_get (proc_ctx_t *proc_ctx, const proc_if_rest_fmt_t rest_fmt, void **ref_reponse)
 
static int ffmpeg_m2v_enc_settings_ctx_init (volatile ffmpeg_m2v_enc_settings_ctx_t *ffmpeg_m2v_enc_settings_ctx, log_ctx_t *log_ctx)
 
static void ffmpeg_m2v_enc_settings_ctx_deinit (volatile ffmpeg_m2v_enc_settings_ctx_t *ffmpeg_m2v_enc_settings_ctx, log_ctx_t *log_ctx)
 
static proc_ctx_tffmpeg_m2v_dec_open (const proc_if_t *proc_if, const char *settings_str, log_ctx_t *log_ctx, va_list arg)
 
static void ffmpeg_m2v_dec_close (proc_ctx_t **ref_proc_ctx)
 
static int ffmpeg_m2v_dec_process_frame (proc_ctx_t *proc_ctx, fifo_ctx_t *iput_fifo_ctx, fifo_ctx_t *oput_fifo_ctx)
 
static int ffmpeg_m2v_dec_rest_put (proc_ctx_t *proc_ctx, const char *str)
 
static int ffmpeg_m2v_dec_rest_get (proc_ctx_t *proc_ctx, const proc_if_rest_fmt_t rest_fmt, void **ref_reponse)
 
static int ffmpeg_m2v_dec_settings_ctx_init (volatile ffmpeg_m2v_dec_settings_ctx_t *ffmpeg_m2v_dec_settings_ctx, log_ctx_t *log_ctx)
 
static void ffmpeg_m2v_dec_settings_ctx_deinit (volatile ffmpeg_m2v_dec_settings_ctx_t *ffmpeg_m2v_dec_settings_ctx, log_ctx_t *log_ctx)
 

Variables

const proc_if_t proc_if_ffmpeg_m2v_enc
 
const proc_if_t proc_if_ffmpeg_m2v_dec
 

Detailed Description

Author
Rafael Antoniello

Definition in file ffmpeg_m2v.c.

Typedef Documentation

FFmpeg's MPEG-2 video decoder wrapper context structure.

FFmpeg's MPEG-2 video decoder settings context structure.

FFmpeg's MPEG-2 video encoder wrapper context structure.

FFmpeg's MPEG-2 video encoder settings context structure.

Function Documentation

static void ffmpeg_m2v_dec_close ( proc_ctx_t **  ref_proc_ctx)
static

Implements the proc_if_s::close callback. See .proc_if.h for further details.

Definition at line 584 of file ffmpeg_m2v.c.

static proc_ctx_t * ffmpeg_m2v_dec_open ( const proc_if_t proc_if,
const char *  settings_str,
log_ctx_t log_ctx,
va_list  arg 
)
static

Implements the proc_if_s::open callback. See .proc_if.h for further details.

Definition at line 525 of file ffmpeg_m2v.c.

static int ffmpeg_m2v_dec_process_frame ( proc_ctx_t proc_ctx,
fifo_ctx_t iput_fifo_ctx,
fifo_ctx_t oput_fifo_ctx 
)
static

Implements the proc_if_s::process_frame callback. See .proc_if.h for further details.

Definition at line 615 of file ffmpeg_m2v.c.

static int ffmpeg_m2v_dec_rest_get ( proc_ctx_t proc_ctx,
const proc_if_rest_fmt_t  rest_fmt,
void **  ref_reponse 
)
static

Implements the proc_if_s::rest_get callback. See .proc_if.h for further details.

Definition at line 703 of file ffmpeg_m2v.c.

static int ffmpeg_m2v_dec_rest_put ( proc_ctx_t proc_ctx,
const char *  str 
)
static

Implements the proc_if_s::rest_put callback. See .proc_if.h for further details.

Definition at line 661 of file ffmpeg_m2v.c.

static void ffmpeg_m2v_dec_settings_ctx_deinit ( volatile ffmpeg_m2v_dec_settings_ctx_t ffmpeg_m2v_dec_settings_ctx,
log_ctx_t log_ctx 
)
static

Release specific MPEG-2 decoder settings (allocated in heap memory).

Parameters
ffmpeg_m2v_dec_settings_ctx
log_ctx

Definition at line 834 of file ffmpeg_m2v.c.

static int ffmpeg_m2v_dec_settings_ctx_init ( volatile ffmpeg_m2v_dec_settings_ctx_t ffmpeg_m2v_dec_settings_ctx,
log_ctx_t log_ctx 
)
static

Initialize specific MPEG-2 decoder settings to defaults.

Parameters
ffmpeg_m2v_dec_settings_ctx
log_ctx
Returns
Status code (STAT_SUCCESS code in case of success, for other code values please refer to .stat_codes.h).

Definition at line 804 of file ffmpeg_m2v.c.

static void ffmpeg_m2v_enc_close ( proc_ctx_t **  ref_proc_ctx)
static

Implements the proc_if_s::close callback. See .proc_if.h for further details.

Definition at line 248 of file ffmpeg_m2v.c.

static proc_ctx_t * ffmpeg_m2v_enc_open ( const proc_if_t proc_if,
const char *  settings_str,
log_ctx_t log_ctx,
va_list  arg 
)
static

Implements the proc_if_s::open callback. See .proc_if.h for further details.

Definition at line 189 of file ffmpeg_m2v.c.

static int ffmpeg_m2v_enc_process_frame ( proc_ctx_t proc_ctx,
fifo_ctx_t iput_fifo_ctx,
fifo_ctx_t oput_fifo_ctx 
)
static

Implements the proc_if_s::process_frame callback. See .proc_if.h for further details.

Definition at line 280 of file ffmpeg_m2v.c.

static int ffmpeg_m2v_enc_rest_get ( proc_ctx_t proc_ctx,
const proc_if_rest_fmt_t  rest_fmt,
void **  ref_reponse 
)
static

Implements the proc_if_s::rest_get callback. See .proc_if.h for further details.

Definition at line 368 of file ffmpeg_m2v.c.

static int ffmpeg_m2v_enc_rest_put ( proc_ctx_t proc_ctx,
const char *  str 
)
static

Implements the proc_if_s::rest_put callback. See .proc_if.h for further details.

Definition at line 326 of file ffmpeg_m2v.c.

static void ffmpeg_m2v_enc_settings_ctx_deinit ( volatile ffmpeg_m2v_enc_settings_ctx_t ffmpeg_m2v_enc_settings_ctx,
log_ctx_t log_ctx 
)
static

Release specific MPEG-2 video encoder settings (allocated in heap memory).

Parameters
ffmpeg_m2v_enc_settings_ctx
log_ctx

Definition at line 501 of file ffmpeg_m2v.c.

static int ffmpeg_m2v_enc_settings_ctx_init ( volatile ffmpeg_m2v_enc_settings_ctx_t ffmpeg_m2v_enc_settings_ctx,
log_ctx_t log_ctx 
)
static

Initialize specific MPEG-2 video encoder settings to defaults.

Parameters
ffmpeg_m2v_enc_settings_ctx
log_ctx
Returns
Status code (STAT_SUCCESS code in case of success, for other code values please refer to .stat_codes.h).

Definition at line 471 of file ffmpeg_m2v.c.

Variable Documentation

const proc_if_t proc_if_ffmpeg_m2v_dec
Initial value:
=
{
"ffmpeg_m2v_dec", "decoder", "video/MPV",
(uint64_t)(PROC_FEATURE_BITRATE|PROC_FEATURE_REGISTER_PTS|
PROC_FEATURE_LATENCY),
proc_send_frame_default1,
NULL,
proc_recv_frame_default1,
NULL,
NULL,
}
static proc_ctx_t * ffmpeg_m2v_dec_open(const proc_if_t *proc_if, const char *settings_str, log_ctx_t *log_ctx, va_list arg)
Definition: ffmpeg_m2v.c:525
proc_frame_ctx_t * avframe_2_proc_frame_ctx(const void *avframe_arg)
void avpacket_release(void **ref_avpacket)
static int ffmpeg_m2v_dec_process_frame(proc_ctx_t *proc_ctx, fifo_ctx_t *iput_fifo_ctx, fifo_ctx_t *oput_fifo_ctx)
Definition: ffmpeg_m2v.c:615
void * proc_frame_ctx_2_avpacket(const proc_frame_ctx_t *proc_frame_ctx)
static int ffmpeg_m2v_dec_rest_get(proc_ctx_t *proc_ctx, const proc_if_rest_fmt_t rest_fmt, void **ref_reponse)
Definition: ffmpeg_m2v.c:703
static void ffmpeg_m2v_dec_close(proc_ctx_t **ref_proc_ctx)
Definition: ffmpeg_m2v.c:584
static int ffmpeg_m2v_dec_rest_put(proc_ctx_t *proc_ctx, const char *str)
Definition: ffmpeg_m2v.c:661

Processor interface implementing the FFmpeg wrapper of the MPEG-2 video decoder.

Definition at line 165 of file ffmpeg_m2v.c.

const proc_if_t proc_if_ffmpeg_m2v_enc
Initial value:
=
{
"ffmpeg_m2v_enc", "encoder", "video/MPV",
(uint64_t)(PROC_FEATURE_BITRATE|PROC_FEATURE_REGISTER_PTS|
PROC_FEATURE_LATENCY),
proc_send_frame_default1,
NULL,
proc_recv_frame_default1,
NULL,
NULL,
}
void avframe_release(void **ref_avfame)
static proc_ctx_t * ffmpeg_m2v_enc_open(const proc_if_t *proc_if, const char *settings_str, log_ctx_t *log_ctx, va_list arg)
Definition: ffmpeg_m2v.c:189
static int ffmpeg_m2v_enc_rest_get(proc_ctx_t *proc_ctx, const proc_if_rest_fmt_t rest_fmt, void **ref_reponse)
Definition: ffmpeg_m2v.c:368
static int ffmpeg_m2v_enc_process_frame(proc_ctx_t *proc_ctx, fifo_ctx_t *iput_fifo_ctx, fifo_ctx_t *oput_fifo_ctx)
Definition: ffmpeg_m2v.c:280
proc_frame_ctx_t * avpacket_2_proc_frame_ctx(const void *avpacket_arg)
static int ffmpeg_m2v_enc_rest_put(proc_ctx_t *proc_ctx, const char *str)
Definition: ffmpeg_m2v.c:326
void * proc_frame_ctx_2_avframe(const proc_frame_ctx_t *proc_frame_ctx)
static void ffmpeg_m2v_enc_close(proc_ctx_t **ref_proc_ctx)
Definition: ffmpeg_m2v.c:248

Processor interface implementing the FFmpeg wrapper of the MPEG-2 video encoder.

Definition at line 145 of file ffmpeg_m2v.c.