FFmpeg
Data Structures | Macros | Functions | Variables
vf_extractplanes.c File Reference
#include "config_components.h"
#include "libavutil/avstring.h"
#include "libavutil/imgutils.h"
#include "libavutil/opt.h"
#include "libavutil/pixdesc.h"
#include "avfilter.h"
#include "drawutils.h"
#include "filters.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
 
#define EIGHTBIT_FORMATS
 
#define HIGHDEPTH_FORMATS(suf)
 
#define FLOAT_FORMATS(suf)
 

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 extract_plane (AVFilterLink *outlink, AVFrame *frame)
 
static int activate (AVFilterContext *ctx)
 
static av_cold int init (AVFilterContext *ctx)
 

Variables

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

Macro Definition Documentation

◆ PLANE_R

#define PLANE_R   0x01

Definition at line 33 of file vf_extractplanes.c.

◆ PLANE_G

#define PLANE_G   0x02

Definition at line 34 of file vf_extractplanes.c.

◆ PLANE_B

#define PLANE_B   0x04

Definition at line 35 of file vf_extractplanes.c.

◆ PLANE_A

#define PLANE_A   0x08

Definition at line 36 of file vf_extractplanes.c.

◆ PLANE_Y

#define PLANE_Y   0x10

Definition at line 37 of file vf_extractplanes.c.

◆ PLANE_U

#define PLANE_U   0x20

Definition at line 38 of file vf_extractplanes.c.

◆ PLANE_V

#define PLANE_V   0x40

Definition at line 39 of file vf_extractplanes.c.

◆ OFFSET

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

Definition at line 51 of file vf_extractplanes.c.

◆ FLAGS

Definition at line 52 of file vf_extractplanes.c.

◆ EIGHTBIT_FORMATS

#define EIGHTBIT_FORMATS
Value:
AV_PIX_FMT_YUV411P, \
AV_PIX_FMT_YUV440P, \
AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUVA420P, \
AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUVA422P, \
AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ422P, \
AV_PIX_FMT_YUVJ440P, AV_PIX_FMT_YUVJ444P, \
AV_PIX_FMT_YUVJ411P, \
AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUVA444P, \
AV_PIX_FMT_GRAY8, AV_PIX_FMT_GRAY8A, \
AV_PIX_FMT_RGB24, AV_PIX_FMT_BGR24, \
AV_PIX_FMT_RGBA, AV_PIX_FMT_BGRA, \
AV_PIX_FMT_ARGB, AV_PIX_FMT_ABGR, \
AV_PIX_FMT_RGB0, AV_PIX_FMT_BGR0, \
AV_PIX_FMT_0RGB, AV_PIX_FMT_0BGR, \
AV_PIX_FMT_GBRP, AV_PIX_FMT_GBRAP

Definition at line 67 of file vf_extractplanes.c.

◆ HIGHDEPTH_FORMATS

#define HIGHDEPTH_FORMATS (   suf)

Definition at line 85 of file vf_extractplanes.c.

◆ FLOAT_FORMATS

#define FLOAT_FORMATS (   suf)
Value:
AV_PIX_FMT_GBRPF32##suf, AV_PIX_FMT_GBRAPF32##suf \

Definition at line 125 of file vf_extractplanes.c.

Function Documentation

◆ AVFILTER_DEFINE_CLASS()

AVFILTER_DEFINE_CLASS ( extractplanes  )

◆ query_formats()

static int query_formats ( AVFilterContext ctx)
static

Definition at line 129 of file vf_extractplanes.c.

◆ config_input()

static int config_input ( AVFilterLink inlink)
static

Definition at line 220 of file vf_extractplanes.c.

◆ config_output()

static int config_output ( AVFilterLink outlink)
static

Definition at line 252 of file vf_extractplanes.c.

Referenced by init().

◆ extract_from_packed()

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 268 of file vf_extractplanes.c.

Referenced by extract_plane().

◆ extract_plane()

static int extract_plane ( AVFilterLink outlink,
AVFrame frame 
)
static

Definition at line 293 of file vf_extractplanes.c.

Referenced by activate().

◆ activate()

static int activate ( AVFilterContext ctx)
static

Definition at line 320 of file vf_extractplanes.c.

◆ init()

static av_cold int init ( AVFilterContext ctx)
static

Definition at line 371 of file vf_extractplanes.c.

Variable Documentation

◆ extractplanes_options

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 53 of file vf_extractplanes.c.

◆ extractplanes_inputs

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

Definition at line 399 of file vf_extractplanes.c.

◆ ff_vf_extractplanes

const AVFilter ff_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 407 of file vf_extractplanes.c.

FLAGS
#define FLAGS
Definition: vf_extractplanes.c:52
FILTER_QUERY_FUNC
#define FILTER_QUERY_FUNC(func)
Definition: internal.h:167
AV_PIX_FMT_BGR24
@ AV_PIX_FMT_BGR24
packed RGB 8:8:8, 24bpp, BGRBGR...
Definition: pixfmt.h:69
AV_PIX_FMT_BGRA
@ AV_PIX_FMT_BGRA
packed BGRA 8:8:8:8, 32bpp, BGRABGRA...
Definition: pixfmt.h:95
AV_PIX_FMT_GBRAP
@ AV_PIX_FMT_GBRAP
planar GBRA 4:4:4:4 32bpp
Definition: pixfmt.h:205
PLANE_A
#define PLANE_A
Definition: vf_extractplanes.c:36
PLANE_B
#define PLANE_B
Definition: vf_extractplanes.c:35
activate
static int activate(AVFilterContext *ctx)
Definition: vf_extractplanes.c:320
PLANE_Y
#define PLANE_Y
Definition: vf_extractplanes.c:37
AV_PIX_FMT_YUVJ422P
@ AV_PIX_FMT_YUVJ422P
planar YUV 4:2:2, 16bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV422P and setting col...
Definition: pixfmt.h:79
AV_PIX_FMT_YUVA420P
@ AV_PIX_FMT_YUVA420P
planar YUV 4:2:0, 20bpp, (1 Cr & Cb sample per 2x2 Y & A samples)
Definition: pixfmt.h:101
ExtractPlanesContext
Definition: vf_extractplanes.c:41
init
static av_cold int init(AVFilterContext *ctx)
Definition: vf_extractplanes.c:371
AV_PIX_FMT_GRAYF32
#define AV_PIX_FMT_GRAYF32
Definition: pixfmt.h:438
FILTER_INPUTS
#define FILTER_INPUTS(array)
Definition: internal.h:190
AV_PIX_FMT_YUVJ444P
@ AV_PIX_FMT_YUVJ444P
planar YUV 4:4:4, 24bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV444P and setting col...
Definition: pixfmt.h:80
AV_PIX_FMT_GRAY8A
@ AV_PIX_FMT_GRAY8A
alias for AV_PIX_FMT_YA8
Definition: pixfmt.h:136
NULL
#define NULL
Definition: coverity.c:32
PLANE_G
#define PLANE_G
Definition: vf_extractplanes.c:34
AV_PIX_FMT_BGR0
@ AV_PIX_FMT_BGR0
packed BGR 8:8:8, 32bpp, BGRXBGRX... X=unused/undefined
Definition: pixfmt.h:230
AV_PIX_FMT_ABGR
@ AV_PIX_FMT_ABGR
packed ABGR 8:8:8:8, 32bpp, ABGRABGR...
Definition: pixfmt.h:94
AVFILTER_FLAG_DYNAMIC_OUTPUTS
#define AVFILTER_FLAG_DYNAMIC_OUTPUTS
The number of the filter outputs is not determined just by AVFilter.outputs.
Definition: avfilter.h:122
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
AV_PIX_FMT_YUVA444P
@ AV_PIX_FMT_YUVA444P
planar YUV 4:4:4 32bpp, (1 Cr & Cb sample per 1x1 Y & A samples)
Definition: pixfmt.h:167
OFFSET
#define OFFSET(x)
Definition: vf_extractplanes.c:51
extractplanes_inputs
static const AVFilterPad extractplanes_inputs[]
Definition: vf_extractplanes.c:399
AV_PIX_FMT_0BGR
@ AV_PIX_FMT_0BGR
packed BGR 8:8:8, 32bpp, XBGRXBGR... X=unused/undefined
Definition: pixfmt.h:229
AV_PIX_FMT_GBRAPF32
#define AV_PIX_FMT_GBRAPF32
Definition: pixfmt.h:436
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
PLANE_U
#define PLANE_U
Definition: vf_extractplanes.c:38
AV_OPT_TYPE_FLAGS
@ AV_OPT_TYPE_FLAGS
Definition: opt.h:224
AV_PIX_FMT_YUV410P
@ AV_PIX_FMT_YUV410P
planar YUV 4:1:0, 9bpp, (1 Cr & Cb sample per 4x4 Y samples)
Definition: pixfmt.h:72
config_input
static int config_input(AVFilterLink *inlink)
Definition: vf_extractplanes.c:220
PLANE_V
#define PLANE_V
Definition: vf_extractplanes.c:39
PLANE_R
#define PLANE_R
Definition: vf_extractplanes.c:33
AV_OPT_TYPE_CONST
@ AV_OPT_TYPE_CONST
Definition: opt.h:234
AV_PIX_FMT_YUVA422P
@ AV_PIX_FMT_YUVA422P
planar YUV 4:2:2 24bpp, (1 Cr & Cb sample per 2x1 Y & A samples)
Definition: pixfmt.h:166
query_formats
static int query_formats(AVFilterContext *ctx)
Definition: vf_extractplanes.c:129