GStreamer Filters Library Reference Manual | ||||
---|---|---|---|---|
Top | Description | Object Hierarchy | Properties | Signals |
#include <gst/filters/gst-filter.h> GstFilter; struct GstFilterClass; GstPad * gst_filter_apply (GstFilter *self
,GstBin *bin
,GstPad *pad
); GstPad * gst_filter_revert (GstFilter *self
,GstBin *bin
,GstPad *pad
); GstPad * gst_filter_follow (GstFilter *self
,GstPad *pad
); gboolean gst_filter_handle_message (GstFilter *self
,GstMessage *message
);
GObject +----GstFilter +----GstAudioconverterFilter +----GstBinFilter +----GstLevelFilter +----GstVolumeFilter +----GstVideoconverterFilter +----GstVideoSizeFilter +----GstMaxFramerateFilter +----GstFramerateFilter +----GstGnomeEffectFilter +----GstPreviewFilter
"applied" :Has Details
"apply-failed" :Has Details
"revert-failed" :Has Details
"reverted" :Has Details
This base class represents filters that can be applied on a pipeline or that can be inserted in a GstFilterManager. Each filter does a specific task and provides an easy to use API or properties/signals to control your pipeline. It also provides some helper functions to more easily add/revert elements or bins to the pipeline.
See also: GstFilterManager
struct GstFilterClass { GObjectClass parent_class; GstPad *(*apply) (GstFilter * self, GstBin * bin, GstPad * pad); GstPad *(*revert) (GstFilter * self, GstBin * bin, GstPad * pad); gboolean (*handle_message) (GstFilter * self, GstMessage * message); const gchar *name; };
The base class for all filters. You must derive from this class and implement
the apply
and revert
methods as well as define the name
variable.
Implementing the handle_message
method is optional.
GObjectClass |
The parent class |
Apply the filter on the GstPad | |
Revert the filter from the GstPad | |
Handle the GstMessage | |
const gchar * |
The name of the filter |
GstPad * gst_filter_apply (GstFilter *self
,GstBin *bin
,GstPad *pad
);
This will apply the filter to a bin on a specific pad.
This will make the filter add elements to the bin
and link them with pad
.
It will return an output pad at the end of the inserted elements.
The filter can be applied on either a source pad or a sink pad, it
will still work the same.
GstPad * gst_filter_revert (GstFilter *self
,GstBin *bin
,GstPad *pad
);
This will revert the filter from a bin on the specified pad.
This should remove any elements the filter previously added to the bin and
return the original pad it received in the gst_filter_apply()
The pad to revert should be the output pad returned from gst_filter_apply()
.
Note that the returned pad may not be the same as the input pad of
gst_filter_apply()
because if the pad before the filter's application
point was unlinked and relinked somewhere else, that might change (as in the
case of adding/removing a filter from a GstFilterManager in which this
filter resides)
|
The GstFilter |
|
The GstBin to revert the filter from |
|
The GstPad to revert the filter from |
Returns : |
The original GstPad from which the filter
manager was applied
See also: gst_filter_manager_apply() . [transfer full]
|
GstPad * gst_filter_follow (GstFilter *self
,GstPad *pad
);
This will not do anything but it will give you the expected output result
from gst_filter_revert()
.
It basically will follow the filter from it's output pad all the way to the
other side of the elements that it added and will give you the input pad that
it should return if gst_filter_revert()
was called but without modifying
the pipeline.
|
The GstFilter |
|
The GstPad to follow the filter from |
Returns : |
The original GstPad from which the
filter manager was applied
See also: gst_filter_manager_revert() . [transfer full]
|
gboolean gst_filter_handle_message (GstFilter *self
,GstMessage *message
);
Try to handle a message originally received on the GstBus to the filter.
"applied"
signalvoid user_function (GstFilter *filter,
GstBin *bin,
GstPad *pad,
GstPad *out_pad,
gpointer user_data) : Has Details
This signal is sent when the filter gets applied on a pad.
"apply-failed"
signalvoid user_function (GstFilter *filter,
GstBin *bin,
GstPad *pad,
gpointer user_data) : Has Details
This signal is sent when the filter fails to apply on a pad.
"revert-failed"
signalvoid user_function (GstFilter *filter,
GstBin *bin,
GstPad *pad,
gpointer user_data) : Has Details
This signal is sent when the filter fails to revert from a pad.