109 "hwmap: from %s (%s) to %s.\n",
145 "context for backward mapping: %d.\n", err);
151 "context (a device, or frames on input).\n");
161 outlink->
w = inlink->
w;
162 outlink->
h = inlink->
h;
185 "frame for software mapping.\n");
198 "software: %d.\n", err);
279 #define OFFSET(x) offsetof(HWMapContext, x)
280 #define FLAGS (AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM)
282 {
"mode",
"Frame mapping mode",
285 0, INT_MAX,
FLAGS,
"mode" },
287 {
"read",
"Mapping should be readable",
289 INT_MIN, INT_MAX,
FLAGS,
"mode" },
290 {
"write",
"Mapping should be writeable",
292 INT_MIN, INT_MAX,
FLAGS,
"mode" },
293 {
"overwrite",
"Mapping will always overwrite the entire frame",
295 INT_MIN, INT_MAX,
FLAGS,
"mode" },
296 {
"direct",
"Mapping should not involve any copying",
298 INT_MIN, INT_MAX,
FLAGS,
"mode" },
329 .priv_class = &hwmap_class,
#define FF_FILTER_FLAG_HWFRAME_AWARE
The filter is aware of hardware frames, and any hardware frame context should not be automatically pr...
void av_buffer_unref(AVBufferRef **buf)
Free a given reference and automatically free the buffer if there are no more references to it...
const AVPixFmtDescriptor * av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
This structure describes decoded (raw) audio or video data.
The mapped frame will be overwritten completely in subsequent operations, so the current frame data n...
The mapping must be writeable.
static int hwmap_filter_frame(AVFilterLink *link, AVFrame *input)
Main libavfilter public API header.
int h
agreed upon image height
int width
The allocated dimensions of the frames in this pool.
AVBufferRef * hw_device_ctx
For filters which will create hardware frames, sets the device the filter should create them in...
enum AVPixelFormat format
The pixel format identifying the underlying HW surface type.
AVFrame * ff_get_video_buffer(AVFilterLink *link, int w, int h)
Request a picture buffer with a specific set of permissions.
static av_cold void hwmap_uninit(AVFilterContext *avctx)
AVBufferRef * hw_frames_ctx
For hwaccel-format frames, this should be a reference to the AVHWFramesContext describing the frame...
const char * name
Pad name.
AVFilterLink ** inputs
array of pointers to input links
int ff_filter_frame(AVFilterLink *link, AVFrame *frame)
Send a frame of data to the next filter.
int av_hwframe_ctx_create_derived(AVBufferRef **derived_frame_ctx, enum AVPixelFormat format, AVBufferRef *derived_device_ctx, AVBufferRef *source_frame_ctx, int flags)
Create and initialise an AVHWFramesContext as a mapping of another existing AVHWFramesContext on a di...
AVFrame * av_frame_alloc(void)
Allocate an AVFrame and set its fields to default values.
static int hwmap_query_formats(AVFilterContext *avctx)
AVFILTER_DEFINE_CLASS(hwmap)
int64_t pts
Presentation timestamp in time_base units (time when frame should be shown to user).
static const AVOption hwmap_options[]
static const AVFilterPad hwmap_inputs[]
A filter pad used for either input or output.
A link between two filters.
int width
width and height of the video frame
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
AVBufferRef * hwframes_ref
void av_frame_free(AVFrame **frame)
Free the frame and any dynamically allocated objects in it, e.g.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
void * priv
private data for use by the filter
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
#define AV_PIX_FMT_FLAG_HWACCEL
Pixel format is an HW accelerated format.
AVFilterFormats * in_formats
Lists of formats and channel layouts supported by the input and output filters respectively.
int av_hwframe_ctx_init(AVBufferRef *ref)
Finalize the context before use.
int w
agreed upon image width
uint64_t flags
Combination of AV_PIX_FMT_FLAG_...
AVBufferRef * hw_frames_ctx
For hwaccel pixel formats, this should be a reference to the AVHWFramesContext describing the frames...
AVFilterContext * src
source filter
static const AVFilterPad outputs[]
int format
agreed upon media format
int format
format of the frame, -1 if unknown or unset Values correspond to enum AVPixelFormat for video frames...
static AVFrame * hwmap_get_buffer(AVFilterLink *inlink, int w, int h)
static const AVFilterPad inputs[]
Descriptor that unambiguously describes how the bits of a pixel are stored in the up to 4 data planes...
uint8_t * data
The data buffer.
Describe the class of an AVClass context structure.
This struct describes a set or pool of "hardware" frames (i.e.
AVBufferRef * hwdevice_ref
refcounted data buffer API
const char * name
Filter name.
const VDPAUPixFmtMap * map
static const AVFilterPad hwmap_outputs[]
AVFilterLink ** outputs
array of pointers to output links
The mapping must be readable.
AVFrame * ff_default_get_video_buffer(AVFilterLink *link, int w, int h)
static int hwmap_config_output(AVFilterLink *outlink)
A reference to a data buffer.
static int query_formats(AVFilterContext *ctx)
int av_hwframe_map(AVFrame *dst, const AVFrame *src, int flags)
Map a hardware frame.
AVBufferRef * av_hwframe_ctx_alloc(AVBufferRef *device_ref_in)
Allocate an AVHWFramesContext tied to a given device context.
AVBufferRef * av_buffer_ref(AVBufferRef *buf)
Create a new reference to an AVBuffer.
AVFilterContext * dst
dest filter
The mapping must be direct.
const char * av_get_pix_fmt_name(enum AVPixelFormat pix_fmt)
Return the short name for a pixel format, NULL in case pix_fmt is unknown.
enum AVPixelFormat sw_format
The pixel format identifying the actual data layout of the hardware frames.
mode
Use these values in ebur128_init (or'ed).
int av_frame_copy_props(AVFrame *dst, const AVFrame *src)
Copy only "metadata" fields from src to dst.
AVFilterFormats * out_formats