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.
This commit is contained in:
David Schleef 2007-12-18 01:01:23 +00:00
parent 1c3e012fc3
commit c5b66243be
3 changed files with 27 additions and 4 deletions

View file

@ -1,3 +1,10 @@
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> 2007-12-17 David Schleef <ds@schleef.org>
* docs/libs/gst-plugins-base-libs-sections.txt: * docs/libs/gst-plugins-base-libs-sections.txt:

View file

@ -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_CHECKERS4, "Checkers 4px", "checkers-4"},
{GST_VIDEO_TEST_SRC_CHECKERS8, "Checkers 8px", "checkers-8"}, {GST_VIDEO_TEST_SRC_CHECKERS8, "Checkers 8px", "checkers-8"},
{GST_VIDEO_TEST_SRC_CIRCULAR, "Circular", "circular"}, {GST_VIDEO_TEST_SRC_CIRCULAR, "Circular", "circular"},
{GST_VIDEO_TEST_SRC_BLINK, "Blink", "blink"},
{0, NULL, NULL} {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_object_class_install_property (gobject_class, PROP_PATTERN,
g_param_spec_enum ("pattern", "Pattern", g_param_spec_enum ("pattern", "Pattern",
"Type of test pattern to generate", GST_TYPE_VIDEO_TEST_SRC_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, g_object_class_install_property (gobject_class,
PROP_TIMESTAMP_OFFSET, g_param_spec_int64 ("timestamp-offset", PROP_TIMESTAMP_OFFSET, g_param_spec_int64 ("timestamp-offset",
"Timestamp offset", "Timestamp offset",
@ -247,6 +248,9 @@ gst_video_test_src_set_pattern (GstVideoTestSrc * videotestsrc,
case GST_VIDEO_TEST_SRC_CIRCULAR: case GST_VIDEO_TEST_SRC_CIRCULAR:
videotestsrc->make_image = gst_video_test_src_circular; videotestsrc->make_image = gst_video_test_src_circular;
break; break;
case GST_VIDEO_TEST_SRC_BLINK:
videotestsrc->make_image = gst_video_test_src_black;
break;
default: default:
g_assert_not_reached (); 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))); gst_buffer_set_caps (outbuf, GST_PAD_CAPS (GST_BASE_SRC_PAD (psrc)));
#endif #endif
src->make_image (src, (void *) GST_BUFFER_DATA (outbuf), if (src->pattern_type == GST_VIDEO_TEST_SRC_BLINK) {
src->width, src->height); 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_TIMESTAMP (outbuf) = src->timestamp_offset + src->running_time;
GST_BUFFER_OFFSET (outbuf) = src->n_frames; GST_BUFFER_OFFSET (outbuf) = src->n_frames;

View file

@ -51,6 +51,7 @@ G_BEGIN_DECLS
* @GST_VIDEO_TEST_SRC_CHECKERS4: Checkers pattern (4px) * @GST_VIDEO_TEST_SRC_CHECKERS4: Checkers pattern (4px)
* @GST_VIDEO_TEST_SRC_CHECKERS8: Checkers pattern (8px) * @GST_VIDEO_TEST_SRC_CHECKERS8: Checkers pattern (8px)
* @GST_VIDEO_TEST_SRC_CIRCULAR: Circular pattern * @GST_VIDEO_TEST_SRC_CIRCULAR: Circular pattern
* @GST_VIDEO_TEST_SRC_BLINK: Alternate between black and white
* *
* The test pattern to produce. * The test pattern to produce.
*/ */
@ -66,7 +67,8 @@ typedef enum {
GST_VIDEO_TEST_SRC_CHECKERS2, GST_VIDEO_TEST_SRC_CHECKERS2,
GST_VIDEO_TEST_SRC_CHECKERS4, GST_VIDEO_TEST_SRC_CHECKERS4,
GST_VIDEO_TEST_SRC_CHECKERS8, GST_VIDEO_TEST_SRC_CHECKERS8,
GST_VIDEO_TEST_SRC_CIRCULAR GST_VIDEO_TEST_SRC_CIRCULAR,
GST_VIDEO_TEST_SRC_BLINK
} GstVideoTestSrcPattern; } GstVideoTestSrcPattern;
typedef struct _GstVideoTestSrc GstVideoTestSrc; typedef struct _GstVideoTestSrc GstVideoTestSrc;