MSDK: Handle context query into the VPP's query function.

The MSDK VPP's query function is not set and it just forwards
all query to its base class. We now need to answer the context
query correctly. Other VA plugins need to query the VA display.

By the way, the current query of "gst.msdk.Context" is also missing.
The other MSDK elements must depend on the bin's context message(
sent in context_propagate()) to set their MsdkContext correctly.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1087>
This commit is contained in:
He Junyan 2021-08-17 22:36:59 +08:00 committed by GStreamer Marge Bot
parent db5be289c7
commit 2928b14b69

View file

@ -1468,6 +1468,33 @@ gst_msdkvpp_stop (GstBaseTransform * trans)
return TRUE; return TRUE;
} }
static gboolean
gst_msdkvpp_query (GstBaseTransform * trans, GstPadDirection direction,
GstQuery * query)
{
GstMsdkVPP *thiz = GST_MSDKVPP (trans);
gboolean ret = FALSE;
switch (GST_QUERY_TYPE (query)) {
case GST_QUERY_CONTEXT:{
GstMsdkContext *msdk_context = NULL;
gst_object_replace ((GstObject **) & msdk_context,
(GstObject *) thiz->context);
ret = gst_msdk_handle_context_query (GST_ELEMENT_CAST (trans),
query, msdk_context);
gst_clear_object (&msdk_context);
break;
}
default:
ret = GST_BASE_TRANSFORM_CLASS (parent_class)->query (trans,
direction, query);
break;
}
return ret;
}
static void static void
gst_msdkvpp_set_property (GObject * object, guint prop_id, gst_msdkvpp_set_property (GObject * object, guint prop_id,
const GValue * value, GParamSpec * pspec) const GValue * value, GParamSpec * pspec)
@ -1701,6 +1728,7 @@ gst_msdkvpp_class_init (GstMsdkVPPClass * klass)
GST_DEBUG_FUNCPTR (gst_msdkvpp_decide_allocation); GST_DEBUG_FUNCPTR (gst_msdkvpp_decide_allocation);
trans_class->prepare_output_buffer = trans_class->prepare_output_buffer =
GST_DEBUG_FUNCPTR (gst_msdkvpp_prepare_output_buffer); GST_DEBUG_FUNCPTR (gst_msdkvpp_prepare_output_buffer);
trans_class->query = GST_DEBUG_FUNCPTR (gst_msdkvpp_query);
obj_properties[PROP_HARDWARE] = obj_properties[PROP_HARDWARE] =
g_param_spec_boolean ("hardware", "Hardware", "Enable hardware VPP", g_param_spec_boolean ("hardware", "Hardware", "Enable hardware VPP",