mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-17 03:35:21 +00:00
composition: add a new failing test for finalize on commit.
Co-Authored by: Thibault Saunier <tsaunier@gnome.org>
This commit is contained in:
parent
50959f9c10
commit
95a2e3b570
1 changed files with 34 additions and 0 deletions
|
@ -184,12 +184,44 @@ GST_START_TEST (test_remove_invalid_object)
|
|||
gnl_composition_remove (composition, source2);
|
||||
fail_unless (gnl_composition_remove (composition, source1));
|
||||
|
||||
gst_element_set_state (GST_ELEMENT (composition), GST_STATE_NULL);
|
||||
gst_object_unref (composition);
|
||||
gst_object_unref (source2);
|
||||
}
|
||||
|
||||
GST_END_TEST;
|
||||
|
||||
GST_START_TEST (test_dispose_on_commit)
|
||||
{
|
||||
GstElement *composition;
|
||||
GstElement *gnlsource;
|
||||
GstElement *audiotestsrc;
|
||||
GstElement *pipeline, *fakesink;
|
||||
gboolean ret;
|
||||
|
||||
composition = gst_element_factory_make ("gnlcomposition", "composition");
|
||||
pipeline = GST_ELEMENT (gst_pipeline_new (NULL));
|
||||
fakesink = gst_element_factory_make ("fakesink", NULL);
|
||||
|
||||
gnlsource = gst_element_factory_make ("gnlsource", "gnlsource1");
|
||||
audiotestsrc = gst_element_factory_make ("audiotestsrc", "audiotestsrc1");
|
||||
gst_bin_add (GST_BIN (gnlsource), audiotestsrc);
|
||||
g_object_set (gnlsource, "start", (guint64) 0 * GST_SECOND,
|
||||
"duration", 10 * GST_SECOND, "inpoint", (guint64) 0, "priority", 1, NULL);
|
||||
fail_unless (gnl_composition_add (GST_BIN (composition), gnlsource));
|
||||
|
||||
gst_bin_add_many (GST_BIN (pipeline), composition, fakesink, NULL);
|
||||
fail_unless (gst_element_link (composition, fakesink) == TRUE);
|
||||
|
||||
|
||||
g_signal_emit_by_name (composition, "commit", TRUE, &ret);
|
||||
|
||||
ASSERT_OBJECT_REFCOUNT (composition, "composition", 1);
|
||||
gst_object_unref (pipeline);
|
||||
}
|
||||
|
||||
GST_END_TEST;
|
||||
|
||||
GST_START_TEST (test_simple_adder)
|
||||
{
|
||||
GstBus *bus;
|
||||
|
@ -322,6 +354,8 @@ gnonlin_suite (void)
|
|||
tcase_add_test (tc_chain, test_change_object_start_stop_in_current_stack);
|
||||
tcase_add_test (tc_chain, test_remove_invalid_object);
|
||||
|
||||
tcase_add_test (tc_chain, test_dispose_on_commit);
|
||||
|
||||
if (gst_registry_check_feature_version (gst_registry_get (), "adder", 1,
|
||||
0, 0)) {
|
||||
tcase_add_test (tc_chain, test_simple_adder);
|
||||
|
|
Loading…
Reference in a new issue