Skip to content

Commit bf73ba1

Browse files
authored
Merge branch 'main' into introduce-RTCEncodedFrameMetadata
2 parents f834681 + 9745de0 commit bf73ba1

File tree

1 file changed

+30
-14
lines changed

1 file changed

+30
-14
lines changed

index.bs

Lines changed: 30 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -177,26 +177,31 @@ As [$writeEncodedData$] ensures that the transform cannot reorder frames, this w
177177

178178
## Extension attribute ## {#attribute}
179179

180-
A RTCRtpTransform has two private slots called `[[readable]]` and `[[writable]]`.
180+
A RTCRtpTransform has private slots:
181+
* `[[readable]]` of type {{ReadableStream}}.
182+
* `[[writable]]` of type {{WritableStream}}.
183+
* `[[owner]]` of type {{RTCRtpSender}} or {{RTCRtpReceiver}}, initialized to null.
181184

182185
Each RTCRtpTransform has an <dfn abstract-op for=RTCRtpTransform>association steps</dfn> set, which is empty by default.
183186

184187
The <dfn attribute for="RTCRtpSender,RTCRtpReceiver">transform</dfn> getter steps are:
185188
1. Return [=this=].`[[transform]]`.
186189

187190
The `transform` setter steps are:
188-
2. Let |transform| be the argument to the setter.
189-
3. Let |checkedTransform| set to |transform| if it is not null or to an [=identity transform stream=] otherwise.
190-
3. Let |reader| be the result of [=ReadableStream/getting a reader=] for |checkedTransform|.`[[readable]]`.
191-
4. Let |writer| be the result of [=WritableStream/getting a writer=] for |checkedTransform|.`[[writable]]`.
192-
5. Initialize |newPipeToController| to a new {{AbortController}}.
193-
6. If [=this=].`[[pipeToController]]` is not null, run the following steps:
191+
1. Let |transform| be the argument to the setter.
192+
1. Let |checkedTransform| set to |transform| if it is not null or to an [=identity transform stream=] otherwise.
193+
1. If |checkedTransform|.`[[owner]]` is not null, throw a {{InvalidStateError}} and abort these steps.
194+
1. Let |reader| be the result of [=ReadableStream/getting a reader=] for |checkedTransform|.`[[readable]]`.
195+
1. Let |writer| be the result of [=WritableStream/getting a writer=] for |checkedTransform|.`[[writable]]`.
196+
1. Set |checkedTransform|.`[[owner]]` to [=this=].
197+
1. Initialize |newPipeToController| to a new {{AbortController}}.
198+
1. If [=this=].`[[pipeToController]]` is not null, run the following steps:
194199
1. [=AbortSignal/Add=] the [$chain transform algorithm$] to [=this=].`[[pipeToController]]`'s [=AbortController/signal=].
195200
2. [=AbortController/signal abort=] on [=this=].`[[pipeToController]]`.
196-
7. Else, run the [$chain transform algorithm$] steps.
197-
8. Set [=this=].`[[pipeToController]]` to |newPipeToController|.
198-
9. Set [=this=].`[[transform]]` to |transform|.
199-
10. Run the steps in the set of [$association steps$] of |transform| with [=this=].
201+
1. Else, run the [$chain transform algorithm$] steps.
202+
1. Set [=this=].`[[pipeToController]]` to |newPipeToController|.
203+
1. Set [=this=].`[[transform]]` to |transform|.
204+
1. Run the steps in the set of [$association steps$] of |transform| with [=this=].
200205

201206
The <dfn abstract-op>chain transform algorithm</dfn> steps are defined as:
202207
1. If |newPipeToController|'s [=AbortController/signal=] is [=AbortSignal/aborted=], abort these steps.
@@ -629,7 +634,7 @@ interface RTCEncodedVideoFrame {
629634
The data is a series of OBUs compliant to the
630635
<a href="https://aomediacodec.github.io/av1-spec/#low-overhead-bitstream-format">
631636
low-overhead bitstream format</a> as described in Section 5 of [[AV1]].
632-
The <a href="https://aomediacodec.github.io/av1-rtp-spec/#41-rtp-header-usage">
637+
The <a href="https://aomediacodec.github.io/av1-rtp-spec/#aggregation-header">
633638
AV1 aggregation header</a> is not accessible.
634639
</td>
635640
</tr>
@@ -678,6 +683,7 @@ An implementation is therefore free to choose whatever method works best.
678683
<pre class="idl">
679684
dictionary RTCEncodedAudioFrameMetadata : RTCEncodedFrameMetadata {
680685
short sequenceNumber;
686+
double audioLevel;
681687
};
682688
</pre>
683689
### Members ### {#RTCEncodedAudioFrameMetadata-members}
@@ -694,6 +700,16 @@ dictionary RTCEncodedAudioFrameMetadata : RTCEncodedFrameMetadata {
694700
Comparing two sequence numbers requires serial number arithmetic described in [[RFC1982]].
695701
</p>
696702
</dd>
703+
<dt>
704+
<dfn dict-member>audioLevel</dfn> <span class="idlMemberType">double</span>
705+
</dt>
706+
<dd>
707+
<p>
708+
The audio level of this frame. The value is between 0..1 (linear),
709+
where 1.0 represents 0 dBov, 0 represents silence, and 0.5 represents
710+
approximately 6 dBSPL change in the sound pressure level from 0 dBov.
711+
</p>
712+
</dd>
697713
</dl>
698714

699715
## <dfn interface>RTCEncodedAudioFrame</dfn> interface ## {#RTCEncodedAudioFrame-interface}
@@ -967,7 +983,7 @@ The <dfn abstract-op>generate key frame algorithm</dfn>, given |promise|, |encod
967983
1. Gather a list of video encoders, named |videoEncoders| from |encoder|, ordered according negotiated RIDs if any.
968984
1. If |rid| is defined, remove from |videoEncoders| any video encoder that does not match |rid|.
969985
1. If |rid| is undefined, remove from |videoEncoders| all video encoders except the first one.
970-
1. If |videoEncoders| is empty, reject |promise| with {{NotFoundError}} and abort these steps.
986+
1. If |videoEncoders| is empty, [=queue a task=] to reject |promise| with {{NotFoundError}} and abort these steps.
971987
|videoEncoders| is expected to be empty if the corresponding {{RTCRtpSender}} is not active, or the corresponding {{RTCRtpSender}} track is ended.
972988
1. Let |videoEncoder| be the first encoder in |videoEncoders|.
973989
1. If |rid| is undefined, set |rid| to the RID value corresponding to |videoEncoder|.
@@ -998,7 +1014,7 @@ The <dfn abstract-op>send request key frame algorithm</dfn>, given |promise| and
9981014
1. If sending a Full Intra Request (FIR) by |depacketizer|'s receiver is not deemed appropriate, [=resolve=] |promise| with undefined and abort these steps.
9991015
Section 4.3.1 of [[RFC5104]] provides guidelines of how and when it is appropriate to sending a Full Intra Request.
10001016
1. Generate a Full Intra Request (FIR) packet as defined in section 4.3.1 of [[RFC5104]] and send it through |depacketizer|'s receiver.
1001-
1. [=Resolve=] |promise| with undefined.
1017+
1. [=Queue a task=] to [=resolve=] |promise| with undefined.
10021018

10031019
# RTCRtpSender extension # {#rtcrtpsender-extension}
10041020

0 commit comments

Comments
 (0)