106 if (formats[i] == outlink->
format) {
119 outlink->
w = inlink->
w;
120 outlink->
h = inlink->
h;
140 "hwframe context.\n");
158 output->
width = outlink->
w;
209 .
name =
"hwdownload",
214 .priv_class = &hwdownload_class,
215 .
inputs = hwdownload_inputs,
static av_cold void hwdownload_uninit(AVFilterContext *avctx)
#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...
This structure describes decoded (raw) audio or video data.
#define LIBAVUTIL_VERSION_INT
Main libavfilter public API header.
Memory handling functions.
int h
agreed upon image height
int width
The allocated dimensions of the frames in this pool.
static int hwdownload_filter_frame(AVFilterLink *link, AVFrame *input)
AVFrame * ff_get_video_buffer(AVFilterLink *link, int w, int h)
Request a picture buffer with a specific set of permissions.
AVBufferRef * hw_frames_ctx
For hwaccel-format frames, this should be a reference to the AVHWFramesContext describing the frame...
const char * name
Pad name.
const char * class_name
The name of the class; usually it is the same name as the context structure type to which the AVClass...
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.
static const AVFilterPad hwdownload_inputs[]
AVFilter ff_vf_hwdownload
static const AVClass hwdownload_class
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.
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_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 w
agreed upon image width
int av_hwframe_transfer_data(AVFrame *dst, const AVFrame *src, int flags)
Copy data to or from a hw surface.
uint64_t flags
Combination of AV_PIX_FMT_FLAG_...
enum AVPixelFormat av_pix_fmt_desc_get_id(const AVPixFmtDescriptor *desc)
Transfer the data from the queried hw frame.
static int hwdownload_config_output(AVFilterLink *outlink)
AVBufferRef * hw_frames_ctx
For hwaccel pixel formats, this should be a reference to the AVHWFramesContext describing the frames...
AVHWFramesContext * hwframes
AVFilterContext * src
source filter
static const AVFilterPad outputs[]
int format
agreed upon media format
static int hwdownload_config_input(AVFilterLink *inlink)
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.
refcounted data buffer API
const char * name
Filter name.
AVFilterLink ** outputs
array of pointers to output links
static const AVFilterPad hwdownload_outputs[]
A reference to a data buffer.
AVBufferRef * av_buffer_ref(AVBufferRef *buf)
Create a new reference to an AVBuffer.
static int hwdownload_query_formats(AVFilterContext *avctx)
AVFilterContext * dst
dest filter
AVBufferRef * hwframes_ref
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.
AVPixelFormat
Pixel format.
int av_frame_copy_props(AVFrame *dst, const AVFrame *src)
Copy only "metadata" fields from src to dst.
AVFilterFormats * out_formats
int av_hwframe_transfer_get_formats(AVBufferRef *hwframe_ref, enum AVHWFrameTransferDirection dir, enum AVPixelFormat **formats, int flags)
Get a list of possible source or target formats usable in av_hwframe_transfer_data().
const AVPixFmtDescriptor * av_pix_fmt_desc_next(const AVPixFmtDescriptor *prev)
Iterate over all pixel format descriptors known to libavutil.