5
* Copyright 2009 Collabora Ltd.
6
* @author: Olivier Crete <olivier.crete@collabora.co.uk>
7
* Copyright 2009 Nokia Corp.
9
* This library is free software; you can redistribute it and/or
10
* modify it under the terms of the GNU Library General Public
11
* License as published by the Free Software Foundation; either
12
* version 2 of the License, or (at your option) any later version.
14
* This library is distributed in the hope that it will be useful,
15
* but WITHOUT ANY WARRANTY; without even the implied warranty of
16
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17
* Library General Public License for more details.
19
* You should have received a copy of the GNU Library General Public
20
* License along with this library; if not, write to the
21
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
22
* Boston, MA 02111-1307, USA.
25
#include <gst/check/gstcheck.h>
27
static GMainLoop *loop;
30
eos_message_cb (GstBus * bus, GstMessage * message, gpointer user_data)
32
GST_DEBUG ("Received eos");
33
g_main_loop_quit (loop);
36
GST_START_TEST (test_mimic_pipeline)
41
const gchar *bin_str = "videotestsrc num-buffers=10 ! mimenc ! "
44
pipeline = gst_parse_launch (bin_str, &error);
45
fail_unless (pipeline != NULL, "Error parsing pipeline: %s", bin_str,
46
error ? error->message : "(invalid error)");
48
loop = g_main_loop_new (NULL, FALSE);
49
bus = gst_element_get_bus (pipeline);
50
gst_bus_add_signal_watch (bus);
51
g_signal_connect (bus, "message::eos", (GCallback) eos_message_cb, NULL);
52
gst_object_unref (bus);
54
fail_unless (gst_element_set_state (pipeline, GST_STATE_PLAYING)
55
!= GST_STATE_CHANGE_FAILURE);
57
g_main_loop_run (loop);
58
g_main_loop_unref (loop);
60
gst_element_set_state (pipeline, GST_STATE_NULL);
61
gst_object_unref (pipeline);
69
Suite *s = suite_create ("mimic");
72
tc_chain = tcase_create ("mimic_pipeline");
73
tcase_add_test (tc_chain, test_mimic_pipeline);
74
suite_add_tcase (s, tc_chain);
79
GST_CHECK_MAIN (mimic)