FFmpeg
Data Structures | Macros | Functions | Variables
vf_hwmap.c File Reference
#include "libavutil/buffer.h"
#include "libavutil/hwcontext.h"
#include "libavutil/log.h"
#include "libavutil/opt.h"
#include "libavutil/pixdesc.h"
#include "avfilter.h"
#include "formats.h"
#include "internal.h"
#include "video.h"

Go to the source code of this file.

Data Structures

struct  HWMapContext
 

Macros

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

Functions

static int hwmap_query_formats (AVFilterContext *avctx)
 
static int hwmap_config_output (AVFilterLink *outlink)
 
static AVFramehwmap_get_buffer (AVFilterLink *inlink, int w, int h)
 
static int hwmap_filter_frame (AVFilterLink *link, AVFrame *input)
 
static av_cold void hwmap_uninit (AVFilterContext *avctx)
 
 AVFILTER_DEFINE_CLASS (hwmap)
 

Variables

static const AVOption hwmap_options []
 
static const AVFilterPad hwmap_inputs []
 
static const AVFilterPad hwmap_outputs []
 
AVFilter ff_vf_hwmap
 

Macro Definition Documentation

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

Definition at line 370 of file vf_hwmap.c.

Definition at line 371 of file vf_hwmap.c.

Function Documentation

static int hwmap_query_formats ( AVFilterContext avctx)
static

Definition at line 40 of file vf_hwmap.c.

static int hwmap_config_output ( AVFilterLink outlink)
static

Definition at line 53 of file vf_hwmap.c.

static AVFrame* hwmap_get_buffer ( AVFilterLink inlink,
int  w,
int  h 
)
static

Definition at line 264 of file vf_hwmap.c.

static int hwmap_filter_frame ( AVFilterLink link,
AVFrame input 
)
static

Definition at line 303 of file vf_hwmap.c.

static av_cold void hwmap_uninit ( AVFilterContext avctx)
static

Definition at line 363 of file vf_hwmap.c.

AVFILTER_DEFINE_CLASS ( hwmap  )

Variable Documentation

const AVOption hwmap_options[]
static
Initial value:
= {
{ "mode", "Frame mapping mode",
0, INT_MAX, FLAGS, "mode" },
{ "read", "Mapping should be readable",
INT_MIN, INT_MAX, FLAGS, "mode" },
{ "write", "Mapping should be writeable",
INT_MIN, INT_MAX, FLAGS, "mode" },
{ "overwrite", "Mapping will always overwrite the entire frame",
INT_MIN, INT_MAX, FLAGS, "mode" },
{ "direct", "Mapping should not involve any copying",
INT_MIN, INT_MAX, FLAGS, "mode" },
{ "derive_device", "Derive a new device of this type",
OFFSET(derive_device_type), AV_OPT_TYPE_STRING,
{ .str = NULL }, 0, 0, FLAGS },
{ "reverse", "Map in reverse (create and allocate in the sink)",
{ .i64 = 0 }, 0, 1, FLAGS },
{ NULL }
}
#define NULL
Definition: coverity.c:32
The mapping must be readable.
Definition: hwcontext.h:503
static uint32_t reverse(uint32_t num, int bits)
Definition: speedhq.c:565
#define OFFSET(x)
Definition: vf_hwmap.c:370
#define FLAGS
Definition: vf_hwmap.c:371
The mapping must be writeable.
Definition: hwcontext.h:507
The mapping must be direct.
Definition: hwcontext.h:519
The mapped frame will be overwritten completely in subsequent operations, so the current frame data n...
Definition: hwcontext.h:513
mode
Use these values in ebur128_init (or'ed).
Definition: ebur128.h:83

Definition at line 372 of file vf_hwmap.c.

const AVFilterPad hwmap_inputs[]
static
Initial value:
= {
{
.name = "default",
.get_video_buffer = hwmap_get_buffer,
.filter_frame = hwmap_filter_frame,
},
{ NULL }
}
#define NULL
Definition: coverity.c:32
static int hwmap_filter_frame(AVFilterLink *link, AVFrame *input)
Definition: vf_hwmap.c:303
static AVFrame * hwmap_get_buffer(AVFilterLink *inlink, int w, int h)
Definition: vf_hwmap.c:264

Definition at line 403 of file vf_hwmap.c.

const AVFilterPad hwmap_outputs[]
static
Initial value:
= {
{
.name = "default",
.config_props = hwmap_config_output,
},
{ NULL }
}
#define NULL
Definition: coverity.c:32
static int hwmap_config_output(AVFilterLink *outlink)
Definition: vf_hwmap.c:53

Definition at line 413 of file vf_hwmap.c.

AVFilter ff_vf_hwmap
Initial value:
= {
.name = "hwmap",
.description = NULL_IF_CONFIG_SMALL("Map hardware frames"),
.uninit = hwmap_uninit,
.priv_size = sizeof(HWMapContext),
.priv_class = &hwmap_class,
.flags_internal = FF_FILTER_FLAG_HWFRAME_AWARE,
}
#define FF_FILTER_FLAG_HWFRAME_AWARE
The filter is aware of hardware frames, and any hardware frame context should not be automatically pr...
Definition: internal.h:385
static av_cold void hwmap_uninit(AVFilterContext *avctx)
Definition: vf_hwmap.c:363
static int hwmap_query_formats(AVFilterContext *avctx)
Definition: vf_hwmap.c:40
static const AVFilterPad hwmap_inputs[]
Definition: vf_hwmap.c:403
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:186
static const AVFilterPad outputs[]
Definition: af_acontrast.c:203
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
static const AVFilterPad hwmap_outputs[]
Definition: vf_hwmap.c:413
static int query_formats(AVFilterContext *ctx)
Definition: aeval.c:244

Definition at line 422 of file vf_hwmap.c.