videosignal: change pattern data type to uint64, add property and message field

Keeps the old uint typed value support for compatibility.
This commit is contained in:
René Stadler 2009-09-08 00:01:28 +03:00
parent b24d581c78
commit c45cc31c7d
3 changed files with 28 additions and 9 deletions

View file

@ -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);

View file

@ -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",

View file

@ -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;