Go to the documentation of this file.
24 #include "config_components.h"
45 #define HSTACK_NAME "hstack_qsv"
46 #define VSTACK_NAME "vstack_qsv"
47 #define XSTACK_NAME "xstack_qsv"
48 #define HWContext QSVVPPContext
49 #define StackHWContext StackQSVContext
59 static void rgb2yuv(
float r,
float g,
float b,
int *y,
int *
u,
int *v,
int depth)
61 *y = ((0.21260*219.0/255.0) *
r + (0.71520*219.0/255.0) *
g +
62 (0.07220*219.0/255.0) *
b) * ((1 << depth) - 1);
63 *
u = (-(0.11457*224.0/255.0) *
r - (0.38543*224.0/255.0) *
g +
64 (0.50000*224.0/255.0) *
b + 0.5) * ((1 << depth) - 1);
65 *v = ((0.50000*224.0/255.0) *
r - (0.45415*224.0/255.0) *
g -
66 (0.04585*224.0/255.0) *
b + 0.5) * ((1 << depth) - 1);
76 for (
int i = 0;
i <
ctx->nb_inputs;
i++) {
88 for (
int i = 0;
i <
ctx->nb_inputs;
i++)
105 mfxVPPCompInputStream *
is = sctx->
comp_conf.InputStream;
113 in_format = inlink0->
format;
129 }
else if (hwfc0->
device_ctx != hwfc->device_ctx) {
159 is[
i].GlobalAlpha = 255;
160 is[
i].GlobalAlphaEnable = 0;
161 is[
i].PixelAlphaEnable = 0;
193 sctx->
comp_conf.Header.BufferId = MFX_EXTBUFF_VPP_COMPOSITE;
235 #if CONFIG_HSTACK_QSV_FILTER
242 #if CONFIG_VSTACK_QSV_FILTER
249 #if CONFIG_XSTACK_QSV_FILTER
static av_cold void qsv_stack_uninit(AVFilterContext *ctx)
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
The official guide to swscale for confused that is
#define u(width, name, range_min, range_max)
enum AVPixelFormat out_sw_format
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.
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
AVRational time_base
Time base for the output events.
This structure describes decoded (raw) audio or video data.
static int process_frame(FFFrameSync *fs)
static enum AVPixelFormat qsv_stack_pix_fmts[]
A link between two filters.
Link properties exposed to filter code, but not external callers.
static int config_output(AVFilterLink *outlink)
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)
#define DEFINE_HSTACK_OPTIONS(api)
int64_t av_rescale_q(int64_t a, AVRational bq, AVRational cq)
Rescale a 64-bit integer by 2 rational numbers.
int ff_qsvvpp_close(AVFilterContext *avctx)
#define fs(width, name, subs,...)
#define DEFINE_XSTACK_OPTIONS(api)
@ AV_PIX_FMT_QSV
HW acceleration through QSV, data[3] contains a pointer to the mfxFrameSurface1 structure.
static FilterLink * ff_filter_link(AVFilterLink *link)
int64_t pts
Timestamp of the current event.
int ff_qsvvpp_filter_frame(QSVVPPContext *s, AVFilterLink *inlink, AVFrame *picref, AVFrame *propref)
#define AVFILTER_FLAG_HWDEVICE
The filter can create hardware frames using AVFilterContext.hw_device_ctx.
int format
agreed upon media format
#define DEFINE_VSTACK_OPTIONS(api)
AVFilterContext * src
source filter
FF_FILTER_FORWARD_WANTED(outlink, inlink)
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)
static int config_comm_output(AVFilterLink *outlink)
void * av_mallocz(size_t size)
Allocate a memory block with alignment suitable for all memory accesses (including vectors if availab...
int(* filter_frame)(AVFilterLink *outlink, AVFrame *frame)
int ff_qsvvpp_init(AVFilterContext *avctx, QSVVPPParam *param)
void * av_calloc(size_t nmemb, size_t size)
This struct describes a set or pool of "hardware" frames (i.e.
static int filter_callback(AVFilterLink *outlink, AVFrame *frame)
@ AV_PIX_FMT_NV12
planar YUV 4:2:0, 12bpp, 1 plane for Y and 1 plane for the UV components, which are interleaved (firs...
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 the filter must be ready for frames arriving randomly on any input any filter with several inputs will most likely require some kind of queuing mechanism It is perfectly acceptable to have a limited queue and to drop frames when the inputs are too unbalanced request_frame For filters that do not use the this method is called when a frame is wanted on an output For a it should directly call filter_frame on the corresponding output For a if there are queued frames already one of these frames should be pushed If the filter should request a frame on one of its repeatedly until at least one frame has been pushed Return or at least make progress towards producing a frame
AVHWDeviceContext * device_ctx
The parent AVHWDeviceContext.
static void rgb2yuv(float r, float g, float b, int *y, int *u, int *v, int depth)
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 qsv_stack_init(AVFilterContext *ctx)
mfxExtVPPComposite comp_conf