mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-31 11:32:38 +00:00
stream: listen to sender ssrc signals
https://bugzilla.gnome.org/show_bug.cgi?id=746747
This commit is contained in:
parent
3cc2c2c226
commit
a51337974c
2 changed files with 60 additions and 0 deletions
|
@ -51,6 +51,26 @@ on_ssrc_active (GObject * session, GObject * source, GstRTSPMedia * media)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
on_sender_ssrc_active (GObject * session, GObject * source,
|
||||||
|
GstRTSPMedia * media)
|
||||||
|
{
|
||||||
|
GstStructure *stats;
|
||||||
|
|
||||||
|
GST_INFO ("source %p in session %p is active", source, session);
|
||||||
|
|
||||||
|
g_object_get (source, "stats", &stats, NULL);
|
||||||
|
if (stats) {
|
||||||
|
gchar *sstr;
|
||||||
|
|
||||||
|
sstr = gst_structure_to_string (stats);
|
||||||
|
g_print ("Sender stats:\nstructure: %s\n", sstr);
|
||||||
|
g_free (sstr);
|
||||||
|
|
||||||
|
gst_structure_free (stats);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* signal callback when the media is prepared for streaming. We can get the
|
/* signal callback when the media is prepared for streaming. We can get the
|
||||||
* session manager for each of the streams and connect to some signals. */
|
* session manager for each of the streams and connect to some signals. */
|
||||||
static void
|
static void
|
||||||
|
@ -75,6 +95,8 @@ media_prepared_cb (GstRTSPMedia * media)
|
||||||
|
|
||||||
g_signal_connect (session, "on-ssrc-active",
|
g_signal_connect (session, "on-ssrc-active",
|
||||||
(GCallback) on_ssrc_active, media);
|
(GCallback) on_ssrc_active, media);
|
||||||
|
g_signal_connect (session, "on-sender-ssrc-active",
|
||||||
|
(GCallback) on_sender_ssrc_active, media);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1682,6 +1682,38 @@ on_timeout (GObject * session, GObject * source, GstRTSPStream * stream)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
on_new_sender_ssrc (GObject * session, GObject * source, GstRTSPStream * stream)
|
||||||
|
{
|
||||||
|
GST_INFO ("%p: new sender source %p", stream, source);
|
||||||
|
#ifndef DUMP_STATS
|
||||||
|
{
|
||||||
|
GstStructure *stats;
|
||||||
|
g_object_get (source, "stats", &stats, NULL);
|
||||||
|
if (stats) {
|
||||||
|
dump_structure (stats);
|
||||||
|
gst_structure_free (stats);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
on_sender_ssrc_active (GObject * session, GObject * source,
|
||||||
|
GstRTSPStream * stream)
|
||||||
|
{
|
||||||
|
#ifndef DUMP_STATS
|
||||||
|
{
|
||||||
|
GstStructure *stats;
|
||||||
|
g_object_get (source, "stats", &stats, NULL);
|
||||||
|
if (stats) {
|
||||||
|
dump_structure (stats);
|
||||||
|
gst_structure_free (stats);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
clear_tr_cache (GstRTSPStreamPrivate * priv, gboolean is_rtp)
|
clear_tr_cache (GstRTSPStreamPrivate * priv, gboolean is_rtp)
|
||||||
{
|
{
|
||||||
|
@ -2135,6 +2167,12 @@ gst_rtsp_stream_join_bin (GstRTSPStream * stream, GstBin * bin,
|
||||||
g_signal_connect (priv->session, "on-timeout", (GCallback) on_timeout,
|
g_signal_connect (priv->session, "on-timeout", (GCallback) on_timeout,
|
||||||
stream);
|
stream);
|
||||||
|
|
||||||
|
/* signal for sender ssrc */
|
||||||
|
g_signal_connect (priv->session, "on-new-sender-ssrc",
|
||||||
|
(GCallback) on_new_sender_ssrc, stream);
|
||||||
|
g_signal_connect (priv->session, "on-sender-ssrc-active",
|
||||||
|
(GCallback) on_sender_ssrc_active, stream);
|
||||||
|
|
||||||
for (i = 0; i < 2; i++) {
|
for (i = 0; i < 2; i++) {
|
||||||
GstPad *teepad, *queuepad;
|
GstPad *teepad, *queuepad;
|
||||||
/* For the sender we create this bit of pipeline for both
|
/* For the sender we create this bit of pipeline for both
|
||||||
|
|
Loading…
Reference in a new issue