gst/rtpmanager/: Add signal to notify of an SDES change.

Original commit message from CVS:
* gst/rtpmanager/gstrtpbin.c: (on_ssrc_sdes), (create_session),
(gst_rtp_bin_class_init):
* gst/rtpmanager/gstrtpbin.h:
* gst/rtpmanager/gstrtpclient.c:
* gst/rtpmanager/gstrtpclient.h:
* gst/rtpmanager/gstrtpjitterbuffer.h:
* gst/rtpmanager/gstrtpmanager.c:
* gst/rtpmanager/gstrtpptdemux.c:
* gst/rtpmanager/gstrtpptdemux.h:
* gst/rtpmanager/gstrtpsession.c: (on_ssrc_sdes),
(gst_rtp_session_class_init), (gst_rtp_session_init):
* gst/rtpmanager/gstrtpsession.h:
* gst/rtpmanager/gstrtpssrcdemux.c:
* gst/rtpmanager/gstrtpssrcdemux.h:
* gst/rtpmanager/rtpjitterbuffer.c:
* gst/rtpmanager/rtpjitterbuffer.h:
* gst/rtpmanager/rtpsession.c: (rtp_session_class_init),
(on_ssrc_sdes), (rtp_session_process_sdes):
* gst/rtpmanager/rtpsession.h:
* gst/rtpmanager/rtpsource.c:
* gst/rtpmanager/rtpsource.h:
* gst/rtpmanager/rtpstats.c:
* gst/rtpmanager/rtpstats.h:
Add signal to notify of an SDES change.
Fix object type in the signal callbacks.
This commit is contained in:
Wim Taymans 2007-12-10 15:34:19 +00:00 committed by Tim-Philipp Müller
parent 95d1f62397
commit 49e501a647
20 changed files with 85 additions and 38 deletions

View file

@ -1,5 +1,5 @@
/* GStreamer
* Copyright (C) <2007> Wim Taymans <wim@fluendo.com>
* Copyright (C) <2007> Wim Taymans <wim.taymans@gmail.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
@ -144,7 +144,7 @@ GST_DEBUG_CATEGORY_STATIC (gst_rtp_bin_debug);
static const GstElementDetails rtpbin_details = GST_ELEMENT_DETAILS ("RTP Bin",
"Filter/Network/RTP",
"Implement an RTP bin",
"Wim Taymans <wim@fluendo.com>");
"Wim Taymans <wim.taymans@gmail.com>");
/* sink pads */
static GstStaticPadTemplate rtpbin_recv_rtp_sink_template =
@ -221,6 +221,7 @@ enum
SIGNAL_ON_SSRC_COLLISION,
SIGNAL_ON_SSRC_VALIDATED,
SIGNAL_ON_SSRC_ACTIVE,
SIGNAL_ON_SSRC_SDES,
SIGNAL_ON_BYE_SSRC,
SIGNAL_ON_BYE_TIMEOUT,
SIGNAL_ON_TIMEOUT,
@ -409,6 +410,13 @@ on_ssrc_active (GstElement * session, guint32 ssrc, GstRtpBinSession * sess)
sess->id, ssrc);
}
static void
on_ssrc_sdes (GstElement * session, guint32 ssrc, GstRtpBinSession * sess)
{
g_signal_emit (sess->bin, gst_rtp_bin_signals[SIGNAL_ON_SSRC_SDES], 0,
sess->id, ssrc);
}
static void
on_bye_ssrc (GstElement * session, guint32 ssrc, GstRtpBinSession * sess)
{
@ -474,6 +482,8 @@ create_session (GstRtpBin * rtpbin, gint id)
(GCallback) on_ssrc_validated, sess);
g_signal_connect (sess->session, "on-ssrc-active",
(GCallback) on_ssrc_active, sess);
g_signal_connect (sess->session, "on-ssrc-sdes",
(GCallback) on_ssrc_sdes, sess);
g_signal_connect (sess->session, "on-bye-ssrc",
(GCallback) on_bye_ssrc, sess);
g_signal_connect (sess->session, "on-bye-timeout",
@ -1100,7 +1110,7 @@ gst_rtp_bin_class_init (GstRtpBinClass * klass)
NULL, NULL, gst_rtp_bin_marshal_VOID__UINT_UINT, G_TYPE_NONE, 2,
G_TYPE_UINT, G_TYPE_UINT);
/**
* GstRtpBin::on-ssrc_collision:
* GstRtpBin::on-ssrc-collision:
* @rtpbin: the object which received the signal
* @session: the session
* @ssrc: the SSRC
@ -1113,7 +1123,7 @@ gst_rtp_bin_class_init (GstRtpBinClass * klass)
NULL, NULL, gst_rtp_bin_marshal_VOID__UINT_UINT, G_TYPE_NONE, 2,
G_TYPE_UINT, G_TYPE_UINT);
/**
* GstRtpBin::on-ssrc_validated:
* GstRtpBin::on-ssrc-validated:
* @rtpbin: the object which received the signal
* @session: the session
* @ssrc: the SSRC
@ -1126,7 +1136,7 @@ gst_rtp_bin_class_init (GstRtpBinClass * klass)
NULL, NULL, gst_rtp_bin_marshal_VOID__UINT_UINT, G_TYPE_NONE, 2,
G_TYPE_UINT, G_TYPE_UINT);
/**
* GstRtpBin::on-ssrc_active:
* GstRtpBin::on-ssrc-active:
* @rtpbin: the object which received the signal
* @session: the session
* @ssrc: the SSRC
@ -1138,6 +1148,19 @@ gst_rtp_bin_class_init (GstRtpBinClass * klass)
G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GstRtpBinClass, on_ssrc_active),
NULL, NULL, gst_rtp_bin_marshal_VOID__UINT_UINT, G_TYPE_NONE, 2,
G_TYPE_UINT, G_TYPE_UINT);
/**
* GstRtpBin::on-ssrc-sdes:
* @rtpbin: the object which received the signal
* @session: the session
* @ssrc: the SSRC
*
* Notify of a SSRC that is active, i.e., sending RTCP.
*/
gst_rtp_bin_signals[SIGNAL_ON_SSRC_SDES] =
g_signal_new ("on-ssrc-sdes", G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GstRtpBinClass, on_ssrc_sdes),
NULL, NULL, gst_rtp_bin_marshal_VOID__UINT_UINT, G_TYPE_NONE, 2,
G_TYPE_UINT, G_TYPE_UINT);
/**
* GstRtpBin::on-bye-ssrc:

View file

@ -1,5 +1,5 @@
/* GStreamer
* Copyright (C) <2007> Wim Taymans <wim@fluendo.com>
* Copyright (C) <2007> Wim Taymans <wim.taymans@gmail.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
@ -69,6 +69,7 @@ struct _GstRtpBinClass {
void (*on_ssrc_collision) (GstRtpBin *rtpbin, guint session, guint32 ssrc);
void (*on_ssrc_validated) (GstRtpBin *rtpbin, guint session, guint32 ssrc);
void (*on_ssrc_active) (GstRtpBin *rtpbin, guint session, guint32 ssrc);
void (*on_ssrc_sdes) (GstRtpBin *rtpbin, guint session, guint32 ssrc);
void (*on_bye_ssrc) (GstRtpBin *rtpbin, guint session, guint32 ssrc);
void (*on_bye_timeout) (GstRtpBin *rtpbin, guint session, guint32 ssrc);
void (*on_timeout) (GstRtpBin *rtpbin, guint session, guint32 ssrc);

View file

@ -1,5 +1,5 @@
/* GStreamer
* Copyright (C) <2007> Wim Taymans <wim@fluendo.com>
* Copyright (C) <2007> Wim Taymans <wim.taymans@gmail.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
@ -55,7 +55,7 @@ static const GstElementDetails rtpclient_details =
GST_ELEMENT_DETAILS ("RTP Client",
"Filter/Network/RTP",
"Implement an RTP client",
"Wim Taymans <wim@fluendo.com>");
"Wim Taymans <wim.taymans@gmail.com>");
/* sink pads */
static GstStaticPadTemplate rtpclient_rtp_sink_template =

View file

@ -1,5 +1,5 @@
/* GStreamer
* Copyright (C) <2007> Wim Taymans <wim@fluendo.com>
* Copyright (C) <2007> Wim Taymans <wim.taymans@gmail.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public

View file

@ -4,7 +4,7 @@
* Copyright 2007 Collabora Ltd,
* Copyright 2007 Nokia Corporation
* @author: Philippe Kalaf <philippe.kalaf@collabora.co.uk>.
* Copyright 2007 Wim Taymans <wim@fluendo.com>
* Copyright 2007 Wim Taymans <wim.taymans@gmail.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public

View file

@ -1,5 +1,5 @@
/* GStreamer
* Copyright (C) <2007> Wim Taymans <wim@fluendo.com>
* Copyright (C) <2007> Wim Taymans <wim.taymans@gmail.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public

View file

@ -5,7 +5,7 @@
* @author Kai Vehmanen <kai.vehmanen@nokia.com>
*
* Loosely based on GStreamer gstdecodebin
* Copyright (C) <2004> Wim Taymans <wim@fluendo.com>
* Copyright (C) <2004> Wim Taymans <wim.taymans@gmail.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public

View file

@ -1,5 +1,5 @@
/* GStreamer
* Copyright (C) <2007> Wim Taymans <wim@fluendo.com>
* Copyright (C) <2007> Wim Taymans <wim.taymans@gmail.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public

View file

@ -1,5 +1,5 @@
/* GStreamer
* Copyright (C) <2007> Wim Taymans <wim@fluendo.com>
* Copyright (C) <2007> Wim Taymans <wim.taymans@gmail.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
@ -146,7 +146,7 @@ static const GstElementDetails rtpsession_details =
GST_ELEMENT_DETAILS ("RTP Session",
"Filter/Network/RTP",
"Implement an RTP session",
"Wim Taymans <wim@fluendo.com>");
"Wim Taymans <wim.taymans@gmail.com>");
/* sink pads */
static GstStaticPadTemplate rtpsession_recv_rtp_sink_template =
@ -209,6 +209,7 @@ enum
SIGNAL_ON_SSRC_COLLISION,
SIGNAL_ON_SSRC_VALIDATED,
SIGNAL_ON_SSRC_ACTIVE,
SIGNAL_ON_SSRC_SDES,
SIGNAL_ON_BYE_SSRC,
SIGNAL_ON_BYE_TIMEOUT,
SIGNAL_ON_TIMEOUT,
@ -337,6 +338,13 @@ on_ssrc_active (RTPSession * session, RTPSource * src, GstRtpSession * sess)
src->ssrc);
}
static void
on_ssrc_sdes (RTPSession * session, RTPSource * src, GstRtpSession * sess)
{
g_signal_emit (sess, gst_rtp_session_signals[SIGNAL_ON_SSRC_SDES], 0,
src->ssrc);
}
static void
on_bye_ssrc (RTPSession * session, RTPSource * src, GstRtpSession * sess)
{
@ -471,6 +479,17 @@ gst_rtp_session_class_init (GstRtpSessionClass * klass)
G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GstRtpSessionClass,
on_ssrc_active), NULL, NULL, g_cclosure_marshal_VOID__UINT,
G_TYPE_NONE, 1, G_TYPE_UINT);
/**
* GstRtpSession::on-ssrc-sdes:
* @session: the object which received the signal
* @src: the SSRC
*
* Notify that a new SDES was received for SSRC.
*/
gst_rtp_session_signals[SIGNAL_ON_SSRC_SDES] =
g_signal_new ("on-ssrc-sdes", G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GstRtpSessionClass, on_ssrc_sdes),
NULL, NULL, g_cclosure_marshal_VOID__UINT, G_TYPE_NONE, 1, G_TYPE_UINT);
/**
* GstRtpSession::on-bye-ssrc:
@ -596,6 +615,8 @@ gst_rtp_session_init (GstRtpSession * rtpsession, GstRtpSessionClass * klass)
(GCallback) on_ssrc_validated, rtpsession);
g_signal_connect (rtpsession->priv->session, "on-ssrc-active",
(GCallback) on_ssrc_active, rtpsession);
g_signal_connect (rtpsession->priv->session, "on-ssrc-sdes",
(GCallback) on_ssrc_sdes, rtpsession);
g_signal_connect (rtpsession->priv->session, "on-bye-ssrc",
(GCallback) on_bye_ssrc, rtpsession);
g_signal_connect (rtpsession->priv->session, "on-bye-timeout",

View file

@ -1,5 +1,5 @@
/* GStreamer
* Copyright (C) <2007> Wim Taymans <wim@fluendo.com>
* Copyright (C) <2007> Wim Taymans <wim.taymans@gmail.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
@ -67,6 +67,7 @@ struct _GstRtpSessionClass {
void (*on_ssrc_collision) (GstRtpSession *sess, guint32 ssrc);
void (*on_ssrc_validated) (GstRtpSession *sess, guint32 ssrc);
void (*on_ssrc_active) (GstRtpSession *sess, guint32 ssrc);
void (*on_ssrc_sdes) (GstRtpSession *sess, guint32 ssrc);
void (*on_bye_ssrc) (GstRtpSession *sess, guint32 ssrc);
void (*on_bye_timeout) (GstRtpSession *sess, guint32 ssrc);
void (*on_timeout) (GstRtpSession *sess, guint32 ssrc);

View file

@ -1,5 +1,5 @@
/* GStreamer
* Copyright (C) <2007> Wim Taymans <wim@fluendo.com>
* Copyright (C) <2007> Wim Taymans <wim.taymans@gmail.com>
*
* RTP SSRC demuxer
*
@ -93,7 +93,7 @@ static GstElementDetails gst_rtp_ssrc_demux_details = {
"RTP SSRC Demux",
"Demux/Network/RTP",
"Splits RTP streams based on the SSRC",
"Wim Taymans <wim@fluendo.com>"
"Wim Taymans <wim.taymans@gmail.com>"
};
#define GST_PAD_LOCK(obj) (g_mutex_lock ((obj)->padlock))

View file

@ -1,5 +1,5 @@
/* GStreamer
* Copyright (C) <2007> Wim Taymans <wim@fluendo.com>
* Copyright (C) <2007> Wim Taymans <wim.taymans@gmail.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public

View file

@ -1,5 +1,5 @@
/* GStreamer
* Copyright (C) <2007> Wim Taymans <wim@fluendo.com>
* Copyright (C) <2007> Wim Taymans <wim.taymans@gmail.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public

View file

@ -1,5 +1,5 @@
/* GStreamer
* Copyright (C) <2007> Wim Taymans <wim@fluendo.com>
* Copyright (C) <2007> Wim Taymans <wim.taymans@gmail.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public

View file

@ -1,5 +1,5 @@
/* GStreamer
* Copyright (C) <2007> Wim Taymans <wim@fluendo.com>
* Copyright (C) <2007> Wim Taymans <wim.taymans@gmail.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
@ -119,9 +119,9 @@ rtp_session_class_init (RTPSessionClass * klass)
g_signal_new ("on-new-ssrc", G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (RTPSessionClass, on_new_ssrc),
NULL, NULL, g_cclosure_marshal_VOID__OBJECT, G_TYPE_NONE, 1,
G_TYPE_OBJECT);
RTP_TYPE_SOURCE);
/**
* RTPSession::on-ssrc_collision:
* RTPSession::on-ssrc-collision:
* @session: the object which received the signal
* @src: the #RTPSource that caused a collision
*
@ -131,9 +131,9 @@ rtp_session_class_init (RTPSessionClass * klass)
g_signal_new ("on-ssrc-collision", G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (RTPSessionClass, on_ssrc_collision),
NULL, NULL, g_cclosure_marshal_VOID__OBJECT, G_TYPE_NONE, 1,
G_TYPE_OBJECT);
RTP_TYPE_SOURCE);
/**
* RTPSession::on-ssrc_validated:
* RTPSession::on-ssrc-validated:
* @session: the object which received the signal
* @src: the new validated RTPSource
*
@ -143,7 +143,7 @@ rtp_session_class_init (RTPSessionClass * klass)
g_signal_new ("on-ssrc-validated", G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (RTPSessionClass, on_ssrc_validated),
NULL, NULL, g_cclosure_marshal_VOID__OBJECT, G_TYPE_NONE, 1,
G_TYPE_OBJECT);
RTP_TYPE_SOURCE);
/**
* RTPSession::on-ssrc-active:
* @session: the object which received the signal
@ -155,7 +155,7 @@ rtp_session_class_init (RTPSessionClass * klass)
g_signal_new ("on-ssrc-active", G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (RTPSessionClass, on_ssrc_active),
NULL, NULL, g_cclosure_marshal_VOID__OBJECT, G_TYPE_NONE, 1,
G_TYPE_OBJECT);
RTP_TYPE_SOURCE);
/**
* RTPSession::on-ssrc-sdes:
* @session: the object which received the signal
@ -167,7 +167,7 @@ rtp_session_class_init (RTPSessionClass * klass)
g_signal_new ("on-ssrc-sdes", G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (RTPSessionClass, on_ssrc_sdes),
NULL, NULL, g_cclosure_marshal_VOID__OBJECT, G_TYPE_NONE, 1,
G_TYPE_OBJECT);
RTP_TYPE_SOURCE);
/**
* RTPSession::on-bye-ssrc:
* @session: the object which received the signal
@ -179,7 +179,7 @@ rtp_session_class_init (RTPSessionClass * klass)
g_signal_new ("on-bye-ssrc", G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (RTPSessionClass, on_bye_ssrc),
NULL, NULL, g_cclosure_marshal_VOID__OBJECT, G_TYPE_NONE, 1,
G_TYPE_OBJECT);
RTP_TYPE_SOURCE);
/**
* RTPSession::on-bye-timeout:
* @session: the object which received the signal
@ -191,7 +191,7 @@ rtp_session_class_init (RTPSessionClass * klass)
g_signal_new ("on-bye-timeout", G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (RTPSessionClass, on_bye_timeout),
NULL, NULL, g_cclosure_marshal_VOID__OBJECT, G_TYPE_NONE, 1,
G_TYPE_OBJECT);
RTP_TYPE_SOURCE);
/**
* RTPSession::on-timeout:
* @session: the object which received the signal
@ -203,7 +203,7 @@ rtp_session_class_init (RTPSessionClass * klass)
g_signal_new ("on-timeout", G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (RTPSessionClass, on_timeout),
NULL, NULL, g_cclosure_marshal_VOID__OBJECT, G_TYPE_NONE, 1,
G_TYPE_OBJECT);
RTP_TYPE_SOURCE);
g_object_class_install_property (gobject_class, PROP_INTERNAL_SOURCE,
g_param_spec_object ("internal-source", "Internal Source",
@ -473,6 +473,7 @@ on_ssrc_active (RTPSession * sess, RTPSource * source)
static void
on_ssrc_sdes (RTPSession * sess, RTPSource * source)
{
GST_DEBUG ("SDES changed for SSRC %08x", source->ssrc);
RTP_SESSION_UNLOCK (sess);
g_signal_emit (sess, rtp_session_signals[SIGNAL_ON_SSRC_SDES], 0, source);
RTP_SESSION_LOCK (sess);
@ -1258,7 +1259,7 @@ rtp_session_process_sdes (RTPSession * sess, GstRTCPPacket * packet,
GST_DEBUG ("entry %d, type %d, len %d, data %.*s", j, type, len, len,
data);
changed |= rtp_source_set_sdes (source, type, data, len);
more_entries = gst_rtcp_packet_sdes_next_entry (packet);
j++;

View file

@ -1,5 +1,5 @@
/* GStreamer
* Copyright (C) <2007> Wim Taymans <wim@fluendo.com>
* Copyright (C) <2007> Wim Taymans <wim.taymans@gmail.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public

View file

@ -1,5 +1,5 @@
/* GStreamer
* Copyright (C) <2007> Wim Taymans <wim@fluendo.com>
* Copyright (C) <2007> Wim Taymans <wim.taymans@gmail.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public

View file

@ -1,5 +1,5 @@
/* GStreamer
* Copyright (C) <2007> Wim Taymans <wim@fluendo.com>
* Copyright (C) <2007> Wim Taymans <wim.taymans@gmail.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public

View file

@ -1,5 +1,5 @@
/* GStreamer
* Copyright (C) <2007> Wim Taymans <wim@fluendo.com>
* Copyright (C) <2007> Wim Taymans <wim.taymans@gmail.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public

View file

@ -1,5 +1,5 @@
/* GStreamer
* Copyright (C) <2007> Wim Taymans <wim@fluendo.com>
* Copyright (C) <2007> Wim Taymans <wim.taymans@gmail.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public