mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-10-22 10:23:47 +00:00
rtpbin: new signal "get-storage"
Similar to the get-session and get-internal-session signals, we expose a get-storage signal in addition to the get-internal-storage signal to give access to the actual element for applications that need to set properties on the element, in particular "size-time" https://bugzilla.gnome.org/show_bug.cgi?id=794910
This commit is contained in:
parent
0f1770f2bd
commit
4f8b34ab85
2 changed files with 36 additions and 0 deletions
|
@ -262,6 +262,7 @@ enum
|
||||||
SIGNAL_RESET_SYNC,
|
SIGNAL_RESET_SYNC,
|
||||||
SIGNAL_GET_SESSION,
|
SIGNAL_GET_SESSION,
|
||||||
SIGNAL_GET_INTERNAL_SESSION,
|
SIGNAL_GET_INTERNAL_SESSION,
|
||||||
|
SIGNAL_GET_STORAGE,
|
||||||
SIGNAL_GET_INTERNAL_STORAGE,
|
SIGNAL_GET_INTERNAL_STORAGE,
|
||||||
|
|
||||||
SIGNAL_ON_NEW_SSRC,
|
SIGNAL_ON_NEW_SSRC,
|
||||||
|
@ -1146,6 +1147,24 @@ gst_rtp_bin_get_internal_session (GstRtpBin * bin, guint session_id)
|
||||||
return internal_session;
|
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 *
|
static GObject *
|
||||||
gst_rtp_bin_get_internal_storage (GstRtpBin * bin, guint session_id)
|
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,
|
get_internal_storage), NULL, NULL, g_cclosure_marshal_generic,
|
||||||
G_TYPE_OBJECT, 1, G_TYPE_UINT);
|
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:
|
* GstRtpBin::on-new-ssrc:
|
||||||
* @rtpbin: the object which received the signal
|
* @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_session = GST_DEBUG_FUNCPTR (gst_rtp_bin_get_session);
|
||||||
klass->get_internal_session =
|
klass->get_internal_session =
|
||||||
GST_DEBUG_FUNCPTR (gst_rtp_bin_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 =
|
klass->get_internal_storage =
|
||||||
GST_DEBUG_FUNCPTR (gst_rtp_bin_get_internal_storage);
|
GST_DEBUG_FUNCPTR (gst_rtp_bin_get_internal_storage);
|
||||||
klass->request_rtp_encoder = GST_DEBUG_FUNCPTR (gst_rtp_bin_request_encoder);
|
klass->request_rtp_encoder = GST_DEBUG_FUNCPTR (gst_rtp_bin_request_encoder);
|
||||||
|
|
|
@ -109,6 +109,7 @@ struct _GstRtpBinClass {
|
||||||
void (*reset_sync) (GstRtpBin *rtpbin);
|
void (*reset_sync) (GstRtpBin *rtpbin);
|
||||||
GstElement* (*get_session) (GstRtpBin *rtpbin, guint session);
|
GstElement* (*get_session) (GstRtpBin *rtpbin, guint session);
|
||||||
RTPSession* (*get_internal_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);
|
GObject* (*get_internal_storage) (GstRtpBin *rtpbin, guint session);
|
||||||
|
|
||||||
/* session manager signals */
|
/* session manager signals */
|
||||||
|
|
Loading…
Reference in a new issue