From 815666e762e6ff17aea1f505eee67c38193e6b86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Sun, 6 Jan 2008 16:36:32 +0000 Subject: Update to GMemoryInputStream API changes in GLib SVN and require gio-2.0 >= 2.15.1 for this. Fixes bug #507584. Original commit message from CVS: * configure.ac: * ext/gio/gstgiobasesrc.c: (gst_gio_base_src_get_size): * tests/check/pipelines/gio.c: (free_input), (GST_START_TEST): Update to GMemoryInputStream API changes in GLib SVN and require gio-2.0 >= 2.15.1 for this. Fixes bug #507584. We can also report the duration for every GSeekable, not only GFileInputStream and GMemoryInputStream. --- tests/check/pipelines/gio.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'tests/check') diff --git a/tests/check/pipelines/gio.c b/tests/check/pipelines/gio.c index 8791b332..0cc7ac20 100644 --- a/tests/check/pipelines/gio.c +++ b/tests/check/pipelines/gio.c @@ -57,6 +57,12 @@ message_handler (GstBus * bus, GstMessage * msg, gpointer data) return TRUE; } +static void +free_input (gpointer data) +{ + g_free (data); +} + GST_START_TEST (test_memory_stream) { GMainLoop *loop; @@ -70,6 +76,8 @@ GST_START_TEST (test_memory_stream) guint8 *in_data; GByteArray *out_data; gint i; + GstFormat fmt = GST_FORMAT_BYTES; + gint64 duration; got_eos = FALSE; @@ -78,8 +86,8 @@ GST_START_TEST (test_memory_stream) in_data[i] = i % 256; input = - G_MEMORY_INPUT_STREAM (g_memory_input_stream_from_data (in_data, 512)); - g_memory_input_stream_set_free_data (input, TRUE); + G_MEMORY_INPUT_STREAM (g_memory_input_stream_new_from_data (in_data, 512, + free_input)); out_data = g_byte_array_new (); output = G_MEMORY_OUTPUT_STREAM (g_memory_output_stream_new (out_data)); @@ -105,6 +113,11 @@ GST_START_TEST (test_memory_stream) gst_bus_add_watch (bus, message_handler, loop); gst_object_unref (bus); + gst_element_set_state (bin, GST_STATE_PAUSED); + + fail_unless (gst_element_query_duration (bin, &fmt, &duration)); + fail_unless_equals_int (duration, 512); + gst_element_set_state (bin, GST_STATE_PLAYING); g_main_loop_run (loop); -- cgit v1.2.1