@@ -287,7 +287,7 @@ enum RTCEncodedVideoFrameType {
287
287
};
288
288
</pre>
289
289
<table dfn-for="RTCEncodedVideoFrameType" class="simple">
290
- <caption> Enumeration description</caption>
290
+ <caption> Enumeration description</caption>
291
291
<thead>
292
292
<tr>
293
293
<th> Enum value</th><th> Description</th>
@@ -347,7 +347,7 @@ dictionary RTCEncodedVideoFrameMetadata {
347
347
348
348
<dl dfn-for="RTCEncodedVideoFrameMetadata" class="dictionary-members">
349
349
<dt>
350
- <dfn dict-member>synchronizationSource</dfn> of type <span class="idlMemberType"> unsigned long</span>
350
+ <dfn dict-member>synchronizationSource</dfn> <span class="idlMemberType"> unsigned long</span>
351
351
</dt>
352
352
<dd>
353
353
<p>
@@ -356,7 +356,7 @@ dictionary RTCEncodedVideoFrameMetadata {
356
356
</p>
357
357
</dd>
358
358
<dt>
359
- <dfn dict-member>payloadType</dfn> of type <span class="idlMemberType"> octet</span>
359
+ <dfn dict-member>payloadType</dfn> <span class="idlMemberType"> octet</span>
360
360
</dt>
361
361
<dd>
362
362
<p>
@@ -365,7 +365,7 @@ dictionary RTCEncodedVideoFrameMetadata {
365
365
</p>
366
366
</dd>
367
367
<dt>
368
- <dfn dict-member>contributingSources</dfn> of type <span class=
368
+ <dfn dict-member>contributingSources</dfn> <span class=
369
369
"idlMemberType"> sequence<unsigned long></span>
370
370
</dt>
371
371
<dd>
@@ -374,13 +374,13 @@ dictionary RTCEncodedVideoFrameMetadata {
374
374
</p>
375
375
</dd>
376
376
<dt>
377
- <dfn>timestamp</dfn> of type <span class=
377
+ <dfn>timestamp</dfn> <span class=
378
378
"idlMemberType"> long long</span>
379
379
</dt>
380
380
<dd>
381
381
<p>
382
382
The media presentation timestamp (PTS) in microseconds of raw frame, matching the
383
- {{VideoFrame/timestamp}} for raw frames which correspond to this frame.
383
+ {{VideoFrame/timestamp}} for raw frames which correspond to this frame.
384
384
</p>
385
385
</dd>
386
386
</dl>
@@ -390,7 +390,7 @@ dictionary RTCEncodedVideoFrameMetadata {
390
390
<pre class="idl">
391
391
// New interfaces to define encoded video and audio frames. Will eventually
392
392
// re-use or extend the equivalent defined in WebCodecs.
393
- [Exposed=(Window,DedicatedWorker)]
393
+ [Exposed=(Window,DedicatedWorker), Serializable ]
394
394
interface RTCEncodedVideoFrame {
395
395
readonly attribute RTCEncodedVideoFrameType type;
396
396
readonly attribute unsigned long timestamp;
@@ -402,7 +402,7 @@ interface RTCEncodedVideoFrame {
402
402
### Members ### {#RTCEncodedVideoFrame-members}
403
403
<dl dfn-for="RTCEncodedVideoFrame" class="dictionary-members">
404
404
<dt>
405
- <dfn attribute>type</dfn> of type <span class="idlMemberType"> RTCEncodedVideoFrameType</span>
405
+ <dfn attribute>type</dfn> <span class="idlMemberType"> RTCEncodedVideoFrameType</span>
406
406
</dt>
407
407
<dd>
408
408
<p>
@@ -412,7 +412,7 @@ interface RTCEncodedVideoFrame {
412
412
</dd>
413
413
414
414
<dt>
415
- <dfn attribute>timestamp</dfn> of type <span class="idlMemberType"> unsigned long</span>
415
+ <dfn attribute>timestamp</dfn> <span class="idlMemberType"> unsigned long</span>
416
416
</dt>
417
417
<dd>
418
418
<p>
@@ -421,7 +421,7 @@ interface RTCEncodedVideoFrame {
421
421
</p>
422
422
</dd>
423
423
<dt>
424
- <dfn attribute>data</dfn> of type <span class="idlMemberType"> ArrayBuffer</span>
424
+ <dfn attribute>data</dfn> <span class="idlMemberType"> ArrayBuffer</span>
425
425
</dt>
426
426
<dd>
427
427
<p>
@@ -442,6 +442,31 @@ interface RTCEncodedVideoFrame {
442
442
</dd>
443
443
</dl>
444
444
445
+ ### Serialization ### {#RTCEncodedVideoFrame-serialization}
446
+
447
+ {{RTCEncodedVideoFrame}} objects are serializable objects [[HTML]] .
448
+ Their [=serialization steps=] , given |value|, |serialized|, and |forStorage|, are:
449
+
450
+ 1. If |forStorage| is true, then throw a {{DataCloneError}} .
451
+ 1. Set |serialized|.`[[type]] ` to the value of |value|.{{RTCEncodedVideoFrame/type}}
452
+ 1. Set |serialized|.`[[timestamp]] ` to the value of |value|.{{RTCEncodedVideoFrame/timestamp}}
453
+ 1. Set |serialized|.`[[metadata]] ` to an internal representation of |value|'s metadata.
454
+ 1. Set |serialized|.`[[data]] ` to |value|.`[[data]] `
455
+
456
+ Their [=deserialization steps=] , given |serialized|, |value| and |realm|, are:
457
+
458
+ 1. Set |value|.{{RTCEncodedVideoFrame/type}} to |serialized|.`[[type]] `
459
+ 1. Set |value|.{{RTCEncodedVideoFrame/timestamp}} to |serialized|.`[[timestamp]] `
460
+ 1. Set |value|'s metadata to the platform object representation of |serialized|.`[[metadata]] `
461
+ 1. Set |value|.`[[data]] ` to |serialized|.`[[data]] `.
462
+
463
+ <p class="note">
464
+ The internal form of a serialized RTCEncodedVideoFrame is not observable;
465
+ it is defined chiefly so that it can be used with frame cloning in the
466
+ [$writeEncodedData$] algorithm and in the {{WindowOrWorkerGlobalScope/structuredClone()}} operation.
467
+ An implementation is therefore free to choose whatever method works best.
468
+ </p>
469
+
445
470
## <dfn dictionary>RTCEncodedAudioFrameMetadata</dfn> dictionary ## {#RTCEncodedAudioFrameMetadata}
446
471
<pre class="idl">
447
472
dictionary RTCEncodedAudioFrameMetadata {
@@ -454,7 +479,7 @@ dictionary RTCEncodedAudioFrameMetadata {
454
479
### Members ### {#RTCEncodedAudioFrameMetadata-members}
455
480
<dl dfn-for="RTCEncodedAudioFrameMetadata" class="dictionary-members">
456
481
<dt>
457
- <dfn dict-member>synchronizationSource</dfn> of type <span class="idlMemberType"> unsigned long</span>
482
+ <dfn dict-member>synchronizationSource</dfn> <span class="idlMemberType"> unsigned long</span>
458
483
</dt>
459
484
<dd>
460
485
<p>
@@ -463,7 +488,7 @@ dictionary RTCEncodedAudioFrameMetadata {
463
488
</p>
464
489
</dd>
465
490
<dt>
466
- <dfn dict-member>payloadType</dfn> of type <span class="idlMemberType"> octet</span>
491
+ <dfn dict-member>payloadType</dfn> <span class="idlMemberType"> octet</span>
467
492
</dt>
468
493
<dd>
469
494
<p>
@@ -472,7 +497,7 @@ dictionary RTCEncodedAudioFrameMetadata {
472
497
</p>
473
498
</dd>
474
499
<dt>
475
- <dfn dict-member>contributingSources</dfn> of type <span class=
500
+ <dfn dict-member>contributingSources</dfn> <span class=
476
501
"idlMemberType"> sequence<unsigned long></span>
477
502
</dt>
478
503
<dd>
@@ -481,7 +506,7 @@ dictionary RTCEncodedAudioFrameMetadata {
481
506
</p>
482
507
</dd>
483
508
<dt>
484
- <dfn dict-member>sequenceNumber</dfn> of type <span class=
509
+ <dfn dict-member>sequenceNumber</dfn> <span class=
485
510
"idlMemberType"> short</span>
486
511
</dt>
487
512
<dd>
@@ -496,7 +521,7 @@ dictionary RTCEncodedAudioFrameMetadata {
496
521
497
522
## <dfn interface>RTCEncodedAudioFrame</dfn> interface ## {#RTCEncodedAudioFrame-interface}
498
523
<pre class="idl">
499
- [Exposed=(Window,DedicatedWorker)]
524
+ [Exposed=(Window,DedicatedWorker), Serializable ]
500
525
interface RTCEncodedAudioFrame {
501
526
readonly attribute unsigned long timestamp;
502
527
attribute ArrayBuffer data;
@@ -507,7 +532,7 @@ interface RTCEncodedAudioFrame {
507
532
### Members ### {#RTCEncodedAudioFrame-members}
508
533
<dl dfn-for="RTCEncodedAudioFrame" class="dictionary-members">
509
534
<dt>
510
- <dfn attribute>timestamp</dfn> of type <span class="idlMemberType"> unsigned long</span>
535
+ <dfn attribute>timestamp</dfn> <span class="idlMemberType"> unsigned long</span>
511
536
</dt>
512
537
<dd>
513
538
<p>
@@ -516,7 +541,7 @@ interface RTCEncodedAudioFrame {
516
541
</p>
517
542
</dd>
518
543
<dt>
519
- <dfn attribute>data</dfn> of type <span class="idlMemberType"> ArrayBuffer</span>
544
+ <dfn attribute>data</dfn> <span class="idlMemberType"> ArrayBuffer</span>
520
545
</dt>
521
546
<dd>
522
547
<p>
@@ -538,8 +563,23 @@ interface RTCEncodedAudioFrame {
538
563
</dl>
539
564
540
565
541
- // New interfaces to expose JavaScript-based transforms.
542
- ##Interfaces
566
+ ### Serialization ### {#RTCEncodedAudioFrame-serialization}
567
+
568
+ {{RTCEncodedAudioFrame}} objects are serializable objects [[HTML]] .
569
+ Their [=serialization steps=] , given |value|, |serialized|, and |forStorage|, are:
570
+
571
+ 1. If |forStorage| is true, then throw a {{DataCloneError}} .
572
+ 1. Set |serialized|.`[[timestamp]] ` to the value of |value|.{{RTCEncodedAudioFrame/timestamp}}
573
+ 1. Set |serialized|.`[[metadata]] ` to an internal representation of |value|'s metadata.
574
+ 1. Set |serialized|.`[[data]] ` to |value|.`[[data]] `
575
+
576
+ Their [=deserialization steps=] , given |serialized|, |value| and |realm|, are:
577
+
578
+ 1. Set |value|.{{RTCEncodedAudioFrame/timestamp}} to |serialized|.`[[timestamp]] `
579
+ 1. Set |value|'s metadata to the platform object representation of |serialized|.`[[metadata]] `
580
+ 1. Set |value|.`[[data]] ` to |serialized|.`[[data]] `.
581
+
582
+ ## Interfaces ## {#RTCRtpScriptTransformer-interfaces}
543
583
<pre class="idl">
544
584
[Exposed=DedicatedWorker]
545
585
interface RTCTransformEvent : Event {
0 commit comments