diff options
author | Rene Stadler <mail@renestadler.de> | 2008-03-24 12:32:59 +0000 |
---|---|---|
committer | Rene Stadler <mail@renestadler.de> | 2008-03-24 12:32:59 +0000 |
commit | fe1f183340452ee6d65e667ce1c8b3ee58aaec32 (patch) | |
tree | 372746cf6c2e92ae4f06f32a1a94ed8287f15be0 /tests/check/elements/rglimiter.c | |
parent | cc2d5bd32b8db721e15aa4fa62cdc4852d233351 (diff) | |
download | gst-plugins-bad-fe1f183340452ee6d65e667ce1c8b3ee58aaec32.tar.gz gst-plugins-bad-fe1f183340452ee6d65e667ce1c8b3ee58aaec32.tar.bz2 gst-plugins-bad-fe1f183340452ee6d65e667ce1c8b3ee58aaec32.zip |
Make rganalysis and rglimiter elements GAP-flag aware.
Original commit message from CVS:
* gst/replaygain/gstrganalysis.c (gst_rg_analysis_init),
(gst_rg_analysis_transform_ip):
* gst/replaygain/gstrglimiter.c (gst_rg_limiter_init),
(gst_rg_limiter_transform_ip):
Make rganalysis and rglimiter elements GAP-flag aware.
* tests/check/elements/rganalysis.c: (test_gap_buffers),
(rganalysis_suite):
* tests/check/elements/rglimiter.c (test_gap), (rglimiter_suite):
Add tests to verify gap-awareness.
Diffstat (limited to 'tests/check/elements/rglimiter.c')
-rw-r--r-- | tests/check/elements/rglimiter.c | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/tests/check/elements/rglimiter.c b/tests/check/elements/rglimiter.c index 33b478d0..9d838785 100644 --- a/tests/check/elements/rglimiter.c +++ b/tests/check/elements/rglimiter.c @@ -204,6 +204,36 @@ GST_START_TEST (test_limiting) GST_END_TEST; +GST_START_TEST (test_gap) +{ + GstElement *element = setup_rglimiter (); + GstBuffer *buf, *out_buf; + + set_playing_state (element); + + buf = create_test_buffer (); + GST_BUFFER_FLAG_SET (buf, GST_BUFFER_FLAG_GAP); + fail_unless (gst_pad_push (mysrcpad, buf) == GST_FLOW_OK); + fail_unless (g_list_length (buffers) == 1); + out_buf = buffers->data; + fail_if (out_buf == NULL); + ASSERT_BUFFER_REFCOUNT (out_buf, "out_buf", 1); + + /* Verify that the baseclass does not lift the GAP flag: */ + fail_unless (GST_BUFFER_FLAG_IS_SET (out_buf, GST_BUFFER_FLAG_GAP)); + + g_assert (GST_BUFFER_SIZE (out_buf) == GST_BUFFER_SIZE (buf)); + /* We cheated by passing an input buffer with non-silence that has the GAP + * flag set. The element cannot know that however and must have skipped + * adjusting the buffer because of the flag, which we can easily verify: */ + fail_if (memcmp (GST_BUFFER_DATA (out_buf), + GST_BUFFER_DATA (buf), GST_BUFFER_SIZE (out_buf)) != 0); + + cleanup_rglimiter (element); +} + +GST_END_TEST; + Suite * rglimiter_suite (void) { @@ -215,6 +245,7 @@ rglimiter_suite (void) tcase_add_test (tc_chain, test_no_buffer); tcase_add_test (tc_chain, test_disabled); tcase_add_test (tc_chain, test_limiting); + tcase_add_test (tc_chain, test_gap); return s; } |