GstFilter

GstFilter — Filters to apply on a pipeline

Synopsis

#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);

Object Hierarchy

  GObject
   +----GstFilter
         +----GstAudioconverterFilter
         +----GstBinFilter
         +----GstLevelFilter
         +----GstVolumeFilter
         +----GstVideoconverterFilter
         +----GstVideoSizeFilter
         +----GstMaxFramerateFilter
         +----GstFramerateFilter
         +----GstGnomeEffectFilter
         +----GstPreviewFilter

Properties

  "name"                     gchar*                : Read

Signals

  "applied"                                        : Has Details
  "apply-failed"                                   : Has Details
  "revert-failed"                                  : Has Details
  "reverted"                                       : Has Details

Description

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

Details

GstFilter

typedef struct _GstFilter GstFilter;

A Filter


struct GstFilterClass

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 parent_class;

The parent class

apply ()

Apply the filter on the GstPad

revert ()

Revert the filter from the GstPad

handle_message ()

Handle the GstMessage

const gchar *name;

The name of the filter

gst_filter_apply ()

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.

self :

The GstFilter

bin :

The GstBin to apply the filter to

pad :

The GstPad to apply the filter to

Returns :

The new applied GstPad to link with the rest of the pipeline or NULL in case of an error. See also: gst_filter_revert(). [transfer full]

gst_filter_revert ()

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)

self :

The GstFilter

bin :

The GstBin to revert the filter from

pad :

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]

gst_filter_follow ()

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.

self :

The GstFilter

pad :

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]

gst_filter_handle_message ()

gboolean            gst_filter_handle_message           (GstFilter *self,
                                                         GstMessage *message);

Try to handle a message originally received on the GstBus to the filter.

self :

The GstFilter

message :

The message to handle

Returns :

TRUE if the message has been handled and should be dropped, FALSE otherwise.

Property Details

The "name" property

  "name"                     gchar*                : Read

The name of the filter.

Default value: NULL

Signal Details

The "applied" signal

void                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.

filter :

The GstFilter

bin :

The GstBin the filter got applied on

pad :

The GstPad the filter got applied on

out_pad :

The resulting output pad

user_data :

user data set when the signal handler was connected.

The "apply-failed" signal

void                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.

filter :

The GstFilter

bin :

The GstBin the filter got applied on

pad :

The GstPad the filter got applied on

user_data :

user data set when the signal handler was connected.

The "revert-failed" signal

void                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.

filter :

The GstFilter

bin :

The GstBin the filter got reverted from

pad :

The GstPad the filter got reverted from

user_data :

user data set when the signal handler was connected.

The "reverted" signal

void                user_function                      (GstFilter *filter,
                                                        GstBin    *bin,
                                                        GstPad    *pad,
                                                        GstPad    *out_pad,
                                                        gpointer   user_data)      : Has Details

This signal is sent when the filter gets reverted from a pad.

filter :

The GstFilter

bin :

The GstBin the filter got reverted from

pad :

The GstPad the filter got reverted from

out_pad :

The resulting output pad

user_data :

user data set when the signal handler was connected.