From 8ed0b03c780c407750234df9bd875c8348892efd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Thu, 6 Apr 2023 14:19:28 +0300 Subject: [PATCH] appsink: Use a class handler callback instead of vfunc for `propose-allocation` There would otherwise be no padding left in the class struct anymore and we might need it for something else in the future. A class handler callback can be overridden by subclasses via `g_signal_override_class_handler()` and chained up via `g_signal_chain_from_overridden_handler()`. Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/2422 Part-of: --- .../gst-plugins-base/gst-libs/gst/app/gstappsink.c | 7 +++---- .../gst-plugins-base/gst-libs/gst/app/gstappsink.h | 10 +--------- 2 files changed, 4 insertions(+), 13 deletions(-) diff --git a/subprojects/gst-plugins-base/gst-libs/gst/app/gstappsink.c b/subprojects/gst-plugins-base/gst-libs/gst/app/gstappsink.c index bea0278cce..3986798fb0 100644 --- a/subprojects/gst-plugins-base/gst-libs/gst/app/gstappsink.c +++ b/subprojects/gst-plugins-base/gst-libs/gst/app/gstappsink.c @@ -351,10 +351,9 @@ gst_app_sink_class_init (GstAppSinkClass * klass) * Since: 1.24 */ gst_app_sink_signals[SIGNAL_PROPOSE_ALLOCATION] = - g_signal_new ("propose-allocation", G_TYPE_FROM_CLASS (klass), - G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GstAppSinkClass, propose_allocation), - NULL, NULL, NULL, G_TYPE_BOOLEAN, 1, - GST_TYPE_QUERY | G_SIGNAL_TYPE_STATIC_SCOPE); + g_signal_new_class_handler ("propose-allocation", + G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST, NULL, NULL, NULL, NULL, + G_TYPE_BOOLEAN, 1, GST_TYPE_QUERY | G_SIGNAL_TYPE_STATIC_SCOPE); /** * GstAppSink::new-serialized-event: * @appsink: the appsink element that emitted the signal diff --git a/subprojects/gst-plugins-base/gst-libs/gst/app/gstappsink.h b/subprojects/gst-plugins-base/gst-libs/gst/app/gstappsink.h index 050bb2d400..3cb38dc2d5 100644 --- a/subprojects/gst-plugins-base/gst-libs/gst/app/gstappsink.h +++ b/subprojects/gst-plugins-base/gst-libs/gst/app/gstappsink.h @@ -123,16 +123,8 @@ struct _GstAppSinkClass */ GstMiniObject * (*try_pull_object) (GstAppSink *appsink, GstClockTime timeout); - /** - * GstAppSinkClass::propose_allocation: - * - * See #GstAppSink::propose-allocation: signal. - * - * Since: 1.24 - */ - gboolean (*propose_allocation) (GstAppSink *appsink, GstQuery *query); /*< private >*/ - gpointer _gst_reserved[GST_PADDING - 4]; + gpointer _gst_reserved[GST_PADDING - 3]; }; GST_APP_API