videomark/detect: rename to simplevideomark[detect]

This commit is contained in:
David Schleef 2013-04-15 00:24:23 -07:00
parent b3ff0630e8
commit 4a88eebe0e
6 changed files with 210 additions and 190 deletions

View file

@ -3,10 +3,10 @@ plugin_LTLIBRARIES = libgstvideosignal.la
libgstvideosignal_la_SOURCES = gstvideosignal.c \ libgstvideosignal_la_SOURCES = gstvideosignal.c \
gstvideoanalyse.c \ gstvideoanalyse.c \
gstvideoanalyse.h \ gstvideoanalyse.h \
gstvideodetect.c \ gstsimplevideomarkdetect.c \
gstvideodetect.h \ gstsimplevideomarkdetect.h \
gstvideomark.c \ gstsimplevideomark.c \
gstvideomark.h gstsimplevideomark.h
libgstvideosignal_la_CFLAGS = $(GST_CFLAGS) $(GST_BASE_CFLAGS) \ libgstvideosignal_la_CFLAGS = $(GST_CFLAGS) $(GST_BASE_CFLAGS) \
$(GST_PLUGINS_BASE_CFLAGS) $(GST_PLUGINS_BASE_CFLAGS)

View file

@ -17,26 +17,26 @@
* Boston, MA 02110-1335, USA. * Boston, MA 02110-1335, USA.
*/ */
/** /**
* SECTION:element-videomark * SECTION:element-simplevideomark
* @see_also: #GstVideoDetect * @see_also: #GstVideoDetect
* *
* This plugin produces #GstVideoMark::pattern-count squares in the bottom left * This plugin produces #GstSimpleVideoMark::pattern-count squares in the bottom left
* corner of the video frames. The squares have a width and height of * corner of the video frames. The squares have a width and height of
* respectively #GstVideoMark:pattern-width and #GstVideoMark:pattern-height. * respectively #GstSimpleVideoMark:pattern-width and #GstSimpleVideoMark:pattern-height.
* Even squares will be black and odd squares will be white. * Even squares will be black and odd squares will be white.
* *
* After writing the pattern, #GstVideoMark:pattern-data-count squares after the * After writing the pattern, #GstSimpleVideoMark:pattern-data-count squares after the
* pattern squares are produced as the bitarray given in * pattern squares are produced as the bitarray given in
* #GstVideoMark:pattern-data. 1 bits will produce white squares and 0 bits will * #GstSimpleVideoMark:pattern-data. 1 bits will produce white squares and 0 bits will
* produce black squares. * produce black squares.
* *
* The element can be enabled with the #GstVideoMark:enabled property. It is * The element can be enabled with the #GstSimpleVideoMark:enabled property. It is
* mostly used together with the #GstVideoDetect plugin. * mostly used together with the #GstVideoDetect plugin.
* *
* <refsect2> * <refsect2>
* <title>Example launch line</title> * <title>Example launch line</title>
* |[ * |[
* gst-launch videotestsrc ! videomark ! ximagesink * gst-launch videotestsrc ! simplevideomark ! ximagesink
* ]| Add the default black/white squares at the bottom left of the video frames. * ]| Add the default black/white squares at the bottom left of the video frames.
* </refsect2> * </refsect2>
* *
@ -50,7 +50,7 @@
#include <gst/gst.h> #include <gst/gst.h>
#include <gst/video/video.h> #include <gst/video/video.h>
#include <gst/video/gstvideofilter.h> #include <gst/video/gstvideofilter.h>
#include "gstvideomark.h" #include "gstsimplevideomark.h"
GST_DEBUG_CATEGORY_STATIC (gst_video_mark_debug_category); GST_DEBUG_CATEGORY_STATIC (gst_video_mark_debug_category);
#define GST_CAT_DEFAULT gst_video_mark_debug_category #define GST_CAT_DEFAULT gst_video_mark_debug_category
@ -104,12 +104,13 @@ enum
/* class initialization */ /* class initialization */
G_DEFINE_TYPE_WITH_CODE (GstVideoMark, gst_video_mark, GST_TYPE_VIDEO_FILTER, G_DEFINE_TYPE_WITH_CODE (GstSimpleVideoMark, gst_video_mark,
GST_DEBUG_CATEGORY_INIT (gst_video_mark_debug_category, "videomark", 0, GST_TYPE_VIDEO_FILTER,
"debug category for videomark element")); GST_DEBUG_CATEGORY_INIT (gst_video_mark_debug_category, "simplevideomark",
0, "debug category for simplevideomark element"));
static void static void
gst_video_mark_class_init (GstVideoMarkClass * klass) gst_video_mark_class_init (GstSimpleVideoMarkClass * klass)
{ {
GObjectClass *gobject_class = G_OBJECT_CLASS (klass); GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
GstBaseTransformClass *base_transform_class = GstBaseTransformClass *base_transform_class =
@ -181,7 +182,7 @@ gst_video_mark_class_init (GstVideoMarkClass * klass)
} }
static void static void
gst_video_mark_init (GstVideoMark * videomark) gst_video_mark_init (GstSimpleVideoMark * simplevideomark)
{ {
} }
@ -189,34 +190,34 @@ void
gst_video_mark_set_property (GObject * object, guint property_id, gst_video_mark_set_property (GObject * object, guint property_id,
const GValue * value, GParamSpec * pspec) const GValue * value, GParamSpec * pspec)
{ {
GstVideoMark *videomark = GST_VIDEO_MARK (object); GstSimpleVideoMark *simplevideomark = GST_SIMPLE_VIDEO_MARK (object);
GST_DEBUG_OBJECT (videomark, "set_property"); GST_DEBUG_OBJECT (simplevideomark, "set_property");
switch (property_id) { switch (property_id) {
case PROP_PATTERN_WIDTH: case PROP_PATTERN_WIDTH:
videomark->pattern_width = g_value_get_int (value); simplevideomark->pattern_width = g_value_get_int (value);
break; break;
case PROP_PATTERN_HEIGHT: case PROP_PATTERN_HEIGHT:
videomark->pattern_height = g_value_get_int (value); simplevideomark->pattern_height = g_value_get_int (value);
break; break;
case PROP_PATTERN_COUNT: case PROP_PATTERN_COUNT:
videomark->pattern_count = g_value_get_int (value); simplevideomark->pattern_count = g_value_get_int (value);
break; break;
case PROP_PATTERN_DATA_COUNT: case PROP_PATTERN_DATA_COUNT:
videomark->pattern_data_count = g_value_get_int (value); simplevideomark->pattern_data_count = g_value_get_int (value);
break; break;
case PROP_PATTERN_DATA: case PROP_PATTERN_DATA:
videomark->pattern_data = g_value_get_uint64 (value); simplevideomark->pattern_data = g_value_get_uint64 (value);
break; break;
case PROP_ENABLED: case PROP_ENABLED:
videomark->enabled = g_value_get_boolean (value); simplevideomark->enabled = g_value_get_boolean (value);
break; break;
case PROP_LEFT_OFFSET: case PROP_LEFT_OFFSET:
videomark->left_offset = g_value_get_int (value); simplevideomark->left_offset = g_value_get_int (value);
break; break;
case PROP_BOTTOM_OFFSET: case PROP_BOTTOM_OFFSET:
videomark->bottom_offset = g_value_get_int (value); simplevideomark->bottom_offset = g_value_get_int (value);
break; break;
default: default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
@ -228,34 +229,34 @@ void
gst_video_mark_get_property (GObject * object, guint property_id, gst_video_mark_get_property (GObject * object, guint property_id,
GValue * value, GParamSpec * pspec) GValue * value, GParamSpec * pspec)
{ {
GstVideoMark *videomark = GST_VIDEO_MARK (object); GstSimpleVideoMark *simplevideomark = GST_SIMPLE_VIDEO_MARK (object);
GST_DEBUG_OBJECT (videomark, "get_property"); GST_DEBUG_OBJECT (simplevideomark, "get_property");
switch (property_id) { switch (property_id) {
case PROP_PATTERN_WIDTH: case PROP_PATTERN_WIDTH:
g_value_set_int (value, videomark->pattern_width); g_value_set_int (value, simplevideomark->pattern_width);
break; break;
case PROP_PATTERN_HEIGHT: case PROP_PATTERN_HEIGHT:
g_value_set_int (value, videomark->pattern_height); g_value_set_int (value, simplevideomark->pattern_height);
break; break;
case PROP_PATTERN_COUNT: case PROP_PATTERN_COUNT:
g_value_set_int (value, videomark->pattern_count); g_value_set_int (value, simplevideomark->pattern_count);
break; break;
case PROP_PATTERN_DATA_COUNT: case PROP_PATTERN_DATA_COUNT:
g_value_set_int (value, videomark->pattern_data_count); g_value_set_int (value, simplevideomark->pattern_data_count);
break; break;
case PROP_PATTERN_DATA: case PROP_PATTERN_DATA:
g_value_set_uint64 (value, videomark->pattern_data); g_value_set_uint64 (value, simplevideomark->pattern_data);
break; break;
case PROP_ENABLED: case PROP_ENABLED:
g_value_set_boolean (value, videomark->enabled); g_value_set_boolean (value, simplevideomark->enabled);
break; break;
case PROP_LEFT_OFFSET: case PROP_LEFT_OFFSET:
g_value_set_int (value, videomark->left_offset); g_value_set_int (value, simplevideomark->left_offset);
break; break;
case PROP_BOTTOM_OFFSET: case PROP_BOTTOM_OFFSET:
g_value_set_int (value, videomark->bottom_offset); g_value_set_int (value, simplevideomark->bottom_offset);
break; break;
default: default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
@ -266,9 +267,9 @@ gst_video_mark_get_property (GObject * object, guint property_id,
void void
gst_video_mark_dispose (GObject * object) gst_video_mark_dispose (GObject * object)
{ {
GstVideoMark *videomark = GST_VIDEO_MARK (object); GstSimpleVideoMark *simplevideomark = GST_SIMPLE_VIDEO_MARK (object);
GST_DEBUG_OBJECT (videomark, "dispose"); GST_DEBUG_OBJECT (simplevideomark, "dispose");
/* clean up as possible. may be called multiple times */ /* clean up as possible. may be called multiple times */
@ -278,9 +279,9 @@ gst_video_mark_dispose (GObject * object)
void void
gst_video_mark_finalize (GObject * object) gst_video_mark_finalize (GObject * object)
{ {
GstVideoMark *videomark = GST_VIDEO_MARK (object); GstSimpleVideoMark *simplevideomark = GST_SIMPLE_VIDEO_MARK (object);
GST_DEBUG_OBJECT (videomark, "finalize"); GST_DEBUG_OBJECT (simplevideomark, "finalize");
/* clean up object here */ /* clean up object here */
@ -290,9 +291,9 @@ gst_video_mark_finalize (GObject * object)
static gboolean static gboolean
gst_video_mark_start (GstBaseTransform * trans) gst_video_mark_start (GstBaseTransform * trans)
{ {
GstVideoMark *videomark = GST_VIDEO_MARK (trans); GstSimpleVideoMark *simplevideomark = GST_SIMPLE_VIDEO_MARK (trans);
GST_DEBUG_OBJECT (videomark, "start"); GST_DEBUG_OBJECT (simplevideomark, "start");
return TRUE; return TRUE;
} }
@ -300,9 +301,9 @@ gst_video_mark_start (GstBaseTransform * trans)
static gboolean static gboolean
gst_video_mark_stop (GstBaseTransform * trans) gst_video_mark_stop (GstBaseTransform * trans)
{ {
GstVideoMark *videomark = GST_VIDEO_MARK (trans); GstSimpleVideoMark *simplevideomark = GST_SIMPLE_VIDEO_MARK (trans);
GST_DEBUG_OBJECT (videomark, "stop"); GST_DEBUG_OBJECT (simplevideomark, "stop");
return TRUE; return TRUE;
} }
@ -311,15 +312,15 @@ static gboolean
gst_video_mark_set_info (GstVideoFilter * filter, GstCaps * incaps, gst_video_mark_set_info (GstVideoFilter * filter, GstCaps * incaps,
GstVideoInfo * in_info, GstCaps * outcaps, GstVideoInfo * out_info) GstVideoInfo * in_info, GstCaps * outcaps, GstVideoInfo * out_info)
{ {
GstVideoMark *videomark = GST_VIDEO_MARK (filter); GstSimpleVideoMark *simplevideomark = GST_SIMPLE_VIDEO_MARK (filter);
GST_DEBUG_OBJECT (videomark, "set_info"); GST_DEBUG_OBJECT (simplevideomark, "set_info");
return TRUE; return TRUE;
} }
static void static void
gst_video_mark_draw_box (GstVideoMark * videomark, guint8 * data, gst_video_mark_draw_box (GstSimpleVideoMark * simplevideomark, guint8 * data,
gint width, gint height, gint row_stride, gint pixel_stride, guint8 color) gint width, gint height, gint row_stride, gint pixel_stride, guint8 color)
{ {
gint i, j; gint i, j;
@ -333,7 +334,7 @@ gst_video_mark_draw_box (GstVideoMark * videomark, guint8 * data,
} }
static GstFlowReturn static GstFlowReturn
gst_video_mark_yuv (GstVideoMark * videomark, GstVideoFrame * frame) gst_video_mark_yuv (GstSimpleVideoMark * simplevideomark, GstVideoFrame * frame)
{ {
gint i, pw, ph, row_stride, pixel_stride; gint i, pw, ph, row_stride, pixel_stride;
gint width, height, req_width, req_height; gint width, height, req_width, req_height;
@ -344,28 +345,28 @@ gst_video_mark_yuv (GstVideoMark * videomark, GstVideoFrame * frame)
width = frame->info.width; width = frame->info.width;
height = frame->info.height; height = frame->info.height;
pw = videomark->pattern_width; pw = simplevideomark->pattern_width;
ph = videomark->pattern_height; ph = simplevideomark->pattern_height;
row_stride = GST_VIDEO_FRAME_COMP_STRIDE (frame, 0); row_stride = GST_VIDEO_FRAME_COMP_STRIDE (frame, 0);
pixel_stride = GST_VIDEO_FRAME_COMP_PSTRIDE (frame, 0); pixel_stride = GST_VIDEO_FRAME_COMP_PSTRIDE (frame, 0);
req_width = req_width =
(videomark->pattern_count + videomark->pattern_data_count) * pw + (simplevideomark->pattern_count +
videomark->left_offset; simplevideomark->pattern_data_count) * pw + simplevideomark->left_offset;
req_height = videomark->bottom_offset + ph; req_height = simplevideomark->bottom_offset + ph;
if (req_width > width || req_height > height) { if (req_width > width || req_height > height) {
GST_ELEMENT_ERROR (videomark, STREAM, WRONG_TYPE, (NULL), GST_ELEMENT_ERROR (simplevideomark, STREAM, WRONG_TYPE, (NULL),
("videomark pattern doesn't fit video, need at least %ix%i (stream has %ix%i)", ("simplevideomark pattern doesn't fit video, need at least %ix%i (stream has %ix%i)",
req_width, req_height, width, height)); req_width, req_height, width, height));
return GST_FLOW_ERROR; return GST_FLOW_ERROR;
} }
/* draw the bottom left pixels */ /* draw the bottom left pixels */
for (i = 0; i < videomark->pattern_count; i++) { for (i = 0; i < simplevideomark->pattern_count; i++) {
d = GST_VIDEO_FRAME_COMP_DATA (frame, 0); d = GST_VIDEO_FRAME_COMP_DATA (frame, 0);
/* move to start of bottom left */ /* move to start of bottom left */
d += row_stride * (height - ph - videomark->bottom_offset) + d += row_stride * (height - ph - simplevideomark->bottom_offset) +
pixel_stride * videomark->left_offset; pixel_stride * simplevideomark->left_offset;
/* move to i-th pattern */ /* move to i-th pattern */
d += pixel_stride * pw * i; d += pixel_stride * pw * i;
@ -376,30 +377,31 @@ gst_video_mark_yuv (GstVideoMark * videomark, GstVideoFrame * frame)
color = 0; color = 0;
/* draw box of width * height */ /* draw box of width * height */
gst_video_mark_draw_box (videomark, d, pw, ph, row_stride, pixel_stride, gst_video_mark_draw_box (simplevideomark, d, pw, ph, row_stride,
color); pixel_stride, color);
} }
pattern_shift = G_GUINT64_CONSTANT (1) << (videomark->pattern_data_count - 1); pattern_shift =
G_GUINT64_CONSTANT (1) << (simplevideomark->pattern_data_count - 1);
/* get the data of the pattern */ /* get the data of the pattern */
for (i = 0; i < videomark->pattern_data_count; i++) { for (i = 0; i < simplevideomark->pattern_data_count; i++) {
d = GST_VIDEO_FRAME_COMP_DATA (frame, 0); d = GST_VIDEO_FRAME_COMP_DATA (frame, 0);
/* move to start of bottom left, adjust for offsets */ /* move to start of bottom left, adjust for offsets */
d += row_stride * (height - ph - videomark->bottom_offset) + d += row_stride * (height - ph - simplevideomark->bottom_offset) +
pixel_stride * videomark->left_offset; pixel_stride * simplevideomark->left_offset;
/* move after the fixed pattern */ /* move after the fixed pattern */
d += pixel_stride * videomark->pattern_count * pw; d += pixel_stride * simplevideomark->pattern_count * pw;
/* move to i-th pattern data */ /* move to i-th pattern data */
d += pixel_stride * pw * i; d += pixel_stride * pw * i;
if (videomark->pattern_data & pattern_shift) if (simplevideomark->pattern_data & pattern_shift)
color = 255; color = 255;
else else
color = 0; color = 0;
gst_video_mark_draw_box (videomark, d, pw, ph, row_stride, pixel_stride, gst_video_mark_draw_box (simplevideomark, d, pw, ph, row_stride,
color); pixel_stride, color);
pattern_shift >>= 1; pattern_shift >>= 1;
} }
@ -412,12 +414,12 @@ static GstFlowReturn
gst_video_mark_transform_frame_ip (GstVideoFilter * filter, gst_video_mark_transform_frame_ip (GstVideoFilter * filter,
GstVideoFrame * frame) GstVideoFrame * frame)
{ {
GstVideoMark *videomark = GST_VIDEO_MARK (filter); GstSimpleVideoMark *simplevideomark = GST_SIMPLE_VIDEO_MARK (filter);
GST_DEBUG_OBJECT (videomark, "transform_frame_ip"); GST_DEBUG_OBJECT (simplevideomark, "transform_frame_ip");
if (videomark->enabled) if (simplevideomark->enabled)
return gst_video_mark_yuv (videomark, frame); return gst_video_mark_yuv (simplevideomark, frame);
return GST_FLOW_OK; return GST_FLOW_OK;
} }

View file

@ -17,26 +17,26 @@
* Boston, MA 02110-1301, USA. * Boston, MA 02110-1301, USA.
*/ */
#ifndef _GST_VIDEO_MARK_H_ #ifndef _GST_SIMPLE_VIDEO_MARK_H_
#define _GST_VIDEO_MARK_H_ #define _GST_SIMPLE_VIDEO_MARK_H_
#include <gst/video/video.h> #include <gst/video/video.h>
#include <gst/video/gstvideofilter.h> #include <gst/video/gstvideofilter.h>
G_BEGIN_DECLS G_BEGIN_DECLS
#define GST_TYPE_VIDEO_MARK (gst_video_mark_get_type()) #define GST_TYPE_SIMPLE_VIDEO_MARK (gst_video_mark_get_type())
#define GST_VIDEO_MARK(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_VIDEO_MARK,GstVideoMark)) #define GST_SIMPLE_VIDEO_MARK(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_SIMPLE_VIDEO_MARK,GstSimpleVideoMark))
#define GST_VIDEO_MARK_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_VIDEO_MARK,GstVideoMarkClass)) #define GST_SIMPLE_VIDEO_MARK_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_SIMPLE_VIDEO_MARK,GstSimpleVideoMarkClass))
#define GST_IS_VIDEO_MARK(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_VIDEO_MARK)) #define GST_IS_SIMPLE_VIDEO_MARK(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_SIMPLE_VIDEO_MARK))
#define GST_IS_VIDEO_MARK_CLASS(obj) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_VIDEO_MARK)) #define GST_IS_SIMPLE_VIDEO_MARK_CLASS(obj) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_SIMPLE_VIDEO_MARK))
typedef struct _GstVideoMark GstVideoMark; typedef struct _GstSimpleVideoMark GstSimpleVideoMark;
typedef struct _GstVideoMarkClass GstVideoMarkClass; typedef struct _GstSimpleVideoMarkClass GstSimpleVideoMarkClass;
struct _GstVideoMark struct _GstSimpleVideoMark
{ {
GstVideoFilter base_videomark; GstVideoFilter base_simplevideomark;
/* properties */ /* properties */
gint pattern_width; gint pattern_width;
@ -49,9 +49,9 @@ struct _GstVideoMark
gint bottom_offset; gint bottom_offset;
}; };
struct _GstVideoMarkClass struct _GstSimpleVideoMarkClass
{ {
GstVideoFilterClass base_videomark_class; GstVideoFilterClass base_simplevideomark_class;
}; };
GType gst_video_mark_get_type (void); GType gst_video_mark_get_type (void);

View file

@ -17,24 +17,24 @@
* Boston, MA 02110-1335, USA. * Boston, MA 02110-1335, USA.
*/ */
/** /**
* SECTION:element-videodetect * SECTION:element-simplevideomarkdetect
* @see_also: #GstVideoMark * @see_also: #GstVideoMark
* *
* This plugin detects #GstVideoDetect:pattern-count squares in the bottom left * This plugin detects #GstSimpleVideoMarkDetect:pattern-count squares in the bottom left
* corner of the video frames. The squares have a width and height of * corner of the video frames. The squares have a width and height of
* respectively #GstVideoDetect:pattern-width and #GstVideoDetect:pattern-height. * respectively #GstSimpleVideoMarkDetect:pattern-width and #GstSimpleVideoMarkDetect:pattern-height.
* Even squares must be black and odd squares must be white. * Even squares must be black and odd squares must be white.
* *
* When the pattern has been found, #GstVideoDetect:pattern-data-count squares * When the pattern has been found, #GstSimpleVideoMarkDetect:pattern-data-count squares
* after the pattern squares are read as a bitarray. White squares represent a 1 * after the pattern squares are read as a bitarray. White squares represent a 1
* bit and black squares a 0 bit. The bitarray will will included in the element * bit and black squares a 0 bit. The bitarray will will included in the element
* message that is posted (see below). * message that is posted (see below).
* *
* After the pattern has been found and the data pattern has been read, an * After the pattern has been found and the data pattern has been read, an
* element message called <classname>&quot;GstVideoDetect&quot;</classname> will * element message called <classname>&quot;GstSimpleVideoMarkDetect&quot;</classname> will
* be posted on the bus. If the pattern is no longer found in the frame, the * be posted on the bus. If the pattern is no longer found in the frame, the
* same element message is posted with the have-pattern field set to #FALSE. * same element message is posted with the have-pattern field set to #FALSE.
* The message is only posted if the #GstVideoDetect:message property is #TRUE. * The message is only posted if the #GstSimpleVideoMarkDetect:message property is #TRUE.
* *
* The message's structure contains these fields: * The message's structure contains these fields:
* <itemizedlist> * <itemizedlist>
@ -87,7 +87,7 @@
* <refsect2> * <refsect2>
* <title>Example launch line</title> * <title>Example launch line</title>
* |[ * |[
* gst-launch videotestsrc ! videodetect ! videoconvert ! ximagesink * gst-launch videotestsrc ! simplevideomarkdetect ! videoconvert ! ximagesink
* ]| * ]|
* </refsect2> * </refsect2>
* *
@ -101,7 +101,7 @@
#include <gst/gst.h> #include <gst/gst.h>
#include <gst/video/video.h> #include <gst/video/video.h>
#include <gst/video/gstvideofilter.h> #include <gst/video/gstvideofilter.h>
#include "gstvideodetect.h" #include "gstsimplevideomarkdetect.h"
GST_DEBUG_CATEGORY_STATIC (gst_video_detect_debug_category); GST_DEBUG_CATEGORY_STATIC (gst_video_detect_debug_category);
#define GST_CAT_DEFAULT gst_video_detect_debug_category #define GST_CAT_DEFAULT gst_video_detect_debug_category
@ -157,13 +157,14 @@ enum
/* class initialization */ /* class initialization */
G_DEFINE_TYPE_WITH_CODE (GstVideoDetect, gst_video_detect, G_DEFINE_TYPE_WITH_CODE (GstSimpleVideoMarkDetect, gst_video_detect,
GST_TYPE_VIDEO_FILTER, GST_TYPE_VIDEO_FILTER,
GST_DEBUG_CATEGORY_INIT (gst_video_detect_debug_category, "videodetect", 0, GST_DEBUG_CATEGORY_INIT (gst_video_detect_debug_category,
"debug category for videodetect element")); "simplevideomarkdetect", 0,
"debug category for simplevideomarkdetect element"));
static void static void
gst_video_detect_class_init (GstVideoDetectClass * klass) gst_video_detect_class_init (GstSimpleVideoMarkDetectClass * klass)
{ {
GObjectClass *gobject_class = G_OBJECT_CLASS (klass); GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
GstBaseTransformClass *base_transform_class = GstBaseTransformClass *base_transform_class =
@ -239,7 +240,7 @@ gst_video_detect_class_init (GstVideoDetectClass * klass)
} }
static void static void
gst_video_detect_init (GstVideoDetect * videodetect) gst_video_detect_init (GstSimpleVideoMarkDetect * simplevideomarkdetect)
{ {
} }
@ -247,37 +248,38 @@ void
gst_video_detect_set_property (GObject * object, guint property_id, gst_video_detect_set_property (GObject * object, guint property_id,
const GValue * value, GParamSpec * pspec) const GValue * value, GParamSpec * pspec)
{ {
GstVideoDetect *videodetect = GST_VIDEO_DETECT (object); GstSimpleVideoMarkDetect *simplevideomarkdetect =
GST_SIMPLE_VIDEO_MARK_DETECT (object);
GST_DEBUG_OBJECT (videodetect, "set_property"); GST_DEBUG_OBJECT (simplevideomarkdetect, "set_property");
switch (property_id) { switch (property_id) {
case PROP_MESSAGE: case PROP_MESSAGE:
videodetect->message = g_value_get_boolean (value); simplevideomarkdetect->message = g_value_get_boolean (value);
break; break;
case PROP_PATTERN_WIDTH: case PROP_PATTERN_WIDTH:
videodetect->pattern_width = g_value_get_int (value); simplevideomarkdetect->pattern_width = g_value_get_int (value);
break; break;
case PROP_PATTERN_HEIGHT: case PROP_PATTERN_HEIGHT:
videodetect->pattern_height = g_value_get_int (value); simplevideomarkdetect->pattern_height = g_value_get_int (value);
break; break;
case PROP_PATTERN_COUNT: case PROP_PATTERN_COUNT:
videodetect->pattern_count = g_value_get_int (value); simplevideomarkdetect->pattern_count = g_value_get_int (value);
break; break;
case PROP_PATTERN_DATA_COUNT: case PROP_PATTERN_DATA_COUNT:
videodetect->pattern_data_count = g_value_get_int (value); simplevideomarkdetect->pattern_data_count = g_value_get_int (value);
break; break;
case PROP_PATTERN_CENTER: case PROP_PATTERN_CENTER:
videodetect->pattern_center = g_value_get_double (value); simplevideomarkdetect->pattern_center = g_value_get_double (value);
break; break;
case PROP_PATTERN_SENSITIVITY: case PROP_PATTERN_SENSITIVITY:
videodetect->pattern_sensitivity = g_value_get_double (value); simplevideomarkdetect->pattern_sensitivity = g_value_get_double (value);
break; break;
case PROP_LEFT_OFFSET: case PROP_LEFT_OFFSET:
videodetect->left_offset = g_value_get_int (value); simplevideomarkdetect->left_offset = g_value_get_int (value);
break; break;
case PROP_BOTTOM_OFFSET: case PROP_BOTTOM_OFFSET:
videodetect->bottom_offset = g_value_get_int (value); simplevideomarkdetect->bottom_offset = g_value_get_int (value);
break; break;
default: default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
@ -289,37 +291,38 @@ void
gst_video_detect_get_property (GObject * object, guint property_id, gst_video_detect_get_property (GObject * object, guint property_id,
GValue * value, GParamSpec * pspec) GValue * value, GParamSpec * pspec)
{ {
GstVideoDetect *videodetect = GST_VIDEO_DETECT (object); GstSimpleVideoMarkDetect *simplevideomarkdetect =
GST_SIMPLE_VIDEO_MARK_DETECT (object);
GST_DEBUG_OBJECT (videodetect, "get_property"); GST_DEBUG_OBJECT (simplevideomarkdetect, "get_property");
switch (property_id) { switch (property_id) {
case PROP_MESSAGE: case PROP_MESSAGE:
g_value_set_boolean (value, videodetect->message); g_value_set_boolean (value, simplevideomarkdetect->message);
break; break;
case PROP_PATTERN_WIDTH: case PROP_PATTERN_WIDTH:
g_value_set_int (value, videodetect->pattern_width); g_value_set_int (value, simplevideomarkdetect->pattern_width);
break; break;
case PROP_PATTERN_HEIGHT: case PROP_PATTERN_HEIGHT:
g_value_set_int (value, videodetect->pattern_height); g_value_set_int (value, simplevideomarkdetect->pattern_height);
break; break;
case PROP_PATTERN_COUNT: case PROP_PATTERN_COUNT:
g_value_set_int (value, videodetect->pattern_count); g_value_set_int (value, simplevideomarkdetect->pattern_count);
break; break;
case PROP_PATTERN_DATA_COUNT: case PROP_PATTERN_DATA_COUNT:
g_value_set_int (value, videodetect->pattern_data_count); g_value_set_int (value, simplevideomarkdetect->pattern_data_count);
break; break;
case PROP_PATTERN_CENTER: case PROP_PATTERN_CENTER:
g_value_set_double (value, videodetect->pattern_center); g_value_set_double (value, simplevideomarkdetect->pattern_center);
break; break;
case PROP_PATTERN_SENSITIVITY: case PROP_PATTERN_SENSITIVITY:
g_value_set_double (value, videodetect->pattern_sensitivity); g_value_set_double (value, simplevideomarkdetect->pattern_sensitivity);
break; break;
case PROP_LEFT_OFFSET: case PROP_LEFT_OFFSET:
g_value_set_int (value, videodetect->left_offset); g_value_set_int (value, simplevideomarkdetect->left_offset);
break; break;
case PROP_BOTTOM_OFFSET: case PROP_BOTTOM_OFFSET:
g_value_set_int (value, videodetect->bottom_offset); g_value_set_int (value, simplevideomarkdetect->bottom_offset);
break; break;
default: default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
@ -330,9 +333,10 @@ gst_video_detect_get_property (GObject * object, guint property_id,
void void
gst_video_detect_dispose (GObject * object) gst_video_detect_dispose (GObject * object)
{ {
GstVideoDetect *videodetect = GST_VIDEO_DETECT (object); GstSimpleVideoMarkDetect *simplevideomarkdetect =
GST_SIMPLE_VIDEO_MARK_DETECT (object);
GST_DEBUG_OBJECT (videodetect, "dispose"); GST_DEBUG_OBJECT (simplevideomarkdetect, "dispose");
/* clean up as possible. may be called multiple times */ /* clean up as possible. may be called multiple times */
@ -342,9 +346,10 @@ gst_video_detect_dispose (GObject * object)
void void
gst_video_detect_finalize (GObject * object) gst_video_detect_finalize (GObject * object)
{ {
GstVideoDetect *videodetect = GST_VIDEO_DETECT (object); GstSimpleVideoMarkDetect *simplevideomarkdetect =
GST_SIMPLE_VIDEO_MARK_DETECT (object);
GST_DEBUG_OBJECT (videodetect, "finalize"); GST_DEBUG_OBJECT (simplevideomarkdetect, "finalize");
/* clean up object here */ /* clean up object here */
@ -354,9 +359,10 @@ gst_video_detect_finalize (GObject * object)
static gboolean static gboolean
gst_video_detect_start (GstBaseTransform * trans) gst_video_detect_start (GstBaseTransform * trans)
{ {
GstVideoDetect *videodetect = GST_VIDEO_DETECT (trans); GstSimpleVideoMarkDetect *simplevideomarkdetect =
GST_SIMPLE_VIDEO_MARK_DETECT (trans);
GST_DEBUG_OBJECT (videodetect, "start"); GST_DEBUG_OBJECT (simplevideomarkdetect, "start");
return TRUE; return TRUE;
} }
@ -364,9 +370,10 @@ gst_video_detect_start (GstBaseTransform * trans)
static gboolean static gboolean
gst_video_detect_stop (GstBaseTransform * trans) gst_video_detect_stop (GstBaseTransform * trans)
{ {
GstVideoDetect *videodetect = GST_VIDEO_DETECT (trans); GstSimpleVideoMarkDetect *simplevideomarkdetect =
GST_SIMPLE_VIDEO_MARK_DETECT (trans);
GST_DEBUG_OBJECT (videodetect, "stop"); GST_DEBUG_OBJECT (simplevideomarkdetect, "stop");
return TRUE; return TRUE;
} }
@ -375,22 +382,23 @@ static gboolean
gst_video_detect_set_info (GstVideoFilter * filter, GstCaps * incaps, gst_video_detect_set_info (GstVideoFilter * filter, GstCaps * incaps,
GstVideoInfo * in_info, GstCaps * outcaps, GstVideoInfo * out_info) GstVideoInfo * in_info, GstCaps * outcaps, GstVideoInfo * out_info)
{ {
GstVideoDetect *videodetect = GST_VIDEO_DETECT (filter); GstSimpleVideoMarkDetect *simplevideomarkdetect =
GST_SIMPLE_VIDEO_MARK_DETECT (filter);
GST_DEBUG_OBJECT (videodetect, "set_info"); GST_DEBUG_OBJECT (simplevideomarkdetect, "set_info");
return TRUE; return TRUE;
} }
static void static void
gst_video_detect_post_message (GstVideoDetect * videodetect, GstBuffer * buffer, gst_video_detect_post_message (GstSimpleVideoMarkDetect * simplevideomarkdetect,
guint64 data) GstBuffer * buffer, guint64 data)
{ {
GstBaseTransform *trans; GstBaseTransform *trans;
GstMessage *m; GstMessage *m;
guint64 duration, timestamp, running_time, stream_time; guint64 duration, timestamp, running_time, stream_time;
trans = GST_BASE_TRANSFORM_CAST (videodetect); trans = GST_BASE_TRANSFORM_CAST (simplevideomarkdetect);
/* get timestamps */ /* get timestamps */
timestamp = GST_BUFFER_TIMESTAMP (buffer); timestamp = GST_BUFFER_TIMESTAMP (buffer);
@ -401,20 +409,21 @@ gst_video_detect_post_message (GstVideoDetect * videodetect, GstBuffer * buffer,
timestamp); timestamp);
/* post message */ /* post message */
m = gst_message_new_element (GST_OBJECT_CAST (videodetect), m = gst_message_new_element (GST_OBJECT_CAST (simplevideomarkdetect),
gst_structure_new ("GstVideoDetect", gst_structure_new ("GstSimpleVideoMarkDetect",
"have-pattern", G_TYPE_BOOLEAN, videodetect->in_pattern, "have-pattern", G_TYPE_BOOLEAN, simplevideomarkdetect->in_pattern,
"timestamp", G_TYPE_UINT64, timestamp, "timestamp", G_TYPE_UINT64, timestamp,
"stream-time", G_TYPE_UINT64, stream_time, "stream-time", G_TYPE_UINT64, stream_time,
"running-time", G_TYPE_UINT64, running_time, "running-time", G_TYPE_UINT64, running_time,
"duration", G_TYPE_UINT64, duration, "duration", G_TYPE_UINT64, duration,
"data", G_TYPE_UINT64, data, NULL)); "data", G_TYPE_UINT64, data, NULL));
gst_element_post_message (GST_ELEMENT_CAST (videodetect), m); gst_element_post_message (GST_ELEMENT_CAST (simplevideomarkdetect), m);
} }
static gdouble static gdouble
gst_video_detect_calc_brightness (GstVideoDetect * videodetect, guint8 * data, gst_video_detect_calc_brightness (GstSimpleVideoMarkDetect *
gint width, gint height, gint row_stride, gint pixel_stride) simplevideomarkdetect, guint8 * data, gint width, gint height,
gint row_stride, gint pixel_stride)
{ {
gint i, j; gint i, j;
guint64 sum; guint64 sum;
@ -430,7 +439,8 @@ gst_video_detect_calc_brightness (GstVideoDetect * videodetect, guint8 * data,
} }
static void static void
gst_video_detect_yuv (GstVideoDetect * videodetect, GstVideoFrame * frame) gst_video_detect_yuv (GstSimpleVideoMarkDetect * simplevideomarkdetect,
GstVideoFrame * frame)
{ {
gdouble brightness; gdouble brightness;
gint i, pw, ph, row_stride, pixel_stride; gint i, pw, ph, row_stride, pixel_stride;
@ -441,85 +451,92 @@ gst_video_detect_yuv (GstVideoDetect * videodetect, GstVideoFrame * frame)
width = frame->info.width; width = frame->info.width;
height = frame->info.height; height = frame->info.height;
pw = videodetect->pattern_width; pw = simplevideomarkdetect->pattern_width;
ph = videodetect->pattern_height; ph = simplevideomarkdetect->pattern_height;
row_stride = GST_VIDEO_FRAME_COMP_STRIDE (frame, 0); row_stride = GST_VIDEO_FRAME_COMP_STRIDE (frame, 0);
pixel_stride = GST_VIDEO_FRAME_COMP_PSTRIDE (frame, 0); pixel_stride = GST_VIDEO_FRAME_COMP_PSTRIDE (frame, 0);
req_width = req_width =
(videodetect->pattern_count + videodetect->pattern_data_count) * pw + (simplevideomarkdetect->pattern_count +
videodetect->left_offset; simplevideomarkdetect->pattern_data_count) * pw +
req_height = videodetect->bottom_offset + ph; simplevideomarkdetect->left_offset;
req_height = simplevideomarkdetect->bottom_offset + ph;
if (req_width > width || req_height > height) { if (req_width > width || req_height > height) {
goto no_pattern; goto no_pattern;
} }
/* analyse the bottom left pixels */ /* analyse the bottom left pixels */
for (i = 0; i < videodetect->pattern_count; i++) { for (i = 0; i < simplevideomarkdetect->pattern_count; i++) {
d = GST_VIDEO_FRAME_COMP_DATA (frame, 0); d = GST_VIDEO_FRAME_COMP_DATA (frame, 0);
/* move to start of bottom left, adjust for offsets */ /* move to start of bottom left, adjust for offsets */
d += row_stride * (height - ph - videodetect->bottom_offset) + d += row_stride * (height - ph - simplevideomarkdetect->bottom_offset) +
pixel_stride * videodetect->left_offset; pixel_stride * simplevideomarkdetect->left_offset;
/* move to i-th pattern */ /* move to i-th pattern */
d += pixel_stride * pw * i; d += pixel_stride * pw * i;
/* calc brightness of width * height box */ /* calc brightness of width * height box */
brightness = gst_video_detect_calc_brightness (videodetect, d, pw, ph, brightness =
gst_video_detect_calc_brightness (simplevideomarkdetect, d, pw, ph,
row_stride, pixel_stride); row_stride, pixel_stride);
GST_DEBUG_OBJECT (videodetect, "brightness %f", brightness); GST_DEBUG_OBJECT (simplevideomarkdetect, "brightness %f", brightness);
if (i & 1) { if (i & 1) {
/* odd pixels must be white, all pixels darker than the center + /* odd pixels must be white, all pixels darker than the center +
* sensitivity are considered wrong. */ * sensitivity are considered wrong. */
if (brightness < if (brightness <
(videodetect->pattern_center + videodetect->pattern_sensitivity)) (simplevideomarkdetect->pattern_center +
simplevideomarkdetect->pattern_sensitivity))
goto no_pattern; goto no_pattern;
} else { } else {
/* even pixels must be black, pixels lighter than the center - sensitivity /* even pixels must be black, pixels lighter than the center - sensitivity
* are considered wrong. */ * are considered wrong. */
if (brightness > if (brightness >
(videodetect->pattern_center - videodetect->pattern_sensitivity)) (simplevideomarkdetect->pattern_center -
simplevideomarkdetect->pattern_sensitivity))
goto no_pattern; goto no_pattern;
} }
} }
GST_DEBUG_OBJECT (videodetect, "found pattern"); GST_DEBUG_OBJECT (simplevideomarkdetect, "found pattern");
pattern_data = 0; pattern_data = 0;
/* get the data of the pattern */ /* get the data of the pattern */
for (i = 0; i < videodetect->pattern_data_count; i++) { for (i = 0; i < simplevideomarkdetect->pattern_data_count; i++) {
d = GST_VIDEO_FRAME_COMP_DATA (frame, 0); d = GST_VIDEO_FRAME_COMP_DATA (frame, 0);
/* move to start of bottom left, adjust for offsets */ /* move to start of bottom left, adjust for offsets */
d += row_stride * (height - ph - videodetect->bottom_offset) + d += row_stride * (height - ph - simplevideomarkdetect->bottom_offset) +
pixel_stride * videodetect->left_offset; pixel_stride * simplevideomarkdetect->left_offset;
/* move after the fixed pattern */ /* move after the fixed pattern */
d += pixel_stride * (videodetect->pattern_count * pw); d += pixel_stride * (simplevideomarkdetect->pattern_count * pw);
/* move to i-th pattern data */ /* move to i-th pattern data */
d += pixel_stride * pw * i; d += pixel_stride * pw * i;
/* calc brightness of width * height box */ /* calc brightness of width * height box */
brightness = gst_video_detect_calc_brightness (videodetect, d, pw, ph, brightness =
gst_video_detect_calc_brightness (simplevideomarkdetect, d, pw, ph,
row_stride, pixel_stride); row_stride, pixel_stride);
/* update pattern, we just use the center to decide between black and white. */ /* update pattern, we just use the center to decide between black and white. */
pattern_data <<= 1; pattern_data <<= 1;
if (brightness > videodetect->pattern_center) if (brightness > simplevideomarkdetect->pattern_center)
pattern_data |= 1; pattern_data |= 1;
} }
GST_DEBUG_OBJECT (videodetect, "have data %" G_GUINT64_FORMAT, pattern_data); GST_DEBUG_OBJECT (simplevideomarkdetect, "have data %" G_GUINT64_FORMAT,
pattern_data);
videodetect->in_pattern = TRUE; simplevideomarkdetect->in_pattern = TRUE;
gst_video_detect_post_message (videodetect, frame->buffer, pattern_data); gst_video_detect_post_message (simplevideomarkdetect, frame->buffer,
pattern_data);
return; return;
no_pattern: no_pattern:
{ {
GST_DEBUG_OBJECT (videodetect, "no pattern found"); GST_DEBUG_OBJECT (simplevideomarkdetect, "no pattern found");
if (videodetect->in_pattern) { if (simplevideomarkdetect->in_pattern) {
videodetect->in_pattern = FALSE; simplevideomarkdetect->in_pattern = FALSE;
gst_video_detect_post_message (videodetect, frame->buffer, 0); gst_video_detect_post_message (simplevideomarkdetect, frame->buffer, 0);
} }
return; return;
} }
@ -529,11 +546,12 @@ static GstFlowReturn
gst_video_detect_transform_frame_ip (GstVideoFilter * filter, gst_video_detect_transform_frame_ip (GstVideoFilter * filter,
GstVideoFrame * frame) GstVideoFrame * frame)
{ {
GstVideoDetect *videodetect = GST_VIDEO_DETECT (filter); GstSimpleVideoMarkDetect *simplevideomarkdetect =
GST_SIMPLE_VIDEO_MARK_DETECT (filter);
GST_DEBUG_OBJECT (videodetect, "transform_frame_ip"); GST_DEBUG_OBJECT (simplevideomarkdetect, "transform_frame_ip");
gst_video_detect_yuv (videodetect, frame); gst_video_detect_yuv (simplevideomarkdetect, frame);
return GST_FLOW_OK; return GST_FLOW_OK;
} }

View file

@ -17,26 +17,26 @@
* Boston, MA 02110-1301, USA. * Boston, MA 02110-1301, USA.
*/ */
#ifndef _GST_VIDEO_DETECT_H_ #ifndef _GST_SIMPLE_VIDEO_MARK_DETECT_H_
#define _GST_VIDEO_DETECT_H_ #define _GST_SIMPLE_VIDEO_MARK_DETECT_H_
#include <gst/video/video.h> #include <gst/video/video.h>
#include <gst/video/gstvideofilter.h> #include <gst/video/gstvideofilter.h>
G_BEGIN_DECLS G_BEGIN_DECLS
#define GST_TYPE_VIDEO_DETECT (gst_video_detect_get_type()) #define GST_TYPE_SIMPLE_VIDEO_MARK_DETECT (gst_video_detect_get_type())
#define GST_VIDEO_DETECT(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_VIDEO_DETECT,GstVideoDetect)) #define GST_SIMPLE_VIDEO_MARK_DETECT(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_SIMPLE_VIDEO_MARK_DETECT,GstSimpleVideoMarkDetect))
#define GST_VIDEO_DETECT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_VIDEO_DETECT,GstVideoDetectClass)) #define GST_SIMPLE_VIDEO_MARK_DETECT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_SIMPLE_VIDEO_MARK_DETECT,GstSimpleVideoMarkDetectClass))
#define GST_IS_VIDEO_DETECT(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_VIDEO_DETECT)) #define GST_IS_SIMPLE_VIDEO_MARK_DETECT(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_SIMPLE_VIDEO_MARK_DETECT))
#define GST_IS_VIDEO_DETECT_CLASS(obj) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_VIDEO_DETECT)) #define GST_IS_SIMPLE_VIDEO_MARK_DETECT_CLASS(obj) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_SIMPLE_VIDEO_MARK_DETECT))
typedef struct _GstVideoDetect GstVideoDetect; typedef struct _GstSimpleVideoMarkDetect GstSimpleVideoMarkDetect;
typedef struct _GstVideoDetectClass GstVideoDetectClass; typedef struct _GstSimpleVideoMarkDetectClass GstSimpleVideoMarkDetectClass;
struct _GstVideoDetect struct _GstSimpleVideoMarkDetect
{ {
GstVideoFilter base_videodetect; GstVideoFilter base_simplevideomarkdetect;
gboolean message; gboolean message;
gint pattern_width; gint pattern_width;
@ -51,9 +51,9 @@ struct _GstVideoDetect
gboolean in_pattern; gboolean in_pattern;
}; };
struct _GstVideoDetectClass struct _GstSimpleVideoMarkDetectClass
{ {
GstVideoFilterClass base_videodetect_class; GstVideoFilterClass base_simplevideomarkdetect_class;
}; };
GType gst_video_detect_get_type (void); GType gst_video_detect_get_type (void);

View file

@ -22,8 +22,8 @@
#endif #endif
#include "gstvideoanalyse.h" #include "gstvideoanalyse.h"
#include "gstvideodetect.h" #include "gstsimplevideomarkdetect.h"
#include "gstvideomark.h" #include "gstsimplevideomark.h"
static gboolean static gboolean
plugin_init (GstPlugin * plugin) plugin_init (GstPlugin * plugin)
@ -34,14 +34,14 @@ plugin_init (GstPlugin * plugin)
GST_TYPE_VIDEO_ANALYSE); GST_TYPE_VIDEO_ANALYSE);
/* FIXME under no circumstances is anyone allowed to revive the /* FIXME under no circumstances is anyone allowed to revive the
* element formerly known as videodetect without changing the name * element formerly known as simplevideomarkdetect without changing the name
* first. XOXO --ds */ * first. XOXO --ds */
res &= gst_element_register (plugin, "videodetect", GST_RANK_NONE, res &= gst_element_register (plugin, "simplevideomarkdetect", GST_RANK_NONE,
GST_TYPE_VIDEO_DETECT); GST_TYPE_SIMPLE_VIDEO_MARK_DETECT);
res &= gst_element_register (plugin, "videomark", GST_RANK_NONE, res &= gst_element_register (plugin, "simplevideomark", GST_RANK_NONE,
GST_TYPE_VIDEO_MARK); GST_TYPE_SIMPLE_VIDEO_MARK);
return res; return res;
} }