webrtc lib: Make the icetransport struct private
authorOlivier CrĂȘte <olivier.crete@collabora.com>
Wed, 21 Apr 2021 20:17:23 +0000 (16:17 -0400)
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Mon, 21 Jun 2021 20:53:09 +0000 (20:53 +0000)
This will prevent any unsafe access.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2241>

ext/webrtc/nicetransport.h
gst-libs/gst/webrtc/icetransport.c
gst-libs/gst/webrtc/icetransport.h
gst-libs/gst/webrtc/webrtc-priv.h

index 4819649..d31e7b7 100644 (file)
@@ -26,6 +26,8 @@
 #include <gst/webrtc/webrtc.h>
 #include "gstwebrtcice.h"
 
+#include "gst/webrtc/webrtc-priv.h"
+
 G_BEGIN_DECLS
 
 GType gst_webrtc_nice_transport_get_type(void);
index 21e2cbe..da5a643 100644 (file)
@@ -33,6 +33,8 @@
 #include "icetransport.h"
 #include "webrtc-enumtypes.h"
 
+#include "webrtc-priv.h"
+
 #define GST_CAT_DEFAULT gst_webrtc_ice_transport_debug
 GST_DEBUG_CATEGORY_STATIC (GST_CAT_DEFAULT);
 
index c1e56d4..09f44e5 100644 (file)
@@ -34,46 +34,6 @@ GType gst_webrtc_ice_transport_get_type(void);
 #define GST_IS_WEBRTC_ICE_TRANSPORT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass) ,GST_TYPE_WEBRTC_ICE_TRANSPORT))
 #define GST_WEBRTC_ICE_TRANSPORT_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS((obj) ,GST_TYPE_WEBRTC_ICE_TRANSPORT,GstWebRTCICETransportClass))
 
-/**
- * GstWebRTCICETransport:
- */
-struct _GstWebRTCICETransport
-{
-  GstObject                          parent;
-
-  GstWebRTCICERole                   role;
-  GstWebRTCICEComponent              component;
-
-  GstWebRTCICEConnectionState        state;
-  GstWebRTCICEGatheringState         gathering_state;
-
-  /* Filled by subclasses */
-  GstElement                        *src;
-  GstElement                        *sink;
-
-  gpointer                          _padding[GST_PADDING];
-};
-
-struct _GstWebRTCICETransportClass
-{
-  GstObjectClass               parent_class;
-
-  gboolean                  (*gather_candidates)        (GstWebRTCICETransport * transport);
-
-  gpointer                  _padding[GST_PADDING];
-};
-
-GST_WEBRTC_API
-void            gst_webrtc_ice_transport_connection_state_change    (GstWebRTCICETransport * ice,
-                                                                     GstWebRTCICEConnectionState new_state);
-GST_WEBRTC_API
-void            gst_webrtc_ice_transport_gathering_state_change     (GstWebRTCICETransport * ice,
-                                                                     GstWebRTCICEGatheringState new_state);
-GST_WEBRTC_API
-void            gst_webrtc_ice_transport_selected_pair_change       (GstWebRTCICETransport * ice);
-GST_WEBRTC_API
-void            gst_webrtc_ice_transport_new_candidate              (GstWebRTCICETransport * ice, guint stream_id, GstWebRTCICEComponent component, gchar * attr);
-
 G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstWebRTCICETransport, gst_object_unref)
 
 G_END_DECLS
index d1768c4..7a23827 100644 (file)
@@ -159,6 +159,47 @@ GST_WEBRTC_API
 GstWebRTCRTPReceiver *      gst_webrtc_rtp_receiver_new                 (void);
 
 
+/**
+ * GstWebRTCICETransport:
+ */
+struct _GstWebRTCICETransport
+{
+  GstObject                          parent;
+
+  GstWebRTCICERole                   role;
+  GstWebRTCICEComponent              component;
+
+  GstWebRTCICEConnectionState        state;
+  GstWebRTCICEGatheringState         gathering_state;
+
+  /* Filled by subclasses */
+  GstElement                        *src;
+  GstElement                        *sink;
+
+  gpointer                          _padding[GST_PADDING];
+};
+
+struct _GstWebRTCICETransportClass
+{
+  GstObjectClass               parent_class;
+
+  gboolean                  (*gather_candidates)        (GstWebRTCICETransport * transport);
+
+  gpointer                  _padding[GST_PADDING];
+};
+
+GST_WEBRTC_API
+void            gst_webrtc_ice_transport_connection_state_change    (GstWebRTCICETransport * ice,
+                                                                     GstWebRTCICEConnectionState new_state);
+GST_WEBRTC_API
+void            gst_webrtc_ice_transport_gathering_state_change     (GstWebRTCICETransport * ice,
+                                                                     GstWebRTCICEGatheringState new_state);
+GST_WEBRTC_API
+void            gst_webrtc_ice_transport_selected_pair_change       (GstWebRTCICETransport * ice);
+GST_WEBRTC_API
+void            gst_webrtc_ice_transport_new_candidate              (GstWebRTCICETransport * ice, guint stream_id, GstWebRTCICEComponent component, gchar * attr);
+
+
 G_END_DECLS
 
 #endif /* __GST_WEBRTC_PRIV_H__ */