[vala/staging] gstreamer-1.0: Fix a few binding errors



commit e0b53fead80b82a09dc64944afe069b7f3d32ad6
Author: Rico Tzschichholz <ricotz ubuntu com>
Date:   Wed Jan 27 15:34:53 2021 +0100

    gstreamer-1.0: Fix a few binding errors

 vapi/gstreamer-1.0.vapi           | 67 +++++++++++++++++++--------------------
 vapi/metadata/Gst-1.0-custom.vala | 13 ++++++++
 vapi/metadata/Gst-1.0.metadata    | 28 ++++++++++++++++
 3 files changed, 74 insertions(+), 34 deletions(-)
---
diff --git a/vapi/gstreamer-1.0.vapi b/vapi/gstreamer-1.0.vapi
index feaa85596..19441e7e8 100644
--- a/vapi/gstreamer-1.0.vapi
+++ b/vapi/gstreamer-1.0.vapi
@@ -985,8 +985,6 @@ namespace Gst {
                [Version (since = "1.16")]
                public static Gst.Clock? id_get_clock (Gst.ClockID id);
                public static Gst.ClockTime id_get_time (Gst.ClockID id);
-               public static Gst.ClockID id_ref (Gst.ClockID id);
-               public static void id_unref (owned Gst.ClockID id);
                public static void id_unschedule (Gst.ClockID id);
                [Version (since = "1.16")]
                public static bool id_uses_clock (Gst.ClockID id, Gst.Clock clock);
@@ -1023,6 +1021,14 @@ namespace Gst {
                [Version (since = "1.6")]
                public signal void synced (bool synced);
        }
+       [CCode (cheader_filename = "gst/gst.h")]
+       [Compact]
+       [PointerType]
+       public class ClockID {
+               public Gst.ClockID? id_ref ();
+               [DestroysInstance]
+               public void id_unref ();
+       }
        [CCode (cheader_filename = "gst/gst.h", copy_function = "g_boxed_copy", free_function = 
"g_boxed_free", type_id = "gst_context_get_type ()")]
        [Compact]
        [Version (since = "1.2")]
@@ -1954,7 +1960,7 @@ namespace Gst {
                public void set_chain_list_function (Gst.PadChainListFunction chainlist, void* user_data = 
null, GLib.DestroyNotify? notify = null);
                public void set_element_private (void* priv);
                [Version (since = "1.8")]
-               public void set_event_full_function_full (owned Gst.PadEventFullFunction event);
+               public void set_event_full_function_full (Gst.PadEventFullFunction event, void* user_data = 
null, GLib.DestroyNotify? notify = null);
                [CCode (cname = "gst_pad_set_event_function_full")]
                public void set_event_function (Gst.PadEventFunction event, void* user_data = null, 
GLib.DestroyNotify? notify = null);
                [CCode (cname = "gst_pad_set_getrange_function_full")]
@@ -2024,6 +2030,21 @@ namespace Gst {
                [CCode (has_construct_function = false)]
                protected ParamFraction ();
        }
+       [CCode (cheader_filename = "gst/gst.h", has_type_id = false)]
+       [Compact]
+       public class ParamSpecArray : GLib.ParamSpec {
+               public weak GLib.ParamSpec element_spec;
+       }
+       [CCode (cheader_filename = "gst/gst.h", has_type_id = false)]
+       [Compact]
+       public class ParamSpecFraction : GLib.ParamSpec {
+               public int def_den;
+               public int def_num;
+               public int max_den;
+               public int max_num;
+               public int min_den;
+               public int min_num;
+       }
        [CCode (cheader_filename = "gst/gst.h", free_function = "gst_parse_context_free", type_id = 
"gst_parse_context_get_type ()")]
        [Compact]
        public class ParseContext {
@@ -2133,11 +2154,10 @@ namespace Gst {
                public int wait (Gst.ClockTime timeout);
                public bool write_control ();
        }
-       [CCode (cheader_filename = "gst/gst.h", copy_function = "g_boxed_copy", free_function = 
"g_boxed_free", type_id = "gst_promise_get_type ()")]
+       [CCode (cheader_filename = "gst/gst.h", ref_function = "gst_promise_ref", type_id = 
"gst_promise_get_type ()", unref_function = "gst_promise_unref")]
        [Compact]
        [Version (since = "1.14")]
-       public class Promise {
-               public weak Gst.MiniObject parent;
+       public class Promise : Gst.MiniObject {
                [CCode (has_construct_function = false)]
                public Promise ();
                public void expire ();
@@ -2572,12 +2592,11 @@ namespace Gst {
        [CCode (cheader_filename = "gst/gst.h", type_id = "gst_task_get_type ()")]
        public class Task : Gst.Object {
                public GLib.Cond cond;
-               public weak Gst.TaskFunction func;
+               [CCode (delegate_target_cname = "user_data", destroy_notify_cname = "notify")]
+               public Gst.TaskFunction func;
                public GLib.RecMutex @lock;
-               public weak GLib.DestroyNotify notify;
                public bool running;
                public Gst.TaskState state;
-               public void* user_data;
                [CCode (has_construct_function = false)]
                public Task (owned Gst.TaskFunction func);
                public static void cleanup_all ();
@@ -2865,18 +2884,13 @@ namespace Gst {
                public Gst.ClockTime time;
                public Gst.ClockTime interval;
                public Gst.ClockReturn status;
-               public weak Gst.ClockCallback func;
-               public void* user_data;
-               public weak GLib.DestroyNotify destroy_data;
+               [CCode (delegate_target_cname = "user_data", destroy_notify_cname = "destroy_data")]
+               public Gst.ClockCallback func;
                public bool unscheduled;
                public bool woken_up;
        }
        [CCode (cheader_filename = "gst/gst.h")]
        [SimpleType]
-       public struct ClockID {
-       }
-       [CCode (cheader_filename = "gst/gst.h")]
-       [SimpleType]
        public struct ClockTime : uint64 {
        }
        [CCode (cheader_filename = "gst/gst.h")]
@@ -2926,7 +2940,7 @@ namespace Gst {
        [CCode (cheader_filename = "gst/gst.h", has_type_id = false)]
        public struct Meta {
                public Gst.MetaFlags flags;
-               public Gst.MetaInfo info;
+               public weak Gst.MetaInfo? info;
                [CCode (array_length = false, array_null_terminated = true)]
                [Version (since = "1.2")]
                public static unowned string[] api_type_get_tags (GLib.Type api);
@@ -2971,21 +2985,6 @@ namespace Gst {
                public unowned Gst.Query? get_query ();
        }
        [CCode (cheader_filename = "gst/gst.h", has_type_id = false)]
-       public struct ParamSpecArray {
-               public weak GLib.ParamSpec parent_instance;
-               public weak GLib.ParamSpec element_spec;
-       }
-       [CCode (cheader_filename = "gst/gst.h", has_type_id = false)]
-       public struct ParamSpecFraction {
-               public weak GLib.ParamSpec parent_instance;
-               public int min_num;
-               public int min_den;
-               public int max_num;
-               public int max_den;
-               public int def_num;
-               public int def_den;
-       }
-       [CCode (cheader_filename = "gst/gst.h", has_type_id = false)]
        [Version (since = "1.6")]
        public struct ParentBufferMeta {
                public Gst.Meta parent;
@@ -3973,9 +3972,9 @@ namespace Gst {
        [CCode (cheader_filename = "gst/gst.h", instance_pos = 3.9)]
        public delegate bool ClockCallback (Gst.Clock clock, Gst.ClockTime time, Gst.ClockID id);
        [CCode (cheader_filename = "gst/gst.h", has_target = false)]
-       public delegate bool ControlSourceGetValue (Gst.ControlSource self, Gst.ClockTime timestamp, double 
value);
+       public delegate bool ControlSourceGetValue (Gst.ControlSource self, Gst.ClockTime timestamp, out 
double value);
        [CCode (cheader_filename = "gst/gst.h", has_target = false)]
-       public delegate bool ControlSourceGetValueArray (Gst.ControlSource self, Gst.ClockTime timestamp, 
Gst.ClockTime interval, uint n_values, double values);
+       public delegate bool ControlSourceGetValueArray (Gst.ControlSource self, Gst.ClockTime timestamp, 
Gst.ClockTime interval, [CCode (array_length_cname = "n_values", array_length_pos = 3.5, array_length_type = 
"guint", type = "gdouble*")] double[] values);
        [CCode (cheader_filename = "gst/gst.h", instance_pos = 5.9)]
        [Version (since = "1.20")]
        public delegate bool CustomMetaTransformFunction (Gst.Buffer transbuf, Gst.CustomMeta meta, 
Gst.Buffer buffer, GLib.Quark type, void* data);
diff --git a/vapi/metadata/Gst-1.0-custom.vala b/vapi/metadata/Gst-1.0-custom.vala
index a101f7c19..4cb5a3e9d 100644
--- a/vapi/metadata/Gst-1.0-custom.vala
+++ b/vapi/metadata/Gst-1.0-custom.vala
@@ -40,6 +40,15 @@ namespace Gst {
                public CapsFeatures.id (params GLib.Quark[] features);
        }
 
+       [CCode (cheader_filename = "gst/gst.h")]
+       [PointerType]
+       [Compact]
+       public class ClockID {
+               public Gst.ClockID? id_ref ();
+               [DestroysInstance]
+               public void id_unref ();
+       }
+
        [CCode (type_id = "gst_control_binding_get_type ()")]
        public abstract class ControlBinding : Gst.Object {
                public virtual bool get_value_array<T> (Gst.ClockTime timestamp, Gst.ClockTime interval, 
[CCode (array_length_pos = 2.5, array_length_type = "guint")] T[] values);
@@ -89,6 +98,10 @@ namespace Gst {
        public class ParseContext {
        }
 
+       [Compact, CCode (ref_function = "gst_promise_ref", type_id = "gst_promise_get_type ()", 
unref_function = "gst_promise_unref")]
+       public class Promise {
+       }
+
        [Compact, CCode (ref_function = "gst_query_ref", type_id = "gst_query_get_type ()", unref_function = 
"gst_query_unref")]
        public class Query {
     [CCode (sentinel = "")]
diff --git a/vapi/metadata/Gst-1.0.metadata b/vapi/metadata/Gst-1.0.metadata
index eb6de8bb5..0dde3d452 100644
--- a/vapi/metadata/Gst-1.0.metadata
+++ b/vapi/metadata/Gst-1.0.metadata
@@ -18,6 +18,10 @@ Bin
   .clock_provider unowned=false
   .messages unowned=false
   .provided_clock unowned=false
+ClockEntry
+  .func unowned=false delegate_target_cname="user_data" destroy_notify_cname="destroy_data"
+  .user_data skip
+  .destroy_data skip
 Element
   .bus unowned=false
   .clock unowned=false
@@ -25,6 +29,12 @@ Element
   .sinkpads type="GLib.List<unowned Gst.Pad>"
   .srcpads type="GLib.List<unowned Gst.Pad>"
   .state_cond unowned=false
+Meta
+  .info nullable unowned
+Task
+  .func unowned=false delegate_target_cname="user_data" destroy_notify_cname="notify"
+  .user_data skip
+  .notify skip
 
 // Private anonymous unions get exposed
 Pad
@@ -181,6 +191,7 @@ Pad
   .set_chain_function_full name="set_chain_function"
   .set_chain_list_function_full.chainlist closure=-1 destroy=-1 owned=false
   .set_chain_list_function_full name="set_chain_list_function"
+  .set_event_full_function_full.event closure=-1 destroy=-1 owned=false
   .set_event_function_full.event closure=-1 destroy=-1 owned=false
   .set_event_function_full name="set_event_function"
   .set_getrange_function_full.get closure=-1 destroy=-1 owned=false
@@ -245,6 +256,8 @@ Memory base_type="Gst.MiniObject"
   .mini_object skip
 Message base_type="Gst.MiniObject"
   .mini_object skip
+Promise base_type="Gst.MiniObject"
+  .parent skip
 Query base_type="Gst.MiniObject"
   .mini_object skip
 Sample base_type="Gst.MiniObject"
@@ -254,6 +267,12 @@ Toc base_type="Gst.MiniObject"
 TocEntry base_type="Gst.MiniObject"
 *.make_writable returns_modified_pointer
 
+// GLib.ParamSpec inheritance
+ParamSpecArray struct=false base_type="GLib.ParamSpec"
+  .parent_instance skip
+ParamSpecFraction struct=false base_type="GLib.ParamSpec"
+  .parent_instance skip
+
 // Reparenting
 TAG_* parent="Gst.Tags" name="TAG_(.+)"
 tag_* parent="Gst.Tags" name="tag_(.+)"
@@ -273,6 +292,10 @@ ElementFactory.get_static_pad_templates type_arguments="Gst.StaticPadTemplate?"
 // Custom
 Buffer
   .copy_into skip
+ClockID skip
+Clock
+  .id_ref skip
+  .id_unref skip
 ControlSource
   .get_value#field name="get_value_func"
   .get_value_array#field name="get_value_array_func"
@@ -299,6 +322,11 @@ Pipeline
 // Upstream
 ///////////
 
+ControlSourceGetValue
+  .value out
+ControlSourceGetValueArray
+  .values array array_length_idx=3
+
 // Not used internally and not meant to be used
 // https://gitlab.freedesktop.org/gstreamer/gstreamer/-/commit/58980426
 ControlBindingConvert skip


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