diff --git a/gst/rtpmanager/gstrtpbin.c b/gst/rtpmanager/gstrtpbin.c index ad99c5b85a..569b027713 100644 --- a/gst/rtpmanager/gstrtpbin.c +++ b/gst/rtpmanager/gstrtpbin.c @@ -262,6 +262,7 @@ enum SIGNAL_RESET_SYNC, SIGNAL_GET_SESSION, SIGNAL_GET_INTERNAL_SESSION, + SIGNAL_GET_STORAGE, SIGNAL_GET_INTERNAL_STORAGE, SIGNAL_ON_NEW_SSRC, @@ -1146,6 +1147,24 @@ gst_rtp_bin_get_internal_session (GstRtpBin * bin, guint session_id) return internal_session; } +static GstElement * +gst_rtp_bin_get_storage (GstRtpBin * bin, guint session_id) +{ + GstRtpBinSession *session; + GstElement *res = NULL; + + GST_RTP_BIN_LOCK (bin); + GST_DEBUG_OBJECT (bin, "retrieving internal storage object, index: %u", + session_id); + session = find_session_by_id (bin, (gint) session_id); + if (session && session->storage) { + res = gst_object_ref (session->storage); + } + GST_RTP_BIN_UNLOCK (bin); + + return res; +} + static GObject * gst_rtp_bin_get_internal_storage (GstRtpBin * bin, guint session_id) { @@ -2125,6 +2144,21 @@ gst_rtp_bin_class_init (GstRtpBinClass * klass) get_internal_storage), NULL, NULL, g_cclosure_marshal_generic, G_TYPE_OBJECT, 1, G_TYPE_UINT); + /** + * GstRtpBin::get-storage: + * @rtpbin: the object which received the signal + * @id: the session id + * + * Request the RTPStorage element as #GObject in session @id. + * + * Since: 1.16 + */ + gst_rtp_bin_signals[SIGNAL_GET_STORAGE] = + g_signal_new ("get-storage", G_TYPE_FROM_CLASS (klass), + G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION, G_STRUCT_OFFSET (GstRtpBinClass, + get_storage), NULL, NULL, g_cclosure_marshal_generic, + GST_TYPE_ELEMENT, 1, G_TYPE_UINT); + /** * GstRtpBin::on-new-ssrc: * @rtpbin: the object which received the signal @@ -2704,6 +2738,7 @@ gst_rtp_bin_class_init (GstRtpBinClass * klass) 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->get_storage = GST_DEBUG_FUNCPTR (gst_rtp_bin_get_storage); klass->get_internal_storage = GST_DEBUG_FUNCPTR (gst_rtp_bin_get_internal_storage); 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 aa93b0b499..00f76545c0 100644 --- a/gst/rtpmanager/gstrtpbin.h +++ b/gst/rtpmanager/gstrtpbin.h @@ -109,6 +109,7 @@ struct _GstRtpBinClass { void (*reset_sync) (GstRtpBin *rtpbin); GstElement* (*get_session) (GstRtpBin *rtpbin, guint session); RTPSession* (*get_internal_session) (GstRtpBin *rtpbin, guint session); + GstElement* (*get_storage) (GstRtpBin *rtpbin, guint session); GObject* (*get_internal_storage) (GstRtpBin *rtpbin, guint session); /* session manager signals */