gst.pad
Module for [Pad] class
Types 3
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.Pad.newFromTemplate 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.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.Element.getStaticPad, the pads can be linked with gst.pad.Pad.link. (For quick links, you can also use gst.element.Element.link, which will make the obvious link for you if it's straightforward.). Pads can be unlinked again with gst.pad.Pad.unlink. gst.pad.Pad.getPeer 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.Pad.setActive.
gst.pad.Pad.query and gst.pad.Pad.peerQuery can be used to query various properties of the pad and the stream.
To send a #GstEvent on a pad, use gst.pad.Pad.sendEvent and gst.pad.Pad.pushEvent. Some events will be sticky on the pad, meaning that after they pass on the pad they can be queried later with gst.pad.Pad.getStickyEvent and gst.pad.Pad.stickyEventsForeach. gst.pad.Pad.getCurrentCaps and gst.pad.Pad.hasCurrentCaps are convenience functions to query the current sticky CAPS event on a pad.
GstElements will use gst.pad.Pad.push and gst.pad.Pad.pullRange 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.Pad.addProbe. gst.pad.Pad.isBlocked can be used to check if a block probe is installed on the pad. gst.pad.Pad.isBlocking checks if the blocking probe is currently blocking the pad. gst.pad.Pad.removeProbe 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.Pad.getOffset. This offset will be applied to the running_time of all data passing over the pad. gst.pad.Pad.setOffset can be used to change the offset.
Convenience functions exist to start, pause and stop the task on a pad with gst.pad.Pad.startTask, gst.pad.Pad.pauseTask and gst.pad.Pad.stopTask respectively.
long offset() @property nothrowGet `offset` property. Returns: The offset that will be applied to the running time of the pad.void offset(long propval) @property nothrowSet `offset` property. Params: propval = The offset that will be applied to the running time of the pad.gst.pad.Pad newFromStaticTemplate(gst.static_pad_template.StaticPadTemplate templ, string name) static nothrowCreates 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...gst.pad.Pad newFromTemplate(gst.pad_template.PadTemplate templ, string name = null) static nothrowCreates 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...string linkGetName(gst.types.PadLinkReturn ret) static nothrowGets a string representing the given pad-link return.bool activateMode(gst.types.PadMode mode, bool active) nothrowActivates or deactivates the given pad in mode via dispatching to the pad's activatemodefunc. For use from within pad activation functions only.gulong addProbe(gst.types.PadProbeType mask, gst.types.PadProbeCallback callback) nothrowBe notified of different states of pads. The provided callback is called for every state that matches mask.bool canLink(gst.pad.Pad sinkpad) nothrowChecks if the source pad and the sink pad are compatible so they can be linked.bool checkReconfigure() nothrowCheck and clear the #GST_PAD_FLAG_NEED_RECONFIGURE flag on pad and return true if the flag was set. Returns: true is the GST_PAD_FLAG_NEED_RECONFIGURE flag was set on pad.string createStreamId(gst.element.Element parent, string streamId = null) nothrowCreates 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...bool eventDefault(gst.object.ObjectWrap parent, gst.event.Event event) nothrowInvokes the default event handler for the given pad.bool forward(gst.types.PadForwardFunction forward) nothrowCalls 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.gst.caps.Caps getAllowedCaps() nothrowGets the capabilities of the allowed media types that can flow through pad and its peer.gst.caps.Caps getCurrentCaps() nothrowGets the capabilities currently configured on pad with the last #GST_EVENT_CAPS event. Returns: the current caps of the pad with incremented ref-count or null when pad has no caps. Unref after usage.gst.types.PadDirection getDirection() nothrowGets the direction of the pad. The direction of the pad is decided at construction time so this function does not take the LOCK. Returns: the #GstPadDirection of the pad.void * getElementPrivate() nothrowGets the private data of a pad. No locking is performed in this function. Returns: a #gpointer to the private data.gst.types.FlowReturn getLastFlowReturn() nothrowGets the #GstFlowReturn return from the last data passed by this pad. Returns:long getOffset() nothrowGet the offset applied to the running time of pad. pad has to be a source pad. Returns: the offset.gst.pad_template.PadTemplate getPadTemplate() nothrowGets the template for pad. Returns: the #GstPadTemplate from which this pad was instantiated, or null if this pad has no template. Unref after usage.gst.caps.Caps getPadTemplateCaps() nothrowGets the capabilities for pad's template. Returns: the #GstCaps of this pad template. Unref after usage.gst.element.Element getParentElement() nothrowGets the parent of pad, cast to a #GstElement. If a pad has no parent or its parent is not an element, return null. Returns: the parent of the pad. The caller has a reference on the parent, so unre...gst.pad.Pad getPeer() nothrowGets the peer of pad. This function refs the peer pad so you need to unref it after use. Returns: the peer #GstPad. Unref after usage.gst.types.FlowReturn getRange(ulong offset, uint size, out gst.buffer.Buffer buffer) nothrowWhen pad is flushing this function returns #GST_FLOW_FLUSHING immediately and buffer is null.gst.pad.Pad getSingleInternalLink() nothrowIf there is a single internal link of the given pad, this function will return it. Otherwise, it will return NULL. Returns: a #GstPad, or null if pad has none or more than one internal links. Unref...gst.event.Event getStickyEvent(gst.types.EventType eventType, uint idx) nothrowReturns a new reference of the sticky event of type event_type from the event.gst.stream.Stream getStream() nothrowReturns 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.string getStreamId() nothrowReturns 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.gst.types.TaskState getTaskState() nothrowGet pad task state. If no task is currently set, #GST_TASK_STOPPED is returned. Returns: The current state of pad's task.bool hasCurrentCaps() nothrowCheck if pad has caps set on it with a #GST_EVENT_CAPS event. Returns: true when pad has caps associated with it.bool isBlocked() nothrowChecks 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.Pad.isBlocking]). Ret...bool isBlocking() nothrowChecks 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. Returns: true if the pad is blocking.bool isLinked() nothrowChecks if a pad is linked to another pad or not. Returns: true if the pad is linked, false otherwise.gst.iterator.Iterator iterateInternalLinks() nothrowGets an iterator for the pads to which the given pad is linked to inside of the parent element.gst.iterator.Iterator iterateInternalLinksDefault(gst.object.ObjectWrap parent = null) nothrowIterate 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 wit...gst.types.PadLinkReturn linkFull(gst.pad.Pad sinkpad, gst.types.PadLinkCheck flags) nothrowLinks the source pad and the sink pad.bool linkMaybeGhosting(gst.pad.Pad sink) nothrowLinks src to sink, creating any #GstGhostPad's in between as necessary.bool linkMaybeGhostingFull(gst.pad.Pad sink, gst.types.PadLinkCheck flags) nothrowLinks src to sink, creating any #GstGhostPad's in between as necessary.void markReconfigure() nothrowMark a pad for needing reconfiguration. The next call to [gst.pad.Pad.checkReconfigure] will return true after this call.bool needsReconfigure() nothrowCheck the #GST_PAD_FLAG_NEED_RECONFIGURE flag on pad and return true if the flag was set. Returns: true is the GST_PAD_FLAG_NEED_RECONFIGURE flag is set on pad.bool pauseTask() nothrowPause 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. Returns: a true if the task could be p...bool peerQueryAcceptCaps(gst.caps.Caps caps) nothrowCheck if the peer of pad accepts caps. If pad has no peer, this function returns true.gst.caps.Caps peerQueryCaps(gst.caps.Caps filter = null) nothrowGets the capabilities of the peer connected to this pad. Similar to [gst.pad.Pad.queryCaps].bool peerQueryConvert(gst.types.Format srcFormat, long srcVal, gst.types.Format destFormat, out long destVal) nothrowQueries the peer pad of a given sink pad to convert src_val in src_format to dest_format.bool peerQueryDuration(gst.types.Format format, out long duration) nothrowQueries the peer pad of a given sink pad for the total stream duration.bool peerQueryPosition(gst.types.Format format, out long cur) nothrowQueries the peer of a given sink pad for the stream position.bool proxyQueryAcceptCaps(gst.query.Query query) nothrowChecks if all internally linked pads of pad accepts the caps in query and returns the intersection of the results.bool proxyQueryCaps(gst.query.Query query) nothrowCalls [gst.pad.Pad.queryCaps] for all internally linked pads of pad and returns the intersection of the results.gst.types.FlowReturn pullRange(ulong offset, uint size, out gst.buffer.Buffer buffer) nothrowPulls a buffer from the peer pad or fills up a provided buffer.bool pushEvent(gst.event.Event event) nothrowSends the event to the peer of the given pad. This function is mainly used by elements to send events to their peer elements.gst.types.FlowReturn pushList(gst.buffer_list.BufferList list) nothrowPushes a buffer list to the peer of pad.bool query(gst.query.Query query) nothrowDispatches 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...gst.caps.Caps queryCaps(gst.caps.Caps filter = null) nothrowGets the capabilities this pad can produce or consume. Note that this method doesn't necessarily return the caps set by sending a [gst.event.Event.newCaps] - use [gst.pad.Pad.getCurrentCaps] for th...bool queryConvert(gst.types.Format srcFormat, long srcVal, gst.types.Format destFormat, out long destVal) nothrowQueries a pad to convert src_val in src_format to dest_format.bool queryDefault(gst.object.ObjectWrap parent, gst.query.Query query) nothrowInvokes 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 o...bool queryDuration(gst.types.Format format, out long duration) nothrowQueries a pad for the total stream duration.bool queryPosition(gst.types.Format format, out long cur) nothrowQueries a pad for the stream position.bool sendEvent(gst.event.Event event) nothrowSends the event to the pad. This function can be used by applications to send events in the pipeline.bool setActive(bool active) nothrowActivates or deactivates the given pad. Normally called from within core state change functions.void setElementPrivate(void * priv = null) nothrowSet 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.bool startTask(gst.types.TaskFunction func) nothrowStarts 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 acquir...void stickyEventsForeach(gst.types.PadStickyEventsForeachFunction foreachFunc) nothrowIterates all sticky events on pad and calls foreach_func for every event. If foreach_func returns false the iteration is immediately stopped.bool stopTask() nothrowStop 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.bool unlink(gst.pad.Pad sinkpad) nothrowUnlinks the source pad from the sink pad. Will emit the #GstPad::unlinked signal on both pads.void useFixedCaps() nothrowA 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.gulong connectLinked(T)(T callback, Flag!"After" after = No.After) if (isCallable!T
&& is(ReturnType!T == void)
&& (Parameters!T.length < 1 || (ParameterStorageClassTuple!T[0] == ParameterStorageClass.none && is(Parameters!T[0] : gst.pad.Pad)))
&& (Parameters!T.length < 2 || (ParameterStorageClassTuple!T[1] == ParameterStorageClass.none && is(Parameters!T[1] : gst.pad.Pad)))
&& Parameters!T.length < 3) nothrowConnect to `Linked` signal.gulong connectUnlinked(T)(T callback, Flag!"After" after = No.After) if (isCallable!T
&& is(ReturnType!T == void)
&& (Parameters!T.length < 1 || (ParameterStorageClassTuple!T[0] == ParameterStorageClass.none && is(Parameters!T[0] : gst.pad.Pad)))
&& (Parameters!T.length < 2 || (ParameterStorageClassTuple!T[1] == ParameterStorageClass.none && is(Parameters!T[1] : gst.pad.Pad)))
&& Parameters!T.length < 3) nothrowConnect to `Unlinked` signal.this(string name, gst.types.PadDirection direction)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 ...Fluent builder implementation template for gst.pad.Pad
T direction(gst.types.PadDirection propval) nothrowT offset(long propval) nothrowSet `offset` property. Params: propval = The offset that will be applied to the running time of the pad. Returns: Builder instance for fluent chainingT template_(gst.pad_template.PadTemplate propval) nothrowFluent builder for gst.pad.Pad