tests: Fix event order and missing events

This commit is contained in:
Sebastian Dröge 2013-05-10 12:29:15 +02:00
parent b19d64d785
commit d8a3895ac9
13 changed files with 165 additions and 142 deletions

View file

@ -914,13 +914,7 @@ GST_START_TEST (test_clip)
sinkpad = gst_element_get_request_pad (adder, "sink_%u");
fail_if (sinkpad == NULL, NULL);
/* send segment to adder */
gst_segment_init (&segment, GST_FORMAT_TIME);
segment.start = GST_SECOND;
segment.stop = 2 * GST_SECOND;
segment.time = 0;
event = gst_event_new_segment (&segment);
gst_pad_send_event (sinkpad, event);
gst_pad_send_event (sinkpad, gst_event_new_stream_start ("test"));
caps = gst_caps_new_simple ("audio/x-raw",
#if G_BYTE_ORDER == G_BIG_ENDIAN
@ -934,6 +928,14 @@ GST_START_TEST (test_clip)
gst_pad_set_caps (sinkpad, caps);
gst_caps_unref (caps);
/* send segment to adder */
gst_segment_init (&segment, GST_FORMAT_TIME);
segment.start = GST_SECOND;
segment.stop = 2 * GST_SECOND;
segment.time = 0;
event = gst_event_new_segment (&segment);
gst_pad_send_event (sinkpad, event);
/* should be clipped and ok */
buffer = gst_buffer_new_and_alloc (44100);
GST_BUFFER_TIMESTAMP (buffer) = 0;

View file

@ -35,12 +35,17 @@ static GstElement *
setup_appsink (void)
{
GstElement *appsink;
GstCaps *caps;
GST_DEBUG ("setup_appsink");
appsink = gst_check_setup_element ("appsink");
mysrcpad = gst_check_setup_src_pad (appsink, &srctemplate);
gst_pad_set_active (mysrcpad, TRUE);
caps = gst_caps_new_empty_simple ("application/x-gst-check");
gst_check_setup_events (mysrcpad, appsink, caps, GST_FORMAT_TIME);
gst_caps_unref (caps);
return appsink;
}
@ -81,16 +86,12 @@ GST_START_TEST (test_non_clients)
{
GstElement *sink;
GstBuffer *buffer;
GstCaps *caps;
sink = setup_appsink ();
ASSERT_SET_STATE (sink, GST_STATE_PLAYING, GST_STATE_CHANGE_ASYNC);
caps = gst_caps_from_string ("application/x-gst-check");
buffer = gst_buffer_new_and_alloc (4);
gst_pad_set_caps (mysrcpad, caps);
gst_caps_unref (caps);
fail_unless (gst_pad_push (mysrcpad, buffer) == GST_FLOW_OK);
GST_DEBUG ("cleaning up appsink");
@ -105,7 +106,6 @@ GST_START_TEST (test_handoff_callback)
{
GstElement *sink;
GstBuffer *buffer;
GstCaps *caps;
gint testdata;
GstAppSinkCallbacks callbacks = { NULL };
@ -120,10 +120,7 @@ GST_START_TEST (test_handoff_callback)
ASSERT_SET_STATE (sink, GST_STATE_PLAYING, GST_STATE_CHANGE_ASYNC);
caps = gst_caps_from_string ("application/x-gst-check");
buffer = gst_buffer_new_and_alloc (4);
gst_pad_set_caps (mysrcpad, caps);
gst_caps_unref (caps);
/* Pushing a buffer should run our callback */
fail_unless (gst_pad_push (mysrcpad, buffer) == GST_FLOW_OK);
@ -196,23 +193,18 @@ GST_START_TEST (test_notify1)
GST_END_TEST;
static GstBufferList *mylist;
static GstCaps *mycaps;
static gint values[] = { 1, 2, 4 };
static const gint values[] = { 1, 2, 4 };
static GstBufferList *
create_buffer_list (void)
{
guint len;
GstBuffer *buffer;
GstBufferList *mylist;
mylist = gst_buffer_list_new ();
fail_if (mylist == NULL);
mycaps = gst_caps_from_string ("application/x-gst-check");
fail_if (mycaps == NULL);
len = gst_buffer_list_length (mylist);
fail_if (len != 0);
@ -228,9 +220,6 @@ create_buffer_list (void)
gst_buffer_fill (buffer, 0, &values[2], sizeof (gint));
gst_buffer_list_add (mylist, buffer);
gst_pad_set_caps (mysrcpad, mycaps);
gst_caps_unref (mycaps);
return mylist;
}

View file

@ -43,22 +43,25 @@ static GstPad *mysrcpad, *mysinkpad;
"rate = (int) [ 1, MAX ], " \
"channels = (int) [ 1, MAX ]"
static GstStaticPadTemplate sinktemplate = GST_STATIC_PAD_TEMPLATE ("sink",
GST_PAD_SINK,
GST_PAD_ALWAYS,
GST_STATIC_CAPS (CONVERT_CAPS_TEMPLATE_STRING)
);
static GstStaticPadTemplate srctemplate = GST_STATIC_PAD_TEMPLATE ("src",
GST_PAD_SRC,
GST_PAD_ALWAYS,
GST_STATIC_CAPS (CONVERT_CAPS_TEMPLATE_STRING)
);
/* takes over reference for outcaps */
static GstElement *
setup_audioconvert (GstCaps * outcaps)
{
GstStaticPadTemplate sinktemplate = GST_STATIC_PAD_TEMPLATE ("sink",
GST_PAD_SINK,
GST_PAD_ALWAYS,
GST_STATIC_CAPS (CONVERT_CAPS_TEMPLATE_STRING)
);
GstStaticPadTemplate srctemplate = GST_STATIC_PAD_TEMPLATE ("src",
GST_PAD_SRC,
GST_PAD_ALWAYS,
GST_STATIC_CAPS (CONVERT_CAPS_TEMPLATE_STRING)
);
GstElement *audioconvert;
gchar *caps_str;
caps_str = gst_caps_to_string (outcaps);
sinktemplate.static_caps.string = caps_str;
GST_DEBUG ("setup_audioconvert with caps %" GST_PTR_FORMAT, outcaps);
audioconvert = gst_check_setup_element ("audioconvert");
@ -73,11 +76,7 @@ setup_audioconvert (GstCaps * outcaps)
gst_pad_set_active (mysrcpad, TRUE);
gst_pad_set_active (mysinkpad, TRUE);
gst_pad_set_caps (mysinkpad, outcaps);
gst_caps_unref (outcaps);
outcaps = gst_pad_get_current_caps (mysinkpad);
fail_unless (gst_caps_is_fixed (outcaps));
gst_caps_unref (outcaps);
g_free (caps_str);
return audioconvert;
}
@ -420,7 +419,7 @@ verify_convert (const gchar * which, void *in, int inlength,
GST_STATE_PLAYING) == GST_STATE_CHANGE_SUCCESS,
"could not set to playing");
gst_pad_set_caps (mysrcpad, incaps);
gst_check_setup_events (mysrcpad, audioconvert, incaps, GST_FORMAT_TIME);
GST_DEBUG ("Creating buffer of %d bytes", inlength);
inbuffer = gst_buffer_new_and_alloc (inlength);
@ -1447,15 +1446,18 @@ GST_END_TEST;
"rate = (int) [ 1, MAX ], " \
"channels = (int) [ 1, MAX ]"
static GstStaticPadTemplate simple_sinktemplate =
GST_STATIC_PAD_TEMPLATE ("sink",
GST_PAD_SINK,
GST_PAD_ALWAYS,
GST_STATIC_CAPS (SIMPLE_CAPS_TEMPLATE_STRING)
);
GST_START_TEST (test_preserve_width)
{
GstStaticPadTemplate sinktemplate = GST_STATIC_PAD_TEMPLATE ("sink",
GST_PAD_SINK,
GST_PAD_ALWAYS,
GST_STATIC_CAPS (SIMPLE_CAPS_TEMPLATE_STRING)
);
GstStaticPadTemplate srctemplate = GST_STATIC_PAD_TEMPLATE ("src",
GST_PAD_SRC,
GST_PAD_ALWAYS,
GST_STATIC_CAPS (CONVERT_CAPS_TEMPLATE_STRING)
);
static const struct _test_formats
{
int width;
@ -1474,7 +1476,7 @@ GST_START_TEST (test_preserve_width)
audioconvert = gst_check_setup_element ("audioconvert");
mysrcpad = gst_check_setup_src_pad (audioconvert, &srctemplate);
mysinkpad = gst_check_setup_sink_pad (audioconvert, &simple_sinktemplate);
mysinkpad = gst_check_setup_sink_pad (audioconvert, &sinktemplate);
gst_pad_set_active (mysrcpad, TRUE);
gst_pad_set_active (mysinkpad, TRUE);

View file

@ -419,6 +419,9 @@ GST_START_TEST (test_large_discont)
sinkpad = gst_check_setup_sink_pad (audiorate, &sinktemplate);
gst_pad_set_active (srcpad, TRUE);
gst_check_setup_events (srcpad, audiorate, caps, GST_FORMAT_TIME);
gst_pad_set_active (sinkpad, TRUE);
fail_unless (gst_element_set_state (audiorate,
@ -426,7 +429,6 @@ GST_START_TEST (test_large_discont)
"failed to set audiorate playing");
buf = gst_buffer_new_and_alloc (4);
gst_pad_set_caps (srcpad, caps);
GST_BUFFER_TIMESTAMP (buf) = 0;
gst_pad_push (srcpad, buf);

View file

@ -51,24 +51,24 @@ static GstPad *mysrcpad, *mysinkpad;
"rate = (int) [ 1, MAX ], " \
"layout = (string) interleaved"
static GstStaticPadTemplate sinktemplate = GST_STATIC_PAD_TEMPLATE ("sink",
GST_PAD_SINK,
GST_PAD_ALWAYS,
GST_STATIC_CAPS (RESAMPLE_CAPS)
);
static GstStaticPadTemplate srctemplate = GST_STATIC_PAD_TEMPLATE ("src",
GST_PAD_SRC,
GST_PAD_ALWAYS,
GST_STATIC_CAPS (RESAMPLE_CAPS)
);
static GstElement *
setup_audioresample (int channels, guint64 mask, int inrate, int outrate,
const gchar * format)
{
GstStaticPadTemplate sinktemplate = GST_STATIC_PAD_TEMPLATE ("sink",
GST_PAD_SINK,
GST_PAD_ALWAYS,
GST_STATIC_CAPS (RESAMPLE_CAPS)
);
GstStaticPadTemplate srctemplate = GST_STATIC_PAD_TEMPLATE ("src",
GST_PAD_SRC,
GST_PAD_ALWAYS,
GST_STATIC_CAPS (RESAMPLE_CAPS)
);
GstElement *audioresample;
GstCaps *caps;
GstStructure *structure;
gchar *caps_str;
GST_DEBUG ("setup_audioresample");
audioresample = gst_check_setup_element ("audioresample");
@ -86,7 +86,7 @@ setup_audioresample (int channels, guint64 mask, int inrate, int outrate,
mysrcpad = gst_check_setup_src_pad (audioresample, &srctemplate);
gst_pad_set_active (mysrcpad, TRUE);
gst_pad_set_caps (mysrcpad, caps);
gst_check_setup_events (mysrcpad, audioresample, caps, GST_FORMAT_TIME);
gst_caps_unref (caps);
caps = gst_caps_from_string (RESAMPLE_CAPS);
@ -94,15 +94,16 @@ setup_audioresample (int channels, guint64 mask, int inrate, int outrate,
gst_structure_set (structure, "channels", G_TYPE_INT, channels,
"rate", G_TYPE_INT, outrate, "format", G_TYPE_STRING, format, NULL);
fail_unless (gst_caps_is_fixed (caps));
caps_str = gst_caps_to_string (caps);
sinktemplate.static_caps.string = caps_str;
mysinkpad = gst_check_setup_sink_pad (audioresample, &sinktemplate);
gst_pad_set_active (mysinkpad, TRUE);
/* this installs a getcaps func that will always return the caps we set
* later */
gst_pad_set_caps (mysinkpad, caps);
gst_pad_use_fixed_caps (mysinkpad);
g_free (caps_str);
gst_caps_unref (caps);
return audioresample;
@ -1011,14 +1012,11 @@ run_fft_pipeline (int inrate, int outrate, int quality, int width,
{
GstElement *audioresample;
GstBuffer *inbuffer, *outbuffer;
GstCaps *caps;
const int nsamples = 2048;
audioresample = setup_audioresample (1, 0, inrate, outrate, format);
fail_unless (audioresample != NULL);
g_object_set (audioresample, "quality", quality, NULL);
caps = gst_pad_get_current_caps (mysrcpad);
fail_unless (gst_caps_is_fixed (caps));
fail_unless (gst_element_set_state (audioresample,
GST_STATE_PLAYING) == GST_STATE_CHANGE_SUCCESS,
@ -1027,7 +1025,6 @@ run_fft_pipeline (int inrate, int outrate, int quality, int width,
inbuffer = gst_buffer_new_and_alloc (nsamples * width / 8);
GST_BUFFER_DURATION (inbuffer) = GST_FRAMES_TO_CLOCK_TIME (nsamples, inrate);
GST_BUFFER_TIMESTAMP (inbuffer) = 0;
gst_pad_set_caps (mysrcpad, caps);
(*init) (inbuffer);
@ -1048,7 +1045,6 @@ run_fft_pipeline (int inrate, int outrate, int quality, int width,
(*compare_ffts) (inbuffer, outbuffer);
/* cleanup */
gst_caps_unref (caps);
cleanup_audioresample (audioresample);
}

View file

@ -89,7 +89,7 @@ GST_START_TEST (test_no_clients)
caps = gst_caps_from_string ("application/x-gst-check");
buffer = gst_buffer_new_and_alloc (4);
gst_pad_set_caps (mysrcpad, caps);
gst_check_setup_events (mysrcpad, sink, caps, GST_FORMAT_BYTES);
gst_caps_unref (caps);
fail_unless (gst_pad_push (mysrcpad, buffer) == GST_FLOW_OK);
@ -121,7 +121,7 @@ GST_START_TEST (test_add_client)
ASSERT_CAPS_REFCOUNT (caps, "caps", 1);
GST_DEBUG ("Created test caps %p %" GST_PTR_FORMAT, caps, caps);
buffer = gst_buffer_new_and_alloc (4);
gst_pad_set_caps (mysrcpad, caps);
gst_check_setup_events (mysrcpad, sink, caps, GST_FORMAT_BYTES);
ASSERT_CAPS_REFCOUNT (caps, "caps", 3);
gst_buffer_fill (buffer, 0, "dead", 4);
fail_unless (gst_pad_push (mysrcpad, buffer) == GST_FLOW_OK);
@ -273,7 +273,7 @@ GST_START_TEST (test_streamheader)
gst_multifdsink_create_streamheader ("babe", "deadbeef", &hbuf1, &hbuf2,
&caps);
ASSERT_CAPS_REFCOUNT (caps, "caps", 1);
fail_unless (gst_pad_set_caps (mysrcpad, caps));
gst_check_setup_events (mysrcpad, sink, caps, GST_FORMAT_BYTES);
/* one is ours, two from set_caps */
ASSERT_CAPS_REFCOUNT (caps, "caps", 3);
@ -365,7 +365,7 @@ GST_START_TEST (test_change_streamheader)
gst_multifdsink_create_streamheader ("first", "header", &hbuf1, &hbuf2,
&caps);
ASSERT_CAPS_REFCOUNT (caps, "caps", 1);
fail_unless (gst_pad_set_caps (mysrcpad, caps));
gst_check_setup_events (mysrcpad, sink, caps, GST_FORMAT_BYTES);
/* one is ours, two from set_caps */
ASSERT_CAPS_REFCOUNT (caps, "caps", 3);
@ -411,7 +411,7 @@ GST_START_TEST (test_change_streamheader)
gst_multifdsink_create_streamheader ("second", "header", &hbuf1, &hbuf2,
&caps);
fail_unless (gst_pad_set_caps (mysrcpad, caps));
gst_check_setup_events (mysrcpad, sink, caps, GST_FORMAT_BYTES);
/* one to hold for the test and one to give away */
ASSERT_BUFFER_REFCOUNT (hbuf1, "hbuf1", 2);
ASSERT_BUFFER_REFCOUNT (hbuf2, "hbuf2", 2);
@ -501,7 +501,7 @@ GST_START_TEST (test_burst_client_bytes)
ASSERT_SET_STATE (sink, GST_STATE_PLAYING, GST_STATE_CHANGE_ASYNC);
caps = gst_caps_from_string ("application/x-gst-check");
gst_pad_set_caps (mysrcpad, caps);
gst_check_setup_events (mysrcpad, sink, caps, GST_FORMAT_BYTES);
GST_DEBUG ("Created test caps %p %" GST_PTR_FORMAT, caps, caps);
/* push buffers in, 9 * 16 bytes = 144 bytes */
@ -590,7 +590,7 @@ GST_START_TEST (test_burst_client_bytes_keyframe)
ASSERT_SET_STATE (sink, GST_STATE_PLAYING, GST_STATE_CHANGE_ASYNC);
caps = gst_caps_from_string ("application/x-gst-check");
gst_pad_set_caps (mysrcpad, caps);
gst_check_setup_events (mysrcpad, sink, caps, GST_FORMAT_BYTES);
GST_DEBUG ("Created test caps %p %" GST_PTR_FORMAT, caps, caps);
/* push buffers in, 9 * 16 bytes = 144 bytes */
@ -681,7 +681,7 @@ GST_START_TEST (test_burst_client_bytes_with_keyframe)
ASSERT_SET_STATE (sink, GST_STATE_PLAYING, GST_STATE_CHANGE_ASYNC);
caps = gst_caps_from_string ("application/x-gst-check");
gst_pad_set_caps (mysrcpad, caps);
gst_check_setup_events (mysrcpad, sink, caps, GST_FORMAT_BYTES);
GST_DEBUG ("Created test caps %p %" GST_PTR_FORMAT, caps, caps);
/* push buffers in, 9 * 16 bytes = 144 bytes */
@ -767,7 +767,7 @@ GST_START_TEST (test_client_next_keyframe)
ASSERT_SET_STATE (sink, GST_STATE_PLAYING, GST_STATE_CHANGE_ASYNC);
caps = gst_caps_from_string ("application/x-gst-check");
gst_pad_set_caps (mysrcpad, caps);
gst_check_setup_events (mysrcpad, sink, caps, GST_FORMAT_BYTES);
GST_DEBUG ("Created test caps %p %" GST_PTR_FORMAT, caps, caps);
/* now add our client */

View file

@ -91,7 +91,7 @@ GST_START_TEST (test_no_clients)
caps = gst_caps_from_string ("application/x-gst-check");
buffer = gst_buffer_new_and_alloc (4);
gst_pad_set_caps (mysrcpad, caps);
gst_check_setup_events (mysrcpad, sink, caps, GST_FORMAT_BYTES);
gst_caps_unref (caps);
fail_unless (gst_pad_push (mysrcpad, buffer) == GST_FLOW_OK);
@ -177,7 +177,7 @@ GST_START_TEST (test_add_client)
ASSERT_CAPS_REFCOUNT (caps, "caps", 1);
GST_DEBUG ("Created test caps %p %" GST_PTR_FORMAT, caps, caps);
buffer = gst_buffer_new_and_alloc (4);
gst_pad_set_caps (mysrcpad, caps);
gst_check_setup_events (mysrcpad, sink, caps, GST_FORMAT_BYTES);
ASSERT_CAPS_REFCOUNT (caps, "caps", 3);
gst_buffer_fill (buffer, 0, "dead", 4);
fail_unless (gst_pad_push (mysrcpad, buffer) == GST_FLOW_OK);
@ -299,7 +299,7 @@ GST_START_TEST (test_streamheader)
ASSERT_BUFFER_REFCOUNT (hbuf1, "hbuf1", 2);
ASSERT_BUFFER_REFCOUNT (hbuf2, "hbuf2", 2);
ASSERT_CAPS_REFCOUNT (caps, "caps", 1);
fail_unless (gst_pad_set_caps (mysrcpad, caps));
gst_check_setup_events (mysrcpad, sink, caps, GST_FORMAT_BYTES);
/* one is ours, two from set_caps */
ASSERT_CAPS_REFCOUNT (caps, "caps", 3);
@ -400,7 +400,7 @@ GST_START_TEST (test_change_streamheader)
gst_multisocketsink_create_streamheader ("first", "header", &hbuf1, &hbuf2,
&caps);
ASSERT_CAPS_REFCOUNT (caps, "caps", 1);
fail_unless (gst_pad_set_caps (mysrcpad, caps));
gst_check_setup_events (mysrcpad, sink, caps, GST_FORMAT_BYTES);
/* one is ours, two from set_caps */
ASSERT_CAPS_REFCOUNT (caps, "caps", 3);
@ -446,7 +446,7 @@ GST_START_TEST (test_change_streamheader)
gst_multisocketsink_create_streamheader ("second", "header", &hbuf1, &hbuf2,
&caps);
fail_unless (gst_pad_set_caps (mysrcpad, caps));
gst_check_setup_events (mysrcpad, sink, caps, GST_FORMAT_BYTES);
/* one to hold for the test and one to give away */
ASSERT_BUFFER_REFCOUNT (hbuf1, "hbuf1", 2);
ASSERT_BUFFER_REFCOUNT (hbuf2, "hbuf2", 2);
@ -539,7 +539,7 @@ GST_START_TEST (test_burst_client_bytes)
ASSERT_SET_STATE (sink, GST_STATE_PLAYING, GST_STATE_CHANGE_ASYNC);
caps = gst_caps_from_string ("application/x-gst-check");
gst_pad_set_caps (mysrcpad, caps);
gst_check_setup_events (mysrcpad, sink, caps, GST_FORMAT_BYTES);
GST_DEBUG ("Created test caps %p %" GST_PTR_FORMAT, caps, caps);
/* push buffers in, 9 * 16 bytes = 144 bytes */
@ -634,7 +634,7 @@ GST_START_TEST (test_burst_client_bytes_keyframe)
caps = gst_caps_from_string ("application/x-gst-check");
GST_DEBUG ("Created test caps %p %" GST_PTR_FORMAT, caps, caps);
gst_pad_set_caps (mysrcpad, caps);
gst_check_setup_events (mysrcpad, sink, caps, GST_FORMAT_BYTES);
/* push buffers in, 9 * 16 bytes = 144 bytes */
for (i = 0; i < 9; i++) {
@ -732,7 +732,7 @@ GST_START_TEST (test_burst_client_bytes_with_keyframe)
ASSERT_SET_STATE (sink, GST_STATE_PLAYING, GST_STATE_CHANGE_ASYNC);
caps = gst_caps_from_string ("application/x-gst-check");
gst_pad_set_caps (mysrcpad, caps);
gst_check_setup_events (mysrcpad, sink, caps, GST_FORMAT_BYTES);
GST_DEBUG ("Created test caps %p %" GST_PTR_FORMAT, caps, caps);
/* push buffers in, 9 * 16 bytes = 144 bytes */
@ -825,7 +825,7 @@ GST_START_TEST (test_client_next_keyframe)
ASSERT_SET_STATE (sink, GST_STATE_PLAYING, GST_STATE_CHANGE_ASYNC);
caps = gst_caps_from_string ("application/x-gst-check");
gst_pad_set_caps (mysrcpad, caps);
gst_check_setup_events (mysrcpad, sink, caps, GST_FORMAT_BYTES);
GST_DEBUG ("Created test caps %p %" GST_PTR_FORMAT, caps, caps);
/* now add our client */

View file

@ -157,12 +157,17 @@ static SubParseInputChunk srt_input3[] = {
static void
setup_subparse (void)
{
GstSegment segment;
subparse = gst_check_setup_element ("subparse");
mysrcpad = gst_check_setup_src_pad (subparse, &srctemplate);
mysinkpad = gst_check_setup_sink_pad (subparse, &sinktemplate);
gst_pad_set_active (mysrcpad, TRUE);
gst_segment_init (&segment, GST_FORMAT_BYTES);
gst_pad_push_event (mysrcpad, gst_event_new_stream_start ("test"));
gst_pad_push_event (mysrcpad, gst_event_new_segment (&segment));
gst_pad_set_active (mysinkpad, TRUE);
fail_unless_equals_int (gst_element_set_state (subparse, GST_STATE_PLAYING),

View file

@ -68,6 +68,21 @@ static GstStaticPadTemplate video_srctemplate = GST_STATIC_PAD_TEMPLATE ("src",
GST_STATIC_CAPS (VIDEO_CAPS_TEMPLATE_STRING)
);
static void
gst_check_setup_events_textoverlay (GstPad * srcpad, GstElement * element,
GstCaps * caps, GstFormat format, const gchar * stream_id)
{
GstSegment segment;
gst_segment_init (&segment, format);
fail_unless (gst_pad_push_event (srcpad,
gst_event_new_stream_start (stream_id)));
if (caps)
fail_unless (gst_pad_push_event (srcpad, gst_event_new_caps (caps)));
fail_unless (gst_pad_push_event (srcpad, gst_event_new_segment (&segment)));
}
/* much like gst_check_setup_src_pad(), but with possibility to give a hint
* which sink template of the element to use, if there are multiple ones */
static GstPad *
@ -279,7 +294,8 @@ GST_START_TEST (test_video_passthrough)
"could not set to playing");
incaps = create_video_caps (VIDEO_CAPS_STRING);
gst_pad_set_caps (myvideosrcpad, incaps);
gst_check_setup_events_textoverlay (myvideosrcpad, textoverlay, incaps,
GST_FORMAT_TIME, "video");
inbuffer = create_black_buffer (incaps);
gst_caps_unref (incaps);
@ -422,7 +438,8 @@ GST_START_TEST (test_video_render_static_text)
"could not set to playing");
incaps = create_video_caps (VIDEO_CAPS_STRING);
gst_pad_set_caps (myvideosrcpad, incaps);
gst_check_setup_events_textoverlay (myvideosrcpad, textoverlay, incaps,
GST_FORMAT_TIME, "video");
inbuffer = create_black_buffer (incaps);
gst_caps_unref (incaps);
ASSERT_BUFFER_REFCOUNT (inbuffer, "inbuffer", 1);
@ -512,7 +529,8 @@ GST_START_TEST (test_video_waits_for_text)
caps = gst_caps_new_simple ("text/x-raw", "format", G_TYPE_STRING, "utf8",
NULL);
gst_pad_set_caps (mytextsrcpad, caps);
gst_check_setup_events_textoverlay (mytextsrcpad, textoverlay, caps,
GST_FORMAT_TIME, "text");
gst_caps_unref (caps);
tbuf = create_text_buffer ("XLX", 1 * GST_SECOND, 5 * GST_SECOND);
@ -527,7 +545,8 @@ GST_START_TEST (test_video_waits_for_text)
fail_unless_equals_int (g_list_length (buffers), 0);
incaps = create_video_caps (VIDEO_CAPS_STRING);
gst_pad_set_caps (myvideosrcpad, incaps);
gst_check_setup_events_textoverlay (myvideosrcpad, textoverlay, incaps,
GST_FORMAT_TIME, "video");
inbuffer = create_black_buffer (incaps);
gst_caps_unref (incaps);
ASSERT_BUFFER_REFCOUNT (inbuffer, "inbuffer", 1);
@ -646,7 +665,8 @@ test_render_continuity_push_video_buffers_thread (gpointer data)
GstCaps *vcaps;
vcaps = create_video_caps (VIDEO_CAPS_STRING);
gst_pad_set_caps (myvideosrcpad, vcaps);
gst_check_setup_events_textoverlay (myvideosrcpad, data, vcaps,
GST_FORMAT_TIME, "video");
do {
GstBuffer *vbuf;
@ -684,13 +704,14 @@ GST_START_TEST (test_render_continuity)
"could not set to playing");
thread = g_thread_try_new ("gst-check",
test_render_continuity_push_video_buffers_thread, NULL, NULL);
test_render_continuity_push_video_buffers_thread, textoverlay, NULL);
fail_unless (thread != NULL);
g_thread_unref (thread);
caps = gst_caps_new_simple ("text/x-raw", "format", G_TYPE_STRING, "utf8",
NULL);
gst_pad_set_caps (mytextsrcpad, caps);
gst_check_setup_events_textoverlay (mytextsrcpad, textoverlay, caps,
GST_FORMAT_TIME, "text");
gst_caps_unref (caps);
tbuf = create_text_buffer ("XLX", 2 * GST_SECOND, GST_SECOND);

View file

@ -165,7 +165,7 @@ GST_START_TEST (test_one)
inbuffer = gst_buffer_new_and_alloc (4);
gst_buffer_memset (inbuffer, 0, 0, 4);
caps = gst_caps_from_string (VIDEO_CAPS_STRING);
gst_pad_set_caps (mysrcpad, caps);
gst_check_setup_events (mysrcpad, videorate, caps, GST_FORMAT_TIME);
GST_BUFFER_TIMESTAMP (inbuffer) = 0;
gst_caps_unref (caps);
ASSERT_BUFFER_REFCOUNT (inbuffer, "inbuffer", 1);
@ -207,7 +207,7 @@ GST_START_TEST (test_more)
GST_BUFFER_OFFSET_END (first) = g_rand_int (rand);
gst_buffer_memset (first, 0, 1, 4);
caps = gst_caps_from_string (VIDEO_CAPS_STRING);
gst_pad_set_caps (mysrcpad, caps);
gst_check_setup_events (mysrcpad, videorate, caps, GST_FORMAT_TIME);
gst_caps_unref (caps);
ASSERT_BUFFER_REFCOUNT (first, "first", 1);
gst_buffer_ref (first);
@ -325,7 +325,7 @@ GST_START_TEST (test_wrong_order_from_zero)
GST_BUFFER_TIMESTAMP (first) = GST_SECOND;
gst_buffer_memset (first, 0, 0, 4);
caps = gst_caps_from_string (VIDEO_CAPS_STRING);
gst_pad_set_caps (mysrcpad, caps);
gst_check_setup_events (mysrcpad, videorate, caps, GST_FORMAT_TIME);
gst_caps_unref (caps);
ASSERT_BUFFER_REFCOUNT (first, "first", 1);
gst_buffer_ref (first);
@ -408,7 +408,7 @@ GST_START_TEST (test_wrong_order)
GST_BUFFER_TIMESTAMP (first) = 0;
gst_buffer_memset (first, 0, 0, 4);
caps = gst_caps_from_string (VIDEO_CAPS_STRING);
gst_pad_set_caps (mysrcpad, caps);
gst_check_setup_events (mysrcpad, videorate, caps, GST_FORMAT_TIME);
gst_caps_unref (caps);
ASSERT_BUFFER_REFCOUNT (first, "first", 1);
gst_buffer_ref (first);
@ -506,7 +506,7 @@ GST_START_TEST (test_no_framerate)
inbuffer = gst_buffer_new_and_alloc (4);
gst_buffer_memset (inbuffer, 0, 0, 4);
caps = gst_caps_from_string (VIDEO_CAPS_NO_FRAMERATE_STRING);
gst_pad_set_caps (mysrcpad, caps);
gst_check_setup_events (mysrcpad, videorate, caps, GST_FORMAT_TIME);
gst_caps_unref (caps);
ASSERT_BUFFER_REFCOUNT (inbuffer, "inbuffer", 1);
@ -539,24 +539,18 @@ GST_START_TEST (test_changing_size)
GstBuffer *fourth;
GstBuffer *fifth;
GstBuffer *outbuf;
GstEvent *newsegment;
GstCaps *caps, *caps_newsize;
GstSegment segment;
videorate = setup_videorate ();
fail_unless (gst_element_set_state (videorate,
GST_STATE_PLAYING) == GST_STATE_CHANGE_SUCCESS,
"could not set to playing");
gst_segment_init (&segment, GST_FORMAT_TIME);
newsegment = gst_event_new_segment (&segment);
fail_unless (gst_pad_push_event (mysrcpad, newsegment) == TRUE);
first = gst_buffer_new_and_alloc (4);
gst_buffer_memset (first, 0, 0, 4);
caps = gst_caps_from_string (VIDEO_CAPS_STRING);
GST_BUFFER_TIMESTAMP (first) = 0;
gst_pad_set_caps (mysrcpad, caps);
gst_check_setup_events (mysrcpad, videorate, caps, GST_FORMAT_TIME);
GST_DEBUG ("pushing first buffer");
fail_unless (gst_pad_push (mysrcpad, first) == GST_FLOW_OK);
@ -631,7 +625,7 @@ GST_START_TEST (test_non_ok_flow)
buf = gst_buffer_new_and_alloc (4);
gst_buffer_memset (buf, 0, 0, 4);
caps = gst_caps_from_string (VIDEO_CAPS_STRING);
gst_pad_set_caps (mysrcpad, caps);
gst_check_setup_events (mysrcpad, videorate, caps, GST_FORMAT_TIME);
gst_caps_unref (caps);
ASSERT_BUFFER_REFCOUNT (buf, "inbuffer", 1);

View file

@ -198,7 +198,7 @@ GST_START_TEST (test_unity_s8)
inbuffer = gst_buffer_new_and_alloc (2);
gst_buffer_fill (inbuffer, 0, in, 2);
caps = gst_caps_from_string (VOLUME_CAPS_STRING_S8);
gst_pad_set_caps (mysrcpad, caps);
gst_check_setup_events (mysrcpad, volume, caps, GST_FORMAT_TIME);
gst_caps_unref (caps);
ASSERT_BUFFER_REFCOUNT (inbuffer, "inbuffer", 1);
@ -241,7 +241,7 @@ GST_START_TEST (test_half_s8)
inbuffer = gst_buffer_new_and_alloc (2);
gst_buffer_fill (inbuffer, 0, in, 2);
caps = gst_caps_from_string (VOLUME_CAPS_STRING_S8);
gst_pad_set_caps (mysrcpad, caps);
gst_check_setup_events (mysrcpad, volume, caps, GST_FORMAT_TIME);
gst_caps_unref (caps);
ASSERT_BUFFER_REFCOUNT (inbuffer, "inbuffer", 1);
/* FIXME: reffing the inbuffer should make the transformation not be
@ -290,7 +290,7 @@ GST_START_TEST (test_double_s8)
inbuffer = gst_buffer_new_and_alloc (2);
gst_buffer_fill (inbuffer, 0, in, 2);
caps = gst_caps_from_string (VOLUME_CAPS_STRING_S8);
gst_pad_set_caps (mysrcpad, caps);
gst_check_setup_events (mysrcpad, volume, caps, GST_FORMAT_TIME);
gst_caps_unref (caps);
ASSERT_BUFFER_REFCOUNT (inbuffer, "inbuffer", 1);
/* FIXME: reffing the inbuffer should make the transformation not be
@ -340,7 +340,7 @@ GST_START_TEST (test_ten_s8)
gst_buffer_fill (inbuffer, 0, in, 2);
fail_unless (gst_buffer_memcmp (inbuffer, 0, in, 2) == 0);
caps = gst_caps_from_string (VOLUME_CAPS_STRING_S8);
gst_pad_set_caps (mysrcpad, caps);
gst_check_setup_events (mysrcpad, volume, caps, GST_FORMAT_TIME);
gst_caps_unref (caps);
ASSERT_BUFFER_REFCOUNT (inbuffer, "inbuffer", 1);
/* FIXME: reffing the inbuffer should make the transformation not be
@ -388,7 +388,7 @@ GST_START_TEST (test_mute_s8)
inbuffer = gst_buffer_new_and_alloc (2);
gst_buffer_fill (inbuffer, 0, in, 2);
caps = gst_caps_from_string (VOLUME_CAPS_STRING_S8);
gst_pad_set_caps (mysrcpad, caps);
gst_check_setup_events (mysrcpad, volume, caps, GST_FORMAT_TIME);
gst_caps_unref (caps);
ASSERT_BUFFER_REFCOUNT (inbuffer, "inbuffer", 1);
/* FIXME: reffing the inbuffer should make the transformation not be
@ -432,7 +432,7 @@ GST_START_TEST (test_unity_s16)
inbuffer = gst_buffer_new_and_alloc (4);
gst_buffer_fill (inbuffer, 0, in, 4);
caps = gst_caps_from_string (VOLUME_CAPS_STRING_S16);
gst_pad_set_caps (mysrcpad, caps);
gst_check_setup_events (mysrcpad, volume, caps, GST_FORMAT_TIME);
gst_caps_unref (caps);
ASSERT_BUFFER_REFCOUNT (inbuffer, "inbuffer", 1);
@ -474,7 +474,7 @@ GST_START_TEST (test_half_s16)
inbuffer = gst_buffer_new_and_alloc (4);
gst_buffer_fill (inbuffer, 0, in, 4);
caps = gst_caps_from_string (VOLUME_CAPS_STRING_S16);
gst_pad_set_caps (mysrcpad, caps);
gst_check_setup_events (mysrcpad, volume, caps, GST_FORMAT_TIME);
gst_caps_unref (caps);
ASSERT_BUFFER_REFCOUNT (inbuffer, "inbuffer", 1);
/* FIXME: reffing the inbuffer should make the transformation not be
@ -521,7 +521,7 @@ GST_START_TEST (test_double_s16)
inbuffer = gst_buffer_new_and_alloc (4);
gst_buffer_fill (inbuffer, 0, in, 4);
caps = gst_caps_from_string (VOLUME_CAPS_STRING_S16);
gst_pad_set_caps (mysrcpad, caps);
gst_check_setup_events (mysrcpad, volume, caps, GST_FORMAT_TIME);
gst_caps_unref (caps);
ASSERT_BUFFER_REFCOUNT (inbuffer, "inbuffer", 1);
/* FIXME: reffing the inbuffer should make the transformation not be
@ -569,7 +569,7 @@ GST_START_TEST (test_ten_s16)
gst_buffer_fill (inbuffer, 0, in, 4);
fail_unless (gst_buffer_memcmp (inbuffer, 0, in, 4) == 0);
caps = gst_caps_from_string (VOLUME_CAPS_STRING_S16);
gst_pad_set_caps (mysrcpad, caps);
gst_check_setup_events (mysrcpad, volume, caps, GST_FORMAT_TIME);
gst_caps_unref (caps);
ASSERT_BUFFER_REFCOUNT (inbuffer, "inbuffer", 1);
/* FIXME: reffing the inbuffer should make the transformation not be
@ -617,7 +617,7 @@ GST_START_TEST (test_mute_s16)
inbuffer = gst_buffer_new_and_alloc (4);
gst_buffer_fill (inbuffer, 0, in, 4);
caps = gst_caps_from_string (VOLUME_CAPS_STRING_S16);
gst_pad_set_caps (mysrcpad, caps);
gst_check_setup_events (mysrcpad, volume, caps, GST_FORMAT_TIME);
gst_caps_unref (caps);
ASSERT_BUFFER_REFCOUNT (inbuffer, "inbuffer", 1);
/* FIXME: reffing the inbuffer should make the transformation not be
@ -674,7 +674,7 @@ GST_START_TEST (test_unity_s24)
inbuffer = gst_buffer_new_and_alloc (6);
gst_buffer_fill (inbuffer, 0, in, 6);
caps = gst_caps_from_string (VOLUME_CAPS_STRING_S24);
gst_pad_set_caps (mysrcpad, caps);
gst_check_setup_events (mysrcpad, volume, caps, GST_FORMAT_TIME);
gst_caps_unref (caps);
ASSERT_BUFFER_REFCOUNT (inbuffer, "inbuffer", 1);
@ -725,7 +725,7 @@ GST_START_TEST (test_half_s24)
inbuffer = gst_buffer_new_and_alloc (6);
gst_buffer_fill (inbuffer, 0, in, 6);
caps = gst_caps_from_string (VOLUME_CAPS_STRING_S24);
gst_pad_set_caps (mysrcpad, caps);
gst_check_setup_events (mysrcpad, volume, caps, GST_FORMAT_TIME);
gst_caps_unref (caps);
ASSERT_BUFFER_REFCOUNT (inbuffer, "inbuffer", 1);
/* FIXME: reffing the inbuffer should make the transformation not be
@ -781,7 +781,7 @@ GST_START_TEST (test_double_s24)
inbuffer = gst_buffer_new_and_alloc (6);
gst_buffer_fill (inbuffer, 0, in, 6);
caps = gst_caps_from_string (VOLUME_CAPS_STRING_S24);
gst_pad_set_caps (mysrcpad, caps);
gst_check_setup_events (mysrcpad, volume, caps, GST_FORMAT_TIME);
gst_caps_unref (caps);
ASSERT_BUFFER_REFCOUNT (inbuffer, "inbuffer", 1);
/* FIXME: reffing the inbuffer should make the transformation not be
@ -838,7 +838,7 @@ GST_START_TEST (test_ten_s24)
gst_buffer_fill (inbuffer, 0, in, 6);
fail_unless (gst_buffer_memcmp (inbuffer, 0, in, 6) == 0);
caps = gst_caps_from_string (VOLUME_CAPS_STRING_S24);
gst_pad_set_caps (mysrcpad, caps);
gst_check_setup_events (mysrcpad, volume, caps, GST_FORMAT_TIME);
gst_caps_unref (caps);
ASSERT_BUFFER_REFCOUNT (inbuffer, "inbuffer", 1);
/* FIXME: reffing the inbuffer should make the transformation not be
@ -894,7 +894,7 @@ GST_START_TEST (test_mute_s24)
inbuffer = gst_buffer_new_and_alloc (6);
gst_buffer_fill (inbuffer, 0, in, 6);
caps = gst_caps_from_string (VOLUME_CAPS_STRING_S24);
gst_pad_set_caps (mysrcpad, caps);
gst_check_setup_events (mysrcpad, volume, caps, GST_FORMAT_TIME);
gst_caps_unref (caps);
ASSERT_BUFFER_REFCOUNT (inbuffer, "inbuffer", 1);
/* FIXME: reffing the inbuffer should make the transformation not be
@ -943,7 +943,7 @@ GST_START_TEST (test_unity_s32)
inbuffer = gst_buffer_new_and_alloc (8);
gst_buffer_fill (inbuffer, 0, in, 8);
caps = gst_caps_from_string (VOLUME_CAPS_STRING_S32);
gst_pad_set_caps (mysrcpad, caps);
gst_check_setup_events (mysrcpad, volume, caps, GST_FORMAT_TIME);
gst_caps_unref (caps);
ASSERT_BUFFER_REFCOUNT (inbuffer, "inbuffer", 1);
@ -985,7 +985,7 @@ GST_START_TEST (test_half_s32)
inbuffer = gst_buffer_new_and_alloc (8);
gst_buffer_fill (inbuffer, 0, in, 8);
caps = gst_caps_from_string (VOLUME_CAPS_STRING_S32);
gst_pad_set_caps (mysrcpad, caps);
gst_check_setup_events (mysrcpad, volume, caps, GST_FORMAT_TIME);
gst_caps_unref (caps);
ASSERT_BUFFER_REFCOUNT (inbuffer, "inbuffer", 1);
/* FIXME: reffing the inbuffer should make the transformation not be
@ -1032,7 +1032,7 @@ GST_START_TEST (test_double_s32)
inbuffer = gst_buffer_new_and_alloc (8);
gst_buffer_fill (inbuffer, 0, in, 8);
caps = gst_caps_from_string (VOLUME_CAPS_STRING_S32);
gst_pad_set_caps (mysrcpad, caps);
gst_check_setup_events (mysrcpad, volume, caps, GST_FORMAT_TIME);
gst_caps_unref (caps);
ASSERT_BUFFER_REFCOUNT (inbuffer, "inbuffer", 1);
/* FIXME: reffing the inbuffer should make the transformation not be
@ -1080,7 +1080,7 @@ GST_START_TEST (test_ten_s32)
gst_buffer_fill (inbuffer, 0, in, 8);
fail_unless (gst_buffer_memcmp (inbuffer, 0, in, 8) == 0);
caps = gst_caps_from_string (VOLUME_CAPS_STRING_S32);
gst_pad_set_caps (mysrcpad, caps);
gst_check_setup_events (mysrcpad, volume, caps, GST_FORMAT_TIME);
gst_caps_unref (caps);
ASSERT_BUFFER_REFCOUNT (inbuffer, "inbuffer", 1);
/* FIXME: reffing the inbuffer should make the transformation not be
@ -1127,7 +1127,7 @@ GST_START_TEST (test_mute_s32)
inbuffer = gst_buffer_new_and_alloc (8);
gst_buffer_fill (inbuffer, 0, in, 8);
caps = gst_caps_from_string (VOLUME_CAPS_STRING_S32);
gst_pad_set_caps (mysrcpad, caps);
gst_check_setup_events (mysrcpad, volume, caps, GST_FORMAT_TIME);
gst_caps_unref (caps);
ASSERT_BUFFER_REFCOUNT (inbuffer, "inbuffer", 1);
/* FIXME: reffing the inbuffer should make the transformation not be
@ -1171,7 +1171,7 @@ GST_START_TEST (test_unity_f32)
inbuffer = gst_buffer_new_and_alloc (8);
gst_buffer_fill (inbuffer, 0, in, sizeof (in));
caps = gst_caps_from_string (VOLUME_CAPS_STRING_F32);
gst_pad_set_caps (mysrcpad, caps);
gst_check_setup_events (mysrcpad, volume, caps, GST_FORMAT_TIME);
gst_caps_unref (caps);
ASSERT_BUFFER_REFCOUNT (inbuffer, "inbuffer", 1);
@ -1216,7 +1216,7 @@ GST_START_TEST (test_half_f32)
inbuffer = gst_buffer_new_and_alloc (8);
gst_buffer_fill (inbuffer, 0, in, 8);
caps = gst_caps_from_string (VOLUME_CAPS_STRING_F32);
gst_pad_set_caps (mysrcpad, caps);
gst_check_setup_events (mysrcpad, volume, caps, GST_FORMAT_TIME);
gst_caps_unref (caps);
ASSERT_BUFFER_REFCOUNT (inbuffer, "inbuffer", 1);
/* FIXME: reffing the inbuffer should make the transformation not be
@ -1266,7 +1266,7 @@ GST_START_TEST (test_double_f32)
inbuffer = gst_buffer_new_and_alloc (8);
gst_buffer_fill (inbuffer, 0, in, 8);
caps = gst_caps_from_string (VOLUME_CAPS_STRING_F32);
gst_pad_set_caps (mysrcpad, caps);
gst_check_setup_events (mysrcpad, volume, caps, GST_FORMAT_TIME);
gst_caps_unref (caps);
ASSERT_BUFFER_REFCOUNT (inbuffer, "inbuffer", 1);
/* FIXME: reffing the inbuffer should make the transformation not be
@ -1317,7 +1317,7 @@ GST_START_TEST (test_ten_f32)
gst_buffer_fill (inbuffer, 0, in, 8);
fail_unless (gst_buffer_memcmp (inbuffer, 0, in, 8) == 0);
caps = gst_caps_from_string (VOLUME_CAPS_STRING_F32);
gst_pad_set_caps (mysrcpad, caps);
gst_check_setup_events (mysrcpad, volume, caps, GST_FORMAT_TIME);
gst_caps_unref (caps);
ASSERT_BUFFER_REFCOUNT (inbuffer, "inbuffer", 1);
/* FIXME: reffing the inbuffer should make the transformation not be
@ -1368,7 +1368,7 @@ GST_START_TEST (test_mute_f32)
inbuffer = gst_buffer_new_and_alloc (8);
gst_buffer_fill (inbuffer, 0, in, 8);
caps = gst_caps_from_string (VOLUME_CAPS_STRING_F32);
gst_pad_set_caps (mysrcpad, caps);
gst_check_setup_events (mysrcpad, volume, caps, GST_FORMAT_TIME);
gst_caps_unref (caps);
ASSERT_BUFFER_REFCOUNT (inbuffer, "inbuffer", 1);
/* FIXME: reffing the inbuffer should make the transformation not be
@ -1415,7 +1415,7 @@ GST_START_TEST (test_unity_f64)
inbuffer = gst_buffer_new_and_alloc (16);
gst_buffer_fill (inbuffer, 0, in, 16);
caps = gst_caps_from_string (VOLUME_CAPS_STRING_F64);
gst_pad_set_caps (mysrcpad, caps);
gst_check_setup_events (mysrcpad, volume, caps, GST_FORMAT_TIME);
gst_caps_unref (caps);
ASSERT_BUFFER_REFCOUNT (inbuffer, "inbuffer", 1);
@ -1460,7 +1460,7 @@ GST_START_TEST (test_half_f64)
inbuffer = gst_buffer_new_and_alloc (16);
gst_buffer_fill (inbuffer, 0, in, 16);
caps = gst_caps_from_string (VOLUME_CAPS_STRING_F64);
gst_pad_set_caps (mysrcpad, caps);
gst_check_setup_events (mysrcpad, volume, caps, GST_FORMAT_TIME);
gst_caps_unref (caps);
ASSERT_BUFFER_REFCOUNT (inbuffer, "inbuffer", 1);
/* FIXME: reffing the inbuffer should make the transformation not be
@ -1510,7 +1510,7 @@ GST_START_TEST (test_double_f64)
inbuffer = gst_buffer_new_and_alloc (16);
gst_buffer_fill (inbuffer, 0, in, 16);
caps = gst_caps_from_string (VOLUME_CAPS_STRING_F64);
gst_pad_set_caps (mysrcpad, caps);
gst_check_setup_events (mysrcpad, volume, caps, GST_FORMAT_TIME);
gst_caps_unref (caps);
ASSERT_BUFFER_REFCOUNT (inbuffer, "inbuffer", 1);
/* FIXME: reffing the inbuffer should make the transformation not be
@ -1561,7 +1561,7 @@ GST_START_TEST (test_ten_f64)
gst_buffer_fill (inbuffer, 0, in, 16);
fail_unless (gst_buffer_memcmp (inbuffer, 0, in, 16) == 0);
caps = gst_caps_from_string (VOLUME_CAPS_STRING_F64);
gst_pad_set_caps (mysrcpad, caps);
gst_check_setup_events (mysrcpad, volume, caps, GST_FORMAT_TIME);
gst_caps_unref (caps);
ASSERT_BUFFER_REFCOUNT (inbuffer, "inbuffer", 1);
/* FIXME: reffing the inbuffer should make the transformation not be
@ -1612,7 +1612,7 @@ GST_START_TEST (test_mute_f64)
inbuffer = gst_buffer_new_and_alloc (16);
gst_buffer_fill (inbuffer, 0, in, 16);
caps = gst_caps_from_string (VOLUME_CAPS_STRING_F64);
gst_pad_set_caps (mysrcpad, caps);
gst_check_setup_events (mysrcpad, volume, caps, GST_FORMAT_TIME);
gst_caps_unref (caps);
ASSERT_BUFFER_REFCOUNT (inbuffer, "inbuffer", 1);
/* FIXME: reffing the inbuffer should make the transformation not be
@ -1661,7 +1661,7 @@ GST_START_TEST (test_wrong_caps)
inbuffer = gst_buffer_new_and_alloc (4);
gst_buffer_fill (inbuffer, 0, in, 4);
caps = gst_caps_from_string (VOLUME_WRONG_CAPS_STRING);
gst_pad_set_caps (mysrcpad, caps);
gst_check_setup_events (mysrcpad, volume, caps, GST_FORMAT_TIME);
gst_caps_unref (caps);
ASSERT_BUFFER_REFCOUNT (inbuffer, "inbuffer", 1);
gst_buffer_ref (inbuffer);
@ -1706,7 +1706,7 @@ GST_START_TEST (test_passthrough)
inbuffer = gst_buffer_new_and_alloc (4);
gst_buffer_fill (inbuffer, 0, in, 4);
caps = gst_caps_from_string (VOLUME_CAPS_STRING_S16);
gst_pad_set_caps (mysrcpad, caps);
gst_check_setup_events (mysrcpad, volume, caps, GST_FORMAT_TIME);
gst_caps_unref (caps);
ASSERT_BUFFER_REFCOUNT (inbuffer, "inbuffer", 1);
@ -1786,7 +1786,7 @@ GST_START_TEST (test_controller_processing)
inbuffer = gst_buffer_new_and_alloc (4);
gst_buffer_fill (inbuffer, 0, in, 4);
caps = gst_caps_from_string (VOLUME_CAPS_STRING_S16);
gst_pad_set_caps (mysrcpad, caps);
gst_check_setup_events (mysrcpad, volume, caps, GST_FORMAT_TIME);
GST_BUFFER_TIMESTAMP (inbuffer) = 0;
gst_caps_unref (caps);
ASSERT_BUFFER_REFCOUNT (inbuffer, "inbuffer", 1);
@ -1845,7 +1845,7 @@ GST_START_TEST (test_controller_defaults_at_ts0)
inbuffer = gst_buffer_new_and_alloc (1000 * sizeof (gint16));
gst_buffer_memset (inbuffer, 0, 0, 1000 * sizeof (gint16));
caps = gst_caps_from_string (VOLUME_CAPS_STRING_S16);
gst_pad_set_caps (mysrcpad, caps);
gst_check_setup_events (mysrcpad, volume, caps, GST_FORMAT_TIME);
GST_BUFFER_TIMESTAMP (inbuffer) = 0;
gst_caps_unref (caps);

View file

@ -70,12 +70,18 @@ static GstElement *
setup_vorbisdec (void)
{
GstElement *vorbisdec;
GstCaps *caps;
GST_DEBUG ("setup_vorbisdec");
vorbisdec = gst_check_setup_element ("vorbisdec");
mysrcpad = gst_check_setup_src_pad (vorbisdec, &srctemplate);
mysinkpad = gst_check_setup_sink_pad (vorbisdec, &sinktemplate);
gst_pad_set_active (mysrcpad, TRUE);
caps = gst_caps_new_empty_simple ("audio/x-vorbis");
gst_check_setup_events (mysrcpad, vorbisdec, caps, GST_FORMAT_TIME);
gst_caps_unref (caps);
gst_pad_set_active (mysinkpad, TRUE);
return vorbisdec;

View file

@ -93,12 +93,18 @@ static GstElement *
setup_vorbistag (void)
{
GstElement *vorbistag;
GstCaps *caps;
GST_DEBUG ("setup_vorbistag");
vorbistag = gst_check_setup_element ("vorbistag");
mysrcpad = gst_check_setup_src_pad (vorbistag, &srctemplate);
mysinkpad = gst_check_setup_sink_pad (vorbistag, &sinktemplate);
gst_pad_set_active (mysrcpad, TRUE);
caps = gst_caps_new_empty_simple ("audio/x-vorbis");
gst_check_setup_events (mysrcpad, vorbistag, caps, GST_FORMAT_TIME);
gst_caps_unref (caps);
gst_pad_set_active (mysinkpad, TRUE);
return vorbistag;