FFmpeg
Data Structures | Macros | Functions | Variables
vf_maskedmerge.c File Reference
#include "libavutil/imgutils.h"
#include "libavutil/pixdesc.h"
#include "libavutil/opt.h"
#include "avfilter.h"
#include "formats.h"
#include "internal.h"
#include "video.h"
#include "maskedmerge.h"

Go to the source code of this file.

Data Structures

struct  ThreadData
 Used for passing data between threads. More...
 

Macros

#define OFFSET(x)   offsetof(MaskedMergeContext, x)
 
#define FLAGS   AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
 

Functions

 AVFILTER_DEFINE_CLASS (maskedmerge)
 
static int query_formats (AVFilterContext *ctx)
 
static int filter_slice (AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
 
static int process_frame (FFFrameSync *fs)
 
static void maskedmerge8 (const uint8_t *bsrc, const uint8_t *osrc, const uint8_t *msrc, uint8_t *dst, ptrdiff_t blinesize, ptrdiff_t olinesize, ptrdiff_t mlinesize, ptrdiff_t dlinesize, int w, int h, int half, int shift)
 
static void maskedmerge16 (const uint8_t *bbsrc, const uint8_t *oosrc, const uint8_t *mmsrc, uint8_t *ddst, ptrdiff_t blinesize, ptrdiff_t olinesize, ptrdiff_t mlinesize, ptrdiff_t dlinesize, int w, int h, int half, int shift)
 
static int config_input (AVFilterLink *inlink)
 
static int config_output (AVFilterLink *outlink)
 
static int activate (AVFilterContext *ctx)
 
static av_cold void uninit (AVFilterContext *ctx)
 

Variables

static const AVOption maskedmerge_options []
 
static const AVFilterPad maskedmerge_inputs []
 
static const AVFilterPad maskedmerge_outputs []
 
const AVFilter ff_vf_maskedmerge
 

Macro Definition Documentation

◆ OFFSET

#define OFFSET (   x)    offsetof(MaskedMergeContext, x)

Definition at line 30 of file vf_maskedmerge.c.

◆ FLAGS

Definition at line 31 of file vf_maskedmerge.c.

Function Documentation

◆ AVFILTER_DEFINE_CLASS()

AVFILTER_DEFINE_CLASS ( maskedmerge  )

◆ query_formats()

static int query_formats ( AVFilterContext ctx)
static

Definition at line 40 of file vf_maskedmerge.c.

◆ filter_slice()

static int filter_slice ( AVFilterContext ctx,
void *  arg,
int  jobnr,
int  nb_jobs 
)
static

Definition at line 72 of file vf_maskedmerge.c.

Referenced by process_frame().

◆ process_frame()

static int process_frame ( FFFrameSync fs)
static

Definition at line 109 of file vf_maskedmerge.c.

Referenced by config_output().

◆ maskedmerge8()

static void maskedmerge8 ( const uint8_t *  bsrc,
const uint8_t *  osrc,
const uint8_t *  msrc,
uint8_t *  dst,
ptrdiff_t  blinesize,
ptrdiff_t  olinesize,
ptrdiff_t  mlinesize,
ptrdiff_t  dlinesize,
int  w,
int  h,
int  half,
int  shift 
)
static

Definition at line 145 of file vf_maskedmerge.c.

Referenced by config_input().

◆ maskedmerge16()

static void maskedmerge16 ( const uint8_t *  bbsrc,
const uint8_t *  oosrc,
const uint8_t *  mmsrc,
uint8_t *  ddst,
ptrdiff_t  blinesize,
ptrdiff_t  olinesize,
ptrdiff_t  mlinesize,
ptrdiff_t  dlinesize,
int  w,
int  h,
int  half,
int  shift 
)
static

Definition at line 166 of file vf_maskedmerge.c.

Referenced by config_input().

◆ config_input()

static int config_input ( AVFilterLink inlink)
static

Definition at line 191 of file vf_maskedmerge.c.

◆ config_output()

static int config_output ( AVFilterLink outlink)
static

Definition at line 221 of file vf_maskedmerge.c.

◆ activate()

static int activate ( AVFilterContext ctx)
static

Definition at line 281 of file vf_maskedmerge.c.

◆ uninit()

static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 287 of file vf_maskedmerge.c.

Variable Documentation

◆ maskedmerge_options

const AVOption maskedmerge_options[]
static
Initial value:
= {
{ "planes", "set planes", OFFSET(planes), AV_OPT_TYPE_INT, {.i64=0xF}, 0, 0xF, FLAGS },
{ NULL }
}

Definition at line 33 of file vf_maskedmerge.c.

◆ maskedmerge_inputs

const AVFilterPad maskedmerge_inputs[]
static
Initial value:
= {
{
.name = "base",
.config_props = config_input,
},
{
.name = "overlay",
},
{
.name = "mask",
},
{ NULL }
}

Definition at line 294 of file vf_maskedmerge.c.

◆ maskedmerge_outputs

const AVFilterPad maskedmerge_outputs[]
static
Initial value:
= {
{
.name = "default",
.config_props = config_output,
},
{ NULL }
}

Definition at line 311 of file vf_maskedmerge.c.

◆ ff_vf_maskedmerge

const AVFilter ff_vf_maskedmerge
Initial value:
= {
.name = "maskedmerge",
.description = NULL_IF_CONFIG_SMALL("Merge first stream with second stream using third stream as mask."),
.priv_size = sizeof(MaskedMergeContext),
.priv_class = &maskedmerge_class,
}

Definition at line 320 of file vf_maskedmerge.c.

config_input
static int config_input(AVFilterLink *inlink)
Definition: vf_maskedmerge.c:191
maskedmerge_outputs
static const AVFilterPad maskedmerge_outputs[]
Definition: vf_maskedmerge.c:311
maskedmerge_inputs
static const AVFilterPad maskedmerge_inputs[]
Definition: vf_maskedmerge.c:294
activate
static int activate(AVFilterContext *ctx)
Definition: vf_maskedmerge.c:281
inputs
these buffered frames must be flushed immediately if a new input produces new the filter must not call request_frame to get more It must just process the frame or queue it The task of requesting more frames is left to the filter s request_frame method or the application If a filter has several inputs
Definition: filter_design.txt:243
FLAGS
#define FLAGS
Definition: vf_maskedmerge.c:31
config_output
static int config_output(AVFilterLink *outlink)
Definition: vf_maskedmerge.c:221
outputs
static const AVFilterPad outputs[]
Definition: af_acontrast.c:203
NULL
#define NULL
Definition: coverity.c:32
uninit
static av_cold void uninit(AVFilterContext *ctx)
Definition: vf_maskedmerge.c:287
OFFSET
#define OFFSET(x)
Definition: vf_maskedmerge.c:30
NULL_IF_CONFIG_SMALL
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Definition: internal.h:117
process_command
static int process_command(AVFilterContext *ctx, const char *cmd, const char *args, char *res, int res_len, int flags)
Definition: af_acrusher.c:336
ff_filter_process_command
int ff_filter_process_command(AVFilterContext *ctx, const char *cmd, const char *arg, char *res, int res_len, int flags)
Generic processing of user supplied commands that are set in the same way as the filter options.
Definition: avfilter.c:842
MaskedMergeContext
Definition: maskedmerge.h:27
AV_OPT_TYPE_INT
@ AV_OPT_TYPE_INT
Definition: opt.h:225
query_formats
static int query_formats(AVFilterContext *ctx)
Definition: vf_maskedmerge.c:40
planes
static const struct @322 planes[]
AVFILTER_FLAG_SLICE_THREADS
#define AVFILTER_FLAG_SLICE_THREADS
The filter supports multithreading by splitting frames into multiple parts and processing them concur...
Definition: avfilter.h:117
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
AVFILTER_FLAG_SUPPORT_TIMELINE_INTERNAL
#define AVFILTER_FLAG_SUPPORT_TIMELINE_INTERNAL
Same as AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC, except that the filter will have its filter_frame() c...
Definition: avfilter.h:134
flags
#define flags(name, subs,...)
Definition: cbs_av1.c:561