[vala] gstreamer-1.0: Fix Gst.Base.Adapter.map/take bindings



commit b3e02e1ecd76cf0443287ac6ef99d18be188e840
Author: Rico Tzschichholz <ricotz ubuntu com>
Date:   Wed Mar 8 09:50:02 2017 +0100

    gstreamer-1.0: Fix Gst.Base.Adapter.map/take bindings
    
    There is no explicit array-length returned while it is implicitly related
    to the in-parameter those methods are taking.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=705987

 vapi/gstreamer-base-1.0.vapi          |    8 ++++----
 vapi/metadata/GstBase-1.0-custom.vala |    8 +++++++-
 vapi/metadata/GstBase-1.0.metadata    |    4 ++++
 3 files changed, 15 insertions(+), 5 deletions(-)
---
diff --git a/vapi/gstreamer-base-1.0.vapi b/vapi/gstreamer-base-1.0.vapi
index fdd3ec7..b2b88b9 100644
--- a/vapi/gstreamer-base-1.0.vapi
+++ b/vapi/gstreamer-base-1.0.vapi
@@ -26,8 +26,8 @@ namespace Gst {
                        public Gst.BufferList? get_buffer_list (size_t nbytes);
                        [Version (since = "1.6")]
                        public GLib.List<Gst.Buffer>? get_list (size_t nbytes);
-                       [CCode (array_length_pos = 0.1, array_length_type = "gsize")]
-                       public unowned uint8[]? map ();
+                       [CCode (array_length = false)]
+                       public unowned uint8[]? map (size_t size);
                        public ssize_t masked_scan_uint32 (uint32 mask, uint32 pattern, size_t offset, size_t 
size);
                        public ssize_t masked_scan_uint32_peek (uint32 mask, uint32 pattern, size_t offset, 
size_t size, out uint32 value);
                        [Version (since = "1.10")]
@@ -43,8 +43,8 @@ namespace Gst {
                        [Version (since = "1.10")]
                        public Gst.ClockTime pts_at_discont ();
                        public void push (owned Gst.Buffer buf);
-                       [CCode (array_length_pos = 0.1, array_length_type = "gsize")]
-                       public uint8[]? take ();
+                       [CCode (array_length = false)]
+                       public uint8[]? take (size_t nbytes);
                        public Gst.Buffer? take_buffer (size_t nbytes);
                        [Version (since = "1.2")]
                        public Gst.Buffer? take_buffer_fast (size_t nbytes);
diff --git a/vapi/metadata/GstBase-1.0-custom.vala b/vapi/metadata/GstBase-1.0-custom.vala
index 773ab1b..b198a6f 100644
--- a/vapi/metadata/GstBase-1.0-custom.vala
+++ b/vapi/metadata/GstBase-1.0-custom.vala
@@ -1,5 +1,11 @@
 namespace Gst {
        namespace Base {
+               public class Adapter : GLib.Object {
+                       [CCode (array_length = false)]
+                       public unowned uint8[]? map (size_t size);
+                       [CCode (array_length = false)]
+                       public uint8[]? take (size_t nbytes);
+               }
                [CCode (cheader_filename = 
"gst/base/gstadapter.h,gst/base/gstbaseparse.h,gst/base/gstbasesink.h,gst/base/gstbasesrc.h,gst/base/gstbasetransform.h,gst/base/gstbitreader.h,gst/base/gstbytereader.h,gst/base/gstbytewriter.h,gst/base/gstcollectpads.h,gst/base/gstpushsrc.h,gst/base/gsttypefindhelper.h",
 cname = "GstBitReader")]
                [Compact]
                public class BitReader {
@@ -18,4 +24,4 @@ public ByteWriter.with_size (uint size, bool fixed);
 public ByteWriter.with_data ([CCode (array_length_type = "guint")] uint8[] data, uint size, bool 
initialized);
                }
        }
-}
\ No newline at end of file
+}
diff --git a/vapi/metadata/GstBase-1.0.metadata b/vapi/metadata/GstBase-1.0.metadata
index a876068..6514339 100644
--- a/vapi/metadata/GstBase-1.0.metadata
+++ b/vapi/metadata/GstBase-1.0.metadata
@@ -14,6 +14,10 @@ ByteWriter struct=false
 BitReader struct=false
 ByteReader struct=false
 
+Adapter
+  .map skip
+  .take skip
+
 // Backwards compatibility
 Adapter
   .copy skip=false


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]