Browse Source

Test real decoder fixtures and malformed video parameter sets

master
evgeny 5 days ago
parent
commit
96e8f6c0ac
  1. 1
      src/Makefile.am
  2. 24
      tests/test_call_video.c

1
src/Makefile.am

@ -188,6 +188,7 @@ utun_CORE_SOURCES = \
call/call_video.c \
call/call_video_bitstream.c \
call/call_video_bitstream.h \
call/call_video_fixtures.h \
call/call_video.h \
call/call_video_transport.c \
call/call_video_transport.h \

24
tests/test_call_video.c

@ -1,4 +1,5 @@
#include "call/call_video.h"
#include "call/call_video_bitstream.h"
#include "debug_config.h"
#include <stdio.h>
#include <stdlib.h>
@ -134,7 +135,28 @@ static void rejected(void) {
call_video_receiver_destroy(r);
puts("video: gap, timeout, replay, malformed KEY, truncated/oversized packets, atomic parse PASS");
}
static void bitstreams(void) {
uint8_t bytes[8192]; struct call_video_bitstream s;
for (int codec = 1; codec <= 2; ++codec) {
for (int profile = 1; profile <= (codec == 1 ? 2 : 1); ++profile) {
int size = call_video_probe_key(codec, profile, bytes, sizeof(bytes)); CHECK(size > 0);
CHECK(!call_video_inspect_key(codec, bytes, size, &s));
CHECK(s.width == 1280 && s.height == 720 && s.profile == (unsigned)profile && s.level == (codec == 1 ? 31u : 93u));
CHECK(s.dpb >= 3);
struct call_video_format f = {1, 1280, 720, 30, 0, codec, s.level, 4000000, profile};
CHECK(!call_video_check_key(&f, bytes, size));
f.width = 640; CHECK(call_video_check_key(&f, bytes, size) < 0);
struct call_video_bitstream saved = s;
for (int i = 0; i < 32; ++i) {
CHECK(call_video_inspect_key(codec, bytes, i, &s) < 0);
CHECK(!memcmp(&saved, &s, sizeof(s)));
}
bytes[0] = 255; CHECK(call_video_inspect_key(codec, bytes, size, &s) < 0);
}
}
puts("video: real AVC Baseline/CB and HEVC IDR, multi-picture DPB, atomic malformed parse PASS");
}
int main(void) {
debug_config_init(); debug_set_level(DEBUG_LEVEL_ERROR);
capabilities(); envelopes(); roundtrip(); rejected(); return 0;
capabilities(); envelopes(); roundtrip(); rejected(); bitstreams(); return 0;
}

Loading…
Cancel
Save