From f59a1d28686690ca9189ec48243479aa2cf81e6a Mon Sep 17 00:00:00 2001 From: Thiago Santos Date: Thu, 13 Jan 2011 11:28:32 -0300 Subject: [PATCH] test: qtmux: Tests qtmux reuse Forces the use of qtmux after it has been put to PLAYING and back to NULL once https://bugzilla.gnome.org/show_bug.cgi?id=639338 --- tests/check/elements/qtmux.c | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/tests/check/elements/qtmux.c b/tests/check/elements/qtmux.c index 69816f7047..1db618cec9 100644 --- a/tests/check/elements/qtmux.c +++ b/tests/check/elements/qtmux.c @@ -355,6 +355,36 @@ GST_START_TEST (test_audio_pad_frag_streamable) GST_END_TEST; +GST_START_TEST (test_reuse) +{ + GstElement *qtmux = setup_qtmux (&srcvideotemplate, "video_%d"); + GstBuffer *inbuffer; + GstCaps *caps; + + gst_element_set_state (qtmux, GST_STATE_PLAYING); + gst_element_set_state (qtmux, GST_STATE_NULL); + gst_element_set_state (qtmux, GST_STATE_PLAYING); + gst_pad_set_active (mysrcpad, TRUE); + gst_pad_set_active (mysinkpad, TRUE); + + inbuffer = gst_buffer_new_and_alloc (1); + fail_unless (inbuffer != NULL); + caps = gst_caps_copy (gst_pad_get_pad_template_caps (mysrcpad)); + gst_buffer_set_caps (inbuffer, caps); + gst_caps_unref (caps); + GST_BUFFER_TIMESTAMP (inbuffer) = 0; + GST_BUFFER_DURATION (inbuffer) = 40 * GST_MSECOND; + ASSERT_BUFFER_REFCOUNT (inbuffer, "inbuffer", 1); + fail_unless (gst_pad_push (mysrcpad, inbuffer) == GST_FLOW_OK); + + /* send eos to have all written */ + fail_unless (gst_pad_push_event (mysrcpad, gst_event_new_eos ()) == TRUE); + + cleanup_qtmux (qtmux, "video_%d"); +} + +GST_END_TEST; + static Suite * qtmux_suite (void) { @@ -369,6 +399,8 @@ qtmux_suite (void) tcase_add_test (tc_chain, test_video_pad_frag_streamable); tcase_add_test (tc_chain, test_audio_pad_frag_streamable); + tcase_add_test (tc_chain, test_reuse); + return s; }