Commit c5b66243 authored by David Schleef's avatar David Schleef

gst/videotestsrc/gstvideotestsrc.*: Add a "blink" pattern. Turn on the pain. ...

gst/videotestsrc/gstvideotestsrc.*: Add a "blink" pattern.  Turn on the pain.  Apologies.  It's useful for testing ve...

Original commit message from CVS:
* gst/videotestsrc/gstvideotestsrc.c:
* gst/videotestsrc/gstvideotestsrc.h:
Add a "blink" pattern.  Turn on the pain.  Apologies.  It's useful
for testing vertical refresh synchronization.
parent 1c3e012f
2007-12-17 David Schleef <ds@schleef.org>
* gst/videotestsrc/gstvideotestsrc.c:
* gst/videotestsrc/gstvideotestsrc.h:
Add a "blink" pattern. Turn on the pain. Apologies. It's useful
for testing vertical refresh synchronization.
2007-12-17 David Schleef <ds@schleef.org>
* docs/libs/gst-plugins-base-libs-sections.txt:
......@@ -114,6 +114,7 @@ gst_video_test_src_pattern_get_type (void)
{GST_VIDEO_TEST_SRC_CHECKERS4, "Checkers 4px", "checkers-4"},
{GST_VIDEO_TEST_SRC_CHECKERS8, "Checkers 8px", "checkers-8"},
{GST_VIDEO_TEST_SRC_CIRCULAR, "Circular", "circular"},
{GST_VIDEO_TEST_SRC_BLINK, "Blink", "blink"},
{0, NULL, NULL}
};
......@@ -153,7 +154,7 @@ gst_video_test_src_class_init (GstVideoTestSrcClass * klass)
g_object_class_install_property (gobject_class, PROP_PATTERN,
g_param_spec_enum ("pattern", "Pattern",
"Type of test pattern to generate", GST_TYPE_VIDEO_TEST_SRC_PATTERN,
1, G_PARAM_READWRITE));
GST_VIDEO_TEST_SRC_SMPTE, G_PARAM_READWRITE));
g_object_class_install_property (gobject_class,
PROP_TIMESTAMP_OFFSET, g_param_spec_int64 ("timestamp-offset",
"Timestamp offset",
......@@ -247,6 +248,9 @@ gst_video_test_src_set_pattern (GstVideoTestSrc * videotestsrc,
case GST_VIDEO_TEST_SRC_CIRCULAR:
videotestsrc->make_image = gst_video_test_src_circular;
break;
case GST_VIDEO_TEST_SRC_BLINK:
videotestsrc->make_image = gst_video_test_src_black;
break;
default:
g_assert_not_reached ();
}
......@@ -565,8 +569,18 @@ gst_video_test_src_create (GstPushSrc * psrc, GstBuffer ** buffer)
gst_buffer_set_caps (outbuf, GST_PAD_CAPS (GST_BASE_SRC_PAD (psrc)));
#endif
src->make_image (src, (void *) GST_BUFFER_DATA (outbuf),
src->width, src->height);
if (src->pattern_type == GST_VIDEO_TEST_SRC_BLINK) {
if (src->n_frames & 0x1) {
gst_video_test_src_white (src, (void *) GST_BUFFER_DATA (outbuf),
src->width, src->height);
} else {
gst_video_test_src_black (src, (void *) GST_BUFFER_DATA (outbuf),
src->width, src->height);
}
} else {
src->make_image (src, (void *) GST_BUFFER_DATA (outbuf),
src->width, src->height);
}
GST_BUFFER_TIMESTAMP (outbuf) = src->timestamp_offset + src->running_time;
GST_BUFFER_OFFSET (outbuf) = src->n_frames;
......
......@@ -51,6 +51,7 @@ G_BEGIN_DECLS
* @GST_VIDEO_TEST_SRC_CHECKERS4: Checkers pattern (4px)
* @GST_VIDEO_TEST_SRC_CHECKERS8: Checkers pattern (8px)
* @GST_VIDEO_TEST_SRC_CIRCULAR: Circular pattern
* @GST_VIDEO_TEST_SRC_BLINK: Alternate between black and white
*
* The test pattern to produce.
*/
......@@ -66,7 +67,8 @@ typedef enum {
GST_VIDEO_TEST_SRC_CHECKERS2,
GST_VIDEO_TEST_SRC_CHECKERS4,
GST_VIDEO_TEST_SRC_CHECKERS8,
GST_VIDEO_TEST_SRC_CIRCULAR
GST_VIDEO_TEST_SRC_CIRCULAR,
GST_VIDEO_TEST_SRC_BLINK
} GstVideoTestSrcPattern;
typedef struct _GstVideoTestSrc GstVideoTestSrc;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment