diff --git a/tests/check/elements/zbar.c b/tests/check/elements/zbar.c index 0566d7e401..9c8284d654 100644 --- a/tests/check/elements/zbar.c +++ b/tests/check/elements/zbar.c @@ -25,6 +25,7 @@ GST_START_TEST (test_still_image) GstMessage *zbar_msg = NULL; const GstStructure *s; GstElement *pipeline, *src, *dec, *csp, *zbar, *sink; + GstSample *sample; const gchar *type, *symbol; gchar *path; int qual; @@ -37,6 +38,8 @@ GST_START_TEST (test_still_image) zbar = gst_element_factory_make ("zbar", NULL); sink = gst_element_factory_make ("fakesink", NULL); + g_object_set (zbar, "attach-frame", TRUE, NULL); + path = g_build_filename (GST_TEST_FILES_PATH, "barcode.png", NULL); GST_LOG ("reading file '%s'", path); g_object_set (src, "location", path, NULL); @@ -79,6 +82,7 @@ GST_START_TEST (test_still_image) fail_unless (gst_structure_has_field (s, "type")); fail_unless (gst_structure_has_field (s, "symbol")); fail_unless (gst_structure_has_field (s, "quality")); + fail_unless (gst_structure_has_field (s, "frame")); fail_unless (gst_structure_get_int (s, "quality", &qual)); fail_unless (qual >= 90); type = gst_structure_get_string (s, "type"); @@ -86,6 +90,11 @@ GST_START_TEST (test_still_image) symbol = gst_structure_get_string (s, "symbol"); fail_unless_equals_string (symbol, "9876543210128"); + fail_unless (gst_structure_get (s, "frame", GST_TYPE_SAMPLE, &sample, NULL)); + fail_unless (gst_sample_get_buffer (sample)); + fail_unless (gst_sample_get_caps (sample)); + gst_sample_unref (sample); + fail_unless_equals_int (gst_element_set_state (pipeline, GST_STATE_NULL), GST_STATE_CHANGE_SUCCESS);