va: filter: add scale method field and setter

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2654>
This commit is contained in:
U. Artie Eoff 2022-06-23 11:11:16 -04:00
parent 63a8fc505e
commit 280678fe42
2 changed files with 17 additions and 0 deletions

View file

@ -58,6 +58,8 @@ struct _GstVaFilter
guint rotation; guint rotation;
GstVideoOrientationMethod orientation; GstVideoOrientationMethod orientation;
guint32 scale_method;
gboolean crop_enabled; gboolean crop_enabled;
VARectangle input_region; VARectangle input_region;
@ -934,6 +936,18 @@ gst_va_filter_get_surface_formats (GstVaFilter * self)
return ret; return ret;
} }
gboolean
gst_va_filter_set_scale_method (GstVaFilter * self, guint32 method)
{
g_return_val_if_fail (GST_IS_VA_FILTER (self), FALSE);
GST_OBJECT_LOCK (self);
self->scale_method = method;
GST_OBJECT_UNLOCK (self);
return TRUE;
}
static gboolean static gboolean
_from_video_orientation_method (GstVideoOrientationMethod orientation, _from_video_orientation_method (GstVideoOrientationMethod orientation,
guint * mirror, guint * rotation) guint * mirror, guint * rotation)
@ -1617,6 +1631,7 @@ _create_pipeline_buffer (GstVaFilter * self, GstVaSample * src,
.output_surface_flag = dst->flags, .output_surface_flag = dst->flags,
.input_color_properties = self->input_color_properties, .input_color_properties = self->input_color_properties,
.output_color_properties = self->output_color_properties, .output_color_properties = self->output_color_properties,
.filter_flags = self->scale_method,
/* output to SDR */ /* output to SDR */
.output_hdr_metadata = NULL, .output_hdr_metadata = NULL,
}; };

View file

@ -120,6 +120,8 @@ gboolean gst_va_filter_install_properties (GstVaFilter * self,
gboolean gst_va_filter_install_deinterlace_properties gboolean gst_va_filter_install_deinterlace_properties
(GstVaFilter * self, (GstVaFilter * self,
GObjectClass * klass); GObjectClass * klass);
gboolean gst_va_filter_set_scale_method (GstVaFilter * self,
guint32 method);
gboolean gst_va_filter_set_orientation (GstVaFilter * self, gboolean gst_va_filter_set_orientation (GstVaFilter * self,
GstVideoOrientationMethod orientation); GstVideoOrientationMethod orientation);
GstVideoOrientationMethod gst_va_filter_get_orientation (GstVaFilter * self); GstVideoOrientationMethod gst_va_filter_get_orientation (GstVaFilter * self);