GStreamer Filters Library Reference Manual | ||||
---|---|---|---|---|
Top | Description | Object Hierarchy | Prerequisites | Known Implementations |
GstFilterManagerGstFilterManager — The filter manager to handle GstFilter objects |
#include <gst/filters/gst-filter-manager.h> GstFilterManager; struct GstFilterManagerInterface; GstFilterId; GstPad * gst_filter_manager_apply (GstFilterManager *self
,GstBin *bin
,GstPad *pad
); GstPad * gst_filter_manager_revert (GstFilterManager *self
,GstBin *bin
,GstPad *pad
); GstFilterId * gst_filter_manager_append_filter (GstFilterManager *self
,GstFilter *filter
); GstFilterId * gst_filter_manager_prepend_filter (GstFilterManager *self
,GstFilter *filter
); GstFilterId * gst_filter_manager_insert_filter_before (GstFilterManager *self
,GstFilter *filter
,GstFilterId *before
); GstFilterId * gst_filter_manager_insert_filter_after (GstFilterManager *self
,GstFilter *filter
,GstFilterId *after
); GstFilterId * gst_filter_manager_insert_filter (GstFilterManager *self
,GstFilter *filter
,gint position
); gboolean gst_filter_manager_remove_filter (GstFilterManager *self
,GstFilterId *id
); GstFilterId * gst_filter_manager_replace_filter (GstFilterManager *self
,GstFilter *filter
,GstFilterId *replace
); GList * gst_filter_manager_list_filters (GstFilterManager *self
); GstFilter * gst_filter_manager_get_filter_by_id (GstFilterManager *self
,GstFilterId *id
); gboolean gst_filter_manager_handle_message (GstFilterManager *self
,GstMessage *message
);
GstFilterManager is implemented by GstMultiFilterManager and GstSingleFilterManager.
This class acts as a manager for multiple GstFilter objects. Its main purpose is to allow the user to easily add and remove filters from a pipeline and it will take care of doing whatever is necessary to keep the pipeline in a consistent state. It will send signals to let the user know of what is happening in terms of applying/reverting filters and whatever or not the apply/revert worked.
See also GstFilter
typedef struct _GstFilterManager GstFilterManager;
Opaque structure representing an object implementing the GstFilterManagerInterface
struct GstFilterManagerInterface { GTypeInterface parent; GList *(*list_filters) (GstFilterManager * self); GstFilterId *(*insert_filter_before) (GstFilterManager * self, GstFilter * filter, GstFilterId * before); GstFilterId *(*insert_filter_after) (GstFilterManager * self, GstFilter * filter, GstFilterId * after); GstFilterId *(*replace_filter) (GstFilterManager * self, GstFilter * filter, GstFilterId * replace); GstFilterId *(*insert_filter) (GstFilterManager * self, GstFilter * filter, gint position); gboolean (*remove_filter) (GstFilterManager * self, GstFilterId * id); GstFilter *(*get_filter_by_id) (GstFilterManager * self, GstFilterId * id); GstPad *(*apply) (GstFilterManager * self, GstBin * bin, GstPad * pad); GstPad *(*revert) (GstFilterManager * self, GstBin * bin, GstPad * pad); gboolean (*handle_message) (GstFilterManager * self, GstMessage * message); };
This is the interface for the GstFilterManager that needs to be implemented
GTypeInterface |
parent interface type. |
List the GstFilterId in the filter manager | |
Insert the GstFilter before the GstFilterId | |
Insert the GstFilter after the GstFilterId | |
Remove the GstFilterId and replace it with the GstFilter | |
Insert the GstFilter at the specified position | |
Remove the fsuFilterId from the filter manager | |
Return the GstFilter associated with the GstFilterId | |
Apply the filter manager on the GstPad on the GstBin | |
Revert the filter manager from the GstPad on the GstBin | |
Handle the GstMessage by all the filters |
typedef struct _GstFilterId GstFilterId;
An opaque structure to represent a single filter application in the filter manager. A filter can be applied multiple times in a filter manager, so this unique GstFilterId represents the filter in a specific position in the filter manager. It becomes invalid as soon as the filter gets removed from the manager.
GstPad * gst_filter_manager_apply (GstFilterManager *self
,GstBin *bin
,GstPad *pad
);
This will apply the filter manager to a bin on a specific pad. If the filter manager already has some filters in it, they will automatically be applied on that pad, otherwise, the filter manager will hook itself to that pad and will add filters to it once the they get added to the filter manager. The filter manager can be applied on either a source pad or a sink pad, it will still work the same and the order of the filters will stay be respected in a source-to-sink order.
|
The GstFilterManager |
|
The GstBin to apply the filter manager to |
|
The GstPad to apply the filter manager to |
Returns : |
The new applied GstPad to link with the rest
of the pipeline
See also: gst_filter_manager_revert() . [transfer none]
|
GstPad * gst_filter_manager_revert (GstFilterManager *self
,GstBin *bin
,GstPad *pad
);
This will revert the filter manager from a bin on the specified pad.
The pad has to be the end part of the filter manager. This is necessarily the
same output pad from gst_filter_manager_apply()
because if new filters get
added to the start or end of the filter manager, that pad might change.
The best way to get the correct pad to revert from is to use get the peer pad
of the element that was linked after the filter manager.
In the case of GstSingleFilterManager, you can also get the out-pad by
querrying the filter manager's "out-pad" property.
|
The GstFilterManager |
|
The GstBin to revert the filter manager from |
|
The GstPad to revert the filter manager from |
Returns : |
The original GstPad from which the filter manager
was applied
See also: gst_filter_manager_apply() . [transfer none]
|
GstFilterId * gst_filter_manager_append_filter (GstFilterManager *self
,GstFilter *filter
);
Add a filter to the end of the list of filters in the filter manager
|
The GstFilterManager |
|
The filter to append |
Returns : |
The GstFilterId of the inserted filter or NULL in case of error. [transfer none] |
GstFilterId * gst_filter_manager_prepend_filter (GstFilterManager *self
,GstFilter *filter
);
Add a filter to the beginning of the list of filters in the filter manager
|
The GstFilterManager |
|
The filter to prepend |
Returns : |
The GstFilterId of the inserted filter or NULL in case of error. [transfer none] |
GstFilterId * gst_filter_manager_insert_filter_before (GstFilterManager *self
,GstFilter *filter
,GstFilterId *before
);
Add a filter before before
in the list of filters in the filter manager
|
The GstFilterManager |
|
The filter to insert |
|
The GstFilterId of the filter before which to insert filter
|
Returns : |
The GstFilterId of the inserted filter or NULL in case of error. [transfer none] |
GstFilterId * gst_filter_manager_insert_filter_after (GstFilterManager *self
,GstFilter *filter
,GstFilterId *after
);
Add a filter after after
in the list of filters in the filter manager
|
The GstFilterManager |
|
The filter to insert |
|
The GstFilterId of the filter after which to insert filter
|
Returns : |
The GstFilterId of the inserted filter or NULL in case of error. [transfer none] |
GstFilterId * gst_filter_manager_insert_filter (GstFilterManager *self
,GstFilter *filter
,gint position
);
Add a filter in the list of filters in the filter manager at the specified position.
|
The GstFilterManager |
|
The filter to insert |
|
The insert position of the filter in the list |
Returns : |
The GstFilterId of the inserted filter or NULL
in case of error
See also: gst_filter_manager_list_filters() . [transfer none]
|
gboolean gst_filter_manager_remove_filter (GstFilterManager *self
,GstFilterId *id
);
Removes the filter identified by id
from the list of filters in the
filter manager
|
The GstFilterManager |
|
The id of the filter to remove |
Returns : |
TRUE if the GstFilterId is valid and the filter was removed,
FALSE if the id is invalid |
GstFilterId * gst_filter_manager_replace_filter (GstFilterManager *self
,GstFilter *filter
,GstFilterId *replace
);
Removes the filter identified by replace
and replace it with the filter
filter
in the same position in the filter manager
gst_filter_manager_remove_filter()
followed by gst_filter_manager_insert_filter()
, because those two operations
would cause an unlink/revert/link followed by unlink/apply/link while the
gst_filter_manager_replace_filter()
operation only causes a
unlink/revert/apply/link which will save you an unlinking and a linking of
pads, which would cause a caps renegociation
|
The GstFilterManager |
|
The filter to insert |
|
The GstFilterId of the filter to replace by filter
|
Returns : |
The GstFilterId of the inserted filter or NULL in case of error. [transfer none] |
GList * gst_filter_manager_list_filters (GstFilterManager *self
);
List all the filters that are currently in the filter manager.
|
The GstFilterManager |
Returns : |
The ordered list of
filters as a GList of GstFilterId
See also: gst_filter_manager_get_filter_by_id() . [transfer full][element-type GstFilterId]
|
GstFilter * gst_filter_manager_get_filter_by_id (GstFilterManager *self
,GstFilterId *id
);
Get the GstFilter identified by the id
GstFilterId from the list of
filters in the filter manager
|
The GstFilterManager |
|
The id of the filter |
Returns : |
The GstFilter representing id or NULL
if id is invalid.
The returned filter is reffed before being returned, so call g_object_unref()
once the filter is not needed anymore. [transfer full]
|
gboolean gst_filter_manager_handle_message (GstFilterManager *self
,GstMessage *message
);
Dispatch a message originally received on the GstBus to the filter manager and to all its filters. Once a filter handles the message, it will stop dispatching it to other filters and will return TRUE
|
The GstFilterManager |
|
The message to handle |
Returns : |
TRUE if the message has been handled and should be dropped, FALSE otherwise. |