From 64a18b1f9a8db54bd6f9ff536852c2f3ccba12e4 Mon Sep 17 00:00:00 2001 From: Youenn Fablet Date: Thu, 21 Aug 2025 15:35:22 +0200 Subject: [PATCH 1/2] Align RTCEncodedVideoFrame type handling to how data is handled. We use a [[type]] slot and set it in constructor, as well as deserialization steps. We make it clear that data/type attributes are related to [[type]]/[[data]] slots. --- index.bs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/index.bs b/index.bs index 80eaae5..098acbb 100644 --- a/index.bs +++ b/index.bs @@ -585,6 +585,7 @@ interface RTCEncodedVideoFrame { {{RTCEncodedFrameMetadata/mimeType}}. For SVC, each spatial layer is transformed separately. + On getting, |this|.`[[data]]` MUST be returned. On setting, |this|.`[[data]]` MUST be set to the new value.

Since packetizers may drop certain elements, e.g. AV1 temporal delimiter OBUs, @@ -667,14 +668,14 @@ interface RTCEncodedVideoFrame { Their [=serialization steps=], given |value|, |serialized|, and |forStorage|, are: 1. If |forStorage| is true, then throw a {{DataCloneError}}. -1. Set |serialized|.`[[type]]` to the value of |value|.{{RTCEncodedVideoFrame/type}}. +1. Set |serialized|.`[[type]]` to the value of |value|.`[[type]]`. 1. Set |serialized|.`[[metadata]]` to an internal representation of |value|'s metadata. 1. Set |serialized|.`[[data]]` to the [=sub-serialization=] of |value|.`[[data]]`. Their [=deserialization steps=], given |serialized|, |value| and |realm|, are: -1. Set |value|.{{RTCEncodedVideoFrame/type}} to |serialized|.`[[type]]`. +1. Set |value|.`[[type]]` to |serialized|.`[[type]]`. 1. Set |value|'s metadata to the platform object representation of |serialized|.`[[metadata]]`. 1. Set |value|.`[[data]]` to the [=sub-deserialization=] of |serialized|.`[[data]]`. @@ -783,6 +784,7 @@ interface RTCEncodedAudioFrame { The encoded frame data. The format of the data depends on the audio codec that is used to encode/decode the frame which can be determined by looking at the {{RTCEncodedFrameMetadata/mimeType}}. + On getting, |this|.`[[data]]` MUST be returned. On setting, |this|.`[[data]]` MUST be set to the new value. The following table gives a number of examples:

From e56b05bce9f22c475361dc5529fed27ad29eb666 Mon Sep 17 00:00:00 2001 From: Youenn Fablet Date: Thu, 21 Aug 2025 16:56:28 +0200 Subject: [PATCH 2/2] Clarify type attribute getter --- index.bs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.bs b/index.bs index 098acbb..4c1e5f4 100644 --- a/index.bs +++ b/index.bs @@ -571,8 +571,8 @@ interface RTCEncodedVideoFrame {

- The type attribute allows the application to determine when a key frame is being - sent or received. + The type attribute allows the application to determine when a frame is a key frame or a delta frame. + On getting, |this|.`[[type]]` MUST be returned.