Re: [webrtc-encoded-transform] No transfer steps defined for RTCEncodedAudioFrame and RTCEncodedVideoFrame (#231)

> I think the intent of the spec is to transfer the [[data]] arrayBuffer and leave the other fields untouched. That is why the spec uses `StructuredSerializeWithTransfer(frame, « data »).`

Ah, I understand now. Transfer steps would only be needed to pass in `« frame »`, which we're not.

Passing in `« data »`, works just fine. Chrome already [implements it](https://jsfiddle.net/jib1/g492kfmv/) even:
```js
console.log(chunk.data.byteLength); /* 302 */
self.postMessage(chunk, [chunk.data]); /* works in Chrome */
console.log(chunk.data.byteLength); /* 0 */
```

> Another potential issue is that serialization is with StructuredSerializeWithTransfer but deserialization is with StructuredDeserialize. Shouldn't it be [StructuredDeserializeWithTransfer](https://html.spec.whatwg.org/multipage/structured-data.html#structureddeserializewithtransfer)?

I'll do a new PR to fix this, and fix the serialization steps to use sub-serialization when transfer is *not* used.


-- 
GitHub Notification of comment by jan-ivar
Please view or discuss this issue at https://github.com/w3c/webrtc-encoded-transform/issues/231#issuecomment-2641398288 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Thursday, 6 February 2025 23:59:42 UTC