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
65 VARectangle *irect =
NULL;
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];
108 if (sctx->
base.fillcolor_enable)
109 params[
i].output_background_color = (sctx->
base.fillcolor[3] << 24 |
110 sctx->
base.fillcolor[0] << 16 |
111 sctx->
base.fillcolor[1] << 8 |
112 sctx->
base.fillcolor[2]);
150 for (
int i = 1;
i < sctx->
base.nb_inputs;
i++) {
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");
180 for (
int i = 0;
i < sctx->
base.nb_inputs;
i++) {
183 sctx->
rects[
i].width = sctx->
base.regions[
i].width;
184 sctx->
rects[
i].height = sctx->
base.regions[
i].height;
230#if CONFIG_HSTACK_VAAPI_FILTER
237#if CONFIG_VSTACK_VAAPI_FILTER
244#if CONFIG_XSTACK_VAAPI_FILTER
SwsAArch64OpImplParams params
simple assert() macros that are a bit more flexible than ISO C assert().
int ff_filter_frame(AVFilterLink *link, AVFrame *frame)
Send a frame of data to the next filter.
#define i(width, name, range_min, range_max)
#define fs(width, name, subs,...)
common internal and external API header
simple arithmetic expression evaluator
int ff_framesync_get_frame(FFFrameSync *fs, unsigned in, AVFrame **rframe, unsigned get)
Get the current frame in an input.
void av_frame_free(AVFrame **frame)
Free the frame and any dynamically allocated objects in it, e.g.
int av_frame_copy_props(AVFrame *dst, const AVFrame *src)
Copy only "metadata" fields from src to dst.
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
int64_t av_rescale_q(int64_t a, AVRational bq, AVRational cq)
Rescale a 64-bit integer by 2 rational numbers.
static FilterLink * ff_filter_link(AVFilterLink *link)
void * av_calloc(size_t nmemb, size_t size)
Memory handling functions.
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.
@ AV_PIX_FMT_VAAPI
Hardware acceleration through VA-API, data[3] contains a VASurfaceID.
static int stack_init(AVFilterContext *avctx)
static int config_comm_output(AVFilterLink *outlink)
#define DEFINE_XSTACK_OPTIONS(api)
#define DEFINE_VSTACK_OPTIONS(api)
#define DEFINE_STACK_FILTER(category, api, capi, filter_flags)
#define DEFINE_HSTACK_OPTIONS(api)
static av_cold void stack_uninit(AVFilterContext *avctx)
uint8_t * data
The data buffer.
unsigned nb_inputs
number of input pads
AVFilterLink ** inputs
array of pointers to input links
void * priv
private data for use by the filter
AVFilterLink ** outputs
array of pointers to output links
A link between two filters.
int w
agreed upon image width
int h
agreed upon image height
AVFilterContext * src
source filter
AVRational time_base
Define the time base used by the PTS of the frames/samples which will pass through this link.
AVRational sample_aspect_ratio
agreed upon sample aspect ratio
int format
agreed upon media format
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).
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
AVRational sample_aspect_ratio
Sample aspect ratio for the video frame, 0/1 if unknown/unspecified.
int format
format of the frame, -1 if unknown or unset Values correspond to enum AVPixelFormat for video frames,...
This struct describes a set or pool of "hardware" frames (i.e.
enum AVPixelFormat sw_format
The pixel format identifying the actual data layout of the hardware frames.
AVHWDeviceContext * device_ctx
The parent AVHWDeviceContext.
Link properties exposed to filter code, but not external callers.
AVBufferRef * hw_frames_ctx
For hwaccel pixel formats, this should be a reference to the AVHWFramesContext describing the frames.
enum AVPixelFormat output_format
int ff_vaapi_vpp_render_pictures(AVFilterContext *avctx, VAProcPipelineParameterBuffer *params_list, int cout, AVFrame *output_frame)
int ff_vaapi_vpp_config_output(AVFilterLink *outlink)
int ff_vaapi_vpp_config_input(AVFilterLink *inlink)
void ff_vaapi_vpp_ctx_init(AVFilterContext *avctx)
int ff_vaapi_vpp_init_params(AVFilterContext *avctx, VAProcPipelineParameterBuffer *params, const AVFrame *input_frame, AVFrame *output_frame)
static int vaapi_stack_init(AVFilterContext *avctx)
static av_cold void vaapi_stack_uninit(AVFilterContext *avctx)
static enum AVPixelFormat vaapi_stack_pix_fmts[]
static int config_output(AVFilterLink *outlink)
static int process_frame(FFFrameSync *fs)
AVFrame * ff_get_video_buffer(AVFilterLink *link, int w, int h)
Request a picture buffer with a specific set of permissions.