summaryrefslogtreecommitdiff
authorRené Stadler <mail@renestadler.de>2009-09-07 21:01:28 (GMT)
committer René Stadler <mail@renestadler.de>2009-09-26 16:11:09 (GMT)
commitc45cc31c7d87abe4a4d2f8767720c8da321ca6b3 (patch) (side-by-side diff)
tree78cb9ed0edee2eb587fd6d9b8871f9c0626aa799
parentb24d581c78e0de7d57ccb9b015339eab174c2cd2 (diff)
downloadgst-plugins-bad-c45cc31c7d87abe4a4d2f8767720c8da321ca6b3.zip
gst-plugins-bad-c45cc31c7d87abe4a4d2f8767720c8da321ca6b3.tar.gz
videosignal: change pattern data type to uint64, add property and message field
Keeps the old uint typed value support for compatibility.
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--gst/videosignal/gstvideodetect.c14
-rw-r--r--gst/videosignal/gstvideomark.c21
-rw-r--r--gst/videosignal/gstvideomark.h2
3 files changed, 28 insertions, 9 deletions
diff --git a/gst/videosignal/gstvideodetect.c b/gst/videosignal/gstvideodetect.c
index d840dd2..0ddc6c3 100644
--- a/gst/videosignal/gstvideodetect.c
+++ b/gst/videosignal/gstvideodetect.c
@@ -78,6 +78,13 @@
* </listitem>
* <listitem>
* <para>
+ * #guint64
+ * <classname>&quot;data-uint64&quot;</classname>:
+ * the data-pattern found after the pattern or 0 when have-signal is #FALSE.
+ * </para>
+ * </listitem>
+ * <listitem>
+ * <para>
* #guint
* <classname>&quot;data&quot;</classname>:
* the data-pattern found after the pattern or 0 when have-signal is #FALSE.
@@ -184,7 +191,7 @@ gst_video_detect_set_caps (GstBaseTransform * btrans, GstCaps * incaps,
static void
gst_video_detect_post_message (GstVideoDetect * videodetect, GstBuffer * buffer,
- guint data)
+ guint64 data)
{
GstBaseTransform *trans;
GstMessage *m;
@@ -208,7 +215,8 @@ gst_video_detect_post_message (GstVideoDetect * videodetect, GstBuffer * buffer,
"stream-time", G_TYPE_UINT64, stream_time,
"running-time", G_TYPE_UINT64, running_time,
"duration", G_TYPE_UINT64, duration,
- "data", G_TYPE_UINT, data, NULL));
+ "data-uint64", G_TYPE_UINT64, data,
+ "data", G_TYPE_UINT, (guint) MIN (data, G_MAXINT), NULL));
gst_element_post_message (GST_ELEMENT_CAST (videodetect), m);
}
@@ -237,7 +245,7 @@ gst_video_detect_yuv (GstVideoDetect * videodetect, GstBuffer * buffer)
gint i, pw, ph, row_stride, pixel_stride, offset;
gint width, height, req_width, req_height;
guint8 *d, *data;
- guint pattern_data;
+ guint64 pattern_data;
data = GST_BUFFER_DATA (buffer);
diff --git a/gst/videosignal/gstvideomark.c b/gst/videosignal/gstvideomark.c
index cbc7214..3e73d85 100644
--- a/gst/videosignal/gstvideomark.c
+++ b/gst/videosignal/gstvideomark.c
@@ -74,6 +74,7 @@ enum
PROP_PATTERN_COUNT,
PROP_PATTERN_DATA_COUNT,
PROP_PATTERN_DATA,
+ PROP_PATTERN_DATA_64,
PROP_ENABLED,
PROP_LEFT_OFFSET,
PROP_BOTTOM_OFFSET
@@ -150,7 +151,7 @@ gst_video_mark_yuv (GstVideoMark * videomark, GstBuffer * buffer)
gint i, pw, ph, row_stride, pixel_stride, offset;
gint width, height, req_width, req_height;
guint8 *d, *data;
- guint pattern_shift;
+ guint64 pattern_shift;
guint8 color;
data = GST_BUFFER_DATA (buffer);
@@ -196,7 +197,7 @@ gst_video_mark_yuv (GstVideoMark * videomark, GstBuffer * buffer)
color);
}
- pattern_shift = 1 << (videomark->pattern_data_count - 1);
+ pattern_shift = G_GUINT64_CONSTANT (1) << (videomark->pattern_data_count - 1);
/* get the data of the pattern */
for (i = 0; i < videomark->pattern_data_count; i++) {
@@ -258,6 +259,9 @@ gst_video_mark_set_property (GObject * object, guint prop_id,
case PROP_PATTERN_DATA_COUNT:
videomark->pattern_data_count = g_value_get_int (value);
break;
+ case PROP_PATTERN_DATA_64:
+ videomark->pattern_data = g_value_get_uint64 (value);
+ break;
case PROP_PATTERN_DATA:
videomark->pattern_data = g_value_get_int (value);
break;
@@ -297,8 +301,11 @@ gst_video_mark_get_property (GObject * object, guint prop_id, GValue * value,
case PROP_PATTERN_DATA_COUNT:
g_value_set_int (value, videomark->pattern_data_count);
break;
+ case PROP_PATTERN_DATA_64:
+ g_value_set_uint64 (value, videomark->pattern_data);
+ break;
case PROP_PATTERN_DATA:
- g_value_set_int (value, videomark->pattern_data);
+ g_value_set_int (value, MIN (videomark->pattern_data, G_MAXINT));
break;
case PROP_ENABLED:
g_value_set_boolean (value, videomark->enabled);
@@ -356,12 +363,16 @@ gst_video_mark_class_init (gpointer klass, gpointer class_data)
DEFAULT_PATTERN_COUNT, G_PARAM_READWRITE | G_PARAM_CONSTRUCT));
g_object_class_install_property (gobject_class, PROP_PATTERN_DATA_COUNT,
g_param_spec_int ("pattern-data-count", "Pattern data count",
- "The number of extra data pattern markers", 0, G_MAXINT,
+ "The number of extra data pattern markers", 0, 64,
DEFAULT_PATTERN_DATA_COUNT, G_PARAM_READWRITE | G_PARAM_CONSTRUCT));
+ g_object_class_install_property (gobject_class, PROP_PATTERN_DATA_64,
+ g_param_spec_uint64 ("pattern-data-uint64", "Pattern data",
+ "The extra data pattern markers", 0, G_MAXUINT64,
+ DEFAULT_PATTERN_DATA, G_PARAM_READWRITE | G_PARAM_CONSTRUCT));
g_object_class_install_property (gobject_class, PROP_PATTERN_DATA,
g_param_spec_int ("pattern-data", "Pattern data",
"The extra data pattern markers", 0, G_MAXINT,
- DEFAULT_PATTERN_DATA, G_PARAM_READWRITE | G_PARAM_CONSTRUCT));
+ DEFAULT_PATTERN_DATA, G_PARAM_READWRITE));
g_object_class_install_property (gobject_class, PROP_ENABLED,
g_param_spec_boolean ("enabled", "Enabled",
"Enable or disable the filter",
diff --git a/gst/videosignal/gstvideomark.h b/gst/videosignal/gstvideomark.h
index b895d18..4511346 100644
--- a/gst/videosignal/gstvideomark.h
+++ b/gst/videosignal/gstvideomark.h
@@ -54,7 +54,7 @@ struct _GstVideoMark {
gint pattern_height;
gint pattern_count;
gint pattern_data_count;
- gint pattern_data;
+ guint64 pattern_data;
gboolean enabled;
gint left_offset;
gint bottom_offset;