Skip to content

Commit f834681

Browse files
committed
Introduce RTCEncodedFrameMetadata dictionary
1 parent 3cd9f83 commit f834681

File tree

1 file changed

+102
-179
lines changed

1 file changed

+102
-179
lines changed

index.bs

+102-179
Original file line numberDiff line numberDiff line change
@@ -313,8 +313,104 @@ The <dfn method for="SFrameTransform">setEncryptionKey(|key|, |keyID|)</dfn> met
313313
# RTCRtpScriptTransform # {#scriptTransform}
314314

315315
In this section, the capture system refers to the system where media is sourced from and the sender system
316-
refers to the system that is sending RTP and RTCP packets to the receiver system where {{RTCEncodedVideoFrameMetadata}} data
317-
or {{RTCEncodedAudioFrameMetadata}} data is populated.
316+
refers to the system that is sending RTP and RTCP packets to the receiver system where {{RTCEncodedFrameMetadata}} data is populated.
317+
318+
## <dfn dictionary>RTCEncodedFrameMetadata</dfn> dictionary ## {#RTCEncodedFrameMetadata}
319+
<pre class="idl">
320+
dictionary RTCEncodedFrameMetadata {
321+
unsigned long synchronizationSource;
322+
octet payloadType;
323+
sequence&lt;unsigned long&gt; contributingSources;
324+
unsigned long rtpTimestamp;
325+
DOMHighResTimeStamp receiveTime;
326+
DOMHighResTimeStamp captureTime;
327+
DOMHighResTimeStamp senderCaptureTimeOffset;
328+
DOMString mimeType;
329+
};
330+
</pre>
331+
332+
### Members ### {#RTCEncodedFrameMetadata-members}
333+
334+
<dl dfn-for="RTCEncodedFrameMetadata" class="dictionary-members">
335+
<dt>
336+
<dfn dict-member>synchronizationSource</dfn> <span class="idlMemberType">unsigned long</span>
337+
</dt>
338+
<dd>
339+
<p>
340+
The synchronization source (ssrc) identifier is an unsigned integer value per [[RFC3550]]
341+
used to identify the stream of RTP packets that the encoded frame object is describing.
342+
</p>
343+
</dd>
344+
<dt>
345+
<dfn dict-member>payloadType</dfn> <span class="idlMemberType">octet</span>
346+
</dt>
347+
<dd>
348+
<p>
349+
The payload type is an unsigned integer value in the range from 0 to 127 per [[RFC3550]]
350+
that is used to describe the format of the RTP payload.
351+
</p>
352+
</dd>
353+
<dt>
354+
<dfn dict-member>contributingSources</dfn> <span class=
355+
"idlMemberType">sequence&lt;unsigned long&gt;</span>
356+
</dt>
357+
<dd>
358+
<p>
359+
The list of contribution sources (csrc list) as defined in [[RFC3550]].
360+
</p>
361+
</dd>
362+
<dt>
363+
<dfn dict-member>rtpTimestamp</dfn> <span class=
364+
"idlMemberType">unsigned long</span>
365+
</dt>
366+
<dd>
367+
<p>
368+
The RTP timestamp identifier is an unsigned integer value per [[RFC3550]]
369+
that reflects the sampling instant of the first octet in the RTP data packet.
370+
</p>
371+
</dd>
372+
<dt>
373+
<dfn dict-member>receiveTime</dfn> <span class=
374+
"idlMemberType">DOMHighResTimeStamp</span>
375+
</dt>
376+
<dd>
377+
<p>
378+
For frames coming from an RTCRtpReceiver, represents the timestamp
379+
of the last received packet used to produce this media frame. This
380+
timestamp is relative to {{Performance}}.{{Performance/timeOrigin}}.
381+
</p>
382+
</dd>
383+
<dt>
384+
<dfn dict-member>captureTime</dfn> <span class="idlMemberType">DOMHighResTimeStamp</span>
385+
</dt>
386+
<dd>
387+
<p>
388+
The capture time of this frame in the capture system's clock.
389+
On populating this member, the user agent MUST return the value of the frame's `[[captureTime]]` slot,
390+
shifted to be relative to {{Performance}}.{{Performance/timeOrigin}}.
391+
</p>
392+
</dd>
393+
<dt>
394+
<dfn dict-member>senderCaptureTimeOffset</dfn> <span class="idlMemberType">DOMHighResTimeStamp</span>
395+
</dt>
396+
<dd>
397+
<p>
398+
The {{RTCEncodedFrameMetadata/senderCaptureTimeOffset}} is the sender system's estimate of the offset
399+
between its own NTP clock and the capture system's NTP clock, for the same frame that the
400+
{{RTCEncodedFrameMetadata/captureTime}} was originated from.
401+
On populating this member, the user agent MUST return the value of the frame's `[[senderCaptureTimeOffset]]` slot.
402+
</p>
403+
</dd>
404+
<dt>
405+
<dfn dict-member>mimeType</dfn> <span class="idlMemberType">DOMString</span>
406+
</dt>
407+
<dd>
408+
<p>
409+
The codec MIME media type/subtype defined in the IANA media types registry
410+
[[!IANA-MEDIA-TYPES]], e.g. audio/opus or video/VP8.
411+
</p>
412+
</dd>
413+
</dl>
318414

319415
## <dfn enum>RTCEncodedVideoFrameType</dfn> dictionary ## {#RTCEncodedVideoFrameType}
320416
<pre class="idl">
@@ -369,22 +465,14 @@ enum RTCEncodedVideoFrameType {
369465

370466
## <dfn dictionary>RTCEncodedVideoFrameMetadata</dfn> dictionary ## {#RTCEncodedVideoFrameMetadata}
371467
<pre class="idl">
372-
dictionary RTCEncodedVideoFrameMetadata {
468+
dictionary RTCEncodedVideoFrameMetadata : RTCEncodedFrameMetadata {
373469
unsigned long long frameId;
374470
sequence&lt;unsigned long long&gt; dependencies;
375471
unsigned short width;
376472
unsigned short height;
377473
unsigned long spatialIndex;
378474
unsigned long temporalIndex;
379-
unsigned long synchronizationSource;
380-
octet payloadType;
381-
sequence&lt;unsigned long&gt; contributingSources;
382475
long long timestamp; // microseconds
383-
unsigned long rtpTimestamp;
384-
DOMHighResTimeStamp receiveTime;
385-
DOMHighResTimeStamp captureTime;
386-
DOMHighResTimeStamp senderCaptureTimeOffset;
387-
DOMString mimeType;
388476
};
389477
</pre>
390478

@@ -410,33 +498,6 @@ dictionary RTCEncodedVideoFrameMetadata {
410498
Only present for received frames if the AV1 Dependency Descriptor Header Extension defined in Appendix A of [[AV1-RTP-SPEC]] is present.
411499
</p>
412500
</dd>
413-
<dt>
414-
<dfn dict-member>synchronizationSource</dfn> <span class="idlMemberType">unsigned long</span>
415-
</dt>
416-
<dd>
417-
<p>
418-
The synchronization source (ssrc) identifier is an unsigned integer value per [[RFC3550]]
419-
used to identify the stream of RTP packets that the encoded frame object is describing.
420-
</p>
421-
</dd>
422-
<dt>
423-
<dfn dict-member>payloadType</dfn> <span class="idlMemberType">octet</span>
424-
</dt>
425-
<dd>
426-
<p>
427-
The payload type is an unsigned integer value in the range from 0 to 127 per [[RFC3550]]
428-
that is used to describe the format of the RTP payload.
429-
</p>
430-
</dd>
431-
<dt>
432-
<dfn dict-member>contributingSources</dfn> <span class=
433-
"idlMemberType">sequence&lt;unsigned long&gt;</span>
434-
</dt>
435-
<dd>
436-
<p>
437-
The list of contribution sources (csrc list) as defined in [[RFC3550]].
438-
</p>
439-
</dd>
440501
<dt>
441502
<dfn dict-member>timestamp</dfn> <span class=
442503
"idlMemberType">long long</span>
@@ -447,58 +508,6 @@ dictionary RTCEncodedVideoFrameMetadata {
447508
{{VideoFrame/timestamp}} for raw frames which correspond to this frame.
448509
</p>
449510
</dd>
450-
<dt>
451-
<dfn dict-member>rtpTimestamp</dfn> <span class=
452-
"idlMemberType">unsigned long</span>
453-
</dt>
454-
<dd>
455-
<p>
456-
The RTP timestamp identifier is an unsigned integer value per [[RFC3550]]
457-
that reflects the sampling instant of the first octet in the RTP data packet.
458-
</p>
459-
</dd>
460-
<dt>
461-
<dfn dict-member>receiveTime</dfn> <span class=
462-
"idlMemberType">DOMHighResTimeStamp</span>
463-
</dt>
464-
<dd>
465-
<p>
466-
For frames coming from an RTCRtpReceiver, represents the timestamp
467-
of the last received packet used to produce this video frame. This
468-
timestamp is relative to {{Performance}}.{{Performance/timeOrigin}}.
469-
Only exists for incoming video frames.
470-
</p>
471-
</dd>
472-
<dt>
473-
<dfn dict-member>captureTime</dfn> <span class="idlMemberType">DOMHighResTimeStamp</span>
474-
</dt>
475-
<dd>
476-
<p>
477-
The capture time of this frame in the capture system's clock.
478-
On populating this member, the user agent MUST return the value of the frame's `[[captureTime]]` slot,
479-
shifted to be relative to {{Performance}}.{{Performance/timeOrigin}}.
480-
</p>
481-
</dd>
482-
<dt>
483-
<dfn dict-member>senderCaptureTimeOffset</dfn> <span class="idlMemberType">DOMHighResTimeStamp</span>
484-
</dt>
485-
<dd>
486-
<p>
487-
The {{RTCEncodedVideoFrameMetadata/senderCaptureTimeOffset}} is the sender system's estimate of the offset
488-
between its own NTP clock and the capture system's NTP clock, for the same frame that the
489-
{{RTCEncodedVideoFrameMetadata/captureTime}} was originated from.
490-
On populating this member, the user agent MUST return the value of the frame's `[[senderCaptureTimeOffset]]` slot.
491-
</p>
492-
</dd>
493-
<dt>
494-
<dfn dict-member>mimeType</dfn> <span class="idlMemberType">DOMString</span>
495-
</dt>
496-
<dd>
497-
<p>
498-
The codec MIME media type/subtype defined in the IANA media types registry
499-
[[!IANA-MEDIA-TYPES]], e.g. video/VP8.
500-
</p>
501-
</dd>
502511
</dl>
503512

504513

@@ -562,7 +571,7 @@ interface RTCEncodedVideoFrame {
562571
<p>
563572
The encoded frame data. The format of the data depends on the video codec that is
564573
used to encode/decode the frame which can be determined by looking at the
565-
{{RTCEncodedVideoFrameMetadata/mimeType}}.
574+
{{RTCEncodedFrameMetadata/mimeType}}.
566575
For <a href="https://w3c.github.io/webrtc-svc/">SVC</a>, each spatial layer
567576
is transformed separately.
568577
</p>
@@ -667,47 +676,12 @@ An implementation is therefore free to choose whatever method works best.
667676

668677
## <dfn dictionary>RTCEncodedAudioFrameMetadata</dfn> dictionary ## {#RTCEncodedAudioFrameMetadata}
669678
<pre class="idl">
670-
dictionary RTCEncodedAudioFrameMetadata {
671-
unsigned long synchronizationSource;
672-
octet payloadType;
673-
sequence&lt;unsigned long&gt; contributingSources;
679+
dictionary RTCEncodedAudioFrameMetadata : RTCEncodedFrameMetadata {
674680
short sequenceNumber;
675-
unsigned long rtpTimestamp;
676-
DOMHighResTimeStamp receiveTime;
677-
DOMHighResTimeStamp captureTime;
678-
DOMHighResTimeStamp senderCaptureTimeOffset;
679-
DOMString mimeType;
680681
};
681682
</pre>
682683
### Members ### {#RTCEncodedAudioFrameMetadata-members}
683684
<dl dfn-for="RTCEncodedAudioFrameMetadata" class="dictionary-members">
684-
<dt>
685-
<dfn dict-member>synchronizationSource</dfn> <span class="idlMemberType">unsigned long</span>
686-
</dt>
687-
<dd>
688-
<p>
689-
The synchronization source (ssrc) identifier is an unsigned integer value per [[RFC3550]]
690-
used to identify the stream of RTP packets that the encoded frame object is describing.
691-
</p>
692-
</dd>
693-
<dt>
694-
<dfn dict-member>payloadType</dfn> <span class="idlMemberType">octet</span>
695-
</dt>
696-
<dd>
697-
<p>
698-
The payload type is an unsigned integer value in the range from 0 to 127 per [[RFC3550]]
699-
that is used to describe the format of the RTP payload.
700-
</p>
701-
</dd>
702-
<dt>
703-
<dfn dict-member>contributingSources</dfn> <span class=
704-
"idlMemberType">sequence&lt;unsigned long&gt;</span>
705-
</dt>
706-
<dd>
707-
<p>
708-
The list of contribution sources (csrc list) as defined in [[RFC3550]].
709-
</p>
710-
</dd>
711685
<dt>
712686
<dfn dict-member>sequenceNumber</dfn> <span class=
713687
"idlMemberType">short</span>
@@ -720,57 +694,6 @@ dictionary RTCEncodedAudioFrameMetadata {
720694
Comparing two sequence numbers requires serial number arithmetic described in [[RFC1982]].
721695
</p>
722696
</dd>
723-
<dt>
724-
<dfn dict-member>rtpTimestamp</dfn> <span class="idlMemberType">unsigned long</span>
725-
</dt>
726-
<dd>
727-
<p>
728-
The RTP timestamp identifier is an unsigned integer value per [[RFC3550]]
729-
that reflects the sampling instant of the first octet in the RTP data packet.
730-
</p>
731-
</dd>
732-
<dt>
733-
<dfn dict-member>receiveTime</dfn> <span class=
734-
"idlMemberType">DOMHighResTimeStamp</span>
735-
</dt>
736-
<dd>
737-
<p>
738-
For frames coming from an RTCRtpReceiver, represents the timestamp
739-
of the last received packet used to produce this audio frame. This
740-
timestamp is relative to {{Performance}}.{{Performance/timeOrigin}}.
741-
Only exists for incoming audio frames.
742-
</p>
743-
</dd>
744-
<dt>
745-
<dfn dict-member>captureTime</dfn> <span class="idlMemberType">DOMHighResTimeStamp</span>
746-
</dt>
747-
<dd>
748-
<p>
749-
The capture time of this frame in the capture system's clock.
750-
On populating this member, the user agent MUST return the value of the frame's `[[captureTime]]` slot,
751-
shifted to be relative to {{Performance}}.{{Performance/timeOrigin}}.
752-
</p>
753-
</dd>
754-
<dt>
755-
<dfn dict-member>senderCaptureTimeOffset</dfn> <span class="idlMemberType">DOMHighResTimeStamp</span>
756-
</dt>
757-
<dd>
758-
<p>
759-
The {{RTCEncodedAudioFrameMetadata/senderCaptureTimeOffset}} is the sender system's estimate of the offset
760-
between its own NTP clock and the capture system's NTP clock, for the same frame that the
761-
{{RTCEncodedAudioFrameMetadata/captureTime}} was originated from.
762-
On populating this member, the user agent MUST return the value of the frame's `[[senderCaptureTimeOffset]]` slot.
763-
</p>
764-
</dd>
765-
<dt>
766-
<dfn dict-member>mimeType</dfn> <span class="idlMemberType">DOMString</span>
767-
</dt>
768-
<dd>
769-
<p>
770-
The codec MIME media type/subtype defined in the IANA media types registry
771-
[[!IANA-MEDIA-TYPES]], e.g. audio/opus.
772-
</p>
773-
</dd>
774697
</dl>
775698

776699
## <dfn interface>RTCEncodedAudioFrame</dfn> interface ## {#RTCEncodedAudioFrame-interface}
@@ -820,7 +743,7 @@ interface RTCEncodedAudioFrame {
820743
<p>
821744
The encoded frame data. The format of the data depends on the audio codec that is
822745
used to encode/decode the frame which can be determined by looking at the
823-
{{RTCEncodedAudioFrameMetadata/mimeType}}.
746+
{{RTCEncodedFrameMetadata/mimeType}}.
824747
The following table gives a number of examples:
825748
</p>
826749
<table class="simple">

0 commit comments

Comments
 (0)