diff options
author | U. Artie Eoff <ullysses.a.eoff@intel.com> | 2020-02-21 07:37:50 -0800 |
---|---|---|
committer | U. Artie Eoff <ullysses.a.eoff@intel.com> | 2020-02-21 08:49:06 -0800 |
commit | 4573d3eefe84c99fc4fda6d2b749abcb72abc7da (patch) | |
tree | 6c79fa9cd051b031dd9842e104b98c966a05fb3e /gst/vaapi/gstvaapipostprocutil.c | |
parent | 39f2c932ee8ef2f61e6980db15097053660a5aa4 (diff) |
vaapipostproc: do not compensate for crop/direction if no VPP
If we do not have functional VPP, then cropping and video
direction is non-functional and we should avoid calling
any of the gst_vaapi_filter* APIs.
Diffstat (limited to 'gst/vaapi/gstvaapipostprocutil.c')
-rw-r--r-- | gst/vaapi/gstvaapipostprocutil.c | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/gst/vaapi/gstvaapipostprocutil.c b/gst/vaapi/gstvaapipostprocutil.c index 94ece028..715a449e 100644 --- a/gst/vaapi/gstvaapipostprocutil.c +++ b/gst/vaapi/gstvaapipostprocutil.c @@ -179,20 +179,22 @@ _fixate_frame_size (GstVaapiPostproc * postproc, GstVideoInfo * vinfo, from_w = GST_VIDEO_INFO_WIDTH (vinfo); from_h = GST_VIDEO_INFO_HEIGHT (vinfo); - /* adjust for crop settings */ - from_w -= postproc->crop_left + postproc->crop_right; - from_h -= postproc->crop_top + postproc->crop_bottom; - - /* compensate for rotation if needed */ - switch (gst_vaapi_filter_get_video_direction (postproc->filter)) { - case GST_VIDEO_ORIENTATION_90R: - case GST_VIDEO_ORIENTATION_90L: - case GST_VIDEO_ORIENTATION_UL_LR: - case GST_VIDEO_ORIENTATION_UR_LL: - G_PRIMITIVE_SWAP (gint, from_w, from_h); - G_PRIMITIVE_SWAP (gint, from_par_n, from_par_d); - default: - break; + if (postproc->has_vpp) { + /* adjust for crop settings */ + from_w -= postproc->crop_left + postproc->crop_right; + from_h -= postproc->crop_top + postproc->crop_bottom; + + /* compensate for rotation if needed */ + switch (gst_vaapi_filter_get_video_direction (postproc->filter)) { + case GST_VIDEO_ORIENTATION_90R: + case GST_VIDEO_ORIENTATION_90L: + case GST_VIDEO_ORIENTATION_UL_LR: + case GST_VIDEO_ORIENTATION_UR_LL: + G_PRIMITIVE_SWAP (gint, from_w, from_h); + G_PRIMITIVE_SWAP (gint, from_par_n, from_par_d); + default: + break; + } } gst_structure_get_int (outs, "width", &w); |