Skip to content

Commit 08d0428

Browse files
committed
test: keep the VP9 resolution change test above the NVDEC minimum
hardwareFollowsResolutionChange halved 320x240 to 160x120 and asserted that the decoder was still a hardware one. NVDEC does not decode VP9 below 128 pixels on the shorter side, so it refuses that size, as it should, and the stream goes on in libvpx; the test failed on an NVIDIA GPU for that reason. The call now sends 640x480 and halves it to 320x240, which every hardware decoder takes. Run on an NVIDIA GeForce RTX 3080 with NVDEC built on Windows, which is the same decoder code over the same cuvid API: the test passes with NVDEC the only decoder accepted as hardware.
1 parent d84ba77 commit 08d0428

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

‎webrtc/src/test/java/dev/onvoid/webrtc/HardwareVideoDecoderIntegrationTest.java‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,17 +182,21 @@ void hardwareFollowsResolutionChange() throws Exception {
182182
CountDownLatch half = new CountDownLatch(10);
183183

184184
try (TestMediaCall call = new TestMediaCall(hardware, true, false, VP9)) {
185+
// Large enough that half the size is still one every hardware
186+
// decoder takes: NVDEC does not decode VP9 below 128 pixels on the
187+
// shorter side, and falls back to libvpx for such a stream.
188+
call.setVideoSize(640, 480);
185189
call.negotiate();
186190

187191
RTCRtpReceiver receiver = call.getReceiver("video");
188192
VideoTrack track = (VideoTrack) receiver.getTrack();
189193
VideoTrackSink sink = frame -> {
190194
int width = frame.buffer.getWidth();
191195

192-
if (width == 320 && frame.buffer.getHeight() == 240) {
196+
if (width == 640 && frame.buffer.getHeight() == 480) {
193197
full.countDown();
194198
}
195-
else if (width == 160 && frame.buffer.getHeight() == 120) {
199+
else if (width == 320 && frame.buffer.getHeight() == 240) {
196200
half.countDown();
197201
}
198202

0 commit comments

Comments
 (0)