FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions | Variables
vf_extractplanes.c File Reference
#include "libavutil/avstring.h"
#include "libavutil/imgutils.h"
#include "libavutil/opt.h"
#include "libavutil/pixdesc.h"
#include "avfilter.h"
#include "drawutils.h"
#include "internal.h"

Go to the source code of this file.

Data Structures

struct  ExtractPlanesContext
 

Macros

#define PLANE_R   0x01
 
#define PLANE_G   0x02
 
#define PLANE_B   0x04
 
#define PLANE_A   0x08
 
#define PLANE_Y   0x10
 
#define PLANE_U   0x20
 
#define PLANE_V   0x40
 
#define OFFSET(x)   offsetof(ExtractPlanesContext, x)
 
#define FLAGS   AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
 

Functions

 AVFILTER_DEFINE_CLASS (extractplanes)
 
static int query_formats (AVFilterContext *ctx)
 
static int config_input (AVFilterLink *inlink)
 
static int config_output (AVFilterLink *outlink)
 
static void extract_from_packed (uint8_t *dst, int dst_linesize, const uint8_t *src, int src_linesize, int width, int height, int depth, int step, int comp)
 
static int filter_frame (AVFilterLink *inlink, AVFrame *frame)
 
static av_cold int init (AVFilterContext *ctx)
 
static av_cold void uninit (AVFilterContext *ctx)
 

Variables

static const AVOption extractplanes_options []
 
static const AVFilterPad extractplanes_inputs []
 
AVFilter avfilter_vf_extractplanes
 

Macro Definition Documentation

#define PLANE_R   0x01

Definition at line 29 of file vf_extractplanes.c.

Referenced by config_input().

#define PLANE_G   0x02

Definition at line 30 of file vf_extractplanes.c.

Referenced by config_input().

#define PLANE_B   0x04

Definition at line 31 of file vf_extractplanes.c.

Referenced by config_input().

#define PLANE_A   0x08

Definition at line 32 of file vf_extractplanes.c.

Referenced by config_input().

#define PLANE_Y   0x10

Definition at line 33 of file vf_extractplanes.c.

Referenced by config_input().

#define PLANE_U   0x20

Definition at line 34 of file vf_extractplanes.c.

Referenced by config_input().

#define PLANE_V   0x40

Definition at line 35 of file vf_extractplanes.c.

Referenced by config_input().

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

Definition at line 47 of file vf_extractplanes.c.

Definition at line 48 of file vf_extractplanes.c.

Function Documentation

AVFILTER_DEFINE_CLASS ( extractplanes  )
static int query_formats ( AVFilterContext ctx)
static

Definition at line 63 of file vf_extractplanes.c.

static int config_input ( AVFilterLink inlink)
static

Definition at line 134 of file vf_extractplanes.c.

static int config_output ( AVFilterLink outlink)
static

Definition at line 165 of file vf_extractplanes.c.

Referenced by init().

static void extract_from_packed ( uint8_t dst,
int  dst_linesize,
const uint8_t src,
int  src_linesize,
int  width,
int  height,
int  depth,
int  step,
int  comp 
)
static

Definition at line 181 of file vf_extractplanes.c.

Referenced by filter_frame().

static int filter_frame ( AVFilterLink inlink,
AVFrame frame 
)
static

Definition at line 206 of file vf_extractplanes.c.

static av_cold int init ( AVFilterContext ctx)
static

Definition at line 254 of file vf_extractplanes.c.

static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 281 of file vf_extractplanes.c.

Variable Documentation

const AVOption extractplanes_options[]
static
Initial value:
= {
{ "planes", "set planes", OFFSET(requested_planes), AV_OPT_TYPE_FLAGS, {.i64=1}, 1, 0xff, FLAGS, "flags"},
{ "y", "set luma plane", 0, AV_OPT_TYPE_CONST, {.i64=PLANE_Y}, 0, 0, FLAGS, "flags"},
{ "u", "set u plane", 0, AV_OPT_TYPE_CONST, {.i64=PLANE_U}, 0, 0, FLAGS, "flags"},
{ "v", "set v plane", 0, AV_OPT_TYPE_CONST, {.i64=PLANE_V}, 0, 0, FLAGS, "flags"},
{ "r", "set red plane", 0, AV_OPT_TYPE_CONST, {.i64=PLANE_R}, 0, 0, FLAGS, "flags"},
{ "g", "set green plane", 0, AV_OPT_TYPE_CONST, {.i64=PLANE_G}, 0, 0, FLAGS, "flags"},
{ "b", "set blue plane", 0, AV_OPT_TYPE_CONST, {.i64=PLANE_B}, 0, 0, FLAGS, "flags"},
{ "a", "set alpha plane", 0, AV_OPT_TYPE_CONST, {.i64=PLANE_A}, 0, 0, FLAGS, "flags"},
{ NULL }
}

Definition at line 49 of file vf_extractplanes.c.

const AVFilterPad extractplanes_inputs[]
static
Initial value:
= {
{
.name = "default",
.filter_frame = filter_frame,
.config_props = config_input,
},
{ NULL }
}

Definition at line 289 of file vf_extractplanes.c.

AVFilter avfilter_vf_extractplanes
Initial value:
= {
.name = "extractplanes",
.description = NULL_IF_CONFIG_SMALL("Extract planes as grayscale frames."),
.priv_size = sizeof(ExtractPlanesContext),
.priv_class = &extractplanes_class,
.init = init,
.outputs = NULL,
}

Definition at line 299 of file vf_extractplanes.c.