Package ch.bailu.gtk.gst
Klasse Pad
- Alle implementierten Schnittstellen:
PointerInterface
- Bekannte direkte Unterklassen:
ProxyPad
A #GstElement is linked to other elements via "pads", which are extremely
light-weight generic link points.
Pads have a #GstPadDirection, source pads produce data, sink pads consume
data.
Pads are typically created from a #GstPadTemplate with
gst_pad_new_from_template() and are then added to a #GstElement. This usually
happens when the element is created but it can also happen dynamically based
on the data that the element is processing or based on the pads that the
application requests.
Pads without pad templates can be created with gst_pad_new(),
which takes a direction and a name as an argument. If the name is %NULL,
then a guaranteed unique name will be assigned to it.
A #GstElement creating a pad will typically use the various
gst_pad_set_*_function\() calls to register callbacks for events, queries or
dataflow on the pads.
gst_pad_get_parent() will retrieve the #GstElement that owns the pad.
After two pads are retrieved from an element by gst_element_get_static_pad(),
the pads can be linked with gst_pad_link(). (For quick links,
you can also use gst_element_link(), which will make the obvious
link for you if it's straightforward.). Pads can be unlinked again with
gst_pad_unlink(). gst_pad_get_peer() can be used to check what the pad is
linked to.
Before dataflow is possible on the pads, they need to be activated with
gst_pad_set_active().
gst_pad_query() and gst_pad_peer_query() can be used to query various
properties of the pad and the stream.
To send a #GstEvent on a pad, use gst_pad_send_event() and
gst_pad_push_event(). Some events will be sticky on the pad, meaning that
after they pass on the pad they can be queried later with
gst_pad_get_sticky_event() and gst_pad_sticky_events_foreach().
gst_pad_get_current_caps() and gst_pad_has_current_caps() are convenience
functions to query the current sticky CAPS event on a pad.
GstElements will use gst_pad_push() and gst_pad_pull_range() to push out
or pull in a buffer.
The dataflow, events and queries that happen on a pad can be monitored with
probes that can be installed with gst_pad_add_probe(). gst_pad_is_blocked()
can be used to check if a block probe is installed on the pad.
gst_pad_is_blocking() checks if the blocking probe is currently blocking the
pad. gst_pad_remove_probe() is used to remove a previously installed probe
and unblock blocking probes if any.
Pad have an offset that can be retrieved with gst_pad_get_offset(). This
offset will be applied to the running_time of all data passing over the pad.
gst_pad_set_offset() can be used to change the offset.
Convenience functions exist to start, pause and stop the task on a pad with
gst_pad_start_task(), gst_pad_pause_task() and gst_pad_stop_task()
respectively.
light-weight generic link points.
Pads have a #GstPadDirection, source pads produce data, sink pads consume
data.
Pads are typically created from a #GstPadTemplate with
gst_pad_new_from_template() and are then added to a #GstElement. This usually
happens when the element is created but it can also happen dynamically based
on the data that the element is processing or based on the pads that the
application requests.
Pads without pad templates can be created with gst_pad_new(),
which takes a direction and a name as an argument. If the name is %NULL,
then a guaranteed unique name will be assigned to it.
A #GstElement creating a pad will typically use the various
gst_pad_set_*_function\() calls to register callbacks for events, queries or
dataflow on the pads.
gst_pad_get_parent() will retrieve the #GstElement that owns the pad.
After two pads are retrieved from an element by gst_element_get_static_pad(),
the pads can be linked with gst_pad_link(). (For quick links,
you can also use gst_element_link(), which will make the obvious
link for you if it's straightforward.). Pads can be unlinked again with
gst_pad_unlink(). gst_pad_get_peer() can be used to check what the pad is
linked to.
Before dataflow is possible on the pads, they need to be activated with
gst_pad_set_active().
gst_pad_query() and gst_pad_peer_query() can be used to query various
properties of the pad and the stream.
To send a #GstEvent on a pad, use gst_pad_send_event() and
gst_pad_push_event(). Some events will be sticky on the pad, meaning that
after they pass on the pad they can be queried later with
gst_pad_get_sticky_event() and gst_pad_sticky_events_foreach().
gst_pad_get_current_caps() and gst_pad_has_current_caps() are convenience
functions to query the current sticky CAPS event on a pad.
GstElements will use gst_pad_push() and gst_pad_pull_range() to push out
or pull in a buffer.
The dataflow, events and queries that happen on a pad can be monitored with
probes that can be installed with gst_pad_add_probe(). gst_pad_is_blocked()
can be used to check if a block probe is installed on the pad.
gst_pad_is_blocking() checks if the blocking probe is currently blocking the
pad. gst_pad_remove_probe() is used to remove a previously installed probe
and unblock blocking probes if any.
Pad have an offset that can be retrieved with gst_pad_get_offset(). This
offset will be applied to the running_time of all data passing over the pad.
gst_pad_set_offset() can be used to change the offset.
Convenience functions exist to start, pause and stop the task on a pad with
gst_pad_start_task(), gst_pad_pause_task() and gst_pad_stop_task()
respectively.
https://gstreamer.freedesktop.org/documentation/gstreamer/gi-index.html
-
Verschachtelte Klassen - Übersicht
Verschachtelte KlassenModifizierer und TypKlasseBeschreibungstatic interface
static interface
static interface
static interface
static interface
static interface
static interface
static interface
static interface
static interface
static interface
static interface
static interface
static interface
static interface
static interface
Von Klasse geerbte verschachtelte Klassen/Schnittstellen ch.bailu.gtk.gobject.Object
Object.OnBindingTransformFunc, Object.OnDuplicateFunc, Object.OnNotify, Object.OnToggleNotify, Object.OnWeakNotify
-
Feldübersicht
FelderVon Klasse geerbte Felder ch.bailu.gtk.gobject.Object
SIGNAL_ON_NOTIFY
-
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungboolean
activateMode
(int mode, boolean active) Activates or deactivates the given pad in @mode via dispatching to the
pad's activatemodefunc.long
addProbe
(int mask, Pad.OnPadProbeCallback callback, Pointer user_data, Pad.OnDestroyNotify destroy_data) Be notified of different states of pads.boolean
Checks if the source pad and the sink pad are compatible so they can be
linked.int
Chain a buffer to @pad.int
chainList
(BufferList list) Chain a bufferlist to @pad.boolean
Check and clear the #GST_PAD_FLAG_NEED_RECONFIGURE flag on @pad and return %TRUE
if the flag was set.createStreamId
(Element parent, Str stream_id) Creates a stream-id for the source #GstPad @pad by combining the
upstream information with the optional @stream_id of the stream
of @pad.createStreamId
(Element parent, String stream_id) Creates a stream-id for the source #GstPad @pad by combining the
upstream information with the optional @stream_id of the stream
of @pad.createStreamIdPrintf
(Element parent, Str stream_id, Object... _ellipsis) Creates a stream-id for the source #GstPad @pad by combining the
upstream information with the optional @stream_id of the stream
of @pad.createStreamIdPrintf
(Element parent, String stream_id, Object... _ellipsis) Creates a stream-id for the source #GstPad @pad by combining the
upstream information with the optional @stream_id of the stream
of @pad.boolean
eventDefault
(Object parent, Event event) Invokes the default event handler for the given pad.boolean
forward
(Pad.OnPadForwardFunction forward, Pointer user_data) Calls @forward for all internally linked pads of @pad.Gets the capabilities of the allowed media types that can flow through
@pad and its peer.static ClassHandler
Gets the capabilities currently configured on @pad with the last
#GST_EVENT_CAPS event.int
Gets the direction of the pad.Gets the private data of a pad.static int
int
Gets the #GstFlowReturn return from the last data passed by this pad.long
Get the offset applied to the running time of @pad.Gets the template for @pad.Gets the capabilities for @pad's template.Gets the parent of @pad, cast to a #GstElement.static long
static TypeSystem.TypeSize
getPeer()
Gets the peer of @pad.If there is a single internal link of the given pad, this function will
return it.getStickyEvent
(int event_type, int idx) Returns a new reference of the sticky event of type @event_type
from the event.Returns the current #GstStream for the @pad, or %NULL if none has been
set yet, i.e. the pad has not received a stream-start event yet.Returns the current stream-id for the @pad, or %NULL if none has been
set yet, i.e. the pad has not received a stream-start event yet.int
Get @pad task state.static long
static TypeSystem.TypeSize
boolean
Check if @pad has caps set on it with a #GST_EVENT_CAPS event.boolean
isActive()
Query if a pad is activeboolean
Checks if the pad is blocked or not.boolean
Checks if the pad is blocking or not.boolean
isLinked()
Checks if a @pad is linked to another pad or not.Gets an iterator for the pads to which the given pad is linked to inside
of the parent element.iterateInternalLinksDefault
(Object parent) Iterate the list of pads to which the given pad is linked to inside of
the parent element.int
Links the source pad and the sink pad.int
Links the source pad and the sink pad.static Str
linkGetName
(int ret) Gets a string representing the given pad-link return.boolean
linkMaybeGhosting
(Pad sink) Links @src to @sink, creating any #GstGhostPad's in between as necessary.boolean
linkMaybeGhostingFull
(Pad sink, int flags) Links @src to @sink, creating any #GstGhostPad's in between as necessary.void
Mark a pad for needing reconfiguration.boolean
Check the #GST_PAD_FLAG_NEED_RECONFIGURE flag on @pad and return %TRUE
if the flag was set.static Pad
newFromStaticTemplatePad
(StaticPadTemplate templ, Str name) Creates a new pad with the given name from the given static template.static Pad
newFromStaticTemplatePad
(StaticPadTemplate templ, String name) Creates a new pad with the given name from the given static template.static Pad
newFromTemplatePad
(PadTemplate templ, Str name) Creates a new pad with the given name from the given template.static Pad
newFromTemplatePad
(PadTemplate templ, String name) Creates a new pad with the given name from the given template.onLinked
(Pad.OnLinked signal) Connect to signal "linked".onUnlinked
(Pad.OnUnlinked signal) Connect to signal "unlinked".boolean
Pause the task of @pad.boolean
Performs gst_pad_query() on the peer of @pad.boolean
peerQueryAcceptCaps
(Caps caps) Check if the peer of @pad accepts @caps.peerQueryCaps
(Caps filter) Gets the capabilities of the peer connected to this pad.boolean
proxyQueryAcceptCaps
(Query query) Checks if all internally linked pads of @pad accepts the caps in @query and
returns the intersection of the results.boolean
proxyQueryCaps
(Query query) Calls gst_pad_query_caps() for all internally linked pads of @pad and returns
the intersection of the results.int
Pushes a buffer to the peer of @pad.boolean
Sends the event to the peer of the given pad.int
pushList
(BufferList list) Pushes a buffer list to the peer of @pad.boolean
Dispatches a query to a pad.boolean
queryAcceptCaps
(Caps caps) Check if the given pad accepts the caps.Gets the capabilities this pad can produce or consume.boolean
queryDefault
(Object parent, Query query) Invokes the default query handler for the given pad.void
removeProbe
(long id) Remove the probe with @id from @pad.boolean
Sends the event to the pad.void
setActivateFunctionFull
(Pad.OnPadActivateFunction activate, Pointer user_data, Pad.OnDestroyNotify notify) Sets the given activate function for @pad.void
setActivatemodeFunctionFull
(Pad.OnPadActivateModeFunction activatemode, Pointer user_data, Pad.OnDestroyNotify notify) Sets the given activate_mode function for the pad.boolean
setActive
(boolean active) Activates or deactivates the given pad.void
setChainFunctionFull
(Pad.OnPadChainFunction chain, Pointer user_data, Pad.OnDestroyNotify notify) Sets the given chain function for the pad.void
setChainListFunctionFull
(Pad.OnPadChainListFunction chainlist, Pointer user_data, Pad.OnDestroyNotify notify) Sets the given chain list function for the pad.void
setElementPrivate
(Pointer priv) Set the given private data gpointer on the pad.void
setEventFullFunctionFull
(Pad.OnPadEventFullFunction event, Pointer user_data, Pad.OnDestroyNotify notify) Sets the given event handler for the pad.void
setEventFunctionFull
(Pad.OnPadEventFunction event, Pointer user_data, Pad.OnDestroyNotify notify) Sets the given event handler for the pad.void
setIterateInternalLinksFunctionFull
(Pad.OnPadIterIntLinkFunction iterintlink, Pointer user_data, Pad.OnDestroyNotify notify) Sets the given internal link iterator function for the pad.void
setLinkFunctionFull
(Pad.OnPadLinkFunction link, Pointer user_data, Pad.OnDestroyNotify notify) Sets the given link function for the pad.void
setOffset
(long offset) Set the offset that will be applied to the running time of @pad.void
setQueryFunctionFull
(Pad.OnPadQueryFunction query, Pointer user_data, Pad.OnDestroyNotify notify) Set the given query function for the pad.void
setUnlinkFunctionFull
(Pad.OnPadUnlinkFunction unlink, Pointer user_data, Pad.OnDestroyNotify notify) Sets the given unlink function for the pad.boolean
startTask
(Pad.OnTaskFunction func, Pointer user_data, Pad.OnDestroyNotify notify) Starts a task that repeatedly calls @func with @user_data.boolean
stopTask()
Stop the task of @pad.int
storeStickyEvent
(Event event) Store the sticky @event on @padboolean
Unlinks the source pad from the sink pad.void
A helper function you can use that sets the FIXED_CAPS flag
This way the default CAPS query will always return the negotiated caps
or in case the pad is not negotiated, the padtemplate caps.Von Klasse geerbte Methoden ch.bailu.gtk.type.PropertyHolder
getBooleanProperty, getIntProperty, getObjectProperty, getStringProperty, getStrProperty, setBooleanProperty, setIntProperty, setObjectProperty, setStringProperty, setStrProperty
Von Klasse geerbte Methoden ch.bailu.gtk.gobject.Object
addToggleRef, bindProperty, bindProperty, bindPropertyFull, bindPropertyFull, bindPropertyWithClosures, bindPropertyWithClosures, compatControl, connect, connect, disconnect, disconnect, dupData, dupData, dupQdata, forceFloating, freezeNotify, get, get, getData, getData, getProperty, getProperty, getQdata, interfaceFindProperty, interfaceInstallProperty, isFloating, notify, notify, notifyByPspec, onNotify, ref, refSink, removeToggleRef, replaceData, replaceData, replaceQdata, runDispose, set, set, setData, setData, setDataFull, setDataFull, setProperty, setProperty, setQdata, setQdataFull, stealData, stealData, stealQdata, takeRef, thawNotify, unref, watchClosure, weakRef, weakUnref
Von Klasse geerbte Methoden ch.bailu.gtk.type.Pointer
asCPointer, cast, connectSignal, disconnectSignals, disconnectSignals, equals, hashCode, throwIfNull, throwNullPointerException, toString, unregisterCallbacks, unregisterCallbacks
Von Klasse geerbte Methoden ch.bailu.gtk.type.Type
asCPointer, asCPointer, asCPointerNotNull, asJnaPointer, asJnaPointer, asPointer, asPointer, cast, cast, throwIfNull
Von Klasse geerbte Methoden java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Von Schnittstelle geerbte Methoden ch.bailu.gtk.type.PointerInterface
asCPointerNotNull, asJnaPointer, asPointer, isNotNull, isNull
-
Felddetails
-
SIGNAL_ON_LINKED
- Siehe auch:
-
SIGNAL_ON_UNLINKED
- Siehe auch:
-
-
Konstruktordetails
-
Pad
-
Pad
Creates a new pad with the given name in the given direction.
If name is %NULL, a guaranteed unique name (across all pads)
will be assigned.
This function makes a copy of the name so you can safely free the name.- Parameter:
name
- the name of the new pad.direction
- the #GstPadDirection of the pad.
-
Pad
Creates a new pad with the given name in the given direction.
If name is %NULL, a guaranteed unique name (across all pads)
will be assigned.
This function makes a copy of the name so you can safely free the name.- Parameter:
name
- the name of the new pad.direction
- the #GstPadDirection of the pad.
-
-
Methodendetails
-
getClassHandler
-
newFromStaticTemplatePad
Creates a new pad with the given name from the given static template.
If name is %NULL, a guaranteed unique name (across all pads)
will be assigned.
This function makes a copy of the name so you can safely free the name.- Parameter:
templ
- the #GstStaticPadTemplate to usename
- the name of the pad- Gibt zurück:
- a new #GstPad.
-
newFromStaticTemplatePad
Creates a new pad with the given name from the given static template.
If name is %NULL, a guaranteed unique name (across all pads)
will be assigned.
This function makes a copy of the name so you can safely free the name.- Parameter:
templ
- the #GstStaticPadTemplate to usename
- the name of the pad- Gibt zurück:
- a new #GstPad.
-
newFromTemplatePad
Creates a new pad with the given name from the given template.
If name is %NULL, a guaranteed unique name (across all pads)
will be assigned.
This function makes a copy of the name so you can safely free the name.- Parameter:
templ
- the pad template to usename
- the name of the pad- Gibt zurück:
- a new #GstPad.
-
newFromTemplatePad
Creates a new pad with the given name from the given template.
If name is %NULL, a guaranteed unique name (across all pads)
will be assigned.
This function makes a copy of the name so you can safely free the name.- Parameter:
templ
- the pad template to usename
- the name of the pad- Gibt zurück:
- a new #GstPad.
-
activateMode
public boolean activateMode(int mode, boolean active) Activates or deactivates the given pad in @mode via dispatching to the
pad's activatemodefunc. For use from within pad activation functions only.
If you don't know what this is, you probably don't want to call it.- Parameter:
mode
- the requested activation modeactive
- whether or not the pad should be active.- Gibt zurück:
- %TRUE if the operation was successful. MT safe.
-
addProbe
public long addProbe(int mask, Pad.OnPadProbeCallback callback, @Nullable Pointer user_data, Pad.OnDestroyNotify destroy_data) Be notified of different states of pads. The provided callback is called for
every state that matches @mask.
Probes are called in groups: First GST_PAD_PROBE_TYPE_BLOCK probes are
called, then others, then finally GST_PAD_PROBE_TYPE_IDLE. The only
exception here are GST_PAD_PROBE_TYPE_IDLE probes that are called
immediately if the pad is already idle while calling gst_pad_add_probe().
In each of the groups, probes are called in the order in which they were
added.- Parameter:
mask
- the probe maskcallback
- #GstPadProbeCallback that will be called with notifications of the pad stateuser_data
- user data passed to the callbackdestroy_data
- #GDestroyNotify for user_data- Gibt zurück:
- an id or 0 if no probe is pending. The id can be used to remove the probe with gst_pad_remove_probe(). When using GST_PAD_PROBE_TYPE_IDLE it can happen that the probe can be run immediately and if the probe returns GST_PAD_PROBE_REMOVE this functions returns 0. MT safe.
-
canLink
Checks if the source pad and the sink pad are compatible so they can be
linked.- Parameter:
sinkpad
- the sink #GstPad.- Gibt zurück:
- %TRUE if the pads can be linked.
-
chain
Chain a buffer to @pad.
The function returns #GST_FLOW_FLUSHING if the pad was flushing.
If the buffer type is not acceptable for @pad (as negotiated with a
preceding GST_EVENT_CAPS event), this function returns
#GST_FLOW_NOT_NEGOTIATED.
The function proceeds calling the chain function installed on @pad (see
gst_pad_set_chain_function()) and the return value of that function is
returned to the caller. #GST_FLOW_NOT_SUPPORTED is returned if @pad has no
chain function.
In all cases, success or failure, the caller loses its reference to @buffer
after calling this function.- Parameter:
buffer
- the #GstBuffer to send, return GST_FLOW_ERROR if not.- Gibt zurück:
- a #GstFlowReturn from the pad. MT safe.
-
chainList
Chain a bufferlist to @pad.
The function returns #GST_FLOW_FLUSHING if the pad was flushing.
If @pad was not negotiated properly with a CAPS event, this function
returns #GST_FLOW_NOT_NEGOTIATED.
The function proceeds calling the chainlist function installed on @pad (see
gst_pad_set_chain_list_function()) and the return value of that function is
returned to the caller. #GST_FLOW_NOT_SUPPORTED is returned if @pad has no
chainlist function.
In all cases, success or failure, the caller loses its reference to @list
after calling this function.
MT safe.- Parameter:
list
- the #GstBufferList to send, return GST_FLOW_ERROR if not.- Gibt zurück:
- a #GstFlowReturn from the pad.
-
checkReconfigure
public boolean checkReconfigure()Check and clear the #GST_PAD_FLAG_NEED_RECONFIGURE flag on @pad and return %TRUE
if the flag was set.- Gibt zurück:
- %TRUE is the GST_PAD_FLAG_NEED_RECONFIGURE flag was set on @pad.
-
createStreamId
Creates a stream-id for the source #GstPad @pad by combining the
upstream information with the optional @stream_id of the stream
of @pad. @pad must have a parent #GstElement and which must have zero
or one sinkpad. @stream_id can only be %NULL if the parent element
of @pad has only a single source pad.
This function generates an unique stream-id by getting the upstream
stream-start event stream ID and appending @stream_id to it. If the
element has no sinkpad it will generate an upstream stream-id by
doing an URI query on the element and in the worst case just uses
a random number. Source elements that don't implement the URI
handler interface should ideally generate a unique, deterministic
stream-id manually instead.
Since stream IDs are sorted alphabetically, any numbers in the
stream ID should be printed with a fixed number of characters,
preceded by 0's, such as by using the format \%03u instead of \%u.- Parameter:
parent
- Parent #GstElement of @padstream_id
- The stream-id- Gibt zurück:
- A stream-id for @pad. g_free() after usage.
-
createStreamId
Creates a stream-id for the source #GstPad @pad by combining the
upstream information with the optional @stream_id of the stream
of @pad. @pad must have a parent #GstElement and which must have zero
or one sinkpad. @stream_id can only be %NULL if the parent element
of @pad has only a single source pad.
This function generates an unique stream-id by getting the upstream
stream-start event stream ID and appending @stream_id to it. If the
element has no sinkpad it will generate an upstream stream-id by
doing an URI query on the element and in the worst case just uses
a random number. Source elements that don't implement the URI
handler interface should ideally generate a unique, deterministic
stream-id manually instead.
Since stream IDs are sorted alphabetically, any numbers in the
stream ID should be printed with a fixed number of characters,
preceded by 0's, such as by using the format \%03u instead of \%u.- Parameter:
parent
- Parent #GstElement of @padstream_id
- The stream-id- Gibt zurück:
- A stream-id for @pad. g_free() after usage.
-
createStreamIdPrintf
public Str createStreamIdPrintf(@Nonnull Element parent, @Nullable Str stream_id, Object... _ellipsis) Creates a stream-id for the source #GstPad @pad by combining the
upstream information with the optional @stream_id of the stream
of @pad. @pad must have a parent #GstElement and which must have zero
or one sinkpad. @stream_id can only be %NULL if the parent element
of @pad has only a single source pad.
This function generates an unique stream-id by getting the upstream
stream-start event stream ID and appending @stream_id to it. If the
element has no sinkpad it will generate an upstream stream-id by
doing an URI query on the element and in the worst case just uses
a random number. Source elements that don't implement the URI
handler interface should ideally generate a unique, deterministic
stream-id manually instead.- Parameter:
parent
- Parent #GstElement of @padstream_id
- The stream-id_ellipsis
- parameters for the @stream_id format string- Gibt zurück:
- A stream-id for @pad. g_free() after usage.
-
createStreamIdPrintf
Creates a stream-id for the source #GstPad @pad by combining the
upstream information with the optional @stream_id of the stream
of @pad. @pad must have a parent #GstElement and which must have zero
or one sinkpad. @stream_id can only be %NULL if the parent element
of @pad has only a single source pad.
This function generates an unique stream-id by getting the upstream
stream-start event stream ID and appending @stream_id to it. If the
element has no sinkpad it will generate an upstream stream-id by
doing an URI query on the element and in the worst case just uses
a random number. Source elements that don't implement the URI
handler interface should ideally generate a unique, deterministic
stream-id manually instead.- Parameter:
parent
- Parent #GstElement of @padstream_id
- The stream-id_ellipsis
- parameters for the @stream_id format string- Gibt zurück:
- A stream-id for @pad. g_free() after usage.
-
eventDefault
Invokes the default event handler for the given pad.
The EOS event will pause the task associated with @pad before it is forwarded
to all internally linked pads,
The event is sent to all pads internally linked to @pad. This function
takes ownership of @event.- Parameter:
parent
- the parent of @pad or %NULLevent
- the #GstEvent to handle.- Gibt zurück:
- %TRUE if the event was sent successfully.
-
forward
Calls @forward for all internally linked pads of @pad. This function deals with
dynamically changing internal pads and will make sure that the @forward
function is only called once for each pad.
When @forward returns %TRUE, no further pads will be processed.- Parameter:
forward
- a #GstPadForwardFunctionuser_data
- user data passed to @forward- Gibt zurück:
- %TRUE if one of the dispatcher functions returned %TRUE.
-
getAllowedCaps
Gets the capabilities of the allowed media types that can flow through
@pad and its peer.
The allowed capabilities is calculated as the intersection of the results of
calling gst_pad_query_caps() on @pad and its peer. The caller owns a reference
on the resulting caps.- Gibt zurück:
- the allowed #GstCaps of the pad link. Unref the caps when you no longer need it. This function returns %NULL when @pad has no peer. MT safe.
-
getCurrentCaps
Gets the capabilities currently configured on @pad with the last
#GST_EVENT_CAPS event.- Gibt zurück:
- the current caps of the pad with incremented ref-count or %NULL when pad has no caps. Unref after usage.
-
getDirection
public int getDirection()Gets the direction of the pad. The direction of the pad is
decided at construction time so this function does not take
the LOCK.- Gibt zurück:
- the #GstPadDirection of the pad. MT safe.
-
getElementPrivate
Gets the private data of a pad.
No locking is performed in this function.- Gibt zurück:
- a #gpointer to the private data.
-
getLastFlowReturn
public int getLastFlowReturn()Gets the #GstFlowReturn return from the last data passed by this pad.- Gibt zurück:
-
getOffset
public long getOffset()Get the offset applied to the running time of @pad. @pad has to be a source
pad.- Gibt zurück:
- the offset.
-
getPadTemplate
Gets the template for @pad.- Gibt zurück:
- the #GstPadTemplate from which this pad was instantiated, or %NULL if this pad has no template. Unref after usage.
-
getPadTemplateCaps
Gets the capabilities for @pad's template.- Gibt zurück:
- the #GstCaps of this pad template. Unref after usage.
-
getParentElement
Gets the parent of @pad, cast to a #GstElement. If a @pad has no parent or
its parent is not an element, return %NULL.- Gibt zurück:
- the parent of the pad. The caller has a reference on the parent, so unref when you're finished with it. MT safe.
-
getPeer
Gets the peer of @pad. This function refs the peer pad so
you need to unref it after use.- Gibt zurück:
- the peer #GstPad. Unref after usage. MT safe.
-
getSingleInternalLink
If there is a single internal link of the given pad, this function will
return it. Otherwise, it will return NULL.- Gibt zurück:
- a #GstPad, or %NULL if @pad has none or more than one internal links. Unref returned pad with gst_object_unref().
-
getStickyEvent
Returns a new reference of the sticky event of type @event_type
from the event.- Parameter:
event_type
- the #GstEventType that should be retrieved.idx
- the index of the event- Gibt zurück:
- a #GstEvent of type @event_type or %NULL when no event of @event_type was on @pad. Unref after usage.
-
getStream
Returns the current #GstStream for the @pad, or %NULL if none has been
set yet, i.e. the pad has not received a stream-start event yet.
This is a convenience wrapper around gst_pad_get_sticky_event() and
gst_event_parse_stream().- Gibt zurück:
- the current #GstStream for @pad, or %NULL. unref the returned stream when no longer needed.
-
getStreamId
Returns the current stream-id for the @pad, or %NULL if none has been
set yet, i.e. the pad has not received a stream-start event yet.
This is a convenience wrapper around gst_pad_get_sticky_event() and
gst_event_parse_stream_start().
The returned stream-id string should be treated as an opaque string, its
contents should not be interpreted.- Gibt zurück:
- a newly-allocated copy of the stream-id for @pad, or %NULL. g_free() the returned string when no longer needed.
-
getTaskState
public int getTaskState()Get @pad task state. If no task is currently
set, #GST_TASK_STOPPED is returned.- Gibt zurück:
- The current state of @pad's task.
-
hasCurrentCaps
public boolean hasCurrentCaps()Check if @pad has caps set on it with a #GST_EVENT_CAPS event.- Gibt zurück:
- %TRUE when @pad has caps associated with it.
-
isActive
public boolean isActive()Query if a pad is active- Gibt zurück:
- %TRUE if the pad is active. MT safe.
-
isBlocked
public boolean isBlocked()Checks if the pad is blocked or not. This function returns the
last requested state of the pad. It is not certain that the pad
is actually blocking at this point (see gst_pad_is_blocking()).- Gibt zurück:
- %TRUE if the pad is blocked. MT safe.
-
isBlocking
public boolean isBlocking()Checks if the pad is blocking or not. This is a guaranteed state
of whether the pad is actually blocking on a #GstBuffer or a #GstEvent.- Gibt zurück:
- %TRUE if the pad is blocking. MT safe.
-
isLinked
public boolean isLinked()Checks if a @pad is linked to another pad or not.- Gibt zurück:
- %TRUE if the pad is linked, %FALSE otherwise. MT safe.
-
iterateInternalLinks
Gets an iterator for the pads to which the given pad is linked to inside
of the parent element.
Each #GstPad element yielded by the iterator will have its refcount increased,
so unref after use.
Free-function: gst_iterator_free- Gibt zurück:
- a new #GstIterator of #GstPad or %NULL when the pad does not have an iterator function configured. Use gst_iterator_free() after usage.
-
iterateInternalLinksDefault
Iterate the list of pads to which the given pad is linked to inside of
the parent element.
This is the default handler, and thus returns an iterator of all of the
pads inside the parent element with opposite direction.
The caller must free this iterator after use with gst_iterator_free().- Parameter:
parent
- the parent of @pad or %NULL- Gibt zurück:
- a #GstIterator of #GstPad, or %NULL if @pad has no parent. Unref each returned pad with gst_object_unref().
-
link
Links the source pad and the sink pad.- Parameter:
sinkpad
- the sink #GstPad to link.- Gibt zurück:
- A result code indicating if the connection worked or what went wrong. MT Safe.
-
linkFull
Links the source pad and the sink pad.
This variant of #gst_pad_link provides a more granular control on the
checks being done when linking. While providing some considerable speedups
the caller of this method must be aware that wrong usage of those flags
can cause severe issues. Refer to the documentation of #GstPadLinkCheck
for more information.
MT Safe.- Parameter:
sinkpad
- the sink #GstPad to link.flags
- the checks to validate when linking- Gibt zurück:
- A result code indicating if the connection worked or what went wrong.
-
linkMaybeGhosting
Links @src to @sink, creating any #GstGhostPad's in between as necessary.
This is a convenience function to save having to create and add intermediate
#GstGhostPad's as required for linking across #GstBin boundaries.
If @src or @sink pads don't have parent elements or do not share a common
ancestor, the link will fail.- Parameter:
sink
- a #GstPad- Gibt zurück:
- whether the link succeeded.
-
linkMaybeGhostingFull
Links @src to @sink, creating any #GstGhostPad's in between as necessary.
This is a convenience function to save having to create and add intermediate
#GstGhostPad's as required for linking across #GstBin boundaries.
If @src or @sink pads don't have parent elements or do not share a common
ancestor, the link will fail.
Calling gst_pad_link_maybe_ghosting_full() with
@flags == %GST_PAD_LINK_CHECK_DEFAULT is the recommended way of linking
pads with safety checks applied.- Parameter:
sink
- a #GstPadflags
- some #GstPadLinkCheck flags- Gibt zurück:
- whether the link succeeded.
-
markReconfigure
public void markReconfigure()Mark a pad for needing reconfiguration. The next call to
gst_pad_check_reconfigure() will return %TRUE after this call. -
needsReconfigure
public boolean needsReconfigure()Check the #GST_PAD_FLAG_NEED_RECONFIGURE flag on @pad and return %TRUE
if the flag was set.- Gibt zurück:
- %TRUE is the GST_PAD_FLAG_NEED_RECONFIGURE flag is set on @pad.
-
pauseTask
public boolean pauseTask()Pause the task of @pad. This function will also wait until the
function executed by the task is finished if this function is not
called from the task function.- Gibt zurück:
- a %TRUE if the task could be paused or %FALSE when the pad has no task.
-
peerQuery
Performs gst_pad_query() on the peer of @pad.
The caller is responsible for both the allocation and deallocation of
the query structure.- Parameter:
query
- the #GstQuery to perform.- Gibt zurück:
- %TRUE if the query could be performed. This function returns %FALSE if @pad has no peer.
-
peerQueryAcceptCaps
Check if the peer of @pad accepts @caps. If @pad has no peer, this function
returns %TRUE.- Parameter:
caps
- a #GstCaps to check on the pad- Gibt zurück:
- %TRUE if the peer of @pad can accept the caps or @pad has no peer.
-
peerQueryCaps
Gets the capabilities of the peer connected to this pad. Similar to
gst_pad_query_caps().
When called on srcpads @filter contains the caps that
upstream could produce in the order preferred by upstream. When
called on sinkpads @filter contains the caps accepted by
downstream in the preferred order. @filter might be %NULL but
if it is not %NULL the returned caps will be a subset of @filter.- Parameter:
filter
- a #GstCaps filter, or %NULL.- Gibt zurück:
- the caps of the peer pad with incremented ref-count. When there is no peer pad, this function returns @filter or, when @filter is %NULL, ANY caps.
-
proxyQueryAcceptCaps
Checks if all internally linked pads of @pad accepts the caps in @query and
returns the intersection of the results.
This function is useful as a default accept caps query function for an element
that can handle any stream format, but requires caps that are acceptable for
all opposite pads.- Parameter:
query
- an ACCEPT_CAPS #GstQuery.- Gibt zurück:
- %TRUE if @query could be executed
-
proxyQueryCaps
Calls gst_pad_query_caps() for all internally linked pads of @pad and returns
the intersection of the results.
This function is useful as a default caps query function for an element
that can handle any stream format, but requires all its pads to have
the same caps. Two such elements are tee and adder.- Parameter:
query
- a CAPS #GstQuery.- Gibt zurück:
- %TRUE if @query could be executed
-
push
Pushes a buffer to the peer of @pad.
This function will call installed block probes before triggering any
installed data probes.
The function proceeds calling gst_pad_chain() on the peer pad and returns
the value from that function. If @pad has no peer, #GST_FLOW_NOT_LINKED will
be returned.
In all cases, success or failure, the caller loses its reference to @buffer
after calling this function.- Parameter:
buffer
- the #GstBuffer to push returns GST_FLOW_ERROR if not.- Gibt zurück:
- a #GstFlowReturn from the peer pad. MT safe.
-
pushEvent
Sends the event to the peer of the given pad. This function is
mainly used by elements to send events to their peer
elements.
This function takes ownership of the provided event so you should
gst_event_ref() it if you want to reuse the event after this call.- Parameter:
event
- the #GstEvent to send to the pad.- Gibt zurück:
- %TRUE if the event was handled. MT safe.
-
pushList
Pushes a buffer list to the peer of @pad.
This function will call installed block probes before triggering any
installed data probes.
The function proceeds calling the chain function on the peer pad and returns
the value from that function. If @pad has no peer, #GST_FLOW_NOT_LINKED will
be returned. If the peer pad does not have any installed chainlist function
every group buffer of the list will be merged into a normal #GstBuffer and
chained via gst_pad_chain().
In all cases, success or failure, the caller loses its reference to @list
after calling this function.- Parameter:
list
- the #GstBufferList to push returns GST_FLOW_ERROR if not.- Gibt zurück:
- a #GstFlowReturn from the peer pad. MT safe.
-
query
Dispatches a query to a pad. The query should have been allocated by the
caller via one of the type-specific allocation functions. The element that
the pad belongs to is responsible for filling the query with an appropriate
response, which should then be parsed with a type-specific query parsing
function.
Again, the caller is responsible for both the allocation and deallocation of
the query structure.
Please also note that some queries might need a running pipeline to work.- Parameter:
query
- the #GstQuery to perform.- Gibt zurück:
- %TRUE if the query could be performed.
-
queryAcceptCaps
Check if the given pad accepts the caps.- Parameter:
caps
- a #GstCaps to check on the pad- Gibt zurück:
- %TRUE if the pad can accept the caps.
-
queryCaps
Gets the capabilities this pad can produce or consume.
Note that this method doesn't necessarily return the caps set by sending a
gst_event_new_caps() - use gst_pad_get_current_caps() for that instead.
gst_pad_query_caps returns all possible caps a pad can operate with, using
the pad's CAPS query function, If the query fails, this function will return
@filter, if not %NULL, otherwise ANY.
When called on sinkpads @filter contains the caps that
upstream could produce in the order preferred by upstream. When
called on srcpads @filter contains the caps accepted by
downstream in the preferred order. @filter might be %NULL but
if it is not %NULL the returned caps will be a subset of @filter.
Note that this function does not return writable #GstCaps, use
gst_caps_make_writable() before modifying the caps.- Parameter:
filter
- suggested #GstCaps, or %NULL- Gibt zurück:
- the caps of the pad with incremented ref-count.
-
queryDefault
Invokes the default query handler for the given pad.
The query is sent to all pads internally linked to @pad. Note that
if there are many possible sink pads that are internally linked to
@pad, only one will be sent the query.
Multi-sinkpad elements should implement custom query handlers.- Parameter:
parent
- the parent of @pad or %NULLquery
- the #GstQuery to handle.- Gibt zurück:
- %TRUE if the query was performed successfully.
-
removeProbe
public void removeProbe(long id) Remove the probe with @id from @pad.
MT safe.- Parameter:
id
- the probe id to remove
-
sendEvent
Sends the event to the pad. This function can be used
by applications to send events in the pipeline.
If @pad is a source pad, @event should be an upstream event. If @pad is a
sink pad, @event should be a downstream event. For example, you would not
send a #GST_EVENT_EOS on a src pad; EOS events only propagate downstream.
Furthermore, some downstream events have to be serialized with data flow,
like EOS, while some can travel out-of-band, like #GST_EVENT_FLUSH_START. If
the event needs to be serialized with data flow, this function will take the
pad's stream lock while calling its event function.
To find out whether an event type is upstream, downstream, or downstream and
serialized, see #GstEventTypeFlags, gst_event_type_get_flags(),
#GST_EVENT_IS_UPSTREAM, #GST_EVENT_IS_DOWNSTREAM, and
#GST_EVENT_IS_SERIALIZED. Note that in practice that an application or
plugin doesn't need to bother itself with this information; the core handles
all necessary locks and checks.
This function takes ownership of the provided event so you should
gst_event_ref() it if you want to reuse the event after this call.- Parameter:
event
- the #GstEvent to send to the pad.- Gibt zurück:
- %TRUE if the event was handled.
-
setActivateFunctionFull
public void setActivateFunctionFull(Pad.OnPadActivateFunction activate, @Nullable Pointer user_data, Pad.OnDestroyNotify notify) Sets the given activate function for @pad. The activate function will
dispatch to gst_pad_activate_mode() to perform the actual activation.
Only makes sense to set on sink pads.
Call this function if your sink pad can start a pull-based task.- Parameter:
activate
- the #GstPadActivateFunction to set.user_data
- user_data passed to @notifynotify
- notify called when @activate will not be used anymore.
-
setActivatemodeFunctionFull
public void setActivatemodeFunctionFull(Pad.OnPadActivateModeFunction activatemode, @Nullable Pointer user_data, Pad.OnDestroyNotify notify) Sets the given activate_mode function for the pad. An activate_mode function
prepares the element for data passing.- Parameter:
activatemode
- the #GstPadActivateModeFunction to set.user_data
- user_data passed to @notifynotify
- notify called when @activatemode will not be used anymore.
-
setActive
public boolean setActive(boolean active) Activates or deactivates the given pad.
Normally called from within core state change functions.
If @active, makes sure the pad is active. If it is already active, either in
push or pull mode, just return. Otherwise dispatches to the pad's activate
function to perform the actual activation.
If not @active, calls gst_pad_activate_mode() with the pad's current mode
and a %FALSE argument.- Parameter:
active
- whether or not the pad should be active.- Gibt zurück:
- %TRUE if the operation was successful. MT safe.
-
setChainFunctionFull
public void setChainFunctionFull(Pad.OnPadChainFunction chain, @Nullable Pointer user_data, Pad.OnDestroyNotify notify) Sets the given chain function for the pad. The chain function is called to
process a #GstBuffer input buffer. see #GstPadChainFunction for more details.- Parameter:
chain
- the #GstPadChainFunction to set.user_data
- user_data passed to @notifynotify
- notify called when @chain will not be used anymore.
-
setChainListFunctionFull
public void setChainListFunctionFull(Pad.OnPadChainListFunction chainlist, @Nullable Pointer user_data, Pad.OnDestroyNotify notify) Sets the given chain list function for the pad. The chainlist function is
called to process a #GstBufferList input buffer list. See
#GstPadChainListFunction for more details.- Parameter:
chainlist
- the #GstPadChainListFunction to set.user_data
- user_data passed to @notifynotify
- notify called when @chainlist will not be used anymore.
-
setElementPrivate
Set the given private data gpointer on the pad.
This function can only be used by the element that owns the pad.
No locking is performed in this function.- Parameter:
priv
- The private data to attach to the pad.
-
setEventFullFunctionFull
public void setEventFullFunctionFull(Pad.OnPadEventFullFunction event, @Nullable Pointer user_data, Pad.OnDestroyNotify notify) Sets the given event handler for the pad.- Parameter:
event
- the #GstPadEventFullFunction to set.user_data
- user_data passed to @notifynotify
- notify called when @event will not be used anymore.
-
setEventFunctionFull
public void setEventFunctionFull(Pad.OnPadEventFunction event, @Nullable Pointer user_data, Pad.OnDestroyNotify notify) Sets the given event handler for the pad.- Parameter:
event
- the #GstPadEventFunction to set.user_data
- user_data passed to @notifynotify
- notify called when @event will not be used anymore.
-
setIterateInternalLinksFunctionFull
public void setIterateInternalLinksFunctionFull(Pad.OnPadIterIntLinkFunction iterintlink, @Nullable Pointer user_data, Pad.OnDestroyNotify notify) Sets the given internal link iterator function for the pad.- Parameter:
iterintlink
- the #GstPadIterIntLinkFunction to set.user_data
- user_data passed to @notifynotify
- notify called when @iterintlink will not be used anymore.
-
setLinkFunctionFull
public void setLinkFunctionFull(Pad.OnPadLinkFunction link, @Nullable Pointer user_data, Pad.OnDestroyNotify notify) Sets the given link function for the pad. It will be called when
the pad is linked with another pad.
The return value #GST_PAD_LINK_OK should be used when the connection can be
made.
The return value #GST_PAD_LINK_REFUSED should be used when the connection
cannot be made for some reason.
If @link is installed on a source pad, it should call the #GstPadLinkFunction
of the peer sink pad, if present.- Parameter:
link
- the #GstPadLinkFunction to set.user_data
- user_data passed to @notifynotify
- notify called when @link will not be used anymore.
-
setOffset
public void setOffset(long offset) Set the offset that will be applied to the running time of @pad. Upon next
buffer, every sticky events (notably segment) will be pushed again with
their running time adjusted. For that reason this is only reliable on
source pads.- Parameter:
offset
- the offset
-
setQueryFunctionFull
public void setQueryFunctionFull(Pad.OnPadQueryFunction query, @Nullable Pointer user_data, Pad.OnDestroyNotify notify) Set the given query function for the pad.- Parameter:
query
- the #GstPadQueryFunction to set.user_data
- user_data passed to @notifynotify
- notify called when @query will not be used anymore.
-
setUnlinkFunctionFull
public void setUnlinkFunctionFull(Pad.OnPadUnlinkFunction unlink, @Nullable Pointer user_data, Pad.OnDestroyNotify notify) Sets the given unlink function for the pad. It will be called
when the pad is unlinked.
Note that the pad's lock is already held when the unlink
function is called, so most pad functions cannot be called
from within the callback.- Parameter:
unlink
- the #GstPadUnlinkFunction to set.user_data
- user_data passed to @notifynotify
- notify called when @unlink will not be used anymore.
-
startTask
public boolean startTask(Pad.OnTaskFunction func, @Nullable Pointer user_data, Pad.OnDestroyNotify notify) Starts a task that repeatedly calls @func with @user_data. This function
is mostly used in pad activation functions to start the dataflow.
The #GST_PAD_STREAM_LOCK of @pad will automatically be acquired
before @func is called.- Parameter:
func
- the task function to calluser_data
- user data passed to the task functionnotify
- called when @user_data is no longer referenced- Gibt zurück:
- a %TRUE if the task could be started.
-
stopTask
public boolean stopTask()Stop the task of @pad. This function will also make sure that the
function executed by the task will effectively stop if not called
from the GstTaskFunction.
This function will deadlock if called from the GstTaskFunction of
the task. Use gst_task_pause() instead.
Regardless of whether the pad has a task, the stream lock is acquired and
released so as to ensure that streaming through this pad has finished.- Gibt zurück:
- a %TRUE if the task could be stopped or %FALSE on error.
-
storeStickyEvent
Store the sticky @event on @pad- Parameter:
event
- a #GstEvent- Gibt zurück:
- #GST_FLOW_OK on success, #GST_FLOW_FLUSHING when the pad was flushing or #GST_FLOW_EOS when the pad was EOS.
-
unlink
Unlinks the source pad from the sink pad. Will emit the #GstPad::unlinked
signal on both pads.- Parameter:
sinkpad
- the sink #GstPad to unlink.- Gibt zurück:
- %TRUE if the pads were unlinked. This function returns %FALSE if the pads were not linked together. MT safe.
-
useFixedCaps
public void useFixedCaps()A helper function you can use that sets the FIXED_CAPS flag
This way the default CAPS query will always return the negotiated caps
or in case the pad is not negotiated, the padtemplate caps.
The negotiated caps are the caps of the last CAPS event that passed on the
pad. Use this function on a pad that, once it negotiated to a CAPS, cannot
be renegotiated to something else. -
onLinked
Connect to signal "linked".
SeePad.OnLinked.onLinked(ch.bailu.gtk.gst.Pad)
for signal description.
FieldSIGNAL_ON_LINKED
contains original signal name and can be used as resource reference.- Parameter:
signal
- callback function (lambda).- Gibt zurück:
SignalHandler
. Can be used to disconnect signal and to release callback function.
-
onUnlinked
Connect to signal "unlinked".
SeePad.OnUnlinked.onUnlinked(ch.bailu.gtk.gst.Pad)
for signal description.
FieldSIGNAL_ON_UNLINKED
contains original signal name and can be used as resource reference.- Parameter:
signal
- callback function (lambda).- Gibt zurück:
SignalHandler
. Can be used to disconnect signal and to release callback function.
-
linkGetName
Gets a string representing the given pad-link return.- Parameter:
ret
- a #GstPadLinkReturn to get the name of.- Gibt zurück:
- a static string with the name of the pad-link return.
-
getTypeID
public static long getTypeID() -
getParentTypeID
public static long getParentTypeID() -
getTypeSize
-
getParentTypeSize
-
getInstanceSize
public static int getInstanceSize()
-