summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorVíctor Manuel Jáquez Leal <vjaquez@igalia.com>2021-02-01 23:55:11 +0100
committerVíctor Manuel Jáquez Leal <vjaquez@igalia.com>2021-02-05 18:52:56 +0100
commit4c7218d7ae5485bf0d0843e0f3ca3f5b68504669 (patch)
treedcc31736db7979f31c1b003050d3418458e8b192 /sys
parentda363a20fe9b79bd142723d762c98ec271553001 (diff)
downloadgstreamer-plugins-bad-4c7218d7ae5485bf0d0843e0f3ca3f5b68504669.tar.gz
va: vpp: handle context query
Previously vapostproc didn't communicate its context through query mechanism, which is required for context sharing. This patch completes this missing bits. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2007>
Diffstat (limited to 'sys')
-rw-r--r--sys/va/gstvavpp.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/sys/va/gstvavpp.c b/sys/va/gstvavpp.c
index a70e5ee48..5d4794762 100644
--- a/sys/va/gstvavpp.c
+++ b/sys/va/gstvavpp.c
@@ -598,6 +598,34 @@ gst_va_vpp_decide_allocation (GstBaseTransform * trans, GstQuery * query)
query);
}
+static gboolean
+gst_va_vpp_query (GstBaseTransform * trans, GstPadDirection direction,
+ GstQuery * query)
+{
+ GstVaVpp *self = GST_VA_VPP (trans);
+ gboolean ret = FALSE;
+
+ switch (GST_QUERY_TYPE (query)) {
+ case GST_QUERY_CONTEXT:
+ {
+ GstVaDisplay *display = NULL;
+
+ gst_object_replace ((GstObject **) & display,
+ (GstObject *) self->display);
+ ret = gst_va_handle_context_query (GST_ELEMENT_CAST (self), query,
+ display);
+ gst_clear_object (&display);
+ break;
+ }
+ default:
+ ret = GST_BASE_TRANSFORM_CLASS (parent_class)->query (trans, direction,
+ query);
+ break;
+ }
+
+ return ret;
+}
+
/* our output size only depends on the caps, not on the input caps */
static gboolean
gst_va_vpp_transform_size (GstBaseTransform * trans,
@@ -2147,6 +2175,7 @@ gst_va_vpp_class_init (gpointer g_class, gpointer class_data)
GST_DEBUG_FUNCPTR (gst_va_vpp_propose_allocation);
trans_class->decide_allocation =
GST_DEBUG_FUNCPTR (gst_va_vpp_decide_allocation);
+ trans_class->query = GST_DEBUG_FUNCPTR (gst_va_vpp_query);
trans_class->transform_caps = GST_DEBUG_FUNCPTR (gst_va_vpp_transform_caps);
trans_class->fixate_caps = GST_DEBUG_FUNCPTR (gst_va_vpp_fixate_caps);
trans_class->transform_size = GST_DEBUG_FUNCPTR (gst_va_vpp_transform_size);