mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-10-07 19:22:15 +00:00
[MOVED FROM BAD 6/6] tests: fix more unit tests
This commit is contained in:
parent
caa34f7bf7
commit
8337fcfe99
2 changed files with 18 additions and 22 deletions
|
@ -23,16 +23,16 @@
|
||||||
static GstStaticPadTemplate sinktemplate = GST_STATIC_PAD_TEMPLATE ("sink",
|
static GstStaticPadTemplate sinktemplate = GST_STATIC_PAD_TEMPLATE ("sink",
|
||||||
GST_PAD_SINK,
|
GST_PAD_SINK,
|
||||||
GST_PAD_ALWAYS,
|
GST_PAD_ALWAYS,
|
||||||
GST_STATIC_CAPS ("video/x-raw-yuv, "
|
GST_STATIC_CAPS ("video/x-raw, "
|
||||||
"format = (fourcc) I420, "
|
"format = (string) I420, "
|
||||||
"width = (int) [1, MAX], "
|
"width = (int) [1, MAX], "
|
||||||
"height = (int) [1, MAX], " "framerate = (fraction) [0, MAX]"));
|
"height = (int) [1, MAX], " "framerate = (fraction) [0, MAX]"));
|
||||||
|
|
||||||
static GstStaticPadTemplate srctemplate = GST_STATIC_PAD_TEMPLATE ("src",
|
static GstStaticPadTemplate srctemplate = GST_STATIC_PAD_TEMPLATE ("src",
|
||||||
GST_PAD_SRC,
|
GST_PAD_SRC,
|
||||||
GST_PAD_ALWAYS,
|
GST_PAD_ALWAYS,
|
||||||
GST_STATIC_CAPS ("video/x-raw-yuv, "
|
GST_STATIC_CAPS ("video/x-raw, "
|
||||||
"format = (fourcc) I420, "
|
"format = (string) I420, "
|
||||||
"width = (int) [1, MAX], "
|
"width = (int) [1, MAX], "
|
||||||
"height = (int) [1, MAX], " "framerate = (fraction) [0, MAX]"));
|
"height = (int) [1, MAX], " "framerate = (fraction) [0, MAX]"));
|
||||||
|
|
||||||
|
@ -122,18 +122,18 @@ GST_START_TEST (test_decode_simple)
|
||||||
GstBuffer *buffer;
|
GstBuffer *buffer;
|
||||||
gint i;
|
gint i;
|
||||||
GList *l;
|
GList *l;
|
||||||
|
GstSegment seg;
|
||||||
|
|
||||||
bin =
|
bin =
|
||||||
setup_vp8dec
|
setup_vp8dec
|
||||||
("video/x-raw-yuv,format=(fourcc)I420,width=(int)320,height=(int)240,framerate=(fraction)25/1");
|
("video/x-raw,format=(string)I420,width=(int)320,height=(int)240,framerate=(fraction)25/1");
|
||||||
|
|
||||||
fail_unless (gst_pad_push_event (srcpad, gst_event_new_new_segment (FALSE,
|
gst_segment_init (&seg, GST_FORMAT_TIME);
|
||||||
1.0, GST_FORMAT_TIME, 0, gst_util_uint64_scale (20, GST_SECOND,
|
seg.stop = gst_util_uint64_scale (20, GST_SECOND, 25);
|
||||||
25), 0)));
|
fail_unless (gst_pad_push_event (srcpad, gst_event_new_segment (&seg)));
|
||||||
|
|
||||||
buffer = gst_buffer_new_and_alloc (320 * 240 + 2 * 160 * 120);
|
buffer = gst_buffer_new_and_alloc (320 * 240 + 2 * 160 * 120);
|
||||||
memset (GST_BUFFER_DATA (buffer), 0, GST_BUFFER_SIZE (buffer));
|
gst_buffer_memset (buffer, 0, 0, -1);
|
||||||
gst_buffer_set_caps (buffer, GST_PAD_CAPS (srcpad));
|
|
||||||
|
|
||||||
for (i = 0; i < 20; i++) {
|
for (i = 0; i < 20; i++) {
|
||||||
GST_BUFFER_TIMESTAMP (buffer) = gst_util_uint64_scale (i, GST_SECOND, 25);
|
GST_BUFFER_TIMESTAMP (buffer) = gst_util_uint64_scale (i, GST_SECOND, 25);
|
||||||
|
@ -155,8 +155,6 @@ GST_START_TEST (test_decode_simple)
|
||||||
gst_util_uint64_scale (i, GST_SECOND, 25));
|
gst_util_uint64_scale (i, GST_SECOND, 25));
|
||||||
fail_unless_equals_uint64 (GST_BUFFER_DURATION (buffer),
|
fail_unless_equals_uint64 (GST_BUFFER_DURATION (buffer),
|
||||||
gst_util_uint64_scale (1, GST_SECOND, 25));
|
gst_util_uint64_scale (1, GST_SECOND, 25));
|
||||||
fail_unless (gst_caps_can_intersect (GST_BUFFER_CAPS (buffer),
|
|
||||||
GST_PAD_CAPS (srcpad)));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
cleanup_vp8dec (bin);
|
cleanup_vp8dec (bin);
|
||||||
|
|
|
@ -30,8 +30,8 @@ static GstStaticPadTemplate sinktemplate = GST_STATIC_PAD_TEMPLATE ("sink",
|
||||||
static GstStaticPadTemplate srctemplate = GST_STATIC_PAD_TEMPLATE ("src",
|
static GstStaticPadTemplate srctemplate = GST_STATIC_PAD_TEMPLATE ("src",
|
||||||
GST_PAD_SRC,
|
GST_PAD_SRC,
|
||||||
GST_PAD_ALWAYS,
|
GST_PAD_ALWAYS,
|
||||||
GST_STATIC_CAPS ("video/x-raw-yuv, "
|
GST_STATIC_CAPS ("video/x-raw, "
|
||||||
"format = (fourcc) I420, "
|
"format = (string) I420, "
|
||||||
"width = (int) [1, MAX], "
|
"width = (int) [1, MAX], "
|
||||||
"height = (int) [1, MAX], " "framerate = (fraction) [0, MAX]"));
|
"height = (int) [1, MAX], " "framerate = (fraction) [0, MAX]"));
|
||||||
|
|
||||||
|
@ -97,20 +97,20 @@ GST_START_TEST (test_encode_simple)
|
||||||
gint i;
|
gint i;
|
||||||
GList *l;
|
GList *l;
|
||||||
GstCaps *outcaps;
|
GstCaps *outcaps;
|
||||||
|
GstSegment seg;
|
||||||
|
|
||||||
vp8enc =
|
vp8enc =
|
||||||
setup_vp8enc
|
setup_vp8enc
|
||||||
("video/x-raw-yuv,format=(fourcc)I420,width=(int)320,height=(int)240,framerate=(fraction)25/1");
|
("video/x-raw,format=(string)I420,width=(int)320,height=(int)240,framerate=(fraction)25/1");
|
||||||
|
|
||||||
g_object_set (vp8enc, "max-latency", 5, NULL);
|
g_object_set (vp8enc, "max-latency", 5, NULL);
|
||||||
|
|
||||||
fail_unless (gst_pad_push_event (srcpad, gst_event_new_new_segment (FALSE,
|
gst_segment_init (&seg, GST_FORMAT_TIME);
|
||||||
1.0, GST_FORMAT_TIME, 0, gst_util_uint64_scale (20, GST_SECOND,
|
seg.stop = gst_util_uint64_scale (20, GST_SECOND, 25);
|
||||||
25), 0)));
|
fail_unless (gst_pad_push_event (srcpad, gst_event_new_segment (&seg)));
|
||||||
|
|
||||||
buffer = gst_buffer_new_and_alloc (320 * 240 + 2 * 160 * 120);
|
buffer = gst_buffer_new_and_alloc (320 * 240 + 2 * 160 * 120);
|
||||||
memset (GST_BUFFER_DATA (buffer), 0, GST_BUFFER_SIZE (buffer));
|
gst_buffer_memset (buffer, 0, 0, -1);
|
||||||
gst_buffer_set_caps (buffer, GST_PAD_CAPS (srcpad));
|
|
||||||
|
|
||||||
for (i = 0; i < 20; i++) {
|
for (i = 0; i < 20; i++) {
|
||||||
GST_BUFFER_TIMESTAMP (buffer) = gst_util_uint64_scale (i, GST_SECOND, 25);
|
GST_BUFFER_TIMESTAMP (buffer) = gst_util_uint64_scale (i, GST_SECOND, 25);
|
||||||
|
@ -143,8 +143,6 @@ GST_START_TEST (test_encode_simple)
|
||||||
gst_util_uint64_scale (i, GST_SECOND, 25));
|
gst_util_uint64_scale (i, GST_SECOND, 25));
|
||||||
fail_unless_equals_uint64 (GST_BUFFER_DURATION (buffer),
|
fail_unless_equals_uint64 (GST_BUFFER_DURATION (buffer),
|
||||||
gst_util_uint64_scale (1, GST_SECOND, 25));
|
gst_util_uint64_scale (1, GST_SECOND, 25));
|
||||||
|
|
||||||
fail_unless (gst_caps_can_intersect (GST_BUFFER_CAPS (buffer), outcaps));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
gst_caps_unref (outcaps);
|
gst_caps_unref (outcaps);
|
||||||
|
|
Loading…
Reference in a new issue