webrtc: Add some locks to setters and remove non-existing functions from headers
authorSebastian Dröge <sebastian@centricular.com>
Thu, 15 Mar 2018 15:31:50 +0000 (17:31 +0200)
committerSebastian Dröge <sebastian@centricular.com>
Fri, 16 Mar 2018 08:37:24 +0000 (10:37 +0200)
https://bugzilla.gnome.org/show_bug.cgi?id=794363

gst-libs/gst/webrtc/dtlstransport.c
gst-libs/gst/webrtc/icetransport.c
gst-libs/gst/webrtc/rtpreceiver.c
gst-libs/gst/webrtc/rtpreceiver.h
gst-libs/gst/webrtc/rtpsender.c
gst-libs/gst/webrtc/rtpsender.h
gst-libs/gst/webrtc/rtptransceiver.h

index 31324c3..d6b760e 100644 (file)
@@ -66,7 +66,9 @@ gst_webrtc_dtls_transport_set_transport (GstWebRTCDTLSTransport * transport,
   g_return_if_fail (GST_IS_WEBRTC_DTLS_TRANSPORT (transport));
   g_return_if_fail (GST_IS_WEBRTC_ICE_TRANSPORT (ice));
 
+  GST_OBJECT_LOCK (transport);
   gst_object_replace ((GstObject **) & transport->transport, GST_OBJECT (ice));
+  GST_OBJECT_UNLOCK (transport);
 }
 
 static void
index d5ed060..e6f4437 100644 (file)
@@ -66,7 +66,9 @@ void
 gst_webrtc_ice_transport_connection_state_change (GstWebRTCICETransport * ice,
     GstWebRTCICEConnectionState new_state)
 {
+  GST_OBJECT_LOCK (ice);
   ice->state = new_state;
+  GST_OBJECT_UNLOCK (ice);
   g_object_notify (G_OBJECT (ice), "state");
 }
 
@@ -74,7 +76,9 @@ void
 gst_webrtc_ice_transport_gathering_state_change (GstWebRTCICETransport * ice,
     GstWebRTCICEGatheringState new_state)
 {
+  GST_OBJECT_LOCK (ice);
   ice->gathering_state = new_state;
+  GST_OBJECT_UNLOCK (ice);
   g_object_notify (G_OBJECT (ice), "gathering-state");
 }
 
index edf6e20..f21d77e 100644 (file)
@@ -60,8 +60,10 @@ gst_webrtc_rtp_receiver_set_transport (GstWebRTCRTPReceiver * receiver,
   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->transport,
       GST_OBJECT (transport));
+  GST_OBJECT_UNLOCK (receiver);
 }
 
 void
@@ -71,8 +73,10 @@ gst_webrtc_rtp_receiver_set_rtcp_transport (GstWebRTCRTPReceiver * receiver,
   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);
 }
 
 static void
index c68d9ba..82a541c 100644 (file)
@@ -59,12 +59,6 @@ struct _GstWebRTCRTPReceiverClass
 GST_WEBRTC_API
 GstWebRTCRTPReceiver *      gst_webrtc_rtp_receiver_new                 (void);
 GST_WEBRTC_API
-GstStructure *              gst_webrtc_rtp_receiver_get_parameters      (GstWebRTCRTPReceiver * receiver, gchar * kind);
-/* FIXME: promise? */
-GST_WEBRTC_API
-gboolean                    gst_webrtc_rtp_receiver_set_parameters      (GstWebRTCRTPReceiver * receiver,
-                                                                         GstStructure * parameters);
-GST_WEBRTC_API
 void                        gst_webrtc_rtp_receiver_set_transport       (GstWebRTCRTPReceiver * receiver,
                                                                          GstWebRTCDTLSTransport * transport);
 GST_WEBRTC_API
index b4dfe6e..4dc6dec 100644 (file)
@@ -66,8 +66,10 @@ gst_webrtc_rtp_sender_set_transport (GstWebRTCRTPSender * sender,
   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->transport,
       GST_OBJECT (transport));
+  GST_OBJECT_UNLOCK (sender);
 }
 
 void
@@ -77,8 +79,10 @@ gst_webrtc_rtp_sender_set_rtcp_transport (GstWebRTCRTPSender * sender,
   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);
 }
 
 static void
index 179afef..40f7eae 100644 (file)
@@ -57,12 +57,6 @@ struct _GstWebRTCRTPSenderClass
 
 GST_WEBRTC_API
 GstWebRTCRTPSender *        gst_webrtc_rtp_sender_new                   (GArray * send_encodings);
-GST_WEBRTC_API
-GstStructure *              gst_webrtc_rtp_sender_get_parameters        (GstWebRTCRTPSender * sender, gchar * kind);
-/* FIXME: promise? */
-GST_WEBRTC_API
-gboolean                    gst_webrtc_rtp_sender_set_parameters        (GstWebRTCRTPSender * sender,
-                                                                         GstStructure * parameters);
 
 GST_WEBRTC_API
 void                        gst_webrtc_rtp_sender_set_transport         (GstWebRTCRTPSender * sender,
index a4f8eb6..6192314 100644 (file)
@@ -61,9 +61,6 @@ struct _GstWebRTCRTPTransceiverClass
   gpointer              _padding[GST_PADDING];
 };
 
-GST_WEBRTC_API
-void                        gst_webrtc_rtp_transceiver_stop     (GstWebRTCRTPTransceiver * transceiver);
-
 G_END_DECLS
 
 #endif /* __GST_WEBRTC_RTP_TRANSCEIVER_H__ */