Commit 2fa12d1a authored by Tim-Philipp Müller's avatar Tim-Philipp Müller

gst/debug/: Port progressreport, navseek, navigationtest, testsink and breakmydata.

Original commit message from CVS:
* gst/debug/Makefile.am:
* gst/debug/breakmydata.c:
* gst/debug/gstdebug.c:
* gst/debug/gstnavigationtest.c:
* gst/debug/gstnavseek.c:
* gst/debug/gstnavseek.h:
* gst/debug/progressreport.c:
* gst/debug/testplugin.c:
Port progressreport, navseek, navigationtest, testsink and
breakmydata.
parent 76620459
2005-10-05 Tim-Philipp Müller <tim at centricular dot net>
* gst/debug/Makefile.am:
* gst/debug/breakmydata.c:
* gst/debug/gstdebug.c:
* gst/debug/gstnavigationtest.c:
* gst/debug/gstnavseek.c:
* gst/debug/gstnavseek.h:
* gst/debug/progressreport.c:
* gst/debug/testplugin.c:
Port progressreport, navseek, navigationtest, testsink and
breakmydata.
2005-10-05 Edward Hervey <edward@fluendo.com>
* ext/dv/gstdvdemux.c: (gst_dvdemux_src_convert),
......
plugin_LTLIBRARIES = libgstefence.la # libgstnavigationtest.la libgstdebug.la
plugin_LTLIBRARIES = libgstefence.la libgstdebug.la libgstnavigationtest.la
noinst_HEADERS = efence.h gstnavigationtest.h gstnavseek.h tests.h
......@@ -7,18 +7,20 @@ libgstefence_la_CFLAGS = $(GST_CFLAGS)
libgstefence_la_LIBADD = $(GST_LIBS)
libgstefence_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
# libgstnavigationtest_la_SOURCES = gstnavigationtest.c
# libgstnavigationtest_la_CFLAGS = $(GST_CFLAGS) -I$(top_srcdir)/gst/videofilter
# libgstnavigationtest_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
#
# libgstdebug_la_SOURCES = \
# gstdebug.c \
# breakmydata.c \
# negotiation.c \
# gstnavseek.c \
# progressreport.c \
# tests.c \
# testplugin.c
#
# libgstdebug_la_CFLAGS = $(GST_CFLAGS)
# libgstdebug_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
libgstnavigationtest_la_SOURCES = gstnavigationtest.c
libgstnavigationtest_la_CFLAGS = $(GST_CFLAGS) -I$(top_srcdir)/gst/videofilter
libgstnavigationtest_la_LIBADD = $(GST_LIBS) $(top_builddir)/gst/videofilter/libgstvideofilter-@GST_MAJORMINOR@.la
libgstnavigationtest_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
libgstdebug_la_SOURCES = \
gstdebug.c \
breakmydata.c \
progressreport.c \
gstnavseek.c \
tests.c \
testplugin.c
# negotiation.c
libgstdebug_la_CFLAGS = $(GST_CFLAGS) $(GST_BASE_CFLAGS)
libgstdebug_la_LIBADD = $(GST_LIBS) $(GST_BASE_LIBS)
libgstdebug_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
......@@ -22,6 +22,7 @@
#endif
#include <gst/gst.h>
#include <gst/base/gstbasetransform.h>
GST_DEBUG_CATEGORY_STATIC (gst_break_my_data_debug);
#define GST_CAT_DEFAULT gst_break_my_data_debug
......@@ -56,10 +57,7 @@ typedef struct _GstBreakMyDataClass GstBreakMyDataClass;
struct _GstBreakMyData
{
GstElement element;
GstPad *sinkpad;
GstPad *srcpad;
GstBaseTransform basetransform;
GRand *rand;
guint skipped;
......@@ -72,113 +70,91 @@ struct _GstBreakMyData
struct _GstBreakMyDataClass
{
GstElementClass parent_class;
GstBaseTransformClass parent_class;
};
GST_BOILERPLATE (GstBreakMyData, gst_break_my_data, GstElement,
GST_TYPE_ELEMENT)
static void gst_break_my_data_set_property (GObject * object,
static void gst_break_my_data_set_property (GObject * object,
guint prop_id, const GValue * value, GParamSpec * pspec);
static void gst_break_my_data_get_property (GObject * object,
static void gst_break_my_data_get_property (GObject * object,
guint prop_id, GValue * value, GParamSpec * pspec);
static void gst_break_my_data_chain (GstPad * pad, GstData * _data);
static GstStateChangeReturn gst_break_my_data_change_state (GstElement *
element);
static GstFlowReturn gst_break_my_data_transform_ip (GstBaseTransform * trans,
GstBuffer * buf);
static gboolean gst_break_my_data_stop (GstBaseTransform * trans);
static gboolean gst_break_my_data_start (GstBaseTransform * trans);
static GstElementDetails details = GST_ELEMENT_DETAILS ("breakmydata",
"Testing",
"randomly change data in the stream",
"Benjamin Otte <otte@gnome>");
GstStaticPadTemplate bmd_src_template = GST_STATIC_PAD_TEMPLATE ("src",
GST_PAD_SRC,
GST_PAD_ALWAYS,
GST_STATIC_CAPS_ANY);
GstStaticPadTemplate bmd_sink_template = GST_STATIC_PAD_TEMPLATE ("sink",
GST_PAD_SINK,
GST_PAD_ALWAYS,
GST_STATIC_CAPS_ANY);
GST_BOILERPLATE (GstBreakMyData, gst_break_my_data, GstBaseTransform,
GST_TYPE_BASE_TRANSFORM)
static void gst_break_my_data_base_init (gpointer g_class)
{
static GstElementDetails details = GST_ELEMENT_DETAILS ("breakmydata",
"Testing",
"randomly change data in the stream",
"Benjamin Otte <otte@gnome>");
GstElementClass *gstelement_class = GST_ELEMENT_CLASS (g_class);
gst_element_class_add_pad_template (gstelement_class,
gst_static_pad_template_get (&bmd_sink_template));
gst_element_class_add_pad_template (gstelement_class,
gst_static_pad_template_get (&bmd_src_template));
gst_element_class_set_details (gstelement_class, &details);
}
static void
gst_break_my_data_class_init (GstBreakMyDataClass * klass)
{
GObjectClass *object = G_OBJECT_CLASS (klass);
GstElementClass *element = GST_ELEMENT_CLASS (klass);
GstBaseTransformClass *gstbasetrans_class;
GObjectClass *gobject_class;
gobject_class = G_OBJECT_CLASS (klass);
gstbasetrans_class = GST_BASE_TRANSFORM_CLASS (klass);
object->set_property = GST_DEBUG_FUNCPTR (gst_break_my_data_set_property);
object->get_property = GST_DEBUG_FUNCPTR (gst_break_my_data_get_property);
gobject_class->set_property =
GST_DEBUG_FUNCPTR (gst_break_my_data_set_property);
gobject_class->get_property =
GST_DEBUG_FUNCPTR (gst_break_my_data_get_property);
g_object_class_install_property (object, ARG_SEED,
g_object_class_install_property (gobject_class, ARG_SEED,
g_param_spec_uint ("seed", "seed",
"seed for randomness (initialized when goint from READY to PAUSED)",
"seed for randomness (initialized when going from READY to PAUSED)",
0, 0xFFFFFFFF, 0, G_PARAM_READWRITE | G_PARAM_CONSTRUCT));
g_object_class_install_property (object, ARG_SET_TO,
g_object_class_install_property (gobject_class, ARG_SET_TO,
g_param_spec_int ("set-to", "set-to",
"set changed bytes to this value (-1 means random value",
-1, 255, -1, G_PARAM_READWRITE | G_PARAM_CONSTRUCT));
g_object_class_install_property (object, ARG_SKIP,
g_object_class_install_property (gobject_class, ARG_SKIP,
g_param_spec_uint ("skip", "skip",
"amount of bytes skipped at the beginning of stream",
0, G_MAXUINT, 0, G_PARAM_READWRITE | G_PARAM_CONSTRUCT));
g_object_class_install_property (object, ARG_PROBABILITY,
g_object_class_install_property (gobject_class, ARG_PROBABILITY,
g_param_spec_double ("probability", "probability",
"probability that a buffer is changed", 0.0, 1.0, 0.0,
G_PARAM_READWRITE | G_PARAM_CONSTRUCT));
element->change_state = gst_break_my_data_change_state;
"probability for each byte in the buffer to be changed", 0.0, 1.0,
0.0, G_PARAM_READWRITE | G_PARAM_CONSTRUCT));
gstbasetrans_class->transform_ip =
GST_DEBUG_FUNCPTR (gst_break_my_data_transform_ip);
gstbasetrans_class->start = GST_DEBUG_FUNCPTR (gst_break_my_data_start);
gstbasetrans_class->stop = GST_DEBUG_FUNCPTR (gst_break_my_data_stop);
gstbasetrans_class->passthrough_on_same_caps = TRUE;
}
static void
gst_break_my_data_init (GstBreakMyData * break_my_data)
gst_break_my_data_init (GstBreakMyData * bmd, GstBreakMyDataClass * g_class)
{
break_my_data->sinkpad = gst_pad_new ("sink", GST_PAD_SINK);
gst_element_add_pad (GST_ELEMENT (break_my_data), break_my_data->sinkpad);
gst_pad_set_chain_function (break_my_data->sinkpad,
GST_DEBUG_FUNCPTR (gst_break_my_data_chain));
gst_pad_set_link_function (break_my_data->sinkpad, gst_pad_proxy_pad_link);
gst_pad_set_getcaps_function (break_my_data->sinkpad, gst_pad_proxy_getcaps);
break_my_data->srcpad = gst_pad_new ("src", GST_PAD_SRC);
gst_element_add_pad (GST_ELEMENT (break_my_data), break_my_data->srcpad);
gst_pad_set_link_function (break_my_data->srcpad, gst_pad_proxy_pad_link);
gst_pad_set_getcaps_function (break_my_data->srcpad, gst_pad_proxy_getcaps);
}
static void
gst_break_my_data_chain (GstPad * pad, GstData * data)
{
GstBuffer *copy = NULL, *buf = GST_BUFFER (data);
GstBreakMyData *bmd = GST_BREAK_MY_DATA (gst_pad_get_parent (pad));
guint i, size;
if (bmd->skipped < bmd->skip) {
i = bmd->skip - bmd->skipped;
} else {
i = 0;
}
size = GST_BUFFER_SIZE (buf);
GST_LOG_OBJECT (bmd,
"got buffer %p (size %u, timestamp %" G_GUINT64_FORMAT ", offset %"
G_GUINT64_FORMAT "", buf, size, GST_BUFFER_TIMESTAMP (buf),
GST_BUFFER_OFFSET (buf));
for (; i < size; i++) {
if (g_rand_double_range (bmd->rand, 0, 1) < bmd->probability) {
guint8 new;
if (!copy)
copy = gst_buffer_copy_on_write (buf);
if (bmd->set < 0) {
new = g_rand_int_range (bmd->rand, 0, 256);
} else {
new = bmd->set;
}
GST_INFO_OBJECT (bmd, "changing byte %u from 0x%2X to 0x%2X", i,
(gint) GST_BUFFER_DATA (copy)[i], (gint) new);
GST_BUFFER_DATA (copy)[i] = new;
}
}
/* don't overflow */
bmd->skipped += MIN (G_MAXUINT - bmd->skipped, GST_BUFFER_SIZE (buf));
gst_pad_push (bmd->srcpad, GST_DATA (copy ? copy : buf));
gst_base_transform_set_in_place (GST_BASE_TRANSFORM (bmd), TRUE);
}
static void
......@@ -187,6 +163,8 @@ gst_break_my_data_set_property (GObject * object, guint prop_id,
{
GstBreakMyData *bmd = GST_BREAK_MY_DATA (object);
GST_LOCK (bmd);
switch (prop_id) {
case ARG_SEED:
bmd->seed = g_value_get_uint (value);
......@@ -204,6 +182,8 @@ gst_break_my_data_set_property (GObject * object, guint prop_id,
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
GST_UNLOCK (bmd);
}
static void
......@@ -212,6 +192,8 @@ gst_break_my_data_get_property (GObject * object, guint prop_id, GValue * value,
{
GstBreakMyData *bmd = GST_BREAK_MY_DATA (object);
GST_LOCK (bmd);
switch (prop_id) {
case ARG_SEED:
g_value_set_uint (value, bmd->seed);
......@@ -229,27 +211,80 @@ gst_break_my_data_get_property (GObject * object, guint prop_id, GValue * value,
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
GST_UNLOCK (bmd);
}
static GstStateChangeReturn
gst_break_my_data_change_state (GstElement * element, GstStateChange transition)
static GstFlowReturn
gst_break_my_data_transform_ip (GstBaseTransform * trans, GstBuffer * buf)
{
GstBreakMyData *bmd = GST_BREAK_MY_DATA (element);
GstBreakMyData *bmd = GST_BREAK_MY_DATA (trans);
guint i, size;
switch (transition) {
case GST_STATE_CHANGE_READY_TO_PAUSED:
bmd->rand = g_rand_new_with_seed (bmd->seed);
bmd->skipped = 0;
break;
case GST_STATE_CHANGE_PAUSED_TO_READY:
g_rand_free (bmd->rand);
break;
default:
break;
g_return_val_if_fail (gst_buffer_is_writable (buf), GST_FLOW_ERROR);
GST_LOCK (bmd);
if (bmd->skipped < bmd->skip) {
i = bmd->skip - bmd->skipped;
} else {
i = 0;
}
size = GST_BUFFER_SIZE (buf);
GST_LOG_OBJECT (bmd,
"got buffer %p (size %u, timestamp %" G_GUINT64_FORMAT ", offset %"
G_GUINT64_FORMAT "", buf, size, GST_BUFFER_TIMESTAMP (buf),
GST_BUFFER_OFFSET (buf));
for (; i < size; i++) {
if (g_rand_double_range (bmd->rand, 0, 1.0) <= bmd->probability) {
guint8 new;
if (bmd->set < 0) {
new = g_rand_int_range (bmd->rand, 0, 256);
} else {
new = bmd->set;
}
GST_INFO_OBJECT (bmd, "changing byte %u from 0x%02X to 0x%02X", i,
(guint) GST_READ_UINT8 (GST_BUFFER_DATA (buf) + i),
(guint) ((guint8) new));
GST_BUFFER_DATA (buf)[i] = new;
}
}
/* don't overflow */
bmd->skipped += MIN (G_MAXUINT - bmd->skipped, GST_BUFFER_SIZE (buf));
GST_UNLOCK (bmd);
return GST_FLOW_OK;
}
return GST_CALL_PARENT_WITH_DEFAULT (GST_ELEMENT_CLASS, change_state,
(element), GST_STATE_CHANGE_SUCCESS);
static gboolean
gst_break_my_data_start (GstBaseTransform * trans)
{
GstBreakMyData *bmd = GST_BREAK_MY_DATA (trans);
GST_LOCK (bmd);
bmd->rand = g_rand_new_with_seed (bmd->seed);
bmd->skipped = 0;
GST_UNLOCK (bmd);
return TRUE;
}
static gboolean
gst_break_my_data_stop (GstBaseTransform * trans)
{
GstBreakMyData *bmd = GST_BREAK_MY_DATA (trans);
GST_LOCK (bmd);
g_rand_free (bmd->rand);
bmd->rand = NULL;
GST_UNLOCK (bmd);
return TRUE;
}
gboolean
......
......@@ -23,20 +23,20 @@
#include <gst/gst.h>
gboolean gst_break_my_data_plugin_init (GstPlugin * plugin);
gboolean gst_negotiation_plugin_init (GstPlugin * plugin);
gboolean gst_progress_report_plugin_init (GstPlugin * plugin);
gboolean gst_navseek_plugin_init (GstPlugin * plugin);
gboolean gst_progressreport_plugin_init (GstPlugin * plugin);
gboolean gst_test_plugin_init (GstPlugin * plugin);
gboolean gst_break_my_data_plugin_init (GstPlugin * plugin);
/* gboolean gst_negotiation_plugin_init (GstPlugin * plugin); */
static gboolean
plugin_init (GstPlugin * plugin)
{
if (!gst_break_my_data_plugin_init (plugin) ||
!gst_negotiation_plugin_init (plugin) ||
!gst_navseek_plugin_init (plugin) ||
!gst_progressreport_plugin_init (plugin) ||
/* !gst_negotiation_plugin_init (plugin) || */
!gst_progress_report_plugin_init (plugin) ||
!gst_test_plugin_init (plugin))
return FALSE;
......
......@@ -27,24 +27,10 @@
#include "config.h"
#endif
/*#define DEBUG_ENABLED */
#include <gstnavigationtest.h>
#include <string.h>
#include <math.h>
/* GstNavigationtest signals and args */
enum
{
/* FILL ME */
LAST_SIGNAL
};
enum
{
ARG_0
/* FILL ME */
};
typedef struct
{
double x;
......@@ -61,10 +47,6 @@ static void gst_navigationtest_init (GTypeInstance * instance,
static gboolean gst_navigationtest_handle_src_event (GstPad * pad,
GstEvent * event);
static void gst_navigationtest_set_property (GObject * object, guint prop_id,
const GValue * value, GParamSpec * pspec);
static void gst_navigationtest_get_property (GObject * object, guint prop_id,
GValue * value, GParamSpec * pspec);
static GstStateChangeReturn
gst_navigationtest_change_state (GstElement * element,
......@@ -74,7 +56,7 @@ static void gst_navigationtest_planar411 (GstVideofilter * videofilter,
void *dest, void *src);
static void gst_navigationtest_setup (GstVideofilter * videofilter);
static GstVideofilterClass *parent_class = NULL;
static GstVideofilterClass *parent_class; /* NULL */
GType
gst_navigationtest_get_type (void)
......@@ -130,15 +112,11 @@ gst_navigationtest_base_init (gpointer g_class)
static void
gst_navigationtest_class_init (gpointer g_class, gpointer class_data)
{
GObjectClass *gobject_class = G_OBJECT_CLASS (g_class);
GstElementClass *element_class = GST_ELEMENT_CLASS (g_class);
GstVideofilterClass *videofilter_class = GST_VIDEOFILTER_CLASS (g_class);
parent_class = g_type_class_peek_parent (g_class);
gobject_class->set_property = gst_navigationtest_set_property;
gobject_class->get_property = gst_navigationtest_get_property;
element_class->change_state = gst_navigationtest_change_state;
videofilter_class->setup = gst_navigationtest_setup;
......@@ -147,67 +125,58 @@ gst_navigationtest_class_init (gpointer g_class, gpointer class_data)
static void
gst_navigationtest_init (GTypeInstance * instance, gpointer g_class)
{
GstNavigationtest *navigationtest = GST_NAVIGATIONTEST (instance);
GstVideofilter *videofilter;
GST_DEBUG ("gst_navigationtest_init");
videofilter = GST_VIDEOFILTER (navigationtest);
GstNavigationtest *navtest = GST_NAVIGATIONTEST (instance);
GstVideofilter *videofilter = GST_VIDEOFILTER (navtest);
gst_pad_set_event_function (videofilter->srcpad,
gst_navigationtest_handle_src_event);
GST_DEBUG_FUNCPTR (gst_navigationtest_handle_src_event));
navigationtest->x = -1;
navigationtest->y = -1;
navtest->x = -1;
navtest->y = -1;
}
static gboolean
gst_navigationtest_handle_src_event (GstPad * pad, GstEvent * event)
{
GstNavigationtest *navigationtest;
GstNavigationtest *navtest;
const gchar *type;
navigationtest = GST_NAVIGATIONTEST (gst_pad_get_parent (pad));
navtest = GST_NAVIGATIONTEST (GST_PAD_PARENT (pad));
switch (GST_EVENT_TYPE (event)) {
case GST_EVENT_NAVIGATION:
type = gst_structure_get_string (event->event_data.structure.structure,
"event");
{
const GstStructure *s = gst_event_get_structure (event);
type = gst_structure_get_string (s, "event");
if (g_str_equal (type, "mouse-move")) {
gst_structure_get_double (event->event_data.structure.structure,
"pointer_x", &navigationtest->x);
gst_structure_get_double (event->event_data.structure.structure,
"pointer_y", &navigationtest->y);
gst_structure_get_double (s, "pointer_x", &navtest->x);
gst_structure_get_double (s, "pointer_y", &navtest->y);
} else if (g_str_equal (type, "mouse-button-press")) {
ButtonClick *click = g_new (ButtonClick, 1);
gst_structure_get_double (event->event_data.structure.structure,
"pointer_x", &click->x);
gst_structure_get_double (event->event_data.structure.structure,
"pointer_y", &click->y);
click->images_left = ceil (GST_VIDEOFILTER (navigationtest)->framerate);
gst_structure_get_double (s, "pointer_x", &click->x);
gst_structure_get_double (s, "pointer_y", &click->y);
click->images_left = ceil (GST_VIDEOFILTER (navtest)->framerate);
/* green */
click->cy = 150;
click->cu = 46;
click->cv = 21;
navigationtest->clicks =
g_slist_prepend (navigationtest->clicks, click);
navtest->clicks = g_slist_prepend (navtest->clicks, click);
} else if (g_str_equal (type, "mouse-button-release")) {
ButtonClick *click = g_new (ButtonClick, 1);
gst_structure_get_double (event->event_data.structure.structure,
"pointer_x", &click->x);
gst_structure_get_double (event->event_data.structure.structure,
"pointer_y", &click->y);
click->images_left = ceil (GST_VIDEOFILTER (navigationtest)->framerate);
gst_structure_get_double (s, "pointer_x", &click->x);
gst_structure_get_double (s, "pointer_y", &click->y);
click->images_left = ceil (GST_VIDEOFILTER (navtest)->framerate);
/* red */
click->cy = 76;
click->cu = 85;
click->cv = 255;
navigationtest->clicks =
g_slist_prepend (navigationtest->clicks, click);
navtest->clicks = g_slist_prepend (navtest->clicks, click);
}
break;
}
default:
break;
}
......@@ -215,64 +184,7 @@ gst_navigationtest_handle_src_event (GstPad * pad, GstEvent * event)
}
static void
gst_navigationtest_set_property (GObject * object, guint prop_id,
const GValue * value, GParamSpec * pspec)
{
GstNavigationtest *src;
g_return_if_fail (GST_IS_NAVIGATIONTEST (object));
src = GST_NAVIGATIONTEST (object);
GST_DEBUG ("gst_navigationtest_set_property");
switch (prop_id) {
#if 0
case ARG_METHOD:
src->method = g_value_get_enum (value);
break;
#endif
default:
break;
}
}
static void
gst_navigationtest_get_property (GObject * object, guint prop_id,
GValue * value, GParamSpec * pspec)
{
GstNavigationtest *src;
g_return_if_fail (GST_IS_NAVIGATIONTEST (object));
src = GST_NAVIGATIONTEST (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 gboolean
plugin_init (GstPlugin * plugin)
{
if (!gst_library_load ("gstvideofilter"))
return FALSE;
return gst_element_register (plugin, "navigationtest", GST_RANK_NONE,
GST_TYPE_NAVIGATIONTEST);
}
GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
GST_VERSION_MINOR,
"navigationtest",
"Template for a video filter",
plugin_init, VERSION, GST_LICENSE, GST_PACKAGE, GST_ORIGIN)
static void gst_navigationtest_setup (GstVideofilter * videofilter)
gst_navigationtest_setup (GstVideofilter * videofilter)
{
GstNavigationtest *navigationtest;
......@@ -328,19 +240,20 @@ static void
gst_navigationtest_planar411 (GstVideofilter * videofilter,
void *dest, void *src)
{
GstNavigationtest *navigationtest;
int width = gst_videofilter_get_input_width (videofilter);
int height = gst_videofilter_get_input_height (videofilter);
GstNavigationtest *navtest = (GstNavigationtest *) videofilter;
gint width, height;
GSList *walk;
g_return_if_fail (GST_IS_NAVIGATIONTEST (videofilter));
navigationtest = GST_NAVIGATIONTEST (videofilter);
width = gst_videofilter_get_input_width (videofilter);
height = gst_videofilter_get_input_height (videofilter);
/* do something interesting here. This simply copies the source
* to the destination. */
memcpy (dest, src, width * height + (width / 2) * (height / 2) * 2);
walk = navigationtest->clicks;
walk = navtest->clicks;
while (walk) {
ButtonClick *click = walk->data;
......@@ -348,32 +261,55 @@ gst_navigationtest_planar411 (GstVideofilter * videofilter,
draw_box_planar411 (dest, width, height, rint (click->x),
rint (click->y), click->cy, click->cu, click->cv);
if (--click->images_left < 1) {
navigationtest->clicks = g_slist_remove (navigationtest->clicks, click);
navtest->clicks = g_slist_remove (navtest->clicks, click);
g_free (click);
}
}
draw_box_planar411 (dest, width, height, rint (navigationtest->x),
rint (navigationtest->y), 0, 128, 128);