Go to the documentation of this file.
24 #include "config_components.h"
44 #define HSTACK_NAME "hstack_vaapi"
45 #define VSTACK_NAME "vstack_vaapi"
46 #define XSTACK_NAME "xstack_vaapi"
47 #define HWContext VAAPIVPPContext
48 #define StackHWContext StackVAAPIContext
64 VAProcPipelineParameterBuffer *params =
NULL;
65 VARectangle *irect =
NULL;
77 if (!irect || !params) {
102 irect[
i].width = iframe->
width;
103 irect[
i].height = iframe->
height;
104 params[
i].surface_region = &irect[
i];
105 params[
i].surface = (VASurfaceID)(uintptr_t)iframe->
data[3];
106 params[
i].output_region = &sctx->
rects[
i];
109 params[
i].output_background_color = (sctx->
base.
fillcolor[3] << 24 |
163 av_log(avctx,
AV_LOG_ERROR,
"All inputs should have the same underlying software pixel format.\n");
168 av_log(avctx,
AV_LOG_ERROR,
"All inputs should have the same underlying vaapi devices.\n");
230 #if CONFIG_HSTACK_VAAPI_FILTER
237 #if CONFIG_VSTACK_VAAPI_FILTER
244 #if CONFIG_XSTACK_VAAPI_FILTER
AVFrame * ff_get_video_buffer(AVFilterLink *link, int w, int h)
Request a picture buffer with a specific set of permissions.
void ff_vaapi_vpp_ctx_init(AVFilterContext *avctx)
AVPixelFormat
Pixel format.
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a all references to both lists are replaced with a reference to the intersection And when a single format is eventually chosen for a link amongst the remaining all references to the list are updated That means that if a filter requires that its input and output have the same format amongst a supported all it has to do is use a reference to the same list of formats query_formats can leave some formats unset and return AVERROR(EAGAIN) to cause the negotiation mechanism toagain later. That can be used by filters with complex requirements to use the format negotiated on one link to set the formats supported on another. Frame references ownership and permissions
static int config_output(AVFilterLink *outlink)
int ff_filter_frame(AVFilterLink *link, AVFrame *frame)
Send a frame of data to the next filter.
uint8_t * data
The data buffer.
int ff_framesync_get_frame(FFFrameSync *fs, unsigned in, AVFrame **rframe, unsigned get)
Get the current frame in an input.
static av_cold void vaapi_stack_uninit(AVFilterContext *avctx)
The exact code depends on how similar the blocks are and how related they are to the and needs to apply these operations to the correct inlink or outlink if there are several Macros are available to factor that when no extra processing is inlink
void av_frame_free(AVFrame **frame)
Free the frame and any dynamically allocated objects in it, e.g.
AVRational time_base
Time base for the output events.
This structure describes decoded (raw) audio or video data.
int64_t pts
Presentation timestamp in time_base units (time when frame should be shown to user).
int ff_vaapi_vpp_render_pictures(AVFilterContext *avctx, VAProcPipelineParameterBuffer *params_list, int cout, AVFrame *output_frame)
A link between two filters.
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
Link properties exposed to filter code, but not external callers.
void * priv
private data for use by the filter
#define DEFINE_STACK_FILTER(category, api, capi, filter_flags)
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
static av_cold void stack_uninit(AVFilterContext *avctx)
AVRational sample_aspect_ratio
agreed upon sample aspect ratio
#define DEFINE_HSTACK_OPTIONS(api)
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
enum AVPixelFormat output_format
int64_t av_rescale_q(int64_t a, AVRational bq, AVRational cq)
Rescale a 64-bit integer by 2 rational numbers.
enum AVPixelFormat sw_format
The pixel format identifying the actual data layout of the hardware frames.
int av_frame_copy_props(AVFrame *dst, const AVFrame *src)
Copy only "metadata" fields from src to dst.
#define fs(width, name, subs,...)
AVFilterLink ** inputs
array of pointers to input links
int ff_vaapi_vpp_config_input(AVFilterLink *inlink)
#define DEFINE_XSTACK_OPTIONS(api)
static FilterLink * ff_filter_link(AVFilterLink *link)
int64_t pts
Timestamp of the current event.
unsigned nb_inputs
number of input pads
int format
agreed upon media format
#define DEFINE_VSTACK_OPTIONS(api)
int format
format of the frame, -1 if unknown or unset Values correspond to enum AVPixelFormat for video frames,...
AVFilterContext * src
source filter
static enum AVPixelFormat vaapi_stack_pix_fmts[]
@ AV_PIX_FMT_VAAPI
Hardware acceleration through VA-API, data[3] contains a VASurfaceID.
AVBufferRef * hw_frames_ctx
For hwaccel pixel formats, this should be a reference to the AVHWFramesContext describing the frames.
StackItemRegion * regions
#define i(width, name, range_min, range_max)
int w
agreed upon image width
static int config_comm_output(AVFilterLink *outlink)
void * av_calloc(size_t nmemb, size_t size)
This struct describes a set or pool of "hardware" frames (i.e.
AVHWDeviceContext * device_ctx
The parent AVHWDeviceContext.
AVRational sample_aspect_ratio
Sample aspect ratio for the video frame, 0/1 if unknown/unspecified.
static int vaapi_stack_init(AVFilterContext *avctx)
int ff_vaapi_vpp_config_output(AVFilterLink *outlink)
int h
agreed upon image height
static int stack_init(AVFilterContext *avctx)
AVRational time_base
Define the time base used by the PTS of the frames/samples which will pass through this link.
static int process_frame(FFFrameSync *fs)
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.
int ff_vaapi_vpp_init_params(AVFilterContext *avctx, VAProcPipelineParameterBuffer *params, const AVFrame *input_frame, AVFrame *output_frame)
AVFilterLink ** outputs
array of pointers to output links