From 28ca3f901c028d6e99cf27f9f6bb5425439110db Mon Sep 17 00:00:00 2001 From: Jeffy Chen Date: Thu, 9 Dec 2021 14:25:41 +0800 Subject: [PATCH 24/31] HACK: waylandsink: Allow both of dmabuf formats and shm formats For the plugins which provide dmabuf without GST_CAPS_FEATURE_MEMORY_DMABUF. Signed-off-by: Jeffy Chen --- ext/wayland/gstwaylandsink.c | 14 ++------------ ext/wayland/gstwaylandsink.h | 1 - 2 files changed, 2 insertions(+), 13 deletions(-) diff --git a/ext/wayland/gstwaylandsink.c b/ext/wayland/gstwaylandsink.c index 07bfec0..e64539b 100644 --- a/ext/wayland/gstwaylandsink.c +++ b/ext/wayland/gstwaylandsink.c @@ -702,7 +702,6 @@ static gboolean gst_wayland_sink_set_caps (GstBaseSink * bsink, GstCaps * caps) { GstWaylandSink *sink; - gboolean use_dmabuf; GstVideoFormat format; sink = GST_WAYLAND_SINK (bsink); @@ -721,18 +720,9 @@ gst_wayland_sink_set_caps (GstBaseSink * bsink, GstCaps * caps) gst_object_unref (sink->pool); sink->pool = gst_wayland_create_pool (sink, caps); - use_dmabuf = gst_caps_features_contains (gst_caps_get_features (caps, 0), - GST_CAPS_FEATURE_MEMORY_DMABUF); - - /* validate the format base on the memory type. */ - if (use_dmabuf) { - if (!gst_wl_display_check_format_for_dmabuf (sink->display, format)) - goto unsupported_format; - } else if (!gst_wl_display_check_format_for_shm (sink->display, format)) { + if (!gst_wl_display_check_format_for_dmabuf (sink->display, format) + && !gst_wl_display_check_format_for_shm (sink->display, format)) goto unsupported_format; - } - - sink->use_dmabuf = use_dmabuf; return TRUE; diff --git a/ext/wayland/gstwaylandsink.h b/ext/wayland/gstwaylandsink.h index 1f70f76..91c8a0b 100644 --- a/ext/wayland/gstwaylandsink.h +++ b/ext/wayland/gstwaylandsink.h @@ -56,7 +56,6 @@ struct _GstWaylandSink GstWlDisplay *display; GstWlWindow *window; GstBufferPool *pool; - gboolean use_dmabuf; guintptr window_handle; gboolean video_info_changed; -- 2.20.1