mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-11 09:55:36 +00:00
rtpbin: add signal for new jitterbuffer
Emit a signal when a new jitterbuffer is created so that the app can have a chance to configure it.
This commit is contained in:
parent
3f3b2d0886
commit
5a2bc1405e
2 changed files with 23 additions and 1 deletions
|
@ -257,6 +257,8 @@ enum
|
|||
SIGNAL_REQUEST_RTCP_ENCODER,
|
||||
SIGNAL_REQUEST_RTCP_DECODER,
|
||||
|
||||
SIGNAL_NEW_JITTERBUFFER,
|
||||
|
||||
LAST_SIGNAL
|
||||
};
|
||||
|
||||
|
@ -1492,7 +1494,6 @@ create_stream (GstRtpBinSession * session, guint32 ssrc)
|
|||
if (!(demux = gst_element_factory_make ("rtpptdemux", NULL)))
|
||||
goto no_demux;
|
||||
|
||||
|
||||
stream = g_new0 (GstRtpBinStream, 1);
|
||||
stream->ssrc = ssrc;
|
||||
stream->bin = rtpbin;
|
||||
|
@ -1523,6 +1524,9 @@ create_stream (GstRtpBinSession * session, guint32 ssrc)
|
|||
g_object_set (buffer, "mode", rtpbin->buffer_mode, NULL);
|
||||
g_object_set (buffer, "do-retransmission", rtpbin->do_retransmission, NULL);
|
||||
|
||||
g_signal_emit (rtpbin, gst_rtp_bin_signals[SIGNAL_NEW_JITTERBUFFER], 0,
|
||||
buffer, session->id, ssrc);
|
||||
|
||||
if (!rtpbin->ignore_pt)
|
||||
gst_bin_add (GST_BIN_CAST (rtpbin), demux);
|
||||
gst_bin_add (GST_BIN_CAST (rtpbin), buffer);
|
||||
|
@ -1956,6 +1960,22 @@ gst_rtp_bin_class_init (GstRtpBinClass * klass)
|
|||
request_rtcp_decoder), _gst_element_accumulator, NULL,
|
||||
g_cclosure_marshal_generic, GST_TYPE_ELEMENT, 1, G_TYPE_UINT);
|
||||
|
||||
/**
|
||||
* GstRtpBin::new-jitterbuffer:
|
||||
* @rtpbin: the object which received the signal
|
||||
* @jitterbuffer: the new jitterbuffer
|
||||
* @session: the session
|
||||
* @ssrc: the SSRC
|
||||
*
|
||||
* Notify that a new @jitterbuffer was created for @session and @ssrc.
|
||||
* This signal can, for example, be used to configure @jitterbuffer.
|
||||
*/
|
||||
gst_rtp_bin_signals[SIGNAL_NEW_JITTERBUFFER] =
|
||||
g_signal_new ("new-jitterbuffer", G_TYPE_FROM_CLASS (klass),
|
||||
G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GstRtpBinClass,
|
||||
new_jitterbuffer), NULL, NULL, g_cclosure_marshal_generic,
|
||||
G_TYPE_NONE, 3, GST_TYPE_ELEMENT, G_TYPE_UINT, G_TYPE_UINT);
|
||||
|
||||
g_object_class_install_property (gobject_class, PROP_SDES,
|
||||
g_param_spec_boxed ("sdes", "SDES",
|
||||
"The SDES items of this session",
|
||||
|
|
|
@ -80,6 +80,8 @@ struct _GstRtpBinClass {
|
|||
|
||||
void (*payload_type_change) (GstRtpBin *rtpbin, guint session, guint pt);
|
||||
|
||||
void (*new_jitterbuffer) (GstRtpBin *rtpbin, guint session, guint32 ssrc);
|
||||
|
||||
/* action signals */
|
||||
void (*clear_pt_map) (GstRtpBin *rtpbin);
|
||||
void (*reset_sync) (GstRtpBin *rtpbin);
|
||||
|
|
Loading…
Reference in a new issue