Skip to content
Permalink
Browse files
Make sure to set bitrate and framerate for VPX encoders
https://bugs.webkit.org/show_bug.cgi?id=246626
rdar://problem/101245414

Reviewed by Eric Carlson.

Make sure to set bitrate and framerate values if they are not provided.
Make decoder configuration more precise based on the encoder configuration.
Make sure to error the encoder if InitEncode returns an error.

Covered by rebased tests.

* LayoutTests/imported/w3c/web-platform-tests/webcodecs/full-cycle-test.https.any_h264_annexb-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/webcodecs/full-cycle-test.https.any_h264_avc-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/webcodecs/full-cycle-test.https.any_vp8-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/webcodecs/full-cycle-test.https.any_vp9_p0-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/webcodecs/reconfiguring-encoder.https.any_h264_annexb-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/webcodecs/reconfiguring-encoder.https.any_h264_avc-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/webcodecs/reconfiguring-encoder.https.any_vp8-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/webcodecs/reconfiguring-encoder.https.any_vp9_p0-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/webcodecs/temporal-svc-encoding.https.any_vp8-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/webcodecs/temporal-svc-encoding.https.any_vp9-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/webcodecs/video-encoder.https.any-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/webcodecs/videoFrame-createImageBitmap.https.any-expected.txt:
* Source/WebCore/Modules/webcodecs/WebCodecsVideoEncoder.cpp:
(WebCore::WebCodecsVideoEncoder::configure):
(WebCore::WebCodecsVideoEncoder::createEncodedChunkMetadata):
* Source/WebCore/Modules/webcodecs/WebCodecsVideoEncoder.h:
* Source/WebCore/platform/LibWebRTCVPXVideoEncoder.cpp:
(WebCore::LibWebRTCVPXInternalVideoEncoder::create):
(WebCore::LibWebRTCVPXVideoEncoder::create):
(WebCore::LibWebRTCVPXVideoEncoder::LibWebRTCVPXVideoEncoder):
(WebCore::LibWebRTCVPXVideoEncoder::initialize):
(WebCore::LibWebRTCVPXInternalVideoEncoder::LibWebRTCVPXInternalVideoEncoder):
(WebCore::LibWebRTCVPXInternalVideoEncoder::initialize):
(WebCore::LibWebRTCVPXInternalVideoEncoder::encode):
* Source/WebCore/platform/LibWebRTCVPXVideoEncoder.h:

Canonical link: https://commits.webkit.org/255666@main
  • Loading branch information
youennf committed Oct 18, 2022
1 parent b6eab27 commit 449a88665b2df5e298ee863b72b9515bfe8e029e
Show file tree
Hide file tree
Showing 16 changed files with 293 additions and 155 deletions.
@@ -1,7 +1,5 @@
CONSOLE MESSAGE: TypeError: Config is not valid
CONSOLE MESSAGE: TypeError: Config is not valid
CONSOLE MESSAGE: TypeError: Config is not valid
CONSOLE MESSAGE: TypeError: Config is not valid
CONSOLE MESSAGE: TypeError: Type error
CONSOLE MESSAGE: TypeError: Type error

FAIL Encoding and decoding cycle promise_test: Unhandled rejection with value: object "InvalidStateError: VideoDecoder is not configured"

@@ -1,6 +1,6 @@
CONSOLE MESSAGE: TypeError: Config is not valid
CONSOLE MESSAGE: TypeError: Config is not valid
CONSOLE MESSAGE: TypeError: Config is not valid
CONSOLE MESSAGE: TypeError: Type error
CONSOLE MESSAGE: TypeError: Type error
CONSOLE MESSAGE: TypeError: Type error

FAIL Encoding and decoding cycle promise_test: Unhandled rejection with value: object "InvalidStateError: VideoDecoder is not configured"

@@ -1,3 +1,21 @@
CONSOLE MESSAGE: TypeError: Type error
CONSOLE MESSAGE: InvalidStateError: VideoDecoder is not configured
CONSOLE MESSAGE: InvalidStateError: VideoDecoder is not configured
CONSOLE MESSAGE: InvalidStateError: VideoDecoder is not configured
CONSOLE MESSAGE: InvalidStateError: VideoDecoder is not configured
CONSOLE MESSAGE: InvalidStateError: VideoDecoder is not configured
CONSOLE MESSAGE: InvalidStateError: VideoDecoder is not configured
CONSOLE MESSAGE: InvalidStateError: VideoDecoder is not configured
CONSOLE MESSAGE: InvalidStateError: VideoDecoder is not configured
CONSOLE MESSAGE: InvalidStateError: VideoDecoder is not configured
CONSOLE MESSAGE: InvalidStateError: VideoDecoder is not configured
CONSOLE MESSAGE: InvalidStateError: VideoDecoder is not configured
CONSOLE MESSAGE: InvalidStateError: VideoDecoder is not configured
CONSOLE MESSAGE: InvalidStateError: VideoDecoder is not configured
CONSOLE MESSAGE: InvalidStateError: VideoDecoder is not configured
CONSOLE MESSAGE: InvalidStateError: VideoDecoder is not configured

Harness Error (FAIL), message = InvalidStateError: VideoDecoder is not configured

FAIL Encoding and decoding cycle promise_test: Unhandled rejection with value: object "InvalidStateError: VideoDecoder is not configured"

@@ -1,3 +1,21 @@
CONSOLE MESSAGE: TypeError: Type error
CONSOLE MESSAGE: InvalidStateError: VideoDecoder is not configured
CONSOLE MESSAGE: InvalidStateError: VideoDecoder is not configured
CONSOLE MESSAGE: InvalidStateError: VideoDecoder is not configured
CONSOLE MESSAGE: InvalidStateError: VideoDecoder is not configured
CONSOLE MESSAGE: InvalidStateError: VideoDecoder is not configured
CONSOLE MESSAGE: InvalidStateError: VideoDecoder is not configured
CONSOLE MESSAGE: InvalidStateError: VideoDecoder is not configured
CONSOLE MESSAGE: InvalidStateError: VideoDecoder is not configured
CONSOLE MESSAGE: InvalidStateError: VideoDecoder is not configured
CONSOLE MESSAGE: InvalidStateError: VideoDecoder is not configured
CONSOLE MESSAGE: InvalidStateError: VideoDecoder is not configured
CONSOLE MESSAGE: InvalidStateError: VideoDecoder is not configured
CONSOLE MESSAGE: InvalidStateError: VideoDecoder is not configured
CONSOLE MESSAGE: InvalidStateError: VideoDecoder is not configured
CONSOLE MESSAGE: InvalidStateError: VideoDecoder is not configured

Harness Error (FAIL), message = InvalidStateError: VideoDecoder is not configured

FAIL Encoding and decoding cycle promise_test: Unhandled rejection with value: object "InvalidStateError: VideoDecoder is not configured"

@@ -1,7 +1,6 @@
CONSOLE MESSAGE: Error: assert_unreached: assert_equals: expected (number) 800 but got (undefined) undefined Reached unreachable code
CONSOLE MESSAGE: Error: assert_unreached: assert_equals: expected (number) 640 but got (undefined) undefined Reached unreachable code
CONSOLE MESSAGE: Error: assert_unreached: assert_equals: expected 800 but got 640 Reached unreachable code

Harness Error (FAIL), message = Error: assert_unreached: assert_equals: expected (number) 640 but got (undefined) undefined Reached unreachable code
Harness Error (FAIL), message = Error: assert_unreached: assert_equals: expected 800 but got 640 Reached unreachable code

FAIL Reconfiguring encoder assert_equals: expected 16 but got 1

@@ -1,37 +1,37 @@
CONSOLE MESSAGE: Error: assert_unreached: assert_equals: expected (number) 800 but got (undefined) undefined Reached unreachable code
CONSOLE MESSAGE: Error: assert_unreached: assert_equals: expected (number) 800 but got (undefined) undefined Reached unreachable code
CONSOLE MESSAGE: Error: assert_unreached: assert_equals: expected (number) 800 but got (undefined) undefined Reached unreachable code
CONSOLE MESSAGE: Error: assert_unreached: assert_equals: expected (number) 800 but got (undefined) undefined Reached unreachable code
CONSOLE MESSAGE: Error: assert_unreached: assert_equals: expected (number) 800 but got (undefined) undefined Reached unreachable code
CONSOLE MESSAGE: Error: assert_unreached: assert_equals: expected (number) 800 but got (undefined) undefined Reached unreachable code
CONSOLE MESSAGE: Error: assert_unreached: assert_equals: expected (number) 800 but got (undefined) undefined Reached unreachable code
CONSOLE MESSAGE: Error: assert_unreached: assert_equals: expected (number) 800 but got (undefined) undefined Reached unreachable code
CONSOLE MESSAGE: Error: assert_unreached: assert_equals: expected (number) 800 but got (undefined) undefined Reached unreachable code
CONSOLE MESSAGE: Error: assert_unreached: assert_equals: expected (number) 800 but got (undefined) undefined Reached unreachable code
CONSOLE MESSAGE: Error: assert_unreached: assert_equals: expected (number) 800 but got (undefined) undefined Reached unreachable code
CONSOLE MESSAGE: Error: assert_unreached: assert_equals: expected (number) 800 but got (undefined) undefined Reached unreachable code
CONSOLE MESSAGE: Error: assert_unreached: assert_equals: expected (number) 800 but got (undefined) undefined Reached unreachable code
CONSOLE MESSAGE: Error: assert_unreached: assert_equals: expected (number) 800 but got (undefined) undefined Reached unreachable code
CONSOLE MESSAGE: Error: assert_unreached: assert_equals: expected (number) 800 but got (undefined) undefined Reached unreachable code
CONSOLE MESSAGE: Error: assert_unreached: assert_equals: expected (number) 800 but got (undefined) undefined Reached unreachable code
CONSOLE MESSAGE: Error: assert_unreached: assert_equals: expected (number) 640 but got (undefined) undefined Reached unreachable code
CONSOLE MESSAGE: Error: assert_unreached: assert_equals: expected (number) 640 but got (undefined) undefined Reached unreachable code
CONSOLE MESSAGE: Error: assert_unreached: assert_equals: expected (number) 640 but got (undefined) undefined Reached unreachable code
CONSOLE MESSAGE: Error: assert_unreached: assert_equals: expected (number) 640 but got (undefined) undefined Reached unreachable code
CONSOLE MESSAGE: Error: assert_unreached: assert_equals: expected (number) 640 but got (undefined) undefined Reached unreachable code
CONSOLE MESSAGE: Error: assert_unreached: assert_equals: expected (number) 640 but got (undefined) undefined Reached unreachable code
CONSOLE MESSAGE: Error: assert_unreached: assert_equals: expected (number) 640 but got (undefined) undefined Reached unreachable code
CONSOLE MESSAGE: Error: assert_unreached: assert_equals: expected (number) 640 but got (undefined) undefined Reached unreachable code
CONSOLE MESSAGE: Error: assert_unreached: assert_equals: expected (number) 640 but got (undefined) undefined Reached unreachable code
CONSOLE MESSAGE: Error: assert_unreached: assert_equals: expected (number) 640 but got (undefined) undefined Reached unreachable code
CONSOLE MESSAGE: Error: assert_unreached: assert_equals: expected (number) 640 but got (undefined) undefined Reached unreachable code
CONSOLE MESSAGE: Error: assert_unreached: assert_equals: expected (number) 640 but got (undefined) undefined Reached unreachable code
CONSOLE MESSAGE: Error: assert_unreached: assert_equals: expected (number) 640 but got (undefined) undefined Reached unreachable code
CONSOLE MESSAGE: Error: assert_unreached: assert_equals: expected (number) 640 but got (undefined) undefined Reached unreachable code
CONSOLE MESSAGE: Error: assert_unreached: assert_equals: expected (number) 640 but got (undefined) undefined Reached unreachable code
CONSOLE MESSAGE: Error: assert_unreached: assert_equals: expected (number) 640 but got (undefined) undefined Reached unreachable code
CONSOLE MESSAGE: Error: assert_unreached: assert_equals: expected 800 but got 640 Reached unreachable code
CONSOLE MESSAGE: Error: assert_unreached: assert_equals: expected 800 but got 640 Reached unreachable code
CONSOLE MESSAGE: Error: assert_unreached: assert_equals: expected 800 but got 640 Reached unreachable code
CONSOLE MESSAGE: Error: assert_unreached: assert_equals: expected 800 but got 640 Reached unreachable code
CONSOLE MESSAGE: Error: assert_unreached: assert_equals: expected 800 but got 640 Reached unreachable code
CONSOLE MESSAGE: Error: assert_unreached: assert_equals: expected 800 but got 640 Reached unreachable code
CONSOLE MESSAGE: Error: assert_unreached: assert_equals: expected 800 but got 640 Reached unreachable code
CONSOLE MESSAGE: Error: assert_unreached: assert_equals: expected 800 but got 640 Reached unreachable code
CONSOLE MESSAGE: Error: assert_unreached: assert_equals: expected 800 but got 640 Reached unreachable code
CONSOLE MESSAGE: Error: assert_unreached: assert_equals: expected 800 but got 640 Reached unreachable code
CONSOLE MESSAGE: Error: assert_unreached: assert_equals: expected 800 but got 640 Reached unreachable code
CONSOLE MESSAGE: Error: assert_unreached: assert_equals: expected 800 but got 640 Reached unreachable code
CONSOLE MESSAGE: Error: assert_unreached: assert_equals: expected 800 but got 640 Reached unreachable code
CONSOLE MESSAGE: Error: assert_unreached: assert_equals: expected 800 but got 640 Reached unreachable code
CONSOLE MESSAGE: Error: assert_unreached: assert_equals: expected 800 but got 640 Reached unreachable code
CONSOLE MESSAGE: Error: assert_unreached: assert_equals: expected 800 but got 640 Reached unreachable code
CONSOLE MESSAGE: Error: assert_unreached: assert_equals: expected 640 but got 800 Reached unreachable code
CONSOLE MESSAGE: Error: assert_unreached: assert_equals: expected 640 but got 800 Reached unreachable code
CONSOLE MESSAGE: Error: assert_unreached: assert_equals: expected 640 but got 800 Reached unreachable code
CONSOLE MESSAGE: Error: assert_unreached: assert_equals: expected 640 but got 800 Reached unreachable code
CONSOLE MESSAGE: Error: assert_unreached: assert_equals: expected 640 but got 800 Reached unreachable code
CONSOLE MESSAGE: Error: assert_unreached: assert_equals: expected 640 but got 800 Reached unreachable code
CONSOLE MESSAGE: Error: assert_unreached: assert_equals: expected 640 but got 800 Reached unreachable code
CONSOLE MESSAGE: Error: assert_unreached: assert_equals: expected 640 but got 800 Reached unreachable code
CONSOLE MESSAGE: Error: assert_unreached: assert_equals: expected 640 but got 800 Reached unreachable code
CONSOLE MESSAGE: Error: assert_unreached: assert_equals: expected 640 but got 800 Reached unreachable code
CONSOLE MESSAGE: Error: assert_unreached: assert_equals: expected 640 but got 800 Reached unreachable code
CONSOLE MESSAGE: Error: assert_unreached: assert_equals: expected 640 but got 800 Reached unreachable code
CONSOLE MESSAGE: Error: assert_unreached: assert_equals: expected 640 but got 800 Reached unreachable code
CONSOLE MESSAGE: Error: assert_unreached: assert_equals: expected 640 but got 800 Reached unreachable code
CONSOLE MESSAGE: Error: assert_unreached: assert_equals: expected 640 but got 800 Reached unreachable code
CONSOLE MESSAGE: Error: assert_unreached: assert_equals: expected 640 but got 800 Reached unreachable code

Harness Error (FAIL), message = Error: assert_unreached: assert_equals: expected (number) 640 but got (undefined) undefined Reached unreachable code
Harness Error (FAIL), message = Error: assert_unreached: assert_equals: expected 640 but got 800 Reached unreachable code

PASS Reconfiguring encoder

@@ -1,3 +1,6 @@
CONSOLE MESSAGE: Error: assert_unreached: assert_equals: expected 800 but got 640 Reached unreachable code

FAIL Reconfiguring encoder assert_equals: expected 16 but got 0
Harness Error (FAIL), message = Error: assert_unreached: assert_equals: expected 800 but got 640 Reached unreachable code

PASS Reconfiguring encoder

@@ -1,3 +1,6 @@
CONSOLE MESSAGE: Error: assert_unreached: assert_equals: expected 800 but got 640 Reached unreachable code

FAIL Reconfiguring encoder assert_equals: expected 16 but got 0
Harness Error (FAIL), message = Error: assert_unreached: assert_equals: expected 800 but got 640 Reached unreachable code

PASS Reconfiguring encoder

@@ -1,4 +1,54 @@
CONSOLE MESSAGE: Error: assert_own_property: expected property "svc" missing
CONSOLE MESSAGE: Error: assert_own_property: expected property "svc" missing
CONSOLE MESSAGE: Error: assert_own_property: expected property "svc" missing
CONSOLE MESSAGE: Error: assert_own_property: expected property "svc" missing
CONSOLE MESSAGE: Error: assert_own_property: expected property "svc" missing
CONSOLE MESSAGE: Error: assert_own_property: expected property "svc" missing
CONSOLE MESSAGE: Error: assert_own_property: expected property "svc" missing
CONSOLE MESSAGE: Error: assert_own_property: expected property "svc" missing
CONSOLE MESSAGE: Error: assert_own_property: expected property "svc" missing
CONSOLE MESSAGE: Error: assert_own_property: expected property "svc" missing
CONSOLE MESSAGE: Error: assert_own_property: expected property "svc" missing
CONSOLE MESSAGE: Error: assert_own_property: expected property "svc" missing
CONSOLE MESSAGE: Error: assert_own_property: expected property "svc" missing
CONSOLE MESSAGE: Error: assert_own_property: expected property "svc" missing
CONSOLE MESSAGE: Error: assert_own_property: expected property "svc" missing
CONSOLE MESSAGE: Error: assert_own_property: expected property "svc" missing
CONSOLE MESSAGE: Error: assert_own_property: expected property "svc" missing
CONSOLE MESSAGE: Error: assert_own_property: expected property "svc" missing
CONSOLE MESSAGE: Error: assert_own_property: expected property "svc" missing
CONSOLE MESSAGE: Error: assert_own_property: expected property "svc" missing
CONSOLE MESSAGE: Error: assert_own_property: expected property "svc" missing
CONSOLE MESSAGE: Error: assert_own_property: expected property "svc" missing
CONSOLE MESSAGE: Error: assert_own_property: expected property "svc" missing
CONSOLE MESSAGE: Error: assert_own_property: expected property "svc" missing
CONSOLE MESSAGE: Error: assert_own_property: expected property "svc" missing
CONSOLE MESSAGE: Error: assert_own_property: expected property "svc" missing
CONSOLE MESSAGE: Error: assert_own_property: expected property "svc" missing
CONSOLE MESSAGE: Error: assert_own_property: expected property "svc" missing
CONSOLE MESSAGE: Error: assert_own_property: expected property "svc" missing
CONSOLE MESSAGE: Error: assert_own_property: expected property "svc" missing
CONSOLE MESSAGE: Error: assert_own_property: expected property "svc" missing
CONSOLE MESSAGE: Error: assert_own_property: expected property "svc" missing
CONSOLE MESSAGE: Error: assert_own_property: expected property "svc" missing
CONSOLE MESSAGE: Error: assert_own_property: expected property "svc" missing
CONSOLE MESSAGE: Error: assert_own_property: expected property "svc" missing
CONSOLE MESSAGE: Error: assert_own_property: expected property "svc" missing
CONSOLE MESSAGE: Error: assert_own_property: expected property "svc" missing
CONSOLE MESSAGE: Error: assert_own_property: expected property "svc" missing
CONSOLE MESSAGE: Error: assert_own_property: expected property "svc" missing
CONSOLE MESSAGE: Error: assert_own_property: expected property "svc" missing
CONSOLE MESSAGE: Error: assert_own_property: expected property "svc" missing
CONSOLE MESSAGE: Error: assert_own_property: expected property "svc" missing
CONSOLE MESSAGE: Error: assert_own_property: expected property "svc" missing
CONSOLE MESSAGE: Error: assert_own_property: expected property "svc" missing
CONSOLE MESSAGE: Error: assert_own_property: expected property "svc" missing
CONSOLE MESSAGE: Error: assert_own_property: expected property "svc" missing
CONSOLE MESSAGE: Error: assert_own_property: expected property "svc" missing
CONSOLE MESSAGE: Error: assert_own_property: expected property "svc" missing

FAIL SVC L1T2 assert_equals: expected 24 but got 0
FAIL SVC L1T3 assert_equals: expected 24 but got 0
Harness Error (FAIL), message = Error: assert_own_property: expected property "svc" missing

FAIL SVC L1T2 assert_equals: expected 12 but got 0
FAIL SVC L1T3 assert_equals: expected 6 but got 0

0 comments on commit 449a886

Please sign in to comment.