GstProcTrans

GstProcTrans — Base class for process transformers

Synopsis

#include <gstproctrans.h>

struct              GstProcTrans;
struct              GstProcTransClass;
#define             GST_PROC_TRANS_SINK_NAME
#define             GST_PROC_TRANS_SRC_NAME
#define             GST_PROC_TRANS_SINK_PAD             (obj)
#define             GST_PROC_TRANS_SRC_PAD              (obj)

Object Hierarchy

  GObject
   +----GstObject
         +----GstElement
               +----GstProcTrans
                     +----GstProcPipe
                     +----GstY4mTrans
                     +----GstMp2enc

Description

This is a base class for elements that process and/or transform data by relying upon another program/process to do the actual processing. This process is presented the data coming into the element on its stdin, and the element will send out what it receives from the process' stdout.

It provides for most of the details such as setting up sink and src pads, state changes, etc. An inheriting element need only concern about providing for the proper pad templates and (optionally but recommended) implementing a custom set_caps. This call-back is called during (initial and only) caps negotiation, and only upon return the child process is actually started. This typically gives the inheritor a chance to provide the right arguments to the sub-program for the circumstances and data at hand.

Details

struct GstProcTrans

struct GstProcTrans;

The opaque GstProcTrans data structure.


struct GstProcTransClass

struct GstProcTransClass {
  GstElementClass parent_class;

  /* virtual methods for subclasses */

  gboolean      (*set_caps)     (GstProcTrans *trans, GstCaps *incaps,
                                 GstCaps **outcaps);
};

GstElementClass parent_class;

set_caps ()

Optional. Notify the subclass of new incaps, we should try to set outcaps on source pad upon return. Note that incaps can be NULL, and *outcaps can also be left NULL in which case no caps are set.

GST_PROC_TRANS_SINK_NAME

#define GST_PROC_TRANS_SINK_NAME    "sink"

the name of the templates for the sink pad


GST_PROC_TRANS_SRC_NAME

#define GST_PROC_TRANS_SRC_NAME     "src"

the name of the templates for the source pad


GST_PROC_TRANS_SINK_PAD()

#define GST_PROC_TRANS_SINK_PAD(obj)        (GST_PROC_TRANS_CAST (obj)->sinkpad)

Gives the pointer to the sink GstPad object of the element.

obj :

process transform instance

GST_PROC_TRANS_SRC_PAD()

#define GST_PROC_TRANS_SRC_PAD(obj)         (GST_PROC_TRANS_CAST (obj)->srcpad)

Gives the pointer to the source GstPad object of the element.

obj :

process transform instance