2014-10-21 08:35:48 +00:00
|
|
|
/* Gnonlin
|
|
|
|
* Copyright (C) <2009> Alessandro Decina <alessandro.decina@collabora.co.uk>
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Library General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Library General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Library General Public
|
|
|
|
* License along with this library; if not, write to the
|
|
|
|
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
|
|
|
|
* Boston, MA 02110-1301, USA.
|
|
|
|
*/
|
|
|
|
#include "common.h"
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
GstElement *composition;
|
|
|
|
GstElement *source3;
|
|
|
|
} TestClosure;
|
|
|
|
|
|
|
|
static int seek_events;
|
|
|
|
|
|
|
|
static GstPadProbeReturn
|
|
|
|
on_source1_pad_event_cb (GstPad * pad, GstPadProbeInfo * info,
|
|
|
|
gpointer user_data)
|
|
|
|
{
|
|
|
|
if (GST_EVENT_TYPE (info->data) == GST_EVENT_SEEK)
|
|
|
|
++seek_events;
|
|
|
|
|
|
|
|
return GST_PAD_PROBE_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
GST_START_TEST (test_change_object_start_stop_in_current_stack)
|
|
|
|
{
|
2014-06-24 11:44:13 +00:00
|
|
|
GstPad *srcpad;
|
2014-10-21 08:35:48 +00:00
|
|
|
GstElement *pipeline;
|
|
|
|
GstElement *comp, *source1, *def, *sink;
|
|
|
|
GstBus *bus;
|
|
|
|
GstMessage *message;
|
|
|
|
gboolean carry_on, ret = FALSE;
|
|
|
|
|
2019-01-28 02:24:29 +00:00
|
|
|
ges_init ();
|
|
|
|
|
2014-10-21 08:35:48 +00:00
|
|
|
pipeline = gst_pipeline_new ("test_pipeline");
|
|
|
|
comp =
|
2014-08-15 13:48:14 +00:00
|
|
|
gst_element_factory_make_or_warn ("nlecomposition", "test_composition");
|
2014-10-21 08:35:48 +00:00
|
|
|
|
2014-07-11 19:59:43 +00:00
|
|
|
gst_element_set_state (comp, GST_STATE_READY);
|
|
|
|
|
2021-05-20 15:47:41 +00:00
|
|
|
sink = gst_element_factory_make_or_warn ("fakevideosink", "sink");
|
2023-06-21 14:24:12 +00:00
|
|
|
g_object_set (sink, "sync", FALSE, NULL);
|
2014-10-21 08:35:48 +00:00
|
|
|
gst_bin_add_many (GST_BIN (pipeline), comp, sink, NULL);
|
|
|
|
|
2014-06-24 11:44:13 +00:00
|
|
|
gst_element_link (comp, sink);
|
2014-10-21 08:35:48 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
source1
|
|
|
|
Start : 0s
|
|
|
|
Duration : 2s
|
|
|
|
Priority : 2
|
|
|
|
*/
|
|
|
|
|
2014-08-15 13:48:14 +00:00
|
|
|
source1 = videotest_nle_src ("source1", 0, 2 * GST_SECOND, 2, 2);
|
2014-06-24 11:44:13 +00:00
|
|
|
srcpad = gst_element_get_static_pad (source1, "src");
|
|
|
|
gst_pad_add_probe (srcpad, GST_PAD_PROBE_TYPE_EVENT_UPSTREAM,
|
|
|
|
(GstPadProbeCallback) on_source1_pad_event_cb, NULL, NULL);
|
2019-01-14 04:22:13 +00:00
|
|
|
gst_object_unref (srcpad);
|
2014-10-21 08:35:48 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
def (default source)
|
|
|
|
Priority = G_MAXUINT32
|
|
|
|
*/
|
|
|
|
def =
|
2014-08-15 13:48:14 +00:00
|
|
|
videotest_nle_src ("default", 0 * GST_SECOND, 0 * GST_SECOND, 2,
|
2014-10-21 08:35:48 +00:00
|
|
|
G_MAXUINT32);
|
|
|
|
g_object_set (def, "expandable", TRUE, NULL);
|
|
|
|
|
|
|
|
ASSERT_OBJECT_REFCOUNT (source1, "source1", 1);
|
|
|
|
ASSERT_OBJECT_REFCOUNT (def, "default", 1);
|
|
|
|
|
|
|
|
/* Add source 1 */
|
|
|
|
|
2014-08-15 13:48:14 +00:00
|
|
|
nle_composition_add (GST_BIN (comp), source1);
|
|
|
|
nle_composition_add (GST_BIN (comp), def);
|
2014-06-27 14:12:12 +00:00
|
|
|
commit_and_wait (comp, &ret);
|
2014-10-21 08:35:48 +00:00
|
|
|
check_start_stop_duration (source1, 0, 2 * GST_SECOND, 2 * GST_SECOND);
|
|
|
|
check_start_stop_duration (comp, 0, 2 * GST_SECOND, 2 * GST_SECOND);
|
|
|
|
|
|
|
|
bus = gst_element_get_bus (GST_ELEMENT (pipeline));
|
|
|
|
|
2014-07-07 21:24:46 +00:00
|
|
|
GST_DEBUG ("Setting pipeline to PAUSED");
|
|
|
|
ASSERT_OBJECT_REFCOUNT (source1, "source1", 1);
|
2014-10-21 08:35:48 +00:00
|
|
|
|
|
|
|
fail_if (gst_element_set_state (GST_ELEMENT (pipeline),
|
|
|
|
GST_STATE_PAUSED) == GST_STATE_CHANGE_FAILURE);
|
|
|
|
|
|
|
|
GST_DEBUG ("Let's poll the bus");
|
|
|
|
|
|
|
|
carry_on = TRUE;
|
|
|
|
while (carry_on) {
|
|
|
|
message = gst_bus_poll (bus, GST_MESSAGE_ANY, GST_SECOND / 10);
|
|
|
|
if (message) {
|
|
|
|
switch (GST_MESSAGE_TYPE (message)) {
|
|
|
|
case GST_MESSAGE_ASYNC_DONE:
|
|
|
|
{
|
|
|
|
carry_on = FALSE;
|
|
|
|
GST_DEBUG ("Pipeline reached PAUSED, stopping polling");
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case GST_MESSAGE_EOS:
|
|
|
|
{
|
|
|
|
GST_WARNING ("Saw EOS");
|
|
|
|
|
|
|
|
fail_if (TRUE);
|
|
|
|
}
|
|
|
|
case GST_MESSAGE_ERROR:
|
|
|
|
fail_error_message (message);
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
gst_mini_object_unref (GST_MINI_OBJECT (message));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* pipeline is paused at this point */
|
|
|
|
|
|
|
|
/* move source1 out of the active segment */
|
|
|
|
g_object_set (source1, "start", (guint64) 4 * GST_SECOND, NULL);
|
2014-06-27 14:12:12 +00:00
|
|
|
commit_and_wait (comp, &ret);
|
2014-10-21 08:35:48 +00:00
|
|
|
|
|
|
|
/* remove source1 from the composition, which will become empty and remove the
|
|
|
|
* ghostpad */
|
2014-06-30 14:21:30 +00:00
|
|
|
|
2014-10-21 08:35:48 +00:00
|
|
|
|
2014-07-07 21:24:46 +00:00
|
|
|
/* keep an extra ref to source1 as we remove it from the bin */
|
|
|
|
gst_object_ref (source1);
|
2014-08-15 13:48:14 +00:00
|
|
|
fail_unless (nle_composition_remove (GST_BIN (comp), source1));
|
2014-10-21 08:35:48 +00:00
|
|
|
g_object_set (source1, "start", (guint64) 0 * GST_SECOND, NULL);
|
|
|
|
/* add the source again and check that the ghostpad is added again */
|
2014-08-15 13:48:14 +00:00
|
|
|
nle_composition_add (GST_BIN (comp), source1);
|
2014-07-07 21:24:46 +00:00
|
|
|
gst_object_unref (source1);
|
2014-06-27 14:12:12 +00:00
|
|
|
commit_and_wait (comp, &ret);
|
2014-10-21 08:35:48 +00:00
|
|
|
|
|
|
|
|
|
|
|
g_object_set (source1, "duration", (guint64) 1 * GST_SECOND, NULL);
|
2014-06-27 14:12:12 +00:00
|
|
|
commit_and_wait (comp, &ret);
|
2014-10-21 08:35:48 +00:00
|
|
|
|
|
|
|
GST_DEBUG ("Setting pipeline to NULL");
|
|
|
|
|
|
|
|
fail_if (gst_element_set_state (GST_ELEMENT (pipeline),
|
|
|
|
GST_STATE_NULL) == GST_STATE_CHANGE_FAILURE);
|
|
|
|
gst_element_set_state (source1, GST_STATE_NULL);
|
|
|
|
|
2014-07-07 21:24:46 +00:00
|
|
|
GST_DEBUG ("Resetted pipeline to NULL");
|
2014-10-21 08:35:48 +00:00
|
|
|
|
|
|
|
ASSERT_OBJECT_REFCOUNT_BETWEEN (pipeline, "main pipeline", 1, 2);
|
2014-09-19 10:58:26 +00:00
|
|
|
gst_check_objects_destroyed_on_unref (pipeline, comp, def, NULL);
|
2014-10-21 08:35:48 +00:00
|
|
|
ASSERT_OBJECT_REFCOUNT_BETWEEN (bus, "main bus", 1, 2);
|
|
|
|
gst_object_unref (bus);
|
2019-01-28 02:24:29 +00:00
|
|
|
|
|
|
|
ges_deinit ();
|
2014-10-21 08:35:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
GST_END_TEST;
|
|
|
|
|
|
|
|
GST_START_TEST (test_remove_invalid_object)
|
|
|
|
{
|
|
|
|
GstBin *composition;
|
|
|
|
GstElement *source1, *source2;
|
|
|
|
|
2019-01-28 02:24:29 +00:00
|
|
|
ges_init ();
|
|
|
|
|
2014-08-15 13:48:14 +00:00
|
|
|
composition = GST_BIN (gst_element_factory_make ("nlecomposition",
|
2014-10-21 08:35:48 +00:00
|
|
|
"composition"));
|
2014-07-11 19:59:43 +00:00
|
|
|
gst_element_set_state (GST_ELEMENT (composition), GST_STATE_READY);
|
|
|
|
|
2014-08-15 13:48:14 +00:00
|
|
|
source1 = gst_element_factory_make ("nlesource", "source1");
|
|
|
|
source2 = gst_element_factory_make ("nlesource", "source2");
|
2014-10-21 08:35:48 +00:00
|
|
|
|
2014-08-15 13:48:14 +00:00
|
|
|
nle_composition_add (composition, source1);
|
|
|
|
nle_composition_remove (composition, source2);
|
|
|
|
fail_unless (nle_composition_remove (composition, source1));
|
2014-10-21 08:35:48 +00:00
|
|
|
|
2014-07-11 19:58:41 +00:00
|
|
|
gst_element_set_state (GST_ELEMENT (composition), GST_STATE_NULL);
|
2014-10-21 08:35:48 +00:00
|
|
|
gst_object_unref (composition);
|
|
|
|
gst_object_unref (source2);
|
2019-01-28 02:24:29 +00:00
|
|
|
|
|
|
|
ges_deinit ();
|
2014-10-21 08:35:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
GST_END_TEST;
|
|
|
|
|
2015-02-03 11:02:42 +00:00
|
|
|
GST_START_TEST (test_remove_last_object)
|
|
|
|
{
|
|
|
|
GstBin *composition;
|
|
|
|
GstElement *source1, *audiotestsrc, *source2, *audiotestsrc2, *fakesink,
|
|
|
|
*pipeline;
|
|
|
|
GstBus *bus;
|
|
|
|
GstMessage *message;
|
|
|
|
gboolean ret;
|
|
|
|
gint64 position = 0;
|
|
|
|
GstClockTime duration;
|
|
|
|
|
2019-01-28 02:24:29 +00:00
|
|
|
ges_init ();
|
|
|
|
|
2015-02-03 11:02:42 +00:00
|
|
|
pipeline = GST_ELEMENT (gst_pipeline_new (NULL));
|
|
|
|
bus = gst_pipeline_get_bus (GST_PIPELINE (pipeline));
|
|
|
|
|
|
|
|
composition = GST_BIN (gst_element_factory_make ("nlecomposition",
|
|
|
|
"composition"));
|
|
|
|
|
|
|
|
gst_element_set_state (GST_ELEMENT (composition), GST_STATE_READY);
|
|
|
|
|
2021-05-20 15:47:41 +00:00
|
|
|
fakesink = gst_element_factory_make ("fakeaudiosink", NULL);
|
2023-06-21 14:24:12 +00:00
|
|
|
g_object_set (fakesink, "sync", FALSE, NULL);
|
2015-02-03 11:02:42 +00:00
|
|
|
gst_bin_add_many (GST_BIN (pipeline), GST_ELEMENT (composition), fakesink,
|
|
|
|
NULL);
|
|
|
|
gst_element_link (GST_ELEMENT (composition), fakesink);
|
|
|
|
|
|
|
|
source1 = gst_element_factory_make ("nlesource", "source1");
|
|
|
|
audiotestsrc = gst_element_factory_make ("audiotestsrc", "audiotestsrc1");
|
|
|
|
gst_bin_add (GST_BIN (source1), audiotestsrc);
|
|
|
|
g_object_set (source1, "start", (guint64) 0 * GST_SECOND,
|
2021-05-01 20:50:11 +00:00
|
|
|
"duration", (gint64) 10 * GST_SECOND, "inpoint", (guint64) 0, "priority",
|
|
|
|
1, NULL);
|
2015-02-03 11:02:42 +00:00
|
|
|
|
|
|
|
nle_composition_add (composition, source1);
|
|
|
|
|
|
|
|
source2 = gst_element_factory_make ("nlesource", "source1");
|
|
|
|
audiotestsrc2 = gst_element_factory_make ("audiotestsrc", "audiotestsrc1");
|
|
|
|
gst_bin_add (GST_BIN (source2), audiotestsrc2);
|
|
|
|
g_object_set (source2, "start", (guint64) 10 * GST_SECOND,
|
2021-05-01 20:50:11 +00:00
|
|
|
"duration", (gint64) 10 * GST_SECOND, "inpoint", (guint64) 0, "priority",
|
|
|
|
1, NULL);
|
2015-02-03 11:02:42 +00:00
|
|
|
|
|
|
|
nle_composition_add (composition, source2);
|
|
|
|
|
|
|
|
fail_if (gst_element_set_state (GST_ELEMENT (pipeline), GST_STATE_PAUSED)
|
|
|
|
== GST_STATE_CHANGE_FAILURE);
|
|
|
|
message = gst_bus_timed_pop_filtered (bus, GST_CLOCK_TIME_NONE,
|
|
|
|
GST_MESSAGE_ASYNC_DONE | GST_MESSAGE_ERROR);
|
|
|
|
gst_mini_object_unref (GST_MINI_OBJECT (message));
|
|
|
|
|
|
|
|
commit_and_wait (GST_ELEMENT (composition), &ret);
|
|
|
|
|
|
|
|
message = gst_bus_timed_pop_filtered (bus, GST_CLOCK_TIME_NONE,
|
|
|
|
GST_MESSAGE_ASYNC_DONE | GST_MESSAGE_ERROR);
|
|
|
|
gst_mini_object_unref (GST_MINI_OBJECT (message));
|
|
|
|
|
|
|
|
gst_element_seek_simple (pipeline,
|
|
|
|
GST_FORMAT_TIME,
|
|
|
|
GST_SEEK_FLAG_FLUSH | GST_SEEK_FLAG_ACCURATE, 15 * GST_SECOND);
|
|
|
|
|
|
|
|
message = gst_bus_timed_pop_filtered (bus, GST_CLOCK_TIME_NONE,
|
|
|
|
GST_MESSAGE_ASYNC_DONE | GST_MESSAGE_ERROR);
|
|
|
|
gst_mini_object_unref (GST_MINI_OBJECT (message));
|
|
|
|
|
|
|
|
ret =
|
|
|
|
gst_element_query_position (GST_ELEMENT (pipeline), GST_FORMAT_TIME,
|
|
|
|
&position);
|
|
|
|
fail_unless_equals_uint64 (position, 15 * GST_SECOND);
|
|
|
|
|
|
|
|
gst_element_seek_simple (pipeline,
|
|
|
|
GST_FORMAT_TIME,
|
|
|
|
GST_SEEK_FLAG_FLUSH | GST_SEEK_FLAG_ACCURATE, 18 * GST_SECOND);
|
|
|
|
|
|
|
|
message = gst_bus_timed_pop_filtered (bus, GST_CLOCK_TIME_NONE,
|
|
|
|
GST_MESSAGE_ASYNC_DONE | GST_MESSAGE_ERROR);
|
|
|
|
gst_mini_object_unref (GST_MINI_OBJECT (message));
|
|
|
|
|
|
|
|
ret =
|
|
|
|
gst_element_query_position (GST_ELEMENT (pipeline), GST_FORMAT_TIME,
|
|
|
|
&position);
|
|
|
|
fail_unless_equals_uint64 (position, 18 * GST_SECOND);
|
|
|
|
|
|
|
|
nle_composition_remove (composition, source2);
|
|
|
|
|
|
|
|
commit_and_wait (GST_ELEMENT (composition), &ret);
|
|
|
|
g_object_get (composition, "duration", &duration, NULL);
|
|
|
|
fail_unless_equals_uint64 (duration, 10 * GST_SECOND);
|
|
|
|
|
|
|
|
ret =
|
|
|
|
gst_element_query_position (GST_ELEMENT (pipeline), GST_FORMAT_TIME,
|
|
|
|
&position);
|
|
|
|
fail_unless_equals_uint64 (position, 10 * GST_SECOND - 1);
|
|
|
|
|
|
|
|
gst_element_set_state (GST_ELEMENT (pipeline), GST_STATE_NULL);
|
|
|
|
gst_object_unref (pipeline);
|
2019-01-14 04:22:13 +00:00
|
|
|
gst_object_unref (bus);
|
2019-01-28 02:24:29 +00:00
|
|
|
|
|
|
|
ges_deinit ();
|
2015-02-03 11:02:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
GST_END_TEST;
|
|
|
|
|
2014-07-11 19:58:41 +00:00
|
|
|
GST_START_TEST (test_dispose_on_commit)
|
|
|
|
{
|
|
|
|
GstElement *composition;
|
2014-08-15 13:48:14 +00:00
|
|
|
GstElement *nlesource;
|
2014-07-11 19:58:41 +00:00
|
|
|
GstElement *audiotestsrc;
|
|
|
|
GstElement *pipeline, *fakesink;
|
|
|
|
gboolean ret;
|
|
|
|
|
2019-01-28 02:24:29 +00:00
|
|
|
ges_init ();
|
|
|
|
|
2014-08-15 13:48:14 +00:00
|
|
|
composition = gst_element_factory_make ("nlecomposition", "composition");
|
2014-07-11 19:58:41 +00:00
|
|
|
pipeline = GST_ELEMENT (gst_pipeline_new (NULL));
|
2021-05-20 15:47:41 +00:00
|
|
|
fakesink = gst_element_factory_make ("fakevideosink", NULL);
|
2023-06-21 14:24:12 +00:00
|
|
|
g_object_set (fakesink, "sync", FALSE, NULL);
|
2014-07-11 19:58:41 +00:00
|
|
|
|
2014-08-15 13:48:14 +00:00
|
|
|
nlesource = gst_element_factory_make ("nlesource", "nlesource1");
|
2014-07-11 19:58:41 +00:00
|
|
|
audiotestsrc = gst_element_factory_make ("audiotestsrc", "audiotestsrc1");
|
2014-08-15 13:48:14 +00:00
|
|
|
gst_bin_add (GST_BIN (nlesource), audiotestsrc);
|
|
|
|
g_object_set (nlesource, "start", (guint64) 0 * GST_SECOND,
|
2021-05-01 20:50:11 +00:00
|
|
|
"duration", (gint64) 10 * GST_SECOND, "inpoint", (guint64) 0, "priority",
|
|
|
|
1, NULL);
|
2014-08-15 13:48:14 +00:00
|
|
|
fail_unless (nle_composition_add (GST_BIN (composition), nlesource));
|
2014-07-11 19:58:41 +00:00
|
|
|
|
|
|
|
gst_bin_add_many (GST_BIN (pipeline), composition, fakesink, NULL);
|
|
|
|
fail_unless (gst_element_link (composition, fakesink) == TRUE);
|
|
|
|
|
|
|
|
|
2014-07-25 08:55:52 +00:00
|
|
|
ASSERT_OBJECT_REFCOUNT (composition, "composition", 1);
|
2014-07-11 19:58:41 +00:00
|
|
|
g_signal_emit_by_name (composition, "commit", TRUE, &ret);
|
|
|
|
|
|
|
|
gst_object_unref (pipeline);
|
2019-01-28 02:24:29 +00:00
|
|
|
|
|
|
|
ges_deinit ();
|
2014-07-11 19:58:41 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
GST_END_TEST;
|
|
|
|
|
2014-10-06 10:30:17 +00:00
|
|
|
GST_START_TEST (test_simple_audiomixer)
|
2014-10-21 08:35:48 +00:00
|
|
|
{
|
|
|
|
GstBus *bus;
|
|
|
|
GstMessage *message;
|
|
|
|
GstElement *pipeline;
|
2014-10-06 10:30:17 +00:00
|
|
|
GstElement *nle_audiomixer;
|
2014-10-21 08:35:48 +00:00
|
|
|
GstElement *composition;
|
2014-10-06 10:30:17 +00:00
|
|
|
GstElement *audiomixer, *fakesink;
|
2014-08-15 13:48:14 +00:00
|
|
|
GstElement *nlesource1, *nlesource2;
|
2014-10-21 08:35:48 +00:00
|
|
|
GstElement *audiotestsrc1, *audiotestsrc2;
|
|
|
|
|
|
|
|
gboolean carry_on = TRUE, ret;
|
|
|
|
GstClockTime total_time = 10 * GST_SECOND;
|
|
|
|
|
2019-01-28 02:24:29 +00:00
|
|
|
ges_init ();
|
|
|
|
|
2014-10-21 08:35:48 +00:00
|
|
|
pipeline = GST_ELEMENT (gst_pipeline_new (NULL));
|
|
|
|
bus = gst_pipeline_get_bus (GST_PIPELINE (pipeline));
|
|
|
|
|
2014-08-15 13:48:14 +00:00
|
|
|
composition = gst_element_factory_make ("nlecomposition", "composition");
|
2014-07-11 19:59:43 +00:00
|
|
|
gst_element_set_state (composition, GST_STATE_READY);
|
2021-05-20 15:47:41 +00:00
|
|
|
fakesink = gst_element_factory_make ("fakeaudiosink", NULL);
|
2023-06-21 14:24:12 +00:00
|
|
|
g_object_set (fakesink, "sync", FALSE, NULL);
|
2014-10-21 08:35:48 +00:00
|
|
|
|
2014-10-06 10:30:17 +00:00
|
|
|
/* nle_audiomixer */
|
|
|
|
nle_audiomixer = gst_element_factory_make ("nleoperation", "nle_audiomixer");
|
|
|
|
audiomixer = gst_element_factory_make ("audiomixer", "audiomixer");
|
|
|
|
fail_unless (audiomixer != NULL);
|
|
|
|
gst_bin_add (GST_BIN (nle_audiomixer), audiomixer);
|
|
|
|
g_object_set (nle_audiomixer, "start", (guint64) 0 * GST_SECOND,
|
2014-10-21 08:35:48 +00:00
|
|
|
"duration", total_time, "inpoint", (guint64) 0 * GST_SECOND,
|
|
|
|
"priority", 0, NULL);
|
2014-10-06 10:30:17 +00:00
|
|
|
nle_composition_add (GST_BIN (composition), nle_audiomixer);
|
2014-10-21 08:35:48 +00:00
|
|
|
|
|
|
|
/* source 1 */
|
2014-08-15 13:48:14 +00:00
|
|
|
nlesource1 = gst_element_factory_make ("nlesource", "nlesource1");
|
2014-10-21 08:35:48 +00:00
|
|
|
audiotestsrc1 = gst_element_factory_make ("audiotestsrc", "audiotestsrc1");
|
2014-08-15 13:48:14 +00:00
|
|
|
gst_bin_add (GST_BIN (nlesource1), audiotestsrc1);
|
|
|
|
g_object_set (nlesource1, "start", (guint64) 0 * GST_SECOND,
|
2021-05-01 20:50:11 +00:00
|
|
|
"duration", (gint64) total_time / 2, "inpoint", (guint64) 0, "priority",
|
|
|
|
1, NULL);
|
2014-08-15 13:48:14 +00:00
|
|
|
fail_unless (nle_composition_add (GST_BIN (composition), nlesource1));
|
2014-10-21 08:35:48 +00:00
|
|
|
|
2014-08-15 13:48:14 +00:00
|
|
|
/* nlesource2 */
|
|
|
|
nlesource2 = gst_element_factory_make ("nlesource", "nlesource2");
|
2014-10-21 08:35:48 +00:00
|
|
|
audiotestsrc2 = gst_element_factory_make ("audiotestsrc", "audiotestsrc2");
|
2014-08-15 13:48:14 +00:00
|
|
|
gst_bin_add (GST_BIN (nlesource2), GST_ELEMENT (audiotestsrc2));
|
|
|
|
g_object_set (nlesource2, "start", (guint64) 0 * GST_SECOND,
|
2014-10-21 08:35:48 +00:00
|
|
|
"duration", total_time, "inpoint", (guint64) 0 * GST_SECOND, "priority",
|
|
|
|
2, NULL);
|
|
|
|
|
|
|
|
GST_DEBUG ("Adding composition to pipeline");
|
|
|
|
gst_bin_add_many (GST_BIN (pipeline), composition, fakesink, NULL);
|
|
|
|
|
2014-08-15 13:48:14 +00:00
|
|
|
fail_unless (nle_composition_add (GST_BIN (composition), nlesource2));
|
2014-06-24 11:44:13 +00:00
|
|
|
fail_unless (gst_element_link (composition, fakesink) == TRUE);
|
|
|
|
|
2014-06-29 20:35:34 +00:00
|
|
|
GST_DEBUG ("Setting pipeline to PLAYING");
|
2014-10-21 08:35:48 +00:00
|
|
|
|
2014-06-29 20:35:34 +00:00
|
|
|
commit_and_wait (composition, &ret);
|
2014-10-21 08:35:48 +00:00
|
|
|
fail_if (gst_element_set_state (GST_ELEMENT (pipeline), GST_STATE_PLAYING)
|
|
|
|
== GST_STATE_CHANGE_FAILURE);
|
|
|
|
|
|
|
|
message = gst_bus_timed_pop_filtered (bus, GST_CLOCK_TIME_NONE,
|
|
|
|
GST_MESSAGE_ASYNC_DONE | GST_MESSAGE_ERROR);
|
2014-06-27 15:01:34 +00:00
|
|
|
|
2014-10-21 08:35:48 +00:00
|
|
|
if (GST_MESSAGE_TYPE (message) == GST_MESSAGE_ERROR)
|
|
|
|
fail_error_message (message);
|
2019-01-14 04:22:13 +00:00
|
|
|
gst_mini_object_unref (GST_MINI_OBJECT (message));
|
2014-10-21 08:35:48 +00:00
|
|
|
|
|
|
|
GST_DEBUG_BIN_TO_DOT_FILE_WITH_TS (GST_BIN (pipeline),
|
2014-10-06 10:30:17 +00:00
|
|
|
GST_DEBUG_GRAPH_SHOW_ALL, "nle-simple-audiomixer-test-play");
|
2014-10-21 08:35:48 +00:00
|
|
|
|
|
|
|
/* Now play the 10 second composition */
|
|
|
|
while (carry_on) {
|
|
|
|
message = gst_bus_poll (bus, GST_MESSAGE_ANY, GST_SECOND / 10);
|
|
|
|
GST_LOG ("poll: %" GST_PTR_FORMAT, message);
|
|
|
|
if (message) {
|
|
|
|
switch (GST_MESSAGE_TYPE (message)) {
|
|
|
|
case GST_MESSAGE_EOS:
|
|
|
|
/* we should check if we really finished here */
|
|
|
|
GST_WARNING ("Got an EOS");
|
|
|
|
carry_on = FALSE;
|
|
|
|
break;
|
|
|
|
case GST_MESSAGE_SEGMENT_START:
|
|
|
|
case GST_MESSAGE_SEGMENT_DONE:
|
|
|
|
/* We shouldn't see any segement messages, since we didn't do a segment seek */
|
|
|
|
GST_WARNING ("Saw a Segment start/stop");
|
|
|
|
fail_if (TRUE);
|
|
|
|
carry_on = FALSE;
|
|
|
|
break;
|
|
|
|
case GST_MESSAGE_ERROR:
|
|
|
|
fail_error_message (message);
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
gst_mini_object_unref (GST_MINI_OBJECT (message));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
gst_element_set_state (GST_ELEMENT (pipeline), GST_STATE_NULL);
|
|
|
|
gst_object_unref (bus);
|
2014-06-27 14:12:12 +00:00
|
|
|
gst_object_unref (pipeline);
|
2019-01-28 02:24:29 +00:00
|
|
|
|
|
|
|
ges_deinit ();
|
2014-10-21 08:35:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
GST_END_TEST;
|
|
|
|
|
2019-06-17 22:23:43 +00:00
|
|
|
static GstElement *
|
2019-07-03 14:10:42 +00:00
|
|
|
create_nested_source (gint nesting_depth)
|
2019-06-17 22:23:43 +00:00
|
|
|
{
|
2019-07-03 14:10:42 +00:00
|
|
|
gint i;
|
|
|
|
GstElement *source, *nested_comp, *bin;
|
2019-06-17 22:23:43 +00:00
|
|
|
|
|
|
|
source = videotest_nle_src ("source", 0, 2 * GST_SECOND, 2, 2);
|
2019-07-03 14:10:42 +00:00
|
|
|
for (i = 0; i < nesting_depth; i++) {
|
|
|
|
gchar *name = g_strdup_printf ("nested_comp%d", i);
|
|
|
|
gchar *desc = g_strdup_printf ("nlecomposition name=%s ! queue", name);
|
|
|
|
bin = gst_parse_bin_from_description (desc, TRUE, NULL);
|
|
|
|
nested_comp = gst_bin_get_by_name (GST_BIN (bin), name);
|
|
|
|
g_free (name);
|
|
|
|
g_free (desc);
|
|
|
|
|
|
|
|
nle_composition_add (GST_BIN (nested_comp), source);
|
|
|
|
gst_object_unref (nested_comp);
|
|
|
|
|
|
|
|
name = g_strdup_printf ("nested_src%d", i);
|
|
|
|
source = gst_element_factory_make_or_warn ("nlesource", name);
|
|
|
|
g_free (name);
|
2021-05-01 20:50:11 +00:00
|
|
|
g_object_set (source, "start", (guint64) 0, "duration",
|
|
|
|
(gint64) 2 * GST_SECOND, NULL);
|
2019-07-03 14:10:42 +00:00
|
|
|
gst_bin_add (GST_BIN (source), bin);
|
|
|
|
}
|
2019-06-17 22:23:43 +00:00
|
|
|
|
|
|
|
|
2019-07-03 14:10:42 +00:00
|
|
|
return source;
|
2019-06-17 22:23:43 +00:00
|
|
|
}
|
|
|
|
|
2019-06-09 23:35:21 +00:00
|
|
|
GST_START_TEST (test_seek_on_nested)
|
|
|
|
{
|
|
|
|
GstBus *bus;
|
2019-06-17 22:23:43 +00:00
|
|
|
GstPad *srcpad;
|
|
|
|
GstElement *pipeline, *comp, *nested_source, *sink;
|
2019-06-09 23:35:21 +00:00
|
|
|
GstMessage *message;
|
|
|
|
gboolean carry_on, ret = FALSE;
|
|
|
|
GstClockTime position;
|
|
|
|
|
|
|
|
ges_init ();
|
|
|
|
|
|
|
|
pipeline = gst_pipeline_new ("test_pipeline");
|
2019-06-17 22:23:43 +00:00
|
|
|
comp = gst_element_factory_make_or_warn ("nlecomposition", NULL);
|
2019-06-09 23:35:21 +00:00
|
|
|
|
|
|
|
gst_element_set_state (comp, GST_STATE_READY);
|
2021-05-20 15:47:41 +00:00
|
|
|
sink = gst_element_factory_make_or_warn ("fakevideosink", "sink");
|
2023-06-21 14:24:12 +00:00
|
|
|
g_object_set (sink, "sync", FALSE, NULL);
|
2019-06-09 23:35:21 +00:00
|
|
|
gst_bin_add_many (GST_BIN (pipeline), comp, sink, NULL);
|
|
|
|
|
|
|
|
gst_element_link (comp, sink);
|
|
|
|
|
2019-07-03 14:10:42 +00:00
|
|
|
nested_source = create_nested_source (1);
|
2019-06-09 23:35:21 +00:00
|
|
|
srcpad = gst_element_get_static_pad (nested_source, "src");
|
|
|
|
gst_pad_add_probe (srcpad, GST_PAD_PROBE_TYPE_EVENT_UPSTREAM,
|
|
|
|
(GstPadProbeCallback) on_source1_pad_event_cb, NULL, NULL);
|
|
|
|
gst_object_unref (srcpad);
|
|
|
|
|
|
|
|
/* Add nested source */
|
|
|
|
nle_composition_add (GST_BIN (comp), nested_source);
|
|
|
|
commit_and_wait (comp, &ret);
|
|
|
|
check_start_stop_duration (comp, 0, 2 * GST_SECOND, 2 * GST_SECOND);
|
|
|
|
|
|
|
|
bus = gst_element_get_bus (GST_ELEMENT (pipeline));
|
|
|
|
|
|
|
|
fail_if (gst_element_set_state (GST_ELEMENT (pipeline),
|
|
|
|
GST_STATE_PAUSED) == GST_STATE_CHANGE_FAILURE);
|
|
|
|
|
|
|
|
GST_DEBUG ("Let's poll the bus");
|
|
|
|
|
|
|
|
carry_on = TRUE;
|
|
|
|
while (carry_on) {
|
|
|
|
message = gst_bus_poll (bus, GST_MESSAGE_ANY, GST_SECOND / 10);
|
|
|
|
if (message) {
|
|
|
|
switch (GST_MESSAGE_TYPE (message)) {
|
|
|
|
case GST_MESSAGE_ASYNC_DONE:
|
|
|
|
{
|
|
|
|
carry_on = FALSE;
|
|
|
|
GST_DEBUG ("Pipeline reached PAUSED, stopping polling");
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case GST_MESSAGE_EOS:
|
|
|
|
{
|
|
|
|
GST_WARNING ("Saw EOS");
|
|
|
|
|
|
|
|
fail_if (TRUE);
|
|
|
|
}
|
|
|
|
case GST_MESSAGE_ERROR:
|
|
|
|
GST_DEBUG_BIN_TO_DOT_FILE (GST_BIN (pipeline),
|
|
|
|
GST_DEBUG_GRAPH_SHOW_ALL, "error");
|
|
|
|
fail_error_message (message);
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
gst_mini_object_unref (GST_MINI_OBJECT (message));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
gst_element_seek_simple (pipeline,
|
|
|
|
GST_FORMAT_TIME,
|
|
|
|
GST_SEEK_FLAG_FLUSH | GST_SEEK_FLAG_ACCURATE, 1 * GST_SECOND);
|
|
|
|
|
|
|
|
message = gst_bus_timed_pop_filtered (bus, GST_CLOCK_TIME_NONE,
|
|
|
|
GST_MESSAGE_ASYNC_DONE | GST_MESSAGE_ERROR);
|
|
|
|
gst_mini_object_unref (GST_MINI_OBJECT (message));
|
|
|
|
|
|
|
|
ret =
|
|
|
|
gst_element_query_position (GST_ELEMENT (pipeline), GST_FORMAT_TIME,
|
|
|
|
(gint64 *) & position);
|
|
|
|
fail_unless_equals_uint64 (position, 1 * GST_SECOND);
|
|
|
|
|
|
|
|
GST_DEBUG ("Setting pipeline to NULL");
|
|
|
|
|
|
|
|
fail_if (gst_element_set_state (GST_ELEMENT (pipeline),
|
|
|
|
GST_STATE_NULL) == GST_STATE_CHANGE_FAILURE);
|
|
|
|
|
|
|
|
GST_DEBUG ("Resetted pipeline to NULL");
|
|
|
|
|
|
|
|
ASSERT_OBJECT_REFCOUNT_BETWEEN (pipeline, "main pipeline", 1, 2);
|
2019-06-17 22:23:43 +00:00
|
|
|
ASSERT_OBJECT_REFCOUNT_BETWEEN (bus, "main bus", 1, 2);
|
|
|
|
gst_object_unref (bus);
|
2019-08-12 21:37:39 +00:00
|
|
|
gst_check_objects_destroyed_on_unref (pipeline, comp, nested_source, NULL);
|
2019-06-17 22:23:43 +00:00
|
|
|
|
|
|
|
ges_deinit ();
|
|
|
|
}
|
|
|
|
|
|
|
|
GST_END_TEST;
|
|
|
|
|
|
|
|
GST_START_TEST (test_error_in_nested_timeline)
|
|
|
|
{
|
|
|
|
GstBus *bus;
|
|
|
|
GstPad *srcpad;
|
|
|
|
GstElement *pipeline, *comp, *nested_source, *sink;
|
|
|
|
GstMessage *message;
|
|
|
|
gboolean carry_on, ret = FALSE;
|
|
|
|
|
|
|
|
ges_init ();
|
|
|
|
|
|
|
|
pipeline = gst_pipeline_new ("test_pipeline");
|
|
|
|
comp = gst_element_factory_make_or_warn ("nlecomposition", NULL);
|
|
|
|
|
|
|
|
gst_element_set_state (comp, GST_STATE_READY);
|
2021-05-20 15:47:41 +00:00
|
|
|
sink = gst_element_factory_make_or_warn ("fakevideosink", "sink");
|
2023-06-21 14:24:12 +00:00
|
|
|
g_object_set (sink, "sync", FALSE, NULL);
|
2019-06-17 22:23:43 +00:00
|
|
|
gst_bin_add_many (GST_BIN (pipeline), comp, sink, NULL);
|
|
|
|
|
|
|
|
gst_element_link (comp, sink);
|
|
|
|
|
2019-07-03 14:10:42 +00:00
|
|
|
nested_source = create_nested_source (1);
|
2019-06-17 22:23:43 +00:00
|
|
|
srcpad = gst_element_get_static_pad (nested_source, "src");
|
|
|
|
gst_pad_add_probe (srcpad, GST_PAD_PROBE_TYPE_EVENT_UPSTREAM,
|
|
|
|
(GstPadProbeCallback) on_source1_pad_event_cb, NULL, NULL);
|
|
|
|
gst_object_unref (srcpad);
|
|
|
|
|
|
|
|
/* Add nested source */
|
|
|
|
nle_composition_add (GST_BIN (comp), nested_source);
|
|
|
|
commit_and_wait (comp, &ret);
|
|
|
|
check_start_stop_duration (comp, 0, 2 * GST_SECOND, 2 * GST_SECOND);
|
|
|
|
|
|
|
|
bus = gst_element_get_bus (GST_ELEMENT (pipeline));
|
|
|
|
|
|
|
|
fail_if (gst_element_set_state (GST_ELEMENT (pipeline),
|
|
|
|
GST_STATE_PAUSED) == GST_STATE_CHANGE_FAILURE);
|
|
|
|
|
|
|
|
GST_DEBUG ("Let's poll the bus");
|
|
|
|
|
|
|
|
carry_on = TRUE;
|
|
|
|
while (carry_on) {
|
|
|
|
message = gst_bus_poll (bus, GST_MESSAGE_ANY, GST_SECOND / 10);
|
|
|
|
if (message) {
|
|
|
|
switch (GST_MESSAGE_TYPE (message)) {
|
|
|
|
case GST_MESSAGE_ASYNC_DONE:
|
|
|
|
{
|
|
|
|
carry_on = FALSE;
|
|
|
|
GST_DEBUG ("Pipeline reached PAUSED, stopping polling");
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case GST_MESSAGE_EOS:
|
|
|
|
{
|
|
|
|
GST_WARNING ("Saw EOS");
|
|
|
|
|
|
|
|
fail_if (TRUE);
|
|
|
|
}
|
|
|
|
case GST_MESSAGE_ERROR:
|
|
|
|
GST_DEBUG_BIN_TO_DOT_FILE (GST_BIN (pipeline),
|
|
|
|
GST_DEBUG_GRAPH_SHOW_ALL, "error");
|
|
|
|
fail_error_message (message);
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
gst_mini_object_unref (GST_MINI_OBJECT (message));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
GST_ELEMENT_ERROR (nested_source, STREAM, FAILED,
|
|
|
|
("Faking an error message"), ("Nothing"));
|
|
|
|
|
|
|
|
message =
|
|
|
|
gst_bus_timed_pop_filtered (bus, GST_CLOCK_TIME_NONE, GST_MESSAGE_ERROR);
|
|
|
|
gst_mini_object_unref (GST_MINI_OBJECT (message));
|
|
|
|
|
|
|
|
fail_if (gst_element_set_state (GST_ELEMENT (pipeline),
|
|
|
|
GST_STATE_NULL) == GST_STATE_CHANGE_FAILURE);
|
|
|
|
|
|
|
|
GST_DEBUG ("Resetted pipeline to NULL");
|
|
|
|
|
2019-06-09 23:35:21 +00:00
|
|
|
ASSERT_OBJECT_REFCOUNT_BETWEEN (bus, "main bus", 1, 2);
|
|
|
|
gst_object_unref (bus);
|
|
|
|
|
|
|
|
ges_deinit ();
|
|
|
|
}
|
|
|
|
|
|
|
|
GST_END_TEST;
|
|
|
|
|
2019-07-03 14:10:42 +00:00
|
|
|
GST_START_TEST (test_nest_deep)
|
|
|
|
{
|
|
|
|
GstBus *bus;
|
|
|
|
GstPad *srcpad;
|
|
|
|
GstElement *pipeline, *comp, *nested_source, *sink;
|
|
|
|
GstMessage *message;
|
|
|
|
gboolean carry_on, ret = FALSE;
|
|
|
|
GstClockTime position;
|
|
|
|
|
|
|
|
ges_init ();
|
|
|
|
|
|
|
|
pipeline = gst_pipeline_new ("test_pipeline");
|
|
|
|
comp = gst_element_factory_make_or_warn ("nlecomposition", NULL);
|
|
|
|
|
|
|
|
gst_element_set_state (comp, GST_STATE_READY);
|
2021-05-20 15:47:41 +00:00
|
|
|
sink = gst_element_factory_make_or_warn ("fakevideosink", "sink");
|
2023-06-21 14:24:12 +00:00
|
|
|
g_object_set (sink, "sync", FALSE, NULL);
|
2019-07-03 14:10:42 +00:00
|
|
|
gst_bin_add_many (GST_BIN (pipeline), comp, sink, NULL);
|
|
|
|
|
|
|
|
gst_element_link (comp, sink);
|
|
|
|
|
|
|
|
nested_source = create_nested_source (2);
|
|
|
|
srcpad = gst_element_get_static_pad (nested_source, "src");
|
|
|
|
gst_pad_add_probe (srcpad, GST_PAD_PROBE_TYPE_EVENT_UPSTREAM,
|
|
|
|
(GstPadProbeCallback) on_source1_pad_event_cb, NULL, NULL);
|
|
|
|
gst_object_unref (srcpad);
|
|
|
|
|
|
|
|
/* Add nested source */
|
|
|
|
nle_composition_add (GST_BIN (comp), nested_source);
|
|
|
|
commit_and_wait (comp, &ret);
|
|
|
|
check_start_stop_duration (comp, 0, 2 * GST_SECOND, 2 * GST_SECOND);
|
|
|
|
|
|
|
|
bus = gst_element_get_bus (GST_ELEMENT (pipeline));
|
|
|
|
|
|
|
|
fail_if (gst_element_set_state (GST_ELEMENT (pipeline),
|
|
|
|
GST_STATE_PAUSED) == GST_STATE_CHANGE_FAILURE);
|
|
|
|
|
|
|
|
GST_DEBUG ("Let's poll the bus");
|
|
|
|
|
|
|
|
carry_on = TRUE;
|
|
|
|
while (carry_on) {
|
|
|
|
message = gst_bus_poll (bus, GST_MESSAGE_ANY, GST_SECOND / 10);
|
|
|
|
GST_DEBUG_BIN_TO_DOT_FILE (GST_BIN (pipeline),
|
|
|
|
GST_DEBUG_GRAPH_SHOW_ALL, "nothing");
|
|
|
|
if (message) {
|
|
|
|
switch (GST_MESSAGE_TYPE (message)) {
|
|
|
|
case GST_MESSAGE_ASYNC_DONE:
|
|
|
|
{
|
|
|
|
carry_on = FALSE;
|
|
|
|
GST_DEBUG ("Pipeline reached PAUSED, stopping polling");
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case GST_MESSAGE_EOS:
|
|
|
|
{
|
|
|
|
GST_WARNING ("Saw EOS");
|
|
|
|
|
|
|
|
fail_if (TRUE);
|
|
|
|
}
|
|
|
|
case GST_MESSAGE_ERROR:
|
|
|
|
GST_DEBUG_BIN_TO_DOT_FILE (GST_BIN (pipeline),
|
|
|
|
GST_DEBUG_GRAPH_SHOW_ALL, "error");
|
|
|
|
fail_error_message (message);
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
gst_mini_object_unref (GST_MINI_OBJECT (message));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
gst_element_seek_simple (pipeline,
|
|
|
|
GST_FORMAT_TIME,
|
|
|
|
GST_SEEK_FLAG_FLUSH | GST_SEEK_FLAG_ACCURATE, 1 * GST_SECOND);
|
|
|
|
|
|
|
|
message = gst_bus_timed_pop_filtered (bus, GST_CLOCK_TIME_NONE,
|
|
|
|
GST_MESSAGE_ASYNC_DONE | GST_MESSAGE_ERROR);
|
|
|
|
gst_mini_object_unref (GST_MINI_OBJECT (message));
|
|
|
|
|
|
|
|
ret =
|
|
|
|
gst_element_query_position (GST_ELEMENT (pipeline), GST_FORMAT_TIME,
|
|
|
|
(gint64 *) & position);
|
|
|
|
fail_unless_equals_uint64 (position, 1 * GST_SECOND);
|
|
|
|
|
|
|
|
GST_DEBUG ("Setting pipeline to NULL");
|
|
|
|
|
|
|
|
fail_if (gst_element_set_state (GST_ELEMENT (pipeline),
|
|
|
|
GST_STATE_NULL) == GST_STATE_CHANGE_FAILURE);
|
|
|
|
|
|
|
|
GST_DEBUG ("Resetted pipeline to NULL");
|
|
|
|
|
|
|
|
ASSERT_OBJECT_REFCOUNT_BETWEEN (pipeline, "main pipeline", 1, 2);
|
|
|
|
gst_check_objects_destroyed_on_unref (pipeline, comp, nested_source, NULL);
|
|
|
|
ASSERT_OBJECT_REFCOUNT_BETWEEN (bus, "main bus", 1, 2);
|
|
|
|
gst_object_unref (bus);
|
|
|
|
|
|
|
|
ges_deinit ();
|
|
|
|
}
|
|
|
|
|
|
|
|
GST_END_TEST;
|
|
|
|
|
|
|
|
|
2019-06-09 23:35:21 +00:00
|
|
|
|
2014-10-21 08:35:48 +00:00
|
|
|
static Suite *
|
|
|
|
gnonlin_suite (void)
|
|
|
|
{
|
2014-08-15 13:48:14 +00:00
|
|
|
Suite *s = suite_create ("nlecomposition");
|
|
|
|
TCase *tc_chain = tcase_create ("nlecomposition");
|
2014-10-21 08:35:48 +00:00
|
|
|
|
|
|
|
suite_add_tcase (s, tc_chain);
|
|
|
|
|
|
|
|
tcase_add_test (tc_chain, test_change_object_start_stop_in_current_stack);
|
|
|
|
tcase_add_test (tc_chain, test_remove_invalid_object);
|
2015-02-03 11:02:42 +00:00
|
|
|
tcase_add_test (tc_chain, test_remove_last_object);
|
2019-06-09 23:35:21 +00:00
|
|
|
tcase_add_test (tc_chain, test_seek_on_nested);
|
2019-06-17 22:23:43 +00:00
|
|
|
tcase_add_test (tc_chain, test_error_in_nested_timeline);
|
2019-07-03 14:10:42 +00:00
|
|
|
tcase_add_test (tc_chain, test_nest_deep);
|
2014-10-21 08:35:48 +00:00
|
|
|
|
2014-07-11 19:58:41 +00:00
|
|
|
tcase_add_test (tc_chain, test_dispose_on_commit);
|
|
|
|
|
2014-10-06 10:30:17 +00:00
|
|
|
if (gst_registry_check_feature_version (gst_registry_get (), "audiomixer", 1,
|
2014-10-21 08:35:48 +00:00
|
|
|
0, 0)) {
|
2014-10-06 10:30:17 +00:00
|
|
|
tcase_add_test (tc_chain, test_simple_audiomixer);
|
2014-10-21 08:35:48 +00:00
|
|
|
} else {
|
2014-10-06 10:30:17 +00:00
|
|
|
GST_WARNING ("audiomixer element not available, skipping 1 test");
|
2014-10-21 08:35:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return s;
|
|
|
|
}
|
|
|
|
|
|
|
|
GST_CHECK_MAIN (gnonlin)
|