Gst.Pad¶
| Subclasses: | Gst.ProxyPad | 
|---|
Methods¶
| Inherited: | Gst.Object (27), GObject.Object (37) | 
|---|---|
| Structs: | GObject.ObjectClass (5) | 
Properties¶
| Inherited: | Gst.Object (2) | 
|---|
| Name | Type | Flags | Short Description | 
|---|---|---|---|
| caps | Gst.Caps | r | The capabilities of the pad | 
| direction | Gst.PadDirection | r/w/co | The direction of the pad | 
| offset | int | r/w | The running time offset of the pad | 
| template | Gst.PadTemplate | r/w | The Gst.PadTemplateof this pad | 
Signals¶
| Inherited: | Gst.Object (1), GObject.Object (1) | 
|---|
| Name | Short Description | 
|---|---|
| linked | Signals that a pad has been linked to the peer pad. | 
| unlinked | Signals that a pad has been unlinked from the peer pad. | 
Fields¶
| Inherited: | Gst.Object (1), GObject.Object (1) | 
|---|
| Name | Type | Access | Description | 
|---|---|---|---|
| activatedata | object | r | |
| activatefunc | Gst.PadActivateFunction | r | |
| activatemodedata | object | r | |
| activatemodefunc | Gst.PadActivateModeFunction | r | |
| activatemodenotify | GLib.DestroyNotify | r | |
| activatenotify | GLib.DestroyNotify | r | |
| block_cond | GLib.Cond | r | |
| chaindata | object | r | |
| chainfunc | Gst.PadChainFunction | r | |
| chainlistdata | object | r | |
| chainlistfunc | Gst.PadChainListFunction | r | |
| chainlistnotify | GLib.DestroyNotify | r | |
| chainnotify | GLib.DestroyNotify | r | |
| direction | Gst.PadDirection | r | the direction of the pad, cannot change after creating the pad. | 
| element_private | object | r | private data owned by the parent element | 
| eventdata | object | r | |
| eventfunc | Gst.PadEventFunction | r | |
| eventnotify | GLib.DestroyNotify | r | |
| getrangedata | object | r | |
| getrangefunc | Gst.PadGetRangeFunction | r | |
| getrangenotify | GLib.DestroyNotify | r | |
| iterintlinkdata | object | r | |
| iterintlinkfunc | Gst.PadIterIntLinkFunction | r | |
| iterintlinknotify | GLib.DestroyNotify | r | |
| linkdata | object | r | |
| linkfunc | Gst.PadLinkFunction | r | |
| linknotify | GLib.DestroyNotify | r | |
| mode | Gst.PadMode | r | |
| num_blocked | int | r | |
| num_probes | int | r | |
| object | Gst.Object | r | |
| offset | int | r | |
| padtemplate | Gst.PadTemplate | r | padtemplate for this pad | 
| peer | Gst.Pad | r | |
| probes | GLib.HookList | r | |
| querydata | object | r | |
| queryfunc | Gst.PadQueryFunction | r | |
| querynotify | GLib.DestroyNotify | r | |
| stream_rec_lock | GLib.RecMutex | r | |
| task | Gst.Task | r | |
| unlinkdata | object | r | |
| unlinkfunc | Gst.PadUnlinkFunction | r | |
| unlinknotify | GLib.DestroyNotify | r | 
Class Details¶
- 
class Gst.Pad(**kwargs)¶
- Bases: - Gst.Object- Abstract: - No - Structure: - Gst.PadClass- A - Gst.Elementis linked to other elements via “pads”, which are extremely light-weight generic link points.- Pads have a - Gst.PadDirection, source pads produce data, sink pads consume data.- Pads are typically created from a - Gst.PadTemplatewith- Gst.Pad.new_from_template() and are then added to a- Gst.Element. 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- None, then a guaranteed unique name will be assigned to it.- A - Gst.Elementcreating 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 - Gst.Elementthat 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 - Gst.Eventon 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.- 
classmethod link_get_name(ret)[source]¶
- Parameters: - ret ( - Gst.PadLinkReturn) – a- Gst.PadLinkReturnto get the name of.- Returns: - a static string with the name of the pad-link return. - Return type: - str- Gets a string representing the given pad-link return. - New in version 1.4. 
 - 
classmethod new(name, direction)[source]¶
- Parameters: - name (strorNone) – the name of the new pad.
- direction (Gst.PadDirection) – theGst.PadDirectionof the pad.
 - Returns: - a new - Gst.Pad.- MT safe. - Return type: - Creates a new pad with the given name in the given direction. If name is - None, 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.
- name (
 - 
classmethod new_from_static_template(templ, name)[source]¶
- Parameters: - templ (Gst.StaticPadTemplate) – theGst.StaticPadTemplateto use
- name (str) – the name of the pad
 - Returns: - a new - Gst.Pad.- Return type: - Creates a new pad with the given name from the given static template. If name is - None, 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.
- templ (
 - 
classmethod new_from_template(templ, name)[source]¶
- Parameters: - templ (Gst.PadTemplate) – the pad template to use
- name (strorNone) – the name of the pad
 - Returns: - a new - Gst.Pad.- Return type: - Creates a new pad with the given name from the given template. If name is - None, 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.
- templ (
 - 
activate_mode(mode, active)[source]¶
- Parameters: - mode (Gst.PadMode) – the requested activation mode
- active (bool) – whether or not the pad should be active.
 - Returns: - Trueif the operation was successful.- MT safe. - Return type: - 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. 
- mode (
 - 
add_probe(mask, callback, *user_data)[source]¶
- Parameters: - mask (Gst.PadProbeType) – the probe mask
- callback (Gst.PadProbeCallback) –Gst.PadProbeCallbackthat will be called with notifications of the pad state
- user_data (objectorNone) – user data passed to the callback
 - Returns: - 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.PadProbeType.IDLEit can happen that the probe can be run immediately and if the probe returns- Gst.PadProbeReturn.REMOVEthis functions returns 0.- MT safe. - Return type: - 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.PadProbeType.BLOCKprobes are called, then others, then finally- Gst.PadProbeType.IDLE. The only exception here are- Gst.PadProbeType.IDLEprobes 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.
- mask (
 - 
can_link(sinkpad)[source]¶
- Parameters: - sinkpad ( - Gst.Pad) – the sink- Gst.Pad.- Returns: - Trueif the pads can be linked.- Return type: - bool- Checks if the source pad and the sink pad are compatible so they can be linked. 
 - 
chain(buffer)[source]¶
- Parameters: - buffer ( - Gst.Buffer) – the- Gst.Bufferto send, return- Gst.FlowReturn.ERRORif not.- Returns: - a - Gst.FlowReturnfrom the pad.- MT safe. - Return type: - Gst.FlowReturn- Chain a buffer to self. - The function returns - Gst.FlowReturn.FLUSHINGif the pad was flushing.- If the buffer type is not acceptable for self (as negotiated with a preceding - Gst.EventType.CAPSevent), this function returns- Gst.FlowReturn.NOT_NEGOTIATED.- The function proceeds calling the chain function installed on self (see gst_pad_set_chain_function()) and the return value of that function is returned to the caller. - Gst.FlowReturn.NOT_SUPPORTEDis returned if self has no chain function.- In all cases, success or failure, the caller loses its reference to buffer after calling this function. 
 - 
chain_list(list)[source]¶
- Parameters: - list ( - Gst.BufferList) – the- Gst.BufferListto send, return- Gst.FlowReturn.ERRORif not.- Returns: - a - Gst.FlowReturnfrom the pad.- Return type: - Gst.FlowReturn- Chain a bufferlist to self. - The function returns - Gst.FlowReturn.FLUSHINGif the pad was flushing.- If self was not negotiated properly with a CAPS event, this function returns - Gst.FlowReturn.NOT_NEGOTIATED.- The function proceeds calling the chainlist function installed on self (see gst_pad_set_chain_list_function()) and the return value of that function is returned to the caller. - Gst.FlowReturn.NOT_SUPPORTEDis returned if self has no chainlist function.- In all cases, success or failure, the caller loses its reference to list after calling this function. - MT safe. 
 - 
check_reconfigure()[source]¶
- Returns: - Trueis the- Gst.PadFlags.NEED_RECONFIGUREflag was set on self.- Return type: - bool- Check and clear the - Gst.PadFlags.NEED_RECONFIGUREflag on self and return- Trueif the flag was set.
 - 
create_stream_id(parent, stream_id)[source]¶
- Parameters: - parent (Gst.Element) – ParentGst.Elementof self
- stream_id (strorNone) – The stream-id
 - Returns: - A stream-id for self. - GLib.free() after usage.- Return type: - Creates a stream-id for the source - Gst.Padself by combining the upstream information with the optional stream_id of the stream of self. self must have a parent- Gst.Elementand which must have zero or one sinkpad. stream_id can only be- Noneif the parent element of self 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. 
- parent (
 - 
event_default(parent, event)[source]¶
- Parameters: - parent (Gst.ObjectorNone) – the parent of self orNone
- event (Gst.Event) – theGst.Eventto handle.
 - Returns: - Trueif the event was sent successfully.- Return type: - Invokes the default event handler for the given pad. - The EOS event will pause the task associated with self before it is forwarded to all internally linked pads, - The event is sent to all pads internally linked to self. This function takes ownership of event. 
- parent (
 - 
forward(forward, *user_data)[source]¶
- Parameters: - forward (Gst.PadForwardFunction) – aGst.PadForwardFunction
- user_data (objectorNone) – user data passed to forward
 - Returns: - Return type: - Calls forward for all internally linked pads of self. 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.
- forward (
 - 
get_allowed_caps()[source]¶
- Returns: - the allowed - Gst.Capsof the pad link. Unref the caps when you no longer need it. This function returns- Nonewhen self has no peer.- MT safe. - Return type: - Gst.Capsor- None- Gets the capabilities of the allowed media types that can flow through self and its peer. - The allowed capabilities is calculated as the intersection of the results of calling - Gst.Pad.query_caps() on self and its peer. The caller owns a reference on the resulting caps.
 - 
get_current_caps()[source]¶
- Returns: - the current caps of the pad with incremented ref-count or - Nonewhen pad has no caps. Unref after usage.- Return type: - Gst.Capsor- None- Gets the capabilities currently configured on self with the last - Gst.EventType.CAPSevent.
 - 
get_direction()[source]¶
- Returns: - the - Gst.PadDirectionof the pad.- MT safe. - Return type: - Gst.PadDirection- Gets the direction of the pad. The direction of the pad is decided at construction time so this function does not take the LOCK. 
 - 
get_element_private()[source]¶
- Returns: - a - objectto the private data.- Return type: - objector- None- Gets the private data of a pad. No locking is performed in this function. 
 - 
get_last_flow_return()[source]¶
- Return type: - Gst.FlowReturn- Gets the - Gst.FlowReturnreturn from the last data passed by this pad.- New in version 1.4. 
 - 
get_offset()[source]¶
- Returns: - the offset. - Return type: - int- Get the offset applied to the running time of self. self has to be a source pad. 
 - 
get_pad_template()[source]¶
- Returns: - the - Gst.PadTemplatefrom which this pad was instantiated, or- Noneif this pad has no template. Unref after usage.- Return type: - Gst.PadTemplateor- None- Gets the template for self. 
 - 
get_pad_template_caps()[source]¶
- Returns: - the - Gst.Capsof this pad template. Unref after usage.- Return type: - Gst.Caps- Gets the capabilities for self’s template. 
 - 
get_parent_element()[source]¶
- Returns: - the parent of the pad. The caller has a reference on the parent, so unref when you’re finished with it. - MT safe. - Return type: - Gst.Elementor- None- Gets the parent of self, cast to a - Gst.Element. If a self has no parent or its parent is not an element, return- None.
 - 
get_peer()[source]¶
- Returns: - the peer - Gst.Pad. Unref after usage.- MT safe. - Return type: - Gst.Pador- None- Gets the peer of self. This function refs the peer pad so you need to unref it after use. 
 - 
get_range(offset, size)[source]¶
- Parameters: - Returns: - a - Gst.FlowReturnfrom the pad.- MT safe. - buffer: - a pointer to hold the - Gst.Buffer, returns- Gst.FlowReturn.ERRORif- None.- Return type: - ( - Gst.FlowReturn, buffer:- Gst.Buffer)- When self is flushing this function returns - Gst.FlowReturn.FLUSHINGimmediately and buffer is- None.- Calls the getrange function of self, see - Gst.PadGetRangeFunctionfor a description of a getrange function. If self has no getrange function installed (see gst_pad_set_getrange_function()) this function returns- Gst.FlowReturn.NOT_SUPPORTED.- If buffer points to a variable holding - None, a valid new- Gst.Bufferwill be placed in buffer when this function returns- Gst.FlowReturn.OK. The new buffer must be freed with gst_buffer_unref() after usage.- When buffer points to a variable that points to a valid - Gst.Buffer, the buffer will be filled with the result data when this function returns- Gst.FlowReturn.OK. If the provided buffer is larger than size, only size bytes will be filled in the result buffer and its size will be updated accordingly.- Note that less than size bytes can be returned in buffer when, for example, an EOS condition is near or when buffer is not large enough to hold size bytes. The caller should check the result buffer size to get the result size. - When this function returns any other result value than - Gst.FlowReturn.OK, buffer will be unchanged.- This is a lowlevel function. Usually - Gst.Pad.pull_range() is used.
 - 
get_single_internal_link()[source]¶
- Returns: - a - Gst.Pad, or- Noneif self has none or more than one internal links. Unref returned pad with- Gst.Object.unref().- Return type: - Gst.Pador- None- If there is a single internal link of the given pad, this function will return it. Otherwise, it will return - None.- New in version 1.18. 
 - 
get_sticky_event(event_type, idx)[source]¶
- Parameters: - event_type (Gst.EventType) – theGst.EventTypethat should be retrieved.
- idx (int) – the index of the event
 - Returns: - a - Gst.Eventof type event_type or- Nonewhen no event of event_type was on self. Unref after usage.- Return type: - Returns a new reference of the sticky event of type event_type from the event. 
- event_type (
 - 
get_stream()[source]¶
- Returns: - the current - Gst.Streamfor self, or- None. unref the returned stream when no longer needed.- Return type: - Gst.Streamor- None- Returns the current - Gst.Streamfor the self, or- Noneif 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().- New in version 1.10. 
 - 
get_stream_id()[source]¶
- Returns: - a newly-allocated copy of the stream-id for self, or - None.- GLib.free() the returned string when no longer needed.- Return type: - stror- None- Returns the current stream-id for the self, or - Noneif 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. - New in version 1.2. 
 - 
get_task_state()[source]¶
- Returns: - The current state of self’s task. - Return type: - Gst.TaskState- Get self task state. If no task is currently set, - Gst.TaskState.STOPPEDis returned.- New in version 1.12. 
 - 
has_current_caps()[source]¶
- Returns: - Truewhen self has caps associated with it.- Return type: - bool- Check if self has caps set on it with a - Gst.EventType.CAPSevent.
 - 
is_active()[source]¶
- Returns: - Trueif the pad is active.- MT safe. - Return type: - bool- Query if a pad is active 
 - 
is_blocked()[source]¶
- Returns: - Trueif the pad is blocked.- MT safe. - Return type: - bool- 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()).
 - 
is_blocking()[source]¶
- Returns: - Trueif the pad is blocking.- MT safe. - Return type: - bool- Checks if the pad is blocking or not. This is a guaranteed state of whether the pad is actually blocking on a - Gst.Bufferor a- Gst.Event.
 - 
is_linked()[source]¶
- Returns: - Trueif the pad is linked,- Falseotherwise.- MT safe. - Return type: - bool- Checks if a self is linked to another pad or not. 
 - 
iterate_internal_links()[source]¶
- Returns: - a new - Gst.Iteratorof- Gst.Pador- Nonewhen the pad does not have an iterator function configured. Use- Gst.Iterator.free() after usage.- Return type: - Gst.Iteratoror- None- Gets an iterator for the pads to which the given pad is linked to inside of the parent element. - Each - Gst.Padelement yielded by the iterator will have its refcount increased, so unref after use.- Free-function: - Gst.Iterator.free
 - 
iterate_internal_links_default(parent)[source]¶
- Parameters: - parent ( - Gst.Objector- None) – the parent of self or- None- Returns: - a - Gst.Iteratorof- Gst.Pad, or- Noneif self has no parent. Unref each returned pad with- Gst.Object.unref().- Return type: - Gst.Iteratoror- None- 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().
 - 
link(sinkpad)[source]¶
- Parameters: - sinkpad ( - Gst.Pad) – the sink- Gst.Padto link.- Returns: - A result code indicating if the connection worked or what went wrong. - MT Safe. - Return type: - Gst.PadLinkReturn- Links the source pad and the sink pad. 
 - 
link_full(sinkpad, flags)[source]¶
- Parameters: - sinkpad (Gst.Pad) – the sinkGst.Padto link.
- flags (Gst.PadLinkCheck) – the checks to validate when linking
 - Returns: - A result code indicating if the connection worked or what went wrong. - Return type: - Links the source pad and the sink pad. - This variant of - Gst.Pad.linkprovides 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- Gst.PadLinkCheckfor more information.- MT Safe. 
- sinkpad (
 - 
link_maybe_ghosting(sink)[source]¶
- Parameters: - sink ( - Gst.Pad) – a- Gst.Pad- Returns: - whether the link succeeded. - Return type: - bool- Links self to sink, creating any - Gst.GhostPad’s in between as necessary.- This is a convenience function to save having to create and add intermediate - Gst.GhostPad’s as required for linking across- Gst.Binboundaries.- If self or sink pads don’t have parent elements or do not share a common ancestor, the link will fail. - New in version 1.10. 
 - 
link_maybe_ghosting_full(sink, flags)[source]¶
- Parameters: - sink (Gst.Pad) – aGst.Pad
- flags (Gst.PadLinkCheck) – someGst.PadLinkCheckflags
 - Returns: - whether the link succeeded. - Return type: - Links self to sink, creating any - Gst.GhostPad’s in between as necessary.- This is a convenience function to save having to create and add intermediate - Gst.GhostPad’s as required for linking across- Gst.Binboundaries.- If self 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.PadLinkCheck.DEFAULTis the recommended way of linking pads with safety checks applied.- New in version 1.10. 
- sink (
 - 
mark_reconfigure()[source]¶
- Mark a pad for needing reconfiguration. The next call to - Gst.Pad.check_reconfigure() will return- Trueafter this call.
 - 
needs_reconfigure()[source]¶
- Returns: - Trueis the- Gst.PadFlags.NEED_RECONFIGUREflag is set on self.- Return type: - bool- Check the - Gst.PadFlags.NEED_RECONFIGUREflag on self and return- Trueif the flag was set.
 - 
pause_task()[source]¶
- Returns: - a - Trueif the task could be paused or- Falsewhen the pad has no task.- Return type: - bool- Pause the task of self. This function will also wait until the function executed by the task is finished if this function is not called from the task function. 
 - 
peer_query(query)[source]¶
- Parameters: - query ( - Gst.Query) – the- Gst.Queryto perform.- Returns: - Trueif the query could be performed. This function returns- Falseif self has no peer.- Return type: - bool- Performs - Gst.Pad.query() on the peer of self.- The caller is responsible for both the allocation and deallocation of the query structure. 
 - 
peer_query_accept_caps(caps)[source]¶
- Parameters: - caps ( - Gst.Caps) – a- Gst.Capsto check on the pad- Returns: - Trueif the peer of self can accept the caps or self has no peer.- Return type: - bool- Check if the peer of self accepts caps. If self has no peer, this function returns - True.
 - 
peer_query_caps(filter)[source]¶
- Parameters: - filter ( - Gst.Capsor- None) – a- Gst.Capsfilter, or- None.- Returns: - the caps of the peer pad with incremented ref-count. When there is no peer pad, this function returns filter or, when filter is - None, ANY caps.- Return type: - Gst.Caps- 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 - Nonebut if it is not- Nonethe returned caps will be a subset of filter.
 - 
peer_query_convert(src_format, src_val, dest_format)[source]¶
- Parameters: - src_format (Gst.Format) – aGst.Formatto convert from.
- src_val (int) – a value to convert.
- dest_format (Gst.Format) – theGst.Formatto convert to.
 - Returns: - Trueif the query could be performed.- dest_val: - a pointer to the result. - Return type: - Queries the peer pad of a given sink pad to convert src_val in src_format to dest_format. 
- src_format (
 - 
peer_query_duration(format)[source]¶
- Parameters: - format ( - Gst.Format) – the- Gst.Formatrequested- Returns: - Trueif the query could be performed.- duration: - a location in which to store the total duration, or - None.- Return type: - ( - bool, duration:- int)- Queries the peer pad of a given sink pad for the total stream duration. 
 - 
peer_query_position(format)[source]¶
- Parameters: - format ( - Gst.Format) – the- Gst.Formatrequested- Returns: - Trueif the query could be performed.- cur: - a location in which to store the current position, or - None.- Return type: - ( - bool, cur:- int)- Queries the peer of a given sink pad for the stream position. 
 - 
proxy_query_accept_caps(query)[source]¶
- Parameters: - query ( - Gst.Query) – an ACCEPT_CAPS- Gst.Query.- Returns: - Trueif query could be executed- Return type: - bool- Checks if all internally linked pads of self 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. 
 - 
proxy_query_caps(query)[source]¶
- Parameters: - query ( - Gst.Query) – a CAPS- Gst.Query.- Returns: - Trueif query could be executed- Return type: - bool- Calls - Gst.Pad.query_caps() for all internally linked pads of self 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. 
 - 
pull_range(offset, size)[source]¶
- Parameters: - Returns: - a - Gst.FlowReturnfrom the peer pad.- MT safe. - buffer: - a pointer to hold the - Gst.Buffer, returns- Gst.FlowReturn.ERRORif- None.- Return type: - ( - Gst.FlowReturn, buffer:- Gst.Buffer)- Pulls a buffer from the peer pad or fills up a provided buffer. - This function will first trigger the pad block signal if it was installed. - When self is not linked - Gst.FlowReturn.NOT_LINKEDis returned else this function returns the result of- Gst.Pad.get_range() on the peer pad. See- Gst.Pad.get_range() for a list of return values and for the semantics of the arguments of this function.- If buffer points to a variable holding - None, a valid new- Gst.Bufferwill be placed in buffer when this function returns- Gst.FlowReturn.OK. The new buffer must be freed with gst_buffer_unref() after usage. When this function returns any other result value, buffer will still point to- None.- When buffer points to a variable that points to a valid - Gst.Buffer, the buffer will be filled with the result data when this function returns- Gst.FlowReturn.OK. When this function returns any other result value, buffer will be unchanged. If the provided buffer is larger than size, only size bytes will be filled in the result buffer and its size will be updated accordingly.- Note that less than size bytes can be returned in buffer when, for example, an EOS condition is near or when buffer is not large enough to hold size bytes. The caller should check the result buffer size to get the result size. 
 - 
push(buffer)[source]¶
- Parameters: - buffer ( - Gst.Buffer) – the- Gst.Bufferto push returns- Gst.FlowReturn.ERRORif not.- Returns: - a - Gst.FlowReturnfrom the peer pad.- MT safe. - Return type: - Gst.FlowReturn- Pushes a buffer to the peer of self. - 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 self has no peer,- Gst.FlowReturn.NOT_LINKEDwill be returned.- In all cases, success or failure, the caller loses its reference to buffer after calling this function. 
 - 
push_event(event)[source]¶
- Parameters: - event ( - Gst.Event) – the- Gst.Eventto send to the pad.- Returns: - Trueif the event was handled.- MT safe. - Return type: - bool- 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. 
 - 
push_list(list)[source]¶
- Parameters: - list ( - Gst.BufferList) – the- Gst.BufferListto push returns- Gst.FlowReturn.ERRORif not.- Returns: - a - Gst.FlowReturnfrom the peer pad.- MT safe. - Return type: - Gst.FlowReturn- Pushes a buffer list to the peer of self. - 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 self has no peer, - Gst.FlowReturn.NOT_LINKEDwill 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- Gst.Bufferand chained via- Gst.Pad.chain().- In all cases, success or failure, the caller loses its reference to list after calling this function. 
 - 
query(query)[source]¶
- Parameters: - query ( - Gst.Query) – the- Gst.Queryto perform.- Returns: - Trueif the query could be performed.- Return type: - bool- 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. 
 - 
query_accept_caps(caps)[source]¶
- Parameters: - caps ( - Gst.Caps) – a- Gst.Capsto check on the pad- Returns: - Trueif the pad can accept the caps.- Return type: - bool- Check if the given pad accepts the caps. 
 - 
query_caps(filter)[source]¶
- Parameters: - filter ( - Gst.Capsor- None) – suggested- Gst.Caps, or- None- Returns: - the caps of the pad with incremented ref-count. - Return type: - Gst.Caps- 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_capsreturns 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- None, 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 - Nonebut if it is not- Nonethe returned caps will be a subset of filter.- Note that this function does not return writable - Gst.Caps, use gst_caps_make_writable() before modifying the caps.
 - 
query_convert(src_format, src_val, dest_format)[source]¶
- Parameters: - src_format (Gst.Format) – aGst.Formatto convert from.
- src_val (int) – a value to convert.
- dest_format (Gst.Format) – theGst.Formatto convert to.
 - Returns: - Trueif the query could be performed.- dest_val: - a pointer to the result. - Return type: - Queries a pad to convert src_val in src_format to dest_format. 
- src_format (
 - 
query_default(parent, query)[source]¶
- Parameters: - parent (Gst.ObjectorNone) – the parent of self orNone
- query (Gst.Query) – theGst.Queryto handle.
 - Returns: - Trueif the query was performed successfully.- Return type: - Invokes the default query handler for the given pad. The query is sent to all pads internally linked to self. Note that if there are many possible sink pads that are internally linked to self, only one will be sent the query. Multi-sinkpad elements should implement custom query handlers. 
- parent (
 - 
query_duration(format)[source]¶
- Parameters: - format ( - Gst.Format) – the- Gst.Formatrequested- Returns: - Trueif the query could be performed.- duration: - a location in which to store the total duration, or - None.- Return type: - ( - bool, duration:- int)- Queries a pad for the total stream duration. 
 - 
query_position(format)[source]¶
- Parameters: - format ( - Gst.Format) – the- Gst.Formatrequested- Returns: - Trueif the query could be performed.- cur: - A location in which to store the current position, or - None.- Return type: - ( - bool, cur:- int)- Queries a pad for the stream position. 
 - 
remove_probe(id)[source]¶
- Parameters: - id ( - int) – the probe id to remove- Remove the probe with id from self. - MT safe. 
 - 
send_event(event)[source]¶
- Parameters: - event ( - Gst.Event) – the- Gst.Eventto send to the pad.- Returns: - Trueif the event was handled.- Return type: - bool- Sends the event to the pad. This function can be used by applications to send events in the pipeline. - If self is a source pad, event should be an upstream event. If self is a sink pad, event should be a downstream event. For example, you would not send a - Gst.EventType.EOSon 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.EventType.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 - Gst.EventTypeFlags,- Gst.EventType.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. 
 - 
set_activate_function_full(activate, *user_data)[source]¶
- Parameters: - activate (Gst.PadActivateFunction) – theGst.PadActivateFunctionto set.
- user_data (objectorNone) – user_data passed to notify
 - Sets the given activate function for self. 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. 
- activate (
 - 
set_activatemode_function_full(activatemode, *user_data)[source]¶
- Parameters: - activatemode (Gst.PadActivateModeFunction) – theGst.PadActivateModeFunctionto set.
- user_data (objectorNone) – user_data passed to notify
 - Sets the given activate_mode function for the pad. An activate_mode function prepares the element for data passing. 
- activatemode (
 - 
set_active(active)[source]¶
- Parameters: - active ( - bool) – whether or not the pad should be active.- Returns: - Trueif the operation was successful.- MT safe. - Return type: - bool- 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- Falseargument.
 - 
set_chain_function_full(chain, *user_data)[source]¶
- Parameters: - chain (Gst.PadChainFunction) – theGst.PadChainFunctionto set.
- user_data (objectorNone) – user_data passed to notify
 - Sets the given chain function for the pad. The chain function is called to process a - Gst.Bufferinput buffer. see- Gst.PadChainFunctionfor more details.
- chain (
 - 
set_chain_list_function_full(chainlist, *user_data)[source]¶
- Parameters: - chainlist (Gst.PadChainListFunction) – theGst.PadChainListFunctionto set.
- user_data (objectorNone) – user_data passed to notify
 - Sets the given chain list function for the pad. The chainlist function is called to process a - Gst.BufferListinput buffer list. See- Gst.PadChainListFunctionfor more details.
- chainlist (
 - 
set_element_private(priv)[source]¶
- Parameters: - priv ( - objector- None) – The private data to attach to the pad.- Set the given private data - objecton the pad. This function can only be used by the element that owns the pad. No locking is performed in this function.
 - 
set_event_full_function_full(event, *user_data)[source]¶
- Parameters: - event (Gst.PadEventFullFunction) – theGst.PadEventFullFunctionto set.
- user_data (objectorNone) – user_data passed to notify
 - Sets the given event handler for the pad. - New in version 1.8. 
- event (
 - 
set_event_function_full(event, *user_data)[source]¶
- Parameters: - event (Gst.PadEventFunction) – theGst.PadEventFunctionto set.
- user_data (objectorNone) – user_data passed to notify
 - Sets the given event handler for the pad. 
- event (
 - 
set_getrange_function_full(get, *user_data)[source]¶
- Parameters: - get (Gst.PadGetRangeFunction) – theGst.PadGetRangeFunctionto set.
- user_data (objectorNone) – user_data passed to notify
 - Sets the given getrange function for the pad. The getrange function is called to produce a new - Gst.Bufferto start the processing pipeline. see- Gst.PadGetRangeFunctionfor a description of the getrange function.
- get (
 - 
set_iterate_internal_links_function_full(iterintlink, *user_data)[source]¶
- Parameters: - iterintlink (Gst.PadIterIntLinkFunction) – theGst.PadIterIntLinkFunctionto set.
- user_data (objectorNone) – user_data passed to notify
 - Sets the given internal link iterator function for the pad. 
- iterintlink (
 - 
set_link_function_full(link, *user_data)[source]¶
- Parameters: - link (Gst.PadLinkFunction) – theGst.PadLinkFunctionto set.
- user_data (objectorNone) – user_data passed to 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.PadLinkReturn.OKshould be used when the connection can be made.- The return value - Gst.PadLinkReturn.REFUSEDshould be used when the connection cannot be made for some reason.- If link is installed on a source pad, it should call the - Gst.PadLinkFunctionof the peer sink pad, if present.
- link (
 - 
set_offset(offset)[source]¶
- Parameters: - offset ( - int) – the offset- Set the offset that will be applied to the running time of self. 
 - 
set_query_function_full(query, *user_data)[source]¶
- Parameters: - query (Gst.PadQueryFunction) – theGst.PadQueryFunctionto set.
- user_data (objectorNone) – user_data passed to notify
 - Set the given query function for the pad. 
- query (
 - 
set_unlink_function_full(unlink, *user_data)[source]¶
- Parameters: - unlink (Gst.PadUnlinkFunction) – theGst.PadUnlinkFunctionto set.
- user_data (objectorNone) – user_data passed to 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. 
- unlink (
 - 
start_task(func, *user_data)[source]¶
- Parameters: - func (Gst.TaskFunction) – the task function to call
- user_data (objectorNone) – user data passed to the task function
 - Returns: - a - Trueif the task could be started.- Return type: - 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 self will automatically be acquired before func is called. 
- func (
 - 
sticky_events_foreach(foreach_func, *user_data)[source]¶
- Parameters: - foreach_func (Gst.PadStickyEventsForeachFunction) – theGst.PadStickyEventsForeachFunctionthat should be called for every event.
- user_data (objectorNone) – the optional user data.
 - Iterates all sticky events on self and calls foreach_func for every event. If foreach_func returns - Falsethe iteration is immediately stopped.
- foreach_func (
 - 
stop_task()[source]¶
- Returns: - a - Trueif the task could be stopped or- Falseon error.- Return type: - bool- Stop the task of self. This function will also make sure that the function executed by the task will effectively stop if not called from the - Gst.TaskFunction.- This function will deadlock if called from the - Gst.TaskFunctionof 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. 
 - 
store_sticky_event(event)[source]¶
- Parameters: - event ( - Gst.Event) – a- Gst.Event- Returns: - Gst.FlowReturn.OKon success,- Gst.FlowReturn.FLUSHINGwhen the pad was flushing or- Gst.FlowReturn.EOSwhen the pad was EOS.- Return type: - Gst.FlowReturn- Store the sticky event on self - New in version 1.2. 
 - 
unlink(sinkpad)[source]¶
- Parameters: - sinkpad ( - Gst.Pad) – the sink- Gst.Padto unlink.- Returns: - Trueif the pads were unlinked. This function returns- Falseif the pads were not linked together.- MT safe. - Return type: - bool- Unlinks the source pad from the sink pad. Will emit the - Gst.Pad- ::unlinkedsignal on both pads.
 - 
use_fixed_caps()[source]¶
- 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. 
 
- 
classmethod 
Signal Details¶
- 
Gst.Pad.signals.linked(pad, peer)¶
- Signal Name: - linked- Flags: - Parameters: - Signals that a pad has been linked to the peer pad. 
Property Details¶
- 
Gst.Pad.props.caps¶
- Name: - caps- Type: - Gst.Caps- Default Value: - None- Flags: - READABLE- The capabilities of the pad 
- 
Gst.Pad.props.direction¶
- Name: - direction- Type: - Gst.PadDirection- Default Value: - Gst.PadDirection.UNKNOWN- Flags: - READABLE,- WRITABLE,- CONSTRUCT_ONLY- The direction of the pad 
- 
Gst.Pad.props.offset¶
- Name: - offset- Type: - int- Default Value: - 0- Flags: - READABLE,- WRITABLE- The offset that will be applied to the running time of the pad. - New in version 1.6. 
- 
Gst.Pad.props.template¶
- Name: - template- Type: - Gst.PadTemplate- Default Value: - None- Flags: - READABLE,- WRITABLE- The - Gst.PadTemplateof this pad