Sets our main struct and passes it to the parent class
Create a new ghostpad with target as the target. The direction will be taken from the target pad. target must be unlinked. Will ref the target.
Create a new ghostpad without a target with the given direction. A target can be set on the ghostpad later with the gst_ghost_pad_set_target() function. The created ghostpad will not have a padtemplate.
Create a new ghostpad with target as the target. The direction will be taken from the target pad. The template used on the ghostpad will be template. Will ref the target.
Create a new ghostpad based on templ, without setting a target. The direction will be taken from the templ.
the main Gtk struct as a void*
Get the target pad of gpad. Unref target pad after usage.
Set the new target of the ghostpad gpad. Any existing target is unlinked and links to the new target are established.
the main Gtk struct
the main Gtk struct
the main Gtk struct as a void*
Queries a pad for the stream position. This is a convenience function for gstreamerD.
Queries a pad for the stream duration. This is a convenience function for gstreamerD.
Signals that new data is available on the pad. This signal is used internally for implementing pad probes. See gst_pad_add_*_probe functions.
Signals that a pad has been linked to the peer pad.
Signals that a pad connection has been requested.
Signals that a pad has been unlinked from the peer pad. See Also GstPadTemplate, GstElement, GstEvent
Gets the direction of the pad. The direction of the pad is decided at construction time so this function does not take the LOCK.
Gets the parent of pad, cast to a GstElement. If a pad has no parent or its parent is not an element, return NULL.
Gets the template for pad.
Links the source pad and the sink pad.
Unlinks the source pad from the sink pad. Will emit the "unlinked" signal on both pads.
Checks if a pad is linked to another pad or not.
Checks if the source pad and the sink pad can be linked. Both srcpad and sinkpad must be unlinked.
Gets the capabilities this pad can produce or consume. Note that this method doesn't necessarily return the caps set by gst_pad_set_caps() - use GST_PAD_CAPS for that instead. gst_pad_get_caps returns all possible caps a pad can operate with, using the pad's get_caps function; this returns the pad template caps if not explicitly set.
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_get_caps() on pad and its peer. The caller owns a reference on the resulting caps.
Gets the capabilities of the media type that currently flows through pad and its peer. This function can be used on both src and sinkpads. Note that srcpads are always negotiated before sinkpads so it is possible that the negotiated caps on the srcpad do not match the negotiated caps of the peer.
Gets the capabilities for pad's template.
Sets the capabilities of this pad. The caps must be fixed. Any previous caps on the pad will be unreffed. This function refs the caps so you should unref if as soon as you don't need it anymore. It is possible to set NULL caps, which will make the pad unnegotiated again.
Gets the peer of pad. This function refs the peer pad so you need to unref it after use.
Gets the capabilities of the peer connected to this pad.
A helper function you can use that sets the gst_pad_get_fixed_caps_func as the getcaps function for the pad. This way the function will always return the negotiated caps or in case the pad is not negotiated, the padtemplate caps. Use this function on a pad that, once _set_caps() has been called on it, cannot be renegotiated to something else.
Query if a pad is active
Blocks or unblocks the dataflow on a pad. This function is a shortcut for gst_pad_set_blocked_async() with a NULL callback.
Blocks or unblocks the dataflow on a pad. The provided callback is called when the operation succeeds; this happens right before the next attempt at pushing a buffer on the pad. This can take a while as the pad can only become blocked when real dataflow is happening. When the pipeline is stalled, for example in PAUSED, this can take an indeterminate amount of time. You can pass NULL as the callback to make this call block. Be careful with this blocking call as it might not return for reasons stated above.
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()).
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.
Adds a "data probe" to a pad. This function will be called whenever data passes through a pad. In this case data means both events and buffers. The probe will be called with the data as an argument, meaning handler should have the same callback signature as the 'have-data' signal of GstPad. Note that the data will have a reference count greater than 1, so it will be immutable -- you must not change it. For source pads, the probe will be called after the blocking function, if any (see gst_pad_set_blocked_async()), but before looking up the peer to chain to. For sink pads, the probe function will be called before configuring the sink with new caps, if any, and before calling the pad's chain function. Your data probe should return TRUE to let the data continue to flow, or FALSE to drop it. Dropping data is rarely useful, but occasionally comes in handy with events. Although probes are implemented internally by connecting handler to the have-data signal on the pad, if you want to remove a probe it is insufficient to only call g_signal_handler_disconnect on the returned handler id. To remove a probe, use the appropriate function, such as gst_pad_remove_data_probe().
Adds a probe that will be called for all buffers passing through a pad. See gst_pad_add_data_probe() for more information.
Adds a probe that will be called for all events passing through a pad. See gst_pad_add_data_probe() for more information.
Removes a data probe from pad.
Removes a buffer probe from pad.
Removes an event probe from pad.
Allocates a new, empty buffer optimized to push to pad pad. This function only works if pad is a source pad and has a peer. A new, empty GstBuffer will be put in the buf argument. You need to check the caps of the buffer after performing this function and renegotiate to the format if needed.
In addition to the function gst_pad_alloc_buffer(), this function automatically calls gst_pad_set_caps() when the caps of the newly allocated buffer are different from the pad caps.
Sets the given bufferalloc function for the pad. Note that the bufferalloc function can only be set on sinkpads.
Sets the given chain function for the pad. The chain function is called to process a GstBuffer input buffer. see GstPadChainFunction for more details.
Sets the given checkgetrange function for the pad. Implement this function on a pad if you dynamically support getrange based scheduling on the pad.
When pad is flushing this function returns GST_FLOW_WRONG_STATE immediatly. Calls the getrange function of pad, see GstPadGetRangeFunction for a description of a getrange function. If pad has no getrange function installed (see gst_pad_set_getrange_function()) this function returns GST_FLOW_NOT_SUPPORTED. buffer's caps must either be unset or the same as what is already configured on pad. Renegotiation within a running pull-mode pipeline is not supported. This is a lowlevel function. Usualy gst_pad_pull_range() is used.
Sets the given getrange function for the pad. The getrange function is called to produce a new GstBuffer to start the processing pipeline. see GstPadGetRangeFunction for a description of the getrange function.
Sets the given event handler for the pad.
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.
Sets the given unlink function for the pad. It will be called when the pad is unlinked.
Check if the given pad accepts the caps.
Sets the given acceptcaps function for the pad. The acceptcaps function will be called to check if the pad can accept the given caps. Setting the acceptcaps function to NULL restores the default behaviour of allowing any caps that matches the caps from gst_pad_get_caps.
Sets the given getcaps function for the pad. getcaps should return the allowable caps for a pad in the context of the element's state, its link to other elements, and the devices or files it has opened. These caps must be a subset of the pad template caps. In the NULL state with no links, getcaps should ideally return the same caps as the pad template. In rare circumstances, an object property can affect the caps returned by getcaps, but this is discouraged. You do not need to call this function if pad's allowed caps are always the same as the pad template caps. This can only be true if the padtemplate has fixed simple caps. For most filters, the caps returned by getcaps is directly affected by the allowed caps on other pads. For demuxers and decoders, the caps returned by the srcpad's getcaps function is directly related to the stream data. Again, getcaps should return the most specific caps it reasonably can, since this helps with autoplugging. Note that the return value from getcaps is owned by the caller, so the caller should unref the caps after usage.
Calls gst_pad_get_allowed_caps() for every other pad belonging to the same element as pad, and returns the intersection of the results. This function is useful as a default getcaps 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 aggregator.
Sets the given setcaps function for the pad. The setcaps function will be called whenever a buffer with a new media type is pushed or pulled from the pad. The pad/element needs to update its internal structures to process the new media type. If this new type is not acceptable, the setcaps function should return FALSE.
Calls gst_pad_set_caps() for every other pad belonging to the same element as pad. If gst_pad_set_caps() fails on any pad, the proxy setcaps fails. May be used only during negotiation.
Fixate a caps on the given pad. Modifies the caps in place, so you should make sure that the caps are actually writable (see gst_caps_make_writable()).
Sets the given fixatecaps function for the pad. The fixatecaps function will be called whenever the default values for a GstCaps needs to be filled in.
A helper function you can use as a GetCaps function that will return the currently negotiated caps or the padtemplate when NULL.
Check if the peer of pad accepts caps. If pad has no peer, this function returns TRUE.
Sets the given activate function for pad. The activate function will dispatch to gst_pad_activate_push() or gst_pad_activate_pull() 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.
Sets the given activate_push function for the pad. An activate_push function prepares the element for pushing. See XXX part-activation.txt for details.
Sets the given activate_pull function for the pad. An activate_pull function prepares the element and any upstream connections for pulling. See XXX part-activation.txt for details.
Pushes a buffer to the peer of pad. This function will call an installed pad block before triggering any installed pad probes. If the caps on buffer are different from the currently configured caps on pad, this function will call any installed setcaps function on pad (see gst_pad_set_setcaps_function()). In case of failure to renegotiate the new format, this function returns GST_FLOW_NOT_NEGOTIATED. 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.
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 owership of the provided event so you should gst_event_ref() it if you want to reuse the event after this call.
Checks if a gst_pad_pull_range() can be performed on the peer source pad. This function is used by plugins that want to check if they can use random access on the peer source pad. The peer sourcepad can implement a custom GstPadCheckGetRangeFunction if it needs to perform some logic to determine if pull_range is possible.
Pulls a buffer from the peer pad. This function will first trigger the pad block signal if it was installed. When pad is not linked GST_FLOW_NOT_LINKED is 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. buffer's caps must either be unset or the same as what is already configured on pad. Renegotiation within a running pull-mode pipeline is not supported.
Activates or deactivates the given pad in pull mode via dispatching to the pad's activatepullfunc. For use from within pad activation functions only. When called on sink pads, will first proxy the call to the peer pad, which is expected to activate its internally linked pads from within its activate_pull function. If you don't know what this is, you probably don't want to call it.
Activates or deactivates the given pad in push mode via dispatching to the pad's activatepushfunc. For use from within pad activation functions only. If you don't know what this is, you probably don't want to call it.
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 owership of the provided event so you should gst_event_ref() it if you want to reuse the event after this call.
Invokes the default event handler for the given pad. End-of-stream and discontinuity events are handled specially, and then the event 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 an event. Multi-sinkpad elements should implement custom event handlers.
Dispatches a query to a pad. The query should have been allocated by the caller via one of the type-specific allocation functions in gstquery.h. The element 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.
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.
Queries a pad for the stream position.
Queries a pad for the total stream duration.
Queries a pad to convert src_val in src_format to dest_format.
Queries the peer of a given sink pad for the stream position.
Queries the peer pad of a given sink pad for the total stream duration.
Queries the peer pad of a given sink pad to convert src_val in src_format to dest_format.
Set the given query function for the pad.
Set the given query type function for the pad.
Get an array of supported queries that can be performed on this pad.
Invoke the default dispatcher for the query types on the pad.
Sets the given internal link function for the pad.
Gets a list of pads to which the given pad is linked to inside of the parent element. The caller must free this list after use.
Gets a list of pads to which the given pad is linked to inside of the parent element. This is the default handler, and thus returns a list of all of the pads inside the parent element with opposite direction. The caller must free this list after use.
Invokes the given dispatcher function on each respective peer of all pads that are internally linked to the given pad. The GstPadDispatcherFunction should return TRUE when no further pads need to be processed.
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.
Gets the private data of a pad. No locking is performed in this function.
Chain a buffer to pad. The function returns GST_FLOW_WRONG_STATE if the pad was flushing. If the caps on buffer are different from the current caps on pad, this function will call any setcaps function (see gst_pad_set_setcaps_function()) installed on pad. If the new caps are not acceptable for pad, 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.
Starts a task that repeatedly calls func with 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.
Pause the task of pad. This function will also make sure that the function executed by the task will effectively stop.
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.
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, checks the pad's current mode and calls gst_pad_activate_push() or gst_pad_activate_pull(), as appropriate, with a FALSE argument.
Description GhostPads are useful when organizing pipelines with GstBin like elements. The idea here is to create hierarchical element graphs. The bin element contains a sub-graph. Now one would like to treat the bin-element like other GstElements. This is where GhostPads come into play. A GhostPad acts as a proxy for another pad. Thus the bin can have sink and source ghost-pads that are associated with sink and source pads of the child elements. If the target pad is known at creation time, gst_ghost_pad_new() is the function to use to get a ghost-pad. Otherwise one can use gst_ghost_pad_new_no_target() to create the ghost-pad and use gst_ghost_pad_set_target() to establish the association later on. Note that GhostPads add overhead to the data processing of a pipeline. Last reviewed on 2005-11-18 (0.9.5)