GstVaapiDecode *const decode = GST_VAAPIDECODE (vdec);
GstVaapiPluginBase *const plugin = GST_VAAPI_PLUGIN_BASE (decode);
- if (gst_vaapi_reply_to_query (query, plugin->display)) {
- GST_DEBUG_OBJECT (decode, "sharing display %p", plugin->display);
- return TRUE;
- }
-
switch (GST_QUERY_TYPE (query)) {
case GST_QUERY_CAPS:{
GstCaps *caps, *filter = NULL;
gst_caps_unref (caps);
break;
}
+ case GST_QUERY_CONTEXT:{
+ ret = gst_vaapi_handle_context_query (query, plugin->display);
+ break;
+ }
default:{
#if GST_CHECK_VERSION(1,4,0)
ret = GST_VIDEO_DECODER_CLASS (gst_vaapidecode_parent_class)->sink_query
GstVaapiDecode *const decode = GST_VAAPIDECODE (vdec);
GstVaapiPluginBase *const plugin = GST_VAAPI_PLUGIN_BASE (decode);
- if (gst_vaapi_reply_to_query (query, plugin->display)) {
- GST_DEBUG_OBJECT (decode, "sharing display %p", plugin->display);
- return TRUE;
- }
-
switch (GST_QUERY_TYPE (query)) {
case GST_QUERY_CAPS:{
GstCaps *caps, *filter = NULL;
gst_caps_unref (caps);
break;
}
+ case GST_QUERY_CONTEXT:{
+ ret = gst_vaapi_handle_context_query (query, plugin->display);
+ break;
+ }
default:{
#if GST_CHECK_VERSION(1,4,0)
ret = GST_VIDEO_DECODER_CLASS (gst_vaapidecode_parent_class)->src_query
GST_INFO_OBJECT (plugin, "query type %s", GST_QUERY_TYPE_NAME (query));
- if (gst_vaapi_reply_to_query (query, plugin->display))
- success = TRUE;
+ if (GST_QUERY_TYPE (query) == GST_QUERY_CONTEXT)
+ success = gst_vaapi_handle_context_query (query, plugin->display);
else if (GST_PAD_IS_SINK (pad))
success = plugin->sinkpad_query (plugin->sinkpad, parent, query);
else
}
gboolean
-gst_vaapi_reply_to_query (GstQuery * query, GstVaapiDisplay * display)
+gst_vaapi_handle_context_query (GstQuery * query, GstVaapiDisplay * display)
{
const gchar *type = NULL;
GstContext *context, *old_context;
- if (GST_QUERY_TYPE (query) != GST_QUERY_CONTEXT)
- return FALSE;
+ g_return_val_if_fail (query != NULL, FALSE);
if (!display)
return FALSE;
G_GNUC_INTERNAL
gboolean
-gst_vaapi_reply_to_query (GstQuery * query, GstVaapiDisplay * display);
+gst_vaapi_handle_context_query (GstQuery * query, GstVaapiDisplay * display);
G_GNUC_INTERNAL
gboolean
{
GstVaapiPostproc *const postproc = GST_VAAPIPOSTPROC (trans);
- if (gst_vaapi_reply_to_query (query,
- GST_VAAPI_PLUGIN_BASE_DISPLAY (postproc))) {
- GST_DEBUG_OBJECT (postproc, "sharing display %p",
- GST_VAAPI_PLUGIN_BASE_DISPLAY (postproc));
- return TRUE;
+ if (GST_QUERY_TYPE (query) == GST_QUERY_CONTEXT) {
+ if (gst_vaapi_handle_context_query (query,
+ GST_VAAPI_PLUGIN_BASE_DISPLAY (postproc))) {
+ GST_DEBUG_OBJECT (postproc, "sharing display %p",
+ GST_VAAPI_PLUGIN_BASE_DISPLAY (postproc));
+ return TRUE;
+ }
}
return
gst_vaapisink_query (GstBaseSink * base_sink, GstQuery * query)
{
GstVaapiSink *const sink = GST_VAAPISINK_CAST (base_sink);
+ GstVaapiPluginBase *const plugin = GST_VAAPI_PLUGIN_BASE (sink);
+ gboolean ret = FALSE;
- GST_INFO_OBJECT (sink, "query type %s", GST_QUERY_TYPE_NAME (query));
-
- if (gst_vaapi_reply_to_query (query, GST_VAAPI_PLUGIN_BASE_DISPLAY (sink))) {
- GST_DEBUG ("sharing display %p", GST_VAAPI_PLUGIN_BASE_DISPLAY (sink));
- return TRUE;
+ switch (GST_QUERY_TYPE (query)) {
+ case GST_QUERY_CONTEXT:
+ ret = gst_vaapi_handle_context_query (query, plugin->display);
+ break;
+ default:
+ ret = GST_BASE_SINK_CLASS (gst_vaapisink_parent_class)->query (base_sink,
+ query);
+ break;
}
- return GST_BASE_SINK_CLASS (gst_vaapisink_parent_class)->query (base_sink,
- query);
+
+ return ret;
}
static void