alternative to assert
[gtkD.git] / gtkD / wrap / APILookupGStreamer.txt
blob613ea5dfa8f02ac30feb68af5f0db47b3fc390a3
2 # This file is part of gstreamerD.
4 # gstreamerD is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU Lesser General Public License as published by
6 # the Free Software Foundation; either version 2.1 of the License, or
7 # (at your option) any later version.
9 # gstreamerD is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 # GNU Lesser General Public License for more details.
14 # You should have received a copy of the GNU Lesser General Public License
15 # along with gstreamerD; if not, write to the Free Software
16 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
21 ###
22 #####
23 # Definitions for wrapping GStreamer
24 #####
25 ###
28 #Notes for the gstreamerD developer:
29 #The work on wrapping gstreamerD automatically isn't complete yet.
30 #At the moment gstreamerc/gstreamer.d and gstreamerc/gstreamertypes.d
31 #have to be copied from hand edited versions from wrap/.
32 #The copying is done automatically in APILookup.txt
33 #Also GstGhostPad.d has to have it's constructor adjusted by hand,
34 #and this isn't done automatically. You should replace Pad* with GstPad*.
35 #I have no idea why GtkWrapper is doing that.
36 #Also it creates two unnecessary files gstreamerc/lib.d gstreamerc/libtypes.d
37 #which have to be removed by hand.
41 # These are enums for gstreamer. There should be a way for these to be moved to APILookupGStreamer.txt.
42 # currently it just hangs up. These don't work for the moment.
43 #enumType: GST_ELEMENT_FLAG_LAST GstElementFlags.FLAG_LAST
46 addTypedefs: start
47 private import gtkc.glibtypes;
48 private import gtkc.gobjecttypes;
49 private import gtkc.gthreadtypes;
50 private import glib.Str;
52 addTypedefs: end
54 #private import gstreamerc.gstreamertypes;
55 #private import gstreamerc.gstreamer;
57 addAliases: start
58 addAliases: end
60 addEnums: start
61 addEnums: end
63 addStructs: start
64 #       /**
65 #       * GstMiniObject.
66 #       * Base class for refcounted lightweight objects.
67 #       * GTypeInstance instance;
68 #       */
69 #       public struct GstMiniObject
70 #       {
71 #               GTypeInstance instanc;
72 #               //< public >// with COW
73 #               int refcount;//gint refcount;
74 #               uint flags;//guint flags;
76 #               //< private >
77 #               gpointer _gst_reserved;
78 #       }
80 #       struct GstMessage
81 #       {
82 #               GstMiniObject mini_object;
84 #               /*< private > *//* with MESSAGE_LOCK */
85 #               GMutex* lock;                 /* lock and cond for async delivery */
86 #               GCond* cond;
88 #               /*< public > *//* with COW */
89 #               GstMessageType type;
90 #               ulong timestamp;//guint64 timestamp;
91 #               GstObject* src;
93 #               GstStructure* structure;
95 #               /*< private > */
96 #               gpointer _gst_reserved[GST_PADDING];
97 #       }
99 addStructs: end
101 addTypes: start
102 addTypes: end
104 addFuncts: start
105 addFuncts: end
107 addUnions: start
108 addUnions: end
110 addConstants: start
111         /***** default padding of structures *****/
112         const long GST_PADDING = 4;
113         //#define GST_PADDING_INIT      {0}
115         /***** padding for very extensible base classes *****/
116         const long GST_PADDING_LARGE = 20;
118         //These times might be clean to define as GstClockTimes instead of long (maybe):
120         //#define G_USEC_PER_SEC 1000000 //This should be in glib...
121         const ulong G_USEC_PER_SEC = 1000000uL;
122         //#define GST_SECOND  (G_USEC_PER_SEC * G_GINT64_CONSTANT (1000))
123         const ulong GST_SECOND = (G_USEC_PER_SEC * 1000uL);
125         public alias GST_SECOND SECOND;
127         //This one is an undefined GstClockTime. How can this be ulong???
128         //I guess it should be long...???
129         //#define GST_CLOCK_TIME_NONE           ((GstClockTime) -1)
130         const long GST_CLOCK_TIME_NONE = -1L;
131         public alias GST_CLOCK_TIME_NONE CLOCK_TIME_NONE;
133 addConstants: end
136 # must start with wrap
138 wrap: gstreamer
139 srcout: srcgstreamer
141 ###########################################################
142 ### GStreamer #############################################
143 ###########################################################
145 file: gstreamer-Gst.html
146 class: GStreamer
147 prefix: gst_
148 #GOptionGroup*
149 import: glib.Str
150 nocode: gst_init
151 code: start
153         /**
154          * Call this function before using any other GStreamer functions in your applications.
155          */
156         public static void init(char[][] args) //public static void init(int* argc, char**[] argv)
157         {
158                 char** argv = cast(char**) new char*[args.length];
159                 int argc = 0;
160                 foreach (char[] p; args)
161                 {
162                         argv[argc++] = cast(char*)p;
163                 }
165                 gst_init(&argc, null);//cast(char**[])&argv);
166         }
168 code: end
169 outFile: gstreamer
171 file: GstBin.html
172 struct: GstBin
173 class: Bin
174 prefix: gst_bin_
175 prefix: gst_
176 import: glib.Str
177 import: gstreamer.Element
178 import: gstreamer.Iterator
179 nocode: gst_bin_new
180 code: start
181         /**
182          * Creates a new bin with the given name.
183          * name:
184          *  the name of the new bin
185          * Returns:
186          *  a new GstBin
187          */
188         public this(char[] name)
189         {
190                 // GstElement* gst_bin_new (const gchar *name);
191                 this( cast(GstBin*) gst_bin_new(Str.toStringz(name)) );
192         }
194         public this(Element elem)
195         {
196                 super( elem.getElementStruct() );
197                 this.gstBin = cast(GstBin*)elem.getElementStruct();
198         }
199 code: end
200 structWrap: GstBin* Bin
201 structWrap: GstElement* Element
202 structWrap: GstIterator* Iterator
203 #... addMany and removeMany
204 outFile: Bin
206 file: gstreamer-GstBuffer.html
207 struct: GstBuffer
208 class: Buffer
209 prefix: gst_buffer_
210 prefix: gst_
211 import: glib.Str
212 import: gstreamer.Caps
213 structWrap: GstBuffer* Buffer
214 structWrap: GstCaps* Caps
215 outFile: Buffer
217 file: GstBus.html
218 struct: GstBus
219 class: Bus
220 prefix: gst_bus_
221 prefix: gst_
222 import: glib.Str
223 import: gstreamer.Message
224 import: glib.Source
225 structWrap: GstBus* Bus
226 structWrap: GstMessage* Message
227 structWrap: GSource* Source
228 nocode: gst_bus_add_watch
229 code: start
230         /**
231          * Adds a bus watch to the default main context with the default priority.
232          * This function is used to receive asynchronous messages in the main loop.
233          * The watch can be removed using g_source_remove() or by returning FALSE
234          * from func.
235          * bus:
236          *  a GstBus to create the watch for
237          * func:
238          *  A function to call when a message is received.
239          * user_data:
240          *  user data passed to func.
241          * Returns:
242          *  The event source id.
243          * MT safe.
244          */
245         public uint addWatch( bool delegate(Message) dlg )
246         {
247                 onWatchListener = dlg;
248                 return gst_bus_add_watch(gstBus, cast(GstBusFunc)&watchCallBack, this);
249         }
251         bool delegate(Message) onWatchListener;
253         extern(C) static gboolean watchCallBack(GstBus* bus, GstMessage* msg, Bus bus_d )//gpointer data)
254         {
255                 Message msg_d = new Message( msg );
257                 return bus_d.onWatchListener( msg_d );
258         }
259 code: end
260 outFile: Bus
262 file: gstreamer-GstCaps.html
263 struct: GstCaps
264 class: Caps
265 prefix: gst_caps_
266 prefix: gst_
267 import: glib.Str
268 import: gstreamer.Structure
269 #libxml2 missing:
270 nocode: gst_caps_save_thyself
271 nocode: gst_caps_load_thyself
272 nocode: gst_caps_new_any
273 code: start
274         /**
275          * Creates a new GstCaps that indicates that it is compatible with
276          * any media format.
277          * Returns:
278          *  the new GstCaps
279          */
280         public static Caps newAny()
281         {
282                 // GstCaps* gst_caps_new_any (void);
283                 return new Caps(cast(GstCaps*)gst_caps_new_any() );
284         }
285 code: end
286 structWrap: GstCaps* Caps
287 structWrap: GstStructure* Structure
288 #TODO: take a look at replace and it's GstCaps**
289 outFile: Caps
291 #file: gstreamer-GstChildProxy.html
292 #class: GstChildProxy
293 #prefix: gst_child_proxy_
294 #import: gstreamer.ObjectGst;
295 #structWrap: GstObject* ObjectGst
296 #outfile: ChildProxy
298 file: GstClock.html
299 struct: GstClock
300 class: Clock
301 prefix: gst_clock_
302 prefix: gst_
303 import: glib.Str
304 structWrap: GstClock* Clock
305 outFile: Clock
307 file: GstElement.html
308 struct: GstElement
309 class: Element
310 prefix: gst_element_
311 prefix: gst_
312 #nocode: GstState
313 #prefix: GST_BIN_
314 #prefix: GST_STATE_CHANGE_
315 #prefix: GST_STATE_ GstState.
316 #prefix: GST_
317 import: glib.Str
318 import: gtkc.gobject
319 import: gstreamer.Pad
320 import: gstreamer.Clock
321 import: gstreamer.Caps
322 import: gstreamer.Iterator
323 import: gstreamer.Index
324 import: gstreamer.TagList
325 import: gstreamer.Message
326 import: gstreamer.Query
327 #import: gstreamer.Format
328 import: gstreamer.Event
329 import: gstreamer.Bus
330 structWrap: GstBus* Bus
331 #import: gstreamer.QueryType
332 #I didn't do this:
333 #import: gobject.ObjectG
334 #structWrap: GObject* ObjectG
335 #I tried this instead:
336 structWrap: GObject* Pad
337 structWrap: GstElement* Element
338 structWrap: GstPad* Pad
339 structWrap: GstClock* Clock
340 structWrap: GstCaps* Caps
341 structWrap: GstIterator* Iterator
342 structWrap: GstIndex* Index
343 structWrap: GstTagList* TagList
344 structWrap: GstMessage* Message
345 structWrap: GstQuery* Query
346 #structWrap: GstFormat* Format
347 #structWrap: GstFormat Format
348 structWrap: GstEvent* Event
349 #structWrap: GstQueryType* QueryType
350 #TODO: GstClockTime
351 #where's GList: structWrap: GList
352 #import: gdk.Cursor
353 #structWrap: GdkCursor* Cursor
354 #nocode: pad-added #this doesn't seem to work.
355 code: start
356         /**
357          * Queries an element for the stream position.
358          * This is a convenience function for gstreamerD.
359          * Returns:
360          *  The current position in nanoseconds - GstFormat.TIME.
361          */
362         public long queryPosition()
363         {
364                 GstFormat form = GstFormat.TIME;
365                 long cur_pos;
366                 queryPosition( &form, &cur_pos );
367                 return cur_pos;
368         }
370         /**
371          * Queries an element for the stream duration.
372          * This is a convenience function for gstreamerD.
373          * Returns:
374          *  The duration in nanoseconds - GstFormat.TIME.
375          */
376         public long queryDuration()
377         {
378                 GstFormat form = GstFormat.TIME;
379                 long cur_dur;
380                 queryDuration( &form, &cur_dur );
381                 return cur_dur;
382         }
384         /**
385          *      This set's the filename for a filesrc element.
386          */
387         public void location( char[] set )
388         {
389                 //g_object_set( G_OBJECT(getElementStruct()), "location", set, NULL);
390                 setProperty("location", set);
391         }
393         /**
394          * Set the caps property of an Element.
395          */
396         void caps( Caps cp )
397         {
398                 g_object_set( getElementStruct(), Str.toStringz("caps"), cp.getCapsStruct(), null );
399         }
401         /**
402         * For your convenience in gstreamerD: you can seek to the
403         * position of the pipeline measured in time_nanoseconds.
404         */
405         public int seek( ulong time_nanoseconds ) //gint64
406         {
407                 return seek( 1.0, GstFormat.TIME, GstSeekFlags.FLUSH,
408                                                                 GstSeekType.SET, time_nanoseconds,
409                                                                 GstSeekType.NONE, GST_CLOCK_TIME_NONE);
410         }
411         
412         /**
413         * Get's all the pads from an element in a Pad[]. FIXME: This a hackish mess.
414         */
415         public Pad[] pads()
416         {
417                 Pad[] result = new Pad[0];
418                 
419                 Iterator iter = iteratePads();
420                 GstPad* obu_c = null;
421                 iter.next( cast(void**) &obu_c );
422                 while( obu_c !is null )
423                 {
424                         Pad tmpobu = new Pad( obu_c );
425                         //writefln( "iterating Padname: ", tmpobu.getName() );
426                         result.length = result.length + 1;
427                         result[result.length-1] = tmpobu;       
428                         
429                         obu_c = null;
430                         iter.next( cast(void**) &obu_c );
431                 }
432                 //writefln("no more pads.");
433                 return result;
434         }
436 //HANDEDIT: This is a way to add disconnectOnPadAdded
437 //There still doesn't seem to be a way to put it
438 //there automatically...
439 /*      
440         protected uint padAddedHandlerId;
441         void delegate(Pad, Element)[] onPadAddedListeners;
442         void addOnPadAdded(void delegate(Pad, Element) dlg)
443         {
444                 if ( !("pad-added" in connectedSignals) )
445                 {
446                         padAddedHandlerId = Signals.connectData(
447                         getStruct(),
448                         "pad-added",
449                         cast(GCallback)&callBackPadAdded,
450                         cast(void*)this,
451                         null,
452                         cast(ConnectFlags)0);
453                         connectedSignals["pad-added"] = 1;
454                 }
455                 onPadAddedListeners ~= dlg;
456         }
457         extern(C) static void callBackPadAdded(GstElement* gstelementStruct, GObject* newPad, Element element)
458         {
459                 bool consumed = false;
460                 
461                 foreach ( void delegate(Pad, Element) dlg ; element.onPadAddedListeners )
462                 {
463                         dlg(new Pad(newPad), element);
464                 }
465                 
466                 return consumed;
467         }
468         void disconnectOnPadAdded()
469         {
470                 if( "pad-added" in connectedSignals )
471                 {
472                         Signals.handlerDisconnect( getStruct(), padAddedHandlerId );
473                         padAddedHandlerId = 0;
474                         connectedSignals["pad-added"] = 0;
475                         onPadAddedListeners = null;
476                 }
477         }
478 */      
479 code: end
480 outFile: Element
482 file: GstElementFactory.html
483 struct: GstElementFactory
484 class: ElementFactory
485 prefix: gst_element_factory_
486 prefix: gst_element_
487 prefix: gst_
488 import: glib.Str
489 import: gstreamer.Element
490 import: gstreamer.Plugin
491 import: gstreamer.Caps
492 import: glib.ListG
493 code: start
494         /**
495          * Create a new element of the type defined by the given element factory.
496          * The element will receive a guaranteed unique name,
497          * consisting of the element factory name and a number.
498          * factoryname:
499          *  a named factory to instantiate
500          * Returns:
501          *  new GstElement or NULL if unable to create element
502          */
503         public static Element make( char[] factoryname )
504         {
505                 // GstElement* gst_element_factory_make (const gchar *factoryname,  const gchar *name);
506                 return new Element( gst_element_factory_make(Str.toStringz(factoryname), null ) );
507         }
508 code: end
509 structWrap: GstElementFactory* ElementFactory
510 structWrap: GstElement* Element
511 structWrap: GstPlugin* Plugin
512 structWrap: GstCaps* Caps
513 structWrap: GList* ListG
514 outFile: ElementFactory
516 file: gstreamer-GstEvent.html
517 struct: GstEvent
518 class: Event
519 prefix: gst_event_
520 prefix: gst_
521 #This might not be necessary:
522 nocode: gst_event_new_buffer_size
523 code: start
524         /**
525          * Create a new buffersize event. The event is sent downstream and notifies
526          * elements that they should provide a buffer of the specified dimensions.
527          * When the async flag is set, a thread boundary is prefered.
528          * format:
529          *  buffer format
530          * minsize:
531          *  minimum buffer size
532          * maxsize:
533          *  maximum buffer size
534          * async:
535          *  thread behavior
536          * Returns:
537          *  a new GstEvent
538          */
539         public static Event newBufferSize(GstFormat format, long minsize, long maxsize, int async)
540         {
541                 // GstEvent* gst_event_new_buffer_size (GstFormat format,  gint64 minsize,  gint64 maxsize,  gboolean async);
542                 return new Event(cast(GstEvent*)gst_event_new_buffer_size(format, minsize, maxsize, async) );
543         }
544 code: end
545 nocode: gst_event_new_eos
546 code: start
547         /**
548          * Create a new EOS event. The eos event can only travel downstream
549          * synchronized with the buffer flow. Elements that receive the EOS
550          * event on a pad can return UNEXPECTED as a GstFlowReturn when data
551          * after the EOS event arrives.
552          * The EOS event will travel down to the sink elements in the pipeline
553          * which will then post the GST_MESSAGE_EOS on the bus after they have
554          * finished playing any buffered data.
555          * When all sinks have posted an EOS message, the EOS message is
556          * forwarded to the application.
557          * Returns:
558          *  The new EOS event.
559          */
560         public static Event newEOS()
561         {
562                 // GstEvent* gst_event_new_eos (void);
563                 return new Event(cast(GstEvent*)gst_event_new_eos() );
564         }
565 code: end
566 nocode: gst_event_new_flush_start
567 code: start
568         /**
569          * Allocate a new flush start event. The flush start event can be send
570          * upstream and downstream and travels out-of-bounds with the dataflow.
571          * It marks pads as being in a WRONG_STATE to process more data.
572          * Elements unlock and blocking functions and exit their streaming functions
573          * as fast as possible.
574          * This event is typically generated after a seek to minimize the latency
575          * after the seek.
576          * Returns:
577          *  A new flush start event.
578          */
579         public static Event newFlushStart()
580         {
581                 // GstEvent* gst_event_new_flush_start (void);
582                 return new Event(cast(GstEvent*)gst_event_new_flush_start() );
583         }
584 code: end
585 nocode: gst_event_new_flush_stop
586 code: start
587         /**
588          * Allocate a new flush stop event. The flush start event can be send
589          * upstream and downstream and travels out-of-bounds with the dataflow.
590          * It is typically send after sending a FLUSH_START event to make the
591          * pads accept data again.
592          * Elements can process this event synchronized with the dataflow since
593          * the preceeding FLUSH_START event stopped the dataflow.
594          * This event is typically generated to complete a seek and to resume
595          * dataflow.
596          * Returns:
597          *  A new flush stop event.
598          */
599         public static Event newFlushStop()
600         {
601                 // GstEvent* gst_event_new_flush_stop (void);
602                 return new Event(cast(GstEvent*)gst_event_new_flush_stop() );
603         }
604 code: end
605 nocode: gst_event_new_navigation
606 code: start
608          * Create a new navigation event from the given description.
609          * structure:
610          *  description of the event
611          * Returns:
612          *  a new GstEvent
613          */
614         public static Event newNavigation(Structure structure)
615         {
616                 // GstEvent* gst_event_new_navigation (GstStructure *structure);
617                 return new Event(cast(GstEvent*)gst_event_new_navigation((structure is null) ? null : structure.getStructureStruct()) );
618         }
619 code: end
620 import: glib.Str
621 import: gstreamer.Structure
622 #import: gstreamer.Format
623 import: gstreamer.TagList
624 import: gstreamer.MiniObject
625 structWrap: GstEvent* Event
626 structWrap: GstStructure* Structure
627 #structWrap: GstFormat* Format
628 structWrap: GstTagList* TagList
629 structWrap: GstMiniObject* MiniObject
630 structWrap: GstMiniObject MiniObject
631 outFile: Event
633 file: gstreamer-GstFormat.html
634 struct: GstFormat
635 #class: Format
636 import: glib.Str
637 import: gstreamer.Iterator
638 prefix: gst_format_
639 prefix: gst_
640 #structWrap: GstFormat* Format
641 structWrap: GstIterator* Iterator
642 outFile: Format
644 file: gstreamer-GstGError.html
645 prefix: gst_
646 import: glib.Str
647 outFile: GError
649 #HANDEDIT: For some reason GtkWrapper does the constructor wrong
650 #with GstGhostPad. You have to hand edit it to look like this:
651 #       /**
652 #        * Sets our main struct and passes it to the parent class
653 #        */
654 #       public this (GstGhostPad* gstGhostPad)
655 #       {
656 #               super(cast(GstPad*)gstGhostPad);
657 #               this.gstGhostPad = gstGhostPad;
658 #       }
659 file: GstGhostPad.html
660 struct: GstGhostPad
661 class: GhostPad
662 extend: Pad
663 prefix: gst_ghost_pad_
664 prefix: gst_
665 import: glib.Str
666 import: gstreamer.Pad
667 structWrap: GstGhostPad* GhostPad
668 #structWrap: GstProxyPad* ProxyPad
669 structWrap: GstPad* Pad
670 nocode: gst_ghost_pad_new
671 code: start
672         /**
673          * Create a new ghostpad with target as the target. The direction and
674          * padtemplate will be taken from the target pad.
675          * Will ref the target.
676          * name:
677          *  the name of the new pad, or NULL to assign a default name.
678          * target:
679          *  the pad to ghost.
680          * Returns:
681          *  a new GstPad, or NULL in case of an error.
682          */
683         public this(char[] name, Pad target)
684         {
685                 // GstPad* gst_ghost_pad_new (const gchar *name,  GstPad *target);
686                 this( cast(GstGhostPad*) gst_ghost_pad_new(Str.toStringz(name), (target is null) ? null : target.getPadStruct()) );
687         }
688 code: end
689 outFile: GhostPad
691 file: GstIndex.html
692 struct: GstIndex
693 class: Index
694 #prefix: GST_OBJECT_
695 prefix: gst_index_
696 prefix: gst_
697 import: glib.Str
698 import: gstreamer.ObjectGst
699 #import: gstreamer.Format
700 structWrap: GstIndex* Index
701 structWrap: GstObject* ObjectGst
702 #structWrap: GstFormat Format
703 outFile: Index
705 file: GstIndexFactory.html
706 struct: GstIndexFactory
707 class: IndexFactory
708 prefix: gst_index_factory_
709 prefix: gst_
710 import: glib.Str
711 import: gstreamer.Index
712 structWrap: GstIndexFactory* IndexFactory
713 structWrap: GstIndex* Index
714 outFile: IndexFactory
716 file: gstreamer-GstIterator.html
717 struct: GstIterator
718 class: Iterator
719 prefix: gst_iterator_
720 prefix: gst_
721 import: glib.Str
722 #GType
723 #GMutex*
724 structWrap: GstIterator* Iterator
725 outFile: Iterator
727 file: GstPad.html
728 struct: GstPad
729 class: Pad
730 #prefix: GST_OBJECT_
731 prefix: gst_pad_
732 prefix: gst_element_
733 prefix: gst_
734 #libxml2 missing:
735 nocode: gst_pad_load_and_link
736 import: glib.Str
737 import: gstreamer.Element
738 import: gstreamer.MiniObject
739 import: gstreamer.PadTemplate
740 import: gstreamer.Caps
741 import: gstreamer.Buffer
742 import: gstreamer.Event
743 import: gstreamer.Query
744 #import: gstreamer.Format
745 import: glib.ListG
746 structWrap: GstPad* Pad
747 structWrap: GstElement* Element
748 structWrap: GstMiniObject* MiniObject
749 structWrap: GstPadTemplate* PadTemplate
750 structWrap: GstCaps* Caps
751 structWrap: GstBuffer* Buffer
752 structWrap: GstEvent* Event
753 structWrap: GstQuery* Query
754 #structWrap: GstFormat* Format
755 #structWrap: GstFormat Format
756 structWrap: GList* ListG
757 #import: gtkc.gobject
758 code: start
759         /**
760          * Sets our main struct and passes it to the parent class.
761          * This one is additional to make gstreamer.Element addOnPadAdded()
762          * working without changes.
763          */
764         public this (GObject* gstPad)
765         {
766                 super(cast(GstObject*)gstPad);
767                 this.gstPad = cast(GstPad*) gstPad;
768         }
769         
770         /**
771          * Queries a pad for the stream position.
772          * This is a convenience function for gstreamerD.
773          * Returns:
774          *  The current position in nanoseconds - GstFormat.TIME.
775          */
776         public long queryPosition()
777         {
778                 GstFormat form = GstFormat.TIME;
779                 long cur_pos;
780                 queryPosition( &form, &cur_pos );
781                 return cur_pos;
782         }
784         /**
785          * Queries a pad for the stream duration.
786          * This is a convenience function for gstreamerD.
787          * Returns:
788          *  The duration in nanoseconds - GstFormat.TIME.
789          */
790         public long queryDuration()
791         {
792                 GstFormat form = GstFormat.TIME;
793                 long cur_dur;
794                 queryDuration( &form, &cur_dur );
795                 return cur_dur;
796         }
797         
798 code: end
799 outFile: Pad
801 file: gstreamer-GstMessage.html
802 struct: GstMessage
803 class: Message
804 prefix: gst_message_
805 prefix: gst_
806 nocode: gst_message_parse_tag
807 #I'm not so sure about the following:
808 nocode: gst_message_type_to_quark
809 nocode: gst_message_new_element
810 nocode: gst_message_new_new_clock
811 nocode: gst_message_new_segment_done
812 nocode: gst_message_new_segment_start
813 nocode: gst_message_new_warning
814 nocode: gst_message_new_state_dirty
815 nocode: gst_message_new_eos
816 nocode: gst_message_new_error
817 nocode: gst_message_new_info
818 #This is a way to get the type of the message:
819 code: start
820         /**
821         * Get the type of the message.
822         */
823         public GstMessageType type()
824         {
825                 return getMessageStruct().type;
826         }
827         
828         /**
829          * Get the src (the element that originated the message) of the message.
830          */
831         public ObjectGst src()
832         {
833                 return new ObjectGst( cast(GstObject*)getMessageStruct().src );
834         }
836         /**
837          * Get the structure.
838          */
839         public Structure structure()
840         {
841                 return new Structure( getMessageStruct().structure );
842         }
844         /**
845          * Extracts the tag list from the GstMessage. The tag list returned in the
846          * output argument is a copy; the caller must free it when done.
847          * MT safe.
848          * message:
849          *  A valid GstMessage of type GST_MESSAGE_TAG.
850          * tag_list:
851          *  Return location for the tag-list.
852          */
853         /*public void parseTag(GstTagList** tagList)
854         {
855                 // void gst_message_parse_tag (GstMessage *message,  GstTagList **tag_list);
856                 gst_message_parse_tag(gstMessage, tagList);
857         }*/
858         public TagList parseTag()
859         {
860                 // void gst_message_parse_tag (GstMessage *message,  GstTagList **tag_list);
861                 GstTagList* tag_list_c;
862                 gst_message_parse_tag(gstMessage, &tag_list_c);
863                 return new TagList(tag_list_c);
864         }
866         //I'm not so sure about the following:
867         /**
868          * Get the unique quark for the given message type.
869          * type:
870          *  the message type
871          * Returns:
872          *  the quark associated with the message type
873          */
874         public static Quark typeToQuark(GstMessageType type)
875         {
876                 // GQuark gst_message_type_to_quark (GstMessageType type);
877                 return new Quark( cast(uint*)gst_message_type_to_quark(type) );
878         }
880         /**
881          * Create a new element-specific message. This is meant as a generic way of
882          * allowing one-way communication from an element to an application, for example
883          * "the firewire cable was unplugged". The format of the message should be
884          * documented in the element's documentation. The structure field can be NULL.
885          * src:
886          *  The object originating the message.
887          * structure:
888          *  The structure for the message. The message will take ownership of
889          * the structure.
890          * Returns:
891          *  The new element message.
892          * MT safe.
893          */
894         public static Message newElement(ObjectGst src, Structure structure)
895         {
896                 // GstMessage* gst_message_new_element (GstObject *src,  GstStructure *structure);
897                 return new Message(cast(GstMessage*)gst_message_new_element((src is null) ? null : src.getObjectGstStruct(), (structure is null) ? null : structure.getStructureStruct()) );
898         }
900         /**
901          * Create a new clock message. This message is posted whenever the
902          * pipeline selectes a new clock for the pipeline.
903          * src:
904          *  The object originating the message.
905          * clock:
906          *  the new selected clock
907          * Returns:
908          *  The new new clock message.
909          * MT safe.
910          */
911         public static Message newNewClock(ObjectGst src, Clock clock)
912         {
913                 // GstMessage* gst_message_new_new_clock (GstObject *src,  GstClock *clock);
914                 return new Message(cast(GstMessage*)gst_message_new_new_clock((src is null) ? null : src.getObjectGstStruct(), (clock is null) ? null : clock.getClockStruct()) );
915         }
917         /**
918          * Create a new segment done message. This message is posted by elements that
919          * finish playback of a segment as a result of a segment seek. This message
920          * is received by the application after all elements that posted a segment_start
921          * have posted the segment_done.
922          * src:
923          *  The object originating the message.
924          * format:
925          *  The format of the position being done
926          * position:
927          *  The position of the segment being done
928          * Returns:
929          *  The new segment done message.
930          * MT safe.
931          */
932         public static Message newSegmentDone(ObjectGst src, GstFormat format, long position)
933         {
934                 // GstMessage* gst_message_new_segment_done (GstObject *src,  GstFormat format,  gint64 position);
935                 return new Message(cast(GstMessage*)gst_message_new_segment_done((src is null) ? null : src.getObjectGstStruct(), format, position) );
936         }
938         /**
939          * Create a new segment message. This message is posted by elements that
940          * start playback of a segment as a result of a segment seek. This message
941          * is not received by the application but is used for maintenance reasons in
942          * container elements.
943          * src:
944          *  The object originating the message.
945          * format:
946          *  The format of the position being played
947          * position:
948          *  The position of the segment being played
949          * Returns:
950          *  The new segment start message.
951          * MT safe.
952          */
953         public static Message newSegmentStart(ObjectGst src, GstFormat format, long position)
954         {
955                 // GstMessage* gst_message_new_segment_start (GstObject *src,  GstFormat format,  gint64 position);
956                 return new Message(cast(GstMessage*)gst_message_new_segment_start((src is null) ? null : src.getObjectGstStruct(), format, position) );
957         }
959         /**
960          * Create a new warning message. The message will make copies of error and
961          * debug.
962          * src:
963          *  The object originating the message.
964          * error:
965          *  The GError for this message.
966          * debug:
967          *  A debugging string for something or other.
968          * Returns:
969          *  The new warning message.
970          * MT safe.
971          */
972         public static Message newWarning(ObjectGst src, ErrorG error, char[] dbug)
973         {
974                 // GstMessage* gst_message_new_warning (GstObject *src,  GError *error,  gchar *debug);
975                 return new Message(cast(GstMessage*)gst_message_new_warning((src is null) ? null : src.getObjectGstStruct(), (error is null) ? null : error.getErrorGStruct(), Str.toStringz(dbug)) );
976         }
978         /**
979          * Create a state dirty message. This message is posted whenever an element
980          * changed its state asynchronously and is used internally to update the
981          * states of container objects.
982          * src:
983          *  the object originating the message
984          * Returns:
985          *  The new state dirty message.
986          * MT safe.
987          */
988         public static Message newStateDirty(ObjectGst src)
989         {
990                 // GstMessage* gst_message_new_state_dirty (GstObject *src);
991                 return new Message(cast(GstMessage*)gst_message_new_state_dirty((src is null) ? null : src.getObjectGstStruct()) );
992         }
994         /**
995          * Create a new eos message. This message is generated and posted in
996          * the sink elements of a GstBin. The bin will only forward the EOS
997          * message to the application if all sinks have posted an EOS message.
998          * src:
999          *  The object originating the message.
1000          * Returns:
1001          *  The new eos message.
1002          * MT safe.
1003          */
1004         public static Message newEOS(ObjectGst src)
1005         {
1006                 // GstMessage* gst_message_new_eos (GstObject *src);
1007                 return new Message(cast(GstMessage*)gst_message_new_eos((src is null) ? null : src.getObjectGstStruct()) );
1008         }
1010         /**
1011          * Create a new error message. The message will copy error and
1012          * debug. This message is posted by element when a fatal event
1013          * occured. The pipeline will probably (partially) stop. The application
1014          * receiving this message should stop the pipeline.
1015          * src:
1016          *  The object originating the message.
1017          * error:
1018          *  The GError for this message.
1019          * debug:
1020          *  A debugging string for something or other.
1021          * Returns:
1022          *  The new error message.
1023          * MT safe.
1024          */
1025         public static Message newError(ObjectGst src, ErrorG error, char[] dbug)
1026         {
1027                 // GstMessage* gst_message_new_error (GstObject *src,  GError *error,  gchar *debug);
1028                 return new Message(cast(GstMessage*)gst_message_new_error((src is null) ? null : src.getObjectGstStruct(), (error is null) ? null : error.getErrorGStruct(), Str.toStringz(dbug)) );
1029         }
1031         /**
1032          * Create a new info message. The message will make copies of error and
1033          * debug.
1034          * src:
1035          *  The object originating the message.
1036          * error:
1037          *  The GError for this message.
1038          * debug:
1039          *  A debugging string for something or other.
1040          * Returns:
1041          *  The new info message.
1042          * Since 0.10.12
1043          * MT safe.
1044          */
1045         public static Message newInfo(ObjectGst src, ErrorG error, char[] dbug)
1046         {
1047                 // GstMessage* gst_message_new_info (GstObject *src,  GError *error,  gchar *debug);
1048                 return new Message(cast(GstMessage*)gst_message_new_info((src is null) ? null : src.getObjectGstStruct(), (error is null) ? null : error.getErrorGStruct(), Str.toStringz(dbug)) );
1049         }
1050 code: end
1051 import: glib.Str
1052 import: glib.Quark
1053 import: gstreamer.Structure
1054 import: gstreamer.ObjectGst
1055 import: gstreamer.Clock
1056 import: glib.ErrorG
1057 #import: gstreamer.Format
1058 import: gstreamer.TagList
1059 structWrap: GstMessage* Message
1060 structWrap: GQuark Quark
1061 structWrap: GstStructure* Structure
1062 structWrap: GstObject* ObjectGst
1063 structWrap: GstClock* Clock
1064 #GstClock**
1065 structWrap: GError* ErrorG
1066 #structWrap: GFormat Format
1067 #structWrap: GFormat* Format
1068 structWrap: GstTagList* TagList
1069 outFile: Message
1071 file: gstreamer-GstMiniObject.html
1072 struct: GstMiniObject
1073 class: MiniObject
1074 prefix: gst_mini_object_
1075 import: glib.Str
1076 #import: gobject.Type
1077 #structWrap: GType Type
1078 import: gobject.Value
1079 structWrap: GstMiniObject* MiniObject
1080 structWrap: GstMiniObject MiniObject
1081 structWrap: GValue* Value
1082 outFile: MiniObject
1084 file: GstObject.html
1085 struct: GstObject
1086 class: ObjectGst
1087 prefix: gst_object_
1088 prefix: gst_
1089 #libxml2 missing:
1090 nocode: gst_object_save_thyself
1091 nocode: gst_object_restore_thyself
1092 nocode: gst_class_signal_emit_by_name
1093 #this is removed because of GstObjectClass* not working yet
1094 nocode: gst_class_signal_connect
1095 import: glib.Str
1096 import: gobject.ObjectG
1097 import: glib.ErrorG
1098 import: glib.ListG
1099 structWrap: GstObject* ObjectGst
1100 structWrap: GObject* ObjectG
1101 structWrap: GError* ErrorG
1102 structWrap: GList* ListG
1103 outFile: ObjectGst
1105 file: GstPadTemplate.html
1106 struct: GstPadTemplate
1107 class: PadTemplate
1108 prefix: gst_pad_template_
1109 prefix: gst_
1110 import: glib.Str
1111 import: gstreamer.Pad
1112 import: gstreamer.Caps
1113 structWrap: GstPadTemplate* PadTemplate
1114 structWrap: GstPad* Pad
1115 structWrap: GstCaps* Caps
1116 outFile: PadTemplate
1118 file: gstreamer-GstParse.html
1119 class: Parse
1120 prefix: gst_parse_
1121 #I'm not so sure about the following:
1122 nocode: gst_parse_error_quark
1123 code: start
1124         /**
1125          * Get the error quark used by the parsing subsystem.
1126          * Returns:
1127          *  the quark of the parse errors.
1128          */
1129         public static Quark errorQuark()
1130         {
1131                 // GQuark gst_parse_error_quark (void);
1132                 return new Quark( cast(uint*)gst_parse_error_quark() );
1133         }
1134 code: end
1135 import: glib.Str
1136 import: glib.Quark
1137 import: glib.ErrorG
1138 import: gstreamer.Element
1139 structWrap: GQuark Quark
1140 structWrap: GError* ErrorG
1141 structWrap: GstElement* Element
1142 outFile: Parse
1144 file: GstPipeline.html
1145 struct: GstPipeline
1146 class: Pipeline
1147 prefix: gst_pipeline_
1148 prefix: gst_
1149 code: start
1150 public this (char[] name)
1152         this.gstPipeline = cast(GstPipeline*) gst_pipeline_new(Str.toStringz(name));
1153         super(cast(GstBin*)this.gstPipeline);
1155 code: end
1156 import: glib.Str
1157 import: gstreamer.Element
1158 import: gstreamer.Clock
1159 import: gstreamer.Bus
1160 structWrap: GstPipeline* Pipeline
1161 structWrap: GstElement* Element
1162 structWrap: GstBus* Bus
1163 structWrap: GstClock* Clock
1164 outFile: Pipeline
1166 file: GstPlugin.html
1167 struct: GstPlugin
1168 class: Plugin
1169 prefix: gst_plugin_
1170 prefix: gst_
1171 import: glib.Str
1172 #import: glib.Quark
1173 #structWrap: GQuark Quark
1174 import: glib.Module
1175 import: glib.ErrorG
1176 import: glib.ListG
1177 structWrap: GstPlugin* Plugin
1178 structWrap: GModule* Module
1179 structWrap: GList* ListG
1180 outFile: Plugin
1182 file: GstPluginFeature.html
1183 struct: GstPluginFeature
1184 class: PluginFeature
1185 prefix: gst_plugin_feature_
1186 prefix: gst_
1187 import: glib.Str
1188 import: glib.ListG
1189 structWrap: GstPluginFeature* PluginFeature
1190 structWrap: GList* ListG
1191 nocode: gst_plugin_feature_set_name
1192 code: start
1193         /**
1194          * Sets the name of a plugin feature. The name uniquely identifies a feature
1195          * within all features of the same type. Renaming a plugin feature is not
1196          * allowed. A copy is made of the name so you should free the supplied name
1197          * after calling this function.
1198          * feature:
1199          *  a feature
1200          * name:
1201          *  the name to set
1202          */
1203         public void setFeatureName(char[] name)
1204         {
1205                 // void gst_plugin_feature_set_name (GstPluginFeature *feature,  const gchar *name);
1206                 gst_plugin_feature_set_name(gstPluginFeature, Str.toStringz(name));
1207         }
1208 code: end
1209 outFile: PluginFeature
1211 file: gstreamer-GstQuery.html
1212 struct: GstQuery
1213 class: Query
1214 prefix: gst_query_
1215 prefix: gst_
1216 nocode: gst_query_new_position
1217 code: start
1218         /**
1219          * Constructs a new query stream position query object. Use gst_query_unref()
1220          * when done with it. A position query is used to query the current position
1221          * of playback in the streams, in some format.
1222          * format:
1223          *  the default GstFormat for the new query
1224          * Returns:
1225          *  A GstQuery
1226          */
1227         public static Query newPosition(GstFormat format)
1228         {
1229                 // GstQuery* gst_query_new_position (GstFormat format);
1230                 return new Query( cast(GstQuery*)gst_query_new_position(format) );
1231         }
1232 code: end
1233 nocode: gst_query_new_duration
1234 code: start
1235         /**
1236          * Constructs a new stream duration query object to query in the given format.
1237          * Use gst_query_unref() when done with it. A duration query will give the
1238          * total length of the stream.
1239          * format:
1240          *  the GstFormat for this duration query
1241          * Returns:
1242          *  A GstQuery
1243          */
1244         public static Query newDuration(GstFormat format)
1245         {
1246                 // GstQuery* gst_query_new_duration (GstFormat format);
1247                 return new Query( cast(GstQuery*)gst_query_new_duration(format) );
1248         }
1249 code: end
1250 nocode: gst_query_new_seeking
1251 code: start
1252         /**
1253          * Constructs a new query object for querying seeking properties of
1254          * the stream.
1255          * format:
1256          *  the default GstFormat for the new query
1257          * Returns:
1258          *  A GstQuery
1259          */
1260         public static Query newSeeking(GstFormat format)
1261         {
1262                 // GstQuery* gst_query_new_seeking (GstFormat format);
1263                 return new Query(cast(GstQuery*)gst_query_new_seeking(format) );
1264         }
1265 code: end
1266 nocode: gst_query_new_formats
1267 code: start
1268         /**
1269          * Constructs a new query object for querying formats of
1270          * the stream.
1271          * Returns:
1272          *  A GstQuery
1273          * Since 0.10.4
1274          */
1275         public static Query newFormats()
1276         {
1277                 // GstQuery* gst_query_new_formats (void);
1278                 return new Query(cast(GstQuery*)gst_query_new_formats() );
1279         }
1280 code: end
1281 nocode: gst_query_new_segment
1282 code: start
1283         /**
1284          * Constructs a new segment query object. Use gst_query_unref()
1285          * when done with it. A segment query is used to discover information about the
1286          * currently configured segment for playback.
1287          * format:
1288          *  the GstFormat for the new query
1289          * Returns:
1290          *  a GstQuery
1291          */
1292         public static Query newSegment(GstFormat format)
1293         {
1294                 // GstQuery* gst_query_new_segment (GstFormat format);
1295                 return new Query(cast(GstQuery*)gst_query_new_segment(format) );
1296         }
1297 code: end
1298 import: glib.Str
1299 import: gstreamer.Structure
1300 #import: gstreamer.Format
1301 structWrap: GstQuery* Query
1302 structWrap: GstStructure* Structure
1303 #structWrap: GstFormat Format
1304 #structWrap: GstFormat* Format
1305 outFile: Query
1307 file: GstRegistry.html
1308 struct: GstRegistry
1309 class: Registry
1310 prefix: gst_registry_
1311 prefix: gst_
1312 import: glib.Str
1313 import: glib.ListG
1314 import: gstreamer.Plugin
1315 import: gstreamer.PluginFeature
1316 #import: gobject.Type
1317 #structWrap: GType Type
1318 structWrap: GstRegistry* Registry
1319 structWrap: GList* ListG
1320 structWrap: GstPlugin* Plugin
1321 structWrap: GstPluginFeature* PluginFeature
1322 outFile: Registry
1324 file: gstreamer-GstSegment.html
1325 struct: GstSegment
1326 class: Segment
1327 prefix: gst_segment_
1328 prefix: gst_
1329 import: glib.Str
1330 #import: gstreamer.Format
1331 structWrap: GstSegment* Segment
1332 #structWrap: GstFormat Format
1333 outFile: Segment
1335 file: gstreamer-GstStructure.html
1336 struct: GstStructure
1337 class: Structure
1338 prefix: gst_structure_
1339 prefix: gst_
1340 import: glib.Str
1341 #import: glib.Quark
1342 #structWrap: GQuark Quark
1343 import: gobject.Value
1344 #import: gobject.Type
1345 #structWrap: GType Type
1346 structWrap: GstStructure* Structure
1347 structWrap: GValue* Value
1348 #GDate**
1349 outFile: Structure
1351 file: GstSystemClock.html
1352 struct: GstSystemClock
1353 class: SystemClock
1354 prefix: gst_system_clock_
1355 import: glib.Str
1356 import: gstreamer.Clock
1357 structWrap: GstSystemClock* SystemClock
1358 structWrap: GstClock* Clock
1359 outFile: SystemClock
1361 file: gstreamer-GstTagList.html
1362 struct: GstTagList
1363 class: TagList
1364 prefix: gst_tag_list_
1365 prefix: gst_tag_
1366 import: glib.Str
1367 #import: gobject.Type
1368 #structWrap: GType Type
1369 #structWrap: GType* Type
1370 import: gobject.Value
1371 structWrap: GstTagList* TagList
1372 structWrap: GValue* Value
1373 #GDate**
1374 outFile: TagList
1376 file: GstTagSetter.html
1377 struct: GstTagSetter
1378 class: TagSetter
1379 prefix: gst_tag_setter_
1380 prefix: gst_
1381 import: glib.Str
1382 import: gstreamer.TagList
1383 structWrap: GstTagSetter* TagSetter
1384 structWrap: GstTagList* TagList
1385 outFile: TagSetter
1387 file: GstTask.html
1388 struct: GstTask
1389 class: Task
1390 prefix: gst_task_
1391 prefix: gst_
1392 import: glib.Str
1393 structWrap: GstTask* Task
1394 #GStaticRecMutex*
1395 outFile: Task
1397 file: gstreamer-GstTypeFind.html
1398 struct: GstTypeFind
1399 class: TypeFind
1400 prefix: gst_type_find_
1401 prefix: gst_
1402 import: glib.Str
1403 import: gstreamer.Caps
1404 import: gstreamer.Plugin
1405 structWrap: GstTypeFind* TypeFind
1406 structWrap: GstCaps* Caps
1407 structWrap: GstPlugin* Plugin
1408 outFile: TypeFind
1410 file: GstTypeFindFactory.html
1411 struct: GstTypeFindFactory
1412 class: TypeFindFactory
1413 prefix: gst_type_find_factory_
1414 prefix: gst_
1415 import: glib.Str
1416 import: glib.ListG
1417 import: gstreamer.TypeFind
1418 import: gstreamer.Caps
1419 structWrap: GstTypeFindFactory* TypeFindFactory
1420 structWrap: GList* ListG
1421 structWrap: GstTypeFind* TypeFind
1422 structWrap: GstCaps* Caps
1423 outFile: TypeFindFactory
1425 #libxml2 missing:
1426 #file: GstXML.html
1427 #struct: GstXML
1428 #class: XML
1429 #prefix: gst_xml_
1430 #prefix: gst_
1431 #structWrap: GstXML* XML
1432 #structWrap: GstElement* Element
1433 #outFile: XML
1435 # ProxyPad doesn't seem to exist anywhere. Atleast we don't seem to need it.
1436 #file:
1437 #class: ProxyPad
1438 #extend: Pad
1439 #import: gstreamer.Pad
1440 #code: start
1441 #//public class ProxyPad : Pad
1442 #//{
1443 #       /** the main Gtk struct */
1444 #       //protected GstProxyPad* gstProxyPad;
1445 #       protected GstPad* gstProxyPad;
1448 #       public GstPad* getProxyPadStruct()
1449 #       {
1450 #               return gstProxyPad;
1451 #       }
1454 #       /** the main Gtk struct as a void* */
1455 #       protected void* getStruct()
1456 #       {
1457 #               return cast(void*)gstProxyPad;
1458 #       }
1460 #       /**
1461 #        * Sets our main struct and passes it to the parent class
1462 #        */
1463 #       public this (GstPad* gstProxyPad)
1464 #       {
1465 #               super(cast(GstObject*)gstProxyPad);
1466 #               this.gstProxyPad = gstProxyPad;
1467 #       }
1468 #//}
1470 #code: end
1471 #outfile: ProxyPad