GST_PLUGINS_NONPORTED=" aiff asfmux \
camerabin cdxaparse coloreffects \
dccp faceoverlay festival \
- fieldanalysis freeverb freeze frei0r gaudieffects geometrictransform \
+ fieldanalysis freeverb freeze frei0r gaudieffects \
hdvparse hls id3tag inter interlace ivfparse jpegformat jp2kdecimator \
kate liveadder legacyresample librfb mpegtsmux \
mpegpsmux mve mxf mythtv nsf nuvdemux \
#define DEFAULT_ZOOM 3.0
-GST_BOILERPLATE (GstBulge, gst_bulge, GstCircleGeometricTransform,
- GST_TYPE_CIRCLE_GEOMETRIC_TRANSFORM);
+#define gst_bulge_parent_class parent_class
+G_DEFINE_TYPE (GstBulge, gst_bulge, GST_TYPE_CIRCLE_GEOMETRIC_TRANSFORM);
static void
gst_bulge_set_property (GObject * object, guint prop_id, const GValue * value,
G_OBJECT_CLASS (parent_class)->finalize (obj);
}
-/* GObject vmethod implementations */
-
-static void
-gst_bulge_base_init (gpointer gclass)
-{
- GstElementClass *element_class = GST_ELEMENT_CLASS (gclass);
-
- gst_element_class_set_details_simple (element_class,
- "bulge",
- "Transform/Effect/Video",
- "Adds a protuberance in the center point",
- "Filippo Argiolas <filippo.argiolas@gmail.com>");
-}
-
static gboolean
bulge_map (GstGeometricTransform * gt, gint x, gint y, gdouble * in_x,
gdouble * in_y)
gst_bulge_class_init (GstBulgeClass * klass)
{
GObjectClass *gobject_class;
+ GstElementClass *gstelement_class;
GstGeometricTransformClass *gstgt_class;
gobject_class = (GObjectClass *) klass;
+ gstelement_class = (GstElementClass *) klass;
gstgt_class = (GstGeometricTransformClass *) klass;
parent_class = g_type_class_peek_parent (klass);
+ gst_element_class_set_details_simple (gstelement_class,
+ "bulge",
+ "Transform/Effect/Video",
+ "Adds a protuberance in the center point",
+ "Filippo Argiolas <filippo.argiolas@gmail.com>");
+
gobject_class->set_property = GST_DEBUG_FUNCPTR (gst_bulge_set_property);
gobject_class->get_property = GST_DEBUG_FUNCPTR (gst_bulge_get_property);
}
static void
-gst_bulge_init (GstBulge * filter, GstBulgeClass * gclass)
+gst_bulge_init (GstBulge * filter)
{
GstGeometricTransform *gt = GST_GEOMETRIC_TRANSFORM (filter);
#define DEFAULT_HEIGHT 20
#define DEFAULT_SPREAD_ANGLE G_PI
-GST_BOILERPLATE (GstCircle, gst_circle, GstCircleGeometricTransform,
- GST_TYPE_CIRCLE_GEOMETRIC_TRANSFORM);
+#define gst_circle_parent_class parent_class
+G_DEFINE_TYPE (GstCircle, gst_circle, GST_TYPE_CIRCLE_GEOMETRIC_TRANSFORM);
static void
gst_circle_set_property (GObject * object, guint prop_id, const GValue * value,
G_OBJECT_CLASS (parent_class)->finalize (obj);
}
-/* GObject vmethod implementations */
-
-static void
-gst_circle_base_init (gpointer gclass)
-{
- GstElementClass *element_class = GST_ELEMENT_CLASS (gclass);
-
- gst_element_class_set_details_simple (element_class,
- "circle",
- "Transform/Effect/Video",
- "Warps the picture into an arc shaped form",
- "Thiago Santos<thiago.sousa.santos@collabora.co.uk>");
-}
-
static gboolean
circle_map (GstGeometricTransform * gt, gint x, gint y, gdouble * in_x,
gdouble * in_y)
gst_circle_class_init (GstCircleClass * klass)
{
GObjectClass *gobject_class;
+ GstElementClass *gstelement_class;
GstGeometricTransformClass *gstgt_class;
gobject_class = (GObjectClass *) klass;
+ gstelement_class = (GstElementClass *) klass;
gstgt_class = (GstGeometricTransformClass *) klass;
parent_class = g_type_class_peek_parent (klass);
+ gst_element_class_set_details_simple (gstelement_class,
+ "circle",
+ "Transform/Effect/Video",
+ "Warps the picture into an arc shaped form",
+ "Thiago Santos<thiago.sousa.santos@collabora.co.uk>");
+
gobject_class->finalize = GST_DEBUG_FUNCPTR (gst_circle_finalize);
gobject_class->set_property = GST_DEBUG_FUNCPTR (gst_circle_set_property);
gobject_class->get_property = GST_DEBUG_FUNCPTR (gst_circle_get_property);
}
static void
-gst_circle_init (GstCircle * filter, GstCircleClass * gclass)
+gst_circle_init (GstCircle * filter)
{
filter->angle = DEFAULT_ANGLE;
filter->spread_angle = DEFAULT_SPREAD_ANGLE;
#define DEFAULT_SCALE 4
-GST_BOILERPLATE (GstDiffuse, gst_diffuse, GstGeometricTransform,
- GST_TYPE_GEOMETRIC_TRANSFORM);
+#define gst_diffuse_parent_class parent_class
+G_DEFINE_TYPE (GstDiffuse, gst_diffuse, GST_TYPE_GEOMETRIC_TRANSFORM);
static void
gst_diffuse_set_property (GObject * object, guint prop_id, const GValue * value,
/* GObject vmethod implementations */
-static void
-gst_diffuse_base_init (gpointer gclass)
-{
- GstElementClass *element_class = GST_ELEMENT_CLASS (gclass);
-
- gst_element_class_set_details_simple (element_class,
- "diffuse",
- "Transform/Effect/Video",
- "Diffuses the image by moving its pixels in random directions",
- "Thiago Santos<thiago.sousa.santos@collabora.co.uk>");
-}
-
static gboolean
diffuse_prepare (GstGeometricTransform * trans)
{
gst_diffuse_class_init (GstDiffuseClass * klass)
{
GObjectClass *gobject_class;
+ GstElementClass *gstelement_class;
GstGeometricTransformClass *gstgt_class;
gobject_class = (GObjectClass *) klass;
+ gstelement_class = (GstElementClass *) klass;
gstgt_class = (GstGeometricTransformClass *) klass;
parent_class = g_type_class_peek_parent (klass);
+ gst_element_class_set_details_simple (gstelement_class,
+ "diffuse",
+ "Transform/Effect/Video",
+ "Diffuses the image by moving its pixels in random directions",
+ "Thiago Santos<thiago.sousa.santos@collabora.co.uk>");
+
gobject_class->finalize = GST_DEBUG_FUNCPTR (gst_diffuse_finalize);
gobject_class->set_property = GST_DEBUG_FUNCPTR (gst_diffuse_set_property);
gobject_class->get_property = GST_DEBUG_FUNCPTR (gst_diffuse_get_property);
}
static void
-gst_diffuse_init (GstDiffuse * filter, GstDiffuseClass * gclass)
+gst_diffuse_init (GstDiffuse * filter)
{
GstGeometricTransform *gt = GST_GEOMETRIC_TRANSFORM (filter);
GST_DEBUG_CATEGORY_STATIC (gst_fisheye_debug);
#define GST_CAT_DEFAULT gst_fisheye_debug
-GST_BOILERPLATE (GstFisheye, gst_fisheye, GstGeometricTransform,
- GST_TYPE_GEOMETRIC_TRANSFORM);
-
-/* GObject vmethod implementations */
-
-static void
-gst_fisheye_base_init (gpointer gclass)
-{
- GstElementClass *element_class = GST_ELEMENT_CLASS (gclass);
-
- gst_element_class_set_details_simple (element_class,
- "fisheye",
- "Transform/Effect/Video",
- "Split the image into two halves and reflect one over each other",
- "Filippo Argiolas <filippo.argiolas@gmail.com>");
-}
+#define gst_fisheye_parent_class parent_class
+G_DEFINE_TYPE (GstFisheye, gst_fisheye, GST_TYPE_GEOMETRIC_TRANSFORM);
static gboolean
fisheye_map (GstGeometricTransform * gt, gint x, gint y, gdouble * in_x,
static void
gst_fisheye_class_init (GstFisheyeClass * klass)
{
+ GstElementClass *gstelement_class;
GstGeometricTransformClass *gstgt_class;
+ gstelement_class = (GstElementClass *) klass;
gstgt_class = (GstGeometricTransformClass *) klass;
parent_class = g_type_class_peek_parent (klass);
+ gst_element_class_set_details_simple (gstelement_class,
+ "fisheye",
+ "Transform/Effect/Video",
+ "Split the image into two halves and reflect one over each other",
+ "Filippo Argiolas <filippo.argiolas@gmail.com>");
gstgt_class->map_func = fisheye_map;
}
static void
-gst_fisheye_init (GstFisheye * filter, GstFisheyeClass * gclass)
+gst_fisheye_init (GstFisheye * filter)
{
GstGeometricTransform *gt = GST_GEOMETRIC_TRANSFORM (filter);
#include "gstgeometrictransform.h"
#include "geometricmath.h"
-#include <gst/controller/gstcontroller.h>
#include <string.h>
GST_DEBUG_CATEGORY_STATIC (geometric_transform_debug);
#define GST_CAT_DEFAULT geometric_transform_debug
static GstStaticPadTemplate gst_geometric_transform_src_template =
- GST_STATIC_PAD_TEMPLATE ("src",
+GST_STATIC_PAD_TEMPLATE ("src",
GST_PAD_SRC,
GST_PAD_ALWAYS,
- GST_STATIC_CAPS (GST_VIDEO_CAPS_ABGR "; "
- GST_VIDEO_CAPS_ARGB "; "
- GST_VIDEO_CAPS_BGR "; "
- GST_VIDEO_CAPS_BGRA "; "
- GST_VIDEO_CAPS_BGRx "; "
- GST_VIDEO_CAPS_RGB "; "
- GST_VIDEO_CAPS_RGBA "; "
- GST_VIDEO_CAPS_RGBx "; "
- GST_VIDEO_CAPS_YUV ("AYUV") "; "
- GST_VIDEO_CAPS_xBGR "; "
- GST_VIDEO_CAPS_xRGB "; "
- GST_VIDEO_CAPS_GRAY8 "; "
- GST_VIDEO_CAPS_GRAY16 ("BIG_ENDIAN") "; "
- GST_VIDEO_CAPS_GRAY16 ("LITTLE_ENDIAN")
- )
+ GST_STATIC_CAPS (GST_VIDEO_CAPS_MAKE ("{ ARGB, BGR, BGRA, BGRx, RGB, "
+ "RGBA, RGBx, AYUV, xBGR, xRGB, GRAY8, GRAY16_BE, GRAY16_LE }"))
);
static GstStaticPadTemplate gst_geometric_transform_sink_template =
- GST_STATIC_PAD_TEMPLATE ("sink",
+GST_STATIC_PAD_TEMPLATE ("sink",
GST_PAD_SINK,
GST_PAD_ALWAYS,
- GST_STATIC_CAPS (GST_VIDEO_CAPS_ABGR "; "
- GST_VIDEO_CAPS_ARGB "; "
- GST_VIDEO_CAPS_BGR "; "
- GST_VIDEO_CAPS_BGRA "; "
- GST_VIDEO_CAPS_BGRx "; "
- GST_VIDEO_CAPS_RGB "; "
- GST_VIDEO_CAPS_RGBA "; "
- GST_VIDEO_CAPS_RGBx "; "
- GST_VIDEO_CAPS_YUV ("AYUV") "; "
- GST_VIDEO_CAPS_xBGR "; "
- GST_VIDEO_CAPS_xRGB "; "
- GST_VIDEO_CAPS_GRAY8 "; "
- GST_VIDEO_CAPS_GRAY16 ("BIG_ENDIAN") "; "
- GST_VIDEO_CAPS_GRAY16 ("LITTLE_ENDIAN")
- )
+ GST_STATIC_CAPS (GST_VIDEO_CAPS_MAKE ("{ ARGB, BGR, BGRA, BGRx, RGB, "
+ "RGBA, RGBx, AYUV, xBGR, xRGB, GRAY8, GRAY16_BE, GRAY16_LE }"))
);
static GstVideoFilterClass *parent_class = NULL;
gint old_width;
gint old_height;
GstGeometricTransformClass *klass;
+ GstVideoInfo vinfo;
gt = GST_GEOMETRIC_TRANSFORM_CAST (btrans);
klass = GST_GEOMETRIC_TRANSFORM_GET_CLASS (gt);
old_width = gt->width;
old_height = gt->height;
- ret = gst_video_format_parse_caps (incaps, >->format, >->width,
- >->height);
+ ret = gst_video_info_from_caps (&vinfo, incaps);
if (ret) {
- gt->row_stride = gst_video_format_get_row_stride (gt->format, 0, gt->width);
- gt->pixel_stride = gst_video_format_get_pixel_stride (gt->format, 0);
+ gt->width = vinfo.width;
+ gt->height = vinfo.height;
+ gt->row_stride = vinfo.stride[0];
+ gt->pixel_stride = GST_VIDEO_INFO_COMP_PSTRIDE (&vinfo, 0);
/* regenerate the map */
GST_OBJECT_LOCK (gt);
/* only set the values if the values are valid */
if (trunc_x >= 0 && trunc_x < gt->width && trunc_y >= 0 &&
trunc_y < gt->height) {
+ GstMapInfo in_info;
+ GstMapInfo out_info;
+
+ if (!gst_buffer_map (outbuf, &out_info, GST_MAP_WRITE)) {
+ GST_WARNING_OBJECT (gt, "Failed to map output buffer");
+ return;
+ }
+ if (!gst_buffer_map (inbuf, &in_info, GST_MAP_READ)) {
+ GST_WARNING_OBJECT (gt, "Failed to map input buffer");
+ gst_buffer_unmap (outbuf, &out_info);
+ return;
+ }
+
in_offset = trunc_y * gt->row_stride + trunc_x * gt->pixel_stride;
- memcpy (GST_BUFFER_DATA (outbuf) + out_offset,
- GST_BUFFER_DATA (inbuf) + in_offset, gt->pixel_stride);
+ memcpy (out_info.data + out_offset,
+ in_info.data + in_offset, gt->pixel_stride);
+
+ gst_buffer_unmap (outbuf, &out_info);
+ gst_buffer_unmap (inbuf, &in_info);
}
}
}
gint x, y;
GstFlowReturn ret = GST_FLOW_OK;
gdouble *ptr;
+ GstMapInfo out_info;
gt = GST_GEOMETRIC_TRANSFORM_CAST (trans);
klass = GST_GEOMETRIC_TRANSFORM_GET_CLASS (gt);
- memset (GST_BUFFER_DATA (outbuf), 0, GST_BUFFER_SIZE (outbuf));
+ gst_buffer_map (outbuf, &out_info, GST_MAP_WRITE);
+ memset (out_info.data, 0, out_info.size);
GST_OBJECT_LOCK (gt);
if (gt->precalc_map) {
if (gt->needs_remap) {
if (klass->prepare_func)
if (!klass->prepare_func (gt)) {
- GST_OBJECT_UNLOCK (gt);
- return FALSE;
+ ret = FALSE;
+ goto end;
}
gst_geometric_transform_generate_map (gt);
}
}
end:
GST_OBJECT_UNLOCK (gt);
+ gst_buffer_unmap (outbuf, &out_info);
return ret;
}
#define DEFAULT_ANGLE2 0
#define DEFAULT_SIDES 3
-GST_BOILERPLATE (GstKaleidoscope, gst_kaleidoscope, GstCircleGeometricTransform,
+#define gst_kaleidoscope_parent_class parent_class
+G_DEFINE_TYPE (GstKaleidoscope, gst_kaleidoscope,
GST_TYPE_CIRCLE_GEOMETRIC_TRANSFORM);
static void
G_OBJECT_CLASS (parent_class)->finalize (obj);
}
-/* GObject vmethod implementations */
-
-static void
-gst_kaleidoscope_base_init (gpointer gclass)
-{
- GstElementClass *element_class = GST_ELEMENT_CLASS (gclass);
-
- gst_element_class_set_details_simple (element_class,
- "kaleidoscope",
- "Transform/Effect/Video",
- "Applies 'kaleidoscope' geometric transform to the image",
- "Thiago Santos<thiago.sousa.santos@collabora.co.uk>");
-}
-
static gboolean
kaleidoscope_map (GstGeometricTransform * gt, gint x, gint y, gdouble * in_x,
gdouble * in_y)
gst_kaleidoscope_class_init (GstKaleidoscopeClass * klass)
{
GObjectClass *gobject_class;
+ GstElementClass *gstelement_class;
GstGeometricTransformClass *gstgt_class;
gobject_class = (GObjectClass *) klass;
+ gstelement_class = (GstElementClass *) klass;
gstgt_class = (GstGeometricTransformClass *) klass;
parent_class = g_type_class_peek_parent (klass);
+ gst_element_class_set_details_simple (gstelement_class,
+ "kaleidoscope",
+ "Transform/Effect/Video",
+ "Applies 'kaleidoscope' geometric transform to the image",
+ "Thiago Santos<thiago.sousa.santos@collabora.co.uk>");
+
gobject_class->finalize = GST_DEBUG_FUNCPTR (gst_kaleidoscope_finalize);
gobject_class->set_property =
GST_DEBUG_FUNCPTR (gst_kaleidoscope_set_property);
}
static void
-gst_kaleidoscope_init (GstKaleidoscope * filter, GstKaleidoscopeClass * gclass)
+gst_kaleidoscope_init (GstKaleidoscope * filter)
{
GstGeometricTransform *gt = GST_GEOMETRIC_TRANSFORM (filter);
#define DEFAULT_AMOUNT 1
#define DEFAULT_TURBULENCE 1
-GST_BOILERPLATE (GstMarble, gst_marble, GstGeometricTransform,
- GST_TYPE_GEOMETRIC_TRANSFORM);
+#define gst_marble_parent_class parent_class
+G_DEFINE_TYPE (GstMarble, gst_marble, GST_TYPE_GEOMETRIC_TRANSFORM);
static void
gst_marble_set_property (GObject * object, guint prop_id, const GValue * value,
G_OBJECT_CLASS (parent_class)->finalize (obj);
}
-/* GObject vmethod implementations */
-
-static void
-gst_marble_base_init (gpointer gclass)
-{
- GstElementClass *element_class = GST_ELEMENT_CLASS (gclass);
-
- gst_element_class_set_details_simple (element_class,
- "marble",
- "Transform/Effect/Video",
- "Applies a marbling effect to the image",
- "Thiago Santos<thiago.sousa.santos@collabora.co.uk>");
-}
-
static gboolean
marble_prepare (GstGeometricTransform * trans)
{
gst_marble_class_init (GstMarbleClass * klass)
{
GObjectClass *gobject_class;
+ GstElementClass *gstelement_class;
GstGeometricTransformClass *gstgt_class;
gobject_class = (GObjectClass *) klass;
+ gstelement_class = (GstElementClass *) klass;
gstgt_class = (GstGeometricTransformClass *) klass;
parent_class = g_type_class_peek_parent (klass);
+ gst_element_class_set_details_simple (gstelement_class,
+ "marble",
+ "Transform/Effect/Video",
+ "Applies a marbling effect to the image",
+ "Thiago Santos<thiago.sousa.santos@collabora.co.uk>");
+
gobject_class->finalize = GST_DEBUG_FUNCPTR (gst_marble_finalize);
gobject_class->set_property = GST_DEBUG_FUNCPTR (gst_marble_set_property);
gobject_class->get_property = GST_DEBUG_FUNCPTR (gst_marble_get_property);
}
static void
-gst_marble_init (GstMarble * filter, GstMarbleClass * gclass)
+gst_marble_init (GstMarble * filter)
{
GstGeometricTransform *gt = GST_GEOMETRIC_TRANSFORM (filter);
#define DEFAULT_PROP_MODE GST_MIRROR_MODE_LEFT
-GST_BOILERPLATE (GstMirror, gst_mirror, GstGeometricTransform,
- GST_TYPE_GEOMETRIC_TRANSFORM);
+#define gst_mirror_parent_class parent_class
+G_DEFINE_TYPE (GstMirror, gst_mirror, GST_TYPE_GEOMETRIC_TRANSFORM);
#define GST_TYPE_MIRROR_MODE (gst_mirror_mode_get_type())
static GType
}
}
-static void
-gst_mirror_base_init (gpointer gclass)
-{
- GstElementClass *element_class = GST_ELEMENT_CLASS (gclass);
-
- gst_element_class_set_details_simple (element_class,
- "mirror",
- "Transform/Effect/Video",
- "Split the image into two halves and reflect one over each other",
- "Filippo Argiolas <filippo.argiolas@gmail.com>");
-}
-
static gboolean
mirror_map (GstGeometricTransform * gt, gint x, gint y, gdouble * in_x,
gdouble * in_y)
gst_mirror_class_init (GstMirrorClass * klass)
{
GObjectClass *gobject_class;
+ GstElementClass *gstelement_class;
GstGeometricTransformClass *gstgt_class;
gobject_class = (GObjectClass *) klass;
+ gstelement_class = (GstElementClass *) klass;
gstgt_class = (GstGeometricTransformClass *) klass;
+ gst_element_class_set_details_simple (gstelement_class,
+ "mirror",
+ "Transform/Effect/Video",
+ "Split the image into two halves and reflect one over each other",
+ "Filippo Argiolas <filippo.argiolas@gmail.com>");
+
gobject_class->set_property = gst_mirror_set_property;
gobject_class->get_property = gst_mirror_get_property;
}
static void
-gst_mirror_init (GstMirror * filter, GstMirrorClass * gclass)
+gst_mirror_init (GstMirror * filter)
{
GstGeometricTransform *gt = GST_GEOMETRIC_TRANSFORM (filter);
#define DEFAULT_INTENSITY 0.5
-GST_BOILERPLATE (GstPinch, gst_pinch, GstCircleGeometricTransform,
- GST_TYPE_CIRCLE_GEOMETRIC_TRANSFORM);
+#define gst_pinch_parent_class parent_class
+G_DEFINE_TYPE (GstPinch, gst_pinch, GST_TYPE_CIRCLE_GEOMETRIC_TRANSFORM);
static void
gst_pinch_set_property (GObject * object, guint prop_id, const GValue * value,
G_OBJECT_CLASS (parent_class)->finalize (obj);
}
-/* GObject vmethod implementations */
-
-static void
-gst_pinch_base_init (gpointer gclass)
-{
- GstElementClass *element_class = GST_ELEMENT_CLASS (gclass);
-
- gst_element_class_set_details_simple (element_class,
- "pinch",
- "Transform/Effect/Video",
- "Applies 'pinch' geometric transform to the image",
- "Thiago Santos<thiago.sousa.santos@collabora.co.uk>");
-}
-
static gboolean
pinch_map (GstGeometricTransform * gt, gint x, gint y, gdouble * in_x,
gdouble * in_y)
gst_pinch_class_init (GstPinchClass * klass)
{
GObjectClass *gobject_class;
+ GstElementClass *gstelement_class;
GstGeometricTransformClass *gstgt_class;
gobject_class = (GObjectClass *) klass;
+ gstelement_class = (GstElementClass *) klass;
gstgt_class = (GstGeometricTransformClass *) klass;
parent_class = g_type_class_peek_parent (klass);
+ gst_element_class_set_details_simple (gstelement_class,
+ "pinch",
+ "Transform/Effect/Video",
+ "Applies 'pinch' geometric transform to the image",
+ "Thiago Santos<thiago.sousa.santos@collabora.co.uk>");
+
gobject_class->finalize = GST_DEBUG_FUNCPTR (gst_pinch_finalize);
gobject_class->set_property = GST_DEBUG_FUNCPTR (gst_pinch_set_property);
gobject_class->get_property = GST_DEBUG_FUNCPTR (gst_pinch_get_property);
}
static void
-gst_pinch_init (GstPinch * filter, GstPinchClass * gclass)
+gst_pinch_init (GstPinch * filter)
{
GstGeometricTransform *gt = GST_GEOMETRIC_TRANSFORM (filter);
#define DEFAULT_ANGLE 0
-GST_BOILERPLATE (GstRotate, gst_rotate, GstGeometricTransform,
- GST_TYPE_GEOMETRIC_TRANSFORM);
+#define gst_rotate_parent_class parent_class
+G_DEFINE_TYPE (GstRotate, gst_rotate, GST_TYPE_GEOMETRIC_TRANSFORM);
static void
gst_rotate_set_property (GObject * object, guint prop_id, const GValue * value,
G_OBJECT_CLASS (parent_class)->finalize (obj);
}
-/* GObject vmethod implementations */
-
-static void
-gst_rotate_base_init (gpointer gclass)
-{
- GstElementClass *element_class = GST_ELEMENT_CLASS (gclass);
-
- gst_element_class_set_details_simple (element_class,
- "rotate",
- "Transform/Effect/Video",
- "Rotates the picture by an arbitrary angle",
- "Thiago Santos<thiago.sousa.santos@collabora.co.uk>");
-}
-
static gboolean
rotate_map (GstGeometricTransform * gt, gint x, gint y, gdouble * in_x,
gdouble * in_y)
gst_rotate_class_init (GstRotateClass * klass)
{
GObjectClass *gobject_class;
+ GstElementClass *gstelement_class;
GstGeometricTransformClass *gstgt_class;
gobject_class = (GObjectClass *) klass;
+ gstelement_class = (GstElementClass *) klass;
gstgt_class = (GstGeometricTransformClass *) klass;
parent_class = g_type_class_peek_parent (klass);
+ gst_element_class_set_details_simple (gstelement_class,
+ "rotate",
+ "Transform/Effect/Video",
+ "Rotates the picture by an arbitrary angle",
+ "Thiago Santos<thiago.sousa.santos@collabora.co.uk>");
+
gobject_class->finalize = GST_DEBUG_FUNCPTR (gst_rotate_finalize);
gobject_class->set_property = GST_DEBUG_FUNCPTR (gst_rotate_set_property);
gobject_class->get_property = GST_DEBUG_FUNCPTR (gst_rotate_get_property);
}
static void
-gst_rotate_init (GstRotate * filter, GstRotateClass * gclass)
+gst_rotate_init (GstRotate * filter)
{
filter->angle = DEFAULT_ANGLE;
}
#define DEFAULT_REFRACTION 1.5
-GST_BOILERPLATE (GstSphere, gst_sphere, GstCircleGeometricTransform,
- GST_TYPE_CIRCLE_GEOMETRIC_TRANSFORM);
+#define gst_sphere_parent_class parent_class
+G_DEFINE_TYPE (GstSphere, gst_sphere, GST_TYPE_CIRCLE_GEOMETRIC_TRANSFORM);
static void
gst_sphere_set_property (GObject * object, guint prop_id, const GValue * value,
G_OBJECT_CLASS (parent_class)->finalize (obj);
}
-/* GObject vmethod implementations */
-
-static void
-gst_sphere_base_init (gpointer gclass)
-{
- GstElementClass *element_class = GST_ELEMENT_CLASS (gclass);
-
- gst_element_class_set_details_simple (element_class,
- "sphere",
- "Transform/Effect/Video",
- "Applies 'sphere' geometric transform to the image",
- "Thiago Santos<thiago.sousa.santos@collabora.co.uk>");
-}
-
/* TODO we could have horizontal and vertical 'radius' */
static gboolean
sphere_map (GstGeometricTransform * gt, gint x, gint y, gdouble * in_x,
gst_sphere_class_init (GstSphereClass * klass)
{
GObjectClass *gobject_class;
+ GstElementClass *gstelement_class;
GstGeometricTransformClass *gstgt_class;
gobject_class = (GObjectClass *) klass;
+ gstelement_class = (GstElementClass *) klass;
gstgt_class = (GstGeometricTransformClass *) klass;
parent_class = g_type_class_peek_parent (klass);
+ gst_element_class_set_details_simple (gstelement_class,
+ "sphere",
+ "Transform/Effect/Video",
+ "Applies 'sphere' geometric transform to the image",
+ "Thiago Santos<thiago.sousa.santos@collabora.co.uk>");
+
gobject_class->finalize = GST_DEBUG_FUNCPTR (gst_sphere_finalize);
gobject_class->set_property = GST_DEBUG_FUNCPTR (gst_sphere_set_property);
gobject_class->get_property = GST_DEBUG_FUNCPTR (gst_sphere_get_property);
}
static void
-gst_sphere_init (GstSphere * filter, GstSphereClass * gclass)
+gst_sphere_init (GstSphere * filter)
{
GstGeometricTransform *gt = GST_GEOMETRIC_TRANSFORM (filter);
#define DEFAULT_HEIGHT 0.5
#define DEFAULT_ZOOM 2.0
-GST_BOILERPLATE (GstSquare, gst_square, GstGeometricTransform,
- GST_TYPE_GEOMETRIC_TRANSFORM);
+#define gst_square_parent_class parent_class
+G_DEFINE_TYPE (GstSquare, gst_square, GST_TYPE_GEOMETRIC_TRANSFORM);
/* GObject vmethod implementations */
}
}
-static void
-gst_square_base_init (gpointer gclass)
-{
- GstElementClass *element_class = GST_ELEMENT_CLASS (gclass);
-
- gst_element_class_set_details_simple (element_class,
- "square",
- "Transform/Effect/Video",
- "Distort center part of the image into a square",
- "Filippo Argiolas <filippo.argiolas@gmail.com>");
-}
-
static gboolean
square_map (GstGeometricTransform * gt, gint x, gint y, gdouble * in_x,
gdouble * in_y)
gst_square_class_init (GstSquareClass * klass)
{
GObjectClass *gobject_class;
+ GstElementClass *gstelement_class;
GstGeometricTransformClass *gstgt_class;
gobject_class = (GObjectClass *) klass;
+ gstelement_class = (GstElementClass *) klass;
gstgt_class = (GstGeometricTransformClass *) klass;
parent_class = g_type_class_peek_parent (klass);
+
+ gst_element_class_set_details_simple (gstelement_class,
+ "square",
+ "Transform/Effect/Video",
+ "Distort center part of the image into a square",
+ "Filippo Argiolas <filippo.argiolas@gmail.com>");
+
gobject_class->set_property = GST_DEBUG_FUNCPTR (gst_square_set_property);
gobject_class->get_property = GST_DEBUG_FUNCPTR (gst_square_get_property);
}
static void
-gst_square_init (GstSquare * filter, GstSquareClass * gclass)
+gst_square_init (GstSquare * filter)
{
GstGeometricTransform *gt = GST_GEOMETRIC_TRANSFORM (filter);
#define DEFAULT_INTENSITY 0.5
#define MAX_SHRINK_AMOUNT 3.0
-GST_BOILERPLATE (GstStretch, gst_stretch, GstCircleGeometricTransform,
- GST_TYPE_CIRCLE_GEOMETRIC_TRANSFORM);
+#define gst_stretch_parent_class parent_class
+G_DEFINE_TYPE (GstStretch, gst_stretch, GST_TYPE_CIRCLE_GEOMETRIC_TRANSFORM);
static void
gst_stretch_set_property (GObject * object, guint prop_id, const GValue * value,
G_OBJECT_CLASS (parent_class)->finalize (obj);
}
-/* GObject vmethod implementations */
-
-static void
-gst_stretch_base_init (gpointer gclass)
-{
- GstElementClass *element_class = GST_ELEMENT_CLASS (gclass);
-
- gst_element_class_set_details_simple (element_class,
- "stretch",
- "Transform/Effect/Video",
- "Stretch the image in a circle around the center point",
- "Filippo Argiolas <filippo.argiolas@gmail.com>");
-}
-
static gboolean
stretch_map (GstGeometricTransform * gt, gint x, gint y, gdouble * in_x,
gdouble * in_y)
gst_stretch_class_init (GstStretchClass * klass)
{
GObjectClass *gobject_class;
+ GstElementClass *gstelement_class;
GstGeometricTransformClass *gstgt_class;
gobject_class = (GObjectClass *) klass;
+ gstelement_class = (GstElementClass *) klass;
gstgt_class = (GstGeometricTransformClass *) klass;
parent_class = g_type_class_peek_parent (klass);
+ gst_element_class_set_details_simple (gstelement_class,
+ "stretch",
+ "Transform/Effect/Video",
+ "Stretch the image in a circle around the center point",
+ "Filippo Argiolas <filippo.argiolas@gmail.com>");
+
gobject_class->set_property = GST_DEBUG_FUNCPTR (gst_stretch_set_property);
gobject_class->get_property = GST_DEBUG_FUNCPTR (gst_stretch_get_property);
}
static void
-gst_stretch_init (GstStretch * filter, GstStretchClass * gclass)
+gst_stretch_init (GstStretch * filter)
{
GstGeometricTransform *gt = GST_GEOMETRIC_TRANSFORM (filter);
GST_DEBUG_CATEGORY_STATIC (gst_tunnel_debug);
#define GST_CAT_DEFAULT gst_tunnel_debug
-GST_BOILERPLATE (GstTunnel, gst_tunnel, GstCircleGeometricTransform,
- GST_TYPE_CIRCLE_GEOMETRIC_TRANSFORM);
+#define gst_tunnel_parent_class parent_class
+G_DEFINE_TYPE (GstTunnel, gst_tunnel, GST_TYPE_CIRCLE_GEOMETRIC_TRANSFORM);
/* Clean up */
static void
G_OBJECT_CLASS (parent_class)->finalize (obj);
}
-/* GObject vmethod implementations */
-
-static void
-gst_tunnel_base_init (gpointer gclass)
-{
- GstElementClass *element_class = GST_ELEMENT_CLASS (gclass);
-
- gst_element_class_set_details_simple (element_class,
- "tunnel",
- "Transform/Effect/Video",
- "Light tunnel effect", "Filippo Argiolas <filippo.argiolas@gmail.com>");
-}
-
static gboolean
tunnel_map (GstGeometricTransform * gt, gint x, gint y, gdouble * in_x,
gdouble * in_y)
gst_tunnel_class_init (GstTunnelClass * klass)
{
GObjectClass *gobject_class;
+ GstElementClass *gstelement_class;
GstGeometricTransformClass *gstgt_class;
gobject_class = (GObjectClass *) klass;
+ gstelement_class = (GstElementClass *) klass;
gstgt_class = (GstGeometricTransformClass *) klass;
parent_class = g_type_class_peek_parent (klass);
+ gst_element_class_set_details_simple (gstelement_class,
+ "tunnel",
+ "Transform/Effect/Video",
+ "Light tunnel effect", "Filippo Argiolas <filippo.argiolas@gmail.com>");
+
gobject_class->finalize = GST_DEBUG_FUNCPTR (gst_tunnel_finalize);
gstgt_class->map_func = tunnel_map;
}
static void
-gst_tunnel_init (GstTunnel * filter, GstTunnelClass * gclass)
+gst_tunnel_init (GstTunnel * filter)
{
GstGeometricTransform *gt = GST_GEOMETRIC_TRANSFORM (filter);
#define DEFAULT_ANGLE (G_PI)
-GST_BOILERPLATE (GstTwirl, gst_twirl, GstCircleGeometricTransform,
- GST_TYPE_CIRCLE_GEOMETRIC_TRANSFORM);
+#define gst_twirl_parent_class parent_class
+G_DEFINE_TYPE (GstTwirl, gst_twirl, GST_TYPE_CIRCLE_GEOMETRIC_TRANSFORM);
static void
gst_twirl_set_property (GObject * object, guint prop_id, const GValue * value,
G_OBJECT_CLASS (parent_class)->finalize (obj);
}
-/* GObject vmethod implementations */
-
-static void
-gst_twirl_base_init (gpointer gclass)
-{
- GstElementClass *element_class = GST_ELEMENT_CLASS (gclass);
-
- gst_element_class_set_details_simple (element_class,
- "twirl",
- "Transform/Effect/Video",
- "Twists the image from the center out",
- "Thiago Santos<thiago.sousa.santos@collabora.co.uk>");
-}
-
static gboolean
twirl_map (GstGeometricTransform * gt, gint x, gint y, gdouble * in_x,
gdouble * in_y)
gst_twirl_class_init (GstTwirlClass * klass)
{
GObjectClass *gobject_class;
+ GstElementClass *gstelement_class;
GstGeometricTransformClass *gstgt_class;
gobject_class = (GObjectClass *) klass;
+ gstelement_class = (GstElementClass *) klass;
gstgt_class = (GstGeometricTransformClass *) klass;
parent_class = g_type_class_peek_parent (klass);
+ gst_element_class_set_details_simple (gstelement_class,
+ "twirl",
+ "Transform/Effect/Video",
+ "Twists the image from the center out",
+ "Thiago Santos<thiago.sousa.santos@collabora.co.uk>");
+
gobject_class->finalize = GST_DEBUG_FUNCPTR (gst_twirl_finalize);
gobject_class->set_property = GST_DEBUG_FUNCPTR (gst_twirl_set_property);
gobject_class->get_property = GST_DEBUG_FUNCPTR (gst_twirl_get_property);
}
static void
-gst_twirl_init (GstTwirl * filter, GstTwirlClass * gclass)
+gst_twirl_init (GstTwirl * filter)
{
GstGeometricTransform *gt = GST_GEOMETRIC_TRANSFORM (filter);
#define DEFAULT_PHASE 0.0
#define DEFAULT_WAVELENGTH 16.0
-GST_BOILERPLATE (GstWaterRipple, gst_water_ripple, GstCircleGeometricTransform,
+#define gst_water_ripple_parent_class parent_class
+G_DEFINE_TYPE (GstWaterRipple, gst_water_ripple,
GST_TYPE_CIRCLE_GEOMETRIC_TRANSFORM);
static void
G_OBJECT_CLASS (parent_class)->finalize (obj);
}
-/* GObject vmethod implementations */
-
-static void
-gst_water_ripple_base_init (gpointer gclass)
-{
- GstElementClass *element_class = GST_ELEMENT_CLASS (gclass);
-
- gst_element_class_set_details_simple (element_class,
- "waterripple",
- "Transform/Effect/Video",
- "Creates a water ripple effect on the image",
- "Thiago Santos<thiago.sousa.santos@collabora.co.uk>");
-}
-
static gboolean
water_ripple_map (GstGeometricTransform * gt, gint x, gint y, gdouble * in_x,
gdouble * in_y)
gst_water_ripple_class_init (GstWaterRippleClass * klass)
{
GObjectClass *gobject_class;
+ GstElementClass *gstelement_class;
GstGeometricTransformClass *gstgt_class;
gobject_class = (GObjectClass *) klass;
+ gstelement_class = (GstElementClass *) klass;
gstgt_class = (GstGeometricTransformClass *) klass;
parent_class = g_type_class_peek_parent (klass);
+ gst_element_class_set_details_simple (gstelement_class,
+ "waterripple",
+ "Transform/Effect/Video",
+ "Creates a water ripple effect on the image",
+ "Thiago Santos<thiago.sousa.santos@collabora.co.uk>");
+
gobject_class->finalize = GST_DEBUG_FUNCPTR (gst_water_ripple_finalize);
gobject_class->set_property =
GST_DEBUG_FUNCPTR (gst_water_ripple_set_property);
}
static void
-gst_water_ripple_init (GstWaterRipple * filter, GstWaterRippleClass * gclass)
+gst_water_ripple_init (GstWaterRipple * filter)
{
GstGeometricTransform *gt = GST_GEOMETRIC_TRANSFORM (filter);