summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiguel París Díaz <mparisdiaz@gmail.com>2015-12-10 12:15:52 +0100
committerSebastian Dröge <sebastian@centricular.com>2016-02-16 13:39:52 +0200
commit92affe2dec1446c38ae65cf3c8f03363009c22fe (patch)
treeb0599382ea7747913ec1c392d93db7bf8f82809e
parent9d0f1277039ddaa147b40b5c9d8cef9761077c7f (diff)
downloadgstreamer-plugins-good-92affe2dec1446c38ae65cf3c8f03363009c22fe.tar.gz
rtpbin: add "get-session" signal
This gets the GstRTPSession element, as compared to the RTPSession object that is returned by get-internal-session. https://bugzilla.gnome.org/show_bug.cgi?id=759293
-rw-r--r--gst/rtpmanager/gstrtpbin.c34
-rw-r--r--gst/rtpmanager/gstrtpbin.h1
2 files changed, 35 insertions, 0 deletions
diff --git a/gst/rtpmanager/gstrtpbin.c b/gst/rtpmanager/gstrtpbin.c
index bc7ec6de4..227c7d7b5 100644
--- a/gst/rtpmanager/gstrtpbin.c
+++ b/gst/rtpmanager/gstrtpbin.c
@@ -249,6 +249,7 @@ enum
SIGNAL_PAYLOAD_TYPE_CHANGE,
SIGNAL_CLEAR_PT_MAP,
SIGNAL_RESET_SYNC,
+ SIGNAL_GET_SESSION,
SIGNAL_GET_INTERNAL_SESSION,
SIGNAL_ON_NEW_SSRC,
@@ -935,6 +936,23 @@ gst_rtp_bin_clear_pt_map (GstRtpBin * bin)
gst_rtp_bin_reset_sync (bin);
}
+static GstElement *
+gst_rtp_bin_get_session (GstRtpBin * bin, guint session_id)
+{
+ GstRtpBinSession *session;
+ GstElement *ret = NULL;
+
+ GST_RTP_BIN_LOCK (bin);
+ GST_DEBUG_OBJECT (bin, "retrieving GstRtpSession, index: %d", session_id);
+ session = find_session_by_id (bin, (gint) session_id);
+ if (session) {
+ ret = gst_object_ref (session->session);
+ }
+ GST_RTP_BIN_UNLOCK (bin);
+
+ return ret;
+}
+
static RTPSession *
gst_rtp_bin_get_internal_session (GstRtpBin * bin, guint session_id)
{
@@ -1847,6 +1865,21 @@ gst_rtp_bin_class_init (GstRtpBinClass * klass)
0, G_TYPE_NONE);
/**
+ * GstRtpBin::get-session:
+ * @rtpbin: the object which received the signal
+ * @id: the session id
+ *
+ * Request the related GstRtpSession as #GstElement related with session @id.
+ *
+ * Since: 1.8
+ */
+ gst_rtp_bin_signals[SIGNAL_GET_SESSION] =
+ g_signal_new ("get-session", G_TYPE_FROM_CLASS (klass),
+ G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION, G_STRUCT_OFFSET (GstRtpBinClass,
+ get_session), NULL, NULL, g_cclosure_marshal_generic,
+ GST_TYPE_ELEMENT, 1, G_TYPE_UINT);
+
+ /**
* GstRtpBin::get-internal-session:
* @rtpbin: the object which received the signal
* @id: the session id
@@ -2311,6 +2344,7 @@ gst_rtp_bin_class_init (GstRtpBinClass * klass)
klass->clear_pt_map = GST_DEBUG_FUNCPTR (gst_rtp_bin_clear_pt_map);
klass->reset_sync = GST_DEBUG_FUNCPTR (gst_rtp_bin_reset_sync);
+ klass->get_session = GST_DEBUG_FUNCPTR (gst_rtp_bin_get_session);
klass->get_internal_session =
GST_DEBUG_FUNCPTR (gst_rtp_bin_get_internal_session);
klass->request_rtp_encoder = GST_DEBUG_FUNCPTR (gst_rtp_bin_request_encoder);
diff --git a/gst/rtpmanager/gstrtpbin.h b/gst/rtpmanager/gstrtpbin.h
index e74a71804..01539d24e 100644
--- a/gst/rtpmanager/gstrtpbin.h
+++ b/gst/rtpmanager/gstrtpbin.h
@@ -100,6 +100,7 @@ struct _GstRtpBinClass {
/* action signals */
void (*clear_pt_map) (GstRtpBin *rtpbin);
void (*reset_sync) (GstRtpBin *rtpbin);
+ GstElement* (*get_session) (GstRtpBin *rtpbin, guint session);
RTPSession* (*get_internal_session) (GstRtpBin *rtpbin, guint session);
/* session manager signals */