mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-27 09:38:17 +00:00
geometrictransform: port to 1.0
Straightforward port of geometrictransform plugin
This commit is contained in:
parent
c31d275aff
commit
d5f2feb8ec
17 changed files with 201 additions and 289 deletions
|
@ -303,7 +303,7 @@ dnl Make sure you have a space before and after all plugins
|
||||||
GST_PLUGINS_NONPORTED=" aiff asfmux \
|
GST_PLUGINS_NONPORTED=" aiff asfmux \
|
||||||
camerabin cdxaparse coloreffects \
|
camerabin cdxaparse coloreffects \
|
||||||
dccp faceoverlay festival \
|
dccp faceoverlay festival \
|
||||||
fieldanalysis freeverb freeze frei0r gaudieffects geometrictransform \
|
fieldanalysis freeverb freeze frei0r gaudieffects \
|
||||||
hdvparse hls id3tag inter interlace ivfparse jpegformat jp2kdecimator \
|
hdvparse hls id3tag inter interlace ivfparse jpegformat jp2kdecimator \
|
||||||
kate liveadder legacyresample librfb mpegtsmux \
|
kate liveadder legacyresample librfb mpegtsmux \
|
||||||
mpegpsmux mve mxf mythtv nsf nuvdemux \
|
mpegpsmux mve mxf mythtv nsf nuvdemux \
|
||||||
|
|
|
@ -62,8 +62,8 @@ enum
|
||||||
|
|
||||||
#define DEFAULT_ZOOM 3.0
|
#define DEFAULT_ZOOM 3.0
|
||||||
|
|
||||||
GST_BOILERPLATE (GstBulge, gst_bulge, GstCircleGeometricTransform,
|
#define gst_bulge_parent_class parent_class
|
||||||
GST_TYPE_CIRCLE_GEOMETRIC_TRANSFORM);
|
G_DEFINE_TYPE (GstBulge, gst_bulge, GST_TYPE_CIRCLE_GEOMETRIC_TRANSFORM);
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gst_bulge_set_property (GObject * object, guint prop_id, const GValue * value,
|
gst_bulge_set_property (GObject * object, guint prop_id, const GValue * value,
|
||||||
|
@ -117,20 +117,6 @@ gst_bulge_finalize (GObject * obj)
|
||||||
G_OBJECT_CLASS (parent_class)->finalize (obj);
|
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
|
static gboolean
|
||||||
bulge_map (GstGeometricTransform * gt, gint x, gint y, gdouble * in_x,
|
bulge_map (GstGeometricTransform * gt, gint x, gint y, gdouble * in_x,
|
||||||
gdouble * in_y)
|
gdouble * in_y)
|
||||||
|
@ -181,13 +167,21 @@ static void
|
||||||
gst_bulge_class_init (GstBulgeClass * klass)
|
gst_bulge_class_init (GstBulgeClass * klass)
|
||||||
{
|
{
|
||||||
GObjectClass *gobject_class;
|
GObjectClass *gobject_class;
|
||||||
|
GstElementClass *gstelement_class;
|
||||||
GstGeometricTransformClass *gstgt_class;
|
GstGeometricTransformClass *gstgt_class;
|
||||||
|
|
||||||
gobject_class = (GObjectClass *) klass;
|
gobject_class = (GObjectClass *) klass;
|
||||||
|
gstelement_class = (GstElementClass *) klass;
|
||||||
gstgt_class = (GstGeometricTransformClass *) klass;
|
gstgt_class = (GstGeometricTransformClass *) klass;
|
||||||
|
|
||||||
parent_class = g_type_class_peek_parent (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->set_property = GST_DEBUG_FUNCPTR (gst_bulge_set_property);
|
||||||
gobject_class->get_property = GST_DEBUG_FUNCPTR (gst_bulge_get_property);
|
gobject_class->get_property = GST_DEBUG_FUNCPTR (gst_bulge_get_property);
|
||||||
|
|
||||||
|
@ -204,7 +198,7 @@ gst_bulge_class_init (GstBulgeClass * klass)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gst_bulge_init (GstBulge * filter, GstBulgeClass * gclass)
|
gst_bulge_init (GstBulge * filter)
|
||||||
{
|
{
|
||||||
GstGeometricTransform *gt = GST_GEOMETRIC_TRANSFORM (filter);
|
GstGeometricTransform *gt = GST_GEOMETRIC_TRANSFORM (filter);
|
||||||
|
|
||||||
|
|
|
@ -74,8 +74,8 @@ enum
|
||||||
#define DEFAULT_HEIGHT 20
|
#define DEFAULT_HEIGHT 20
|
||||||
#define DEFAULT_SPREAD_ANGLE G_PI
|
#define DEFAULT_SPREAD_ANGLE G_PI
|
||||||
|
|
||||||
GST_BOILERPLATE (GstCircle, gst_circle, GstCircleGeometricTransform,
|
#define gst_circle_parent_class parent_class
|
||||||
GST_TYPE_CIRCLE_GEOMETRIC_TRANSFORM);
|
G_DEFINE_TYPE (GstCircle, gst_circle, GST_TYPE_CIRCLE_GEOMETRIC_TRANSFORM);
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gst_circle_set_property (GObject * object, guint prop_id, const GValue * value,
|
gst_circle_set_property (GObject * object, guint prop_id, const GValue * value,
|
||||||
|
@ -150,20 +150,6 @@ gst_circle_finalize (GObject * obj)
|
||||||
G_OBJECT_CLASS (parent_class)->finalize (obj);
|
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
|
static gboolean
|
||||||
circle_map (GstGeometricTransform * gt, gint x, gint y, gdouble * in_x,
|
circle_map (GstGeometricTransform * gt, gint x, gint y, gdouble * in_x,
|
||||||
gdouble * in_y)
|
gdouble * in_y)
|
||||||
|
@ -196,13 +182,21 @@ static void
|
||||||
gst_circle_class_init (GstCircleClass * klass)
|
gst_circle_class_init (GstCircleClass * klass)
|
||||||
{
|
{
|
||||||
GObjectClass *gobject_class;
|
GObjectClass *gobject_class;
|
||||||
|
GstElementClass *gstelement_class;
|
||||||
GstGeometricTransformClass *gstgt_class;
|
GstGeometricTransformClass *gstgt_class;
|
||||||
|
|
||||||
gobject_class = (GObjectClass *) klass;
|
gobject_class = (GObjectClass *) klass;
|
||||||
|
gstelement_class = (GstElementClass *) klass;
|
||||||
gstgt_class = (GstGeometricTransformClass *) klass;
|
gstgt_class = (GstGeometricTransformClass *) klass;
|
||||||
|
|
||||||
parent_class = g_type_class_peek_parent (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->finalize = GST_DEBUG_FUNCPTR (gst_circle_finalize);
|
||||||
gobject_class->set_property = GST_DEBUG_FUNCPTR (gst_circle_set_property);
|
gobject_class->set_property = GST_DEBUG_FUNCPTR (gst_circle_set_property);
|
||||||
gobject_class->get_property = GST_DEBUG_FUNCPTR (gst_circle_get_property);
|
gobject_class->get_property = GST_DEBUG_FUNCPTR (gst_circle_get_property);
|
||||||
|
@ -227,7 +221,7 @@ gst_circle_class_init (GstCircleClass * klass)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gst_circle_init (GstCircle * filter, GstCircleClass * gclass)
|
gst_circle_init (GstCircle * filter)
|
||||||
{
|
{
|
||||||
filter->angle = DEFAULT_ANGLE;
|
filter->angle = DEFAULT_ANGLE;
|
||||||
filter->spread_angle = DEFAULT_SPREAD_ANGLE;
|
filter->spread_angle = DEFAULT_SPREAD_ANGLE;
|
||||||
|
|
|
@ -68,8 +68,8 @@ enum
|
||||||
|
|
||||||
#define DEFAULT_SCALE 4
|
#define DEFAULT_SCALE 4
|
||||||
|
|
||||||
GST_BOILERPLATE (GstDiffuse, gst_diffuse, GstGeometricTransform,
|
#define gst_diffuse_parent_class parent_class
|
||||||
GST_TYPE_GEOMETRIC_TRANSFORM);
|
G_DEFINE_TYPE (GstDiffuse, gst_diffuse, GST_TYPE_GEOMETRIC_TRANSFORM);
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gst_diffuse_set_property (GObject * object, guint prop_id, const GValue * value,
|
gst_diffuse_set_property (GObject * object, guint prop_id, const GValue * value,
|
||||||
|
@ -130,18 +130,6 @@ gst_diffuse_finalize (GObject * obj)
|
||||||
|
|
||||||
/* GObject vmethod implementations */
|
/* 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
|
static gboolean
|
||||||
diffuse_prepare (GstGeometricTransform * trans)
|
diffuse_prepare (GstGeometricTransform * trans)
|
||||||
{
|
{
|
||||||
|
@ -187,13 +175,21 @@ static void
|
||||||
gst_diffuse_class_init (GstDiffuseClass * klass)
|
gst_diffuse_class_init (GstDiffuseClass * klass)
|
||||||
{
|
{
|
||||||
GObjectClass *gobject_class;
|
GObjectClass *gobject_class;
|
||||||
|
GstElementClass *gstelement_class;
|
||||||
GstGeometricTransformClass *gstgt_class;
|
GstGeometricTransformClass *gstgt_class;
|
||||||
|
|
||||||
gobject_class = (GObjectClass *) klass;
|
gobject_class = (GObjectClass *) klass;
|
||||||
|
gstelement_class = (GstElementClass *) klass;
|
||||||
gstgt_class = (GstGeometricTransformClass *) klass;
|
gstgt_class = (GstGeometricTransformClass *) klass;
|
||||||
|
|
||||||
parent_class = g_type_class_peek_parent (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->finalize = GST_DEBUG_FUNCPTR (gst_diffuse_finalize);
|
||||||
gobject_class->set_property = GST_DEBUG_FUNCPTR (gst_diffuse_set_property);
|
gobject_class->set_property = GST_DEBUG_FUNCPTR (gst_diffuse_set_property);
|
||||||
gobject_class->get_property = GST_DEBUG_FUNCPTR (gst_diffuse_get_property);
|
gobject_class->get_property = GST_DEBUG_FUNCPTR (gst_diffuse_get_property);
|
||||||
|
@ -209,7 +205,7 @@ gst_diffuse_class_init (GstDiffuseClass * klass)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gst_diffuse_init (GstDiffuse * filter, GstDiffuseClass * gclass)
|
gst_diffuse_init (GstDiffuse * filter)
|
||||||
{
|
{
|
||||||
GstGeometricTransform *gt = GST_GEOMETRIC_TRANSFORM (filter);
|
GstGeometricTransform *gt = GST_GEOMETRIC_TRANSFORM (filter);
|
||||||
|
|
||||||
|
|
|
@ -53,22 +53,8 @@
|
||||||
GST_DEBUG_CATEGORY_STATIC (gst_fisheye_debug);
|
GST_DEBUG_CATEGORY_STATIC (gst_fisheye_debug);
|
||||||
#define GST_CAT_DEFAULT gst_fisheye_debug
|
#define GST_CAT_DEFAULT gst_fisheye_debug
|
||||||
|
|
||||||
GST_BOILERPLATE (GstFisheye, gst_fisheye, GstGeometricTransform,
|
#define gst_fisheye_parent_class parent_class
|
||||||
GST_TYPE_GEOMETRIC_TRANSFORM);
|
G_DEFINE_TYPE (GstFisheye, gst_fisheye, 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>");
|
|
||||||
}
|
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
fisheye_map (GstGeometricTransform * gt, gint x, gint y, gdouble * in_x,
|
fisheye_map (GstGeometricTransform * gt, gint x, gint y, gdouble * in_x,
|
||||||
|
@ -123,17 +109,24 @@ fisheye_map (GstGeometricTransform * gt, gint x, gint y, gdouble * in_x,
|
||||||
static void
|
static void
|
||||||
gst_fisheye_class_init (GstFisheyeClass * klass)
|
gst_fisheye_class_init (GstFisheyeClass * klass)
|
||||||
{
|
{
|
||||||
|
GstElementClass *gstelement_class;
|
||||||
GstGeometricTransformClass *gstgt_class;
|
GstGeometricTransformClass *gstgt_class;
|
||||||
|
|
||||||
|
gstelement_class = (GstElementClass *) klass;
|
||||||
gstgt_class = (GstGeometricTransformClass *) klass;
|
gstgt_class = (GstGeometricTransformClass *) klass;
|
||||||
|
|
||||||
parent_class = g_type_class_peek_parent (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;
|
gstgt_class->map_func = fisheye_map;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gst_fisheye_init (GstFisheye * filter, GstFisheyeClass * gclass)
|
gst_fisheye_init (GstFisheye * filter)
|
||||||
{
|
{
|
||||||
GstGeometricTransform *gt = GST_GEOMETRIC_TRANSFORM (filter);
|
GstGeometricTransform *gt = GST_GEOMETRIC_TRANSFORM (filter);
|
||||||
|
|
||||||
|
|
|
@ -23,52 +23,25 @@
|
||||||
|
|
||||||
#include "gstgeometrictransform.h"
|
#include "gstgeometrictransform.h"
|
||||||
#include "geometricmath.h"
|
#include "geometricmath.h"
|
||||||
#include <gst/controller/gstcontroller.h>
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
GST_DEBUG_CATEGORY_STATIC (geometric_transform_debug);
|
GST_DEBUG_CATEGORY_STATIC (geometric_transform_debug);
|
||||||
#define GST_CAT_DEFAULT geometric_transform_debug
|
#define GST_CAT_DEFAULT geometric_transform_debug
|
||||||
|
|
||||||
static GstStaticPadTemplate gst_geometric_transform_src_template =
|
static GstStaticPadTemplate gst_geometric_transform_src_template =
|
||||||
GST_STATIC_PAD_TEMPLATE ("src",
|
GST_STATIC_PAD_TEMPLATE ("src",
|
||||||
GST_PAD_SRC,
|
GST_PAD_SRC,
|
||||||
GST_PAD_ALWAYS,
|
GST_PAD_ALWAYS,
|
||||||
GST_STATIC_CAPS (GST_VIDEO_CAPS_ABGR "; "
|
GST_STATIC_CAPS (GST_VIDEO_CAPS_MAKE ("{ ARGB, BGR, BGRA, BGRx, RGB, "
|
||||||
GST_VIDEO_CAPS_ARGB "; "
|
"RGBA, RGBx, AYUV, xBGR, xRGB, GRAY8, GRAY16_BE, GRAY16_LE }"))
|
||||||
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")
|
|
||||||
)
|
|
||||||
);
|
);
|
||||||
|
|
||||||
static GstStaticPadTemplate gst_geometric_transform_sink_template =
|
static GstStaticPadTemplate gst_geometric_transform_sink_template =
|
||||||
GST_STATIC_PAD_TEMPLATE ("sink",
|
GST_STATIC_PAD_TEMPLATE ("sink",
|
||||||
GST_PAD_SINK,
|
GST_PAD_SINK,
|
||||||
GST_PAD_ALWAYS,
|
GST_PAD_ALWAYS,
|
||||||
GST_STATIC_CAPS (GST_VIDEO_CAPS_ABGR "; "
|
GST_STATIC_CAPS (GST_VIDEO_CAPS_MAKE ("{ ARGB, BGR, BGRA, BGRx, RGB, "
|
||||||
GST_VIDEO_CAPS_ARGB "; "
|
"RGBA, RGBx, AYUV, xBGR, xRGB, GRAY8, GRAY16_BE, GRAY16_LE }"))
|
||||||
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")
|
|
||||||
)
|
|
||||||
);
|
);
|
||||||
|
|
||||||
static GstVideoFilterClass *parent_class = NULL;
|
static GstVideoFilterClass *parent_class = NULL;
|
||||||
|
@ -163,6 +136,7 @@ gst_geometric_transform_set_caps (GstBaseTransform * btrans, GstCaps * incaps,
|
||||||
gint old_width;
|
gint old_width;
|
||||||
gint old_height;
|
gint old_height;
|
||||||
GstGeometricTransformClass *klass;
|
GstGeometricTransformClass *klass;
|
||||||
|
GstVideoInfo vinfo;
|
||||||
|
|
||||||
gt = GST_GEOMETRIC_TRANSFORM_CAST (btrans);
|
gt = GST_GEOMETRIC_TRANSFORM_CAST (btrans);
|
||||||
klass = GST_GEOMETRIC_TRANSFORM_GET_CLASS (gt);
|
klass = GST_GEOMETRIC_TRANSFORM_GET_CLASS (gt);
|
||||||
|
@ -170,11 +144,12 @@ gst_geometric_transform_set_caps (GstBaseTransform * btrans, GstCaps * incaps,
|
||||||
old_width = gt->width;
|
old_width = gt->width;
|
||||||
old_height = gt->height;
|
old_height = gt->height;
|
||||||
|
|
||||||
ret = gst_video_format_parse_caps (incaps, >->format, >->width,
|
ret = gst_video_info_from_caps (&vinfo, incaps);
|
||||||
>->height);
|
|
||||||
if (ret) {
|
if (ret) {
|
||||||
gt->row_stride = gst_video_format_get_row_stride (gt->format, 0, gt->width);
|
gt->width = vinfo.width;
|
||||||
gt->pixel_stride = gst_video_format_get_pixel_stride (gt->format, 0);
|
gt->height = vinfo.height;
|
||||||
|
gt->row_stride = vinfo.stride[0];
|
||||||
|
gt->pixel_stride = GST_VIDEO_INFO_COMP_PSTRIDE (&vinfo, 0);
|
||||||
|
|
||||||
/* regenerate the map */
|
/* regenerate the map */
|
||||||
GST_OBJECT_LOCK (gt);
|
GST_OBJECT_LOCK (gt);
|
||||||
|
@ -228,10 +203,26 @@ gst_geometric_transform_do_map (GstGeometricTransform * gt, GstBuffer * inbuf,
|
||||||
/* only set the values if the values are valid */
|
/* only set the values if the values are valid */
|
||||||
if (trunc_x >= 0 && trunc_x < gt->width && trunc_y >= 0 &&
|
if (trunc_x >= 0 && trunc_x < gt->width && trunc_y >= 0 &&
|
||||||
trunc_y < gt->height) {
|
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;
|
in_offset = trunc_y * gt->row_stride + trunc_x * gt->pixel_stride;
|
||||||
|
|
||||||
memcpy (GST_BUFFER_DATA (outbuf) + out_offset,
|
memcpy (out_info.data + out_offset,
|
||||||
GST_BUFFER_DATA (inbuf) + in_offset, gt->pixel_stride);
|
in_info.data + in_offset, gt->pixel_stride);
|
||||||
|
|
||||||
|
gst_buffer_unmap (outbuf, &out_info);
|
||||||
|
gst_buffer_unmap (inbuf, &in_info);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -262,19 +253,21 @@ gst_geometric_transform_transform (GstBaseTransform * trans, GstBuffer * buf,
|
||||||
gint x, y;
|
gint x, y;
|
||||||
GstFlowReturn ret = GST_FLOW_OK;
|
GstFlowReturn ret = GST_FLOW_OK;
|
||||||
gdouble *ptr;
|
gdouble *ptr;
|
||||||
|
GstMapInfo out_info;
|
||||||
|
|
||||||
gt = GST_GEOMETRIC_TRANSFORM_CAST (trans);
|
gt = GST_GEOMETRIC_TRANSFORM_CAST (trans);
|
||||||
klass = GST_GEOMETRIC_TRANSFORM_GET_CLASS (gt);
|
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);
|
GST_OBJECT_LOCK (gt);
|
||||||
if (gt->precalc_map) {
|
if (gt->precalc_map) {
|
||||||
if (gt->needs_remap) {
|
if (gt->needs_remap) {
|
||||||
if (klass->prepare_func)
|
if (klass->prepare_func)
|
||||||
if (!klass->prepare_func (gt)) {
|
if (!klass->prepare_func (gt)) {
|
||||||
GST_OBJECT_UNLOCK (gt);
|
ret = FALSE;
|
||||||
return FALSE;
|
goto end;
|
||||||
}
|
}
|
||||||
gst_geometric_transform_generate_map (gt);
|
gst_geometric_transform_generate_map (gt);
|
||||||
}
|
}
|
||||||
|
@ -304,6 +297,7 @@ gst_geometric_transform_transform (GstBaseTransform * trans, GstBuffer * buf,
|
||||||
}
|
}
|
||||||
end:
|
end:
|
||||||
GST_OBJECT_UNLOCK (gt);
|
GST_OBJECT_UNLOCK (gt);
|
||||||
|
gst_buffer_unmap (outbuf, &out_info);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -73,7 +73,8 @@ enum
|
||||||
#define DEFAULT_ANGLE2 0
|
#define DEFAULT_ANGLE2 0
|
||||||
#define DEFAULT_SIDES 3
|
#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);
|
GST_TYPE_CIRCLE_GEOMETRIC_TRANSFORM);
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -149,20 +150,6 @@ gst_kaleidoscope_finalize (GObject * obj)
|
||||||
G_OBJECT_CLASS (parent_class)->finalize (obj);
|
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
|
static gboolean
|
||||||
kaleidoscope_map (GstGeometricTransform * gt, gint x, gint y, gdouble * in_x,
|
kaleidoscope_map (GstGeometricTransform * gt, gint x, gint y, gdouble * in_x,
|
||||||
gdouble * in_y)
|
gdouble * in_y)
|
||||||
|
@ -200,13 +187,21 @@ static void
|
||||||
gst_kaleidoscope_class_init (GstKaleidoscopeClass * klass)
|
gst_kaleidoscope_class_init (GstKaleidoscopeClass * klass)
|
||||||
{
|
{
|
||||||
GObjectClass *gobject_class;
|
GObjectClass *gobject_class;
|
||||||
|
GstElementClass *gstelement_class;
|
||||||
GstGeometricTransformClass *gstgt_class;
|
GstGeometricTransformClass *gstgt_class;
|
||||||
|
|
||||||
gobject_class = (GObjectClass *) klass;
|
gobject_class = (GObjectClass *) klass;
|
||||||
|
gstelement_class = (GstElementClass *) klass;
|
||||||
gstgt_class = (GstGeometricTransformClass *) klass;
|
gstgt_class = (GstGeometricTransformClass *) klass;
|
||||||
|
|
||||||
parent_class = g_type_class_peek_parent (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->finalize = GST_DEBUG_FUNCPTR (gst_kaleidoscope_finalize);
|
||||||
gobject_class->set_property =
|
gobject_class->set_property =
|
||||||
GST_DEBUG_FUNCPTR (gst_kaleidoscope_set_property);
|
GST_DEBUG_FUNCPTR (gst_kaleidoscope_set_property);
|
||||||
|
@ -233,7 +228,7 @@ gst_kaleidoscope_class_init (GstKaleidoscopeClass * klass)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gst_kaleidoscope_init (GstKaleidoscope * filter, GstKaleidoscopeClass * gclass)
|
gst_kaleidoscope_init (GstKaleidoscope * filter)
|
||||||
{
|
{
|
||||||
GstGeometricTransform *gt = GST_GEOMETRIC_TRANSFORM (filter);
|
GstGeometricTransform *gt = GST_GEOMETRIC_TRANSFORM (filter);
|
||||||
|
|
||||||
|
|
|
@ -74,8 +74,8 @@ enum
|
||||||
#define DEFAULT_AMOUNT 1
|
#define DEFAULT_AMOUNT 1
|
||||||
#define DEFAULT_TURBULENCE 1
|
#define DEFAULT_TURBULENCE 1
|
||||||
|
|
||||||
GST_BOILERPLATE (GstMarble, gst_marble, GstGeometricTransform,
|
#define gst_marble_parent_class parent_class
|
||||||
GST_TYPE_GEOMETRIC_TRANSFORM);
|
G_DEFINE_TYPE (GstMarble, gst_marble, GST_TYPE_GEOMETRIC_TRANSFORM);
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gst_marble_set_property (GObject * object, guint prop_id, const GValue * value,
|
gst_marble_set_property (GObject * object, guint prop_id, const GValue * value,
|
||||||
|
@ -165,20 +165,6 @@ gst_marble_finalize (GObject * obj)
|
||||||
G_OBJECT_CLASS (parent_class)->finalize (obj);
|
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
|
static gboolean
|
||||||
marble_prepare (GstGeometricTransform * trans)
|
marble_prepare (GstGeometricTransform * trans)
|
||||||
{
|
{
|
||||||
|
@ -228,13 +214,21 @@ static void
|
||||||
gst_marble_class_init (GstMarbleClass * klass)
|
gst_marble_class_init (GstMarbleClass * klass)
|
||||||
{
|
{
|
||||||
GObjectClass *gobject_class;
|
GObjectClass *gobject_class;
|
||||||
|
GstElementClass *gstelement_class;
|
||||||
GstGeometricTransformClass *gstgt_class;
|
GstGeometricTransformClass *gstgt_class;
|
||||||
|
|
||||||
gobject_class = (GObjectClass *) klass;
|
gobject_class = (GObjectClass *) klass;
|
||||||
|
gstelement_class = (GstElementClass *) klass;
|
||||||
gstgt_class = (GstGeometricTransformClass *) klass;
|
gstgt_class = (GstGeometricTransformClass *) klass;
|
||||||
|
|
||||||
parent_class = g_type_class_peek_parent (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->finalize = GST_DEBUG_FUNCPTR (gst_marble_finalize);
|
||||||
gobject_class->set_property = GST_DEBUG_FUNCPTR (gst_marble_set_property);
|
gobject_class->set_property = GST_DEBUG_FUNCPTR (gst_marble_set_property);
|
||||||
gobject_class->get_property = GST_DEBUG_FUNCPTR (gst_marble_get_property);
|
gobject_class->get_property = GST_DEBUG_FUNCPTR (gst_marble_get_property);
|
||||||
|
@ -265,7 +259,7 @@ gst_marble_class_init (GstMarbleClass * klass)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gst_marble_init (GstMarble * filter, GstMarbleClass * gclass)
|
gst_marble_init (GstMarble * filter)
|
||||||
{
|
{
|
||||||
GstGeometricTransform *gt = GST_GEOMETRIC_TRANSFORM (filter);
|
GstGeometricTransform *gt = GST_GEOMETRIC_TRANSFORM (filter);
|
||||||
|
|
||||||
|
|
|
@ -61,8 +61,8 @@ enum
|
||||||
|
|
||||||
#define DEFAULT_PROP_MODE GST_MIRROR_MODE_LEFT
|
#define DEFAULT_PROP_MODE GST_MIRROR_MODE_LEFT
|
||||||
|
|
||||||
GST_BOILERPLATE (GstMirror, gst_mirror, GstGeometricTransform,
|
#define gst_mirror_parent_class parent_class
|
||||||
GST_TYPE_GEOMETRIC_TRANSFORM);
|
G_DEFINE_TYPE (GstMirror, gst_mirror, GST_TYPE_GEOMETRIC_TRANSFORM);
|
||||||
|
|
||||||
#define GST_TYPE_MIRROR_MODE (gst_mirror_mode_get_type())
|
#define GST_TYPE_MIRROR_MODE (gst_mirror_mode_get_type())
|
||||||
static GType
|
static GType
|
||||||
|
@ -123,18 +123,6 @@ gst_mirror_get_property (GObject * object, guint prop_id,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
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
|
static gboolean
|
||||||
mirror_map (GstGeometricTransform * gt, gint x, gint y, gdouble * in_x,
|
mirror_map (GstGeometricTransform * gt, gint x, gint y, gdouble * in_x,
|
||||||
gdouble * in_y)
|
gdouble * in_y)
|
||||||
|
@ -187,11 +175,19 @@ static void
|
||||||
gst_mirror_class_init (GstMirrorClass * klass)
|
gst_mirror_class_init (GstMirrorClass * klass)
|
||||||
{
|
{
|
||||||
GObjectClass *gobject_class;
|
GObjectClass *gobject_class;
|
||||||
|
GstElementClass *gstelement_class;
|
||||||
GstGeometricTransformClass *gstgt_class;
|
GstGeometricTransformClass *gstgt_class;
|
||||||
|
|
||||||
gobject_class = (GObjectClass *) klass;
|
gobject_class = (GObjectClass *) klass;
|
||||||
|
gstelement_class = (GstElementClass *) klass;
|
||||||
gstgt_class = (GstGeometricTransformClass *) 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->set_property = gst_mirror_set_property;
|
||||||
gobject_class->get_property = gst_mirror_get_property;
|
gobject_class->get_property = gst_mirror_get_property;
|
||||||
|
|
||||||
|
@ -207,7 +203,7 @@ gst_mirror_class_init (GstMirrorClass * klass)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gst_mirror_init (GstMirror * filter, GstMirrorClass * gclass)
|
gst_mirror_init (GstMirror * filter)
|
||||||
{
|
{
|
||||||
GstGeometricTransform *gt = GST_GEOMETRIC_TRANSFORM (filter);
|
GstGeometricTransform *gt = GST_GEOMETRIC_TRANSFORM (filter);
|
||||||
|
|
||||||
|
|
|
@ -68,8 +68,8 @@ enum
|
||||||
|
|
||||||
#define DEFAULT_INTENSITY 0.5
|
#define DEFAULT_INTENSITY 0.5
|
||||||
|
|
||||||
GST_BOILERPLATE (GstPinch, gst_pinch, GstCircleGeometricTransform,
|
#define gst_pinch_parent_class parent_class
|
||||||
GST_TYPE_CIRCLE_GEOMETRIC_TRANSFORM);
|
G_DEFINE_TYPE (GstPinch, gst_pinch, GST_TYPE_CIRCLE_GEOMETRIC_TRANSFORM);
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gst_pinch_set_property (GObject * object, guint prop_id, const GValue * value,
|
gst_pinch_set_property (GObject * object, guint prop_id, const GValue * value,
|
||||||
|
@ -123,20 +123,6 @@ gst_pinch_finalize (GObject * obj)
|
||||||
G_OBJECT_CLASS (parent_class)->finalize (obj);
|
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
|
static gboolean
|
||||||
pinch_map (GstGeometricTransform * gt, gint x, gint y, gdouble * in_x,
|
pinch_map (GstGeometricTransform * gt, gint x, gint y, gdouble * in_x,
|
||||||
gdouble * in_y)
|
gdouble * in_y)
|
||||||
|
@ -182,13 +168,21 @@ static void
|
||||||
gst_pinch_class_init (GstPinchClass * klass)
|
gst_pinch_class_init (GstPinchClass * klass)
|
||||||
{
|
{
|
||||||
GObjectClass *gobject_class;
|
GObjectClass *gobject_class;
|
||||||
|
GstElementClass *gstelement_class;
|
||||||
GstGeometricTransformClass *gstgt_class;
|
GstGeometricTransformClass *gstgt_class;
|
||||||
|
|
||||||
gobject_class = (GObjectClass *) klass;
|
gobject_class = (GObjectClass *) klass;
|
||||||
|
gstelement_class = (GstElementClass *) klass;
|
||||||
gstgt_class = (GstGeometricTransformClass *) klass;
|
gstgt_class = (GstGeometricTransformClass *) klass;
|
||||||
|
|
||||||
parent_class = g_type_class_peek_parent (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->finalize = GST_DEBUG_FUNCPTR (gst_pinch_finalize);
|
||||||
gobject_class->set_property = GST_DEBUG_FUNCPTR (gst_pinch_set_property);
|
gobject_class->set_property = GST_DEBUG_FUNCPTR (gst_pinch_set_property);
|
||||||
gobject_class->get_property = GST_DEBUG_FUNCPTR (gst_pinch_get_property);
|
gobject_class->get_property = GST_DEBUG_FUNCPTR (gst_pinch_get_property);
|
||||||
|
@ -204,7 +198,7 @@ gst_pinch_class_init (GstPinchClass * klass)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gst_pinch_init (GstPinch * filter, GstPinchClass * gclass)
|
gst_pinch_init (GstPinch * filter)
|
||||||
{
|
{
|
||||||
GstGeometricTransform *gt = GST_GEOMETRIC_TRANSFORM (filter);
|
GstGeometricTransform *gt = GST_GEOMETRIC_TRANSFORM (filter);
|
||||||
|
|
||||||
|
|
|
@ -69,8 +69,8 @@ enum
|
||||||
|
|
||||||
#define DEFAULT_ANGLE 0
|
#define DEFAULT_ANGLE 0
|
||||||
|
|
||||||
GST_BOILERPLATE (GstRotate, gst_rotate, GstGeometricTransform,
|
#define gst_rotate_parent_class parent_class
|
||||||
GST_TYPE_GEOMETRIC_TRANSFORM);
|
G_DEFINE_TYPE (GstRotate, gst_rotate, GST_TYPE_GEOMETRIC_TRANSFORM);
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gst_rotate_set_property (GObject * object, guint prop_id, const GValue * value,
|
gst_rotate_set_property (GObject * object, guint prop_id, const GValue * value,
|
||||||
|
@ -124,20 +124,6 @@ gst_rotate_finalize (GObject * obj)
|
||||||
G_OBJECT_CLASS (parent_class)->finalize (obj);
|
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
|
static gboolean
|
||||||
rotate_map (GstGeometricTransform * gt, gint x, gint y, gdouble * in_x,
|
rotate_map (GstGeometricTransform * gt, gint x, gint y, gdouble * in_x,
|
||||||
gdouble * in_y)
|
gdouble * in_y)
|
||||||
|
@ -190,13 +176,21 @@ static void
|
||||||
gst_rotate_class_init (GstRotateClass * klass)
|
gst_rotate_class_init (GstRotateClass * klass)
|
||||||
{
|
{
|
||||||
GObjectClass *gobject_class;
|
GObjectClass *gobject_class;
|
||||||
|
GstElementClass *gstelement_class;
|
||||||
GstGeometricTransformClass *gstgt_class;
|
GstGeometricTransformClass *gstgt_class;
|
||||||
|
|
||||||
gobject_class = (GObjectClass *) klass;
|
gobject_class = (GObjectClass *) klass;
|
||||||
|
gstelement_class = (GstElementClass *) klass;
|
||||||
gstgt_class = (GstGeometricTransformClass *) klass;
|
gstgt_class = (GstGeometricTransformClass *) klass;
|
||||||
|
|
||||||
parent_class = g_type_class_peek_parent (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->finalize = GST_DEBUG_FUNCPTR (gst_rotate_finalize);
|
||||||
gobject_class->set_property = GST_DEBUG_FUNCPTR (gst_rotate_set_property);
|
gobject_class->set_property = GST_DEBUG_FUNCPTR (gst_rotate_set_property);
|
||||||
gobject_class->get_property = GST_DEBUG_FUNCPTR (gst_rotate_get_property);
|
gobject_class->get_property = GST_DEBUG_FUNCPTR (gst_rotate_get_property);
|
||||||
|
@ -211,7 +205,7 @@ gst_rotate_class_init (GstRotateClass * klass)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gst_rotate_init (GstRotate * filter, GstRotateClass * gclass)
|
gst_rotate_init (GstRotate * filter)
|
||||||
{
|
{
|
||||||
filter->angle = DEFAULT_ANGLE;
|
filter->angle = DEFAULT_ANGLE;
|
||||||
}
|
}
|
||||||
|
|
|
@ -68,8 +68,8 @@ enum
|
||||||
|
|
||||||
#define DEFAULT_REFRACTION 1.5
|
#define DEFAULT_REFRACTION 1.5
|
||||||
|
|
||||||
GST_BOILERPLATE (GstSphere, gst_sphere, GstCircleGeometricTransform,
|
#define gst_sphere_parent_class parent_class
|
||||||
GST_TYPE_CIRCLE_GEOMETRIC_TRANSFORM);
|
G_DEFINE_TYPE (GstSphere, gst_sphere, GST_TYPE_CIRCLE_GEOMETRIC_TRANSFORM);
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gst_sphere_set_property (GObject * object, guint prop_id, const GValue * value,
|
gst_sphere_set_property (GObject * object, guint prop_id, const GValue * value,
|
||||||
|
@ -123,20 +123,6 @@ gst_sphere_finalize (GObject * obj)
|
||||||
G_OBJECT_CLASS (parent_class)->finalize (obj);
|
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' */
|
/* TODO we could have horizontal and vertical 'radius' */
|
||||||
static gboolean
|
static gboolean
|
||||||
sphere_map (GstGeometricTransform * gt, gint x, gint y, gdouble * in_x,
|
sphere_map (GstGeometricTransform * gt, gint x, gint y, gdouble * in_x,
|
||||||
|
@ -194,13 +180,21 @@ static void
|
||||||
gst_sphere_class_init (GstSphereClass * klass)
|
gst_sphere_class_init (GstSphereClass * klass)
|
||||||
{
|
{
|
||||||
GObjectClass *gobject_class;
|
GObjectClass *gobject_class;
|
||||||
|
GstElementClass *gstelement_class;
|
||||||
GstGeometricTransformClass *gstgt_class;
|
GstGeometricTransformClass *gstgt_class;
|
||||||
|
|
||||||
gobject_class = (GObjectClass *) klass;
|
gobject_class = (GObjectClass *) klass;
|
||||||
|
gstelement_class = (GstElementClass *) klass;
|
||||||
gstgt_class = (GstGeometricTransformClass *) klass;
|
gstgt_class = (GstGeometricTransformClass *) klass;
|
||||||
|
|
||||||
parent_class = g_type_class_peek_parent (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->finalize = GST_DEBUG_FUNCPTR (gst_sphere_finalize);
|
||||||
gobject_class->set_property = GST_DEBUG_FUNCPTR (gst_sphere_set_property);
|
gobject_class->set_property = GST_DEBUG_FUNCPTR (gst_sphere_set_property);
|
||||||
gobject_class->get_property = GST_DEBUG_FUNCPTR (gst_sphere_get_property);
|
gobject_class->get_property = GST_DEBUG_FUNCPTR (gst_sphere_get_property);
|
||||||
|
@ -215,7 +209,7 @@ gst_sphere_class_init (GstSphereClass * klass)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gst_sphere_init (GstSphere * filter, GstSphereClass * gclass)
|
gst_sphere_init (GstSphere * filter)
|
||||||
{
|
{
|
||||||
GstGeometricTransform *gt = GST_GEOMETRIC_TRANSFORM (filter);
|
GstGeometricTransform *gt = GST_GEOMETRIC_TRANSFORM (filter);
|
||||||
|
|
||||||
|
|
|
@ -65,8 +65,8 @@ enum
|
||||||
#define DEFAULT_HEIGHT 0.5
|
#define DEFAULT_HEIGHT 0.5
|
||||||
#define DEFAULT_ZOOM 2.0
|
#define DEFAULT_ZOOM 2.0
|
||||||
|
|
||||||
GST_BOILERPLATE (GstSquare, gst_square, GstGeometricTransform,
|
#define gst_square_parent_class parent_class
|
||||||
GST_TYPE_GEOMETRIC_TRANSFORM);
|
G_DEFINE_TYPE (GstSquare, gst_square, GST_TYPE_GEOMETRIC_TRANSFORM);
|
||||||
|
|
||||||
/* GObject vmethod implementations */
|
/* GObject vmethod implementations */
|
||||||
|
|
||||||
|
@ -137,18 +137,6 @@ gst_square_get_property (GObject * object, guint prop_id,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
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
|
static gboolean
|
||||||
square_map (GstGeometricTransform * gt, gint x, gint y, gdouble * in_x,
|
square_map (GstGeometricTransform * gt, gint x, gint y, gdouble * in_x,
|
||||||
gdouble * in_y)
|
gdouble * in_y)
|
||||||
|
@ -190,12 +178,21 @@ static void
|
||||||
gst_square_class_init (GstSquareClass * klass)
|
gst_square_class_init (GstSquareClass * klass)
|
||||||
{
|
{
|
||||||
GObjectClass *gobject_class;
|
GObjectClass *gobject_class;
|
||||||
|
GstElementClass *gstelement_class;
|
||||||
GstGeometricTransformClass *gstgt_class;
|
GstGeometricTransformClass *gstgt_class;
|
||||||
|
|
||||||
gobject_class = (GObjectClass *) klass;
|
gobject_class = (GObjectClass *) klass;
|
||||||
|
gstelement_class = (GstElementClass *) klass;
|
||||||
gstgt_class = (GstGeometricTransformClass *) klass;
|
gstgt_class = (GstGeometricTransformClass *) klass;
|
||||||
|
|
||||||
parent_class = g_type_class_peek_parent (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->set_property = GST_DEBUG_FUNCPTR (gst_square_set_property);
|
||||||
gobject_class->get_property = GST_DEBUG_FUNCPTR (gst_square_get_property);
|
gobject_class->get_property = GST_DEBUG_FUNCPTR (gst_square_get_property);
|
||||||
|
|
||||||
|
@ -219,7 +216,7 @@ gst_square_class_init (GstSquareClass * klass)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gst_square_init (GstSquare * filter, GstSquareClass * gclass)
|
gst_square_init (GstSquare * filter)
|
||||||
{
|
{
|
||||||
GstGeometricTransform *gt = GST_GEOMETRIC_TRANSFORM (filter);
|
GstGeometricTransform *gt = GST_GEOMETRIC_TRANSFORM (filter);
|
||||||
|
|
||||||
|
|
|
@ -63,8 +63,8 @@ enum
|
||||||
#define DEFAULT_INTENSITY 0.5
|
#define DEFAULT_INTENSITY 0.5
|
||||||
#define MAX_SHRINK_AMOUNT 3.0
|
#define MAX_SHRINK_AMOUNT 3.0
|
||||||
|
|
||||||
GST_BOILERPLATE (GstStretch, gst_stretch, GstCircleGeometricTransform,
|
#define gst_stretch_parent_class parent_class
|
||||||
GST_TYPE_CIRCLE_GEOMETRIC_TRANSFORM);
|
G_DEFINE_TYPE (GstStretch, gst_stretch, GST_TYPE_CIRCLE_GEOMETRIC_TRANSFORM);
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gst_stretch_set_property (GObject * object, guint prop_id, const GValue * value,
|
gst_stretch_set_property (GObject * object, guint prop_id, const GValue * value,
|
||||||
|
@ -118,20 +118,6 @@ gst_stretch_finalize (GObject * obj)
|
||||||
G_OBJECT_CLASS (parent_class)->finalize (obj);
|
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
|
static gboolean
|
||||||
stretch_map (GstGeometricTransform * gt, gint x, gint y, gdouble * in_x,
|
stretch_map (GstGeometricTransform * gt, gint x, gint y, gdouble * in_x,
|
||||||
gdouble * in_y)
|
gdouble * in_y)
|
||||||
|
@ -183,13 +169,21 @@ static void
|
||||||
gst_stretch_class_init (GstStretchClass * klass)
|
gst_stretch_class_init (GstStretchClass * klass)
|
||||||
{
|
{
|
||||||
GObjectClass *gobject_class;
|
GObjectClass *gobject_class;
|
||||||
|
GstElementClass *gstelement_class;
|
||||||
GstGeometricTransformClass *gstgt_class;
|
GstGeometricTransformClass *gstgt_class;
|
||||||
|
|
||||||
gobject_class = (GObjectClass *) klass;
|
gobject_class = (GObjectClass *) klass;
|
||||||
|
gstelement_class = (GstElementClass *) klass;
|
||||||
gstgt_class = (GstGeometricTransformClass *) klass;
|
gstgt_class = (GstGeometricTransformClass *) klass;
|
||||||
|
|
||||||
parent_class = g_type_class_peek_parent (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->set_property = GST_DEBUG_FUNCPTR (gst_stretch_set_property);
|
||||||
gobject_class->get_property = GST_DEBUG_FUNCPTR (gst_stretch_get_property);
|
gobject_class->get_property = GST_DEBUG_FUNCPTR (gst_stretch_get_property);
|
||||||
|
|
||||||
|
@ -206,7 +200,7 @@ gst_stretch_class_init (GstStretchClass * klass)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gst_stretch_init (GstStretch * filter, GstStretchClass * gclass)
|
gst_stretch_init (GstStretch * filter)
|
||||||
{
|
{
|
||||||
GstGeometricTransform *gt = GST_GEOMETRIC_TRANSFORM (filter);
|
GstGeometricTransform *gt = GST_GEOMETRIC_TRANSFORM (filter);
|
||||||
|
|
||||||
|
|
|
@ -54,8 +54,8 @@
|
||||||
GST_DEBUG_CATEGORY_STATIC (gst_tunnel_debug);
|
GST_DEBUG_CATEGORY_STATIC (gst_tunnel_debug);
|
||||||
#define GST_CAT_DEFAULT gst_tunnel_debug
|
#define GST_CAT_DEFAULT gst_tunnel_debug
|
||||||
|
|
||||||
GST_BOILERPLATE (GstTunnel, gst_tunnel, GstCircleGeometricTransform,
|
#define gst_tunnel_parent_class parent_class
|
||||||
GST_TYPE_CIRCLE_GEOMETRIC_TRANSFORM);
|
G_DEFINE_TYPE (GstTunnel, gst_tunnel, GST_TYPE_CIRCLE_GEOMETRIC_TRANSFORM);
|
||||||
|
|
||||||
/* Clean up */
|
/* Clean up */
|
||||||
static void
|
static void
|
||||||
|
@ -64,19 +64,6 @@ gst_tunnel_finalize (GObject * obj)
|
||||||
G_OBJECT_CLASS (parent_class)->finalize (obj);
|
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
|
static gboolean
|
||||||
tunnel_map (GstGeometricTransform * gt, gint x, gint y, gdouble * in_x,
|
tunnel_map (GstGeometricTransform * gt, gint x, gint y, gdouble * in_x,
|
||||||
gdouble * in_y)
|
gdouble * in_y)
|
||||||
|
@ -120,20 +107,27 @@ static void
|
||||||
gst_tunnel_class_init (GstTunnelClass * klass)
|
gst_tunnel_class_init (GstTunnelClass * klass)
|
||||||
{
|
{
|
||||||
GObjectClass *gobject_class;
|
GObjectClass *gobject_class;
|
||||||
|
GstElementClass *gstelement_class;
|
||||||
GstGeometricTransformClass *gstgt_class;
|
GstGeometricTransformClass *gstgt_class;
|
||||||
|
|
||||||
gobject_class = (GObjectClass *) klass;
|
gobject_class = (GObjectClass *) klass;
|
||||||
|
gstelement_class = (GstElementClass *) klass;
|
||||||
gstgt_class = (GstGeometricTransformClass *) klass;
|
gstgt_class = (GstGeometricTransformClass *) klass;
|
||||||
|
|
||||||
parent_class = g_type_class_peek_parent (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);
|
gobject_class->finalize = GST_DEBUG_FUNCPTR (gst_tunnel_finalize);
|
||||||
|
|
||||||
gstgt_class->map_func = tunnel_map;
|
gstgt_class->map_func = tunnel_map;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gst_tunnel_init (GstTunnel * filter, GstTunnelClass * gclass)
|
gst_tunnel_init (GstTunnel * filter)
|
||||||
{
|
{
|
||||||
GstGeometricTransform *gt = GST_GEOMETRIC_TRANSFORM (filter);
|
GstGeometricTransform *gt = GST_GEOMETRIC_TRANSFORM (filter);
|
||||||
|
|
||||||
|
|
|
@ -68,8 +68,8 @@ enum
|
||||||
|
|
||||||
#define DEFAULT_ANGLE (G_PI)
|
#define DEFAULT_ANGLE (G_PI)
|
||||||
|
|
||||||
GST_BOILERPLATE (GstTwirl, gst_twirl, GstCircleGeometricTransform,
|
#define gst_twirl_parent_class parent_class
|
||||||
GST_TYPE_CIRCLE_GEOMETRIC_TRANSFORM);
|
G_DEFINE_TYPE (GstTwirl, gst_twirl, GST_TYPE_CIRCLE_GEOMETRIC_TRANSFORM);
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gst_twirl_set_property (GObject * object, guint prop_id, const GValue * value,
|
gst_twirl_set_property (GObject * object, guint prop_id, const GValue * value,
|
||||||
|
@ -123,20 +123,6 @@ gst_twirl_finalize (GObject * obj)
|
||||||
G_OBJECT_CLASS (parent_class)->finalize (obj);
|
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
|
static gboolean
|
||||||
twirl_map (GstGeometricTransform * gt, gint x, gint y, gdouble * in_x,
|
twirl_map (GstGeometricTransform * gt, gint x, gint y, gdouble * in_x,
|
||||||
gdouble * in_y)
|
gdouble * in_y)
|
||||||
|
@ -172,13 +158,21 @@ static void
|
||||||
gst_twirl_class_init (GstTwirlClass * klass)
|
gst_twirl_class_init (GstTwirlClass * klass)
|
||||||
{
|
{
|
||||||
GObjectClass *gobject_class;
|
GObjectClass *gobject_class;
|
||||||
|
GstElementClass *gstelement_class;
|
||||||
GstGeometricTransformClass *gstgt_class;
|
GstGeometricTransformClass *gstgt_class;
|
||||||
|
|
||||||
gobject_class = (GObjectClass *) klass;
|
gobject_class = (GObjectClass *) klass;
|
||||||
|
gstelement_class = (GstElementClass *) klass;
|
||||||
gstgt_class = (GstGeometricTransformClass *) klass;
|
gstgt_class = (GstGeometricTransformClass *) klass;
|
||||||
|
|
||||||
parent_class = g_type_class_peek_parent (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->finalize = GST_DEBUG_FUNCPTR (gst_twirl_finalize);
|
||||||
gobject_class->set_property = GST_DEBUG_FUNCPTR (gst_twirl_set_property);
|
gobject_class->set_property = GST_DEBUG_FUNCPTR (gst_twirl_set_property);
|
||||||
gobject_class->get_property = GST_DEBUG_FUNCPTR (gst_twirl_get_property);
|
gobject_class->get_property = GST_DEBUG_FUNCPTR (gst_twirl_get_property);
|
||||||
|
@ -194,7 +188,7 @@ gst_twirl_class_init (GstTwirlClass * klass)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gst_twirl_init (GstTwirl * filter, GstTwirlClass * gclass)
|
gst_twirl_init (GstTwirl * filter)
|
||||||
{
|
{
|
||||||
GstGeometricTransform *gt = GST_GEOMETRIC_TRANSFORM (filter);
|
GstGeometricTransform *gt = GST_GEOMETRIC_TRANSFORM (filter);
|
||||||
|
|
||||||
|
|
|
@ -72,7 +72,8 @@ enum
|
||||||
#define DEFAULT_PHASE 0.0
|
#define DEFAULT_PHASE 0.0
|
||||||
#define DEFAULT_WAVELENGTH 16.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);
|
GST_TYPE_CIRCLE_GEOMETRIC_TRANSFORM);
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -147,20 +148,6 @@ gst_water_ripple_finalize (GObject * obj)
|
||||||
G_OBJECT_CLASS (parent_class)->finalize (obj);
|
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
|
static gboolean
|
||||||
water_ripple_map (GstGeometricTransform * gt, gint x, gint y, gdouble * in_x,
|
water_ripple_map (GstGeometricTransform * gt, gint x, gint y, gdouble * in_x,
|
||||||
gdouble * in_y)
|
gdouble * in_y)
|
||||||
|
@ -201,13 +188,21 @@ static void
|
||||||
gst_water_ripple_class_init (GstWaterRippleClass * klass)
|
gst_water_ripple_class_init (GstWaterRippleClass * klass)
|
||||||
{
|
{
|
||||||
GObjectClass *gobject_class;
|
GObjectClass *gobject_class;
|
||||||
|
GstElementClass *gstelement_class;
|
||||||
GstGeometricTransformClass *gstgt_class;
|
GstGeometricTransformClass *gstgt_class;
|
||||||
|
|
||||||
gobject_class = (GObjectClass *) klass;
|
gobject_class = (GObjectClass *) klass;
|
||||||
|
gstelement_class = (GstElementClass *) klass;
|
||||||
gstgt_class = (GstGeometricTransformClass *) klass;
|
gstgt_class = (GstGeometricTransformClass *) klass;
|
||||||
|
|
||||||
parent_class = g_type_class_peek_parent (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->finalize = GST_DEBUG_FUNCPTR (gst_water_ripple_finalize);
|
||||||
gobject_class->set_property =
|
gobject_class->set_property =
|
||||||
GST_DEBUG_FUNCPTR (gst_water_ripple_set_property);
|
GST_DEBUG_FUNCPTR (gst_water_ripple_set_property);
|
||||||
|
@ -231,7 +226,7 @@ gst_water_ripple_class_init (GstWaterRippleClass * klass)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gst_water_ripple_init (GstWaterRipple * filter, GstWaterRippleClass * gclass)
|
gst_water_ripple_init (GstWaterRipple * filter)
|
||||||
{
|
{
|
||||||
GstGeometricTransform *gt = GST_GEOMETRIC_TRANSFORM (filter);
|
GstGeometricTransform *gt = GST_GEOMETRIC_TRANSFORM (filter);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue