webrtc lib: Make the rtpsender struct private
authorOlivier CrĂȘte <olivier.crete@collabora.com>
Wed, 21 Apr 2021 20:00:57 +0000 (16:00 -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/gstwebrtcbin.c
gst-libs/gst/webrtc/rtpsender.c
gst-libs/gst/webrtc/rtpsender.h
gst-libs/gst/webrtc/webrtc-priv.h

index df5bc8e..38d556f 100644 (file)
@@ -31,6 +31,8 @@
 #include "webrtcdatachannel.h"
 #include "sctptransport.h"
 
+#include "gst/webrtc/webrtc-priv.h"
+
 #include <gst/rtp/rtp.h>
 
 #include <stdio.h>
index 90221dd..90f43cc 100644 (file)
@@ -32,6 +32,7 @@
 
 #include "rtpsender.h"
 #include "rtptransceiver.h"
+#include "webrtc-priv.h"
 
 #define GST_CAT_DEFAULT gst_webrtc_rtp_sender_debug
 GST_DEBUG_CATEGORY_STATIC (GST_CAT_DEFAULT);
index 44eee81..b3ca9a0 100644 (file)
@@ -35,48 +35,6 @@ GType gst_webrtc_rtp_sender_get_type(void);
 #define GST_IS_WEBRTC_RTP_SENDER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass) ,GST_TYPE_WEBRTC_RTP_SENDER))
 #define GST_WEBRTC_RTP_SENDER_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS((obj) ,GST_TYPE_WEBRTC_RTP_SENDER,GstWebRTCRTPSenderClass))
 
-/**
- * GstWebRTCRTPSender:
- * @transport: The transport for RTP packets
- * @send_encodings: Unused
- * @priority: The priority of the stream (Since: 1.20)
- *
- * An object to track the sending aspect of the stream
- *
- * Mostly matches the WebRTC RTCRtpSender interface.
- *
- * Since: 1.16
- */
-/**
- * GstWebRTCRTPSender.priority:
- *
- * The priority of the stream
- *
- * Since: 1.20
- */
-struct _GstWebRTCRTPSender
-{
-  GstObject                          parent;
-
-  /* The MediStreamTrack is represented by the stream and is output into @transport as necessary */
-  GstWebRTCDTLSTransport            *transport;
-
-  GArray                            *send_encodings;
-  GstWebRTCPriorityType              priority;
-
-  gpointer                          _padding[GST_PADDING];
-};
-
-struct _GstWebRTCRTPSenderClass
-{
-  GstObjectClass        parent_class;
-
-  gpointer              _padding[GST_PADDING];
-};
-
-GST_WEBRTC_API
-GstWebRTCRTPSender *        gst_webrtc_rtp_sender_new                   (void);
-
 GST_WEBRTC_API
 void                        gst_webrtc_rtp_sender_set_priority          (GstWebRTCRTPSender *sender,
                                                                          GstWebRTCPriorityType priority);
index 6f2d3ea..559fc2d 100644 (file)
@@ -86,6 +86,48 @@ struct _GstWebRTCRTPTransceiverClass
   gpointer              _padding[GST_PADDING];
 };
 
+/**
+ * GstWebRTCRTPSender:
+ * @transport: The transport for RTP packets
+ * @send_encodings: Unused
+ * @priority: The priority of the stream (Since: 1.20)
+ *
+ * An object to track the sending aspect of the stream
+ *
+ * Mostly matches the WebRTC RTCRtpSender interface.
+ *
+ * Since: 1.16
+ */
+/**
+ * GstWebRTCRTPSender.priority:
+ *
+ * The priority of the stream
+ *
+ * Since: 1.20
+ */
+struct _GstWebRTCRTPSender
+{
+  GstObject                          parent;
+
+  /* The MediStreamTrack is represented by the stream and is output into @transport as necessary */
+  GstWebRTCDTLSTransport            *transport;
+
+  GArray                            *send_encodings;
+  GstWebRTCPriorityType              priority;
+
+  gpointer                          _padding[GST_PADDING];
+};
+
+struct _GstWebRTCRTPSenderClass
+{
+  GstObjectClass        parent_class;
+
+  gpointer              _padding[GST_PADDING];
+};
+
+GST_WEBRTC_API
+GstWebRTCRTPSender *        gst_webrtc_rtp_sender_new                   (void);
+
 G_END_DECLS
 
 #endif /* __GST_WEBRTC_PRIV_H__ */