summaryrefslogtreecommitdiffstats
path: root/tests/check/pipelines
diff options
context:
space:
mode:
authorSebastian Dröge <slomo@circular-chaos.org>2008-01-06 16:36:32 +0000
committerSebastian Dröge <slomo@circular-chaos.org>2008-01-06 16:36:32 +0000
commit815666e762e6ff17aea1f505eee67c38193e6b86 (patch)
tree4a29297230964cd500f2b5671239c683611369b2 /tests/check/pipelines
parentb37e08cb29ddca72161a8098690ba52e5594153d (diff)
downloadgst-plugins-bad-815666e762e6ff17aea1f505eee67c38193e6b86.tar.gz
gst-plugins-bad-815666e762e6ff17aea1f505eee67c38193e6b86.tar.bz2
gst-plugins-bad-815666e762e6ff17aea1f505eee67c38193e6b86.zip
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.
Diffstat (limited to 'tests/check/pipelines')
-rw-r--r--tests/check/pipelines/gio.c17
1 files changed, 15 insertions, 2 deletions
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);