summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian@centricular.com>2018-03-15 17:31:50 +0200
committerSebastian Dröge <sebastian@centricular.com>2018-03-16 10:37:24 +0200
commit950ead921542c8c0e16b233f91120357ff53596f (patch)
tree9dada72a8a843691dfb1b28c485517057ebe9d79
parentdabfe399eb7a1a77e65133394591c450d7a4c0d0 (diff)
webrtc: Add some locks to setters and remove non-existing functions from headers
https://bugzilla.gnome.org/show_bug.cgi?id=794363
-rw-r--r--gst-libs/gst/webrtc/dtlstransport.c2
-rw-r--r--gst-libs/gst/webrtc/icetransport.c4
-rw-r--r--gst-libs/gst/webrtc/rtpreceiver.c4
-rw-r--r--gst-libs/gst/webrtc/rtpreceiver.h6
-rw-r--r--gst-libs/gst/webrtc/rtpsender.c4
-rw-r--r--gst-libs/gst/webrtc/rtpsender.h6
-rw-r--r--gst-libs/gst/webrtc/rtptransceiver.h3
7 files changed, 14 insertions, 15 deletions
diff --git a/gst-libs/gst/webrtc/dtlstransport.c b/gst-libs/gst/webrtc/dtlstransport.c
index 31324c34d..d6b760ea3 100644
--- a/gst-libs/gst/webrtc/dtlstransport.c
+++ b/gst-libs/gst/webrtc/dtlstransport.c
@@ -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
diff --git a/gst-libs/gst/webrtc/icetransport.c b/gst-libs/gst/webrtc/icetransport.c
index d5ed0605e..e6f44378f 100644
--- a/gst-libs/gst/webrtc/icetransport.c
+++ b/gst-libs/gst/webrtc/icetransport.c
@@ -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");
}
diff --git a/gst-libs/gst/webrtc/rtpreceiver.c b/gst-libs/gst/webrtc/rtpreceiver.c
index edf6e201b..f21d77ef1 100644
--- a/gst-libs/gst/webrtc/rtpreceiver.c
+++ b/gst-libs/gst/webrtc/rtpreceiver.c
@@ -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
diff --git a/gst-libs/gst/webrtc/rtpreceiver.h b/gst-libs/gst/webrtc/rtpreceiver.h
index c68d9ba19..82a541cf8 100644
--- a/gst-libs/gst/webrtc/rtpreceiver.h
+++ b/gst-libs/gst/webrtc/rtpreceiver.h
@@ -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
diff --git a/gst-libs/gst/webrtc/rtpsender.c b/gst-libs/gst/webrtc/rtpsender.c
index b4dfe6ed8..4dc6deca6 100644
--- a/gst-libs/gst/webrtc/rtpsender.c
+++ b/gst-libs/gst/webrtc/rtpsender.c
@@ -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
diff --git a/gst-libs/gst/webrtc/rtpsender.h b/gst-libs/gst/webrtc/rtpsender.h
index 179afefbf..40f7eae7d 100644
--- a/gst-libs/gst/webrtc/rtpsender.h
+++ b/gst-libs/gst/webrtc/rtpsender.h
@@ -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,
diff --git a/gst-libs/gst/webrtc/rtptransceiver.h b/gst-libs/gst/webrtc/rtptransceiver.h
index a4f8eb609..6192314d0 100644
--- a/gst-libs/gst/webrtc/rtptransceiver.h
+++ b/gst-libs/gst/webrtc/rtptransceiver.h
@@ -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__ */