[0.11] gstreamer: caps: Make GstCaps public struct more opaque by moving the private pointer into the implementation

Sebastian Dröge slomo at kemper.freedesktop.org
Thu Jan 26 05:46:01 PST 2012


Module: gstreamer
Branch: 0.11
Commit: b4066a6c956a29f7bb977f5a8b9f2a77af02f539
URL:    http://cgit.freedesktop.org/gstreamer/gstreamer/commit/?id=b4066a6c956a29f7bb977f5a8b9f2a77af02f539

Author: Sebastian Dröge <sebastian.droege at collabora.co.uk>
Date:   Thu Jan 26 14:45:30 2012 +0100

caps: Make GstCaps public struct more opaque by moving the private pointer into the implementation

---

 gst/gstcaps.c |   10 ++++++++--
 gst/gstcaps.h |    3 ---
 2 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/gst/gstcaps.c b/gst/gstcaps.c
index 9c1bd7f..f85c07e 100644
--- a/gst/gstcaps.c
+++ b/gst/gstcaps.c
@@ -75,8 +75,14 @@
 
 #define DEBUG_REFCOUNT
 
+typedef struct _GstCapsImpl
+{
+  GstCaps caps;
+
+  GPtrArray *array;
+} GstCapsImpl;
 
-#define GST_CAPS_ARRAY(c) ((GPtrArray *)((c)->priv))
+#define GST_CAPS_ARRAY(c) (((GstCapsImpl *)(c))->array)
 
 #define GST_CAPS_LEN(c)   (GST_CAPS_ARRAY(c)->len)
 
@@ -191,7 +197,7 @@ gst_caps_init (GstCaps * caps, gsize size)
    * in practise
    * GST_CAPS_ARRAY (caps) = g_ptr_array_sized_new (32);
    */
-  caps->priv = g_ptr_array_new ();
+  GST_CAPS_ARRAY (caps) = g_ptr_array_new ();
 }
 
 /**
diff --git a/gst/gstcaps.h b/gst/gstcaps.h
index 4b59c48..4603182 100644
--- a/gst/gstcaps.h
+++ b/gst/gstcaps.h
@@ -344,9 +344,6 @@ gst_caps_take (GstCaps **old_caps, GstCaps *new_caps)
  */
 struct _GstCaps {
   GstMiniObject mini_object;
-
-  /*< private >*/
-  gpointer     priv;
 };
 
 /**



More information about the gstreamer-commits mailing list