From e1bc3533ec9013f57ab6c62448c1f1b9a307ac97 Mon Sep 17 00:00:00 2001 From: bdrtc Date: Mon, 5 Sep 2022 14:25:47 +0800 Subject: [PATCH 1/5] Add frameDuration attribute to OpusEncoderConfig --- opus_codec_registration.src.html | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/opus_codec_registration.src.html b/opus_codec_registration.src.html index fa8018da..7967325f 100644 --- a/opus_codec_registration.src.html +++ b/opus_codec_registration.src.html @@ -131,6 +131,7 @@ dictionary OpusEncoderConfig { OpusBitstreamFormat format = "opus"; + [EnforceRange] unsigned long frameDuration; }; @@ -141,6 +142,10 @@ Configures the format of output {{EncodedAudioChunk}}s. See {{OpusBitstreamFormat}}. +
frameDuration
+
+ Configures the frame duration, in milliseconds, of output {{EncodedAudioChunk}}s. +
OpusBitstreamFormat {#opus-bitstream-format} From 31b0ec49c5c68e8bbae76d7b170e687cec2081d3 Mon Sep 17 00:00:00 2001 From: bdrtc Date: Wed, 7 Sep 2022 10:50:22 +0800 Subject: [PATCH 2/5] change type of frameDuration in OpusEncoderConfig to unsigned long long, and meaning of it to microseconds as well --- opus_codec_registration.src.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/opus_codec_registration.src.html b/opus_codec_registration.src.html index 7967325f..5a6ded8a 100644 --- a/opus_codec_registration.src.html +++ b/opus_codec_registration.src.html @@ -131,7 +131,7 @@ dictionary OpusEncoderConfig { OpusBitstreamFormat format = "opus"; - [EnforceRange] unsigned long frameDuration; + [EnforceRange] unsigned long long frameDuration; }; @@ -144,7 +144,7 @@
frameDuration
- Configures the frame duration, in milliseconds, of output {{EncodedAudioChunk}}s. + Configures the frame duration, in microseconds, of output {{EncodedAudioChunk}}s.
From 7376fda7b12f7c56dcdefffa1fa0dd173fde9644 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BD=95=E8=B6=85?= Date: Wed, 21 Sep 2022 15:35:03 +0800 Subject: [PATCH 3/5] change the type of frameDuration in OpusEncoderConfig to unsigned long; add validation checking steps to it --- index.src.html | 5 ++++- opus_codec_registration.src.html | 12 +++++++++--- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/index.src.html b/index.src.html index 0a6ea365..a41df258 100644 --- a/index.src.html +++ b/index.src.html @@ -2073,7 +2073,10 @@ run these steps: 1. If {{AudioEncoderConfig/codec}} is not a valid codec string, return `false`. -2. Return `true`. +2. If the current codec's registry defines a codec-specific additional configuration + validation steps, run the algorithm defined in the registry. If the return + value is `false`, return it. +3. Return `true`.
codec
diff --git a/opus_codec_registration.src.html b/opus_codec_registration.src.html index 5a6ded8a..d4c14971 100644 --- a/opus_codec_registration.src.html +++ b/opus_codec_registration.src.html @@ -105,7 +105,7 @@ NOTE: Once the initialization has succeeded, any packet can be decoded at any time without error, but this might not result in the expected audio output. -AudiEncoderConfig extensions {#audioencoderconfig-extensions} +AudioEncoderConfig extensions {#audioencoderconfig-extensions} =============================================================
@@ -131,11 +131,17 @@
 
 dictionary OpusEncoderConfig {
   OpusBitstreamFormat format = "opus";
-  [EnforceRange] unsigned long long frameDuration;
+  [EnforceRange] unsigned long frameDuration;
 };
 
 
+To check if an {{OpusEncoderConfig}} is a valid OpusEncoderConfig, +run these steps: +1. If {{OpusEncoderConfig/frameDuration}} is not a valid ptime value, + which is described in section 6.1 of [[RFC6381]], return `false`. +2. Return `true`. +
format
@@ -144,7 +150,7 @@
frameDuration
- Configures the frame duration, in microseconds, of output {{EncodedAudioChunk}}s. + Configures the frame duration, in milliseconds, of output {{EncodedAudioChunk}}s.
From 7d10b29c17c46fefcb365ae4290d778ca2a846cd Mon Sep 17 00:00:00 2001 From: bdrtc Date: Fri, 23 Sep 2022 18:33:10 +0800 Subject: [PATCH 4/5] fix wrong reference of RFC7587 in opus_codec_registration --- index.src.html | 6 +++--- opus_codec_registration.src.html | 5 ++--- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/index.src.html b/index.src.html index a41df258..2becfa8d 100644 --- a/index.src.html +++ b/index.src.html @@ -2073,9 +2073,9 @@ run these steps: 1. If {{AudioEncoderConfig/codec}} is not a valid codec string, return `false`. -2. If the current codec's registry defines a codec-specific additional configuration - validation steps, run the algorithm defined in the registry. If the return - value is `false`, return it. +2. If the {{AudioEncoderConfig}} has a codec-specific extension and the corresponding + registration in the [[WEBCODECS-CODEC-REGISTRY]] defines steps to check whether the + the extension is a valid extension, return the result of running those steps. 3. Return `true`.
diff --git a/opus_codec_registration.src.html b/opus_codec_registration.src.html index d4c14971..523421b3 100644 --- a/opus_codec_registration.src.html +++ b/opus_codec_registration.src.html @@ -136,10 +136,9 @@ -To check if an {{OpusEncoderConfig}} is a valid OpusEncoderConfig, -run these steps: +To check if an {{OpusEncoderConfig}} is valid, run these steps: 1. If {{OpusEncoderConfig/frameDuration}} is not a valid ptime value, - which is described in section 6.1 of [[RFC6381]], return `false`. + which is described in Section 6.1 of [[RFC7587]], return `false`. 2. Return `true`.
From 67cc86744faa37e3fd69c9579129e3b1596ca971 Mon Sep 17 00:00:00 2001 From: bdrtc Date: Mon, 26 Sep 2022 10:13:35 +0800 Subject: [PATCH 5/5] wrap ptime with backticks in opus_codec_registration.src.html --- opus_codec_registration.src.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opus_codec_registration.src.html b/opus_codec_registration.src.html index 523421b3..54dc1a09 100644 --- a/opus_codec_registration.src.html +++ b/opus_codec_registration.src.html @@ -137,7 +137,7 @@ To check if an {{OpusEncoderConfig}} is valid, run these steps: -1. If {{OpusEncoderConfig/frameDuration}} is not a valid ptime value, +1. If {{OpusEncoderConfig/frameDuration}} is not a valid `ptime` value, which is described in Section 6.1 of [[RFC7587]], return `false`. 2. Return `true`.