va: compositor/filter: use scale method setter

Use the filter's scale method member instead of the sample's member.

Removes the filter_flags member from the composite sample.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2654>
This commit is contained in:
U. Artie Eoff 2022-06-23 11:39:57 -04:00
parent 280678fe42
commit 178f4fcd20
3 changed files with 6 additions and 5 deletions

View file

@ -1049,7 +1049,6 @@ gst_va_compositor_sample_next (gpointer data)
.height = (pad->height == DEFAULT_PAD_HEIGHT) .height = (pad->height == DEFAULT_PAD_HEIGHT)
? GST_VIDEO_INFO_HEIGHT (&vaggpad->info) : pad->height, ? GST_VIDEO_INFO_HEIGHT (&vaggpad->info) : pad->height,
}, },
.flags = generator->comp->scale_method,
.alpha = pad->alpha, .alpha = pad->alpha,
}; };
/* *INDENT-ON* */ /* *INDENT-ON* */
@ -1133,6 +1132,9 @@ gst_va_compositor_aggregate_frames (GstVideoAggregator * vagg,
GST_OBJECT_LOCK (self); GST_OBJECT_LOCK (self);
if (!gst_va_filter_set_scale_method (self->filter, self->scale_method))
GST_WARNING_OBJECT (self, "couldn't set filter scale method");
if (!gst_va_filter_compose (self->filter, &tx)) { if (!gst_va_filter_compose (self->filter, &tx)) {
GST_ERROR_OBJECT (self, "couldn't apply filter"); GST_ERROR_OBJECT (self, "couldn't apply filter");
ret = GST_FLOW_ERROR; ret = GST_FLOW_ERROR;

View file

@ -1806,15 +1806,17 @@ gst_va_filter_compose (GstVaFilter * self, GstVaComposeTransaction * tx)
/* (transfer full), unref it */ /* (transfer full), unref it */
gst_buffer_unref (sample->buffer); gst_buffer_unref (sample->buffer);
GST_OBJECT_LOCK (self);
/* *INDENT-OFF* */ /* *INDENT-OFF* */
params = (VAProcPipelineParameterBuffer) { params = (VAProcPipelineParameterBuffer) {
.surface = in_surface, .surface = in_surface,
.surface_region = &sample->input_region, .surface_region = &sample->input_region,
.output_region = &sample->output_region, .output_region = &sample->output_region,
.output_background_color = 0xff000000, .output_background_color = 0xff000000,
.filter_flags = sample->flags, .filter_flags = self->scale_method,
}; };
/* *INDENT-ON* */ /* *INDENT-ON* */
GST_OBJECT_UNLOCK (self);
/* only send blend state when sample is not fully opaque */ /* only send blend state when sample is not fully opaque */
if ((self->pipeline_caps.blend_flags & VA_BLEND_GLOBAL_ALPHA) if ((self->pipeline_caps.blend_flags & VA_BLEND_GLOBAL_ALPHA)

View file

@ -87,9 +87,6 @@ struct _GstVaComposeSample
/* input buffer (transfer full) */ /* input buffer (transfer full) */
GstBuffer *buffer; GstBuffer *buffer;
/* scale method flags */
guint32 flags;
VARectangle input_region; VARectangle input_region;
VARectangle output_region; VARectangle output_region;