2 * This file is part of gtkD.
4 * gtkD 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 * gtkD 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 gtkD; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 // generated automatically - do not change
20 // find conversion definition on APILookup.txt
21 // implement new conversion functionalities on the wrap.utils pakage
24 * Conversion parameters:
25 * inFile = GstPad.html
45 * - gst_pad_load_and_link
49 * - gstreamer.MiniObject
50 * - gstreamer.PadTemplate
58 * - GstBuffer* -> Buffer
60 * - GstElement* -> Element
61 * - GstEvent* -> Event
62 * - GstMiniObject* -> MiniObject
64 * - GstPadTemplate* -> PadTemplate
65 * - GstQuery* -> Query
72 private import gstreamerc
.gstreamertypes
;
74 private import gstreamerc
.gstreamer
;
76 private import glib
.Str
;
77 private import gstreamer
.Element
;
78 private import gstreamer
.MiniObject
;
79 private import gstreamer
.PadTemplate
;
80 private import gstreamer
.Caps
;
81 private import gstreamer
.Buffer
;
82 private import gstreamer
.Event
;
83 private import gstreamer
.Query
;
84 private import glib
.ListG
;
90 * A GstElement is linked to other elements via "pads", which are extremely
91 * light-weight generic link points.
92 * After two pads are retrieved from an element with gst_element_get_pad(),
93 * the pads can be link with gst_pad_link(). (For quick links,
94 * you can also use gst_element_link(), which will make the obvious
95 * link for you if it's straightforward.)
96 * Pads are typically created from a GstPadTemplate with
97 * gst_pad_new_from_template().
98 * Pads have GstCaps attached to it to describe the media type they are
99 * capable of dealing with. gst_pad_get_caps() and gst_pad_set_caps() are
100 * used to manipulate the caps of the pads.
101 * Pads created from a pad template cannot set capabilities that are
102 * incompatible with the pad template capabilities.
103 * Pads without pad templates can be created with gst_pad_new(),
104 * which takes a direction and a name as an argument. If the name is NULL,
105 * then a guaranteed unique name will be assigned to it.
106 * gst_pad_get_parent() will retrieve the GstElement that owns the pad.
107 * A GstElement creating a pad will typically use the various
108 * gst_pad_set_*_function() calls to register callbacks for various events
110 * GstElements will use gst_pad_push() and gst_pad_pull_range() to push out
111 * or pull in a buffer.
112 * To send a GstEvent on a pad, use gst_pad_send_event() and
113 * gst_pad_push_event().
114 * Last reviewed on 2006-07-06 (0.10.9)
116 private import gstreamer
.ObjectGst
;
117 public class Pad
: ObjectGst
120 /** the main Gtk struct */
121 protected GstPad
* gstPad
;
124 public GstPad
* getPadStruct()
130 /** the main Gtk struct as a void* */
131 protected void* getStruct()
133 return cast(void*)gstPad
;
137 * Sets our main struct and passes it to the parent class
139 public this (GstPad
* gstPad
)
141 super(cast(GstObject
*)gstPad
);
142 this.gstPad
= gstPad
;
146 * Sets our main struct and passes it to the parent class.
147 * This one is additional to make gstreamer.Element addOnPadAdded()
148 * working without changes.
150 public this (GObject
* gstPad
)
152 super(cast(GstObject
*)gstPad
);
153 this.gstPad
= cast(GstPad
*) gstPad
;
157 * Queries a pad for the stream position.
158 * This is a convenience function for gstreamerD.
160 * The current position in nanoseconds - GstFormat.TIME.
162 public long queryPosition()
164 GstFormat form
= GstFormat
.TIME
;
166 queryPosition( &form
, &cur_pos
);
171 * Queries a pad for the stream duration.
172 * This is a convenience function for gstreamerD.
174 * The duration in nanoseconds - GstFormat.TIME.
176 public long queryDuration()
178 GstFormat form
= GstFormat
.TIME
;
180 queryDuration( &form
, &cur_dur
);
188 // imports for the signal processing
189 private import gobject
.Signals
;
190 private import gtkc
.gdktypes
;
191 int[char[]] connectedSignals
;
193 gboolean
delegate(MiniObject
, Pad
)[] onHaveDataListeners
;
194 void addOnHaveData(gboolean
delegate(MiniObject
, Pad
) dlg
)
196 if ( !("have-data" in connectedSignals
) )
201 cast(GCallback
)&callBackHaveData
,
204 cast(ConnectFlags
)0);
205 connectedSignals
["have-data"] = 1;
207 onHaveDataListeners
~= dlg
;
209 extern(C
) static void callBackHaveData(GstPad
* padStruct
, GstMiniObject
* miniObj
, Pad pad
)
211 bit consumed
= false;
213 foreach ( gboolean
delegate(MiniObject
, Pad
) dlg
; pad
.onHaveDataListeners
)
215 dlg(new MiniObject(miniObj
), pad
);
221 void delegate(Pad
, Pad
)[] onLinkedListeners
;
222 void addOnLinked(void delegate(Pad
, Pad
) dlg
)
224 if ( !("linked" in connectedSignals
) )
229 cast(GCallback
)&callBackLinked
,
232 cast(ConnectFlags
)0);
233 connectedSignals
["linked"] = 1;
235 onLinkedListeners
~= dlg
;
237 extern(C
) static void callBackLinked(GstPad
* padStruct
, GstPad
* peer
, Pad pad
)
239 bit consumed
= false;
241 foreach ( void delegate(Pad
, Pad
) dlg
; pad
.onLinkedListeners
)
243 dlg(new Pad(peer
), pad
);
249 void delegate(Pad
)[] onRequestLinkListeners
;
250 void addOnRequestLink(void delegate(Pad
) dlg
)
252 if ( !("request-link" in connectedSignals
) )
257 cast(GCallback
)&callBackRequestLink
,
260 cast(ConnectFlags
)0);
261 connectedSignals
["request-link"] = 1;
263 onRequestLinkListeners
~= dlg
;
265 extern(C
) static void callBackRequestLink(GstPad
* padStruct
, Pad pad
)
267 bit consumed
= false;
269 foreach ( void delegate(Pad
) dlg
; pad
.onRequestLinkListeners
)
277 void delegate(Pad
, Pad
)[] onUnlinkedListeners
;
278 void addOnUnlinked(void delegate(Pad
, Pad
) dlg
)
280 if ( !("unlinked" in connectedSignals
) )
285 cast(GCallback
)&callBackUnlinked
,
288 cast(ConnectFlags
)0);
289 connectedSignals
["unlinked"] = 1;
291 onUnlinkedListeners
~= dlg
;
293 extern(C
) static void callBackUnlinked(GstPad
* padStruct
, GstPad
* peer
, Pad pad
)
295 bit consumed
= false;
297 foreach ( void delegate(Pad
, Pad
) dlg
; pad
.onUnlinkedListeners
)
299 dlg(new Pad(peer
), pad
);
316 * Gets the direction of the pad. The direction of the pad is
317 * decided at construction time so this function does not take
320 * a GstPad to get the direction of.
322 * the GstPadDirection of the pad.
325 public GstPadDirection
getDirection()
327 // GstPadDirection gst_pad_get_direction (GstPad *pad);
328 return gst_pad_get_direction(gstPad
);
333 * Gets the parent of pad, cast to a GstElement. If a pad has no parent or
334 * its parent is not an element, return NULL.
338 * The parent of the pad. The caller has a reference on the parent, so
339 * unref when you're finished with it.
342 public Element
getParentElement()
344 // GstElement* gst_pad_get_parent_element (GstPad *pad);
345 return new Element( gst_pad_get_parent_element(gstPad
) );
349 * Gets the template for pad.
353 * the GstPadTemplate from which this pad was instantiated, or NULL
354 * if this pad has no template.
355 * FIXME: currently returns an unrefcounted padtemplate.
357 public PadTemplate
getPadTemplate()
359 // GstPadTemplate* gst_pad_get_pad_template (GstPad *pad);
360 return new PadTemplate( gst_pad_get_pad_template(gstPad
) );
364 * Links the source pad and the sink pad.
366 * the source GstPad to link.
368 * the sink GstPad to link.
370 * A result code indicating if the connection worked or
374 public GstPadLinkReturn
link(Pad sinkpad
)
376 // GstPadLinkReturn gst_pad_link (GstPad *srcpad, GstPad *sinkpad);
377 return gst_pad_link(gstPad
, (sinkpad
is null) ?
null : sinkpad
.getPadStruct());
381 * Unlinks the source pad from the sink pad. Will emit the "unlinked" signal on
384 * the source GstPad to unlink.
386 * the sink GstPad to unlink.
388 * TRUE if the pads were unlinked. This function returns FALSE if
389 * the pads were not linked together.
392 public int unlink(Pad sinkpad
)
394 // gboolean gst_pad_unlink (GstPad *srcpad, GstPad *sinkpad);
395 return gst_pad_unlink(gstPad
, (sinkpad
is null) ?
null : sinkpad
.getPadStruct());
399 * Checks if a pad is linked to another pad or not.
403 * TRUE if the pad is linked, FALSE otherwise.
406 public int isLinked()
408 // gboolean gst_pad_is_linked (GstPad *pad);
409 return gst_pad_is_linked(gstPad
);
413 * Checks if the source pad and the sink pad can be linked.
414 * Both srcpad and sinkpad must be unlinked.
416 * the source GstPad to link.
418 * the sink GstPad to link.
420 * TRUE if the pads can be linked, FALSE otherwise.
422 public int canLink(Pad sinkpad
)
424 // gboolean gst_pad_can_link (GstPad *srcpad, GstPad *sinkpad);
425 return gst_pad_can_link(gstPad
, (sinkpad
is null) ?
null : sinkpad
.getPadStruct());
429 * Gets the capabilities this pad can produce or consume.
430 * Note that this method doesn't necessarily return the caps set by
431 * gst_pad_set_caps() - use GST_PAD_CAPS for that instead.
432 * gst_pad_get_caps returns all possible caps a pad can operate with, using
433 * the pad's get_caps function;
434 * this returns the pad template caps if not explicitly set.
436 * a GstPad to get the capabilities of.
438 * a newly allocated copy of the GstCaps of this pad.
441 public Caps
getCaps()
443 // GstCaps* gst_pad_get_caps (GstPad *pad);
444 return new Caps( gst_pad_get_caps(gstPad
) );
448 * Gets the capabilities of the allowed media types that can flow through
450 * The allowed capabilities is calculated as the intersection of the results of
451 * calling gst_pad_get_caps() on pad and its peer. The caller owns a reference
452 * on the resulting caps.
456 * the allowed GstCaps of the pad link. Unref the caps when you no
457 * longer need it. This function returns NULL when pad has no peer.
460 public Caps
getAllowedCaps()
462 // GstCaps* gst_pad_get_allowed_caps (GstPad *pad);
463 return new Caps( gst_pad_get_allowed_caps(gstPad
) );
467 * Gets the capabilities of the media type that currently flows through pad
469 * This function can be used on both src and sinkpads. Note that srcpads are
470 * always negotiated before sinkpads so it is possible that the negotiated caps
471 * on the srcpad do not match the negotiated caps of the peer.
475 * the negotiated GstCaps of the pad link. Free the caps when
476 * you no longer need it. This function returns NULL when the pad has no
477 * peer or is not negotiated yet.
480 public Caps
getNegotiatedCaps()
482 // GstCaps* gst_pad_get_negotiated_caps (GstPad *pad);
483 return new Caps( gst_pad_get_negotiated_caps(gstPad
) );
487 * Gets the capabilities for pad's template.
489 * a GstPad to get the template capabilities from.
491 * the GstCaps of this pad template. If you intend to keep a reference
492 * on the caps, make a copy (see gst_caps_copy()).
494 public Caps
getPadTemplateCaps()
496 // const GstCaps* gst_pad_get_pad_template_caps (GstPad *pad);
497 return new Caps( gst_pad_get_pad_template_caps(gstPad
) );
501 * Sets the capabilities of this pad. The caps must be fixed. Any previous
502 * caps on the pad will be unreffed. This function refs the caps so you should
503 * unref if as soon as you don't need it anymore.
504 * It is possible to set NULL caps, which will make the pad unnegotiated
507 * a GstPad to set the capabilities of.
511 * TRUE if the caps could be set. FALSE if the caps were not fixed
512 * or bad parameters were provided to this function.
515 public int setCaps(Caps caps
)
517 // gboolean gst_pad_set_caps (GstPad *pad, GstCaps *caps);
518 return gst_pad_set_caps(gstPad
, (caps
is null) ?
null : caps
.getCapsStruct());
522 * Gets the peer of pad. This function refs the peer pad so
523 * you need to unref it after use.
525 * a GstPad to get the peer of.
527 * the peer GstPad. Unref after usage.
532 // GstPad* gst_pad_get_peer (GstPad *pad);
533 return new Pad( gst_pad_get_peer(gstPad
) );
537 * Gets the capabilities of the peer connected to this pad.
539 * a GstPad to get the peer capabilities of.
541 * the GstCaps of the peer pad. This function returns a new caps, so use
542 * gst_caps_unref to get rid of it. this function returns NULL if there is no
545 public Caps
peerGetCaps()
547 // GstCaps* gst_pad_peer_get_caps (GstPad *pad);
548 return new Caps( gst_pad_peer_get_caps(gstPad
) );
552 * A helper function you can use that sets the
553 * gst_pad_get_fixed_caps_func as the getcaps function for the
554 * pad. This way the function will always return the negotiated caps
555 * or in case the pad is not negotiated, the padtemplate caps.
556 * Use this function on a pad that, once _set_caps() has been called
557 * on it, cannot be renegotiated to something else.
561 public void useFixedCaps()
563 // void gst_pad_use_fixed_caps (GstPad *pad);
564 gst_pad_use_fixed_caps(gstPad
);
568 * Query if a pad is active
570 * the GstPad to query
572 * TRUE if the pad is active.
575 public int isActive()
577 // gboolean gst_pad_is_active (GstPad *pad);
578 return gst_pad_is_active(gstPad
);
582 * Blocks or unblocks the dataflow on a pad. This function is
583 * a shortcut for gst_pad_set_blocked_async() with a NULL
586 * the GstPad to block or unblock
588 * boolean indicating we should block or unblock
590 * TRUE if the pad could be blocked. This function can fail
591 * wrong parameters were passed or the pad was already in the
595 public int setBlocked(int blocked
)
597 // gboolean gst_pad_set_blocked (GstPad *pad, gboolean blocked);
598 return gst_pad_set_blocked(gstPad
, blocked
);
602 * Blocks or unblocks the dataflow on a pad. The provided callback
603 * is called when the operation succeeds; this happens right before the next
604 * attempt at pushing a buffer on the pad.
605 * This can take a while as the pad can only become blocked when real dataflow
607 * When the pipeline is stalled, for example in PAUSED, this can
608 * take an indeterminate amount of time.
609 * You can pass NULL as the callback to make this call block. Be careful with
610 * this blocking call as it might not return for reasons stated above.
612 * the GstPad to block or unblock
614 * boolean indicating whether the pad should be blocked or unblocked
616 * GstPadBlockCallback that will be called when the
619 * user data passed to the callback
621 * TRUE if the pad could be blocked. This function can fail
622 * if wrong parameters were passed or the pad was already in the
626 public int setBlockedAsync(int blocked
, GstPadBlockCallback callback
, void* userData
)
628 // gboolean gst_pad_set_blocked_async (GstPad *pad, gboolean blocked, GstPadBlockCallback callback, gpointer user_data);
629 return gst_pad_set_blocked_async(gstPad
, blocked
, callback
, userData
);
634 * Checks if the pad is blocked or not. This function returns the
635 * last requested state of the pad. It is not certain that the pad
636 * is actually blocking at this point (see gst_pad_is_blocking()).
638 * the GstPad to query
640 * TRUE if the pad is blocked.
643 public int isBlocked()
645 // gboolean gst_pad_is_blocked (GstPad *pad);
646 return gst_pad_is_blocked(gstPad
);
650 * Checks if the pad is blocking or not. This is a guaranteed state
651 * of whether the pad is actually blocking on a GstBuffer or a GstEvent.
653 * the GstPad to query
655 * TRUE if the pad is blocking.
659 public int isBlocking()
661 // gboolean gst_pad_is_blocking (GstPad *pad);
662 return gst_pad_is_blocking(gstPad
);
666 * Adds a "data probe" to a pad. This function will be called whenever data
667 * passes through a pad. In this case data means both events and buffers. The
668 * probe will be called with the data as an argument, meaning handler should
669 * have the same callback signature as the 'have-data' signal of GstPad.
670 * Note that the data will have a reference count greater than 1, so it will
671 * be immutable -- you must not change it.
672 * For source pads, the probe will be called after the blocking function, if any
673 * (see gst_pad_set_blocked_async()), but before looking up the peer to chain
674 * to. For sink pads, the probe function will be called before configuring the
675 * sink with new caps, if any, and before calling the pad's chain function.
676 * Your data probe should return TRUE to let the data continue to flow, or FALSE
677 * to drop it. Dropping data is rarely useful, but occasionally comes in handy
679 * Although probes are implemented internally by connecting handler to the
680 * have-data signal on the pad, if you want to remove a probe it is insufficient
681 * to only call g_signal_handler_disconnect on the returned handler id. To
682 * remove a probe, use the appropriate function, such as
683 * gst_pad_remove_data_probe().
685 * pad to add the data probe handler to
687 * function to call when data is passed over pad
689 * data to pass along with the handler
693 public uint addDataProbe(GCallback handler
, void* data
)
695 // gulong gst_pad_add_data_probe (GstPad *pad, GCallback handler, gpointer data);
696 return gst_pad_add_data_probe(gstPad
, handler
, data
);
700 * Adds a probe that will be called for all buffers passing through a pad. See
701 * gst_pad_add_data_probe() for more information.
703 * pad to add the buffer probe handler to
705 * function to call when data is passed over pad
707 * data to pass along with the handler
711 public uint addBufferProbe(GCallback handler
, void* data
)
713 // gulong gst_pad_add_buffer_probe (GstPad *pad, GCallback handler, gpointer data);
714 return gst_pad_add_buffer_probe(gstPad
, handler
, data
);
718 * Adds a probe that will be called for all events passing through a pad. See
719 * gst_pad_add_data_probe() for more information.
721 * pad to add the event probe handler to
723 * function to call when data is passed over pad
725 * data to pass along with the handler
729 public uint addEventProbe(GCallback handler
, void* data
)
731 // gulong gst_pad_add_event_probe (GstPad *pad, GCallback handler, gpointer data);
732 return gst_pad_add_event_probe(gstPad
, handler
, data
);
736 * Removes a data probe from pad.
738 * pad to remove the data probe handler from
740 * handler id returned from gst_pad_add_data_probe
742 public void removeDataProbe(uint handlerId
)
744 // void gst_pad_remove_data_probe (GstPad *pad, guint handler_id);
745 gst_pad_remove_data_probe(gstPad
, handlerId
);
749 * Removes a buffer probe from pad.
751 * pad to remove the buffer probe handler from
753 * handler id returned from gst_pad_add_buffer_probe
755 public void removeBufferProbe(uint handlerId
)
757 // void gst_pad_remove_buffer_probe (GstPad *pad, guint handler_id);
758 gst_pad_remove_buffer_probe(gstPad
, handlerId
);
762 * Removes an event probe from pad.
764 * pad to remove the event probe handler from
766 * handler id returned from gst_pad_add_event_probe
768 public void removeEventProbe(uint handlerId
)
770 // void gst_pad_remove_event_probe (GstPad *pad, guint handler_id);
771 gst_pad_remove_event_probe(gstPad
, handlerId
);
775 * Creates a new pad with the given name in the given direction.
776 * If name is NULL, a guaranteed unique name (across all pads)
778 * This function makes a copy of the name so you can safely free the name.
780 * the name of the new pad.
782 * the GstPadDirection of the pad.
784 * a new GstPad, or NULL in case of an error.
787 public this (char[] name
, GstPadDirection direction
)
789 // GstPad* gst_pad_new (const gchar *name, GstPadDirection direction);
790 this(cast(GstPad
*)gst_pad_new(Str
.toStringz(name
), direction
) );
794 * Creates a new pad with the given name from the given template.
795 * If name is NULL, a guaranteed unique name (across all pads)
797 * This function makes a copy of the name so you can safely free the name.
799 * the pad template to use
801 * the name of the element
803 * a new GstPad, or NULL in case of an error.
805 public this (PadTemplate templ
, char[] name
)
807 // GstPad* gst_pad_new_from_template (GstPadTemplate *templ, const gchar *name);
808 this(cast(GstPad
*)gst_pad_new_from_template((templ
is null) ?
null : templ
.getPadTemplateStruct(), Str
.toStringz(name
)) );
812 * Creates a new pad with the given name from the given static template.
813 * If name is NULL, a guaranteed unique name (across all pads)
815 * This function makes a copy of the name so you can safely free the name.
817 * the GstStaticPadTemplate to use
819 * the name of the element
821 * a new GstPad, or NULL in case of an error.
823 public this (GstStaticPadTemplate
* templ
, char[] name
)
825 // GstPad* gst_pad_new_from_static_template (GstStaticPadTemplate *templ, const gchar *name);
826 this(cast(GstPad
*)gst_pad_new_from_static_template(templ
, Str
.toStringz(name
)) );
830 * Allocates a new, empty buffer optimized to push to pad pad. This
831 * function only works if pad is a source pad and has a peer.
832 * A new, empty GstBuffer will be put in the buf argument.
833 * You need to check the caps of the buffer after performing this
834 * function and renegotiate to the format if needed.
838 * the offset of the new buffer in the stream
840 * the size of the new buffer
842 * the caps of the new buffer
844 * a newly allocated buffer
846 * a result code indicating success of the operation. Any
847 * result code other than GST_FLOW_OK is an error and buf should
849 * An error can occur if the pad is not connected or when the downstream
850 * peer elements cannot provide an acceptable buffer.
853 public GstFlowReturn
allocBuffer(ulong offset
, int size
, Caps caps
, GstBuffer
** buf
)
855 // GstFlowReturn gst_pad_alloc_buffer (GstPad *pad, guint64 offset, gint size, GstCaps *caps, GstBuffer **buf);
856 return gst_pad_alloc_buffer(gstPad
, offset
, size
, (caps
is null) ?
null : caps
.getCapsStruct(), buf
);
860 * In addition to the function gst_pad_alloc_buffer(), this function
861 * automatically calls gst_pad_set_caps() when the caps of the
862 * newly allocated buffer are different from the pad caps.
866 * the offset of the new buffer in the stream
868 * the size of the new buffer
870 * the caps of the new buffer
872 * a newly allocated buffer
874 * a result code indicating success of the operation. Any
875 * result code other than GST_FLOW_OK is an error and buf should
877 * An error can occur if the pad is not connected or when the downstream
878 * peer elements cannot provide an acceptable buffer.
881 public GstFlowReturn
allocBufferAndSetCaps(ulong offset
, int size
, Caps caps
, GstBuffer
** buf
)
883 // GstFlowReturn gst_pad_alloc_buffer_and_set_caps (GstPad *pad, guint64 offset, gint size, GstCaps *caps, GstBuffer **buf);
884 return gst_pad_alloc_buffer_and_set_caps(gstPad
, offset
, size
, (caps
is null) ?
null : caps
.getCapsStruct(), buf
);
888 * Sets the given bufferalloc function for the pad. Note that the
889 * bufferalloc function can only be set on sinkpads.
893 * the GstPadBufferAllocFunction to set.
895 public void setBufferallocFunction(GstPadBufferAllocFunction bufalloc
)
897 // void gst_pad_set_bufferalloc_function (GstPad *pad, GstPadBufferAllocFunction bufalloc);
898 gst_pad_set_bufferalloc_function(gstPad
, bufalloc
);
903 * Sets the given chain function for the pad. The chain function is called to
904 * process a GstBuffer input buffer. see GstPadChainFunction for more details.
908 * the GstPadChainFunction to set.
910 public void setChainFunction(GstPadChainFunction chain
)
912 // void gst_pad_set_chain_function (GstPad *pad, GstPadChainFunction chain);
913 gst_pad_set_chain_function(gstPad
, chain
);
918 * Sets the given checkgetrange function for the pad. Implement this function on
919 * a pad if you dynamically support getrange based scheduling on the pad.
923 * the GstPadCheckGetRangeFunction to set.
925 public void setCheckgetrangeFunction(GstPadCheckGetRangeFunction check
)
927 // void gst_pad_set_checkgetrange_function (GstPad *pad, GstPadCheckGetRangeFunction check);
928 gst_pad_set_checkgetrange_function(gstPad
, check
);
933 * When pad is flushing this function returns GST_FLOW_WRONG_STATE
935 * Calls the getrange function of pad, see GstPadGetRangeFunction for a
936 * description of a getrange function. If pad has no getrange function
937 * installed (see gst_pad_set_getrange_function()) this function returns
938 * GST_FLOW_NOT_SUPPORTED.
939 * buffer's caps must either be unset or the same as what is already configured
940 * on pad. Renegotiation within a running pull-mode pipeline is not supported.
942 * a src GstPad, returns GST_FLOW_ERROR if not.
944 * The start offset of the buffer
946 * The length of the buffer
948 * a pointer to hold the GstBuffer, returns GST_FLOW_ERROR if NULL.
950 * a GstFlowReturn from the pad.
953 public GstFlowReturn
getRange(ulong offset
, uint size
, GstBuffer
** buffer
)
955 // GstFlowReturn gst_pad_get_range (GstPad *pad, guint64 offset, guint size, GstBuffer **buffer);
956 return gst_pad_get_range(gstPad
, offset
, size
, buffer
);
960 * Sets the given getrange function for the pad. The getrange function is called to
961 * produce a new GstBuffer to start the processing pipeline. see
962 * GstPadGetRangeFunction for a description of the getrange function.
966 * the GstPadGetRangeFunction to set.
968 public void setGetrangeFunction(GstPadGetRangeFunction get
)
970 // void gst_pad_set_getrange_function (GstPad *pad, GstPadGetRangeFunction get);
971 gst_pad_set_getrange_function(gstPad
, get
);
976 * Sets the given event handler for the pad.
980 * the GstPadEventFunction to set.
982 public void setEventFunction(GstPadEventFunction event
)
984 // void gst_pad_set_event_function (GstPad *pad, GstPadEventFunction event);
985 gst_pad_set_event_function(gstPad
, event
);
990 * Sets the given link function for the pad. It will be called when
991 * the pad is linked with another pad.
992 * The return value GST_PAD_LINK_OK should be used when the connection can be
994 * The return value GST_PAD_LINK_REFUSED should be used when the connection
995 * cannot be made for some reason.
996 * If link is installed on a source pad, it should call the GstPadLinkFunction
997 * of the peer sink pad, if present.
1001 * the GstPadLinkFunction to set.
1003 public void setLinkFunction(GstPadLinkFunction link
)
1005 // void gst_pad_set_link_function (GstPad *pad, GstPadLinkFunction link);
1006 gst_pad_set_link_function(gstPad
, link
);
1011 * Sets the given unlink function for the pad. It will be called
1012 * when the pad is unlinked.
1016 * the GstPadUnlinkFunction to set.
1018 public void setUnlinkFunction(GstPadUnlinkFunction unlink
)
1020 // void gst_pad_set_unlink_function (GstPad *pad, GstPadUnlinkFunction unlink);
1021 gst_pad_set_unlink_function(gstPad
, unlink
);
1026 * Check if the given pad accepts the caps.
1030 * a GstCaps to check on the pad
1032 * TRUE if the pad can accept the caps.
1034 public int acceptCaps(Caps caps
)
1036 // gboolean gst_pad_accept_caps (GstPad *pad, GstCaps *caps);
1037 return gst_pad_accept_caps(gstPad
, (caps
is null) ?
null : caps
.getCapsStruct());
1041 * Sets the given acceptcaps function for the pad. The acceptcaps function
1042 * will be called to check if the pad can accept the given caps. Setting the
1043 * acceptcaps function to NULL restores the default behaviour of allowing
1044 * any caps that matches the caps from gst_pad_get_caps.
1048 * the GstPadAcceptCapsFunction to set.
1050 public void setAcceptcapsFunction(GstPadAcceptCapsFunction acceptcaps
)
1052 // void gst_pad_set_acceptcaps_function (GstPad *pad, GstPadAcceptCapsFunction acceptcaps);
1053 gst_pad_set_acceptcaps_function(gstPad
, acceptcaps
);
1058 * Sets the given getcaps function for the pad. getcaps should return the
1059 * allowable caps for a pad in the context of the element's state, its link to
1060 * other elements, and the devices or files it has opened. These caps must be a
1061 * subset of the pad template caps. In the NULL state with no links, getcaps
1062 * should ideally return the same caps as the pad template. In rare
1063 * circumstances, an object property can affect the caps returned by getcaps,
1064 * but this is discouraged.
1065 * You do not need to call this function if pad's allowed caps are always the
1066 * same as the pad template caps. This can only be true if the padtemplate
1067 * has fixed simple caps.
1068 * For most filters, the caps returned by getcaps is directly affected by the
1069 * allowed caps on other pads. For demuxers and decoders, the caps returned by
1070 * the srcpad's getcaps function is directly related to the stream data. Again,
1071 * getcaps should return the most specific caps it reasonably can, since this
1072 * helps with autoplugging.
1073 * Note that the return value from getcaps is owned by the caller, so the caller
1074 * should unref the caps after usage.
1078 * the GstPadGetCapsFunction to set.
1080 public void setGetcapsFunction(GstPadGetCapsFunction getcaps
)
1082 // void gst_pad_set_getcaps_function (GstPad *pad, GstPadGetCapsFunction getcaps);
1083 gst_pad_set_getcaps_function(gstPad
, getcaps
);
1088 * Calls gst_pad_get_allowed_caps() for every other pad belonging to the
1089 * same element as pad, and returns the intersection of the results.
1090 * This function is useful as a default getcaps function for an element
1091 * that can handle any stream format, but requires all its pads to have
1092 * the same caps. Two such elements are tee and aggregator.
1094 * a GstPad to proxy.
1096 * the intersection of the other pads' allowed caps.
1098 public Caps
proxyGetcaps()
1100 // GstCaps* gst_pad_proxy_getcaps (GstPad *pad);
1101 return new Caps( gst_pad_proxy_getcaps(gstPad
) );
1105 * Sets the given setcaps function for the pad. The setcaps function
1106 * will be called whenever a buffer with a new media type is pushed or
1107 * pulled from the pad. The pad/element needs to update its internal
1108 * structures to process the new media type. If this new type is not
1109 * acceptable, the setcaps function should return FALSE.
1113 * the GstPadSetCapsFunction to set.
1115 public void setSetcapsFunction(GstPadSetCapsFunction setcaps
)
1117 // void gst_pad_set_setcaps_function (GstPad *pad, GstPadSetCapsFunction setcaps);
1118 gst_pad_set_setcaps_function(gstPad
, setcaps
);
1123 * Calls gst_pad_set_caps() for every other pad belonging to the
1124 * same element as pad. If gst_pad_set_caps() fails on any pad,
1125 * the proxy setcaps fails. May be used only during negotiation.
1127 * a GstPad to proxy from
1129 * the GstCaps to link with
1133 public int proxySetcaps(Caps caps
)
1135 // gboolean gst_pad_proxy_setcaps (GstPad *pad, GstCaps *caps);
1136 return gst_pad_proxy_setcaps(gstPad
, (caps
is null) ?
null : caps
.getCapsStruct());
1140 * Fixate a caps on the given pad. Modifies the caps in place, so you should
1141 * make sure that the caps are actually writable (see gst_caps_make_writable()).
1143 * a GstPad to fixate
1145 * the GstCaps to fixate
1147 public void fixateCaps(Caps caps
)
1149 // void gst_pad_fixate_caps (GstPad *pad, GstCaps *caps);
1150 gst_pad_fixate_caps(gstPad
, (caps
is null) ?
null : caps
.getCapsStruct());
1154 * Sets the given fixatecaps function for the pad. The fixatecaps function
1155 * will be called whenever the default values for a GstCaps needs to be
1160 * the GstPadFixateCapsFunction to set.
1162 public void setFixatecapsFunction(GstPadFixateCapsFunction fixatecaps
)
1164 // void gst_pad_set_fixatecaps_function (GstPad *pad, GstPadFixateCapsFunction fixatecaps);
1165 gst_pad_set_fixatecaps_function(gstPad
, fixatecaps
);
1170 * A helper function you can use as a GetCaps function that
1171 * will return the currently negotiated caps or the padtemplate
1176 * The currently negotiated caps or the padtemplate.
1178 public Caps
getFixedCapsFunc()
1180 // GstCaps* gst_pad_get_fixed_caps_func (GstPad *pad);
1181 return new Caps( gst_pad_get_fixed_caps_func(gstPad
) );
1185 * Check if the peer of pad accepts caps. If pad has no peer, this function
1188 * a GstPad to check the peer of
1190 * a GstCaps to check on the pad
1192 * TRUE if the peer of pad can accept the caps or pad has no peer.
1194 public int peerAcceptCaps(Caps caps
)
1196 // gboolean gst_pad_peer_accept_caps (GstPad *pad, GstCaps *caps);
1197 return gst_pad_peer_accept_caps(gstPad
, (caps
is null) ?
null : caps
.getCapsStruct());
1201 * Sets the given activate function for pad. The activate function will
1202 * dispatch to gst_pad_activate_push() or gst_pad_activate_pull() to perform
1203 * the actual activation. Only makes sense to set on sink pads.
1204 * Call this function if your sink pad can start a pull-based task.
1208 * the GstPadActivateFunction to set.
1210 public void setActivateFunction(GstPadActivateFunction activate
)
1212 // void gst_pad_set_activate_function (GstPad *pad, GstPadActivateFunction activate);
1213 gst_pad_set_activate_function(gstPad
, activate
);
1218 * Sets the given activate_push function for the pad. An activate_push function
1219 * prepares the element for pushing. See XXX part-activation.txt for details.
1223 * the GstPadActivateModeFunction to set.
1225 public void setActivatepushFunction(GstPadActivateModeFunction activatepush
)
1227 // void gst_pad_set_activatepush_function (GstPad *pad, GstPadActivateModeFunction activatepush);
1228 gst_pad_set_activatepush_function(gstPad
, activatepush
);
1232 * Sets the given activate_pull function for the pad. An activate_pull function
1233 * prepares the element and any upstream connections for pulling. See XXX
1234 * part-activation.txt for details.
1238 * the GstPadActivateModeFunction to set.
1240 public void setActivatepullFunction(GstPadActivateModeFunction activatepull
)
1242 // void gst_pad_set_activatepull_function (GstPad *pad, GstPadActivateModeFunction activatepull);
1243 gst_pad_set_activatepull_function(gstPad
, activatepull
);
1248 * Pushes a buffer to the peer of pad.
1249 * This function will call an installed pad block before triggering any
1250 * installed pad probes.
1251 * If the caps on buffer are different from the currently configured caps on
1252 * pad, this function will call any installed setcaps function on pad (see
1253 * gst_pad_set_setcaps_function()). In case of failure to renegotiate the new
1254 * format, this function returns GST_FLOW_NOT_NEGOTIATED.
1255 * The function proceeds calling gst_pad_chain() on the peer pad and returns the
1256 * value from that function. If pad has no peer, GST_FLOW_NOT_LINKED will be
1258 * In all cases, success or failure, the caller loses its reference to buffer
1259 * after calling this function.
1261 * a source GstPad, returns GST_FLOW_ERROR if not.
1263 * the GstBuffer to push returns GST_FLOW_ERROR if not.
1265 * a GstFlowReturn from the peer pad.
1268 public GstFlowReturn
push(Buffer buffer
)
1270 // GstFlowReturn gst_pad_push (GstPad *pad, GstBuffer *buffer);
1271 return gst_pad_push(gstPad
, (buffer
is null) ?
null : buffer
.getBufferStruct());
1275 * Sends the event to the peer of the given pad. This function is
1276 * mainly used by elements to send events to their peer
1278 * This function takes owership of the provided event so you should
1279 * gst_event_ref() it if you want to reuse the event after this call.
1281 * a GstPad to push the event to.
1283 * the GstEvent to send to the pad.
1285 * TRUE if the event was handled.
1288 public int pushEvent(Event event
)
1290 // gboolean gst_pad_push_event (GstPad *pad, GstEvent *event);
1291 return gst_pad_push_event(gstPad
, (event
is null) ?
null : event
.getEventStruct());
1295 * Checks if a gst_pad_pull_range() can be performed on the peer
1296 * source pad. This function is used by plugins that want to check
1297 * if they can use random access on the peer source pad.
1298 * The peer sourcepad can implement a custom GstPadCheckGetRangeFunction
1299 * if it needs to perform some logic to determine if pull_range is
1304 * a gboolean with the result.
1307 public int checkPullRange()
1309 // gboolean gst_pad_check_pull_range (GstPad *pad);
1310 return gst_pad_check_pull_range(gstPad
);
1314 * Pulls a buffer from the peer pad.
1315 * This function will first trigger the pad block signal if it was
1317 * When pad is not linked GST_FLOW_NOT_LINKED is returned else this
1318 * function returns the result of gst_pad_get_range() on the peer pad.
1319 * See gst_pad_get_range() for a list of return values and for the
1320 * semantics of the arguments of this function.
1321 * buffer's caps must either be unset or the same as what is already configured
1322 * on pad. Renegotiation within a running pull-mode pipeline is not supported.
1324 * a sink GstPad, returns GST_FLOW_ERROR if not.
1326 * The start offset of the buffer
1328 * The length of the buffer
1330 * a pointer to hold the GstBuffer, returns GST_FLOW_ERROR if NULL.
1332 * a GstFlowReturn from the peer pad.
1333 * When this function returns GST_FLOW_OK, buffer will contain a valid
1334 * GstBuffer that should be freed with gst_buffer_unref() after usage.
1335 * buffer may not be used or freed when any other return value than
1336 * GST_FLOW_OK is returned.
1339 public GstFlowReturn
pullRange(ulong offset
, uint size
, GstBuffer
** buffer
)
1341 // GstFlowReturn gst_pad_pull_range (GstPad *pad, guint64 offset, guint size, GstBuffer **buffer);
1342 return gst_pad_pull_range(gstPad
, offset
, size
, buffer
);
1346 * Activates or deactivates the given pad in pull mode via dispatching to the
1347 * pad's activatepullfunc. For use from within pad activation functions only.
1348 * When called on sink pads, will first proxy the call to the peer pad, which is
1349 * expected to activate its internally linked pads from within its activate_pull
1351 * If you don't know what this is, you probably don't want to call it.
1353 * the GstPad to activate or deactivate.
1355 * whether or not the pad should be active.
1357 * TRUE if the operation was successful.
1360 public int activatePull(int active
)
1362 // gboolean gst_pad_activate_pull (GstPad *pad, gboolean active);
1363 return gst_pad_activate_pull(gstPad
, active
);
1367 * Activates or deactivates the given pad in push mode via dispatching to the
1368 * pad's activatepushfunc. For use from within pad activation functions only.
1369 * If you don't know what this is, you probably don't want to call it.
1371 * the GstPad to activate or deactivate.
1373 * whether the pad should be active or not.
1375 * TRUE if the operation was successful.
1378 public int activatePush(int active
)
1380 // gboolean gst_pad_activate_push (GstPad *pad, gboolean active);
1381 return gst_pad_activate_push(gstPad
, active
);
1385 * Sends the event to the pad. This function can be used
1386 * by applications to send events in the pipeline.
1387 * If pad is a source pad, event should be an upstream event. If pad is a
1388 * sink pad, event should be a downstream event. For example, you would not
1389 * send a GST_EVENT_EOS on a src pad; EOS events only propagate downstream.
1390 * Furthermore, some downstream events have to be serialized with data flow,
1391 * like EOS, while some can travel out-of-band, like GST_EVENT_FLUSH_START. If
1392 * the event needs to be serialized with data flow, this function will take the
1393 * pad's stream lock while calling its event function.
1394 * To find out whether an event type is upstream, downstream, or downstream and
1395 * serialized, see GstEventTypeFlags, gst_event_type_get_flags(),
1396 * GST_EVENT_IS_UPSTREAM, GST_EVENT_IS_DOWNSTREAM, and
1397 * GST_EVENT_IS_SERIALIZED. Note that in practice that an application or plugin
1398 * doesn't need to bother itself with this information; the core handles all
1399 * necessary locks and checks.
1400 * This function takes owership of the provided event so you should
1401 * gst_event_ref() it if you want to reuse the event after this call.
1403 * a GstPad to send the event to.
1405 * the GstEvent to send to the pad.
1407 * TRUE if the event was handled.
1409 public int sendEvent(Event event
)
1411 // gboolean gst_pad_send_event (GstPad *pad, GstEvent *event);
1412 return gst_pad_send_event(gstPad
, (event
is null) ?
null : event
.getEventStruct());
1416 * Invokes the default event handler for the given pad. End-of-stream and
1417 * discontinuity events are handled specially, and then the event is sent to all
1418 * pads internally linked to pad. Note that if there are many possible sink
1419 * pads that are internally linked to pad, only one will be sent an event.
1420 * Multi-sinkpad elements should implement custom event handlers.
1422 * a GstPad to call the default event handler on.
1424 * the GstEvent to handle.
1426 * TRUE if the event was sent succesfully.
1428 public int eventDefault(Event event
)
1430 // gboolean gst_pad_event_default (GstPad *pad, GstEvent *event);
1431 return gst_pad_event_default(gstPad
, (event
is null) ?
null : event
.getEventStruct());
1435 * Dispatches a query to a pad. The query should have been allocated by the
1436 * caller via one of the type-specific allocation functions in gstquery.h. The
1437 * element is responsible for filling the query with an appropriate response,
1438 * which should then be parsed with a type-specific query parsing function.
1439 * Again, the caller is responsible for both the allocation and deallocation of
1440 * the query structure.
1442 * a GstPad to invoke the default query on.
1444 * the GstQuery to perform.
1446 * TRUE if the query could be performed.
1448 public int query(Query query
)
1450 // gboolean gst_pad_query (GstPad *pad, GstQuery *query);
1451 return gst_pad_query(gstPad
, (query
is null) ?
null : query
.getQueryStruct());
1455 * Invokes the default query handler for the given pad.
1456 * The query is sent to all pads internally linked to pad. Note that
1457 * if there are many possible sink pads that are internally linked to
1458 * pad, only one will be sent the query.
1459 * Multi-sinkpad elements should implement custom query handlers.
1461 * a GstPad to call the default query handler on.
1463 * the GstQuery to handle.
1465 * TRUE if the query was performed succesfully.
1467 public int queryDefault(Query query
)
1469 // gboolean gst_pad_query_default (GstPad *pad, GstQuery *query);
1470 return gst_pad_query_default(gstPad
, (query
is null) ?
null : query
.getQueryStruct());
1474 * Queries a pad for the stream position.
1476 * a GstPad to invoke the position query on.
1478 * a pointer to the GstFormat asked for.
1479 * On return contains the GstFormat used.
1481 * A location in which to store the current position, or NULL.
1483 * TRUE if the query could be performed.
1485 public int queryPosition(GstFormat
* format
, long* cur
)
1487 // gboolean gst_pad_query_position (GstPad *pad, GstFormat *format, gint64 *cur);
1488 return gst_pad_query_position(gstPad
, format
, cur
);
1492 * Queries a pad for the total stream duration.
1494 * a GstPad to invoke the duration query on.
1496 * a pointer to the GstFormat asked for.
1497 * On return contains the GstFormat used.
1499 * A location in which to store the total duration, or NULL.
1501 * TRUE if the query could be performed.
1503 public int queryDuration(GstFormat
* format
, long* duration
)
1505 // gboolean gst_pad_query_duration (GstPad *pad, GstFormat *format, gint64 *duration);
1506 return gst_pad_query_duration(gstPad
, format
, duration
);
1510 * Queries a pad to convert src_val in src_format to dest_format.
1512 * a GstPad to invoke the convert query on.
1514 * a GstFormat to convert from.
1516 * a value to convert.
1518 * a pointer to the GstFormat to convert to.
1520 * a pointer to the result.
1522 * TRUE if the query could be performed.
1524 public int queryConvert(GstFormat srcFormat
, long srcVal
, GstFormat
* destFormat
, long* destVal
)
1526 // gboolean gst_pad_query_convert (GstPad *pad, GstFormat src_format, gint64 src_val, GstFormat *dest_format, gint64 *dest_val);
1527 return gst_pad_query_convert(gstPad
, srcFormat
, srcVal
, destFormat
, destVal
);
1531 * Queries the peer of a given sink pad for the stream position.
1533 * a GstPad on whose peer to invoke the position query on.
1534 * Must be a sink pad.
1536 * a pointer to the GstFormat asked for.
1537 * On return contains the GstFormat used.
1539 * A location in which to store the current position, or NULL.
1541 * TRUE if the query could be performed.
1543 public int queryPeerPosition(GstFormat
* format
, long* cur
)
1545 // gboolean gst_pad_query_peer_position (GstPad *pad, GstFormat *format, gint64 *cur);
1546 return gst_pad_query_peer_position(gstPad
, format
, cur
);
1550 * Queries the peer pad of a given sink pad for the total stream duration.
1552 * a GstPad on whose peer pad to invoke the duration query on.
1553 * Must be a sink pad.
1555 * a pointer to the GstFormat asked for.
1556 * On return contains the GstFormat used.
1558 * A location in which to store the total duration, or NULL.
1560 * TRUE if the query could be performed.
1562 public int queryPeerDuration(GstFormat
* format
, long* duration
)
1564 // gboolean gst_pad_query_peer_duration (GstPad *pad, GstFormat *format, gint64 *duration);
1565 return gst_pad_query_peer_duration(gstPad
, format
, duration
);
1569 * Queries the peer pad of a given sink pad to convert src_val in src_format
1572 * a GstPad, on whose peer pad to invoke the convert query on.
1573 * Must be a sink pad.
1575 * a GstFormat to convert from.
1577 * a value to convert.
1579 * a pointer to the GstFormat to convert to.
1581 * a pointer to the result.
1583 * TRUE if the query could be performed.
1585 public int queryPeerConvert(GstFormat srcFormat
, long srcVal
, GstFormat
* destFormat
, long* destVal
)
1587 // gboolean gst_pad_query_peer_convert (GstPad *pad, GstFormat src_format, gint64 src_val, GstFormat *dest_format, gint64 *dest_val);
1588 return gst_pad_query_peer_convert(gstPad
, srcFormat
, srcVal
, destFormat
, destVal
);
1592 * Set the given query function for the pad.
1594 * a GstPad of either direction.
1596 * the GstPadQueryFunction to set.
1598 public void setQueryFunction(GstPadQueryFunction query
)
1600 // void gst_pad_set_query_function (GstPad *pad, GstPadQueryFunction query);
1601 gst_pad_set_query_function(gstPad
, query
);
1606 * Set the given query type function for the pad.
1608 * a GstPad of either direction.
1610 * the GstPadQueryTypeFunction to set.
1612 public void setQueryTypeFunction(GstPadQueryTypeFunction typeFunc
)
1614 // void gst_pad_set_query_type_function (GstPad *pad, GstPadQueryTypeFunction type_func);
1615 gst_pad_set_query_type_function(gstPad
, typeFunc
);
1620 * Get an array of supported queries that can be performed
1625 * a zero-terminated array of GstQueryType.
1627 public GstQueryType
* getQueryTypes()
1629 // const GstQueryType* gst_pad_get_query_types (GstPad *pad);
1630 return gst_pad_get_query_types(gstPad
);
1634 * Invoke the default dispatcher for the query types on
1639 * an zero-terminated array of GstQueryType, or NULL if none of the
1640 * internally-linked pads has a query types function.
1642 public GstQueryType
* getQueryTypesDefault()
1644 // const GstQueryType* gst_pad_get_query_types_default (GstPad *pad);
1645 return gst_pad_get_query_types_default(gstPad
);
1649 * Sets the given internal link function for the pad.
1651 * a GstPad of either direction.
1653 * the GstPadIntLinkFunction to set.
1655 public void setInternalLinkFunction(GstPadIntLinkFunction intlink
)
1657 // void gst_pad_set_internal_link_function (GstPad *pad, GstPadIntLinkFunction intlink);
1658 gst_pad_set_internal_link_function(gstPad
, intlink
);
1663 * Gets a list of pads to which the given pad is linked to
1664 * inside of the parent element.
1665 * The caller must free this list after use.
1667 * the GstPad to get the internal links of.
1669 * a newly allocated GList of pads.
1672 public ListG
getInternalLinks()
1674 // GList* gst_pad_get_internal_links (GstPad *pad);
1675 return new ListG( gst_pad_get_internal_links(gstPad
) );
1679 * Gets a list of pads to which the given pad is linked to
1680 * inside of the parent element.
1681 * This is the default handler, and thus returns a list of all of the
1682 * pads inside the parent element with opposite direction.
1683 * The caller must free this list after use.
1685 * the GstPad to get the internal links of.
1687 * a newly allocated GList of pads, or NULL if the pad has no parent.
1690 public ListG
getInternalLinksDefault()
1692 // GList* gst_pad_get_internal_links_default (GstPad *pad);
1693 return new ListG( gst_pad_get_internal_links_default(gstPad
) );
1698 * Invokes the given dispatcher function on each respective peer of
1699 * all pads that are internally linked to the given pad.
1700 * The GstPadDispatcherFunction should return TRUE when no further pads
1701 * need to be processed.
1703 * a GstPad to dispatch.
1705 * the GstDispatcherFunction to call.
1707 * gpointer user data passed to the dispatcher function.
1709 * TRUE if one of the dispatcher functions returned TRUE.
1711 public int dispatcher(GstPadDispatcherFunction dispatch
, void* data
)
1713 // gboolean gst_pad_dispatcher (GstPad *pad, GstPadDispatcherFunction dispatch, gpointer data);
1714 return gst_pad_dispatcher(gstPad
, dispatch
, data
);
1719 * Set the given private data gpointer on the pad.
1720 * This function can only be used by the element that owns the pad.
1721 * No locking is performed in this function.
1723 * the GstPad to set the private data of.
1725 * The private data to attach to the pad.
1727 public void setElementPrivate(void* priv
)
1729 // void gst_pad_set_element_private (GstPad *pad, gpointer priv);
1730 gst_pad_set_element_private(gstPad
, priv
);
1734 * Gets the private data of a pad.
1735 * No locking is performed in this function.
1737 * the GstPad to get the private data of.
1739 * a gpointer to the private data.
1741 public void* getElementPrivate()
1743 // gpointer gst_pad_get_element_private (GstPad *pad);
1744 return gst_pad_get_element_private(gstPad
);
1748 * Chain a buffer to pad.
1749 * The function returns GST_FLOW_WRONG_STATE if the pad was flushing.
1750 * If the caps on buffer are different from the current caps on pad, this
1751 * function will call any setcaps function (see gst_pad_set_setcaps_function())
1752 * installed on pad. If the new caps are not acceptable for pad, this function
1753 * returns GST_FLOW_NOT_NEGOTIATED.
1754 * The function proceeds calling the chain function installed on pad (see
1755 * gst_pad_set_chain_function()) and the return value of that function is
1756 * returned to the caller. GST_FLOW_NOT_SUPPORTED is returned if pad has no
1758 * In all cases, success or failure, the caller loses its reference to buffer
1759 * after calling this function.
1761 * a sink GstPad, returns GST_FLOW_ERROR if not.
1763 * the GstBuffer to send, return GST_FLOW_ERROR if not.
1765 * a GstFlowReturn from the pad.
1768 public GstFlowReturn
chain(Buffer buffer
)
1770 // GstFlowReturn gst_pad_chain (GstPad *pad, GstBuffer *buffer);
1771 return gst_pad_chain(gstPad
, (buffer
is null) ?
null : buffer
.getBufferStruct());
1775 * Starts a task that repeatedly calls func with data. This function
1776 * is mostly used in pad activation functions to start the dataflow.
1777 * The GST_PAD_STREAM_LOCK of pad will automatically be acquired
1778 * before func is called.
1780 * the GstPad to start the task of
1782 * the task function to call
1784 * data passed to the task function
1786 * a TRUE if the task could be started.
1788 public int startTask(GstTaskFunction func
, void* data
)
1790 // gboolean gst_pad_start_task (GstPad *pad, GstTaskFunction func, gpointer data);
1791 return gst_pad_start_task(gstPad
, func
, data
);
1795 * Pause the task of pad. This function will also make sure that the
1796 * function executed by the task will effectively stop.
1798 * the GstPad to pause the task of
1800 * a TRUE if the task could be paused or FALSE when the pad
1803 public int pauseTask()
1805 // gboolean gst_pad_pause_task (GstPad *pad);
1806 return gst_pad_pause_task(gstPad
);
1810 * Stop the task of pad. This function will also make sure that the
1811 * function executed by the task will effectively stop if not called
1812 * from the GstTaskFunction.
1813 * This function will deadlock if called from the GstTaskFunction of
1814 * the task. Use gst_task_pause() instead.
1815 * Regardless of whether the pad has a task, the stream lock is acquired and
1816 * released so as to ensure that streaming through this pad has finished.
1818 * the GstPad to stop the task of
1820 * a TRUE if the task could be stopped or FALSE on error.
1822 public int stopTask()
1824 // gboolean gst_pad_stop_task (GstPad *pad);
1825 return gst_pad_stop_task(gstPad
);
1829 * Activates or deactivates the given pad.
1830 * Normally called from within core state change functions.
1831 * If active, makes sure the pad is active. If it is already active, either in
1832 * push or pull mode, just return. Otherwise dispatches to the pad's activate
1833 * function to perform the actual activation.
1834 * If not active, checks the pad's current mode and calls
1835 * gst_pad_activate_push() or gst_pad_activate_pull(), as appropriate, with a
1838 * the GstPad to activate or deactivate.
1840 * whether or not the pad should be active.
1842 * TRUE if the operation was successful.
1845 public int setActive(int active
)
1847 // gboolean gst_pad_set_active (GstPad *pad, gboolean active);
1848 return gst_pad_set_active(gstPad
, active
);