mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-20 00:31:13 +00:00
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.
This commit is contained in:
parent
39f2c932ee
commit
4573d3eefe
2 changed files with 33 additions and 24 deletions
|
@ -718,6 +718,8 @@ rotate_crop_meta (GstVaapiPostproc * const postproc, const GstVideoMeta * vmeta,
|
||||||
{
|
{
|
||||||
guint tmp;
|
guint tmp;
|
||||||
|
|
||||||
|
g_return_if_fail (postproc->has_vpp);
|
||||||
|
|
||||||
/* The video meta is required since the caps width/height are smaller,
|
/* The video meta is required since the caps width/height are smaller,
|
||||||
* which would not result in a usable GstVideoInfo for mapping the
|
* which would not result in a usable GstVideoInfo for mapping the
|
||||||
* buffer. */
|
* buffer. */
|
||||||
|
@ -1559,6 +1561,7 @@ gst_vaapipostproc_prepare_output_buffer (GstBaseTransform * trans,
|
||||||
info.width = video_meta->width;
|
info.width = video_meta->width;
|
||||||
info.height = video_meta->height;
|
info.height = video_meta->height;
|
||||||
|
|
||||||
|
if (postproc->has_vpp) {
|
||||||
/* compensate for rotation if needed */
|
/* compensate for rotation if needed */
|
||||||
switch (gst_vaapi_filter_get_video_direction (postproc->filter)) {
|
switch (gst_vaapi_filter_get_video_direction (postproc->filter)) {
|
||||||
case GST_VIDEO_ORIENTATION_90R:
|
case GST_VIDEO_ORIENTATION_90R:
|
||||||
|
@ -1569,6 +1572,7 @@ gst_vaapipostproc_prepare_output_buffer (GstBaseTransform * trans,
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ensure_buffer_pool (postproc, &info);
|
ensure_buffer_pool (postproc, &info);
|
||||||
}
|
}
|
||||||
|
@ -1765,6 +1769,8 @@ get_scale_factor (GstVaapiPostproc * const postproc, gdouble * w_factor,
|
||||||
gdouble wd = GST_VIDEO_INFO_WIDTH (&postproc->srcpad_info);
|
gdouble wd = GST_VIDEO_INFO_WIDTH (&postproc->srcpad_info);
|
||||||
gdouble hd = GST_VIDEO_INFO_HEIGHT (&postproc->srcpad_info);
|
gdouble hd = GST_VIDEO_INFO_HEIGHT (&postproc->srcpad_info);
|
||||||
|
|
||||||
|
g_return_if_fail (postproc->has_vpp);
|
||||||
|
|
||||||
switch (gst_vaapi_filter_get_video_direction (postproc->filter)) {
|
switch (gst_vaapi_filter_get_video_direction (postproc->filter)) {
|
||||||
case GST_VIDEO_ORIENTATION_90R:
|
case GST_VIDEO_ORIENTATION_90R:
|
||||||
case GST_VIDEO_ORIENTATION_90L:
|
case GST_VIDEO_ORIENTATION_90L:
|
||||||
|
@ -1801,8 +1807,9 @@ gst_vaapipostproc_src_event (GstBaseTransform * trans, GstEvent * event)
|
||||||
GST_EVENT (gst_mini_object_make_writable (GST_MINI_OBJECT (event)));
|
GST_EVENT (gst_mini_object_make_writable (GST_MINI_OBJECT (event)));
|
||||||
|
|
||||||
structure = (GstStructure *) gst_event_get_structure (event);
|
structure = (GstStructure *) gst_event_get_structure (event);
|
||||||
if (gst_structure_get_double (structure, "pointer_x", &x) &&
|
if (postproc->has_vpp
|
||||||
gst_structure_get_double (structure, "pointer_y", &y)) {
|
&& gst_structure_get_double (structure, "pointer_x", &x)
|
||||||
|
&& gst_structure_get_double (structure, "pointer_y", &y)) {
|
||||||
GST_DEBUG_OBJECT (postproc, "converting %fx%f", x, y);
|
GST_DEBUG_OBJECT (postproc, "converting %fx%f", x, y);
|
||||||
|
|
||||||
/* video-direction compensation */
|
/* video-direction compensation */
|
||||||
|
|
|
@ -179,6 +179,7 @@ _fixate_frame_size (GstVaapiPostproc * postproc, GstVideoInfo * vinfo,
|
||||||
from_w = GST_VIDEO_INFO_WIDTH (vinfo);
|
from_w = GST_VIDEO_INFO_WIDTH (vinfo);
|
||||||
from_h = GST_VIDEO_INFO_HEIGHT (vinfo);
|
from_h = GST_VIDEO_INFO_HEIGHT (vinfo);
|
||||||
|
|
||||||
|
if (postproc->has_vpp) {
|
||||||
/* adjust for crop settings */
|
/* adjust for crop settings */
|
||||||
from_w -= postproc->crop_left + postproc->crop_right;
|
from_w -= postproc->crop_left + postproc->crop_right;
|
||||||
from_h -= postproc->crop_top + postproc->crop_bottom;
|
from_h -= postproc->crop_top + postproc->crop_bottom;
|
||||||
|
@ -194,6 +195,7 @@ _fixate_frame_size (GstVaapiPostproc * postproc, GstVideoInfo * vinfo,
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
gst_structure_get_int (outs, "width", &w);
|
gst_structure_get_int (outs, "width", &w);
|
||||||
gst_structure_get_int (outs, "height", &h);
|
gst_structure_get_int (outs, "height", &h);
|
||||||
|
|
Loading…
Reference in a new issue