kmssink: Move kmsmem cache code higher

This will be needed as this API will be used elsewhere to clear
the cache.

https://bugzilla.gnome.org/show_bug.cgi?id=782774
This commit is contained in:
Nicolas Dufresne 2017-07-07 12:12:38 -04:00
parent b8c5a4c9ed
commit 98b91d09c2

View file

@ -488,6 +488,21 @@ ensure_allowed_caps (GstKMSSink * self, drmModeConnector * conn,
return (self->allowed_caps && !gst_caps_is_empty (self->allowed_caps));
}
static GstMemory *
get_cached_kmsmem (GstMemory * mem)
{
return gst_mini_object_get_qdata (GST_MINI_OBJECT (mem),
g_quark_from_static_string ("kmsmem"));
}
static void
set_cached_kmsmem (GstMemory * mem, GstMemory * kmsmem)
{
return gst_mini_object_set_qdata (GST_MINI_OBJECT (mem),
g_quark_from_static_string ("kmsmem"), kmsmem,
(GDestroyNotify) gst_memory_unref);
}
static gboolean
gst_kms_sink_start (GstBaseSink * bsink)
{
@ -1033,21 +1048,6 @@ event_failed:
}
}
static GstMemory *
get_cached_kmsmem (GstMemory * mem)
{
return gst_mini_object_get_qdata (GST_MINI_OBJECT (mem),
g_quark_from_static_string ("kmsmem"));
}
static void
set_cached_kmsmem (GstMemory * mem, GstMemory * kmsmem)
{
return gst_mini_object_set_qdata (GST_MINI_OBJECT (mem),
g_quark_from_static_string ("kmsmem"), kmsmem,
(GDestroyNotify) gst_memory_unref);
}
static gboolean
gst_kms_sink_import_dmabuf (GstKMSSink * self, GstBuffer * inbuf,
GstBuffer ** outbuf)