You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
https://w3c.github.io/webcodecs/#dom-videoframe-videoframe-data-init should validate the plane layout according the coded width and height #702
Agreed, combinedLayout is only used to run the check in step 11, which should be making sure that the buffer is large enough to contain the entire coded region of the frame. It's not necessary to compute anything related to the visible region here, but Compute Layout and Allocation Size algorithm is shared with copyTo() which does.
The complexity comes from having to support explicit and implicit layouts. The actual check just needs to ensure that the buffer contains the full planeCodedHeight * planeStride bytes for every plane.
It could be worth making this more obvious because using planeCodedWidth * planeSampleBytes for the last row instead of planeStride might be logical but would differ from the spec intention.
Activity
youennf commentedon Jul 7, 2023
Switching to using codedWidth/codedHeight seems to align with what Chrome does AIUI: https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/modules/webcodecs/video_frame.cc;l=849;drc=a3636d1ffd79769d79cb736dcf0066eeef408762
VideoFrame buffer constructor doesn't respect codedWidth if visibleRe…
sandersdan commentedon Jul 10, 2023
Agreed,
combinedLayoutis only used to run the check in step 11, which should be making sure that the buffer is large enough to contain the entire coded region of the frame. It's not necessary to compute anything related to the visible region here, butCompute Layout and Allocation Sizealgorithm is shared withcopyTo()which does.The complexity comes from having to support explicit and implicit layouts. The actual check just needs to ensure that the buffer contains the full
planeCodedHeight * planeStridebytes for every plane.It could be worth making this more obvious because using
planeCodedWidth * planeSampleBytesfor the last row instead ofplaneStridemight be logical but would differ from the spec intention.VideoFrame buffer constructor doesn't respect codedWidth if visibleRe…