Specify how decode() handles an EncodedVideoChunk/EncodedAudioChunk with empty data
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 48/100
Hướng nghiên cứu
Read the VideoDecoder and AudioDecoder “decode the chunk” control message algorithms and compare them with the WPT case in webcodecs/videoDecoder-codec-specific.https.any.js, “Decode empty frame.” The issue proposes queuing the appropriate close algorithm with an EncodingError when chunk data is empty; done when both decoder algorithms specify that behavior and the test expectations align.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
The spec does not say what happens when decode() is given a chunk whose [[internal data]]
has zero length.
- The EncodedVideoChunk/EncodedAudioChunk constructors accept a zero-length
dataand just
record [[byte length]]. - decode() only checks [[state]] and [[key chunk required]].
- The codec registrations say chunk data "is expected to be" a frame of the codec (e.g. VP8:
"a frame as described in Section 4 and Annex A of [[VP8]]"), but that is descriptive. Whether
an empty chunk "results in an error" in the decode control message is left to the codec
implementation.
Implementations differ in where this is decided:
- Chromium rejects it generically, for every audio and video codec, before it reaches the
codec: DecoderTemplate::ProcessDecodeRequest() closes the decoder with
EncodingError ("Null or empty decoder buffer."). decode() itself does not throw. - In WebKit it has depended on the codec backend. Some libraries treat an empty input as a
request to flush (libvpx does so for a null/zero-size buffer to vpx_codec_decode()), so
without an explicit check an empty chunk can silently produce no output and no error.
WPT already expects the Chromium behaviour: webcodecs/videoDecoder-codec-specific.https.any.js,
"Decode empty frame", decodes a key chunk followed by a zero-length key chunk and expects the
error callback with EncodingError, flush() to reject, and state "closed".
Proposal: in the "decode the chunk" control message of VideoDecoder and AudioDecoder, before
handing the chunk to [[codec implementation]], add:
If chunk's [[internal data]] is empty, queue a task to run the Close VideoDecoder
(resp. Close AudioDecoder) algorithm with an EncodingError DOMException and return
"processed".
This keeps decode() from throwing (matching current behaviour and WPT), makes the result
independent of the codec and backend, and keeps an empty chunk from ever being interpreted as a
codec-level flush.
Alternatives:
- Throw synchronously from decode() (TypeError or DataError) when the chunk is empty. Simpler
for authors, but changes the behaviour Chromium ships and WPT tests for. - Reject zero-length data in the EncodedVideoChunk/EncodedAudioChunk constructors. Would
affect encoders and other uses of chunks, and is a larger compatibility risk.
Related: a decode that produces no output, such as a VP8 frame with show_frame = 0 (an
alternate reference frame), is not an error, and the spec already handles it: "If decoded
outputs is not empty". This issue is only about chunks that carry no data.
- Ngôn ngữ chính
- HTML
- Star
- 1.3k
- Fork
- 190
- Merge trung bình
- 1 ngày 4 giờ
- Pull request đã merge (30 ngày)
- 12
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của w3c/webcodecs
-
privacy-needs-resolution
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 65/100
Maintainer thường phản hồi trong vòng 1 ngày
-
editorial
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
w3c/webcodecs#978 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
w3c/webcodecs#977 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 55/100
w3c/webcodecs#973 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của w3c/webcodecs
Issue tương tự
-
spurctld: a user with no usage gets a lower fair-share factor than a user with a little usageĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
ROCm/FastFlowLM#887 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug core plugins
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
bunkerity/bunkerweb#4121 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug ready-for-agent
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 73/100
PhyberApex/kuroshiro#1687 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
status:needs-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
Maintainer thường phản hồi trong vòng 4 ngày