mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-18 20:25:25 +00:00
Make warpTV a subclass of videofilter
Original commit message from CVS: Make warpTV a subclass of videofilter
This commit is contained in:
parent
08797649fb
commit
1756816071
4 changed files with 188 additions and 166 deletions
11
ChangeLog
11
ChangeLog
|
@ -1,3 +1,14 @@
|
||||||
|
2004-01-07 David Schleef <ds@schleef.org>
|
||||||
|
|
||||||
|
* gst/videofilter/gstvideotemplate.c:
|
||||||
|
* gst/videofilter/gstvideotemplate.h:
|
||||||
|
* gst/videofilter/make_filter:
|
||||||
|
Merge videotemplate header into source file.
|
||||||
|
* gst/effectv/Makefile.am:
|
||||||
|
* gst/effectv/gsteffectv.c: (plugin_init):
|
||||||
|
* gst/effectv/gstwarp.c:
|
||||||
|
Make warpTV a subclass of videofilter.
|
||||||
|
|
||||||
2004-01-07 Benjamin Otte <in7y118@public.uni-hamburg.de>
|
2004-01-07 Benjamin Otte <in7y118@public.uni-hamburg.de>
|
||||||
|
|
||||||
* ext/mad/gstid3tag.c: (gst_mad_id3_to_tag_list):
|
* ext/mad/gstid3tag.c: (gst_mad_id3_to_tag_list):
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
plugin_LTLIBRARIES = libgsteffectv.la
|
plugin_LTLIBRARIES = libgsteffectv.la
|
||||||
|
|
||||||
libgsteffectv_la_SOURCES = gsteffectv.c gstedge.c gstaging.c gstdice.c gstwarp.c gstshagadelic.c gstvertigo.c gstrev.c gstquark.c
|
libgsteffectv_la_SOURCES = gsteffectv.c gstedge.c gstaging.c gstdice.c gstwarp.c gstshagadelic.c gstvertigo.c gstrev.c gstquark.c
|
||||||
libgsteffectv_la_CFLAGS = $(GST_CFLAGS)
|
libgsteffectv_la_CFLAGS = $(GST_CFLAGS) -I$(top_srcdir)/gst/videofilter
|
||||||
libgsteffectv_la_LIBADD =
|
libgsteffectv_la_LIBADD =
|
||||||
libgsteffectv_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
|
libgsteffectv_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
|
||||||
|
|
||||||
|
|
|
@ -70,6 +70,9 @@ plugin_init (GstPlugin * plugin)
|
||||||
{
|
{
|
||||||
gint i = 0;
|
gint i = 0;
|
||||||
|
|
||||||
|
if (!gst_library_load ("gstvideofilter"))
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
while (_elements[i].name) {
|
while (_elements[i].name) {
|
||||||
if (!gst_element_register (plugin, _elements[i].name,
|
if (!gst_element_register (plugin, _elements[i].name,
|
||||||
GST_RANK_NONE, (_elements[i].type) ()))
|
GST_RANK_NONE, (_elements[i].type) ()))
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
/* GStreamer
|
/* GStreamer
|
||||||
* Copyright (C) <1999> Erik Walthinsen <omega@cse.ogi.edu>
|
* Copyright (C) <1999> Erik Walthinsen <omega@cse.ogi.edu>
|
||||||
|
* Copyright (C) <2003> David Schleef <ds@schleef.org>
|
||||||
*
|
*
|
||||||
* EffecTV - Realtime Digital Video Effector
|
* EffecTV - Realtime Digital Video Effector
|
||||||
* Copyright (C) 2001 FUKUCHI Kentarou
|
* Copyright (C) 2001 FUKUCHI Kentarou
|
||||||
*
|
*
|
||||||
* EffecTV is free software. This library is free software;
|
* This library is free software; you can redistribute it and/or
|
||||||
* you can redistribute it and/or
|
|
||||||
* modify it under the terms of the GNU Library General Public
|
* modify it under the terms of the GNU Library General Public
|
||||||
* License as published by the Free Software Foundation; either
|
* License as published by the Free Software Foundation; either
|
||||||
* version 2 of the License, or (at your option) any later version.
|
* version 2 of the License, or (at your option) any later version.
|
||||||
|
@ -19,8 +19,14 @@
|
||||||
* License along with this library; if not, write to the
|
* License along with this library; if not, write to the
|
||||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||||
* Boston, MA 02111-1307, USA.
|
* Boston, MA 02111-1307, USA.
|
||||||
|
*/
|
||||||
* From main.c of warp-1.1:
|
|
||||||
|
/*
|
||||||
|
* This file was (probably) generated from gstvideotemplate.c,
|
||||||
|
* gstvideotemplate.c,v 1.11 2004/01/07 08:56:45 ds Exp
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* From main.c of warp-1.1:
|
||||||
*
|
*
|
||||||
* Simple DirectMedia Layer demo
|
* Simple DirectMedia Layer demo
|
||||||
* Realtime picture 'gooing'
|
* Realtime picture 'gooing'
|
||||||
|
@ -30,21 +36,24 @@
|
||||||
#ifdef HAVE_CONFIG_H
|
#ifdef HAVE_CONFIG_H
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include <gst/gst.h>
|
||||||
|
#include <gstvideofilter.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include <gst/gst.h>
|
|
||||||
#include "gsteffectv.h"
|
#include "gsteffectv.h"
|
||||||
|
|
||||||
#ifndef M_PI
|
#ifndef M_PI
|
||||||
#define M_PI 3.14159265358979323846
|
#define M_PI 3.14159265358979323846
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#define GST_TYPE_WARPTV \
|
#define GST_TYPE_WARPTV \
|
||||||
(gst_warptv_get_type())
|
(gst_warptv_get_type())
|
||||||
#define GST_WARPTV(obj) \
|
#define GST_WARPTV(obj) \
|
||||||
(G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_WARPTV,GstWarpTV))
|
(G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_WARPTV,GstWarpTV))
|
||||||
#define GST_WARPTV_CLASS(klass) \
|
#define GST_WARPTV_CLASS(klass) \
|
||||||
(G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_ULAW,GstWarpTV))
|
(G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_WARPTV,GstWarpTVClass))
|
||||||
#define GST_IS_WARPTV(obj) \
|
#define GST_IS_WARPTV(obj) \
|
||||||
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_WARPTV))
|
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_WARPTV))
|
||||||
#define GST_IS_WARPTV_CLASS(obj) \
|
#define GST_IS_WARPTV_CLASS(obj) \
|
||||||
|
@ -53,11 +62,8 @@
|
||||||
typedef struct _GstWarpTV GstWarpTV;
|
typedef struct _GstWarpTV GstWarpTV;
|
||||||
typedef struct _GstWarpTVClass GstWarpTVClass;
|
typedef struct _GstWarpTVClass GstWarpTVClass;
|
||||||
|
|
||||||
struct _GstWarpTV
|
struct _GstWarpTV {
|
||||||
{
|
GstVideofilter videofilter;
|
||||||
GstElement element;
|
|
||||||
|
|
||||||
GstPad *sinkpad, *srcpad;
|
|
||||||
|
|
||||||
gint width, height;
|
gint width, height;
|
||||||
gint *offstable;
|
gint *offstable;
|
||||||
|
@ -67,133 +73,192 @@ struct _GstWarpTV
|
||||||
gint tval;
|
gint tval;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct _GstWarpTVClass
|
struct _GstWarpTVClass {
|
||||||
{
|
GstVideofilterClass parent_class;
|
||||||
GstElementClass parent_class;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/* elementfactory information */
|
|
||||||
static GstElementDetails gst_warptv_details = GST_ELEMENT_DETAILS (
|
|
||||||
"WarpTV",
|
|
||||||
"Filter/Effect/Video",
|
|
||||||
"WarpTV does realtime goo'ing of the video input",
|
|
||||||
"Sam Lantinga <slouken@devolution.com>"
|
|
||||||
);
|
|
||||||
|
|
||||||
|
/* GstWarpTV signals and args */
|
||||||
/* Filter signals and args */
|
enum {
|
||||||
enum
|
|
||||||
{
|
|
||||||
/* FILL ME */
|
/* FILL ME */
|
||||||
LAST_SIGNAL
|
LAST_SIGNAL
|
||||||
};
|
};
|
||||||
|
|
||||||
enum
|
enum {
|
||||||
{
|
|
||||||
ARG_0,
|
ARG_0,
|
||||||
|
/* FILL ME */
|
||||||
};
|
};
|
||||||
|
|
||||||
static void gst_warptv_base_init (gpointer g_class);
|
static void gst_warptv_base_init (gpointer g_class);
|
||||||
static void gst_warptv_class_init (GstWarpTVClass * klass);
|
static void gst_warptv_class_init (gpointer g_class, gpointer class_data);
|
||||||
static void gst_warptv_init (GstWarpTV * filter);
|
static void gst_warptv_init (GTypeInstance *instance, gpointer g_class);
|
||||||
|
|
||||||
static void gst_warptv_initialize (GstWarpTV *filter);
|
static void gst_warptv_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec);
|
||||||
|
static void gst_warptv_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec);
|
||||||
|
|
||||||
static void gst_warptv_set_property (GObject * object, guint prop_id,
|
static void gst_warptv_setup(GstVideofilter *videofilter);
|
||||||
const GValue * value, GParamSpec * pspec);
|
static void initSinTable (GstWarpTV *filter);
|
||||||
static void gst_warptv_get_property (GObject * object, guint prop_id,
|
static void initOffsTable (GstWarpTV *filter);
|
||||||
GValue * value, GParamSpec * pspec);
|
static void initDistTable (GstWarpTV *filter);
|
||||||
|
static void gst_warptv_rgb32 (GstVideofilter *videofilter, void *d, void *s);
|
||||||
|
|
||||||
static void gst_warptv_chain (GstPad * pad, GstData *_data);
|
GType
|
||||||
|
gst_warptv_get_type (void)
|
||||||
static GstElementClass *parent_class = NULL;
|
|
||||||
/*static guint gst_warptv_signals[LAST_SIGNAL] = { 0 }; */
|
|
||||||
|
|
||||||
GType gst_warptv_get_type (void)
|
|
||||||
{
|
{
|
||||||
static GType warptv_type = 0;
|
static GType warptv_type = 0;
|
||||||
|
|
||||||
if (!warptv_type) {
|
if (!warptv_type) {
|
||||||
static const GTypeInfo warptv_info = {
|
static const GTypeInfo warptv_info = {
|
||||||
sizeof (GstWarpTVClass),
|
sizeof(GstWarpTVClass),
|
||||||
gst_warptv_base_init,
|
gst_warptv_base_init,
|
||||||
NULL,
|
NULL,
|
||||||
(GClassInitFunc) gst_warptv_class_init,
|
gst_warptv_class_init,
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
sizeof (GstWarpTV),
|
sizeof(GstWarpTV),
|
||||||
0,
|
0,
|
||||||
(GInstanceInitFunc) gst_warptv_init,
|
gst_warptv_init,
|
||||||
};
|
};
|
||||||
|
warptv_type = g_type_register_static(GST_TYPE_VIDEOFILTER,
|
||||||
warptv_type = g_type_register_static (GST_TYPE_ELEMENT, "GstWarpTV", &warptv_info, 0);
|
"GstWarpTV", &warptv_info, 0);
|
||||||
}
|
}
|
||||||
return warptv_type;
|
return warptv_type;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static GstVideofilterFormat gst_warptv_formats[] = {
|
||||||
|
{ "RGB ", 32, gst_warptv_rgb32, 24, G_BIG_ENDIAN, 0x00ff0000, 0x0000ff00, 0x000000ff },
|
||||||
|
{ "RGB ", 32, gst_warptv_rgb32, 24, G_BIG_ENDIAN, 0xff000000, 0x00ff0000, 0x0000ff00 },
|
||||||
|
{ "RGB ", 32, gst_warptv_rgb32, 24, G_BIG_ENDIAN, 0x000000ff, 0x0000ff00, 0x00ff0000 },
|
||||||
|
{ "RGB ", 32, gst_warptv_rgb32, 24, G_BIG_ENDIAN, 0x0000ff00, 0x00ff0000, 0xff000000 },
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gst_warptv_base_init (gpointer g_class)
|
gst_warptv_base_init (gpointer g_class)
|
||||||
{
|
{
|
||||||
|
static GstElementDetails warptv_details = GST_ELEMENT_DETAILS (
|
||||||
|
"WarpTV",
|
||||||
|
"Filter/Effect/Video",
|
||||||
|
"WarpTV does realtime goo'ing of the video input",
|
||||||
|
"Sam Lantinga <slouken@devolution.com>"
|
||||||
|
);
|
||||||
GstElementClass *element_class = GST_ELEMENT_CLASS (g_class);
|
GstElementClass *element_class = GST_ELEMENT_CLASS (g_class);
|
||||||
|
GstVideofilterClass *videofilter_class = GST_VIDEOFILTER_CLASS (g_class);
|
||||||
|
int i;
|
||||||
|
|
||||||
|
gst_element_class_set_details (element_class, &warptv_details);
|
||||||
|
|
||||||
gst_element_class_add_pad_template (element_class,
|
for(i=0;i<G_N_ELEMENTS(gst_warptv_formats);i++){
|
||||||
gst_static_pad_template_get (&gst_effectv_src_template));
|
gst_videofilter_class_add_format(videofilter_class,
|
||||||
gst_element_class_add_pad_template (element_class,
|
gst_warptv_formats + i);
|
||||||
gst_static_pad_template_get (&gst_effectv_sink_template));
|
}
|
||||||
|
|
||||||
gst_element_class_set_details (element_class, &gst_warptv_details);
|
gst_videofilter_class_add_pad_templates (GST_VIDEOFILTER_CLASS (g_class));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gst_warptv_class_init (GstWarpTVClass * klass)
|
gst_warptv_class_init (gpointer g_class, gpointer class_data)
|
||||||
{
|
{
|
||||||
GObjectClass *gobject_class;
|
GObjectClass *gobject_class;
|
||||||
GstElementClass *gstelement_class;
|
GstVideofilterClass *videofilter_class;
|
||||||
|
|
||||||
gobject_class = (GObjectClass *) klass;
|
gobject_class = G_OBJECT_CLASS (g_class);
|
||||||
gstelement_class = (GstElementClass *) klass;
|
videofilter_class = GST_VIDEOFILTER_CLASS (g_class);
|
||||||
|
|
||||||
parent_class = g_type_class_ref (GST_TYPE_ELEMENT);
|
#if 0
|
||||||
|
g_object_class_install_property(gobject_class, ARG_METHOD,
|
||||||
|
g_param_spec_enum("method","method","method",
|
||||||
|
GST_TYPE_WARPTV_METHOD, GST_WARPTV_METHOD_1,
|
||||||
|
G_PARAM_READWRITE));
|
||||||
|
#endif
|
||||||
|
|
||||||
gobject_class->set_property = gst_warptv_set_property;
|
gobject_class->set_property = gst_warptv_set_property;
|
||||||
gobject_class->get_property = gst_warptv_get_property;
|
gobject_class->get_property = gst_warptv_get_property;
|
||||||
}
|
|
||||||
|
|
||||||
static GstPadLinkReturn
|
videofilter_class->setup = gst_warptv_setup;
|
||||||
gst_warptv_sinkconnect (GstPad * pad, const GstCaps * caps)
|
|
||||||
{
|
|
||||||
GstWarpTV *filter;
|
|
||||||
GstStructure *structure;
|
|
||||||
|
|
||||||
filter = GST_WARPTV (gst_pad_get_parent (pad));
|
|
||||||
structure = gst_caps_get_structure (caps, 0);
|
|
||||||
|
|
||||||
gst_structure_get_int (structure, "width", &filter->width);
|
|
||||||
gst_structure_get_int (structure, "height", &filter->height);
|
|
||||||
|
|
||||||
gst_warptv_initialize (filter);
|
|
||||||
|
|
||||||
return gst_pad_try_set_caps (filter->srcpad, caps);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gst_warptv_init (GstWarpTV * filter)
|
gst_warptv_init (GTypeInstance *instance, gpointer g_class)
|
||||||
{
|
{
|
||||||
filter->sinkpad = gst_pad_new_from_template (
|
GstWarpTV *warptv = GST_WARPTV (instance);
|
||||||
gst_static_pad_template_get (&gst_effectv_sink_template), "sink");
|
GstVideofilter *videofilter;
|
||||||
gst_pad_set_chain_function (filter->sinkpad, gst_warptv_chain);
|
|
||||||
gst_pad_set_link_function (filter->sinkpad, gst_warptv_sinkconnect);
|
|
||||||
gst_element_add_pad (GST_ELEMENT (filter), filter->sinkpad);
|
|
||||||
|
|
||||||
filter->srcpad = gst_pad_new_from_template (
|
GST_DEBUG("gst_warptv_init");
|
||||||
gst_static_pad_template_get (&gst_effectv_src_template), "src");
|
|
||||||
gst_element_add_pad (GST_ELEMENT (filter), filter->srcpad);
|
|
||||||
|
|
||||||
filter->tval = 0;
|
videofilter = GST_VIDEOFILTER(warptv);
|
||||||
filter->disttable = NULL;
|
|
||||||
filter->offstable = NULL;
|
/* do stuff */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
gst_warptv_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec)
|
||||||
|
{
|
||||||
|
GstWarpTV *src;
|
||||||
|
|
||||||
|
/* it's not null if we got it, but it might not be ours */
|
||||||
|
g_return_if_fail(GST_IS_WARPTV(object));
|
||||||
|
src = GST_WARPTV(object);
|
||||||
|
|
||||||
|
GST_DEBUG("gst_warptv_set_property");
|
||||||
|
switch (prop_id) {
|
||||||
|
#if 0
|
||||||
|
case ARG_METHOD:
|
||||||
|
src->method = g_value_get_enum (value);
|
||||||
|
break;
|
||||||
|
#endif
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
gst_warptv_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
|
||||||
|
{
|
||||||
|
GstWarpTV *src;
|
||||||
|
|
||||||
|
/* it's not null if we got it, but it might not be ours */
|
||||||
|
g_return_if_fail(GST_IS_WARPTV(object));
|
||||||
|
src = GST_WARPTV(object);
|
||||||
|
|
||||||
|
switch (prop_id) {
|
||||||
|
#if 0
|
||||||
|
case ARG_METHOD:
|
||||||
|
g_value_set_enum (value, src->method);
|
||||||
|
break;
|
||||||
|
#endif
|
||||||
|
default:
|
||||||
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static void gst_warptv_setup(GstVideofilter *videofilter)
|
||||||
|
{
|
||||||
|
GstWarpTV *warptv;
|
||||||
|
int width = gst_videofilter_get_input_width(videofilter);
|
||||||
|
int height = gst_videofilter_get_input_height(videofilter);
|
||||||
|
|
||||||
|
g_return_if_fail(GST_IS_WARPTV(videofilter));
|
||||||
|
warptv = GST_WARPTV(videofilter);
|
||||||
|
|
||||||
|
/* if any setup needs to be done, do it here */
|
||||||
|
|
||||||
|
warptv->width = width;
|
||||||
|
warptv->height = height;
|
||||||
|
warptv->tval = 0;
|
||||||
|
|
||||||
|
g_free (warptv->disttable);
|
||||||
|
g_free (warptv->offstable);
|
||||||
|
|
||||||
|
warptv->offstable = (guint32 *) g_malloc (height * sizeof (guint32));
|
||||||
|
warptv->disttable = g_malloc (width * height * sizeof (guint32));
|
||||||
|
|
||||||
|
initSinTable (warptv);
|
||||||
|
initOffsTable (warptv);
|
||||||
|
initDistTable (warptv);
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
initSinTable (GstWarpTV *filter)
|
initSinTable (GstWarpTV *filter)
|
||||||
|
@ -246,53 +311,32 @@ initDistTable (GstWarpTV *filter)
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void gst_warptv_rgb32 (GstVideofilter *videofilter,
|
||||||
gst_warptv_initialize (GstWarpTV *filter)
|
void *d, void *s)
|
||||||
{
|
{
|
||||||
g_free (filter->disttable);
|
GstWarpTV *warptv;
|
||||||
g_free (filter->offstable);
|
int width = gst_videofilter_get_input_width(videofilter);
|
||||||
|
int height = gst_videofilter_get_input_height(videofilter);
|
||||||
filter->offstable = (guint32 *) g_malloc (filter->height * sizeof (guint32));
|
guint32 *src = s;
|
||||||
filter->disttable = g_malloc (filter->width * filter->height * sizeof (guint32));
|
guint32 *dest = d;
|
||||||
|
|
||||||
initSinTable (filter);
|
|
||||||
initOffsTable (filter);
|
|
||||||
initDistTable (filter);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
gst_warptv_chain (GstPad * pad, GstData *_data)
|
|
||||||
{
|
|
||||||
GstBuffer *buf = GST_BUFFER (_data);
|
|
||||||
GstWarpTV *filter;
|
|
||||||
guint32 *src, *dest;
|
|
||||||
gint xw,yw,cw;
|
gint xw,yw,cw;
|
||||||
GstBuffer *outbuf;
|
|
||||||
gint32 c,i, x,y, dx,dy, maxx, maxy;
|
gint32 c,i, x,y, dx,dy, maxx, maxy;
|
||||||
gint32 width, height, skip, *ctptr, *distptr;
|
gint32 skip, *ctptr, *distptr;
|
||||||
gint32 *sintable, *ctable;
|
gint32 *sintable, *ctable;
|
||||||
|
|
||||||
filter = GST_WARPTV (gst_pad_get_parent (pad));
|
g_return_if_fail(GST_IS_WARPTV(videofilter));
|
||||||
|
warptv = GST_WARPTV(videofilter);
|
||||||
|
|
||||||
src = (guint32 *) GST_BUFFER_DATA (buf);
|
xw = (gint) (sin ((warptv->tval + 100) * M_PI / 128) * 30);
|
||||||
|
yw = (gint) (sin ((warptv->tval) * M_PI / 256) * -35);
|
||||||
|
cw = (gint) (sin ((warptv->tval - 70) * M_PI / 64) * 50);
|
||||||
|
xw += (gint) (sin ((warptv->tval - 10) * M_PI / 512) * 40);
|
||||||
|
yw += (gint) (sin ((warptv->tval + 30) * M_PI / 512) * 40);
|
||||||
|
|
||||||
outbuf = gst_buffer_new ();
|
ctptr = warptv->ctable;
|
||||||
GST_BUFFER_SIZE (outbuf) = (filter->width * filter->height * sizeof(guint32));
|
distptr = warptv->disttable;
|
||||||
dest = (guint32 *) GST_BUFFER_DATA (outbuf) = g_malloc (GST_BUFFER_SIZE (outbuf));
|
sintable = warptv->sintable;
|
||||||
GST_BUFFER_TIMESTAMP (outbuf) = GST_BUFFER_TIMESTAMP (buf);
|
ctable = warptv->ctable;
|
||||||
|
|
||||||
xw = (gint) (sin ((filter->tval + 100) * M_PI / 128) * 30);
|
|
||||||
yw = (gint) (sin ((filter->tval) * M_PI / 256) * -35);
|
|
||||||
cw = (gint) (sin ((filter->tval - 70) * M_PI / 64) * 50);
|
|
||||||
xw += (gint) (sin ((filter->tval - 10) * M_PI / 512) * 40);
|
|
||||||
yw += (gint) (sin ((filter->tval + 30) * M_PI / 512) * 40);
|
|
||||||
|
|
||||||
ctptr = filter->ctable;
|
|
||||||
distptr = filter->disttable;
|
|
||||||
width = filter->width;
|
|
||||||
height = filter->height;
|
|
||||||
sintable = filter->sintable;
|
|
||||||
ctable = filter->ctable;
|
|
||||||
|
|
||||||
skip = 0 ; /* video_width*sizeof(RGB32)/4 - video_width;; */
|
skip = 0 ; /* video_width*sizeof(RGB32)/4 - video_width;; */
|
||||||
c = 0;
|
c = 0;
|
||||||
|
@ -316,47 +360,11 @@ gst_warptv_chain (GstPad * pad, GstData *_data)
|
||||||
|
|
||||||
if (dy < 0) dy = 0;
|
if (dy < 0) dy = 0;
|
||||||
else if (dy > maxy) dy = maxy;
|
else if (dy > maxy) dy = maxy;
|
||||||
*dest++ = src[filter->offstable[dy] + dx];
|
*dest++ = src[warptv->offstable[dy] + dx];
|
||||||
}
|
}
|
||||||
dest += skip;
|
dest += skip;
|
||||||
}
|
}
|
||||||
|
|
||||||
filter->tval = (filter->tval + 1) & 511;
|
warptv->tval = (warptv->tval + 1) & 511;
|
||||||
|
|
||||||
gst_buffer_unref (buf);
|
|
||||||
|
|
||||||
gst_pad_push (filter->srcpad, GST_DATA (outbuf));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
gst_warptv_set_property (GObject * object, guint prop_id, const GValue * value, GParamSpec * pspec)
|
|
||||||
{
|
|
||||||
GstWarpTV *filter;
|
|
||||||
|
|
||||||
/* it's not null if we got it, but it might not be ours */
|
|
||||||
g_return_if_fail (GST_IS_WARPTV (object));
|
|
||||||
|
|
||||||
filter = GST_WARPTV (object);
|
|
||||||
|
|
||||||
switch (prop_id) {
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
gst_warptv_get_property (GObject * object, guint prop_id, GValue * value, GParamSpec * pspec)
|
|
||||||
{
|
|
||||||
GstWarpTV *filter;
|
|
||||||
|
|
||||||
/* it's not null if we got it, but it might not be ours */
|
|
||||||
g_return_if_fail (GST_IS_WARPTV (object));
|
|
||||||
|
|
||||||
filter = GST_WARPTV (object);
|
|
||||||
|
|
||||||
switch (prop_id) {
|
|
||||||
default:
|
|
||||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
Loading…
Reference in a new issue