[vala] gstreamer: Fix Gst.Event bindings



commit 9fff9a11bd501ef476f09be9613a799243bbe93f
Author: Sebastian Dröge <sebastian droege collabora co uk>
Date:   Tue Mar 30 10:28:25 2010 +0200

    gstreamer: Fix Gst.Event bindings
    
    Ownership of parameters/returns, nullability, etc.

 vapi/gstreamer-0.10.vapi                           |   25 ++++++++----
 .../gstreamer-0.10/gstreamer-0.10-custom.vala      |   29 ++++++++++++++
 vapi/packages/gstreamer-0.10/gstreamer-0.10.gi     |    4 +-
 .../gstreamer-0.10/gstreamer-0.10.metadata         |   40 +++++---------------
 4 files changed, 57 insertions(+), 41 deletions(-)
---
diff --git a/vapi/gstreamer-0.10.vapi b/vapi/gstreamer-0.10.vapi
index 2f64c51..03ed4bb 100644
--- a/vapi/gstreamer-0.10.vapi
+++ b/vapi/gstreamer-0.10.vapi
@@ -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 ();
 	}
diff --git a/vapi/packages/gstreamer-0.10/gstreamer-0.10-custom.vala b/vapi/packages/gstreamer-0.10/gstreamer-0.10-custom.vala
index 309f26c..0d3d67b 100644
--- a/vapi/packages/gstreamer-0.10/gstreamer-0.10-custom.vala
+++ b/vapi/packages/gstreamer-0.10/gstreamer-0.10-custom.vala
@@ -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 {
diff --git a/vapi/packages/gstreamer-0.10/gstreamer-0.10.gi b/vapi/packages/gstreamer-0.10/gstreamer-0.10.gi
index 7ffe21f..912d609 100644
--- a/vapi/packages/gstreamer-0.10/gstreamer-0.10.gi
+++ b/vapi/packages/gstreamer-0.10/gstreamer-0.10.gi
@@ -2106,7 +2106,7 @@
 			<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">
@@ -2193,7 +2193,7 @@
 				<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">
diff --git a/vapi/packages/gstreamer-0.10/gstreamer-0.10.metadata b/vapi/packages/gstreamer-0.10/gstreamer-0.10.metadata
index dffe7db..4c97b90 100644
--- a/vapi/packages/gstreamer-0.10/gstreamer-0.10.metadata
+++ b/vapi/packages/gstreamer-0.10/gstreamer-0.10.metadata
@@ -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"



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