44 VAProcPipelineCaps pipeline_caps;
46 memset(&pipeline_caps, 0,
sizeof(pipeline_caps));
47 vas = vaQueryVideoProcPipelineCaps(vpp_ctx->
hwctx->
display,
51 if (vas != VA_STATUS_SUCCESS) {
53 "caps: %d (%s).\n", vas, vaErrorStr(vas));
57 if (!pipeline_caps.rotation_flags) {
64 ctx->rotation_state = VA_ROTATION_270;
65 ctx->mirror_state = VA_MIRROR_VERTICAL;
68 ctx->rotation_state = VA_ROTATION_90;
69 ctx->mirror_state = VA_MIRROR_NONE;
72 ctx->rotation_state = VA_ROTATION_270;
73 ctx->mirror_state = VA_MIRROR_NONE;
76 ctx->rotation_state = VA_ROTATION_90;
77 ctx->mirror_state = VA_MIRROR_VERTICAL;
80 ctx->rotation_state = VA_ROTATION_180;
81 ctx->mirror_state = VA_MIRROR_NONE;
84 ctx->rotation_state = VA_ROTATION_NONE;
85 ctx->mirror_state = VA_MIRROR_HORIZONTAL;
88 ctx->rotation_state = VA_ROTATION_NONE;
89 ctx->mirror_state = VA_MIRROR_VERTICAL;
96 if (VA_ROTATION_NONE !=
ctx->rotation_state) {
97 support_flag = pipeline_caps.rotation_flags & (1 <<
ctx->rotation_state);
100 ctx->rotation_state);
105 if (VA_MIRROR_NONE !=
ctx->mirror_state) {
106 support_flag = pipeline_caps.mirror_flags &
ctx->mirror_state;
124 VAProcPipelineParameterBuffer
params;
127 if (
ctx->passthrough)
153 params.rotation_state =
ctx->rotation_state;
201 "w:%d h:%d -> w:%d h:%d (passthrough mode)\n",
202 inlink->
w, inlink->
h, inlink->
w, inlink->
h);
228 return ctx->passthrough ?
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",
276 .p.name =
"transpose_vaapi",
278 .p.priv_class = &transpose_vaapi_class,
SwsAArch64OpImplParams params
const FFFilter ff_vf_transpose_vaapi
static AVFormatContext * ctx
static AVFrame * get_video_buffer(AVFilterLink *inlink, int w, int h)
int ff_filter_frame(AVFilterLink *link, AVFrame *frame)
Send a frame of data to the next filter.
Main libavfilter public API header.
int(* init)(AVBSFContext *ctx)
@ AV_OPT_TYPE_CONST
Special option type for declaring named constants.
@ AV_OPT_TYPE_INT
Underlying C type is int.
AVBufferRef * av_buffer_ref(const AVBufferRef *buf)
Create a new reference to an AVBuffer.
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_VERBOSE
Detailed information.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
static av_cold void uninit(AVBitStreamFilterContext *ctx)
static int output_frame(H264Context *h, AVFrame *dst, H264Picture *srcp)
#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 AVFILTER_DEFINE_CLASS(fname)
#define FILTER_QUERY_FUNC2(func)
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
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.
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
AVFilterContext * dst
dest filter
A filter pad used for either input or output.
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).
int format
format of the frame, -1 if unknown or unset Values correspond to enum AVPixelFormat for video frames,...
VADisplay display
The VADisplay handle, to be filled by the user.
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.
void(* pipeline_uninit)(AVFilterContext *avctx)
enum AVPixelFormat output_format
int(* build_filter_params)(AVFilterContext *avctx)
AVVAAPIDeviceContext * hwctx
@ TRANSPOSE_PT_TYPE_PORTRAIT
@ TRANSPOSE_PT_TYPE_LANDSCAPE
int ff_vaapi_vpp_config_output(AVFilterLink *outlink)
int ff_vaapi_vpp_config_input(AVFilterLink *inlink)
int ff_vaapi_vpp_query_formats(const AVFilterContext *avctx, AVFilterFormatsConfig **cfg_in, AVFilterFormatsConfig **cfg_out)
void ff_vaapi_vpp_pipeline_uninit(AVFilterContext *avctx)
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)
int ff_vaapi_vpp_render_picture(AVFilterContext *avctx, VAProcPipelineParameterBuffer *params, AVFrame *output_frame)
void ff_vaapi_vpp_ctx_uninit(AVFilterContext *avctx)
static const AVFilterPad transpose_vaapi_outputs[]
static AVFrame * get_video_buffer(AVFilterLink *inlink, int w, int h)
static int transpose_vaapi_vpp_config_output(AVFilterLink *outlink)
static int transpose_vaapi_filter_frame(AVFilterLink *inlink, AVFrame *input_frame)
static const AVFilterPad transpose_vaapi_inputs[]
static int transpose_vaapi_build_filter_params(AVFilterContext *avctx)
static const AVOption transpose_vaapi_options[]
static av_cold int transpose_vaapi_init(AVFilterContext *avctx)
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.
AVFrame * ff_default_get_video_buffer(AVFilterLink *link, int w, int h)