mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-23 00:36:51 +00:00
f6f9563dc8
Add a script that creates elements based on any of the GStreamer base classes. It isn't very user friendly at the moment, one needs to edit the script to make it work properly. Each base class has a template file describing what to put into the constructed element. Eventually, these templates should be moved to reside with the base class source and installed to a well-known directory, where an installed script could find them. The template files use the .c ending so editors know they are C source, but gst-indent doesn't handle them correctly. So they need to be committed with -n. Ugh. I'll try to figure out a fix for that soon.
154 lines
4.3 KiB
C
154 lines
4.3 KiB
C
% ClassName
|
|
GstBaseTransform
|
|
% TYPE_CLASS_NAME
|
|
GST_TYPE_BASE_TRANSFORM
|
|
% pkg-config
|
|
gstreamer-base-0.10
|
|
% includes
|
|
#include <gst/base/gstbasetransform.h>
|
|
% prototypes
|
|
static GstCaps *gst_replace_transform_caps (GstBaseTransform * trans,
|
|
GstPadDirection direction, GstCaps * caps);
|
|
static void
|
|
gst_replace_fixate_caps (GstBaseTransform * trans,
|
|
GstPadDirection direction, GstCaps * caps, GstCaps * othercaps);
|
|
static gboolean
|
|
gst_replace_transform_size (GstBaseTransform * trans,
|
|
GstPadDirection direction,
|
|
GstCaps * caps, guint size, GstCaps * othercaps, guint * othersize);
|
|
static gboolean
|
|
gst_replace_get_unit_size (GstBaseTransform * trans, GstCaps * caps,
|
|
guint * size);
|
|
static gboolean
|
|
gst_replace_set_caps (GstBaseTransform * trans, GstCaps * incaps,
|
|
GstCaps * outcaps);
|
|
static gboolean gst_replace_start (GstBaseTransform * trans);
|
|
static gboolean gst_replace_stop (GstBaseTransform * trans);
|
|
static gboolean gst_replace_event (GstBaseTransform * trans, GstEvent * event);
|
|
static GstFlowReturn
|
|
gst_replace_transform (GstBaseTransform * trans, GstBuffer * inbuf,
|
|
GstBuffer * outbuf);
|
|
static GstFlowReturn
|
|
gst_replace_transform_ip (GstBaseTransform * trans, GstBuffer * buf);
|
|
static GstFlowReturn
|
|
gst_replace_prepare_output_buffer (GstBaseTransform * trans,
|
|
GstBuffer * input, gint size, GstCaps * caps, GstBuffer ** buf);
|
|
static gboolean
|
|
gst_replace_src_event (GstBaseTransform * trans, GstEvent * event);
|
|
static void
|
|
gst_replace_before_transform (GstBaseTransform * trans, GstBuffer * buffer);
|
|
% declare-class
|
|
GstBaseTransformClass *base_transform_class = GST_BASE_TRANSFORM_CLASS (klass);
|
|
% set-methods
|
|
base_transform_class->transform_caps = GST_DEBUG_FUNCPTR (gst_replace_transform_caps);
|
|
base_transform_class->fixate_caps = GST_DEBUG_FUNCPTR (gst_replace_fixate_caps);
|
|
base_transform_class->transform_size = GST_DEBUG_FUNCPTR (gst_replace_transform_size);
|
|
base_transform_class->get_unit_size = GST_DEBUG_FUNCPTR (gst_replace_get_unit_size);
|
|
base_transform_class->set_caps = GST_DEBUG_FUNCPTR (gst_replace_set_caps);
|
|
base_transform_class->start = GST_DEBUG_FUNCPTR (gst_replace_start);
|
|
base_transform_class->stop = GST_DEBUG_FUNCPTR (gst_replace_stop);
|
|
base_transform_class->event = GST_DEBUG_FUNCPTR (gst_replace_event);
|
|
base_transform_class->transform = GST_DEBUG_FUNCPTR (gst_replace_transform);
|
|
base_transform_class->transform_ip = GST_DEBUG_FUNCPTR (gst_replace_transform_ip);
|
|
base_transform_class->prepare_output_buffer = GST_DEBUG_FUNCPTR (gst_replace_prepare_output_buffer);
|
|
base_transform_class->src_event = GST_DEBUG_FUNCPTR (gst_replace_src_event);
|
|
base_transform_class->before_transform = GST_DEBUG_FUNCPTR (gst_replace_before_transform);
|
|
% methods
|
|
|
|
static GstCaps *
|
|
gst_replace_transform_caps (GstBaseTransform * trans,
|
|
GstPadDirection direction, GstCaps * caps)
|
|
{
|
|
|
|
return NULL;
|
|
}
|
|
|
|
static void
|
|
gst_replace_fixate_caps (GstBaseTransform * trans,
|
|
GstPadDirection direction, GstCaps * caps, GstCaps * othercaps)
|
|
{
|
|
|
|
}
|
|
|
|
static gboolean
|
|
gst_replace_transform_size (GstBaseTransform * trans,
|
|
GstPadDirection direction,
|
|
GstCaps * caps, guint size, GstCaps * othercaps, guint * othersize)
|
|
{
|
|
|
|
return FALSE;
|
|
}
|
|
|
|
static gboolean
|
|
gst_replace_get_unit_size (GstBaseTransform * trans, GstCaps * caps,
|
|
guint * size)
|
|
{
|
|
|
|
return FALSE;
|
|
}
|
|
|
|
static gboolean
|
|
gst_replace_set_caps (GstBaseTransform * trans, GstCaps * incaps,
|
|
GstCaps * outcaps)
|
|
{
|
|
|
|
return FALSE;
|
|
}
|
|
|
|
static gboolean
|
|
gst_replace_start (GstBaseTransform * trans)
|
|
{
|
|
|
|
return FALSE;
|
|
}
|
|
|
|
static gboolean
|
|
gst_replace_stop (GstBaseTransform * trans)
|
|
{
|
|
|
|
return FALSE;
|
|
}
|
|
|
|
static gboolean
|
|
gst_replace_event (GstBaseTransform * trans, GstEvent * event)
|
|
{
|
|
|
|
return FALSE;
|
|
}
|
|
|
|
static GstFlowReturn
|
|
gst_replace_transform (GstBaseTransform * trans, GstBuffer * inbuf,
|
|
GstBuffer * outbuf)
|
|
{
|
|
|
|
return GST_FLOW_ERROR;
|
|
}
|
|
|
|
static GstFlowReturn
|
|
gst_replace_transform_ip (GstBaseTransform * trans, GstBuffer * buf)
|
|
{
|
|
|
|
return GST_FLOW_ERROR;
|
|
}
|
|
|
|
static GstFlowReturn
|
|
gst_replace_prepare_output_buffer (GstBaseTransform * trans,
|
|
GstBuffer * input, gint size, GstCaps * caps, GstBuffer ** buf)
|
|
{
|
|
|
|
return GST_FLOW_ERROR;
|
|
}
|
|
|
|
static gboolean
|
|
gst_replace_src_event (GstBaseTransform * trans, GstEvent * event)
|
|
{
|
|
|
|
return FALSE;
|
|
}
|
|
|
|
static void
|
|
gst_replace_before_transform (GstBaseTransform * trans, GstBuffer * buffer)
|
|
{
|
|
|
|
}
|
|
% end
|