srt: preserve ABI compatibility

Reintroduce socket descriptor parameter removed in 327ad84e to
"caller-added" and "caller-removed" signals, just set it always to zero.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2004>
This commit is contained in:
Jakub Adam 2021-02-03 23:39:00 +01:00
parent 6bdf09d252
commit 9c00d261c3
3 changed files with 10 additions and 6 deletions

View file

@ -126,7 +126,7 @@ srt_caller_signal_removed (SRTCaller * caller, GstSRTObject * srtobject)
* socket. Deliver the stats to the app before we throw them away. */ * socket. Deliver the stats to the app before we throw them away. */
gst_structure_free (stats); gst_structure_free (stats);
g_signal_emit_by_name (srtobject->element, "caller-removed", g_signal_emit_by_name (srtobject->element, "caller-removed", 0,
caller->sockaddr); caller->sockaddr);
} }
@ -990,7 +990,7 @@ thread_func (gpointer data)
g_mutex_unlock (&srtobject->sock_lock); g_mutex_unlock (&srtobject->sock_lock);
/* notifying caller-added */ /* notifying caller-added */
g_signal_emit_by_name (srtobject->element, "caller-added", g_signal_emit_by_name (srtobject->element, "caller-added", 0,
caller->sockaddr); caller->sockaddr);
if (gst_uri_handler_get_uri_type (GST_URI_HANDLER (srtobject->element)) == if (gst_uri_handler_get_uri_type (GST_URI_HANDLER (srtobject->element)) ==

View file

@ -305,6 +305,7 @@ gst_srt_sink_class_init (GstSRTSinkClass * klass)
/** /**
* GstSRTSink::caller-added: * GstSRTSink::caller-added:
* @gstsrtsink: the srtsink element that emitted this signal * @gstsrtsink: the srtsink element that emitted this signal
* @unused: always zero (for ABI compatibility with previous versions)
* @addr: the #GSocketAddress of the new caller * @addr: the #GSocketAddress of the new caller
* *
* A new caller has connected to @gstsrtsink. * A new caller has connected to @gstsrtsink.
@ -312,11 +313,12 @@ gst_srt_sink_class_init (GstSRTSinkClass * klass)
signals[SIG_CALLER_ADDED] = signals[SIG_CALLER_ADDED] =
g_signal_new ("caller-added", G_TYPE_FROM_CLASS (klass), g_signal_new ("caller-added", G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GstSRTSinkClass, caller_added), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GstSRTSinkClass, caller_added),
NULL, NULL, NULL, G_TYPE_NONE, 1, G_TYPE_SOCKET_ADDRESS); NULL, NULL, NULL, G_TYPE_NONE, 2, G_TYPE_INT, G_TYPE_SOCKET_ADDRESS);
/** /**
* GstSRTSink::caller-removed: * GstSRTSink::caller-removed:
* @gstsrtsink: the srtsink element that emitted this signal * @gstsrtsink: the srtsink element that emitted this signal
* @unused: always zero (for ABI compatibility with previous versions)
* @addr: the #GSocketAddress of the caller * @addr: the #GSocketAddress of the caller
* *
* The given caller has disconnected. * The given caller has disconnected.
@ -325,7 +327,7 @@ gst_srt_sink_class_init (GstSRTSinkClass * klass)
g_signal_new ("caller-removed", G_TYPE_FROM_CLASS (klass), g_signal_new ("caller-removed", G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GstSRTSinkClass, G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GstSRTSinkClass,
caller_added), NULL, NULL, NULL, G_TYPE_NONE, caller_added), NULL, NULL, NULL, G_TYPE_NONE,
1, G_TYPE_SOCKET_ADDRESS); 2, G_TYPE_INT, G_TYPE_SOCKET_ADDRESS);
/** /**
* GstSRTSink::caller-rejected: * GstSRTSink::caller-rejected:

View file

@ -362,6 +362,7 @@ gst_srt_src_class_init (GstSRTSrcClass * klass)
/** /**
* GstSRTSrc::caller-added: * GstSRTSrc::caller-added:
* @gstsrtsrc: the srtsrc element that emitted this signal * @gstsrtsrc: the srtsrc element that emitted this signal
* @unused: always zero (for ABI compatibility with previous versions)
* @addr: the #GSocketAddress of the new caller * @addr: the #GSocketAddress of the new caller
* *
* A new caller has connected to srtsrc. * A new caller has connected to srtsrc.
@ -369,11 +370,12 @@ gst_srt_src_class_init (GstSRTSrcClass * klass)
signals[SIG_CALLER_ADDED] = signals[SIG_CALLER_ADDED] =
g_signal_new ("caller-added", G_TYPE_FROM_CLASS (klass), g_signal_new ("caller-added", G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GstSRTSrcClass, caller_added), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GstSRTSrcClass, caller_added),
NULL, NULL, NULL, G_TYPE_NONE, 1, G_TYPE_SOCKET_ADDRESS); NULL, NULL, NULL, G_TYPE_NONE, 2, G_TYPE_INT, G_TYPE_SOCKET_ADDRESS);
/** /**
* GstSRTSrc::caller-removed: * GstSRTSrc::caller-removed:
* @gstsrtsrc: the srtsrc element that emitted this signal * @gstsrtsrc: the srtsrc element that emitted this signal
* @unused: always zero (for ABI compatibility with previous versions)
* @addr: the #GSocketAddress of the caller * @addr: the #GSocketAddress of the caller
* *
* The given caller has disconnected. * The given caller has disconnected.
@ -382,7 +384,7 @@ gst_srt_src_class_init (GstSRTSrcClass * klass)
g_signal_new ("caller-removed", G_TYPE_FROM_CLASS (klass), g_signal_new ("caller-removed", G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GstSRTSrcClass, G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GstSRTSrcClass,
caller_added), NULL, NULL, NULL, G_TYPE_NONE, caller_added), NULL, NULL, NULL, G_TYPE_NONE,
1, G_TYPE_SOCKET_ADDRESS); 2, G_TYPE_INT, G_TYPE_SOCKET_ADDRESS);
/** /**
* GstSRTSrc::caller-rejected: * GstSRTSrc::caller-rejected: