mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-03 04:52:28 +00:00
gst/rtpmanager/gstrtpsession.c: Use method to get the internal SSRC.
Original commit message from CVS: * gst/rtpmanager/gstrtpsession.c: (gst_rtp_session_getcaps_send_rtp): Use method to get the internal SSRC. * gst/rtpmanager/rtpsession.c: (rtp_session_class_init), (rtp_session_set_property), (rtp_session_get_property): Add property to congiure the internal SSRC of the session. Fixes #565910.
This commit is contained in:
parent
1786eb1e25
commit
06d1532024
2 changed files with 16 additions and 2 deletions
|
@ -1653,15 +1653,17 @@ gst_rtp_session_getcaps_send_rtp (GstPad * pad)
|
|||
GstRtpSessionPrivate *priv;
|
||||
GstCaps *result;
|
||||
GstStructure *s1, *s2;
|
||||
guint ssrc;
|
||||
|
||||
rtpsession = GST_RTP_SESSION (gst_pad_get_parent (pad));
|
||||
priv = rtpsession->priv;
|
||||
|
||||
ssrc = rtp_session_get_internal_ssrc (priv->session);
|
||||
|
||||
/* we can basically accept anything but we prefer to receive packets with our
|
||||
* internal SSRC so that we don't have to patch it. Create a structure with
|
||||
* the SSRC and another one without. */
|
||||
s1 = gst_structure_new ("application/x-rtp",
|
||||
"ssrc", G_TYPE_UINT, priv->session->source->ssrc, NULL);
|
||||
s1 = gst_structure_new ("application/x-rtp", "ssrc", G_TYPE_UINT, ssrc, NULL);
|
||||
s2 = gst_structure_new ("application/x-rtp", NULL);
|
||||
|
||||
result = gst_caps_new_full (s1, s2, NULL);
|
||||
|
|
|
@ -63,6 +63,7 @@ enum
|
|||
enum
|
||||
{
|
||||
PROP_0,
|
||||
PROP_INTERNAL_SSRC,
|
||||
PROP_INTERNAL_SOURCE,
|
||||
PROP_BANDWIDTH,
|
||||
PROP_RTCP_FRACTION,
|
||||
|
@ -244,6 +245,11 @@ rtp_session_class_init (RTPSessionClass * klass)
|
|||
NULL, NULL, g_cclosure_marshal_VOID__OBJECT, G_TYPE_NONE, 1,
|
||||
RTP_TYPE_SOURCE);
|
||||
|
||||
g_object_class_install_property (gobject_class, PROP_INTERNAL_SSRC,
|
||||
g_param_spec_uint ("internal-ssrc", "Internal SSRC",
|
||||
"The internal SSRC used for the session",
|
||||
0, G_MAXUINT, 0, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
||||
|
||||
g_object_class_install_property (gobject_class, PROP_INTERNAL_SOURCE,
|
||||
g_param_spec_object ("internal-source", "Internal Source",
|
||||
"The internal source element of the session",
|
||||
|
@ -451,6 +457,9 @@ rtp_session_set_property (GObject * object, guint prop_id,
|
|||
sess = RTP_SESSION (object);
|
||||
|
||||
switch (prop_id) {
|
||||
case PROP_INTERNAL_SSRC:
|
||||
rtp_session_set_internal_ssrc (sess, g_value_get_uint (value));
|
||||
break;
|
||||
case PROP_BANDWIDTH:
|
||||
rtp_session_set_bandwidth (sess, g_value_get_double (value));
|
||||
break;
|
||||
|
@ -503,6 +512,9 @@ rtp_session_get_property (GObject * object, guint prop_id,
|
|||
sess = RTP_SESSION (object);
|
||||
|
||||
switch (prop_id) {
|
||||
case PROP_INTERNAL_SSRC:
|
||||
g_value_set_uint (value, rtp_session_get_internal_ssrc (sess));
|
||||
break;
|
||||
case PROP_INTERNAL_SOURCE:
|
||||
g_value_take_object (value, rtp_session_get_internal_source (sess));
|
||||
break;
|
||||
|
|
Loading…
Reference in a new issue