summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYouness Alaoui <kakaroto@kakaroto.homelinux.net>2014-08-11 15:53:51 -0400
committerOlivier CrĂȘte <olivier.crete@collabora.com>2015-01-27 16:38:39 -0500
commit9102709e6f8a0b9c390e8636589c3d80f9b1810a (patch)
tree2512847b46dce4e878bdc155990ce8124cd304d6
parent5bd19ca4a6c4fa0df50f521eb860d97e95310641 (diff)
downloadfarstream-9102709e6f8a0b9c390e8636589c3d80f9b1810a.tar.gz
Add support for send-rtcp-mux on fs-rtp-session and nice transmitter
In fs_nice_transmitter_set_send_component_mux(), the component IDs, which start from 1, are used as nicesinks array indexes and nicesinks[0] is always NULL.
-rw-r--r--gst/fsrtpconference/fs-rtp-stream.c43
-rw-r--r--transmitters/nice/fs-nice-stream-transmitter.c25
-rw-r--r--transmitters/nice/fs-nice-transmitter.c13
-rw-r--r--transmitters/nice/fs-nice-transmitter.h3
4 files changed, 82 insertions, 2 deletions
diff --git a/gst/fsrtpconference/fs-rtp-stream.c b/gst/fsrtpconference/fs-rtp-stream.c
index 36088198..ebe30f16 100644
--- a/gst/fsrtpconference/fs-rtp-stream.c
+++ b/gst/fsrtpconference/fs-rtp-stream.c
@@ -76,7 +76,8 @@ enum
PROP_PARTICIPANT,
PROP_SESSION,
PROP_RTP_HEADER_EXTENSIONS,
- PROP_DECRYPTION_PARAMETERS
+ PROP_DECRYPTION_PARAMETERS,
+ PROP_SEND_RTCP_MUX
};
struct _FsRtpStreamPrivate
@@ -85,6 +86,7 @@ struct _FsRtpStreamPrivate
FsStreamTransmitter *stream_transmitter;
FsStreamDirection direction;
+ gboolean send_rtcp_mux;
stream_new_remote_codecs_cb new_remote_codecs_cb;
stream_known_source_packet_receive_cb known_source_packet_received_cb;
@@ -231,6 +233,14 @@ fs_rtp_stream_class_init (FsRtpStreamClass *klass)
" would like to use",
FS_TYPE_RTP_HEADER_EXTENSION_LIST,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
+
+ g_object_class_install_property (gobject_class,
+ PROP_SEND_RTCP_MUX,
+ g_param_spec_boolean ("send-rtcp-mux",
+ "Send RTCP muxed with on the same RTP connection",
+ "Send RTCP muxed with on the same RTP connection",
+ FALSE,
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
}
static void
@@ -454,6 +464,17 @@ fs_rtp_stream_get_property (GObject *object,
g_value_set_boxed (value, self->priv->decryption_parameters);
FS_RTP_SESSION_UNLOCK (session);
break;
+ case PROP_SEND_RTCP_MUX:
+ FS_RTP_SESSION_LOCK (session);
+ if (self->priv->stream_transmitter == NULL ||
+ g_object_class_find_property (
+ G_OBJECT_GET_CLASS (self->priv->stream_transmitter),
+ "send-component-mux") != NULL)
+ g_value_set_boolean (value, self->priv->send_rtcp_mux);
+ else
+ g_value_set_boolean (value, FALSE);
+ FS_RTP_SESSION_UNLOCK (session);
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
@@ -541,6 +562,23 @@ fs_rtp_stream_set_property (GObject *object,
}
}
break;
+ case PROP_SEND_RTCP_MUX:
+ {
+ FsRtpSession *session = fs_rtp_stream_get_session (self, NULL);
+
+ if (session) {
+ FS_RTP_SESSION_LOCK (session);
+ self->priv->send_rtcp_mux = g_value_get_boolean (value);
+ if (self->priv->stream_transmitter != NULL &&
+ g_object_class_find_property (
+ G_OBJECT_GET_CLASS (self->priv->stream_transmitter),
+ "send-component-mux") != NULL)
+ g_object_set (self->priv->stream_transmitter,
+ "send-component-mux", self->priv->send_rtcp_mux, NULL);
+ FS_RTP_SESSION_UNLOCK (session);
+ }
+ }
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
@@ -1178,6 +1216,9 @@ fs_rtp_stream_set_transmitter (FsStream *stream,
self->priv->sending_changed_locked_cb (self,
self->priv->direction & FS_DIRECTION_SEND,
self->priv->user_data_for_cb);
+ if (g_object_class_find_property (G_OBJECT_GET_CLASS (st),
+ "send-component-mux") != NULL)
+ g_object_set (st, "send-component-mux", self->priv->send_rtcp_mux, NULL);
FS_RTP_SESSION_UNLOCK (session);
if (!fs_stream_transmitter_gather_local_candidates (st, error))
diff --git a/transmitters/nice/fs-nice-stream-transmitter.c b/transmitters/nice/fs-nice-stream-transmitter.c
index df752d39..9040635b 100644
--- a/transmitters/nice/fs-nice-stream-transmitter.c
+++ b/transmitters/nice/fs-nice-stream-transmitter.c
@@ -71,7 +71,8 @@ enum
PROP_ICE_TCP,
PROP_ICE_UDP,
PROP_RELIABLE,
- PROP_DEBUG
+ PROP_DEBUG,
+ PROP_SEND_COMPONENT_MUX
};
struct _FsNiceStreamTransmitterPrivate
@@ -92,6 +93,7 @@ struct _FsNiceStreamTransmitterPrivate
gboolean ice_udp;
gboolean ice_tcp;
gboolean reliable;
+ gboolean send_component_mux;
guint compatibility_mode;
@@ -417,6 +419,14 @@ fs_nice_stream_transmitter_class_init (FsNiceStreamTransmitterClass *klass)
0,
G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS));
+ g_object_class_install_property (gobject_class, PROP_SEND_COMPONENT_MUX,
+ g_param_spec_boolean (
+ "send-component-mux",
+ "Send component mux",
+ "Whether to mux all components on the same component as component 1",
+ FALSE,
+ G_PARAM_WRITABLE | G_PARAM_STATIC_STRINGS));
+
}
static void
@@ -605,6 +615,9 @@ fs_nice_stream_transmitter_get_property (GObject *object,
g_value_set_boolean (value,
g_atomic_int_get (&self->priv->associate_on_source));
break;
+ case PROP_SEND_COMPONENT_MUX:
+ g_value_set_boolean (value, self->priv->send_component_mux);
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
@@ -682,6 +695,13 @@ fs_nice_stream_transmitter_set_property (GObject *object,
nice_debug_disable (TRUE);
}
break;
+ case PROP_SEND_COMPONENT_MUX:
+ self->priv->send_component_mux = g_value_get_boolean (value);
+ if (self->priv->gststream != NULL)
+ fs_nice_transmitter_set_send_component_mux (self->priv->transmitter,
+ self->priv->gststream, self->priv->send_component_mux);
+ break;
+
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
@@ -1525,6 +1545,9 @@ fs_nice_stream_transmitter_build (FsNiceStreamTransmitter *self,
if (self->priv->gststream == NULL)
return FALSE;
+ fs_nice_transmitter_set_send_component_mux (self->priv->transmitter,
+ self->priv->gststream, self->priv->send_component_mux);
+
GST_DEBUG ("Created a stream with %u components",
self->priv->transmitter->components);
diff --git a/transmitters/nice/fs-nice-transmitter.c b/transmitters/nice/fs-nice-transmitter.c
index 7bb9e465..41545373 100644
--- a/transmitters/nice/fs-nice-transmitter.c
+++ b/transmitters/nice/fs-nice-transmitter.c
@@ -868,3 +868,16 @@ fs_nice_transmitter_request_keyunit (FsNiceTransmitter *self,
"all-headers", G_TYPE_BOOLEAN, TRUE,
NULL)));
}
+
+void
+fs_nice_transmitter_set_send_component_mux (FsNiceTransmitter *self,
+ NiceGstStream *ns, gboolean send_component_mux)
+{
+ guint component;
+
+ for (component = 2; component <= self->components; component++)
+ {
+ g_object_set (ns->nicesinks[component],
+ "component", send_component_mux ? 1 : component, NULL);
+ }
+}
diff --git a/transmitters/nice/fs-nice-transmitter.h b/transmitters/nice/fs-nice-transmitter.h
index c39e77e4..f068c399 100644
--- a/transmitters/nice/fs-nice-transmitter.h
+++ b/transmitters/nice/fs-nice-transmitter.h
@@ -106,6 +106,9 @@ void fs_nice_transmitter_set_sending (FsNiceTransmitter *self,
void fs_nice_transmitter_request_keyunit (FsNiceTransmitter *self,
NiceGstStream *ns, guint component);
+void fs_nice_transmitter_set_send_component_mux (FsNiceTransmitter *self,
+ NiceGstStream *ns, gboolean send_component_mux);
+
G_END_DECLS