Bug 264516
Summary: | Sending multiple `VideoFrame`s per `postMessage()` only sends duplicates of the first | ||
---|---|---|---|
Product: | WebKit | Reporter: | daxpedda |
Component: | Media | Assignee: | youenn fablet <youennf> |
Status: | RESOLVED FIXED | ||
Severity: | Normal | CC: | daxpedda, eric.carlson, jer.noble, webkit-bug-importer, youennf |
Priority: | P2 | Keywords: | InRadar |
Version: | Safari Technology Preview | ||
Hardware: | Mac (Intel) | ||
OS: | macOS 13 |
daxpedda
Sending more then one `VideoFrame` to a worker per `postMessage()` at once, sends as many `VideoFrame`s as there were sent, but they are all a duplicate of the first one.
I concluded that there are duplicates and not just malformed because when I try to send them back again with `postMessage()` I receive the following error:
"duplicate transferable for structured clone".
---
Window:
```js
const frame1 = new VideoFrame(new ArrayBuffer(4), { format: 'RGBA', codedWidth: 1, codedHeight: 1, timestamp: 0 })
const frame2 = new VideoFrame(new ArrayBuffer(8), { format: 'RGBA', codedWidth: 1, codedHeight: 2, timestamp: 0 })
const worker = new Worker('worker.js')
worker.postMessage([frame1, frame2])
```
Worker:
```js
addEventListener('message', (event) => {
console.log(event.data[0].codedHeight)
console.log(event.data[1].codedHeight)
})
```
Received:
```
1
1
```
Expected:
```
1
2
```
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
daxpedda
I've tried this only on Intel hardware:
- Safari Technology Preview 182 MacOS Ventura
- Safari 17.1 MacOS Ventura
- Safari 17.0 MacOS Monterey
Radar WebKit Bug Importer
<rdar://problem/118445968>
youenn fablet
Pull request: https://github.com/WebKit/WebKit/pull/20535
EWS
Committed 270772@main (b55438f2a83c): <https://commits.webkit.org/270772@main>
Reviewed commits have been landed. Closing PR #20535 and removing active labels.