mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 12:11:13 +00:00
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
This commit is contained in:
parent
b496bf923c
commit
f59a1d2868
1 changed files with 32 additions and 0 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue