1 /* gstreamer-0.10-custom.vala
3 * Copyright (C) 2007-2008 Jürg Billeter
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 * Jürg Billeter <j@bitron.ch>
23 public struct ClockTime
: uint64 {
24 [CCode (cname
="GST_TIME_ARGS")]
25 public unowned
string args ();
26 [CCode (cname
="GST_CLOCK_TIME_IS_VALID")]
27 public bool is_valid ();
30 public struct ClockTimeDiff
: int64 {
34 public class ClockID
{
35 [CCode (cname
="gst_clock_new_single_shot_id")]
36 public ClockID
.single_shot (Gst
.Clock clock
, Gst
.ClockTime time
);
37 [CCode (cname
="gst_clock_new_periodic_id")]
38 public ClockID
.periodic (Gst
.Clock clock
, Gst
.ClockTime start_time
, Gst
.ClockTime interval
);
41 [CCode (ref_function
= "gst_event_ref", unref_function
= "gst_event_unref")]
42 public class Event
: MiniObject
{
43 public unowned Event @
ref ();
45 public static void replace (ref Event? oldobj
, Event? newobj
);
48 [CCode (cname
= "GST_EVENT_IS_UPSTREAM")]
49 public bool is_upstream ();
50 [CCode (cname
= "GST_EVENT_IS_DOWNSTREAM")]
51 public bool is_downstream ();
52 [CCode (cname
= "GST_EVENT_IS_SERIALIZED")]
53 public bool is_serialized ();
55 // Deprecated, should be in Gst.EventType
56 public static Gst
.EventTypeFlags
type_get_flags (Gst
.EventType type
);
57 public static unowned
string type_get_name (Gst
.EventType type
);
58 public static GLib
.Quark
type_to_quark (Gst
.EventType type
);
61 public enum EventType
{
63 [CCode (cname
= "gst_event_type_get_flags")]
64 public Gst
.EventTypeFlags
get_flags ();
65 [CCode (cname
= "gst_event_type_to_quark")]
66 public GLib
.Quark
to_quark ();
67 [CCode (cname
= "gst_event_type_get_name")]
68 public unowned
string get_name ();
73 [CCode (cname
= "gst_format_get_details")]
74 public unowned FormatDefinition
get_details ();
75 [CCode (cname
= "gst_format_to_quark")]
76 public GLib
.Quark
to_quark ();
77 [CCode (cname
= "gst_format_get_name")]
78 public unowned
string get_name ();
80 [CCode (cname
= "gst_format_register")]
81 static Format
register (string nick
, string description
);
82 [CCode (cname
= "gst_format_get_by_nick")]
83 static Format
get_by_nick (string nick
);
85 [CCode (cname
= "GST_FORMAT_PERCENT_MAX")]
86 public const int64 PERCENT_MAX
;
87 [CCode (cname
= "GST_FORMAT_PERCENT_SCALE")]
88 public const int64 PERCENT_SCALE
;
91 public interface ImplementsInterface
: Gst
.Element
{
92 public unowned Gst
.Element?
cast (GLib
.Type type
);
93 public bool check (GLib
.Type type
);
96 public abstract class Index
{
97 public int new_group ();
98 [CCode (cname
= "GST_INDEX_IS_WRITABLE")]
99 public bool is_writable ();
100 [CCode (cname
= "GST_INDEX_IS_READABLE")]
101 public bool is_readable ();
104 public struct IndexAssociation
{
105 public Gst
.Format format
;
110 public class IndexEntry
{
111 public IndexEntryType type
;
112 [CCode (cname
= "GST_INDEX_NASSOCS")]
113 public int n_assocs ();
114 [CCode (cname
= "GST_INDEX_ASSOC_FLAGS")]
115 public AssocFlags
assoc_flags ();
116 [CCode (cname
= "GST_INDEX_ASSOC_FORMAT")]
117 public Gst
.Format
assoc_format (int i
);
118 [CCode (cname
= "GST_INDEX_ASSOC_VALUE")]
119 public unowned IndexAssociation
assoc_value (int i
);
120 [CCode (cname
= "GST_INDEX_FORMAT_FORMAT")]
121 public Gst
.Format
format_format ();
122 [CCode (cname
= "GST_INDEX_FORMAT_KEY")]
123 public unowned
string format_key ();
124 [CCode (cname
= "GST_INDEX_ID_INVALID")]
125 static const int ID_INVALID
;
126 [CCode (cname
= "GST_INDEX_ID_DESCRIPTION")]
127 public unowned
string id_description ();
130 [CCode (ref_function
= "gst_object_ref", unref_function
= "gst_object_unref", ref_sink_function
= "gst_object_ref_sink")]
131 public abstract class Object
{
132 public unowned Gst
.Object @
ref ();
133 public void unref ();
135 public void ref_sink ();
136 public static void replace (ref Gst
.Object? oldobj
, Gst
.Object? newobj
);
138 [CCode (cname
= "GST_OBJECT_FLAG_IS_SET")]
139 public bool flag_is_set (Gst
.ObjectFlags flag
);
140 [CCode (cname
= "GST_OBJECT_FLAG_SET")]
141 public void flag_set (Gst
.ObjectFlags flag
);
142 [CCode (cname
= "GST_OBJECT_FLAG_UNSET")]
143 public void flag_unset (Gst
.ObjectFlags flag
);
144 [CCode (cname
= "GST_OBJECT_IS_FLOATING")]
145 public bool is_floating ();
146 [CCode (cname
= "GST_OBJECT_IS_DISPOSING")]
147 public bool is_disposing ();
151 public void add_many (params owned Gst
.Element
[] elements
);
152 public void remove_many (params Gst
.Element
[] elements
);
155 [CCode (ref_function
= "gst_buffer_ref", unref_function
= "gst_buffer_unref")]
156 public class Buffer
: Gst
.MiniObject
{
157 [CCode (has_construct_function
= false)]
159 [CCode (cname
= "GST_BUFFER_FLAG_SET")]
160 public void flag_set (BufferFlag flag
);
161 [CCode (cname
= "GST_BUFFER_FLAG_UNSET")]
162 public void flag_unset (BufferFlag flag
);
163 [CCode (cname
= "GST_BUFFER_FLAG_IS_SET")]
164 public bool flag_is_set (BufferFlag flag
);
165 [CCode (cname
= "GST_BUFFER_IS_DISCONT")]
166 public bool is_discont ();
167 [ReturnsModifiedPointer
]
168 public void make_metadata_writable ();
169 [ReturnsModifiedPointer
]
170 public void make_writable ();
171 [CCode (cname
= "GST_BUFFER_TIMESTAMP_IS_VALID")]
172 public bool timestamp_is_valid ();
173 [CCode (cname
= "GST_BUFFER_DURATION_IS_VALID")]
174 public bool duration_is_valid ();
175 [CCode (cname
= "GST_BUFFER_OFFSET_IS_VALID")]
176 public bool offset_is_valid ();
177 [CCode (cname
= "GST_BUFFER_OFFSET_END_IS_VALID")]
178 public bool offset_end_is_valid ();
179 [ReturnsModifiedPointer
]
180 public void join (owned Buffer buf2
);
182 public unowned Buffer @
ref ();
183 public void unref ();
184 public static void replace (ref Buffer? oldobj
, Buffer? newobj
);
185 public Buffer
copy ();
188 [CCode (ref_function
= "gst_buffer_list_ref", unref_function
= "gst_buffer_list_unref")]
189 public class BufferList
: Gst
.MiniObject
{
190 [ReturnsModifiedPointer
]
191 public void make_writable ();
192 public unowned BufferList @
ref ();
193 public void unref ();
194 public BufferList
copy ();
198 [CCode (cname
= "gst_bus_add_watch_full")]
199 public uint add_watch (owned Gst
.BusFunc func
, [CCode (pos
= 0.1)] int priority
= GLib
.Priority
.DEFAULT
);
200 [CCode (instance_pos
= -1)]
201 public Gst
.BusSyncReply
sync_signal_handler (Gst
.Bus bus
, Gst
.Message message
);
203 [CCode (instance_pos
= -1)]
204 public bool async_signal_func (Gst
.Bus bus
, Gst
.Message message
);
207 public interface ChildProxy
: Gst
.Object
{
208 public void @
get (string first_property_name
, ...);
209 public void get_property (string name
, ref Gst
.Value value
);
210 public void get_valist (string first_property_name
, void* var_args
);
211 public bool lookup (string name
, out Gst
.Object? target
, out unowned GLib
.ParamSpec? pspec
);
212 public void @
set (string first_property_name
, ...);
213 public void set_property (string name
, Gst
.Value value
);
214 public void set_valist (string first_property_name
, void* var_args
);
217 public abstract class Element
{
218 [CCode (cname
= "abidata.ABI.target_state")]
219 public State target_state
;
222 [CCode (cheader_filename
= "gst/gst.h")]
224 [CCode (cname
= "gst_pad_add_buffer_probe_full")]
225 public uint add_buffer_probe ([CCode (type
="GCallback")] owned BufferProbeCallback handler
);
226 [CCode (cname
= "gst_pad_add_data_probe_full")]
227 public uint add_data_probe ([CCode (type
="GCallback")] owned DataProbeCallback handler
);
228 [CCode (cname
= "gst_pad_add_event_probe_full")]
229 public uint add_event_probe ([CCode (type
="GCallback")] owned EventProbeCallback handler
);
230 [CCode (instance_pos
= -1)]
231 public Gst
.Caps
get_fixed_caps_func (Gst
.Pad pad
);
232 [CCode (instance_pos
= -1)]
233 public Gst
.Caps
proxy_getcaps (Gst
.Pad pad
);
234 [CCode (instance_pos
= -1)]
235 public bool proxy_setcaps (Gst
.Caps caps
);
236 [CCode (cname
= "gst_pad_set_blocked_async_full")]
237 public bool set_blocked_async (bool blocked
, owned Gst
.PadBlockCallback
callback);
239 [CCode (cname
= "GST_PAD_STREAM_LOCK")]
240 public void stream_lock ();
241 [CCode (cname
= "GST_PAD_STREAM_UNLOCK")]
242 public void stream_unlock ();
245 public enum FlowReturn
{
247 [CCode (cname
= "GST_FLOW_IS_FATAL")]
248 public bool is_fatal ();
249 [CCode (cname
= "GST_FLOW_IS_SUCCESS")]
250 public bool is_success ();
253 public enum PadLinkReturn
{
255 [CCode (cname
= "GST_PAD_LINK_FAILED")]
256 public bool failed ();
257 [CCode (cname
= "GST_PAD_LINK_SUCCESSFUL")]
258 public bool successful ();
262 [CCode (cname
="GCallback")]
263 public delegate
bool BufferProbeCallback (Gst
.Pad pad
, Gst
.Buffer buffer
);
264 [CCode (cname
="GCallback")]
265 public delegate
bool EventProbeCallback (Gst
.Pad pad
, Gst
.Event event
);
266 [CCode (cname
="GCallback")]
267 public delegate
bool DataProbeCallback (Gst
.Pad pad
, Gst
.MiniObject data
);
270 public unowned Caps @
ref ();
271 public void unref ();
273 [ReturnsModifiedPointer
]
274 public void make_writable ();
276 [CCode (cname
= "GST_CAPS_IS_SIMPLE")]
277 public bool is_simple ();
279 public static void replace (ref Caps? oldobj
, Caps? newobj
);
282 public abstract class MiniObject
{
283 [ReturnsModifiedPointer
]
284 public void make_writable ();
286 public unowned MiniObject @
ref ();
287 public void unref ();
288 public virtual MiniObject
copy ();
289 public virtual void finalize ();
290 public static void replace (ref MiniObject? oldobj
, MiniObject? newobj
);
292 [CCode (cname
= "GST_MINI_OBJECT_FLAG_SET")]
293 public void flag_set (MiniObjectFlags flag
);
294 [CCode (cname
= "GST_MINI_OBJECT_FLAG_UNSET")]
295 public void flag_unset (MiniObjectFlags flag
);
296 [CCode (cname
= "GST_MINI_OBJECT_FLAG_IS_SET")]
297 public bool flag_is_set (MiniObjectFlags flag
);
300 [CCode (ref_function
= "gst_message_ref", unref_function
= "gst_message_unref")]
301 public class Message
: MiniObject
{
302 [ReturnsModifiedPointer
]
303 public void make_writable ();
304 public unowned Message @
ref ();
305 public void unref ();
306 public Message
copy ();
308 // Deprecated, real method is in MessageType
309 public static GLib
.Quark
type_to_quark (Gst
.MessageType type
);
312 public enum MessageType
{
314 public GLib
.Quark
to_quark ();
315 public unowned
string get_name ();
318 [CCode (ref_function
= "gst_query_ref", unref_function
= "gst_query_unref")]
319 public class Query
: MiniObject
{
320 [ReturnsModifiedPointer
]
321 public void make_writable ();
322 public unowned Query @
ref ();
323 public void unref ();
324 public Query
copy ();
327 public enum QueryType
{
329 public GLib
.Quark
to_quark ();
330 public unowned
string get_name ();
331 public unowned QueryTypeDefinition
get_details ();
332 public static QueryType
get_by_nick ();
333 public static Iterator
<QueryTypeDefinition
> iterate_definitions ();
334 public static Gst
.QueryType
register (string nick
, string description
);
337 public struct QueryTypeDefinition
{
338 public weak string description
;
339 public weak string nick
;
340 public GLib
.Quark quark
;
341 public Gst
.QueryType value
;
346 [CCode (copy_function
= "gst_structure_copy", type_id
= "GST_TYPE_STRUCTURE", cheader_filename
= "gst/gst.h")]
347 public class Structure
{
348 [CCode (cname
= "gst_structure_empty_new", has_construct_function
= false)]
349 public Structure
.empty (string name
);
350 [CCode (cname
= "gst_structure_id_empty_new", has_construct_function
= false)]
351 public Structure
.id_empty (GLib
.Quark quark
);
353 [CCode (cname
= "gst_structure_id_new", has_construct_function
= false)]
354 public Structure
.id (GLib
.Quark quark
, GLib
.Quark field_quark
, ...);
359 [CCode (cname
= "GST_STATE_GET_NEXT")]
360 public State
get_next (State pending
);
363 public enum StateChange
{
365 [CCode (cname
= "GST_STATE_TRANSITION")]
366 public static StateChange
transition (State cur
, State next
);
367 [CCode (cname
= "GST_STATE_TRANSITION_CURRENT")]
368 public static State
transition_current ();
369 [CCode (cname
= "GST_STATE_TRANSITION_NEXT")]
370 public static State
transition_next ();
374 public class DebugCategory
{
375 [CCode (cname
="GST_DEBUG_CATEGORY_INIT")]
376 public void init (string name
, uint color
, string description
);
377 [CCode (cname
="GST_CAT_LOG")]
378 public void log (string format
, ...);
379 [CCode (cname
="GST_CAT_DEBUG")]
380 public void debug (string format
, ...);
381 [CCode (cname
="GST_CAT_INFO")]
382 public void info (string format
, ...);
383 [CCode (cname
="GST_CAT_WARNING")]
384 public void warning (string format
, ...);
385 [CCode (cname
="GST_CAT_ERROR")]
386 public void error (string format
, ...);
387 [CCode (cname
="GST_CAT_LOG_OBJECT")]
388 public void log_object (GLib
.Object obj
, string format
, ...);
389 [CCode (cname
="GST_CAT_DEBUG_OBJECT")]
390 public void debug_object (GLib
.Object obj
, string format
, ...);
391 [CCode (cname
="GST_CAT_INFO_OBJECT")]
392 public void info_object (GLib
.Object obj
, string format
, ...);
393 [CCode (cname
="GST_CAT_WARNING_OBJECT")]
394 public void warning_object (GLib
.Object obj
, string format
, ...);
395 [CCode (cname
="GST_CAT_ERROR_OBJECT")]
396 public void error_object (GLib
.Object obj
, string format
, ...);
397 [CCode (cname
="GST_DEBUG_CATEGORY_GET")]
398 public static unowned DebugCategory @
get (string name
);
401 [CCode (cname
="GST_DEBUG_BIN_TO_DOT_FILE")]
402 public static void debug_bin_to_dot_file (Bin bin
, DebugGraphDetails details
, string prefix
);
403 [CCode (cname
="GST_DEBUG_BIN_TO_DOT_FILE_WITH_TS")]
404 public static void debug_bin_to_dot_file_with_ts (Bin bin
, DebugGraphDetails details
, string prefix
);
406 public struct IntRange
{}
407 public struct DoubleRange
{}
408 public struct List
{}
409 public struct Array
{}
410 public struct Fraction
{}
411 public struct FractionRange
{}
413 [CCode (cname
= "GValue", type_id
= "G_TYPE_VALUE")]
414 public struct Value
: GLib
.Value
{
416 public static GLib
.Type
array_get_type ();
417 public static GLib
.Type
list_get_type ();
419 [CCode (cname
= "GST_MAKE_FOURCC")]
420 public static uint make_fourcc (char a
, char b
, char c
, char d
);
421 [CCode (cname
= "GST_STR_FOURCC")]
422 public static uint str_fourcc (string str
);
424 public void set_fourcc (uint fourcc
);
425 public uint get_fourcc ();
427 public void set_int_range (int start
, int end
);
428 public int get_int_range_min ();
429 public int get_int_range_max ();
431 public void set_double_range (double start
, double end
);
432 public double get_double_range_min ();
433 public double get_double_range_max ();
435 public void list_append_value (Gst
.Value append_value
);
436 public void list_prepend_value (Gst
.Value prepend_value
);
437 public void list_concat (Gst
.Value value1
, Gst
.Value value2
);
438 public uint list_get_size ();
439 public unowned Gst
.Value?
list_get_value (uint index
);
441 public void set_fraction (int numerator
, int denominator
);
442 public int get_fraction_numerator ();
443 public int get_fraction_denominator ();
444 public static bool fraction_multiply (GLib
.Value product
, GLib
.Value factor1
, GLib
.Value factor2
);
445 public static bool fraction_subtract (GLib
.Value dest
, GLib
.Value minuend
, GLib
.Value subtrahend
);
447 public void set_fraction_range (Gst
.Value start
, Gst
.Value end
);
448 public unowned Gst
.Value?
get_fraction_range_min ();
449 public unowned Gst
.Value?
get_fraction_range_max ();
450 public void set_fraction_range_full (int numerator_start
, int denominator_start
, int numerator_end
, int denominator_end
);
452 public void set_date (GLib
.Date date
);
453 public GLib
.Date
get_date ();
455 public void set_caps (Caps caps
);
456 public Caps
get_caps ();
458 public void set_structure (Structure structure
);
459 public unowned Structure
get_structure ();
461 public unowned Buffer
get_buffer ();
462 public void set_buffer (Buffer b
);
463 public void take_buffer (Buffer b
);
465 public bool is_fixed ();
467 public static void register (Gst
.ValueTable table
);
469 public void init_and_copy (Gst
.Value src
);
471 public string serialize ();
472 public bool deserialize (string src
);
474 public static bool can_compare (Gst
.Value value1
, Gst
.Value value2
);
475 public static int compare (Gst
.Value value1
, Gst
.Value value2
);
477 public static void register_union_func (GLib
.Type type1
, GLib
.Type type2
, Gst
.ValueUnionFunc func
);
478 public static bool union (Gst
.Value dest
, Gst
.Value value1
, Gst
.Value value2
);
479 public static bool can_union (Gst
.Value value1
, Gst
.Value value2
);
481 public static void register_subtract_func (GLib
.Type minuend_type
, GLib
.Type subtrahend_type
, Gst
.ValueSubtractFunc func
);
482 public static bool subtract (Gst
.Value dest
, Gst
.Value minuend
, Gst
.Value subtrahend
);
483 public static bool can_subtract (Gst
.Value minuend
, Gst
.Value subtrahend
);
485 public static void register_intersect_func (GLib
.Type type1
, GLib
.Type type2
, Gst
.ValueIntersectFunc func
);
486 public static bool intersect (Gst
.Value dest
, Gst
.Value value1
, Gst
.Value value2
);
487 public static bool can_intersect (Gst
.Value value1
, Gst
.Value value2
);
489 public void array_append_value (Gst
.Value append_value
);
490 public uint array_get_size ();
491 public unowned Gst
.Value?
array_get_value (uint index
);
492 public void array_prepend_value (Gst
.Value prepend_value
);
496 public bool parse_doc(void* doc
, string root
);
497 public bool parse_file(string fname
, string root
);
498 public unowned Element
get_element(string name
);
501 [CCode (cheader_filename
= "gst/gst.h")]
502 public struct PluginDesc
{
503 public int major_version
;
504 public int minor_version
;
505 public weak string name
;
506 public weak string description
;
507 public weak Gst
.PluginInitFunc plugin_init
;
508 public weak string version
;
509 public weak string license
;
510 public weak string source
;
511 public weak string package
;
512 public weak string origin
;
513 void *_gst_reserved
[];
516 public class Plugin
{
517 [CCode (instance_pos
= -1)]
518 public bool name_filter (Gst
.Plugin plugin
, string name
);
521 public abstract class PluginFeature
{
522 [CCode (instance_pos
= -1)]
523 public bool type_name_filter (Gst
.PluginFeature feature
, Gst
.TypeNameData data
);
526 public struct PollFD
{
529 public static bool can_read (Gst
.Poll @
set, Gst
.PollFD fd
);
530 public static bool can_write (Gst
.Poll @
set, Gst
.PollFD fd
);
531 public static bool ctl_read (Gst
.Poll @
set, Gst
.PollFD fd
, bool active
);
532 public static bool ctl_write (Gst
.Poll @
set, Gst
.PollFD fd
, bool active
);
533 public static bool has_closed (Gst
.Poll @
set, Gst
.PollFD fd
);
534 public static bool has_error (Gst
.Poll @
set, Gst
.PollFD fd
);
535 public static void ignored (Gst
.Poll @
set, Gst
.PollFD fd
);