webrtc: Add some locks to setters and remove non-existing functions from headers

https://bugzilla.gnome.org/show_bug.cgi?id=794363
This commit is contained in:
Sebastian Dröge 2018-03-15 17:31:50 +02:00
parent dabfe399eb
commit 950ead9215
7 changed files with 14 additions and 15 deletions

View 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

View 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");
}

View 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

View 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

View 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

View 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,

View 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__ */