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>
* <listitem> * <listitem>
* <para> * <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 * #guint
* <classname>&quot;data&quot;</classname>: * <classname>&quot;data&quot;</classname>:
* the data-pattern found after the pattern or 0 when have-signal is #FALSE. * 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 static void
gst_video_detect_post_message (GstVideoDetect * videodetect, GstBuffer * buffer, gst_video_detect_post_message (GstVideoDetect * videodetect, GstBuffer * buffer,
guint data) guint64 data)
{ {
GstBaseTransform *trans; GstBaseTransform *trans;
GstMessage *m; GstMessage *m;
@ -208,7 +215,8 @@ gst_video_detect_post_message (GstVideoDetect * videodetect, GstBuffer * buffer,
"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_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); 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 i, pw, ph, row_stride, pixel_stride, offset;
gint width, height, req_width, req_height; gint width, height, req_width, req_height;
guint8 *d, *data; guint8 *d, *data;
guint pattern_data; guint64 pattern_data;
data = GST_BUFFER_DATA (buffer); data = GST_BUFFER_DATA (buffer);

View file

@ -74,6 +74,7 @@ enum
PROP_PATTERN_COUNT, PROP_PATTERN_COUNT,
PROP_PATTERN_DATA_COUNT, PROP_PATTERN_DATA_COUNT,
PROP_PATTERN_DATA, PROP_PATTERN_DATA,
PROP_PATTERN_DATA_64,
PROP_ENABLED, PROP_ENABLED,
PROP_LEFT_OFFSET, PROP_LEFT_OFFSET,
PROP_BOTTOM_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 i, pw, ph, row_stride, pixel_stride, offset;
gint width, height, req_width, req_height; gint width, height, req_width, req_height;
guint8 *d, *data; guint8 *d, *data;
guint pattern_shift; guint64 pattern_shift;
guint8 color; guint8 color;
data = GST_BUFFER_DATA (buffer); data = GST_BUFFER_DATA (buffer);
@ -196,7 +197,7 @@ gst_video_mark_yuv (GstVideoMark * videomark, GstBuffer * buffer)
color); 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 */ /* get the data of the pattern */
for (i = 0; i < videomark->pattern_data_count; i++) { 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: case PROP_PATTERN_DATA_COUNT:
videomark->pattern_data_count = g_value_get_int (value); videomark->pattern_data_count = g_value_get_int (value);
break; break;
case PROP_PATTERN_DATA_64:
videomark->pattern_data = g_value_get_uint64 (value);
break;
case PROP_PATTERN_DATA: case PROP_PATTERN_DATA:
videomark->pattern_data = g_value_get_int (value); videomark->pattern_data = g_value_get_int (value);
break; break;
@ -297,8 +301,11 @@ gst_video_mark_get_property (GObject * object, guint prop_id, GValue * value,
case PROP_PATTERN_DATA_COUNT: case PROP_PATTERN_DATA_COUNT:
g_value_set_int (value, videomark->pattern_data_count); g_value_set_int (value, videomark->pattern_data_count);
break; break;
case PROP_PATTERN_DATA_64:
g_value_set_uint64 (value, videomark->pattern_data);
break;
case PROP_PATTERN_DATA: case PROP_PATTERN_DATA:
g_value_set_int (value, videomark->pattern_data); g_value_set_int (value, MIN (videomark->pattern_data, G_MAXINT));
break; break;
case PROP_ENABLED: case PROP_ENABLED:
g_value_set_boolean (value, videomark->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)); DEFAULT_PATTERN_COUNT, G_PARAM_READWRITE | G_PARAM_CONSTRUCT));
g_object_class_install_property (gobject_class, PROP_PATTERN_DATA_COUNT, g_object_class_install_property (gobject_class, PROP_PATTERN_DATA_COUNT,
g_param_spec_int ("pattern-data-count", "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)); 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_object_class_install_property (gobject_class, PROP_PATTERN_DATA,
g_param_spec_int ("pattern-data", "Pattern data", g_param_spec_int ("pattern-data", "Pattern data",
"The extra data pattern markers", 0, G_MAXINT, "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_object_class_install_property (gobject_class, PROP_ENABLED,
g_param_spec_boolean ("enabled", "Enabled", g_param_spec_boolean ("enabled", "Enabled",
"Enable or disable the filter", "Enable or disable the filter",

View file

@ -54,7 +54,7 @@ struct _GstVideoMark {
gint pattern_height; gint pattern_height;
gint pattern_count; gint pattern_count;
gint pattern_data_count; gint pattern_data_count;
gint pattern_data; guint64 pattern_data;
gboolean enabled; gboolean enabled;
gint left_offset; gint left_offset;
gint bottom_offset; gint bottom_offset;