summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThiago Santos <thiago.sousa.santos@collabora.co.uk>2011-01-27 18:35:14 (GMT)
committerThiago Santos <thiago.sousa.santos@collabora.co.uk>2011-02-03 22:09:20 (GMT)
commit4a7dc8178207b00ee43f7071fa43ff1581a6199d (patch)
tree819e496b38f4a917357020fdeb25a03dc71344e3
parent869a61343c415cee12fef7dd43d4c1a0114acf4c (diff)
tests: camerabin2: preview filter tests
Adds tests to the preview-filter property of camerabin2
-rw-r--r--tests/check/elements/camerabin2.c32
1 files changed, 30 insertions, 2 deletions
diff --git a/tests/check/elements/camerabin2.c b/tests/check/elements/camerabin2.c
index 1b0ddf4..df630d4 100644
--- a/tests/check/elements/camerabin2.c
+++ b/tests/check/elements/camerabin2.c
@@ -988,15 +988,18 @@ GST_START_TEST (test_image_custom_filter)
{
GstElement *vf_filter;
GstElement *image_filter;
+ GstElement *preview_filter;
GstPad *pad;
gint vf_probe_counter = 0;
gint image_probe_counter = 0;
+ gint preview_probe_counter = 0;
if (!camera)
return;
vf_filter = gst_element_factory_make ("identity", "vf-filter");
image_filter = gst_element_factory_make ("identity", "img-filter");
+ preview_filter = gst_element_factory_make ("identity", "preview-filter");
pad = gst_element_get_static_pad (vf_filter, "src");
gst_pad_add_buffer_probe (pad, (GCallback) filter_buffer_count,
@@ -1008,10 +1011,20 @@ GST_START_TEST (test_image_custom_filter)
&image_probe_counter);
gst_object_unref (pad);
+ pad = gst_element_get_static_pad (preview_filter, "src");
+ gst_pad_add_buffer_probe (pad, (GCallback) filter_buffer_count,
+ &preview_probe_counter);
+ gst_object_unref (pad);
+
/* set still image mode and filters */
g_object_set (camera, "mode", 1,
"location", make_test_file_name (IMAGE_FILENAME, -1),
- "viewfinder-filter", vf_filter, "image-filter", image_filter, NULL);
+ "viewfinder-filter", vf_filter, "image-filter", image_filter,
+ "preview-filter", preview_filter, NULL);
+
+ gst_object_unref (vf_filter);
+ gst_object_unref (preview_filter);
+ gst_object_unref (image_filter);
if (gst_element_set_state (GST_ELEMENT (camera), GST_STATE_PLAYING) ==
GST_STATE_CHANGE_FAILURE) {
@@ -1035,6 +1048,7 @@ GST_START_TEST (test_image_custom_filter)
fail_unless (vf_probe_counter > 0);
fail_unless (image_probe_counter == 1);
+ fail_unless (preview_probe_counter == 1);
}
GST_END_TEST;
@@ -1044,15 +1058,18 @@ GST_START_TEST (test_video_custom_filter)
{
GstElement *vf_filter;
GstElement *video_filter;
+ GstElement *preview_filter;
GstPad *pad;
gint vf_probe_counter = 0;
gint video_probe_counter = 0;
+ gint preview_probe_counter = 0;
if (!camera)
return;
vf_filter = gst_element_factory_make ("identity", "vf-filter");
video_filter = gst_element_factory_make ("identity", "video-filter");
+ preview_filter = gst_element_factory_make ("identity", "preview-filter");
pad = gst_element_get_static_pad (vf_filter, "src");
gst_pad_add_buffer_probe (pad, (GCallback) filter_buffer_count,
@@ -1064,10 +1081,20 @@ GST_START_TEST (test_video_custom_filter)
&video_probe_counter);
gst_object_unref (pad);
+ pad = gst_element_get_static_pad (preview_filter, "src");
+ gst_pad_add_buffer_probe (pad, (GCallback) filter_buffer_count,
+ &preview_probe_counter);
+ gst_object_unref (pad);
+
/* set still image mode and filters */
g_object_set (camera, "mode", 2,
"location", make_test_file_name (VIDEO_FILENAME, -1),
- "viewfinder-filter", vf_filter, "video-filter", video_filter, NULL);
+ "viewfinder-filter", vf_filter, "video-filter", video_filter,
+ "preview-filter", preview_filter, NULL);
+
+ gst_object_unref (vf_filter);
+ gst_object_unref (preview_filter);
+ gst_object_unref (video_filter);
if (gst_element_set_state (GST_ELEMENT (camera), GST_STATE_PLAYING) ==
GST_STATE_CHANGE_FAILURE) {
@@ -1093,6 +1120,7 @@ GST_START_TEST (test_video_custom_filter)
fail_unless (vf_probe_counter > 0);
fail_unless (video_probe_counter > 0);
+ fail_unless (preview_probe_counter == 1);
}
GST_END_TEST;