diff options
author | George Kiagiadakis <george.kiagiadakis@collabora.com> | 2018-10-05 15:37:45 +0300 |
---|---|---|
committer | George Kiagiadakis <george.kiagiadakis@collabora.com> | 2018-10-05 15:40:13 +0300 |
commit | a85a59e4a8cda731e688f4e6716401e394c6c29c (patch) | |
tree | 2b28a4beaf76dfd0f7c499607c86ba31afaa0461 | |
parent | 18f082a0d8db9626f233b142d8615a6929cf5224 (diff) | |
download | gst-plugins-base-a85a59e4a8cda731e688f4e6716401e394c6c29c.tar.gz gst-plugins-base-a85a59e4a8cda731e688f4e6716401e394c6c29c.tar.xz |
tests: audioconvert: test caps fixate with layout conversion
https://bugzilla.gnome.org/show_bug.cgi?id=797225
-rw-r--r-- | tests/check/elements/audioconvert.c | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/tests/check/elements/audioconvert.c b/tests/check/elements/audioconvert.c index 2420fa327..0d8699b23 100644 --- a/tests/check/elements/audioconvert.c +++ b/tests/check/elements/audioconvert.c @@ -1775,6 +1775,55 @@ GST_START_TEST (test_layout_conversion) GST_END_TEST; +GST_START_TEST (test_layout_conv_fixate_caps) +{ + GstCaps *incaps, *outcaps; + GstElement *audioconvert; + GstCaps *caps; + GstStructure *s; + + incaps = gst_caps_from_string ("audio/x-raw, " + "format = (string) F32LE, " + "layout = (string) interleaved, " + "rate = (int) 44100, " + "channels = (int) 1"); + outcaps = gst_caps_from_string ("audio/x-raw, " + "format = (string) S16LE, " + "layout = (string) interleaved, " + "rate = (int) [ 1, MAX ], " + "channels = (int) 2;" + "audio/x-raw, " + "format = (string) { F32LE, F32BE, F64LE, F64BE }, " + "layout = (string) non-interleaved, " + "rate = (int) [ 1, MAX ], " + "channels = (int) [1, 8]"); + + audioconvert = setup_audioconvert (outcaps); + + fail_unless (gst_element_set_state (audioconvert, + GST_STATE_PLAYING) == GST_STATE_CHANGE_SUCCESS, + "could not set to playing"); + + gst_check_setup_events (mysrcpad, audioconvert, incaps, GST_FORMAT_TIME); + + caps = gst_pad_get_current_caps (mysinkpad); + s = gst_caps_get_structure (caps, 0); + assert_equals_string (gst_structure_get_string (s, "format"), "F32LE"); + assert_equals_string (gst_structure_get_string (s, "layout"), + "non-interleaved"); + + fail_unless (gst_element_set_state (audioconvert, + GST_STATE_NULL) == GST_STATE_CHANGE_SUCCESS, "could not set to null"); + /* cleanup */ + GST_DEBUG ("cleanup audioconvert"); + cleanup_audioconvert (audioconvert); + GST_DEBUG ("cleanup, unref incaps"); + gst_caps_unref (incaps); + gst_caps_unref (outcaps); +} + +GST_END_TEST; + static Suite * audioconvert_suite (void) { @@ -1794,6 +1843,7 @@ audioconvert_suite (void) tcase_add_test (tc_chain, test_preserve_width); tcase_add_test (tc_chain, test_gap_buffers); tcase_add_test (tc_chain, test_layout_conversion); + tcase_add_test (tc_chain, test_layout_conv_fixate_caps); return s; } |