mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-24 10:41:04 +00:00
tests: Remove theoraenc discont test
It should be fixed differently, see https://bugzilla.gnome.org/show_bug.cgi?id=663262
This commit is contained in:
parent
4f1e7eec40
commit
416029a006
1 changed files with 0 additions and 114 deletions
|
@ -308,119 +308,6 @@ GST_START_TEST (test_continuity)
|
|||
|
||||
GST_END_TEST;
|
||||
|
||||
static gboolean
|
||||
drop_second_data_buffer (GstPad * droppad, GstBuffer * buffer, gpointer unused)
|
||||
{
|
||||
return !(GST_BUFFER_OFFSET (buffer) == 1);
|
||||
}
|
||||
|
||||
GST_START_TEST (test_discontinuity)
|
||||
{
|
||||
GstElement *bin;
|
||||
GstPad *pad, *droppad;
|
||||
gchar *pipe_str;
|
||||
GstBuffer *buffer;
|
||||
GError *error = NULL;
|
||||
guint drop_id;
|
||||
|
||||
pipe_str = g_strdup_printf ("videotestsrc num-buffers=10"
|
||||
" ! video/x-raw-yuv,format=(fourcc)I420,framerate=10/1"
|
||||
" ! theoraenc ! fakesink name=fs0");
|
||||
|
||||
bin = gst_parse_launch (pipe_str, &error);
|
||||
fail_unless (bin != NULL, "Error parsing pipeline: %s",
|
||||
error ? error->message : "(invalid error)");
|
||||
g_free (pipe_str);
|
||||
|
||||
/* the plan: same as test_continuity, but dropping a buffer and seeing if
|
||||
theoraenc correctly notes the discontinuity */
|
||||
|
||||
/* get the pad to use to drop buffers */
|
||||
{
|
||||
GstElement *sink = gst_bin_get_by_name (GST_BIN (bin), "theoraenc0");
|
||||
|
||||
fail_unless (sink != NULL, "Could not get theoraenc out of bin");
|
||||
droppad = gst_element_get_static_pad (sink, "sink");
|
||||
fail_unless (droppad != NULL, "Could not get pad out of theoraenc");
|
||||
gst_object_unref (sink);
|
||||
}
|
||||
|
||||
/* get the pad */
|
||||
{
|
||||
GstElement *sink = gst_bin_get_by_name (GST_BIN (bin), "fs0");
|
||||
|
||||
fail_unless (sink != NULL, "Could not get fakesink out of bin");
|
||||
pad = gst_element_get_static_pad (sink, "sink");
|
||||
fail_unless (pad != NULL, "Could not get pad out of fakesink");
|
||||
gst_object_unref (sink);
|
||||
}
|
||||
|
||||
drop_id = gst_pad_add_buffer_probe (droppad,
|
||||
G_CALLBACK (drop_second_data_buffer), NULL);
|
||||
gst_buffer_straw_start_pipeline (bin, pad);
|
||||
|
||||
/* header packets should have timestamp == NONE, granulepos 0 */
|
||||
buffer = gst_buffer_straw_get_buffer (bin, pad);
|
||||
check_buffer_timestamp (buffer, GST_CLOCK_TIME_NONE);
|
||||
check_buffer_duration (buffer, GST_CLOCK_TIME_NONE);
|
||||
check_buffer_granulepos (buffer, 0);
|
||||
check_buffer_is_header (buffer, TRUE);
|
||||
gst_buffer_unref (buffer);
|
||||
|
||||
buffer = gst_buffer_straw_get_buffer (bin, pad);
|
||||
check_buffer_timestamp (buffer, GST_CLOCK_TIME_NONE);
|
||||
check_buffer_duration (buffer, GST_CLOCK_TIME_NONE);
|
||||
check_buffer_granulepos (buffer, 0);
|
||||
check_buffer_is_header (buffer, TRUE);
|
||||
gst_buffer_unref (buffer);
|
||||
|
||||
buffer = gst_buffer_straw_get_buffer (bin, pad);
|
||||
check_buffer_timestamp (buffer, GST_CLOCK_TIME_NONE);
|
||||
check_buffer_duration (buffer, GST_CLOCK_TIME_NONE);
|
||||
check_buffer_granulepos (buffer, 0);
|
||||
check_buffer_is_header (buffer, TRUE);
|
||||
gst_buffer_unref (buffer);
|
||||
|
||||
{
|
||||
buffer = gst_buffer_straw_get_buffer (bin, pad);
|
||||
check_buffer_timestamp (buffer, 0);
|
||||
/* plain division because I know the answer is exact */
|
||||
check_buffer_duration (buffer, GST_SECOND / 10);
|
||||
check_buffer_granulepos (buffer, 1 << GRANULEPOS_SHIFT);
|
||||
check_buffer_is_header (buffer, FALSE);
|
||||
fail_if (GST_BUFFER_IS_DISCONT (buffer), "expected continuous buffer yo");
|
||||
gst_buffer_unref (buffer);
|
||||
|
||||
/* check discontinuity with the next buffer */
|
||||
buffer = gst_buffer_straw_get_buffer (bin, pad);
|
||||
check_buffer_duration (buffer, GST_SECOND / 10);
|
||||
/* After a discont, we'll always get a keyframe, so this one should be
|
||||
* 3<<GRANULEPOS_SHIFT */
|
||||
check_buffer_granulepos (buffer, 3 << GRANULEPOS_SHIFT);
|
||||
check_buffer_is_header (buffer, FALSE);
|
||||
fail_unless (GST_BUFFER_IS_DISCONT (buffer),
|
||||
"expected discontinuous buffer yo");
|
||||
gst_buffer_unref (buffer);
|
||||
|
||||
/* Then the buffer after that should be continuous */
|
||||
buffer = gst_buffer_straw_get_buffer (bin, pad);
|
||||
fail_if (GST_BUFFER_IS_DISCONT (buffer), "expected continuous buffer yo");
|
||||
/* plain division because I know the answer is exact */
|
||||
check_buffer_duration (buffer, GST_SECOND / 10);
|
||||
check_buffer_granulepos (buffer, (3 << GRANULEPOS_SHIFT) | 1);
|
||||
check_buffer_is_header (buffer, FALSE);
|
||||
gst_buffer_unref (buffer);
|
||||
}
|
||||
|
||||
gst_buffer_straw_stop_pipeline (bin, pad);
|
||||
gst_pad_remove_buffer_probe (droppad, drop_id);
|
||||
|
||||
gst_object_unref (droppad);
|
||||
gst_object_unref (pad);
|
||||
gst_object_unref (bin);
|
||||
}
|
||||
|
||||
GST_END_TEST;
|
||||
|
||||
#endif /* #ifndef GST_DISABLE_PARSE */
|
||||
|
||||
|
@ -437,7 +324,6 @@ theoraenc_suite (void)
|
|||
#ifndef GST_DISABLE_PARSE
|
||||
tcase_add_test (tc_chain, test_granulepos_offset);
|
||||
tcase_add_test (tc_chain, test_continuity);
|
||||
tcase_add_test (tc_chain, test_discontinuity);
|
||||
#endif
|
||||
|
||||
return s;
|
||||
|
|
Loading…
Reference in a new issue