Commit 3e8ae760 authored by Wim Taymans's avatar Wim Taymans
Browse files

tests: update for memory api changes

parent 846f3095
......@@ -109,7 +109,9 @@ GST_START_TEST (test_passthrough)
fail_unless (gst_pad_set_caps (mysrcpad, caps));
gst_caps_unref (caps);
inbuffer = gst_buffer_new_wrapped_full (in, NULL, 0, 12);
inbuffer =
gst_buffer_new_wrapped_full (GST_MEMORY_FLAG_READONLY, in, 12, 0, 12,
NULL, NULL);
fail_unless (gst_buffer_memcmp (inbuffer, 0, in, 12) == 0);
ASSERT_BUFFER_REFCOUNT (inbuffer, "inbuffer", 1);
......@@ -151,7 +153,9 @@ GST_START_TEST (test_zero)
fail_unless (gst_pad_set_caps (mysrcpad, caps));
gst_caps_unref (caps);
inbuffer = gst_buffer_new_wrapped_full (in, NULL, 0, 12);
inbuffer =
gst_buffer_new_wrapped_full (GST_MEMORY_FLAG_READONLY, in, 12, 0, 12,
NULL, NULL);
fail_unless (gst_buffer_memcmp (inbuffer, 0, in, 12) == 0);
ASSERT_BUFFER_REFCOUNT (inbuffer, "inbuffer", 1);
......@@ -193,7 +197,9 @@ GST_START_TEST (test_050_clip)
fail_unless (gst_pad_set_caps (mysrcpad, caps));
gst_caps_unref (caps);
inbuffer = gst_buffer_new_wrapped_full (in, NULL, 0, 12);
inbuffer =
gst_buffer_new_wrapped_full (GST_MEMORY_FLAG_READONLY, in, 12, 0, 12,
NULL, NULL);
fail_unless (gst_buffer_memcmp (inbuffer, 0, in, 12) == 0);
ASSERT_BUFFER_REFCOUNT (inbuffer, "inbuffer", 1);
......@@ -235,7 +241,9 @@ GST_START_TEST (test_200_clip)
fail_unless (gst_pad_set_caps (mysrcpad, caps));
gst_caps_unref (caps);
inbuffer = gst_buffer_new_wrapped_full (in, NULL, 0, 12);
inbuffer =
gst_buffer_new_wrapped_full (GST_MEMORY_FLAG_READONLY, in, 12, 0, 12,
NULL, NULL);
fail_unless (gst_buffer_memcmp (inbuffer, 0, in, 12) == 0);
ASSERT_BUFFER_REFCOUNT (inbuffer, "inbuffer", 1);
......@@ -278,7 +286,9 @@ GST_START_TEST (test_050_wrap_negative)
fail_unless (gst_pad_set_caps (mysrcpad, caps));
gst_caps_unref (caps);
inbuffer = gst_buffer_new_wrapped_full (in, NULL, 0, 12);
inbuffer =
gst_buffer_new_wrapped_full (GST_MEMORY_FLAG_READONLY, in, 12, 0, 12,
NULL, NULL);
fail_unless (gst_buffer_memcmp (inbuffer, 0, in, 12) == 0);
ASSERT_BUFFER_REFCOUNT (inbuffer, "inbuffer", 1);
......@@ -321,7 +331,9 @@ GST_START_TEST (test_200_wrap_negative)
fail_unless (gst_pad_set_caps (mysrcpad, caps));
gst_caps_unref (caps);
inbuffer = gst_buffer_new_wrapped_full (in, NULL, 0, 12);
inbuffer =
gst_buffer_new_wrapped_full (GST_MEMORY_FLAG_READONLY, in, 12, 0, 12,
NULL, NULL);
fail_unless (gst_buffer_memcmp (inbuffer, 0, in, 12) == 0);
ASSERT_BUFFER_REFCOUNT (inbuffer, "inbuffer", 1);
......@@ -364,7 +376,9 @@ GST_START_TEST (test_050_wrap_positive)
fail_unless (gst_pad_set_caps (mysrcpad, caps));
gst_caps_unref (caps);
inbuffer = gst_buffer_new_wrapped_full (in, NULL, 0, 12);
inbuffer =
gst_buffer_new_wrapped_full (GST_MEMORY_FLAG_READONLY, in, 12, 0, 12,
NULL, NULL);
fail_unless (gst_buffer_memcmp (inbuffer, 0, in, 12) == 0);
ASSERT_BUFFER_REFCOUNT (inbuffer, "inbuffer", 1);
......@@ -407,7 +421,9 @@ GST_START_TEST (test_200_wrap_positive)
fail_unless (gst_pad_set_caps (mysrcpad, caps));
gst_caps_unref (caps);
inbuffer = gst_buffer_new_wrapped_full (in, NULL, 0, 12);
inbuffer =
gst_buffer_new_wrapped_full (GST_MEMORY_FLAG_READONLY, in, 12, 0, 12,
NULL, NULL);
fail_unless (gst_buffer_memcmp (inbuffer, 0, in, 12) == 0);
ASSERT_BUFFER_REFCOUNT (inbuffer, "inbuffer", 1);
......
......@@ -105,7 +105,9 @@ GST_START_TEST (test_passthrough)
GST_STATE_PLAYING) == GST_STATE_CHANGE_SUCCESS,
"could not set to playing");
inbuffer = gst_buffer_new_wrapped_full (in, NULL, 0, 12);
inbuffer =
gst_buffer_new_wrapped_full (GST_MEMORY_FLAG_READONLY, in, 12, 0, 12,
NULL, NULL);
fail_unless (gst_buffer_memcmp (inbuffer, 0, in, 12) == 0);
caps = gst_caps_from_string (DYNAMIC_CAPS_STRING);
fail_unless (gst_pad_set_caps (mysrcpad, caps));
......@@ -148,7 +150,9 @@ GST_START_TEST (test_compress_hard_50_50)
GST_STATE_PLAYING) == GST_STATE_CHANGE_SUCCESS,
"could not set to playing");
inbuffer = gst_buffer_new_wrapped_full (in, NULL, 0, 16);
inbuffer =
gst_buffer_new_wrapped_full (GST_MEMORY_FLAG_READONLY, in, 16, 0, 16,
NULL, NULL);
fail_unless (gst_buffer_memcmp (inbuffer, 0, in, 16) == 0);
caps = gst_caps_from_string (DYNAMIC_CAPS_STRING);
fail_unless (gst_pad_set_caps (mysrcpad, caps));
......@@ -195,7 +199,9 @@ GST_START_TEST (test_compress_soft_50_50)
GST_STATE_PLAYING) == GST_STATE_CHANGE_SUCCESS,
"could not set to playing");
inbuffer = gst_buffer_new_wrapped_full (in, NULL, 0, 16);
inbuffer =
gst_buffer_new_wrapped_full (GST_MEMORY_FLAG_READONLY, in, 16, 0, 16,
NULL, NULL);
fail_unless (gst_buffer_memcmp (inbuffer, 0, in, 16) == 0);
caps = gst_caps_from_string (DYNAMIC_CAPS_STRING);
fail_unless (gst_pad_set_caps (mysrcpad, caps));
......@@ -242,7 +248,9 @@ GST_START_TEST (test_compress_hard_100_50)
GST_STATE_PLAYING) == GST_STATE_CHANGE_SUCCESS,
"could not set to playing");
inbuffer = gst_buffer_new_wrapped_full (in, NULL, 0, 16);
inbuffer =
gst_buffer_new_wrapped_full (GST_MEMORY_FLAG_READONLY, in, 16, 0, 16,
NULL, NULL);
fail_unless (gst_buffer_memcmp (inbuffer, 0, in, 16) == 0);
caps = gst_caps_from_string (DYNAMIC_CAPS_STRING);
fail_unless (gst_pad_set_caps (mysrcpad, caps));
......@@ -290,7 +298,9 @@ GST_START_TEST (test_expand_hard_50_200)
GST_STATE_PLAYING) == GST_STATE_CHANGE_SUCCESS,
"could not set to playing");
inbuffer = gst_buffer_new_wrapped_full (in, NULL, 0, 16);
inbuffer =
gst_buffer_new_wrapped_full (GST_MEMORY_FLAG_READONLY, in, 16, 0, 16,
NULL, NULL);
fail_unless (gst_buffer_memcmp (inbuffer, 0, in, 16) == 0);
caps = gst_caps_from_string (DYNAMIC_CAPS_STRING);
fail_unless (gst_pad_set_caps (mysrcpad, caps));
......@@ -337,7 +347,9 @@ GST_START_TEST (test_expand_soft_50_200)
GST_STATE_PLAYING) == GST_STATE_CHANGE_SUCCESS,
"could not set to playing");
inbuffer = gst_buffer_new_wrapped_full (in, NULL, 0, 16);
inbuffer =
gst_buffer_new_wrapped_full (GST_MEMORY_FLAG_READONLY, in, 16, 0, 16,
NULL, NULL);
fail_unless (gst_buffer_memcmp (inbuffer, 0, in, 16) == 0);
caps = gst_caps_from_string (DYNAMIC_CAPS_STRING);
fail_unless (gst_pad_set_caps (mysrcpad, caps));
......@@ -384,7 +396,9 @@ GST_START_TEST (test_expand_hard_0_200)
GST_STATE_PLAYING) == GST_STATE_CHANGE_SUCCESS,
"could not set to playing");
inbuffer = gst_buffer_new_wrapped_full (in, NULL, 0, 16);
inbuffer =
gst_buffer_new_wrapped_full (GST_MEMORY_FLAG_READONLY, in, 16, 0, 16,
NULL, NULL);
fail_unless (gst_buffer_memcmp (inbuffer, 0, in, 16) == 0);
caps = gst_caps_from_string (DYNAMIC_CAPS_STRING);
fail_unless (gst_pad_set_caps (mysrcpad, caps));
......
......@@ -103,7 +103,9 @@ GST_START_TEST (test_passthrough)
fail_unless (gst_pad_set_caps (mysrcpad, caps));
gst_caps_unref (caps);
inbuffer = gst_buffer_new_wrapped_full (in, NULL, 0, sizeof (in));
inbuffer =
gst_buffer_new_wrapped_full (GST_MEMORY_FLAG_READONLY, in, sizeof (in), 0,
sizeof (in), NULL, NULL);
fail_unless (gst_buffer_memcmp (inbuffer, 0, in, sizeof (in)) == 0);
ASSERT_BUFFER_REFCOUNT (inbuffer, "inbuffer", 1);
......@@ -147,7 +149,9 @@ GST_START_TEST (test_echo)
fail_unless (gst_pad_set_caps (mysrcpad, caps));
gst_caps_unref (caps);
inbuffer = gst_buffer_new_wrapped_full (in, NULL, 0, sizeof (in));
inbuffer =
gst_buffer_new_wrapped_full (GST_MEMORY_FLAG_READONLY, in, sizeof (in), 0,
sizeof (in), NULL, NULL);
fail_unless (gst_buffer_memcmp (inbuffer, 0, in, sizeof (in)) == 0);
ASSERT_BUFFER_REFCOUNT (inbuffer, "inbuffer", 1);
......@@ -192,7 +196,9 @@ GST_START_TEST (test_feedback)
fail_unless (gst_pad_set_caps (mysrcpad, caps));
gst_caps_unref (caps);
inbuffer = gst_buffer_new_wrapped_full (in, NULL, 0, sizeof (in));
inbuffer =
gst_buffer_new_wrapped_full (GST_MEMORY_FLAG_READONLY, in, sizeof (in), 0,
sizeof (in), NULL, NULL);
fail_unless (gst_buffer_memcmp (inbuffer, 0, in, sizeof (in)) == 0);
ASSERT_BUFFER_REFCOUNT (inbuffer, "inbuffer", 1);
......
......@@ -149,7 +149,9 @@ GST_START_TEST (test_mono_middle)
fail_unless (gst_pad_set_caps (mysrcpad, caps));
gst_caps_unref (caps);
inbuffer = gst_buffer_new_wrapped_full (in, NULL, 0, 4);
inbuffer =
gst_buffer_new_wrapped_full (GST_MEMORY_FLAG_READONLY, in, sizeof (in), 0,
sizeof (in), NULL, NULL);
ASSERT_BUFFER_REFCOUNT (inbuffer, "inbuffer", 1);
/* pushing gives away my reference ... */
......@@ -188,7 +190,9 @@ GST_START_TEST (test_mono_left)
fail_unless (gst_pad_set_caps (mysrcpad, caps));
gst_caps_unref (caps);
inbuffer = gst_buffer_new_wrapped_full (in, NULL, 0, 4);
inbuffer =
gst_buffer_new_wrapped_full (GST_MEMORY_FLAG_READONLY, in, sizeof (in), 0,
sizeof (in), NULL, NULL);
fail_unless (gst_buffer_memcmp (inbuffer, 0, in, 4) == 0);
ASSERT_BUFFER_REFCOUNT (inbuffer, "inbuffer", 1);
......@@ -228,7 +232,9 @@ GST_START_TEST (test_mono_right)
fail_unless (gst_pad_set_caps (mysrcpad, caps));
gst_caps_unref (caps);
inbuffer = gst_buffer_new_wrapped_full (in, NULL, 0, 4);
inbuffer =
gst_buffer_new_wrapped_full (GST_MEMORY_FLAG_READONLY, in, sizeof (in), 0,
sizeof (in), NULL, NULL);
fail_unless (gst_buffer_memcmp (inbuffer, 0, in, 4) == 0);
ASSERT_BUFFER_REFCOUNT (inbuffer, "inbuffer", 1);
......@@ -266,7 +272,9 @@ GST_START_TEST (test_stereo_middle)
fail_unless (gst_pad_set_caps (mysrcpad, caps));
gst_caps_unref (caps);
inbuffer = gst_buffer_new_wrapped_full (in, NULL, 0, 8);
inbuffer =
gst_buffer_new_wrapped_full (GST_MEMORY_FLAG_READONLY, in, sizeof (in), 0,
sizeof (in), NULL, NULL);
ASSERT_BUFFER_REFCOUNT (inbuffer, "inbuffer", 1);
/* pushing gives away my reference ... */
......@@ -305,7 +313,9 @@ GST_START_TEST (test_stereo_left)
fail_unless (gst_pad_set_caps (mysrcpad, caps));
gst_caps_unref (caps);
inbuffer = gst_buffer_new_wrapped_full (in, NULL, 0, 8);
inbuffer =
gst_buffer_new_wrapped_full (GST_MEMORY_FLAG_READONLY, in, sizeof (in), 0,
sizeof (in), NULL, NULL);
fail_unless (gst_buffer_memcmp (inbuffer, 0, in, 8) == 0);
ASSERT_BUFFER_REFCOUNT (inbuffer, "inbuffer", 1);
......@@ -345,7 +355,9 @@ GST_START_TEST (test_stereo_right)
fail_unless (gst_pad_set_caps (mysrcpad, caps));
gst_caps_unref (caps);
inbuffer = gst_buffer_new_wrapped_full (in, NULL, 0, 8);
inbuffer =
gst_buffer_new_wrapped_full (GST_MEMORY_FLAG_READONLY, in, sizeof (in), 0,
sizeof (in), NULL, NULL);
fail_unless (gst_buffer_memcmp (inbuffer, 0, in, 8) == 0);
ASSERT_BUFFER_REFCOUNT (inbuffer, "inbuffer", 1);
......@@ -381,7 +393,9 @@ GST_START_TEST (test_mono_middle_simple)
GST_STATE_PLAYING) == GST_STATE_CHANGE_SUCCESS,
"could not set to playing");
inbuffer = gst_buffer_new_wrapped_full (in, NULL, 0, 4);
inbuffer =
gst_buffer_new_wrapped_full (GST_MEMORY_FLAG_READONLY, in, sizeof (in), 0,
sizeof (in), NULL, NULL);
caps = gst_caps_from_string (PANORAMA_MONO_CAPS_STRING);
fail_unless (gst_pad_set_caps (mysrcpad, caps));
gst_caps_unref (caps);
......@@ -420,7 +434,9 @@ GST_START_TEST (test_mono_left_simple)
GST_STATE_PLAYING) == GST_STATE_CHANGE_SUCCESS,
"could not set to playing");
inbuffer = gst_buffer_new_wrapped_full (in, NULL, 0, 4);
inbuffer =
gst_buffer_new_wrapped_full (GST_MEMORY_FLAG_READONLY, in, sizeof (in), 0,
sizeof (in), NULL, NULL);
fail_unless (gst_buffer_memcmp (inbuffer, 0, in, 4) == 0);
caps = gst_caps_from_string (PANORAMA_MONO_CAPS_STRING);
fail_unless (gst_pad_set_caps (mysrcpad, caps));
......@@ -460,7 +476,9 @@ GST_START_TEST (test_mono_right_simple)
GST_STATE_PLAYING) == GST_STATE_CHANGE_SUCCESS,
"could not set to playing");
inbuffer = gst_buffer_new_wrapped_full (in, NULL, 0, 4);
inbuffer =
gst_buffer_new_wrapped_full (GST_MEMORY_FLAG_READONLY, in, sizeof (in), 0,
sizeof (in), NULL, NULL);
fail_unless (gst_buffer_memcmp (inbuffer, 0, in, 4) == 0);
caps = gst_caps_from_string (PANORAMA_MONO_CAPS_STRING);
fail_unless (gst_pad_set_caps (mysrcpad, caps));
......@@ -498,7 +516,9 @@ GST_START_TEST (test_stereo_middle_simple)
GST_STATE_PLAYING) == GST_STATE_CHANGE_SUCCESS,
"could not set to playing");
inbuffer = gst_buffer_new_wrapped_full (in, NULL, 0, 8);
inbuffer =
gst_buffer_new_wrapped_full (GST_MEMORY_FLAG_READONLY, in, sizeof (in), 0,
sizeof (in), NULL, NULL);
caps = gst_caps_from_string (PANORAMA_STEREO_CAPS_STRING);
fail_unless (gst_pad_set_caps (mysrcpad, caps));
gst_caps_unref (caps);
......@@ -537,7 +557,9 @@ GST_START_TEST (test_stereo_left_simple)
GST_STATE_PLAYING) == GST_STATE_CHANGE_SUCCESS,
"could not set to playing");
inbuffer = gst_buffer_new_wrapped_full (in, NULL, 0, 8);
inbuffer =
gst_buffer_new_wrapped_full (GST_MEMORY_FLAG_READONLY, in, sizeof (in), 0,
sizeof (in), NULL, NULL);
fail_unless (gst_buffer_memcmp (inbuffer, 0, in, 8) == 0);
caps = gst_caps_from_string (PANORAMA_STEREO_CAPS_STRING);
fail_unless (gst_pad_set_caps (mysrcpad, caps));
......@@ -577,7 +599,9 @@ GST_START_TEST (test_stereo_right_simple)
GST_STATE_PLAYING) == GST_STATE_CHANGE_SUCCESS,
"could not set to playing");
inbuffer = gst_buffer_new_wrapped_full (in, NULL, 0, 8);
inbuffer =
gst_buffer_new_wrapped_full (GST_MEMORY_FLAG_READONLY, in, sizeof (in), 0,
sizeof (in), NULL, NULL);
fail_unless (gst_buffer_memcmp (inbuffer, 0, in, 8) == 0);
caps = gst_caps_from_string (PANORAMA_STEREO_CAPS_STRING);
fail_unless (gst_pad_set_caps (mysrcpad, caps));
......@@ -617,7 +641,9 @@ GST_START_TEST (test_wrong_caps)
GST_STATE_PLAYING) == GST_STATE_CHANGE_SUCCESS,
"could not set to playing");
inbuffer = gst_buffer_new_wrapped_full (in, NULL, 0, 4);
inbuffer =
gst_buffer_new_wrapped_full (GST_MEMORY_FLAG_READONLY, in, sizeof (in), 0,
sizeof (in), NULL, NULL);
ASSERT_BUFFER_REFCOUNT (inbuffer, "inbuffer", 1);
gst_buffer_ref (inbuffer);
......
......@@ -253,8 +253,9 @@ rtp_pipeline_run (rtp_pipeline * p)
GstBuffer *buf;
buf =
gst_buffer_new_wrapped_full ((guint8 *) data, NULL, 0,
p->frame_data_size);
gst_buffer_new_wrapped_full (GST_MEMORY_FLAG_READONLY,
(guint8 *) data, p->frame_data_size, 0, p->frame_data_size, NULL,
NULL);
g_signal_emit_by_name (p->appsrc, "push-buffer", buf, &flow_ret);
fail_unless_equals_int (flow_ret, GST_FLOW_OK);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment