]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
gstreamer: Fix Gst.Event bindings
authorSebastian Dröge <sebastian.droege@collabora.co.uk>
Tue, 30 Mar 2010 08:28:25 +0000 (10:28 +0200)
committerSebastian Dröge <sebastian.droege@collabora.co.uk>
Thu, 8 Apr 2010 08:30:51 +0000 (10:30 +0200)
Ownership of parameters/returns, nullability, etc.

vapi/gstreamer-0.10.vapi
vapi/packages/gstreamer-0.10/gstreamer-0.10-custom.vala
vapi/packages/gstreamer-0.10/gstreamer-0.10.gi
vapi/packages/gstreamer-0.10/gstreamer-0.10.metadata

index 2f64c51f948081e511711fa3823977e8e4e204c6..03ed4bb7cbe9a0e8cefda29ca665cb2d4c48c5a3 100644 (file)
@@ -450,11 +450,7 @@ namespace Gst {
        }
        [CCode (ref_function = "gst_event_ref", unref_function = "gst_event_unref", cheader_filename = "gst/gst.h")]
        public class Event : Gst.MiniObject {
-               public void* abidata;
-               public weak Gst.Object src;
-               public weak Gst.Structure structure;
                public uint64 timestamp;
-               public Gst.EventType type;
                [CCode (has_construct_function = false)]
                public Event.buffer_size (Gst.Format format, int64 minsize, int64 maxsize, bool @async);
                [CCode (has_construct_function = false)]
@@ -468,6 +464,12 @@ namespace Gst {
                public uint32 get_seqnum ();
                public unowned Gst.Structure get_structure ();
                public bool has_name (string name);
+               [CCode (cname = "GST_EVENT_IS_DOWNSTREAM")]
+               public bool is_downstream ();
+               [CCode (cname = "GST_EVENT_IS_SERIALIZED")]
+               public bool is_serialized ();
+               [CCode (cname = "GST_EVENT_IS_UPSTREAM")]
+               public bool is_upstream ();
                [CCode (has_construct_function = false)]
                public Event.latency (Gst.ClockTime latency);
                [CCode (has_construct_function = false)]
@@ -482,9 +484,9 @@ namespace Gst {
                public void parse_new_segment_full (out bool update, out double rate, out double applied_rate, out Gst.Format format, out int64 start, out int64 stop, out int64 position);
                public void parse_qos (out double proportion, out Gst.ClockTimeDiff diff, out Gst.ClockTime timestamp);
                public void parse_seek (out double rate, out Gst.Format format, out Gst.SeekFlags flags, out Gst.SeekType start_type, out int64 start, out Gst.SeekType stop_type, out int64 stop);
-               public void parse_sink_message (void* msg);
-               public void parse_step (Gst.Format format, uint64 amount, double rate, bool flush, bool intermediate);
-               public void parse_tag (out Gst.TagList taglist);
+               public void parse_sink_message (out unowned Gst.Message msg);
+               public void parse_step (out Gst.Format format, out uint64 amount, out double rate, out bool flush, out bool intermediate);
+               public void parse_tag (out unowned Gst.TagList taglist);
                [CCode (has_construct_function = false)]
                public Event.qos (double proportion, Gst.ClockTimeDiff diff, Gst.ClockTime timestamp);
                public Gst.Event @ref ();
@@ -493,12 +495,17 @@ namespace Gst {
                public Event.seek (double rate, Gst.Format format, Gst.SeekFlags flags, Gst.SeekType start_type, int64 start, Gst.SeekType stop_type, int64 stop);
                public void set_seqnum (uint32 seqnum);
                [CCode (has_construct_function = false)]
-               public Event.sink_message (void* msg);
+               public Event.sink_message (owned Gst.Message msg);
+               [CCode (cname = "GST_EVENT_SRC")]
+               public unowned Gst.Object src ();
                [CCode (has_construct_function = false)]
                public Event.step (Gst.Format format, uint64 amount, double rate, bool flush, bool intermediate);
                [CCode (has_construct_function = false)]
-               public Event.tag (Gst.TagList taglist);
+               public Event.tag (owned Gst.TagList taglist);
+               [CCode (cname = "GST_EVENT_TYPE")]
+               public Gst.EventType type ();
                public static Gst.EventTypeFlags type_get_flags (Gst.EventType type);
+               public static unowned string type_get_name (Gst.EventType type);
                public static GLib.Quark type_to_quark (Gst.EventType type);
                public void unref ();
        }
index 309f26c957731049b48b4755df98c874513770d0..0d3d67b9af455eef1566189795156dc9749f706b 100644 (file)
@@ -42,7 +42,36 @@ namespace Gst {
                public Event @ref ();
                public void unref ();
                public static void replace (ref Event? oldobj, Event? newobj);
+
+               [CCode (cname = "GST_EVENT_SRC")]
+               public unowned Gst.Object src ();
+               [CCode (cname = "GST_EVENT_TYPE")]
+               public EventType type ();
+               [CCode (cname = "GST_EVENT_IS_UPSTREAM")]
+               public bool is_upstream ();
+               [CCode (cname = "GST_EVENT_IS_DOWNSTREAM")]
+               public bool is_downstream ();
+               [CCode (cname = "GST_EVENT_IS_SERIALIZED")]
+               public bool is_serialized ();
+
+               // Deprecated, should be in Gst.EventType
+               public static Gst.EventTypeFlags type_get_flags (Gst.EventType type);
+               public static unowned string type_get_name (Gst.EventType type);
+               public static GLib.Quark type_to_quark (Gst.EventType type);
+       }
+
+#if 0
+       // FIXME: This can't be parsed by vapigen, see bug #614543
+       public enum EventType {
+               ;
+               [CCode (cname = "gst_event_type_get_flags")]
+               public Gst.EventTypeFlags get_flags ();
+               [CCode (cname = "gst_event_type_to_quark")]
+               public GLib.Quark to_quark ();
+               [CCode (cname = "gst_event_type_get_name")]
+               public unowned string get_name ();
        }
+#endif
 
        [CCode (ref_function = "gst_object_ref", unref_function = "gst_object_unref", ref_sink_function = "gst_object_ref_sink")]
        public class Object {
index 7ffe21f1f79637508db256bacb427872508d134c..912d6094d303db0914b12f3d1d398b36d8749681 100644 (file)
                        <method name="new_sink_message" symbol="gst_event_new_sink_message">
                                <return-type type="GstEvent*"/>
                                <parameters>
-                                       <parameter name="msg" type="struct _GstMessage*"/>
+                                       <parameter name="msg" type="GstMessage*"/>
                                </parameters>
                        </method>
                        <method name="new_step" symbol="gst_event_new_step">
                                <return-type type="void"/>
                                <parameters>
                                        <parameter name="event" type="GstEvent*"/>
-                                       <parameter name="msg" type="struct _GstMessage**"/>
+                                       <parameter name="msg" type="GstMessage**"/>
                                </parameters>
                        </method>
                        <method name="parse_step" symbol="gst_event_parse_step">
index dffe7dbc97f06486be0729e287f9537d5cd9c03c..4c97b903a856605701a2d61f4a11db0c9ac366ac 100644 (file)
@@ -173,40 +173,20 @@ gst_element_factory_get_uri_protocols is_array="1" array_null_terminated="1" tra
 gst_error_get_message transfer_ownership="1"
 GstEvent base_class="GstMiniObject"
 GstEvent.mini_object hidden="1"
+GstEvent.abidata hidden="1"
+GstEvent.structure hidden="1"
+GstEvent.src hidden="1"
+GstEvent.type hidden="1"
 GstEventClass hidden="1"
 GstEventType to_string="gst_event_type_get_name"
+gst_event_type_get_flags hidden="1"
+gst_event_type_to_quark hidden="1"
+gst_event_type_get_name hidden="1"
 gst_event_new_custom.structure takes_ownership="1"
 gst_event_new_navigation.structure takes_ownership="1"
-gst_event_parse_buffer_size.format is_out="1"
-gst_event_parse_buffer_size.minsize is_out="1"
-gst_event_parse_buffer_size.maxsize is_out="1"
-gst_event_parse_buffer_size.async is_out="1"
-gst_event_parse_latency.latency is_out="1"
-gst_event_parse_new_segment.update is_out="1"
-gst_event_parse_new_segment.rate is_out="1"
-gst_event_parse_new_segment.format is_out="1"
-gst_event_parse_new_segment.start is_out="1"
-gst_event_parse_new_segment.stop is_out="1"
-gst_event_parse_new_segment.position is_out="1"
-gst_event_parse_new_segment_full.update is_out="1"
-gst_event_parse_new_segment_full.rate is_out="1"
-gst_event_parse_new_segment_full.applied_rate is_out="1"
-gst_event_parse_new_segment_full.format is_out="1"
-gst_event_parse_new_segment_full.start is_out="1"
-gst_event_parse_new_segment_full.stop is_out="1"
-gst_event_parse_new_segment_full.position is_out="1"
-gst_event_parse_qos.proportion is_out="1"
-gst_event_parse_qos.diff is_out="1"
-gst_event_parse_qos.timestamp is_out="1"
-gst_event_parse_seek.rate is_out="1"
-gst_event_parse_seek.format is_out="1"
-gst_event_parse_seek.flags is_out="1"
-gst_event_parse_seek.start_type is_out="1"
-gst_event_parse_seek.start is_out="1"
-gst_event_parse_seek.stop_type is_out="1"
-gst_event_parse_seek.stop is_out="1"
-gst_event_parse_tag.taglist is_out="1" value_owned="1"
-gst_event_type_get_name hidden="1"
+gst_event_new_tag.taglist takes_ownership="1"
+gst_event_new_sink_message.msg takes_ownership="1"
+gst_event_parse_*.* is_out="1"
 GstFlowReturn to_string="gst_flow_get_name"
 gst_flow_get_name hidden="1"
 GstFormatReturn to_string="gst_format_get_name"