diff --git a/ext/webrtc/gstwebrtcbin.c b/ext/webrtc/gstwebrtcbin.c index baded4cd1f..b5e53a1810 100644 --- a/ext/webrtc/gstwebrtcbin.c +++ b/ext/webrtc/gstwebrtcbin.c @@ -80,10 +80,10 @@ * configuration. Some cases are outlined below for a simple single * audio/video/data session: * - * - max-bundle (requires rtcp-muxing) uses a single transport for all + * - max-bundle uses a single transport for all * media/data transported. Renegotiation involves adding/removing the * necessary streams to the existing transports. - * - max-compat without rtcp-mux involves two TransportStream per media stream + * - max-compat involves two TransportStream per media stream * to transport the rtp and the rtcp packets and a single TransportStream for * all data channels. Each stream change involves modifying the associated * TransportStream/s as necessary. @@ -859,11 +859,8 @@ _collate_ice_connection_states (GstWebRTCBin * webrtc) for (i = 0; i < webrtc->priv->transceivers->len; i++) { GstWebRTCRTPTransceiver *rtp_trans = g_ptr_array_index (webrtc->priv->transceivers, i); - WebRTCTransceiver *trans = WEBRTC_TRANSCEIVER (rtp_trans); - TransportStream *stream = trans->stream; - GstWebRTCICETransport *transport, *rtcp_transport; + GstWebRTCICETransport *transport; GstWebRTCICEConnectionState ice_state; - gboolean rtcp_mux = FALSE; if (rtp_trans->stopped) { GST_TRACE_OBJECT (webrtc, "transceiver %p stopped", rtp_trans); @@ -875,8 +872,6 @@ _collate_ice_connection_states (GstWebRTCBin * webrtc) continue; } - g_object_get (stream, "rtcp-mux", &rtcp_mux, NULL); - transport = webrtc_transceiver_get_dtls_transport (rtp_trans)->transport; /* get transport state */ @@ -892,24 +887,6 @@ _collate_ice_connection_states (GstWebRTCBin * webrtc) if (ice_state != STATE (CONNECTED) && ice_state != STATE (COMPLETED) && ice_state != STATE (CLOSED)) all_connected_completed_or_closed = FALSE; - - rtcp_transport = - webrtc_transceiver_get_rtcp_dtls_transport (rtp_trans)->transport; - - if (!rtcp_mux && rtcp_transport && transport != rtcp_transport) { - g_object_get (rtcp_transport, "state", &ice_state, NULL); - GST_TRACE_OBJECT (webrtc, "transceiver %p RTCP state 0x%x", rtp_trans, - ice_state); - any_state |= (1 << ice_state); - - if (ice_state != STATE (NEW) && ice_state != STATE (CLOSED)) - all_new_or_closed = FALSE; - if (ice_state != STATE (COMPLETED) && ice_state != STATE (CLOSED)) - all_completed_or_closed = FALSE; - if (ice_state != STATE (CONNECTED) && ice_state != STATE (COMPLETED) - && ice_state != STATE (CLOSED)) - all_connected_completed_or_closed = FALSE; - } } GST_TRACE_OBJECT (webrtc, "ICE connection state: 0x%x", any_state); @@ -970,7 +947,7 @@ _collate_ice_gathering_states (GstWebRTCBin * webrtc) WebRTCTransceiver *trans = WEBRTC_TRANSCEIVER (rtp_trans); TransportStream *stream = trans->stream; GstWebRTCDTLSTransport *dtls_transport; - GstWebRTCICETransport *transport, *rtcp_transport; + GstWebRTCICETransport *transport; GstWebRTCICEGatheringState ice_state; gboolean rtcp_mux = FALSE; @@ -1003,22 +980,6 @@ _collate_ice_gathering_states (GstWebRTCBin * webrtc) any_state |= (1 << ice_state); if (ice_state != STATE (COMPLETE)) all_completed = FALSE; - - dtls_transport = webrtc_transceiver_get_rtcp_dtls_transport (rtp_trans); - if (dtls_transport == NULL) { - GST_WARNING ("Transceiver %p has no DTLS RTCP transport", rtp_trans); - continue; - } - rtcp_transport = dtls_transport->transport; - - if (!rtcp_mux && rtcp_transport && rtcp_transport != transport) { - g_object_get (rtcp_transport, "gathering-state", &ice_state, NULL); - GST_TRACE_OBJECT (webrtc, "transceiver %p RTCP gathering state: 0x%x", - rtp_trans, ice_state); - any_state |= (1 << ice_state); - if (ice_state != STATE (COMPLETE)) - all_completed = FALSE; - } } GST_TRACE_OBJECT (webrtc, "ICE gathering state: 0x%x", any_state); @@ -1064,7 +1025,7 @@ _collate_peer_connection_states (GstWebRTCBin * webrtc) g_ptr_array_index (webrtc->priv->transceivers, i); WebRTCTransceiver *trans = WEBRTC_TRANSCEIVER (rtp_trans); TransportStream *stream = trans->stream; - GstWebRTCDTLSTransport *transport, *rtcp_transport; + GstWebRTCDTLSTransport *transport; GstWebRTCICEConnectionState ice_state; GstWebRTCDTLSTransportState dtls_state; gboolean rtcp_mux = FALSE; @@ -1107,38 +1068,6 @@ _collate_peer_connection_states (GstWebRTCBin * webrtc) if (ice_state != ICE_STATE (CONNECTED) && ice_state != ICE_STATE (COMPLETED) && ice_state != ICE_STATE (CLOSED)) ice_all_connected_completed_or_closed = FALSE; - - rtcp_transport = webrtc_transceiver_get_rtcp_dtls_transport (rtp_trans); - - if (!rtcp_mux && rtcp_transport && rtcp_transport != transport) { - g_object_get (rtcp_transport, "state", &dtls_state, NULL); - GST_TRACE_OBJECT (webrtc, "transceiver %p RTCP DTLS state: 0x%x", - rtp_trans, dtls_state); - any_dtls_state |= (1 << dtls_state); - - if (dtls_state != DTLS_STATE (NEW) && dtls_state != DTLS_STATE (CLOSED)) - dtls_all_new_or_closed = FALSE; - if (dtls_state != DTLS_STATE (NEW) - && dtls_state != DTLS_STATE (CONNECTING)) - dtls_all_new_connecting_or_checking = FALSE; - if (dtls_state != DTLS_STATE (CONNECTED) - && dtls_state != DTLS_STATE (CLOSED)) - dtls_all_connected_completed_or_closed = FALSE; - - g_object_get (rtcp_transport->transport, "state", &ice_state, NULL); - GST_TRACE_OBJECT (webrtc, "transceiver %p RTCP ICE state: 0x%x", - rtp_trans, ice_state); - any_ice_state |= (1 << ice_state); - - if (ice_state != ICE_STATE (NEW) && ice_state != ICE_STATE (CLOSED)) - ice_all_new_or_closed = FALSE; - if (ice_state != ICE_STATE (NEW) && ice_state != ICE_STATE (CHECKING)) - ice_all_new_connecting_or_checking = FALSE; - if (ice_state != ICE_STATE (CONNECTED) - && ice_state != ICE_STATE (COMPLETED) - && ice_state != ICE_STATE (CLOSED)) - ice_all_connected_completed_or_closed = FALSE; - } } GST_TRACE_OBJECT (webrtc, "ICE connection state: 0x%x. DTLS connection " @@ -1704,7 +1633,7 @@ _on_sending_rtcp (GObject * internal_session, GstBuffer * buffer, pad_name = g_strdup_printf ("send_rtcp_src_%u", - rtp_trans->sender->rtcp_transport->session_id); + rtp_trans->sender->transport->session_id); pad = gst_element_get_static_pad (webrtc->rtpbin, pad_name); g_free (pad_name); if (pad) { @@ -1895,8 +1824,6 @@ gst_webrtc_bin_attach_tos (GstWebRTCBin * webrtc) gst_webrtc_bin_attach_probe_to_ice_sink (webrtc, stream->transport->transport); - gst_webrtc_bin_attach_probe_to_ice_sink (webrtc, - stream->rtcp_transport->transport); } gst_webrtc_bin_update_sctp_priority (webrtc); @@ -1954,18 +1881,6 @@ _create_transport_channel (GstWebRTCBin * webrtc, guint session_id) if (webrtc->priv->tos_attached) gst_webrtc_bin_attach_probe_to_ice_sink (webrtc, transport->transport); - if ((transport = ret->rtcp_transport)) { - g_signal_connect (G_OBJECT (transport->transport), - "notify::state", G_CALLBACK (_on_ice_transport_notify_state), webrtc); - g_signal_connect (G_OBJECT (transport->transport), - "notify::gathering-state", - G_CALLBACK (_on_ice_transport_notify_gathering_state), webrtc); - g_signal_connect (G_OBJECT (transport), "notify::state", - G_CALLBACK (_on_dtls_transport_notify_state), webrtc); - if (webrtc->priv->tos_attached) - gst_webrtc_bin_attach_probe_to_ice_sink (webrtc, transport->transport); - } - GST_TRACE_OBJECT (webrtc, "Create transport %" GST_PTR_FORMAT " for session %u", ret, session_id); @@ -6985,11 +6900,6 @@ _transport_free (GObject * object) g_signal_handlers_disconnect_by_data (stream->transport->transport, webrtc); g_signal_handlers_disconnect_by_data (stream->transport, webrtc); } - if (stream->rtcp_transport) { - g_signal_handlers_disconnect_by_data (stream->rtcp_transport->transport, - webrtc); - g_signal_handlers_disconnect_by_data (stream->rtcp_transport, webrtc); - } gst_object_unref (object); } diff --git a/ext/webrtc/nicetransport.c b/ext/webrtc/nicetransport.c index f922ec0371..ebd08793e5 100644 --- a/ext/webrtc/nicetransport.c +++ b/ext/webrtc/nicetransport.c @@ -171,7 +171,6 @@ gst_webrtc_nice_transport_finalize (GObject * object) void gst_webrtc_nice_transport_update_buffer_size (GstWebRTCNiceTransport * nice) { - GstWebRTCICETransport *ice = GST_WEBRTC_ICE_TRANSPORT (nice); NiceAgent *agent = NULL; GPtrArray *sockets; guint i; @@ -179,8 +178,7 @@ gst_webrtc_nice_transport_update_buffer_size (GstWebRTCNiceTransport * nice) g_object_get (nice->stream->ice, "agent", &agent, NULL); g_assert (agent != NULL); - sockets = nice_agent_get_sockets (agent, nice->stream->stream_id, - ice->component + 1); + sockets = nice_agent_get_sockets (agent, nice->stream->stream_id, 1); if (sockets == NULL) { g_object_unref (agent); return; diff --git a/ext/webrtc/transportreceivebin.c b/ext/webrtc/transportreceivebin.c index 6d38a8325e..df89e6ebbb 100644 --- a/ext/webrtc/transportreceivebin.c +++ b/ext/webrtc/transportreceivebin.c @@ -25,24 +25,16 @@ #include "utils.h" /* - * ,----------------------------transport_receive_%u---------------------------, - * ; (rtp/data) ; - * ; ,-nicesrc-, ,-capsfilter-, ,--queue--, ,-dtlssrtpdec-, ,-funnel-, ; - * ; ; src o-o sink src o-osink srco-osink rtp_srco-------o sink_0 ; ; - * ; '---------' '------------' '---------' ; ; ; src o--o rtp_src - * ; ; rtcp_srco---, ,-o sink_1 ; ; - * ; ; ; ; ; '--------' ; - * ; ; data_srco-, ; ; ,-funnel-, ; - * ; (rtcp) '-------------' ; '-+-o sink_0 ; ; - * ; ,-nicesrc-, ,-capsfilter-, ,--queue--, ,-dtlssrtpdec-, ; ,-' ; src o--o rtcp_src - * ; ; src o-o sink src o-osink srco-osink rtp_srco-+-' ,-o sink_1 ; ; - * ; '---------' '------------' '---------' ; ; ; ; '--------' ; - * ; ; rtcp_srco-+---' ,-funnel-, ; - * ; ; ; '-----o sink_0 ; ; - * ; ; data_srco-, ; src o--o data_src - * ; '-------------' '-----o sink_1 ; ; - * ; '--------' ; - * '---------------------------------------------------------------------------' + * ,-----------------------transport_receive_%u------------------, + * ; ; + * ; ,-nicesrc-, ,-capsfilter-, ,---queue---, ,-dtlssrtpdec-, ; + * ; ; src o-o sink src o-o sink src o-osink rtp_srco---o rtp_src + * ; '---------' '------------' '-----------' ; ; ; + * ; ; rtcp_srco---o rtcp_src + * ; ; ; ; + * ; ; data_srco---o data_src + * ; '-------------' ; + * '-------------------------------------------------------------' * * Do we really wnat to be *that* permissive in what we accept? * @@ -155,24 +147,9 @@ transport_receive_bin_set_receive_state (TransportReceiveBin * receive, (GstPadProbeCallback) pad_block, receive, NULL); gst_object_unref (peer_pad); gst_object_unref (pad); - - transport = receive->stream->rtcp_transport; - dtlssrtpdec = transport->dtlssrtpdec; - pad = gst_element_get_static_pad (dtlssrtpdec, "sink"); - peer_pad = gst_pad_get_peer (pad); - receive->rtcp_block = - _create_pad_block (GST_ELEMENT (receive), peer_pad, 0, NULL, NULL); - receive->rtcp_block->block_id = - gst_pad_add_probe (peer_pad, - GST_PAD_PROBE_TYPE_BLOCK | - GST_PAD_PROBE_TYPE_DATA_DOWNSTREAM, - (GstPadProbeCallback) pad_block, receive, NULL); - gst_object_unref (peer_pad); - gst_object_unref (pad); } } } - receive->receive_state = state; g_mutex_unlock (&receive->pad_block_lock); } @@ -250,9 +227,6 @@ transport_receive_bin_change_state (GstElement * element, elem = receive->stream->transport->transport->src; gst_element_set_locked_state (elem, TRUE); gst_element_set_state (elem, GST_STATE_PLAYING); - elem = receive->stream->rtcp_transport->transport->src; - gst_element_set_locked_state (elem, TRUE); - gst_element_set_state (elem, GST_STATE_PLAYING); break; } default: @@ -270,9 +244,6 @@ transport_receive_bin_change_state (GstElement * element, elem = receive->stream->transport->transport->src; gst_element_set_locked_state (elem, FALSE); gst_element_set_state (elem, GST_STATE_NULL); - elem = receive->stream->rtcp_transport->transport->src; - gst_element_set_locked_state (elem, FALSE); - gst_element_set_state (elem, GST_STATE_NULL); if (receive->rtp_block) _free_pad_block (receive->rtp_block); @@ -303,7 +274,7 @@ transport_receive_bin_constructed (GObject * object) TransportReceiveBin *receive = TRANSPORT_RECEIVE_BIN (object); GstWebRTCDTLSTransport *transport; GstPad *ghost, *pad; - GstElement *capsfilter, *funnel, *queue; + GstElement *capsfilter, *queue; GstCaps *caps; g_return_if_fail (receive->stream); @@ -336,76 +307,25 @@ transport_receive_bin_constructed (GObject * object) GST_ELEMENT (capsfilter), "sink")) g_warn_if_reached (); - /* link ice src, dtlsrtp together for rtcp */ - transport = receive->stream->rtcp_transport; - gst_bin_add (GST_BIN (receive), GST_ELEMENT (transport->dtlssrtpdec)); - - capsfilter = gst_element_factory_make ("capsfilter", NULL); - caps = gst_caps_new_empty_simple ("application/x-rtcp"); - g_object_set (capsfilter, "caps", caps, NULL); - gst_caps_unref (caps); - - queue = gst_element_factory_make ("queue", NULL); - /* FIXME: make this configurable? */ - g_object_set (queue, "leaky", 2, "max-size-time", (guint64) 0, - "max-size-buffers", 0, "max-size-bytes", 5 * 1024 * 1024, NULL); - g_signal_connect (queue, "overrun", G_CALLBACK (rtp_queue_overrun), receive); - - gst_bin_add (GST_BIN (receive), queue); - gst_bin_add (GST_BIN (receive), GST_ELEMENT (capsfilter)); - if (!gst_element_link_pads (capsfilter, "src", queue, "sink")) - g_warn_if_reached (); - - if (!gst_element_link_pads (queue, "src", transport->dtlssrtpdec, "sink")) - g_warn_if_reached (); - - gst_bin_add (GST_BIN (receive), GST_ELEMENT (transport->transport->src)); - if (!gst_element_link_pads (GST_ELEMENT (transport->transport->src), "src", - GST_ELEMENT (capsfilter), "sink")) - g_warn_if_reached (); - - /* create funnel for rtp_src */ - funnel = gst_element_factory_make ("funnel", NULL); - gst_bin_add (GST_BIN (receive), funnel); - if (!gst_element_link_pads (receive->stream->transport->dtlssrtpdec, - "rtp_src", funnel, "sink_0")) - g_warn_if_reached (); - if (!gst_element_link_pads (receive->stream->rtcp_transport->dtlssrtpdec, - "rtp_src", funnel, "sink_1")) - g_warn_if_reached (); - - pad = gst_element_get_static_pad (funnel, "src"); + /* expose rtp_src */ + pad = + gst_element_get_static_pad (receive->stream->transport->dtlssrtpdec, + "rtp_src"); receive->rtp_src = gst_ghost_pad_new ("rtp_src", pad); gst_element_add_pad (GST_ELEMENT (receive), receive->rtp_src); gst_object_unref (pad); - /* create funnel for rtcp_src */ - funnel = gst_element_factory_make ("funnel", NULL); - gst_bin_add (GST_BIN (receive), funnel); - if (!gst_element_link_pads (receive->stream->transport->dtlssrtpdec, - "rtcp_src", funnel, "sink_0")) - g_warn_if_reached (); - if (!gst_element_link_pads (receive->stream->rtcp_transport->dtlssrtpdec, - "rtcp_src", funnel, "sink_1")) - g_warn_if_reached (); - - pad = gst_element_get_static_pad (funnel, "src"); + /* expose rtcp_rtc */ + pad = gst_element_get_static_pad (receive->stream->transport->dtlssrtpdec, + "rtcp_src"); receive->rtcp_src = gst_ghost_pad_new ("rtcp_src", pad); gst_element_add_pad (GST_ELEMENT (receive), receive->rtcp_src); gst_object_unref (pad); - /* create funnel for data_src */ - funnel = gst_element_factory_make ("funnel", NULL); - gst_bin_add (GST_BIN (receive), funnel); - if (!gst_element_link_pads (receive->stream->transport->dtlssrtpdec, - "data_src", funnel, "sink_0")) - g_warn_if_reached (); - if (!gst_element_link_pads (receive->stream->rtcp_transport->dtlssrtpdec, - "data_src", funnel, "sink_1")) - g_warn_if_reached (); - - pad = gst_element_get_static_pad (funnel, "src"); + /* expose data_src */ + pad = gst_element_get_request_pad (receive->stream->transport->dtlssrtpdec, + "data_src"); ghost = gst_ghost_pad_new ("data_src", pad); gst_element_add_pad (GST_ELEMENT (receive), ghost); gst_object_unref (pad); diff --git a/ext/webrtc/transportsendbin.c b/ext/webrtc/transportsendbin.c index dc5c1ff0e2..7484a2ff7d 100644 --- a/ext/webrtc/transportsendbin.c +++ b/ext/webrtc/transportsendbin.c @@ -25,20 +25,16 @@ #include "utils.h" /* - * ,------------------------transport_send_%u-------------------------, - * ; ,-----dtlssrtpenc---, ; - * data_sink o--------------------------o data_sink ; ; - * ; ; ; ,---nicesink---, ; - * rtp_sink o--------------------------o rtp_sink_0 src o--o sink ; ; - * ; ; ; '--------------' ; - * ; ,--outputselector--, ,-o rtcp_sink_0 ; ; - * ; ; src_0 o-' '-------------------' ; - * rtcp_sink ;---o sink ; ,----dtlssrtpenc----, ,---nicesink---, ; - * ; ; src_1 o---o rtcp_sink_0 src o--o sink ; ; - * ; '------------------' '-------------------' '--------------' ; - * '------------------------------------------------------------------' + * ,--------------transport_send_%u-------- ---, + * ; ,-----dtlssrtpenc---, ; + * data_sink o---o data_sink ; ; + * ; ; ; ,---nicesink---, ; + * rtp_sink o---o rtp_sink_0 src o--o sink ; ; + * ; ; ; '--------------' ; + * rtcp_sink o---o rtcp_sink_0 ; ; + * ; '-------------------' + * '-------------------------------------------' * - * outputselecter is used to switch between rtcp-mux and no rtcp-mux * * FIXME: Do we need a valve drop=TRUE for the no RTCP case? */ @@ -82,24 +78,6 @@ enum static void cleanup_blocks (TransportSendBin * send); -static void -_set_rtcp_mux (TransportSendBin * send, gboolean rtcp_mux) -{ - GstPad *active_pad; - - if (rtcp_mux) - active_pad = gst_element_get_static_pad (send->outputselector, "src_0"); - else - active_pad = gst_element_get_static_pad (send->outputselector, "src_1"); - send->rtcp_mux = rtcp_mux; - GST_OBJECT_UNLOCK (send); - - g_object_set (send->outputselector, "active-pad", active_pad, NULL); - - gst_object_unref (active_pad); - GST_OBJECT_LOCK (send); -} - static void transport_send_bin_set_property (GObject * object, guint prop_id, const GValue * value, GParamSpec * pspec) @@ -112,9 +90,6 @@ transport_send_bin_set_property (GObject * object, guint prop_id, /* XXX: weak-ref this? Note, it's construct-only so can't be changed later */ send->stream = TRANSPORT_STREAM (g_value_get_object (value)); break; - case PROP_RTCP_MUX: - _set_rtcp_mux (send, g_value_get_boolean (value)); - break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; @@ -133,9 +108,6 @@ transport_send_bin_get_property (GObject * object, guint prop_id, case PROP_STREAM: g_value_set_object (value, send->stream); break; - case PROP_RTCP_MUX: - g_value_set_boolean (value, send->rtcp_mux); - break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; @@ -201,7 +173,6 @@ transport_send_bin_change_state (GstElement * element, * we should only add it once/if we get the encoding keys */ TSB_LOCK (send); gst_element_set_locked_state (send->rtp_ctx.dtlssrtpenc, TRUE); - gst_element_set_locked_state (send->rtcp_ctx.dtlssrtpenc, TRUE); send->active = TRUE; TSB_UNLOCK (send); break; @@ -220,13 +191,6 @@ transport_send_bin_change_state (GstElement * element, elem = send->stream->transport->transport->sink; send->rtp_ctx.nice_block = block_peer_pad (elem, "sink"); - /* RTCP */ - elem = send->stream->rtcp_transport->dtlssrtpenc; - /* Block the RTCP DTLS encoder */ - send->rtcp_ctx.rtcp_block = block_peer_pad (elem, "rtcp_sink_0"); - /* unblock ice sink once a connection is made, this should also be automatic */ - elem = send->stream->rtcp_transport->transport->sink; - send->rtcp_ctx.nice_block = block_peer_pad (elem, "sink"); TSB_UNLOCK (send); break; } @@ -257,7 +221,6 @@ transport_send_bin_change_state (GstElement * element, cleanup_blocks (send); gst_element_set_locked_state (send->rtp_ctx.dtlssrtpenc, FALSE); - gst_element_set_locked_state (send->rtcp_ctx.dtlssrtpenc, FALSE); TSB_UNLOCK (send); break; @@ -276,8 +239,6 @@ _on_dtls_enc_key_set (GstElement * dtlssrtpenc, TransportSendBin * send) if (dtlssrtpenc == send->rtp_ctx.dtlssrtpenc) ctx = &send->rtp_ctx; - else if (dtlssrtpenc == send->rtcp_ctx.dtlssrtpenc) - ctx = &send->rtcp_ctx; else { GST_WARNING_OBJECT (send, "Received dtls-enc key info for unknown element %" GST_PTR_FORMAT, @@ -308,8 +269,6 @@ _on_notify_dtls_client_status (GstElement * dtlssrtpenc, TransportSendBinDTLSContext *ctx; if (dtlssrtpenc == send->rtp_ctx.dtlssrtpenc) ctx = &send->rtp_ctx; - else if (dtlssrtpenc == send->rtcp_ctx.dtlssrtpenc) - ctx = &send->rtcp_ctx; else { GST_WARNING_OBJECT (send, "Received dtls-enc client mode for unknown element %" GST_PTR_FORMAT, @@ -351,13 +310,6 @@ _on_notify_ice_connection_state (GstWebRTCICETransport * transport, _free_pad_block (send->rtp_ctx.nice_block); send->rtp_ctx.nice_block = NULL; } - } else if (transport == send->stream->rtcp_transport->transport) { - if (send->rtcp_ctx.nice_block) { - GST_LOG_OBJECT (send, "Unblocking pad %" GST_PTR_FORMAT, - send->rtcp_ctx.nice_block->pad); - _free_pad_block (send->rtcp_ctx.nice_block); - send->rtcp_ctx.nice_block = NULL; - } } TSB_UNLOCK (send); } @@ -400,13 +352,6 @@ transport_send_bin_constructed (GObject * object) g_return_if_fail (send->stream); - g_object_bind_property (send, "rtcp-mux", send->stream, "rtcp-mux", - G_BINDING_BIDIRECTIONAL); - - /* Output selector to direct the RTCP for muxed-mode */ - send->outputselector = gst_element_factory_make ("output-selector", NULL); - gst_bin_add (GST_BIN (send), send->outputselector); - /* RTP */ transport = send->stream->transport; /* Do the common init for the context struct */ @@ -417,10 +362,6 @@ transport_send_bin_constructed (GObject * object) pad = gst_element_request_pad (transport->dtlssrtpenc, templ, "rtp_sink_0", NULL); - if (!gst_element_link_pads (GST_ELEMENT (send->outputselector), "src_0", - GST_ELEMENT (transport->dtlssrtpenc), "rtcp_sink_0")) - g_warn_if_reached (); - ghost = gst_ghost_pad_new ("rtp_sink", pad); gst_element_add_pad (GST_ELEMENT (send), ghost); gst_object_unref (pad); @@ -436,17 +377,11 @@ transport_send_bin_constructed (GObject * object) gst_object_unref (pad); /* RTCP */ - transport = send->stream->rtcp_transport; /* Do the common init for the context struct */ - tsb_setup_ctx (send, &send->rtcp_ctx, transport); templ = _find_pad_template (transport->dtlssrtpenc, GST_PAD_SINK, GST_PAD_REQUEST, "rtcp_sink_%d"); - - if (!gst_element_link_pads (GST_ELEMENT (send->outputselector), "src_1", - GST_ELEMENT (transport->dtlssrtpenc), "rtcp_sink_0")) - g_warn_if_reached (); - - pad = gst_element_get_static_pad (send->outputselector, "sink"); + pad = gst_element_request_pad (transport->dtlssrtpenc, templ, "rtcp_sink_0", + NULL); ghost = gst_ghost_pad_new ("rtcp_sink", pad); gst_element_add_pad (GST_ELEMENT (send), ghost); @@ -478,7 +413,6 @@ static void cleanup_blocks (TransportSendBin * send) { cleanup_ctx_blocks (&send->rtp_ctx); - cleanup_ctx_blocks (&send->rtcp_ctx); } static void @@ -491,10 +425,6 @@ transport_send_bin_dispose (GObject * object) g_signal_handlers_disconnect_by_data (send->rtp_ctx.nicesink, send); send->rtp_ctx.nicesink = NULL; } - if (send->rtcp_ctx.nicesink) { - g_signal_handlers_disconnect_by_data (send->rtcp_ctx.nicesink, send); - send->rtcp_ctx.nicesink = NULL; - } cleanup_blocks (send); TSB_UNLOCK (send); @@ -623,12 +553,6 @@ transport_send_bin_class_init (TransportSendBinClass * klass) "The TransportStream for this sending bin", transport_stream_get_type (), G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS)); - - g_object_class_install_property (gobject_class, - PROP_RTCP_MUX, - g_param_spec_boolean ("rtcp-mux", "RTCP Mux", - "Whether RTCP packets are muxed with RTP packets", - FALSE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); } static void diff --git a/ext/webrtc/transportsendbin.h b/ext/webrtc/transportsendbin.h index ed10a07234..8bc688ddaa 100644 --- a/ext/webrtc/transportsendbin.h +++ b/ext/webrtc/transportsendbin.h @@ -54,12 +54,8 @@ struct _TransportSendBin gboolean active; /* Flag that's cleared on shutdown */ TransportStream *stream; /* parent transport stream */ - gboolean rtcp_mux; - - GstElement *outputselector; TransportSendBinDTLSContext rtp_ctx; - TransportSendBinDTLSContext rtcp_ctx; /* struct pad_block *rtp_block; diff --git a/ext/webrtc/transportstream.c b/ext/webrtc/transportstream.c index 01261ae1be..73a551de23 100644 --- a/ext/webrtc/transportstream.c +++ b/ext/webrtc/transportstream.c @@ -178,10 +178,6 @@ transport_stream_dispose (GObject * object) gst_object_unref (stream->transport); stream->transport = NULL; - if (stream->rtcp_transport) - gst_object_unref (stream->rtcp_transport); - stream->rtcp_transport = NULL; - if (stream->rtxsend) gst_object_unref (stream->rtxsend); stream->rtxsend = NULL; @@ -213,19 +209,12 @@ transport_stream_constructed (GObject * object) GstWebRTCBin *webrtc; GstWebRTCICETransport *ice_trans; - stream->transport = gst_webrtc_dtls_transport_new (stream->session_id, FALSE); - stream->rtcp_transport = - gst_webrtc_dtls_transport_new (stream->session_id, TRUE); + stream->transport = gst_webrtc_dtls_transport_new (stream->session_id); webrtc = GST_WEBRTC_BIN (gst_object_get_parent (GST_OBJECT (object))); g_object_bind_property (stream->transport, "client", stream, "dtls-client", G_BINDING_BIDIRECTIONAL); - g_object_bind_property (stream->rtcp_transport, "client", stream, - "dtls-client", G_BINDING_BIDIRECTIONAL); - - g_object_bind_property (stream->transport, "certificate", - stream->rtcp_transport, "certificate", G_BINDING_BIDIRECTIONAL); /* Need to go full Java and have a transport manager? * Or make the caller set the ICE transport up? */ @@ -242,12 +231,6 @@ transport_stream_constructed (GObject * object) gst_webrtc_dtls_transport_set_transport (stream->transport, ice_trans); gst_object_unref (ice_trans); - ice_trans = - gst_webrtc_ice_find_transport (webrtc->priv->ice, stream->stream, - GST_WEBRTC_ICE_COMPONENT_RTCP); - gst_webrtc_dtls_transport_set_transport (stream->rtcp_transport, ice_trans); - gst_object_unref (ice_trans); - stream->send_bin = g_object_new (transport_send_bin_get_type (), "stream", stream, NULL); gst_object_ref_sink (stream->send_bin); diff --git a/ext/webrtc/transportstream.h b/ext/webrtc/transportstream.h index 174d93e907..939b6e8319 100644 --- a/ext/webrtc/transportstream.h +++ b/ext/webrtc/transportstream.h @@ -58,7 +58,6 @@ struct _TransportStream GstWebRTCICEStream *stream; GstWebRTCDTLSTransport *transport; - GstWebRTCDTLSTransport *rtcp_transport; GArray *ptmap; /* array of PtMapItem's */ GArray *remote_ssrcmap; /* array of SsrcMapItem's */ diff --git a/ext/webrtc/webrtctransceiver.c b/ext/webrtc/webrtctransceiver.c index c42fd232ff..db012f3922 100644 --- a/ext/webrtc/webrtctransceiver.c +++ b/ext/webrtc/webrtctransceiver.c @@ -65,13 +65,6 @@ webrtc_transceiver_set_transport (WebRTCTransceiver * trans, if (rtp_trans->receiver) gst_object_replace ((GstObject **) & rtp_trans->receiver->transport, (GstObject *) stream->transport); - - if (rtp_trans->sender) - gst_object_replace ((GstObject **) & rtp_trans->sender->rtcp_transport, - (GstObject *) stream->rtcp_transport); - if (rtp_trans->receiver) - gst_object_replace ((GstObject **) & rtp_trans->receiver->rtcp_transport, - (GstObject *) stream->rtcp_transport); } GstWebRTCDTLSTransport * @@ -88,20 +81,6 @@ webrtc_transceiver_get_dtls_transport (GstWebRTCRTPTransceiver * trans) return NULL; } -GstWebRTCDTLSTransport * -webrtc_transceiver_get_rtcp_dtls_transport (GstWebRTCRTPTransceiver * trans) -{ - g_return_val_if_fail (WEBRTC_IS_TRANSCEIVER (trans), NULL); - - if (trans->sender) { - return trans->sender->rtcp_transport; - } else if (trans->receiver) { - return trans->receiver->rtcp_transport; - } - - return NULL; -} - static void webrtc_transceiver_set_property (GObject * object, guint prop_id, const GValue * value, GParamSpec * pspec) diff --git a/gst-libs/gst/webrtc/dtlstransport.c b/gst-libs/gst/webrtc/dtlstransport.c index 2c7135b1dc..bba2e3528b 100644 --- a/gst-libs/gst/webrtc/dtlstransport.c +++ b/gst-libs/gst/webrtc/dtlstransport.c @@ -55,8 +55,7 @@ enum PROP_STATE, PROP_CLIENT, PROP_CERTIFICATE, - PROP_REMOTE_CERTIFICATE, - PROP_RTCP, + PROP_REMOTE_CERTIFICATE }; void @@ -88,9 +87,6 @@ gst_webrtc_dtls_transport_set_property (GObject * object, guint prop_id, case PROP_CERTIFICATE: g_object_set_property (G_OBJECT (webrtc->dtlssrtpdec), "pem", value); break; - case PROP_RTCP: - webrtc->is_rtcp = g_value_get_boolean (value); - break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; @@ -123,9 +119,6 @@ gst_webrtc_dtls_transport_get_property (GObject * object, guint prop_id, case PROP_REMOTE_CERTIFICATE: g_object_get_property (G_OBJECT (webrtc->dtlssrtpdec), "peer-pem", value); break; - case PROP_RTCP: - g_value_set_boolean (value, webrtc->is_rtcp); - break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; @@ -184,8 +177,8 @@ gst_webrtc_dtls_transport_constructed (GObject * object) /* XXX: this may collide with another connection_id however this is only a * problem if multiple dtls element sets are being used within the same * process */ - connection_id = g_strdup_printf ("%s_%u_%u", webrtc->is_rtcp ? "rtcp" : "rtp", - webrtc->session_id, g_random_int ()); + connection_id = g_strdup_printf ("rtp_%u_%u", webrtc->session_id, + g_random_int ()); webrtc->dtlssrtpenc = gst_element_factory_make ("dtlssrtpenc", NULL); g_object_set (webrtc->dtlssrtpenc, "connection-id", connection_id, @@ -249,12 +242,6 @@ gst_webrtc_dtls_transport_class_init (GstWebRTCDTLSTransportClass * klass) g_param_spec_string ("remote-certificate", "Remote DTLS certificate", "Remote DTLS certificate", NULL, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); - - g_object_class_install_property (gobject_class, - PROP_RTCP, - g_param_spec_boolean ("rtcp", "RTCP", - "The transport is being used solely for RTCP", FALSE, - G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS)); } static void @@ -263,8 +250,8 @@ gst_webrtc_dtls_transport_init (GstWebRTCDTLSTransport * webrtc) } GstWebRTCDTLSTransport * -gst_webrtc_dtls_transport_new (guint session_id, gboolean is_rtcp) +gst_webrtc_dtls_transport_new (guint session_id) { return g_object_new (GST_TYPE_WEBRTC_DTLS_TRANSPORT, "session-id", session_id, - "rtcp", is_rtcp, NULL); + NULL); } diff --git a/gst-libs/gst/webrtc/dtlstransport.h b/gst-libs/gst/webrtc/dtlstransport.h index feb3944bbb..72a8ee98f3 100644 --- a/gst-libs/gst/webrtc/dtlstransport.h +++ b/gst-libs/gst/webrtc/dtlstransport.h @@ -45,7 +45,6 @@ struct _GstWebRTCDTLSTransport GstWebRTCICETransport *transport; GstWebRTCDTLSTransportState state; - gboolean is_rtcp; gboolean client; guint session_id; GstElement *dtlssrtpenc; @@ -62,7 +61,7 @@ struct _GstWebRTCDTLSTransportClass }; GST_WEBRTC_API -GstWebRTCDTLSTransport * gst_webrtc_dtls_transport_new (guint session_id, gboolean rtcp); +GstWebRTCDTLSTransport * gst_webrtc_dtls_transport_new (guint session_id); GST_WEBRTC_API void gst_webrtc_dtls_transport_set_transport (GstWebRTCDTLSTransport * transport, diff --git a/gst-libs/gst/webrtc/rtpreceiver.c b/gst-libs/gst/webrtc/rtpreceiver.c index 768e9876d3..dd8c5a989f 100644 --- a/gst-libs/gst/webrtc/rtpreceiver.c +++ b/gst-libs/gst/webrtc/rtpreceiver.c @@ -63,17 +63,6 @@ gst_webrtc_rtp_receiver_set_transport (GstWebRTCRTPReceiver * receiver, GST_OBJECT_LOCK (receiver); gst_object_replace ((GstObject **) & receiver->transport, GST_OBJECT (transport)); - GST_OBJECT_UNLOCK (receiver); -} - -void -gst_webrtc_rtp_receiver_set_rtcp_transport (GstWebRTCRTPReceiver * receiver, - GstWebRTCDTLSTransport * transport) -{ - g_return_if_fail (GST_IS_WEBRTC_RTP_RECEIVER (receiver)); - g_return_if_fail (GST_IS_WEBRTC_DTLS_TRANSPORT (transport)); - - GST_OBJECT_LOCK (receiver); gst_object_replace ((GstObject **) & receiver->rtcp_transport, GST_OBJECT (transport)); GST_OBJECT_UNLOCK (receiver); diff --git a/gst-libs/gst/webrtc/rtpreceiver.h b/gst-libs/gst/webrtc/rtpreceiver.h index 746bd4fae7..c4260f73f6 100644 --- a/gst-libs/gst/webrtc/rtpreceiver.h +++ b/gst-libs/gst/webrtc/rtpreceiver.h @@ -69,9 +69,6 @@ GstWebRTCRTPReceiver * gst_webrtc_rtp_receiver_new (void); GST_WEBRTC_API void gst_webrtc_rtp_receiver_set_transport (GstWebRTCRTPReceiver * receiver, GstWebRTCDTLSTransport * transport); -GST_WEBRTC_API -void gst_webrtc_rtp_receiver_set_rtcp_transport (GstWebRTCRTPReceiver * receiver, - GstWebRTCDTLSTransport * transport); G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstWebRTCRTPReceiver, gst_object_unref) diff --git a/gst-libs/gst/webrtc/rtpsender.c b/gst-libs/gst/webrtc/rtpsender.c index e14227c0bd..3c533bf2de 100644 --- a/gst-libs/gst/webrtc/rtpsender.c +++ b/gst-libs/gst/webrtc/rtpsender.c @@ -66,17 +66,6 @@ gst_webrtc_rtp_sender_set_transport (GstWebRTCRTPSender * sender, GST_OBJECT_LOCK (sender); gst_object_replace ((GstObject **) & sender->transport, GST_OBJECT (transport)); - GST_OBJECT_UNLOCK (sender); -} - -void -gst_webrtc_rtp_sender_set_rtcp_transport (GstWebRTCRTPSender * sender, - GstWebRTCDTLSTransport * transport) -{ - g_return_if_fail (GST_IS_WEBRTC_RTP_SENDER (sender)); - g_return_if_fail (GST_IS_WEBRTC_DTLS_TRANSPORT (transport)); - - GST_OBJECT_LOCK (sender); gst_object_replace ((GstObject **) & sender->rtcp_transport, GST_OBJECT (transport)); GST_OBJECT_UNLOCK (sender); diff --git a/gst-libs/gst/webrtc/rtpsender.h b/gst-libs/gst/webrtc/rtpsender.h index 6c42f2daca..01c948da54 100644 --- a/gst-libs/gst/webrtc/rtpsender.h +++ b/gst-libs/gst/webrtc/rtpsender.h @@ -83,9 +83,6 @@ GST_WEBRTC_API void gst_webrtc_rtp_sender_set_transport (GstWebRTCRTPSender * sender, GstWebRTCDTLSTransport * transport); GST_WEBRTC_API -void gst_webrtc_rtp_sender_set_rtcp_transport (GstWebRTCRTPSender * sender, - GstWebRTCDTLSTransport * transport); -GST_WEBRTC_API void gst_webrtc_rtp_sender_set_priority (GstWebRTCRTPSender *sender, GstWebRTCPriorityType priority);