Skip to content

Commit 7ff6427

Browse files
committed
Introduce RTCEncodedFrameMetadata dictionary
1 parent 3cd9f83 commit 7ff6427

File tree

1 file changed

+99
-179
lines changed

1 file changed

+99
-179
lines changed

index.bs

+99-179
Original file line numberDiff line numberDiff line change
@@ -313,8 +313,101 @@ 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+
<dd>
336+
<p>
337+
The synchronization source (ssrc) identifier is an unsigned integer value per [[RFC3550]]
338+
used to identify the stream of RTP packets that the encoded frame object is describing.
339+
</p>
340+
</dd>
341+
<dt>
342+
<dfn dict-member>payloadType</dfn> <span class="idlMemberType">octet</span>
343+
</dt>
344+
<dd>
345+
<p>
346+
The payload type is an unsigned integer value in the range from 0 to 127 per [[RFC3550]]
347+
that is used to describe the format of the RTP payload.
348+
</p>
349+
</dd>
350+
<dt>
351+
<dfn dict-member>contributingSources</dfn> <span class=
352+
"idlMemberType">sequence&lt;unsigned long&gt;</span>
353+
</dt>
354+
<dd>
355+
<p>
356+
The list of contribution sources (csrc list) as defined in [[RFC3550]].
357+
</p>
358+
</dd>
359+
<dt>
360+
<dfn dict-member>rtpTimestamp</dfn> <span class=
361+
"idlMemberType">unsigned long</span>
362+
</dt>
363+
<dd>
364+
<p>
365+
The RTP timestamp identifier is an unsigned integer value per [[RFC3550]]
366+
that reflects the sampling instant of the first octet in the RTP data packet.
367+
</p>
368+
</dd>
369+
<dt>
370+
<dfn dict-member>receiveTime</dfn> <span class=
371+
"idlMemberType">DOMHighResTimeStamp</span>
372+
</dt>
373+
<dd>
374+
<p>
375+
For frames coming from an RTCRtpReceiver, represents the timestamp
376+
of the last received packet used to produce this media frame. This
377+
timestamp is relative to {{Performance}}.{{Performance/timeOrigin}}.
378+
</p>
379+
</dd>
380+
<dt>
381+
<dfn dict-member>captureTime</dfn> <span class="idlMemberType">DOMHighResTimeStamp</span>
382+
</dt>
383+
<dd>
384+
<p>
385+
The capture time of this frame in the capture system's clock.
386+
On populating this member, the user agent MUST return the value of the frame's `[[captureTime]]` slot,
387+
shifted to be relative to {{Performance}}.{{Performance/timeOrigin}}.
388+
</p>
389+
</dd>
390+
<dt>
391+
<dfn dict-member>senderCaptureTimeOffset</dfn> <span class="idlMemberType">DOMHighResTimeStamp</span>
392+
</dt>
393+
<dd>
394+
<p>
395+
The {{RTCEncodedFrameMetadata/senderCaptureTimeOffset}} is the sender system's estimate of the offset
396+
between its own NTP clock and the capture system's NTP clock, for the same frame that the
397+
{{RTCEncodedFrameMetadata/captureTime}} was originated from.
398+
On populating this member, the user agent MUST return the value of the frame's `[[senderCaptureTimeOffset]]` slot.
399+
</p>
400+
</dd>
401+
<dt>
402+
<dfn dict-member>mimeType</dfn> <span class="idlMemberType">DOMString</span>
403+
</dt>
404+
<dd>
405+
<p>
406+
The codec MIME media type/subtype defined in the IANA media types registry
407+
[[!IANA-MEDIA-TYPES]], e.g. audio/opus or video/VP8.
408+
</p>
409+
</dd>
410+
</dl>
318411

319412
## <dfn enum>RTCEncodedVideoFrameType</dfn> dictionary ## {#RTCEncodedVideoFrameType}
320413
<pre class="idl">
@@ -369,22 +462,14 @@ enum RTCEncodedVideoFrameType {
369462

370463
## <dfn dictionary>RTCEncodedVideoFrameMetadata</dfn> dictionary ## {#RTCEncodedVideoFrameMetadata}
371464
<pre class="idl">
372-
dictionary RTCEncodedVideoFrameMetadata {
465+
dictionary RTCEncodedVideoFrameMetadata : RTCEncodedFrameMetadata {
373466
unsigned long long frameId;
374467
sequence&lt;unsigned long long&gt; dependencies;
375468
unsigned short width;
376469
unsigned short height;
377470
unsigned long spatialIndex;
378471
unsigned long temporalIndex;
379-
unsigned long synchronizationSource;
380-
octet payloadType;
381-
sequence&lt;unsigned long&gt; contributingSources;
382472
long long timestamp; // microseconds
383-
unsigned long rtpTimestamp;
384-
DOMHighResTimeStamp receiveTime;
385-
DOMHighResTimeStamp captureTime;
386-
DOMHighResTimeStamp senderCaptureTimeOffset;
387-
DOMString mimeType;
388473
};
389474
</pre>
390475

@@ -410,33 +495,6 @@ dictionary RTCEncodedVideoFrameMetadata {
410495
Only present for received frames if the AV1 Dependency Descriptor Header Extension defined in Appendix A of [[AV1-RTP-SPEC]] is present.
411496
</p>
412497
</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>
440498
<dt>
441499
<dfn dict-member>timestamp</dfn> <span class=
442500
"idlMemberType">long long</span>
@@ -447,58 +505,6 @@ dictionary RTCEncodedVideoFrameMetadata {
447505
{{VideoFrame/timestamp}} for raw frames which correspond to this frame.
448506
</p>
449507
</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>
502508
</dl>
503509

504510

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

668674
## <dfn dictionary>RTCEncodedAudioFrameMetadata</dfn> dictionary ## {#RTCEncodedAudioFrameMetadata}
669675
<pre class="idl">
670-
dictionary RTCEncodedAudioFrameMetadata {
671-
unsigned long synchronizationSource;
672-
octet payloadType;
673-
sequence&lt;unsigned long&gt; contributingSources;
676+
dictionary RTCEncodedAudioFrameMetadata : RTCEncodedFrameMetadata {
674677
short sequenceNumber;
675-
unsigned long rtpTimestamp;
676-
DOMHighResTimeStamp receiveTime;
677-
DOMHighResTimeStamp captureTime;
678-
DOMHighResTimeStamp senderCaptureTimeOffset;
679-
DOMString mimeType;
680678
};
681679
</pre>
682680
### Members ### {#RTCEncodedAudioFrameMetadata-members}
683681
<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>
711682
<dt>
712683
<dfn dict-member>sequenceNumber</dfn> <span class=
713684
"idlMemberType">short</span>
@@ -720,57 +691,6 @@ dictionary RTCEncodedAudioFrameMetadata {
720691
Comparing two sequence numbers requires serial number arithmetic described in [[RFC1982]].
721692
</p>
722693
</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>
774694
</dl>
775695

776696
## <dfn interface>RTCEncodedAudioFrame</dfn> interface ## {#RTCEncodedAudioFrame-interface}
@@ -820,7 +740,7 @@ interface RTCEncodedAudioFrame {
820740
<p>
821741
The encoded frame data. The format of the data depends on the audio codec that is
822742
used to encode/decode the frame which can be determined by looking at the
823-
{{RTCEncodedAudioFrameMetadata/mimeType}}.
743+
{{RTCEncodedFrameMetadata/mimeType}}.
824744
The following table gives a number of examples:
825745
</p>
826746
<table class="simple">

0 commit comments

Comments
 (0)