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



commit 34e856f75c9a5c4797a819d30444306237127deb
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           | 53 ++++++++++++++++++---------------------
 vapi/metadata/Gst-1.0-custom.vala |  4 +++
 vapi/metadata/Gst-1.0.metadata    | 24 ++++++++++++++++++
 3 files changed, 53 insertions(+), 28 deletions(-)
---
diff --git a/vapi/gstreamer-1.0.vapi b/vapi/gstreamer-1.0.vapi
index b14c64165..3b21b27c8 100644
--- a/vapi/gstreamer-1.0.vapi
+++ b/vapi/gstreamer-1.0.vapi
@@ -1937,7 +1937,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")]
@@ -2007,6 +2007,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 {
@@ -2116,11 +2131,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 ();
@@ -2545,12 +2559,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 ();
@@ -2836,9 +2849,8 @@ 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;
        }
@@ -2890,7 +2902,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);
@@ -2931,21 +2943,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;
@@ -3911,9 +3908,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", has_target = false)]
        public delegate void DebugFuncPtr ();
        [CCode (cheader_filename = "gst/gst.h", instance_pos = 1.9)]
diff --git a/vapi/metadata/Gst-1.0-custom.vala b/vapi/metadata/Gst-1.0-custom.vala
index a101f7c19..07bf44592 100644
--- a/vapi/metadata/Gst-1.0-custom.vala
+++ b/vapi/metadata/Gst-1.0-custom.vala
@@ -89,6 +89,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 e433211a5..d5961a377 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_(.+)"
@@ -295,6 +314,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]