44 #define OFFSET(x) offsetof(QSVOverlayContext, x) 45 #define FLAGS (AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_FILTERING_PARAM) 99 {
"eof_action",
"Action to take when encountering EOF from secondary input ",
115 #define PASS_EXPR(e, s) {\ 116 ret = av_expr_parse(&e, s, var_names, NULL, NULL, NULL, NULL, 0, ctx); \ 118 av_log(ctx, AV_LOG_ERROR, "Error when passing '%s'.\n", s);\ 185 mfxVPPCompInputStream *st = &vpp->
comp_conf.InputStream[0];
197 st->DstW = inlink->
w;
198 st->DstH = inlink->
h;
199 st->GlobalAlphaEnable = 0;
200 st->PixelAlphaEnable = 0;
209 mfxVPPCompInputStream *st = &vpp->
comp_conf.InputStream[1];
227 st->GlobalAlphaEnable = (st->GlobalAlpha < 255);
243 av_log(ctx,
AV_LOG_ERROR,
"Mixing hardware and software pixel formats is not supported.\n");
249 if (hw_frame0->
device_ctx != hw_frame1->device_ctx) {
250 av_log(ctx,
AV_LOG_ERROR,
"Inputs with different underlying QSV devices are forbidden.\n");
270 if (ret == 0 || ret ==
AVERROR(EAGAIN)) {
381 vpp->
comp_conf.Header.BufferId = MFX_EXTBUFF_VPP_COMPOSITE;
483 .
name =
"overlay_qsv",
489 .
inputs = overlay_qsv_inputs,
490 .
outputs = overlay_qsv_outputs,
491 .priv_class = &overlay_qsv_class,
#define FF_FILTER_FLAG_HWFRAME_AWARE
The filter is aware of hardware frames, and any hardware frame context should not be automatically pr...
static enum AVPixelFormat pix_fmt
const AVPixFmtDescriptor * av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
This structure describes decoded (raw) audio or video data.
static int overlay_qsv_init(AVFilterContext *ctx)
#define LIBAVUTIL_VERSION_INT
Main libavfilter public API header.
static av_cold int init(AVCodecContext *avctx)
static int eval_expr(AVFilterContext *ctx)
int h
agreed upon image height
const char * av_default_item_name(void *ptr)
Return the context name.
static int config_output(AVFilterLink *outlink)
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
#define av_assert0(cond)
assert() equivalent, that is always enabled.
static int handle_overlay_eof(AVFilterContext *ctx)
static int filter_frame_main(AVFilterLink *inlink, AVFrame *frame)
int ff_qsvvpp_create(AVFilterContext *avctx, QSVVPPContext **vpp, QSVVPPParam *param)
#define AV_PIX_FMT_FLAG_ALPHA
The pixel format has an alpha channel.
static av_cold int uninit(AVCodecContext *avctx)
int64_t pts
Presentation timestamp in time_base units (time when frame should be shown to user).
static const AVClass overlay_qsv_class
static int overlay_qsv_query_formats(AVFilterContext *ctx)
#define AVERROR_EOF
End of file.
static void overlay_qsv_uninit(AVFilterContext *ctx)
A filter pad used for either input or output.
static int blend_frame(AVFilterContext *ctx, AVFrame *mpic, AVFrame *opic)
A link between two filters.
static const AVOption options[]
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
AVRational frame_rate
Frame rate of the stream on the link, or 1/0 if unknown or variable; if left to 0/0, will be automatically copied from the first input of the source filter if it exists.
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_LOG_DEBUG
Stuff which is only useful for libav* developers.
static int filter_frame_overlay(AVFilterLink *inlink, AVFrame *frame)
planar YUV 4:2:0, 12bpp, 1 plane for Y and 1 plane for the UV components, which are interleaved (firs...
AVRational time_base
Define the time base used by the PTS of the frames/samples which will pass through this link...
simple assert() macros that are a bit more flexible than ISO C assert().
void * av_mallocz(size_t size)
Allocate a memory block with alignment suitable for all memory accesses (including vectors if availab...
AVFilterFormats * in_formats
Lists of formats and channel layouts supported by the input and output filters respectively.
int av_compare_ts(int64_t ts_a, AVRational tb_a, int64_t ts_b, AVRational tb_b)
Compare two timestamps each in its own time base.
int w
agreed upon image width
uint64_t flags
Combination of AV_PIX_FMT_FLAG_...
mfxExtVPPComposite comp_conf
unsigned nb_inputs
number of input pads
AVBufferRef * hw_frames_ctx
For hwaccel pixel formats, this should be a reference to the AVHWFramesContext describing the frames...
static const AVFilterPad overlay_qsv_outputs[]
AVHWDeviceContext * device_ctx
The parent AVHWDeviceContext.
AVFilterContext * src
source filter
static const AVFilterPad inputs[]
AVFrame * av_frame_clone(const AVFrame *src)
Create a new frame that references the same data as src.
static const AVFilterPad outputs[]
int format
agreed upon media format
void av_expr_free(AVExpr *e)
Free a parsed expression previously created with av_expr_parse().
int ff_qsvvpp_filter_frame(QSVVPPContext *s, AVFilterLink *inlink, AVFrame *picref)
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.
packed YUV 4:2:2, 16bpp, Y0 Cb Y1 Cr
Describe the class of an AVClass context structure.
int ff_qsvvpp_free(QSVVPPContext **vpp)
Rational number (pair of numerator and denominator).
This struct describes a set or pool of "hardware" frames (i.e.
HW acceleration through QSV, data[3] contains a pointer to the mfxFrameSurface1 structure.
static int config_overlay_input(AVFilterLink *inlink)
const char * name
Filter name.
AVFilterLink ** outputs
array of pointers to output links
AVFilter ff_vf_overlay_qsv
static const AVFilterPad overlay_qsv_inputs[]
#define FF_INLINK_IDX(link)
Find the index of a link.
static av_always_inline AVRational av_inv_q(AVRational q)
Invert a rational.
static int have_alpha_planar(AVFilterLink *link)
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
static int query_formats(AVFilterContext *ctx)
common internal and external API header
double var_values[VAR_VARS_NB]
static enum AVPixelFormat out_pix_fmts[]
uint16_t overlay_pixel_alpha
enum EOFAction eof_action
static const char *const var_names[]
static int config_main_input(AVFilterLink *inlink)
static int request_frame(AVFilterLink *outlink)
double av_expr_eval(AVExpr *e, const double *const_values, void *opaque)
Evaluate a previously parsed expression.
AVFilterContext * dst
dest filter
enum AVPixelFormat out_sw_format
Intel Quick Sync Video VPP base function.
int(* filter_frame)(AVFilterLink *outlink, AVFrame *frame)
int ff_request_frame(AVFilterLink *link)
Request an input frame from the filter at the other end of the link.
#define FFSWAP(type, a, b)
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.
enum AVPixelFormat sw_format
The pixel format identifying the actual data layout of the hardware frames.
AVPixelFormat
Pixel format.
#define AV_NOPTS_VALUE
Undefined timestamp value.
AVFilterFormats * out_formats
simple arithmetic expression evaluator
void * av_mallocz_array(size_t nmemb, size_t size)
Allocate a memory block for an array with av_mallocz().