summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorThiago Santos <thiagoss@osg.samsung.com>2015-04-20 08:20:37 -0300
committerThiago Santos <thiagoss@osg.samsung.com>2015-04-21 10:00:44 -0300
commit87e306fe4a2c8ecea295f2f95b33ffb609a17bcc (patch)
tree7fb3a53ecfc0e536d7afd17169601c01fc58efc6 /tests
parentef5b7ca93ef3cda83632c79d17611239190b0326 (diff)
downloadgstreamer-plugins-bad-87e306fe4a2c8ecea295f2f95b33ffb609a17bcc.tar.gz
tests: camerabin: add test for capture with different caps
Adds a test to verify that viewfinder and image capture caps can be set to non-intersecting caps and still work. https://bugzilla.gnome.org/show_bug.cgi?id=724868
Diffstat (limited to 'tests')
-rw-r--r--tests/check/elements/camerabin.c30
1 files changed, 29 insertions, 1 deletions
diff --git a/tests/check/elements/camerabin.c b/tests/check/elements/camerabin.c
index 006160697..b5ef62d2f 100644
--- a/tests/check/elements/camerabin.c
+++ b/tests/check/elements/camerabin.c
@@ -707,7 +707,8 @@ wait_for_idle_state (void)
fail_unless (idle);
}
-GST_START_TEST (test_single_image_capture)
+static void
+run_single_image_capture_test (GstCaps * viewfinder_caps, GstCaps * image_caps)
{
gboolean idle;
GstMessage *msg;
@@ -717,6 +718,11 @@ GST_START_TEST (test_single_image_capture)
/* set still image mode */
g_object_set (camera, "mode", 1, "location", image_filename, NULL);
+ if (viewfinder_caps)
+ g_object_set (camera, "viewfinder-caps", viewfinder_caps, NULL);
+ if (image_caps)
+ g_object_set (camera, "image-capture-caps", image_caps, NULL);
+
if (gst_element_set_state (GST_ELEMENT (camera), GST_STATE_PLAYING) ==
GST_STATE_CHANGE_FAILURE) {
GST_WARNING ("setting camerabin to PLAYING failed");
@@ -743,6 +749,27 @@ GST_START_TEST (test_single_image_capture)
remove_file (image_filename, 0);
}
+GST_START_TEST (test_single_image_capture)
+{
+ run_single_image_capture_test (NULL, NULL);
+}
+
+GST_END_TEST;
+
+
+/* Verify that incompatible caps can be used in viewfinder and image capture
+ * at the same time */
+GST_START_TEST (test_single_image_capture_with_different_caps)
+{
+ GstCaps *vf_caps =
+ gst_caps_from_string ("video/x-raw, width=480, height=320");
+ GstCaps *img_caps =
+ gst_caps_from_string ("video/x-raw, width=800, height=600");
+ run_single_image_capture_test (vf_caps, img_caps);
+ gst_caps_unref (vf_caps);
+ gst_caps_unref (img_caps);
+}
+
GST_END_TEST;
@@ -1604,6 +1631,7 @@ camerabin_suite (void)
tcase_add_checked_fixture (tc_basic, tests[i].setup_func, teardown);
tcase_add_test (tc_basic, test_single_image_capture);
+ tcase_add_test (tc_basic, test_single_image_capture_with_different_caps);
tcase_add_test (tc_basic, test_single_video_recording);
tcase_add_test (tc_basic, test_image_video_cycle);
if (gst_plugin_feature_check_version ((GstPluginFeature *) jpegenc_factory,