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
23 # Definitions for wrapping GStreamer
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
47 private import gtkc.glibtypes;
48 private import gtkc.gobjecttypes;
49 private import gtkc.gthreadtypes;
50 private import glib.Str;
54 #private import gstreamerc.gstreamertypes;
55 #private import gstreamerc.gstreamer;
66 # * Base class for refcounted lightweight objects.
67 # * GTypeInstance instance;
69 # public struct GstMiniObject
71 # GTypeInstance instanc;
72 # //< public >// with COW
73 # int refcount;//gint refcount;
74 # uint flags;//guint flags;
77 # gpointer _gst_reserved;
82 # GstMiniObject mini_object;
84 # /*< private > *//* with MESSAGE_LOCK */
85 # GMutex* lock; /* lock and cond for async delivery */
88 # /*< public > *//* with COW */
89 # GstMessageType type;
90 # ulong timestamp;//guint64 timestamp;
93 # GstStructure* structure;
96 # gpointer _gst_reserved[GST_PADDING];
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;
136 # must start with wrap
141 ###########################################################
142 ### GStreamer #############################################
143 ###########################################################
145 file: gstreamer-Gst.html
154 * Call this function before using any other GStreamer functions in your applications.
156 public static void init(char[][] args) //public static void init(int* argc, char**[] argv)
158 char** argv = cast(char**) new char*[args.length];
160 foreach (char[] p; args)
162 argv[argc++] = cast(char*)p;
165 gst_init(&argc, null);//cast(char**[])&argv);
177 import: gstreamer.Element
178 import: gstreamer.Iterator
182 * Creates a new bin with the given name.
184 * the name of the new bin
188 public this(char[] name)
190 // GstElement* gst_bin_new (const gchar *name);
191 this( cast(GstBin*) gst_bin_new(Str.toStringz(name)) );
194 public this(Element elem)
196 super( elem.getElementStruct() );
197 this.gstBin = cast(GstBin*)elem.getElementStruct();
200 structWrap: GstBin* Bin
201 structWrap: GstElement* Element
202 structWrap: GstIterator* Iterator
203 #... addMany and removeMany
206 file: gstreamer-GstBuffer.html
212 import: gstreamer.Caps
213 structWrap: GstBuffer* Buffer
214 structWrap: GstCaps* Caps
223 import: gstreamer.Message
225 structWrap: GstBus* Bus
226 structWrap: GstMessage* Message
227 structWrap: GSource* Source
228 nocode: gst_bus_add_watch
229 nocode: gst_bus_set_sync_handler
232 * Adds a bus watch to the default main context with the default priority.
233 * This function is used to receive asynchronous messages in the main loop.
234 * The watch can be removed using g_source_remove() or by returning FALSE
237 * a GstBus to create the watch for
239 * A function to call when a message is received.
241 * user data passed to func.
243 * The event source id.
246 public uint addWatch( bool delegate(Message) dlg )
248 onWatchListener = dlg;
249 return gst_bus_add_watch(gstBus, cast(GstBusFunc)&watchCallBack, cast(void*)this);
252 bool delegate(Message) onWatchListener;
254 extern(C) static gboolean watchCallBack(GstBus* bus, GstMessage* msg, Bus bus_d )//gpointer data)
256 Message msg_d = new Message( msg );
258 return bus_d.onWatchListener( msg_d );
262 * Use this for making an XOverlay.
263 * Sets the synchronous handler on the bus. The function will be called
264 * every time a new message is posted on the bus. Note that the function
265 * will be called in the same thread context as the posting object. This
266 * function is usually only called by the creator of the bus. Applications
267 * should handle messages asynchronously using the gst_bus watch and poll
269 * You cannot replace an existing sync_handler. You can pass NULL to this
270 * function, which will clear the existing handler.
272 * a GstBus to install the handler on
274 * The handler function to install
276 * User data that will be sent to the handler function.
278 public void setSyncHandler( GstBusSyncReply delegate(Message) dlg )
280 onSyncHandlerListener = dlg;
281 gst_bus_set_sync_handler(gstBus, cast(GstBusSyncHandler)&syncHandlerCallBack, cast(void*)this);
284 GstBusSyncReply delegate(Message) onSyncHandlerListener;
286 extern(C) static GstBusSyncReply syncHandlerCallBack(GstBus * bus, GstMessage * msg, Bus bus_d )//GstPipeline * pipeline)
287 //extern(C) static gboolean watchCallBack(GstBus* bus, GstMessage* msg, Bus bus_d )//gpointer data)
289 Message msg_d = new Message( msg );
291 return bus_d.onSyncHandlerListener( msg_d );
296 file: gstreamer-GstCaps.html
302 import: gstreamer.Structure
304 nocode: gst_caps_save_thyself
305 nocode: gst_caps_load_thyself
306 nocode: gst_caps_new_any
309 * Creates a new GstCaps that indicates that it is compatible with
314 public static Caps newAny()
316 // GstCaps* gst_caps_new_any (void);
317 return new Caps(cast(GstCaps*)gst_caps_new_any() );
320 structWrap: GstCaps* Caps
321 structWrap: GstStructure* Structure
322 #TODO: take a look at replace and it's GstCaps**
325 #file: gstreamer-GstChildProxy.html
326 #class: GstChildProxy
327 #prefix: gst_child_proxy_
328 #import: gstreamer.ObjectGst;
329 #structWrap: GstObject* ObjectGst
338 structWrap: GstClock* Clock
341 file: GstElement.html
348 #prefix: GST_STATE_CHANGE_
349 #prefix: GST_STATE_ GstState.
353 import: gstreamer.Pad
354 import: gstreamer.Clock
355 import: gstreamer.Caps
356 import: gstreamer.Iterator
357 import: gstreamer.Index
358 import: gstreamer.TagList
359 import: gstreamer.Message
360 import: gstreamer.Query
361 #import: gstreamer.Format
362 import: gstreamer.Event
363 import: gstreamer.Bus
364 structWrap: GstBus* Bus
365 #import: gstreamer.QueryType
367 #import: gobject.ObjectG
368 #structWrap: GObject* ObjectG
369 #I tried this instead:
370 structWrap: GObject* Pad
371 structWrap: GstElement* Element
372 structWrap: GstPad* Pad
373 structWrap: GstClock* Clock
374 structWrap: GstCaps* Caps
375 structWrap: GstIterator* Iterator
376 structWrap: GstIndex* Index
377 structWrap: GstTagList* TagList
378 structWrap: GstMessage* Message
379 structWrap: GstQuery* Query
380 #structWrap: GstFormat* Format
381 #structWrap: GstFormat Format
382 structWrap: GstEvent* Event
383 #structWrap: GstQueryType* QueryType
385 #where's GList: structWrap: GList
387 #structWrap: GdkCursor* Cursor
388 #nocode: pad-added #this doesn't seem to work.
391 * Queries an element for the stream position.
392 * This is a convenience function for gstreamerD.
394 * The current position in nanoseconds - GstFormat.TIME.
396 public long queryPosition()
398 GstFormat form = GstFormat.TIME;
400 queryPosition( &form, &cur_pos );
405 * Queries an element for the stream duration.
406 * This is a convenience function for gstreamerD.
408 * The duration in nanoseconds - GstFormat.TIME.
410 public long queryDuration()
412 GstFormat form = GstFormat.TIME;
414 queryDuration( &form, &cur_dur );
419 * This set's the filename for a filesrc element.
421 public void location( char[] set )
423 //g_object_set( G_OBJECT(getElementStruct()), "location", set, NULL);
424 setProperty("location", set);
428 * Set the caps property of an Element.
432 g_object_set( getElementStruct(), Str.toStringz("caps"), cp.getCapsStruct(), null );
436 * For your convenience in gstreamerD: you can seek to the
437 * position of the pipeline measured in time_nanoseconds.
439 public int seek( ulong time_nanoseconds ) //gint64
441 return seek( 1.0, GstFormat.TIME, GstSeekFlags.FLUSH,
442 GstSeekType.SET, time_nanoseconds,
443 GstSeekType.NONE, GST_CLOCK_TIME_NONE);
447 * Get's all the pads from an element in a Pad[]. FIXME: This a hackish mess.
451 Pad[] result = new Pad[0];
453 Iterator iter = iteratePads();
454 GstPad* obu_c = null;
455 iter.next( cast(void**) &obu_c );
456 while( obu_c !is null )
458 Pad tmpobu = new Pad( obu_c );
459 //writefln( "iterating Padname: ", tmpobu.getName() );
460 result.length = result.length + 1;
461 result[result.length-1] = tmpobu;
464 iter.next( cast(void**) &obu_c );
466 //writefln("no more pads.");
470 //HANDEDIT: This is a way to add disconnectOnPadAdded
471 //There still doesn't seem to be a way to put it
472 //there automatically...
474 protected uint padAddedHandlerId;
475 void delegate(Pad, Element)[] onPadAddedListeners;
476 void addOnPadAdded(void delegate(Pad, Element) dlg)
478 if ( !("pad-added" in connectedSignals) )
480 padAddedHandlerId = Signals.connectData(
483 cast(GCallback)&callBackPadAdded,
486 cast(ConnectFlags)0);
487 connectedSignals["pad-added"] = 1;
489 onPadAddedListeners ~= dlg;
491 extern(C) static void callBackPadAdded(GstElement* gstelementStruct, GObject* newPad, Element element)
493 bit consumed = false;
495 foreach ( void delegate(Pad, Element) dlg ; element.onPadAddedListeners )
497 dlg(new Pad(newPad), element);
502 void disconnectOnPadAdded()
504 if( "pad-added" in connectedSignals )
506 Signals.handlerDisconnect( getStruct(), padAddedHandlerId );
507 padAddedHandlerId = 0;
508 connectedSignals["pad-added"] = 0;
509 onPadAddedListeners = null;
516 file: GstElementFactory.html
517 struct: GstElementFactory
518 class: ElementFactory
519 prefix: gst_element_factory_
523 import: gstreamer.Element
524 import: gstreamer.Plugin
525 import: gstreamer.Caps
529 * Create a new element of the type defined by the given element factory.
530 * The element will receive a guaranteed unique name,
531 * consisting of the element factory name and a number.
533 * a named factory to instantiate
535 * new GstElement or NULL if unable to create element
537 public static Element make( char[] factoryname )
539 // GstElement* gst_element_factory_make (const gchar *factoryname, const gchar *name);
540 return new Element( gst_element_factory_make(Str.toStringz(factoryname), null ) );
543 structWrap: GstElementFactory* ElementFactory
544 structWrap: GstElement* Element
545 structWrap: GstPlugin* Plugin
546 structWrap: GstCaps* Caps
547 structWrap: GList* ListG
548 outFile: ElementFactory
550 file: gstreamer-GstEvent.html
555 #This might not be necessary:
556 nocode: gst_event_new_buffer_size
559 * Create a new buffersize event. The event is sent downstream and notifies
560 * elements that they should provide a buffer of the specified dimensions.
561 * When the async flag is set, a thread boundary is prefered.
565 * minimum buffer size
567 * maximum buffer size
573 public static Event newBufferSize(GstFormat format, long minsize, long maxsize, int async)
575 // GstEvent* gst_event_new_buffer_size (GstFormat format, gint64 minsize, gint64 maxsize, gboolean async);
576 return new Event(cast(GstEvent*)gst_event_new_buffer_size(format, minsize, maxsize, async) );
579 nocode: gst_event_new_eos
582 * Create a new EOS event. The eos event can only travel downstream
583 * synchronized with the buffer flow. Elements that receive the EOS
584 * event on a pad can return UNEXPECTED as a GstFlowReturn when data
585 * after the EOS event arrives.
586 * The EOS event will travel down to the sink elements in the pipeline
587 * which will then post the GST_MESSAGE_EOS on the bus after they have
588 * finished playing any buffered data.
589 * When all sinks have posted an EOS message, the EOS message is
590 * forwarded to the application.
594 public static Event newEOS()
596 // GstEvent* gst_event_new_eos (void);
597 return new Event(cast(GstEvent*)gst_event_new_eos() );
600 nocode: gst_event_new_flush_start
603 * Allocate a new flush start event. The flush start event can be send
604 * upstream and downstream and travels out-of-bounds with the dataflow.
605 * It marks pads as being in a WRONG_STATE to process more data.
606 * Elements unlock and blocking functions and exit their streaming functions
607 * as fast as possible.
608 * This event is typically generated after a seek to minimize the latency
611 * A new flush start event.
613 public static Event newFlushStart()
615 // GstEvent* gst_event_new_flush_start (void);
616 return new Event(cast(GstEvent*)gst_event_new_flush_start() );
619 nocode: gst_event_new_flush_stop
622 * Allocate a new flush stop event. The flush start event can be send
623 * upstream and downstream and travels out-of-bounds with the dataflow.
624 * It is typically send after sending a FLUSH_START event to make the
625 * pads accept data again.
626 * Elements can process this event synchronized with the dataflow since
627 * the preceeding FLUSH_START event stopped the dataflow.
628 * This event is typically generated to complete a seek and to resume
631 * A new flush stop event.
633 public static Event newFlushStop()
635 // GstEvent* gst_event_new_flush_stop (void);
636 return new Event(cast(GstEvent*)gst_event_new_flush_stop() );
639 nocode: gst_event_new_navigation
642 * Create a new navigation event from the given description.
644 * description of the event
648 public static Event newNavigation(Structure structure)
650 // GstEvent* gst_event_new_navigation (GstStructure *structure);
651 return new Event(cast(GstEvent*)gst_event_new_navigation((structure is null) ? null : structure.getStructureStruct()) );
655 import: gstreamer.Structure
656 #import: gstreamer.Format
657 import: gstreamer.TagList
658 import: gstreamer.MiniObject
659 structWrap: GstEvent* Event
660 structWrap: GstStructure* Structure
661 #structWrap: GstFormat* Format
662 structWrap: GstTagList* TagList
663 structWrap: GstMiniObject* MiniObject
664 structWrap: GstMiniObject MiniObject
667 file: gstreamer-GstFormat.html
671 import: gstreamer.Iterator
674 #structWrap: GstFormat* Format
675 structWrap: GstIterator* Iterator
678 file: gstreamer-GstGError.html
683 #HANDEDIT: For some reason GtkWrapper does the constructor wrong
684 #with GstGhostPad. You have to hand edit it to look like this:
686 # * Sets our main struct and passes it to the parent class
688 # public this (GstGhostPad* gstGhostPad)
690 # super(cast(GstPad*)gstGhostPad);
691 # this.gstGhostPad = gstGhostPad;
693 file: GstGhostPad.html
697 prefix: gst_ghost_pad_
700 import: gstreamer.Pad
701 structWrap: GstGhostPad* GhostPad
702 #structWrap: GstProxyPad* ProxyPad
703 structWrap: GstPad* Pad
704 nocode: gst_ghost_pad_new
707 * Create a new ghostpad with target as the target. The direction and
708 * padtemplate will be taken from the target pad.
709 * Will ref the target.
711 * the name of the new pad, or NULL to assign a default name.
715 * a new GstPad, or NULL in case of an error.
717 public this(char[] name, Pad target)
719 // GstPad* gst_ghost_pad_new (const gchar *name, GstPad *target);
720 this( cast(GstGhostPad*) gst_ghost_pad_new(Str.toStringz(name), (target is null) ? null : target.getPadStruct()) );
725 file: GstImplementsInterface.html
726 struct: GstImplementsInterface
727 class: ImplementsInterface
729 #prefix: gst_implements_interface_ #problem results in keyword cast
731 structWrap: GstElement* Element
732 outFile: ImplementsInterface
741 import: gstreamer.ObjectGst
742 #import: gstreamer.Format
743 structWrap: GstIndex* Index
744 structWrap: GstObject* ObjectGst
745 #structWrap: GstFormat Format
748 file: GstIndexFactory.html
749 struct: GstIndexFactory
751 prefix: gst_index_factory_
754 import: gstreamer.Index
755 structWrap: GstIndexFactory* IndexFactory
756 structWrap: GstIndex* Index
757 outFile: IndexFactory
759 file: gstreamer-GstIterator.html
762 prefix: gst_iterator_
767 structWrap: GstIterator* Iterator
778 nocode: gst_pad_load_and_link
780 import: gstreamer.Element
781 import: gstreamer.MiniObject
782 import: gstreamer.PadTemplate
783 import: gstreamer.Caps
784 import: gstreamer.Buffer
785 import: gstreamer.Event
786 import: gstreamer.Query
787 #import: gstreamer.Format
789 structWrap: GstPad* Pad
790 structWrap: GstElement* Element
791 structWrap: GstMiniObject* MiniObject
792 structWrap: GstPadTemplate* PadTemplate
793 structWrap: GstCaps* Caps
794 structWrap: GstBuffer* Buffer
795 structWrap: GstEvent* Event
796 structWrap: GstQuery* Query
797 #structWrap: GstFormat* Format
798 #structWrap: GstFormat Format
799 structWrap: GList* ListG
800 #import: gtkc.gobject
803 * Sets our main struct and passes it to the parent class.
804 * This one is additional to make gstreamer.Element addOnPadAdded()
805 * working without changes.
807 public this (GObject* gstPad)
809 super(cast(GstObject*)gstPad);
810 this.gstPad = cast(GstPad*) gstPad;
814 * Queries a pad for the stream position.
815 * This is a convenience function for gstreamerD.
817 * The current position in nanoseconds - GstFormat.TIME.
819 public long queryPosition()
821 GstFormat form = GstFormat.TIME;
823 queryPosition( &form, &cur_pos );
828 * Queries a pad for the stream duration.
829 * This is a convenience function for gstreamerD.
831 * The duration in nanoseconds - GstFormat.TIME.
833 public long queryDuration()
835 GstFormat form = GstFormat.TIME;
837 queryDuration( &form, &cur_dur );
844 #########for pad signals disconnecting add this with hand editing:
845 #########also this would be needed on all
846 #########gtkD signals.
847 # protected uint padAddedHandlerId;
848 # void delegate(Pad, Element)[] onPadAddedListeners;
849 # void addOnPadAdded(void delegate(Pad, Element) dlg)
851 # if ( !("pad-added" in connectedSignals) )
853 # padAddedHandlerId = Signals.connectData(
856 # cast(GCallback)&callBackPadAdded,
859 # cast(ConnectFlags)0);
860 # connectedSignals["pad-added"] = 1;
862 # onPadAddedListeners ~= dlg;
864 # extern(C) static void callBackPadAdded(GstElement* gstelementStruct, GObject* newPad, Element element)
866 # bit consumed = false;
868 # foreach ( void delegate(Pad, Element) dlg ; element.onPadAddedListeners )
870 # dlg(new Pad(newPad), element);
875 # void disconnectOnPadAdded()
877 # if( "pad-added" in connectedSignals )
879 # Signals.handlerDisconnect( getStruct(), padAddedHandlerId );
880 # padAddedHandlerId = 0;
881 # connectedSignals["pad-added"] = 0;
882 # onPadAddedListeners = null;
886 file: gstreamer-GstMessage.html
891 nocode: gst_message_parse_tag
892 #I'm not so sure about the following:
893 nocode: gst_message_type_to_quark
894 nocode: gst_message_new_element
895 nocode: gst_message_new_new_clock
896 nocode: gst_message_new_segment_done
897 nocode: gst_message_new_segment_start
898 nocode: gst_message_new_warning
899 nocode: gst_message_new_state_dirty
900 nocode: gst_message_new_eos
901 nocode: gst_message_new_error
902 nocode: gst_message_new_info
903 #This is a way to get the type of the message:
906 * Get the type of the message.
908 public GstMessageType type()
910 return cast(GstMessageType)getMessageStruct().type;
914 * Get the src (the element that originated the message) of the message.
916 public ObjectGst src()
918 return new ObjectGst( cast(GstObject*)getMessageStruct().src );
924 public Structure structure()
926 return new Structure( getMessageStruct().structure );
930 * Extracts the tag list from the GstMessage. The tag list returned in the
931 * output argument is a copy; the caller must free it when done.
934 * A valid GstMessage of type GST_MESSAGE_TAG.
936 * Return location for the tag-list.
938 /*public void parseTag(GstTagList** tagList)
940 // void gst_message_parse_tag (GstMessage *message, GstTagList **tag_list);
941 gst_message_parse_tag(gstMessage, tagList);
943 public TagList parseTag()
945 // void gst_message_parse_tag (GstMessage *message, GstTagList **tag_list);
946 GstTagList* tag_list_c;
947 gst_message_parse_tag(gstMessage, &tag_list_c);
948 return new TagList(tag_list_c);
951 //I'm not so sure about the following:
953 * Get the unique quark for the given message type.
957 * the quark associated with the message type
959 public static Quark typeToQuark(GstMessageType type)
961 // GQuark gst_message_type_to_quark (GstMessageType type);
962 return new Quark( cast(uint*)gst_message_type_to_quark(type) );
966 * Create a new element-specific message. This is meant as a generic way of
967 * allowing one-way communication from an element to an application, for example
968 * "the firewire cable was unplugged". The format of the message should be
969 * documented in the element's documentation. The structure field can be NULL.
971 * The object originating the message.
973 * The structure for the message. The message will take ownership of
976 * The new element message.
979 public static Message newElement(ObjectGst src, Structure structure)
981 // GstMessage* gst_message_new_element (GstObject *src, GstStructure *structure);
982 return new Message(cast(GstMessage*)gst_message_new_element((src is null) ? null : src.getObjectGstStruct(), (structure is null) ? null : structure.getStructureStruct()) );
986 * Create a new clock message. This message is posted whenever the
987 * pipeline selectes a new clock for the pipeline.
989 * The object originating the message.
991 * the new selected clock
993 * The new new clock message.
996 public static Message newNewClock(ObjectGst src, Clock clock)
998 // GstMessage* gst_message_new_new_clock (GstObject *src, GstClock *clock);
999 return new Message(cast(GstMessage*)gst_message_new_new_clock((src is null) ? null : src.getObjectGstStruct(), (clock is null) ? null : clock.getClockStruct()) );
1003 * Create a new segment done message. This message is posted by elements that
1004 * finish playback of a segment as a result of a segment seek. This message
1005 * is received by the application after all elements that posted a segment_start
1006 * have posted the segment_done.
1008 * The object originating the message.
1010 * The format of the position being done
1012 * The position of the segment being done
1014 * The new segment done message.
1017 public static Message newSegmentDone(ObjectGst src, GstFormat format, long position)
1019 // GstMessage* gst_message_new_segment_done (GstObject *src, GstFormat format, gint64 position);
1020 return new Message(cast(GstMessage*)gst_message_new_segment_done((src is null) ? null : src.getObjectGstStruct(), format, position) );
1024 * Create a new segment message. This message is posted by elements that
1025 * start playback of a segment as a result of a segment seek. This message
1026 * is not received by the application but is used for maintenance reasons in
1027 * container elements.
1029 * The object originating the message.
1031 * The format of the position being played
1033 * The position of the segment being played
1035 * The new segment start message.
1038 public static Message newSegmentStart(ObjectGst src, GstFormat format, long position)
1040 // GstMessage* gst_message_new_segment_start (GstObject *src, GstFormat format, gint64 position);
1041 return new Message(cast(GstMessage*)gst_message_new_segment_start((src is null) ? null : src.getObjectGstStruct(), format, position) );
1045 * Create a new warning message. The message will make copies of error and
1048 * The object originating the message.
1050 * The GError for this message.
1052 * A debugging string for something or other.
1054 * The new warning message.
1057 public static Message newWarning(ObjectGst src, ErrorG error, char[] dbug)
1059 // GstMessage* gst_message_new_warning (GstObject *src, GError *error, gchar *debug);
1060 return new Message(cast(GstMessage*)gst_message_new_warning((src is null) ? null : src.getObjectGstStruct(), (error is null) ? null : error.getErrorGStruct(), Str.toStringz(dbug)) );
1064 * Create a state dirty message. This message is posted whenever an element
1065 * changed its state asynchronously and is used internally to update the
1066 * states of container objects.
1068 * the object originating the message
1070 * The new state dirty message.
1073 public static Message newStateDirty(ObjectGst src)
1075 // GstMessage* gst_message_new_state_dirty (GstObject *src);
1076 return new Message(cast(GstMessage*)gst_message_new_state_dirty((src is null) ? null : src.getObjectGstStruct()) );
1080 * Create a new eos message. This message is generated and posted in
1081 * the sink elements of a GstBin. The bin will only forward the EOS
1082 * message to the application if all sinks have posted an EOS message.
1084 * The object originating the message.
1086 * The new eos message.
1089 public static Message newEOS(ObjectGst src)
1091 // GstMessage* gst_message_new_eos (GstObject *src);
1092 return new Message(cast(GstMessage*)gst_message_new_eos((src is null) ? null : src.getObjectGstStruct()) );
1096 * Create a new error message. The message will copy error and
1097 * debug. This message is posted by element when a fatal event
1098 * occured. The pipeline will probably (partially) stop. The application
1099 * receiving this message should stop the pipeline.
1101 * The object originating the message.
1103 * The GError for this message.
1105 * A debugging string for something or other.
1107 * The new error message.
1110 public static Message newError(ObjectGst src, ErrorG error, char[] dbug)
1112 // GstMessage* gst_message_new_error (GstObject *src, GError *error, gchar *debug);
1113 return new Message(cast(GstMessage*)gst_message_new_error((src is null) ? null : src.getObjectGstStruct(), (error is null) ? null : error.getErrorGStruct(), Str.toStringz(dbug)) );
1117 * Create a new info message. The message will make copies of error and
1120 * The object originating the message.
1122 * The GError for this message.
1124 * A debugging string for something or other.
1126 * The new info message.
1130 public static Message newInfo(ObjectGst src, ErrorG error, char[] dbug)
1132 // GstMessage* gst_message_new_info (GstObject *src, GError *error, gchar *debug);
1133 return new Message(cast(GstMessage*)gst_message_new_info((src is null) ? null : src.getObjectGstStruct(), (error is null) ? null : error.getErrorGStruct(), Str.toStringz(dbug)) );
1138 import: gstreamer.Structure
1139 import: gstreamer.ObjectGst
1140 import: gstreamer.Clock
1142 #import: gstreamer.Format
1143 import: gstreamer.TagList
1144 structWrap: GstMessage* Message
1145 structWrap: GQuark Quark
1146 structWrap: GstStructure* Structure
1147 structWrap: GstObject* ObjectGst
1148 structWrap: GstClock* Clock
1150 structWrap: GError* ErrorG
1151 #structWrap: GFormat Format
1152 #structWrap: GFormat* Format
1153 structWrap: GstTagList* TagList
1156 file: gstreamer-GstMiniObject.html
1157 struct: GstMiniObject
1159 prefix: gst_mini_object_
1161 #import: gobject.Type
1162 #structWrap: GType Type
1163 import: gobject.Value
1164 structWrap: GstMiniObject* MiniObject
1165 structWrap: GstMiniObject MiniObject
1166 structWrap: GValue* Value
1169 file: GstObject.html
1175 nocode: gst_object_save_thyself
1176 nocode: gst_object_restore_thyself
1177 nocode: gst_class_signal_emit_by_name
1178 #this is removed because of GstObjectClass* not working yet
1179 nocode: gst_class_signal_connect
1181 import: gobject.ObjectG
1184 structWrap: GstObject* ObjectGst
1185 structWrap: GObject* ObjectG
1186 structWrap: GError* ErrorG
1187 structWrap: GList* ListG
1188 nocode: gst_object_ref
1191 * Increments the refence count on object. This function
1192 * does not take the lock on object because it relies on
1193 * atomic refcounting.
1194 * This object returns the input parameter to ease writing
1196 * result = gst_object_ref (object->parent);
1198 * a GstObject to reference
1200 * A pointer to object
1202 public void* reference()
1204 // gpointer gst_object_ref (gpointer object);
1205 return gst_object_ref( gstObject );
1207 /*public static void* ref(void* object)
1209 // gpointer gst_object_ref (gpointer object);
1210 return gst_object_ref(object);
1215 file: GstPadTemplate.html
1216 struct: GstPadTemplate
1218 prefix: gst_pad_template_
1221 import: gstreamer.Pad
1222 import: gstreamer.Caps
1223 structWrap: GstPadTemplate* PadTemplate
1224 structWrap: GstPad* Pad
1225 structWrap: GstCaps* Caps
1226 outFile: PadTemplate
1228 file: gstreamer-GstParse.html
1231 #I'm not so sure about the following:
1232 nocode: gst_parse_error_quark
1235 * Get the error quark used by the parsing subsystem.
1237 * the quark of the parse errors.
1239 public static Quark errorQuark()
1241 // GQuark gst_parse_error_quark (void);
1242 return new Quark( cast(uint*)gst_parse_error_quark() );
1248 import: gstreamer.Element
1249 structWrap: GQuark Quark
1250 structWrap: GError* ErrorG
1251 structWrap: GstElement* Element
1254 file: GstPipeline.html
1257 prefix: gst_pipeline_
1260 public this (char[] name)
1262 this.gstPipeline = cast(GstPipeline*) gst_pipeline_new(Str.toStringz(name));
1263 super(cast(GstBin*)this.gstPipeline);
1267 import: gstreamer.Element
1268 import: gstreamer.Clock
1269 import: gstreamer.Bus
1270 structWrap: GstPipeline* Pipeline
1271 structWrap: GstElement* Element
1272 structWrap: GstBus* Bus
1273 structWrap: GstClock* Clock
1276 file: GstPlugin.html
1283 #structWrap: GQuark Quark
1287 structWrap: GstPlugin* Plugin
1288 structWrap: GModule* Module
1289 structWrap: GList* ListG
1292 file: GstPluginFeature.html
1293 struct: GstPluginFeature
1294 class: PluginFeature
1295 prefix: gst_plugin_feature_
1299 structWrap: GstPluginFeature* PluginFeature
1300 structWrap: GList* ListG
1301 nocode: gst_plugin_feature_set_name
1304 * Sets the name of a plugin feature. The name uniquely identifies a feature
1305 * within all features of the same type. Renaming a plugin feature is not
1306 * allowed. A copy is made of the name so you should free the supplied name
1307 * after calling this function.
1313 public void setFeatureName(char[] name)
1315 // void gst_plugin_feature_set_name (GstPluginFeature *feature, const gchar *name);
1316 gst_plugin_feature_set_name(gstPluginFeature, Str.toStringz(name));
1319 outFile: PluginFeature
1321 file: gstreamer-GstQuery.html
1326 nocode: gst_query_new_position
1329 * Constructs a new query stream position query object. Use gst_query_unref()
1330 * when done with it. A position query is used to query the current position
1331 * of playback in the streams, in some format.
1333 * the default GstFormat for the new query
1337 public static Query newPosition(GstFormat format)
1339 // GstQuery* gst_query_new_position (GstFormat format);
1340 return new Query( cast(GstQuery*)gst_query_new_position(format) );
1343 nocode: gst_query_new_duration
1346 * Constructs a new stream duration query object to query in the given format.
1347 * Use gst_query_unref() when done with it. A duration query will give the
1348 * total length of the stream.
1350 * the GstFormat for this duration query
1354 public static Query newDuration(GstFormat format)
1356 // GstQuery* gst_query_new_duration (GstFormat format);
1357 return new Query( cast(GstQuery*)gst_query_new_duration(format) );
1360 nocode: gst_query_new_seeking
1363 * Constructs a new query object for querying seeking properties of
1366 * the default GstFormat for the new query
1370 public static Query newSeeking(GstFormat format)
1372 // GstQuery* gst_query_new_seeking (GstFormat format);
1373 return new Query(cast(GstQuery*)gst_query_new_seeking(format) );
1376 nocode: gst_query_new_formats
1379 * Constructs a new query object for querying formats of
1385 public static Query newFormats()
1387 // GstQuery* gst_query_new_formats (void);
1388 return new Query(cast(GstQuery*)gst_query_new_formats() );
1391 nocode: gst_query_new_segment
1394 * Constructs a new segment query object. Use gst_query_unref()
1395 * when done with it. A segment query is used to discover information about the
1396 * currently configured segment for playback.
1398 * the GstFormat for the new query
1402 public static Query newSegment(GstFormat format)
1404 // GstQuery* gst_query_new_segment (GstFormat format);
1405 return new Query(cast(GstQuery*)gst_query_new_segment(format) );
1409 import: gstreamer.Structure
1410 #import: gstreamer.Format
1411 structWrap: GstQuery* Query
1412 structWrap: GstStructure* Structure
1413 #structWrap: GstFormat Format
1414 #structWrap: GstFormat* Format
1417 file: GstRegistry.html
1420 prefix: gst_registry_
1424 import: gstreamer.Plugin
1425 import: gstreamer.PluginFeature
1426 #import: gobject.Type
1427 #structWrap: GType Type
1428 structWrap: GstRegistry* Registry
1429 structWrap: GList* ListG
1430 structWrap: GstPlugin* Plugin
1431 structWrap: GstPluginFeature* PluginFeature
1434 file: gstreamer-GstSegment.html
1437 prefix: gst_segment_
1440 #import: gstreamer.Format
1441 structWrap: GstSegment* Segment
1442 #structWrap: GstFormat Format
1445 file: gstreamer-GstStructure.html
1446 struct: GstStructure
1448 prefix: gst_structure_
1452 #structWrap: GQuark Quark
1453 import: gobject.Value
1454 #import: gobject.Type
1455 #structWrap: GType Type
1456 structWrap: GstStructure* Structure
1457 structWrap: GValue* Value
1461 file: GstSystemClock.html
1462 struct: GstSystemClock
1464 prefix: gst_system_clock_
1466 import: gstreamer.Clock
1467 structWrap: GstSystemClock* SystemClock
1468 structWrap: GstClock* Clock
1469 outFile: SystemClock
1471 file: gstreamer-GstTagList.html
1474 prefix: gst_tag_list_
1477 #import: gobject.Type
1478 #structWrap: GType Type
1479 #structWrap: GType* Type
1480 import: gobject.Value
1481 structWrap: GstTagList* TagList
1482 structWrap: GValue* Value
1486 file: GstTagSetter.html
1487 struct: GstTagSetter
1489 prefix: gst_tag_setter_
1492 import: gstreamer.TagList
1493 structWrap: GstTagSetter* TagSetter
1494 structWrap: GstTagList* TagList
1503 structWrap: GstTask* Task
1507 file: gstreamer-GstTypeFind.html
1510 prefix: gst_type_find_
1513 import: gstreamer.Caps
1514 import: gstreamer.Plugin
1515 structWrap: GstTypeFind* TypeFind
1516 structWrap: GstCaps* Caps
1517 structWrap: GstPlugin* Plugin
1520 file: GstTypeFindFactory.html
1521 struct: GstTypeFindFactory
1522 class: TypeFindFactory
1523 prefix: gst_type_find_factory_
1527 import: gstreamer.TypeFind
1528 import: gstreamer.Caps
1529 structWrap: GstTypeFindFactory* TypeFindFactory
1530 structWrap: GList* ListG
1531 structWrap: GstTypeFind* TypeFind
1532 structWrap: GstCaps* Caps
1533 outFile: TypeFindFactory
1541 #structWrap: GstXML* XML
1542 #structWrap: GstElement* Element
1545 # ProxyPad doesn't seem to exist anywhere. Atleast we don't seem to need it.
1549 #import: gstreamer.Pad
1551 #//public class ProxyPad : Pad
1553 # /** the main Gtk struct */
1554 # //protected GstProxyPad* gstProxyPad;
1555 # protected GstPad* gstProxyPad;
1558 # public GstPad* getProxyPadStruct()
1560 # return gstProxyPad;
1564 # /** the main Gtk struct as a void* */
1565 # protected void* getStruct()
1567 # return cast(void*)gstProxyPad;
1571 # * Sets our main struct and passes it to the parent class
1573 # public this (GstPad* gstProxyPad)
1575 # super(cast(GstObject*)gstProxyPad);
1576 # this.gstProxyPad = gstProxyPad;