46 VAProcPipelineCaps pipeline_caps;
48 memset(&pipeline_caps, 0,
sizeof(pipeline_caps));
49 vas = vaQueryVideoProcPipelineCaps(vpp_ctx->
hwctx->
display,
53 if (vas != VA_STATUS_SUCCESS) {
55 "caps: %d (%s).\n", vas, vaErrorStr(vas));
59 if (!pipeline_caps.rotation_flags) {
99 support_flag = pipeline_caps.rotation_flags & (1 << ctx->
rotation_state);
108 support_flag = pipeline_caps.mirror_flags & ctx->
mirror_state;
126 VAProcPipelineParameterBuffer
params;
151 input_frame, output_frame);
201 "w:%d h:%d -> w:%d h:%d (passthrough mode)\n",
202 inlink->
w, inlink->
h, inlink->
w, inlink->
h);
233 #define OFFSET(x) offsetof(TransposeVAAPIContext, x) 234 #define FLAGS (AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_FILTERING_PARAM) 245 {
"passthrough",
"do not apply transposition if the input matches the specified geometry",
278 .
name =
"transpose_vaapi",
284 .
inputs = transpose_vaapi_inputs,
285 .
outputs = transpose_vaapi_outputs,
286 .priv_class = &transpose_vaapi_class,
#define FF_FILTER_FLAG_HWFRAME_AWARE
The filter is aware of hardware frames, and any hardware frame context should not be automatically pr...
This structure describes decoded (raw) audio or video data.
int ff_vaapi_vpp_config_input(AVFilterLink *inlink)
Main libavfilter public API header.
Memory handling functions.
int ff_vaapi_vpp_config_output(AVFilterLink *outlink)
static av_cold int init(AVCodecContext *avctx)
int h
agreed upon image height
AVFrame * ff_null_get_video_buffer(AVFilterLink *link, int w, int h)
AVFrame * ff_get_video_buffer(AVFilterLink *link, int w, int h)
Request a picture buffer with a specific set of permissions.
const char * name
Pad name.
AVFilterLink ** inputs
array of pointers to input links
static av_cold int transpose_vaapi_init(AVFilterContext *avctx)
int ff_filter_frame(AVFilterLink *link, AVFrame *frame)
Send a frame of data to the next filter.
static av_cold int uninit(AVCodecContext *avctx)
static int transpose_vaapi_build_filter_params(AVFilterContext *avctx)
int64_t pts
Presentation timestamp in time_base units (time when frame should be shown to user).
#define AV_LOG_VERBOSE
Detailed information.
A filter pad used for either input or output.
A link between two filters.
static const AVFilterPad transpose_vaapi_inputs[]
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
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. ...
static const AVOption transpose_vaapi_options[]
static int transpose_vaapi_filter_frame(AVFilterLink *inlink, AVFrame *input_frame)
void * priv
private data for use by the filter
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
simple assert() macros that are a bit more flexible than ISO C assert().
int w
agreed upon image width
AVBufferRef * hw_frames_ctx
For hwaccel pixel formats, this should be a reference to the AVHWFramesContext describing the frames...
void ff_vaapi_vpp_pipeline_uninit(AVFilterContext *avctx)
static int transpose_vaapi_vpp_config_output(AVFilterLink *outlink)
AVFilterContext * src
source filter
static AVFrame * get_video_buffer(AVFilterLink *inlink, int w, int h)
static const AVFilterPad outputs[]
VADisplay display
The VADisplay handle, to be filled by the user.
int format
format of the frame, -1 if unknown or unset Values correspond to enum AVPixelFormat for video frames...
AVFilter ff_vf_transpose_vaapi
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 inputs
static int output_frame(H264Context *h, AVFrame *dst, H264Picture *srcp)
AVFILTER_DEFINE_CLASS(transpose_vaapi)
const char * name
Filter name.
AVFilterLink ** outputs
array of pointers to output links
enum AVPixelFormat output_format
AVVAAPIDeviceContext * hwctx
AVFrame * ff_default_get_video_buffer(AVFilterLink *link, int w, int h)
int ff_vaapi_vpp_render_picture(AVFilterContext *avctx, VAProcPipelineParameterBuffer *params, AVFrame *output_frame)
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
int ff_vaapi_vpp_query_formats(AVFilterContext *avctx)
static int query_formats(AVFilterContext *ctx)
void ff_vaapi_vpp_ctx_init(AVFilterContext *avctx)
AVBufferRef * av_buffer_ref(AVBufferRef *buf)
Create a new reference to an AVBuffer.
AVFilterContext * dst
dest filter
int ff_vaapi_vpp_init_params(AVFilterContext *avctx, VAProcPipelineParameterBuffer *params, const AVFrame *input_frame, AVFrame *output_frame)
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(* build_filter_params)(AVFilterContext *avctx)
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
void(* pipeline_uninit)(AVFilterContext *avctx)
void ff_vaapi_vpp_ctx_uninit(AVFilterContext *avctx)
static const AVFilterPad transpose_vaapi_outputs[]
int av_frame_copy_props(AVFrame *dst, const AVFrame *src)
Copy only "metadata" fields from src to dst.