From bfc2af34862343d642bfebe07b8e6c016b9017db Mon Sep 17 00:00:00 2001 From: Dale Curtis Date: Tue, 27 Sep 2022 15:02:32 -0700 Subject: [PATCH 1/2] Add spec text for serializable encoded chunks. Chromium launched with this support, but apparently the spec text was never updated. Sorry about that! Fixes: #289 --- index.src.html | 40 ++++++++++++++++++++++++++++++++++++++-- 1 file changed, 38 insertions(+), 2 deletions(-) diff --git a/index.src.html b/index.src.html index 0a6ea365..1860d289 100644 --- a/index.src.html +++ b/index.src.html @@ -2441,7 +2441,7 @@ EncodedAudioChunk Interface {#encodedaudiochunk-interface} ------------------------------------------------------------ -[Exposed=(Window,DedicatedWorker)] +[Exposed=(Window,DedicatedWorker), Serializable] interface EncodedAudioChunk { constructor(EncodedAudioChunkInit init); readonly attribute EncodedAudioChunkType type; @@ -2510,10 +2510,28 @@ greater than in |destination|, throw a {{TypeError}}. 2. Copy the {{EncodedAudioChunk/[[internal data]]}} into |destination|. +### Serialization ###{#encodedaudiochunk-serialization} +: The {{EncodedAudioChunk}} [=serialization steps=] (with |value|, |serialized|, + and |forStorage|) are: +:: 1. If |forStorage| is `true`, throw a {{TypeError}}. + 2. For each {{EncodedAudioChunk}} internal slot in |value|, assign the value + of each internal slot to a field in |serialized| with the same name + the internal slot. + +: The {{EncodedAudioChunk}} [=deserialization steps=] (with |serialized| and + |value|) are: +:: 1. For all named fields in |serialized|, assign the value of each named field + to the {{EncodedAudioChunk}} internal slot in |value| with the same name + as the named field. + +NOTE: Since {{EncodedAudioChunk}}s are immutable, User Agents may choose to + implement serialization using a reference counting model similar to + [[#audiodata-transfer-serialization]]. + EncodedVideoChunk Interface{#encodedvideochunk-interface} ----------------------------------------------------------- <xmp class='idl'> -[Exposed=(Window,DedicatedWorker)] +[Exposed=(Window,DedicatedWorker), Serializable] interface EncodedVideoChunk { constructor(EncodedVideoChunkInit init); readonly attribute EncodedVideoChunkType type; @@ -2584,6 +2602,24 @@ {{TypeError}}. 2. Copy the {{EncodedVideoChunk/[[internal data]]}} into |destination|. +### Serialization ###{#encodedvideochunk-serialization} +: The {{EncodedVideoChunk}} [=serialization steps=] (with |value|, |serialized|, + and |forStorage|) are: +:: 1. If |forStorage| is `true`, throw a {{TypeError}}. + 2. For each {{EncodedVideoChunk}} internal slot in |value|, assign the value + of each internal slot to a field in |serialized| with the same name + the internal slot. + +: The {{EncodedVideoChunk}} [=deserialization steps=] (with |serialized| and + |value|) are: +:: 1. For all named fields in |serialized|, assign the value of each named field + to the {{EncodedVideoChunk}} internal slot in |value| with the same name + as the named field. + +NOTE: Since {{EncodedVideoChunk}}s are immutable, User Agents may choose to + implement serialization using a reference counting model similar to + [[#videoframe-transfer-serialization]]. + Raw Media Interfaces {#raw-media-interfaces} ==================================================== From 0913cb52a49d6a839b85a68811619919a365daa0 Mon Sep 17 00:00:00 2001 From: Dale Curtis <dalecurtis@chromium.org> Date: Wed, 28 Sep 2022 12:32:58 -0700 Subject: [PATCH 2/2] Fix typos --- index.src.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.src.html b/index.src.html index 1860d289..561dbc49 100644 --- a/index.src.html +++ b/index.src.html @@ -2515,7 +2515,7 @@ and |forStorage|) are: :: 1. If |forStorage| is `true`, throw a {{TypeError}}. 2. For each {{EncodedAudioChunk}} internal slot in |value|, assign the value - of each internal slot to a field in |serialized| with the same name + of each internal slot to a field in |serialized| with the same name as the internal slot. : The {{EncodedAudioChunk}} [=deserialization steps=] (with |serialized| and @@ -2607,7 +2607,7 @@ and |forStorage|) are: :: 1. If |forStorage| is `true`, throw a {{TypeError}}. 2. For each {{EncodedVideoChunk}} internal slot in |value|, assign the value - of each internal slot to a field in |serialized| with the same name + of each internal slot to a field in |serialized| with the same name as the internal slot. : The {{EncodedVideoChunk}} [=deserialization steps=] (with |serialized| and