mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-10-07 19:22:15 +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;
|
GstRtpSessionPrivate *priv;
|
||||||
GstCaps *result;
|
GstCaps *result;
|
||||||
GstStructure *s1, *s2;
|
GstStructure *s1, *s2;
|
||||||
|
guint ssrc;
|
||||||
|
|
||||||
rtpsession = GST_RTP_SESSION (gst_pad_get_parent (pad));
|
rtpsession = GST_RTP_SESSION (gst_pad_get_parent (pad));
|
||||||
priv = rtpsession->priv;
|
priv = rtpsession->priv;
|
||||||
|
|
||||||
|
ssrc = rtp_session_get_internal_ssrc (priv->session);
|
||||||
|
|
||||||
/* we can basically accept anything but we prefer to receive packets with our
|
/* 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
|
* internal SSRC so that we don't have to patch it. Create a structure with
|
||||||
* the SSRC and another one without. */
|
* the SSRC and another one without. */
|
||||||
s1 = gst_structure_new ("application/x-rtp",
|
s1 = gst_structure_new ("application/x-rtp", "ssrc", G_TYPE_UINT, ssrc, NULL);
|
||||||
"ssrc", G_TYPE_UINT, priv->session->source->ssrc, NULL);
|
|
||||||
s2 = gst_structure_new ("application/x-rtp", NULL);
|
s2 = gst_structure_new ("application/x-rtp", NULL);
|
||||||
|
|
||||||
result = gst_caps_new_full (s1, s2, NULL);
|
result = gst_caps_new_full (s1, s2, NULL);
|
||||||
|
|
|
@ -63,6 +63,7 @@ enum
|
||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
PROP_0,
|
PROP_0,
|
||||||
|
PROP_INTERNAL_SSRC,
|
||||||
PROP_INTERNAL_SOURCE,
|
PROP_INTERNAL_SOURCE,
|
||||||
PROP_BANDWIDTH,
|
PROP_BANDWIDTH,
|
||||||
PROP_RTCP_FRACTION,
|
PROP_RTCP_FRACTION,
|
||||||
|
@ -244,6 +245,11 @@ rtp_session_class_init (RTPSessionClass * klass)
|
||||||
NULL, NULL, g_cclosure_marshal_VOID__OBJECT, G_TYPE_NONE, 1,
|
NULL, NULL, g_cclosure_marshal_VOID__OBJECT, G_TYPE_NONE, 1,
|
||||||
RTP_TYPE_SOURCE);
|
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_object_class_install_property (gobject_class, PROP_INTERNAL_SOURCE,
|
||||||
g_param_spec_object ("internal-source", "Internal Source",
|
g_param_spec_object ("internal-source", "Internal Source",
|
||||||
"The internal source element of the session",
|
"The internal source element of the session",
|
||||||
|
@ -451,6 +457,9 @@ rtp_session_set_property (GObject * object, guint prop_id,
|
||||||
sess = RTP_SESSION (object);
|
sess = RTP_SESSION (object);
|
||||||
|
|
||||||
switch (prop_id) {
|
switch (prop_id) {
|
||||||
|
case PROP_INTERNAL_SSRC:
|
||||||
|
rtp_session_set_internal_ssrc (sess, g_value_get_uint (value));
|
||||||
|
break;
|
||||||
case PROP_BANDWIDTH:
|
case PROP_BANDWIDTH:
|
||||||
rtp_session_set_bandwidth (sess, g_value_get_double (value));
|
rtp_session_set_bandwidth (sess, g_value_get_double (value));
|
||||||
break;
|
break;
|
||||||
|
@ -503,6 +512,9 @@ rtp_session_get_property (GObject * object, guint prop_id,
|
||||||
sess = RTP_SESSION (object);
|
sess = RTP_SESSION (object);
|
||||||
|
|
||||||
switch (prop_id) {
|
switch (prop_id) {
|
||||||
|
case PROP_INTERNAL_SSRC:
|
||||||
|
g_value_set_uint (value, rtp_session_get_internal_ssrc (sess));
|
||||||
|
break;
|
||||||
case PROP_INTERNAL_SOURCE:
|
case PROP_INTERNAL_SOURCE:
|
||||||
g_value_take_object (value, rtp_session_get_internal_source (sess));
|
g_value_take_object (value, rtp_session_get_internal_source (sess));
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in a new issue