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 31324c34d7ce66795b39bf9c85f706b4da9127e5..d6b760ea36bb99ca234b2889621ae004064c9a6d 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 d5ed0605e66db4392875b6a09ed3600a405f00de..e6f44378fe6ebe15179f55272a34683b3578a9a8 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 edf6e201bb66694593032a915afc78f469bf5c04..f21d77ef13b63f702b1595e4bd8b54a81eedb4c0 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 c68d9ba19d5be00490322a2e8af06c6cc8fe82a3..82a541cf86bd73d56ebbd5da04e3372a08740a9e 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 b4dfe6ed88b78e8de44c8bfcc0afe10057bae23b..4dc6deca6cd55efa8624de40e191baf20e4d4184 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 179afefbf5637d31906eb85dd1c9abb29aa5fe20..40f7eae7dc6b3b2e18db43d30c8007b632959a46 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 a4f8eb6097412a034f82af22a51f986df51e4a1e..6192314d0e3323020c179c9e16bab0d6260976d3 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__ */