42#define OFFSET(x) offsetof(QSVOverlayContext, x)
43#define FLAGS (AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_FILTERING_PARAM)
88 {
"eof_action",
"Action to take when encountering EOF from secondary input ",
109#define PASS_EXPR(e, s) {\
110 ret = av_expr_parse(&e, s, var_names, NULL, NULL, NULL, NULL, 0, ctx); \
112 av_log(ctx, AV_LOG_ERROR, "Error when passing '%s'.\n", s);\
180 mfxVPPCompInputStream *st = &vpp->
comp_conf.InputStream[0];
192 st->DstW = inlink->
w;
193 st->DstH = inlink->
h;
194 st->GlobalAlphaEnable = 0;
195 st->PixelAlphaEnable = 0;
204 mfxVPPCompInputStream *st = &vpp->
comp_conf.InputStream[1];
222 st->GlobalAlphaEnable = (st->GlobalAlpha < 255);
235 for (
i = 0;
i <
ctx->nb_inputs;
i++) {
242 if (ret < 0 && ret !=
AVERROR(EAGAIN))
260 for (
i = 0;
i <
ctx->nb_inputs;
i++) {
264 in->
sync =
i ? 1 : 2;
331 vpp->
comp_conf.Header.BufferId = MFX_EXTBUFF_VPP_COMPOSITE;
390 for (
i = 0;
i <
ctx->nb_inputs;
i++) {
427 .p.name =
"overlay_qsv",
429 .p.priv_class = &overlay_qsv_class,
432 .
preinit = overlay_qsv_framesync_preinit,
const FFFilter ff_vf_overlay_qsv
static AVFormatContext * ctx
int ff_filter_frame(AVFilterLink *link, AVFrame *frame)
Send a frame of data to the next filter.
Main libavfilter public API header.
#define i(width, name, range_min, range_max)
#define fs(width, name, subs,...)
common internal and external API header
static enum AVPixelFormat pix_fmt
int(* init)(AVBSFContext *ctx)
void av_expr_free(AVExpr *e)
Free a parsed expression previously created with av_expr_parse().
double av_expr_eval(AVExpr *e, const double *const_values, void *opaque)
Evaluate a previously parsed expression.
simple arithmetic expression evaluator
static av_always_inline int process_frame(AVTextFormatContext *tfc, InputFile *ifile, AVFrame *frame, const AVPacket *pkt, int *packet_new)
int ff_framesync_configure(FFFrameSync *fs)
Configure a frame sync structure.
int ff_framesync_activate(FFFrameSync *fs)
Examine the frames in the filter's input and try to produce output.
int ff_framesync_get_frame(FFFrameSync *fs, unsigned in, AVFrame **rframe, unsigned get)
Get the current frame in an input.
void ff_framesync_uninit(FFFrameSync *fs)
Free all memory currently allocated.
int ff_framesync_init(FFFrameSync *fs, AVFilterContext *parent, unsigned nb_in)
Initialize a frame sync structure.
#define FRAMESYNC_DEFINE_CLASS(name, context, field)
@ EXT_INFINITY
Extend the frame to infinity.
@ AV_OPT_TYPE_CONST
Special option type for declaring named constants.
@ AV_OPT_TYPE_INT
Underlying C type is int.
@ AV_OPT_TYPE_BOOL
Underlying C type is int.
@ AV_OPT_TYPE_STRING
Underlying C type is a uint8_t* that is either NULL or points to a C string allocated with the av_mal...
#define AVFILTER_FLAG_HWDEVICE
The filter can create hardware frames using AVFilterContext.hw_device_ctx.
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
static av_always_inline AVRational av_inv_q(AVRational q)
Invert a rational.
int64_t av_rescale_q(int64_t a, AVRational bq, AVRational cq)
Rescale a 64-bit integer by 2 rational numbers.
static av_cold void uninit(AVBitStreamFilterContext *ctx)
static int activate(AVBitStreamFilterContext *ctx)
static int config_output(AVBitStreamFilterLink *outlink)
#define FILTER_INPUTS(array)
#define FILTER_OUTPUTS(array)
#define FF_FILTER_FLAG_HWFRAME_AWARE
The filter is aware of hardware frames, and any hardware frame context should not be automatically pr...
static FilterLink * ff_filter_link(AVFilterLink *link)
#define FF_INLINK_IDX(link)
Find the index of a link.
#define FILTER_QUERY_FUNC2(func)
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
void * av_calloc(size_t nmemb, size_t size)
Memory handling functions.
static const char *const var_names[]
@ EXT_STOP
Completely stop all streams with this one.
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.
const AVPixFmtDescriptor * av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
#define AV_PIX_FMT_FLAG_ALPHA
The pixel format has an alpha channel.
AVPixelFormat
Pixel format.
@ 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...
@ AV_PIX_FMT_YUV420P
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
@ AV_PIX_FMT_YUYV422
packed YUV 4:2:2, 16bpp, Y0 Cb Y1 Cr
@ AV_PIX_FMT_QSV
HW acceleration through QSV, data[3] contains a pointer to the mfxFrameSurface1 structure.
AVFrame * ff_qsvvpp_get_video_buffer(AVFilterLink *inlink, int w, int h)
int ff_qsvvpp_filter_frame(QSVVPPContext *s, AVFilterLink *inlink, AVFrame *picref, AVFrame *propref)
int ff_qsvvpp_close(AVFilterContext *avctx)
int ff_qsvvpp_init(AVFilterContext *avctx, QSVVPPParam *param)
Intel Quick Sync Video VPP base function.
static av_cold int preinit(AVBitStreamFilterContext *ctx)
uint8_t * data
The data buffer.
void * priv
private data for use by the filter
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.
AVFilterContext * dst
dest filter
int format
agreed upon media format
A filter pad used for either input or output.
This structure describes decoded (raw) audio or video data.
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.
Descriptor that unambiguously describes how the bits of a pixel are stored in the up to 4 data planes...
enum FFFrameSyncExtMode after
Extrapolation mode for timestamps after the last frame.
enum FFFrameSyncExtMode before
Extrapolation mode for timestamps before the first frame.
AVRational time_base
Time base for the incoming frames.
unsigned sync
Synchronization level: frames on input at the highest sync level will generate output frame events.
Link properties exposed to filter code, but not external callers.
AVRational frame_rate
Frame rate of the stream on the link, or 1/0 if unknown or variable.
AVBufferRef * hw_frames_ctx
For hwaccel pixel formats, this should be a reference to the AVHWFramesContext describing the frames.
uint16_t overlay_pixel_alpha
double var_values[VAR_VARS_NB]
mfxExtVPPComposite comp_conf
int(* filter_frame)(AVFilterLink *outlink, AVFrame *frame)
enum AVPixelFormat out_sw_format
static enum AVPixelFormat out_pix_fmts[]
static int overlay_qsv_init(AVFilterContext *ctx)
static av_cold void overlay_qsv_uninit(AVFilterContext *ctx)
static const AVOption overlay_qsv_options[]
static int init_framesync(AVFilterContext *ctx)
static const AVFilterPad overlay_qsv_outputs[]
static const AVFilterPad overlay_qsv_inputs[]
static int eval_expr(AVFilterContext *ctx)
static int activate(AVFilterContext *ctx)
static int config_output(AVFilterLink *outlink)
static int overlay_qsv_query_formats(const AVFilterContext *ctx, AVFilterFormatsConfig **cfg_in, AVFilterFormatsConfig **cfg_out)
static int have_alpha_planar(AVFilterLink *link)
static int filter_callback(AVFilterLink *outlink, AVFrame *frame)
static int config_overlay_input(AVFilterLink *inlink)
static int config_main_input(AVFilterLink *inlink)
static int process_frame(FFFrameSync *fs)