summaryrefslogtreecommitdiff
path: root/tests/check/elements/x264enc.c
diff options
context:
space:
mode:
authorMark Nauwelaerts <mark.nauwelaerts@collabora.co.uk>2010-04-13 16:59:03 +0200
committerMark Nauwelaerts <mark.nauwelaerts@collabora.co.uk>2010-04-19 10:39:36 +0200
commit6ebb4e0fedf0ee8c75eba9269600f61caf6b83d7 (patch)
tree8622b51b036bfc82f67290cded35350dea21f166 /tests/check/elements/x264enc.c
parentd17388afa99932e29959b87df16c1421f6e767f3 (diff)
x264enc: adaptive NALU type checking
In particular, be less picky about SEI NALU order, which makes test more robust with respect to changes in libx264. See also #615410.
Diffstat (limited to 'tests/check/elements/x264enc.c')
-rw-r--r--tests/check/elements/x264enc.c27
1 files changed, 11 insertions, 16 deletions
diff --git a/tests/check/elements/x264enc.c b/tests/check/elements/x264enc.c
index c256f4e3..ecfa4d41 100644
--- a/tests/check/elements/x264enc.c
+++ b/tests/check/elements/x264enc.c
@@ -154,7 +154,7 @@ GST_START_TEST (test_video_pad)
switch (i) {
case 0:
{
- gint nsize, npos, j, type;
+ gint nsize, npos, j, type, next_type;
guint8 *data = GST_BUFFER_DATA (outbuffer);
gint size = GST_BUFFER_SIZE (outbuffer);
@@ -162,6 +162,8 @@ GST_START_TEST (test_video_pad)
npos = 0;
j = 0;
+ /* need SPS first */
+ next_type = 7;
/* loop through NALs */
while (npos < size) {
fail_unless (size - npos >= 4);
@@ -169,24 +171,17 @@ GST_START_TEST (test_video_pad)
fail_unless (nsize > 0);
fail_unless (npos + 4 + nsize <= size);
type = data[npos + 4] & 0x1F;
- /* check the first NALs, disregard AU (9) */
- if (type != 9) {
- switch (j) {
- case 0:
- /* SEI */
- fail_unless (type == 6);
- break;
- case 1:
+ /* check the first NALs, disregard AU (9), SEI (6) */
+ if (type != 9 && type != 6) {
+ fail_unless (type == next_type);
+ switch (type) {
+ case 7:
/* SPS */
- fail_unless (type == 7);
+ next_type = 8;
break;
- case 2:
+ case 8:
/* PPS */
- fail_unless (type == 8);
- break;
- case 3:
- /* IDR */
- fail_unless (type == 5);
+ next_type = 5;
break;
default:
break;