Specify how decode() handles an EncodedVideoChunk/EncodedAudioChunk with empty data
Mantenedores costumam responder em até 1 dia
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 4/5
- Tempo estimado
- 3-5 dias
- Facilidade para iniciantes
- 48/100
Direção de pesquisa
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.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
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.
- Linguagem predominante
- HTML
- Estrelas
- 1.3k
- Forks
- 190
- Merge médio
- 1d 4h
- PRs com merge (30d)
- 12
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Sem modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de w3c/webcodecs
-
privacy-needs-resolution
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 65/100
Mantenedores costumam responder em até 1 dia
-
editorial
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 68/100
Mantenedores costumam responder em até 1 dia
-
Dificuldade 5/5 Mais de uma semana Facilidade para iniciantes 35/100
w3c/webcodecs#978 · 3 comentários ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 5/5 Mais de uma semana Facilidade para iniciantes 25/100
w3c/webcodecs#977 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 55/100
w3c/webcodecs#973 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
Todas as issues de w3c/webcodecs
Issues semelhantes
-
bug ready-for-agent
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 73/100
PhyberApex/kuroshiro#1687 ·
Mantenedores costumam responder em até 1 dia
-
Provider test fails on official OpenAI preset: chat probe sends max_tokens, rejected by newer modelsAberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
Mantenedores costumam responder em até 1 dia
-
general_error() logs every 4xx response at ERROR level, including expected 400, 404 and 409 outcomesAbertabug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 75/100
awslabs/visual-asset-management-system#935 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 62/100
Mantenedores costumam responder em até 1 dia
-
vim.filetype.match() prefixes a URL buffer name with the cwd before passing it to filetype functionsAberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 73/100
Mantenedores costumam responder em até 1 dia