2002-04-23 22:17:01 +00:00
|
|
|
/* GStreamer
|
|
|
|
* Copyright (C) <1999> Erik Walthinsen <omega@cse.ogi.edu>
|
2004-01-10 21:18:31 +00:00
|
|
|
* Copyright (C) <2003> David Schleef <ds@schleef.org>
|
2002-04-23 22:17:01 +00:00
|
|
|
*
|
2004-01-10 21:18:31 +00:00
|
|
|
* EffecTV - Realtime Digital Video Effector
|
2002-04-24 19:50:00 +00:00
|
|
|
* Copyright (C) 2001 FUKUCHI Kentarou
|
2002-04-23 22:17:01 +00:00
|
|
|
*
|
2004-01-10 21:18:31 +00:00
|
|
|
* This library is free software; you can redistribute it and/or
|
2002-08-14 21:01:38 +00:00
|
|
|
* modify it under the terms of the GNU Library General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2 of the License, or (at your option) any later version.
|
2004-01-10 21:18:31 +00:00
|
|
|
*
|
2002-08-14 21:01:38 +00:00
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Library General Public License for more details.
|
2004-01-10 21:18:31 +00:00
|
|
|
*
|
2002-08-14 21:01:38 +00:00
|
|
|
* You should have received a copy of the GNU Library General Public
|
|
|
|
* License along with this library; if not, write to the
|
|
|
|
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
|
|
* Boston, MA 02111-1307, USA.
|
2002-04-23 22:17:01 +00:00
|
|
|
*/
|
|
|
|
|
2004-01-10 21:18:31 +00:00
|
|
|
/*
|
|
|
|
* 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
|
|
|
|
* Realtime picture 'gooing'
|
|
|
|
* by sam lantinga slouken@devolution.com
|
|
|
|
*/
|
|
|
|
|
2003-06-29 19:46:12 +00:00
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
#include "config.h"
|
|
|
|
#endif
|
2003-11-02 12:48:08 +00:00
|
|
|
|
2004-01-10 21:18:31 +00:00
|
|
|
#include <gst/gst.h>
|
|
|
|
#include <gstvideofilter.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <math.h>
|
|
|
|
|
2002-04-23 22:17:01 +00:00
|
|
|
#define GST_TYPE_AGINGTV \
|
|
|
|
(gst_agingtv_get_type())
|
|
|
|
#define GST_AGINGTV(obj) \
|
|
|
|
(G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_AGINGTV,GstAgingTV))
|
|
|
|
#define GST_AGINGTV_CLASS(klass) \
|
2004-01-10 21:18:31 +00:00
|
|
|
(G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_AGINGTV,GstAgingTVClass))
|
2002-04-23 22:17:01 +00:00
|
|
|
#define GST_IS_AGINGTV(obj) \
|
|
|
|
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_AGINGTV))
|
|
|
|
#define GST_IS_AGINGTV_CLASS(obj) \
|
|
|
|
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_AGINGTV))
|
|
|
|
|
2002-04-24 18:33:26 +00:00
|
|
|
#define SCRATCH_MAX 20
|
|
|
|
typedef struct _scratch
|
|
|
|
{
|
|
|
|
gint life;
|
|
|
|
gint x;
|
|
|
|
gint dx;
|
|
|
|
gint init;
|
2004-03-15 19:32:27 +00:00
|
|
|
}
|
|
|
|
scratch;
|
2002-04-24 18:33:26 +00:00
|
|
|
|
2004-03-14 22:34:33 +00:00
|
|
|
static int dx[8] = { 1, 1, 0, -1, -1, -1, 0, 1 };
|
|
|
|
static int dy[8] = { 0, -1, -1, -1, 0, 1, 1, 1 };
|
2002-04-24 18:33:26 +00:00
|
|
|
|
2002-04-23 22:17:01 +00:00
|
|
|
typedef struct _GstAgingTV GstAgingTV;
|
|
|
|
typedef struct _GstAgingTVClass GstAgingTVClass;
|
|
|
|
|
2004-03-14 22:34:33 +00:00
|
|
|
struct _GstAgingTV
|
|
|
|
{
|
2004-01-10 21:18:31 +00:00
|
|
|
GstVideofilter videofilter;
|
2002-04-23 22:17:01 +00:00
|
|
|
|
|
|
|
gint width, height;
|
2002-04-24 18:33:26 +00:00
|
|
|
gint aging_mode;
|
|
|
|
|
|
|
|
scratch scratches[SCRATCH_MAX];
|
|
|
|
gint scratch_lines;
|
|
|
|
|
|
|
|
gint dust_interval;
|
|
|
|
gint pits_interval;
|
2002-04-23 22:17:01 +00:00
|
|
|
|
|
|
|
};
|
|
|
|
|
2004-03-14 22:34:33 +00:00
|
|
|
struct _GstAgingTVClass
|
|
|
|
{
|
2004-01-10 21:18:31 +00:00
|
|
|
GstVideofilterClass parent_class;
|
|
|
|
};
|
2002-04-23 22:17:01 +00:00
|
|
|
|
2004-01-10 21:18:31 +00:00
|
|
|
/* GstAgingTV signals and args */
|
2004-03-14 22:34:33 +00:00
|
|
|
enum
|
|
|
|
{
|
2002-04-23 22:17:01 +00:00
|
|
|
/* FILL ME */
|
|
|
|
LAST_SIGNAL
|
|
|
|
};
|
|
|
|
|
2004-03-14 22:34:33 +00:00
|
|
|
enum
|
|
|
|
{
|
2004-05-21 22:39:30 +00:00
|
|
|
ARG_0
|
|
|
|
/* FILL ME */
|
2002-04-23 22:17:01 +00:00
|
|
|
};
|
|
|
|
|
2004-03-14 22:34:33 +00:00
|
|
|
static void gst_agingtv_base_init (gpointer g_class);
|
|
|
|
static void gst_agingtv_class_init (gpointer g_class, gpointer class_data);
|
|
|
|
static void gst_agingtv_init (GTypeInstance * instance, gpointer g_class);
|
|
|
|
static void gst_agingtv_setup (GstVideofilter * videofilter);
|
2002-04-23 22:17:01 +00:00
|
|
|
|
2004-03-14 22:34:33 +00:00
|
|
|
static void gst_agingtv_set_property (GObject * object, guint prop_id,
|
|
|
|
const GValue * value, GParamSpec * pspec);
|
|
|
|
static void gst_agingtv_get_property (GObject * object, guint prop_id,
|
|
|
|
GValue * value, GParamSpec * pspec);
|
|
|
|
static void gst_agingtv_rgb32 (GstVideofilter * videofilter, void *d, void *s);
|
2002-04-23 22:17:01 +00:00
|
|
|
|
2004-01-10 21:18:31 +00:00
|
|
|
GType
|
|
|
|
gst_agingtv_get_type (void)
|
2002-04-23 22:17:01 +00:00
|
|
|
{
|
|
|
|
static GType agingtv_type = 0;
|
|
|
|
|
|
|
|
if (!agingtv_type) {
|
|
|
|
static const GTypeInfo agingtv_info = {
|
2004-03-14 22:34:33 +00:00
|
|
|
sizeof (GstAgingTVClass),
|
2003-11-02 12:48:08 +00:00
|
|
|
gst_agingtv_base_init,
|
2002-04-23 22:17:01 +00:00
|
|
|
NULL,
|
2004-01-10 21:18:31 +00:00
|
|
|
gst_agingtv_class_init,
|
2002-04-23 22:17:01 +00:00
|
|
|
NULL,
|
|
|
|
NULL,
|
2004-03-14 22:34:33 +00:00
|
|
|
sizeof (GstAgingTV),
|
2002-04-23 22:17:01 +00:00
|
|
|
0,
|
2004-01-10 21:18:31 +00:00
|
|
|
gst_agingtv_init,
|
2002-04-23 22:17:01 +00:00
|
|
|
};
|
2004-03-15 19:32:27 +00:00
|
|
|
|
2004-03-14 22:34:33 +00:00
|
|
|
agingtv_type = g_type_register_static (GST_TYPE_VIDEOFILTER,
|
2004-03-15 19:32:27 +00:00
|
|
|
"GstAgingTV", &agingtv_info, 0);
|
2002-04-23 22:17:01 +00:00
|
|
|
}
|
|
|
|
return agingtv_type;
|
|
|
|
}
|
|
|
|
|
2004-01-10 21:18:31 +00:00
|
|
|
static GstVideofilterFormat gst_agingtv_formats[] = {
|
2004-03-14 22:34:33 +00:00
|
|
|
{"RGB ", 32, gst_agingtv_rgb32, 24, G_BIG_ENDIAN, 0x0000ff00, 0x00ff0000,
|
|
|
|
0xff000000}
|
2004-01-10 21:18:31 +00:00
|
|
|
};
|
2004-03-14 22:34:33 +00:00
|
|
|
|
2003-11-02 12:48:08 +00:00
|
|
|
static void
|
|
|
|
gst_agingtv_base_init (gpointer g_class)
|
|
|
|
{
|
2004-03-14 22:34:33 +00:00
|
|
|
static GstElementDetails agingtv_details = GST_ELEMENT_DETAILS ("AgingTV",
|
|
|
|
"Filter/Effect/Video",
|
|
|
|
"AgingTV adds age to video input using scratches and dust",
|
|
|
|
"Sam Lantinga <slouken@devolution.com>");
|
2003-11-02 12:48:08 +00:00
|
|
|
GstElementClass *element_class = GST_ELEMENT_CLASS (g_class);
|
2004-01-10 21:18:31 +00:00
|
|
|
GstVideofilterClass *videofilter_class = GST_VIDEOFILTER_CLASS (g_class);
|
|
|
|
int i;
|
2004-03-14 22:34:33 +00:00
|
|
|
|
2004-01-10 21:18:31 +00:00
|
|
|
gst_element_class_set_details (element_class, &agingtv_details);
|
|
|
|
|
2004-03-14 22:34:33 +00:00
|
|
|
for (i = 0; i < G_N_ELEMENTS (gst_agingtv_formats); i++) {
|
|
|
|
gst_videofilter_class_add_format (videofilter_class,
|
2004-03-15 19:32:27 +00:00
|
|
|
gst_agingtv_formats + i);
|
2004-01-10 21:18:31 +00:00
|
|
|
}
|
2003-11-02 12:48:08 +00:00
|
|
|
|
2004-01-10 21:18:31 +00:00
|
|
|
gst_videofilter_class_add_pad_templates (GST_VIDEOFILTER_CLASS (g_class));
|
2003-11-02 12:48:08 +00:00
|
|
|
}
|
|
|
|
|
2002-04-23 22:17:01 +00:00
|
|
|
static void
|
2004-01-10 21:18:31 +00:00
|
|
|
gst_agingtv_class_init (gpointer g_class, gpointer class_data)
|
2002-04-23 22:17:01 +00:00
|
|
|
{
|
|
|
|
GObjectClass *gobject_class;
|
2004-01-10 21:18:31 +00:00
|
|
|
GstVideofilterClass *videofilter_class;
|
2002-04-23 22:17:01 +00:00
|
|
|
|
2004-01-10 21:18:31 +00:00
|
|
|
gobject_class = G_OBJECT_CLASS (g_class);
|
|
|
|
videofilter_class = GST_VIDEOFILTER_CLASS (g_class);
|
2002-04-23 22:17:01 +00:00
|
|
|
|
2004-01-10 21:18:31 +00:00
|
|
|
#if 0
|
2004-03-14 22:34:33 +00:00
|
|
|
g_object_class_install_property (gobject_class, ARG_METHOD,
|
|
|
|
g_param_spec_enum ("method", "method", "method",
|
2004-03-15 19:32:27 +00:00
|
|
|
GST_TYPE_AGINGTV_METHOD, GST_AGINGTV_METHOD_1, G_PARAM_READWRITE));
|
2004-01-10 21:18:31 +00:00
|
|
|
#endif
|
2002-04-23 22:17:01 +00:00
|
|
|
|
|
|
|
gobject_class->set_property = gst_agingtv_set_property;
|
|
|
|
gobject_class->get_property = gst_agingtv_get_property;
|
2004-01-10 21:18:31 +00:00
|
|
|
|
|
|
|
videofilter_class->setup = gst_agingtv_setup;
|
2002-04-23 22:17:01 +00:00
|
|
|
}
|
|
|
|
|
2004-01-10 21:18:31 +00:00
|
|
|
static void
|
2004-03-14 22:34:33 +00:00
|
|
|
gst_agingtv_init (GTypeInstance * instance, gpointer g_class)
|
2002-04-23 22:17:01 +00:00
|
|
|
{
|
2004-01-10 21:18:31 +00:00
|
|
|
GstAgingTV *agingtv = GST_AGINGTV (instance);
|
|
|
|
GstVideofilter *videofilter;
|
2002-04-23 22:17:01 +00:00
|
|
|
|
2004-03-14 22:34:33 +00:00
|
|
|
GST_DEBUG ("gst_agingtv_init");
|
2002-04-23 22:17:01 +00:00
|
|
|
|
2004-03-14 22:34:33 +00:00
|
|
|
videofilter = GST_VIDEOFILTER (agingtv);
|
2002-04-23 22:17:01 +00:00
|
|
|
|
2004-01-10 21:18:31 +00:00
|
|
|
/* do stuff */
|
2002-04-23 22:17:01 +00:00
|
|
|
}
|
|
|
|
|
2004-03-14 22:34:33 +00:00
|
|
|
static void
|
|
|
|
gst_agingtv_setup (GstVideofilter * videofilter)
|
2002-04-23 22:17:01 +00:00
|
|
|
{
|
2004-01-10 21:18:31 +00:00
|
|
|
GstAgingTV *agingtv;
|
2004-03-14 22:34:33 +00:00
|
|
|
int width = gst_videofilter_get_input_width (videofilter);
|
|
|
|
int height = gst_videofilter_get_input_height (videofilter);
|
2004-01-10 21:18:31 +00:00
|
|
|
|
2004-03-14 22:34:33 +00:00
|
|
|
g_return_if_fail (GST_IS_AGINGTV (videofilter));
|
|
|
|
agingtv = GST_AGINGTV (videofilter);
|
2002-04-24 18:33:26 +00:00
|
|
|
|
2004-01-10 21:18:31 +00:00
|
|
|
/* if any setup needs to be done, do it here */
|
|
|
|
|
|
|
|
agingtv->width = width;
|
|
|
|
agingtv->height = height;
|
|
|
|
}
|
2002-04-24 18:33:26 +00:00
|
|
|
|
2004-03-14 22:34:33 +00:00
|
|
|
static unsigned int
|
2002-04-24 18:33:26 +00:00
|
|
|
fastrand (void)
|
|
|
|
{
|
|
|
|
static unsigned int fastrand_val;
|
2002-04-23 22:17:01 +00:00
|
|
|
|
2002-04-24 18:33:26 +00:00
|
|
|
return (fastrand_val = fastrand_val * 1103515245 + 12345);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2004-03-14 22:34:33 +00:00
|
|
|
static void
|
|
|
|
coloraging (guint32 * src, guint32 * dest, gint video_area)
|
2002-04-24 18:33:26 +00:00
|
|
|
{
|
|
|
|
guint32 a, b;
|
|
|
|
gint i;
|
|
|
|
|
|
|
|
for (i = video_area; i; i--) {
|
|
|
|
a = *src++;
|
|
|
|
b = (a & 0xfcfcfc) >> 2;
|
|
|
|
*dest++ = a - b + 0x181818 + ((fastrand () >> 8) & 0x101010);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2004-03-14 22:34:33 +00:00
|
|
|
static void
|
|
|
|
scratching (scratch * scratches, gint scratch_lines, guint32 * dest, gint width,
|
|
|
|
gint height)
|
2002-04-24 18:33:26 +00:00
|
|
|
{
|
|
|
|
gint i, y, y1, y2;
|
|
|
|
guint32 *p, a, b;
|
|
|
|
scratch *scratch;
|
|
|
|
|
|
|
|
for (i = 0; i < scratch_lines; i++) {
|
|
|
|
scratch = &scratches[i];
|
|
|
|
|
|
|
|
if (scratch->life) {
|
|
|
|
scratch->x = scratch->x + scratch->dx;
|
2004-03-14 22:34:33 +00:00
|
|
|
|
2002-04-24 18:33:26 +00:00
|
|
|
if (scratch->x < 0 || scratch->x > width * 256) {
|
2004-03-15 19:32:27 +00:00
|
|
|
scratch->life = 0;
|
|
|
|
break;
|
2002-04-24 18:33:26 +00:00
|
|
|
}
|
|
|
|
p = dest + (scratch->x >> 8);
|
|
|
|
if (scratch->init) {
|
2004-03-15 19:32:27 +00:00
|
|
|
y1 = scratch->init;
|
|
|
|
scratch->init = 0;
|
2002-04-24 18:33:26 +00:00
|
|
|
} else {
|
2004-03-15 19:32:27 +00:00
|
|
|
y1 = 0;
|
2002-04-24 18:33:26 +00:00
|
|
|
}
|
|
|
|
scratch->life--;
|
|
|
|
if (scratch->life) {
|
2004-03-15 19:32:27 +00:00
|
|
|
y2 = height;
|
2002-04-24 18:33:26 +00:00
|
|
|
} else {
|
2004-03-15 19:32:27 +00:00
|
|
|
y2 = fastrand () % height;
|
2002-04-24 18:33:26 +00:00
|
|
|
}
|
|
|
|
for (y = y1; y < y2; y++) {
|
2004-03-15 19:32:27 +00:00
|
|
|
a = *p & 0xfefeff;
|
|
|
|
a += 0x202020;
|
|
|
|
b = a & 0x1010100;
|
|
|
|
*p = a | (b - (b >> 8));
|
|
|
|
p += width;
|
2002-04-24 18:33:26 +00:00
|
|
|
}
|
|
|
|
} else {
|
|
|
|
if ((fastrand () & 0xf0000000) == 0) {
|
2004-03-15 19:32:27 +00:00
|
|
|
scratch->life = 2 + (fastrand () >> 27);
|
|
|
|
scratch->x = fastrand () % (width * 256);
|
|
|
|
scratch->dx = ((int) fastrand ()) >> 23;
|
|
|
|
scratch->init = (fastrand () % (height - 1)) + 1;
|
2002-04-24 18:33:26 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2004-03-14 22:34:33 +00:00
|
|
|
static void
|
|
|
|
dusts (guint32 * dest, gint width, gint height, gint dust_interval,
|
|
|
|
gint area_scale)
|
2002-04-24 18:33:26 +00:00
|
|
|
{
|
|
|
|
int i, j;
|
|
|
|
int dnum;
|
|
|
|
int d, len;
|
2002-04-27 17:07:39 +00:00
|
|
|
guint x, y;
|
2002-04-24 18:33:26 +00:00
|
|
|
|
|
|
|
if (dust_interval == 0) {
|
|
|
|
if ((fastrand () & 0xf0000000) == 0) {
|
|
|
|
dust_interval = fastrand () >> 29;
|
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
2004-03-14 22:34:33 +00:00
|
|
|
dnum = area_scale * 4 + (fastrand () >> 27);
|
|
|
|
|
2002-04-24 18:33:26 +00:00
|
|
|
for (i = 0; i < dnum; i++) {
|
|
|
|
x = fastrand () % width;
|
|
|
|
y = fastrand () % height;
|
|
|
|
d = fastrand () >> 29;
|
|
|
|
len = fastrand () % area_scale + 5;
|
|
|
|
for (j = 0; j < len; j++) {
|
|
|
|
dest[y * width + x] = 0x101010;
|
|
|
|
y += dy[d];
|
|
|
|
x += dx[d];
|
2002-04-27 17:07:39 +00:00
|
|
|
|
2004-03-14 22:34:33 +00:00
|
|
|
if (y >= height || x >= width)
|
2004-03-15 19:32:27 +00:00
|
|
|
break;
|
2002-04-27 17:07:39 +00:00
|
|
|
|
2002-04-24 18:33:26 +00:00
|
|
|
d = (d + fastrand () % 3 - 1) & 7;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
dust_interval--;
|
|
|
|
}
|
|
|
|
|
2004-03-14 22:34:33 +00:00
|
|
|
static void
|
|
|
|
pits (guint32 * dest, gint width, gint height, gint area_scale,
|
|
|
|
gint pits_interval)
|
2002-04-24 18:33:26 +00:00
|
|
|
{
|
|
|
|
int i, j;
|
|
|
|
int pnum, size, pnumscale;
|
2002-04-27 17:07:39 +00:00
|
|
|
guint x, y;
|
2002-04-24 18:33:26 +00:00
|
|
|
|
|
|
|
pnumscale = area_scale * 2;
|
|
|
|
if (pits_interval) {
|
|
|
|
pnum = pnumscale + (fastrand () % pnumscale);
|
|
|
|
|
|
|
|
pits_interval--;
|
|
|
|
} else {
|
|
|
|
pnum = fastrand () % pnumscale;
|
|
|
|
|
|
|
|
if ((fastrand () & 0xf8000000) == 0) {
|
|
|
|
pits_interval = (fastrand () >> 28) + 20;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
for (i = 0; i < pnum; i++) {
|
|
|
|
x = fastrand () % (width - 1);
|
|
|
|
y = fastrand () % (height - 1);
|
|
|
|
|
|
|
|
size = fastrand () >> 28;
|
|
|
|
|
|
|
|
for (j = 0; j < size; j++) {
|
|
|
|
x = x + fastrand () % 3 - 1;
|
|
|
|
y = y + fastrand () % 3 - 1;
|
2002-04-27 17:07:39 +00:00
|
|
|
|
2004-03-14 22:34:33 +00:00
|
|
|
if (y >= height || x >= width)
|
2004-03-15 19:32:27 +00:00
|
|
|
break;
|
2002-04-27 17:07:39 +00:00
|
|
|
|
2002-04-24 18:33:26 +00:00
|
|
|
dest[y * width + x] = 0xc0c0c0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2004-03-14 22:34:33 +00:00
|
|
|
static void
|
|
|
|
gst_agingtv_rgb32 (GstVideofilter * videofilter, void *d, void *s)
|
2002-04-23 22:17:01 +00:00
|
|
|
{
|
2004-01-10 21:18:31 +00:00
|
|
|
GstAgingTV *agingtv;
|
2004-03-14 22:34:33 +00:00
|
|
|
int width = gst_videofilter_get_input_width (videofilter);
|
|
|
|
int height = gst_videofilter_get_input_height (videofilter);
|
2004-01-10 21:18:31 +00:00
|
|
|
int video_size = width * height;
|
|
|
|
guint32 *src = s;
|
|
|
|
guint32 *dest = d;
|
|
|
|
gint area_scale = width * height / 64 / 480;
|
|
|
|
|
2004-03-14 22:34:33 +00:00
|
|
|
if (area_scale <= 0)
|
|
|
|
area_scale = 1;
|
|
|
|
|
|
|
|
g_return_if_fail (GST_IS_AGINGTV (videofilter));
|
|
|
|
agingtv = GST_AGINGTV (videofilter);
|
2004-01-10 21:18:31 +00:00
|
|
|
|
|
|
|
coloraging (src, dest, video_size);
|
|
|
|
scratching (agingtv->scratches, agingtv->scratch_lines, dest, width, height);
|
|
|
|
pits (dest, width, height, area_scale, agingtv->pits_interval);
|
2004-03-14 22:34:33 +00:00
|
|
|
if (area_scale > 1)
|
2004-01-10 21:18:31 +00:00
|
|
|
dusts (dest, width, height, agingtv->dust_interval, area_scale);
|
2004-03-14 22:34:33 +00:00
|
|
|
|
2002-04-23 22:17:01 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2004-03-14 22:34:33 +00:00
|
|
|
gst_agingtv_set_property (GObject * object, guint prop_id, const GValue * value,
|
|
|
|
GParamSpec * pspec)
|
2002-04-23 22:17:01 +00:00
|
|
|
{
|
2004-01-10 21:18:31 +00:00
|
|
|
GstAgingTV *src;
|
2002-04-23 22:17:01 +00:00
|
|
|
|
|
|
|
/* it's not null if we got it, but it might not be ours */
|
2004-03-14 22:34:33 +00:00
|
|
|
g_return_if_fail (GST_IS_AGINGTV (object));
|
|
|
|
src = GST_AGINGTV (object);
|
2002-04-23 22:17:01 +00:00
|
|
|
|
2004-03-14 22:34:33 +00:00
|
|
|
GST_DEBUG ("gst_agingtv_set_property");
|
2002-04-23 22:17:01 +00:00
|
|
|
switch (prop_id) {
|
2004-01-10 21:18:31 +00:00
|
|
|
#if 0
|
|
|
|
case ARG_METHOD:
|
|
|
|
src->method = g_value_get_enum (value);
|
|
|
|
break;
|
|
|
|
#endif
|
2002-04-23 22:17:01 +00:00
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2004-03-14 22:34:33 +00:00
|
|
|
gst_agingtv_get_property (GObject * object, guint prop_id, GValue * value,
|
|
|
|
GParamSpec * pspec)
|
2002-04-23 22:17:01 +00:00
|
|
|
{
|
2004-01-10 21:18:31 +00:00
|
|
|
GstAgingTV *src;
|
2002-04-23 22:17:01 +00:00
|
|
|
|
|
|
|
/* it's not null if we got it, but it might not be ours */
|
2004-03-14 22:34:33 +00:00
|
|
|
g_return_if_fail (GST_IS_AGINGTV (object));
|
|
|
|
src = GST_AGINGTV (object);
|
2002-04-23 22:17:01 +00:00
|
|
|
|
|
|
|
switch (prop_id) {
|
2004-01-10 21:18:31 +00:00
|
|
|
#if 0
|
|
|
|
case ARG_METHOD:
|
|
|
|
g_value_set_enum (value, src->method);
|
|
|
|
break;
|
|
|
|
#endif
|
2002-04-23 22:17:01 +00:00
|
|
|
default:
|
|
|
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|