Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into registry-av1
Browse files Browse the repository at this point in the history
  • Loading branch information
dalecurtis committed Aug 9, 2021
2 parents 7ce5b4c + d64137c commit ab99231
Show file tree
Hide file tree
Showing 7 changed files with 251 additions and 8 deletions.
12 changes: 11 additions & 1 deletion .github/workflows/auto-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,24 @@ jobs:
echidna_token: ECHIDNA_TOKEN_VORBIS_REGISTRATION
build_override: |
status: NOTE-WD
- source: mp3_codec_registration.src.html
destination: mp3_codec_registration.html
echidna_token: ECHIDNA_TOKEN_MP3_REGISTRATION
build_override: |
status: NOTE-WD
- source: flac_codec_registration.src.html
destination: flac_codec_registration.html
echidna_token: ECHIDNA_TOKEN_FLAC_REGISTRATION
build_override: |
status: NOTE-WD
- source: opus_codec_registration.src.html
destination: opus_codec_registration.html
echidna_token: ECHIDNA_TOKEN_OPUS_REGISTRATION
build_override: |
status: NOTE-WD
- source: av1_codec_registration.src.html
destination: av1_codec_registration.html
echidna_token: ECHIDNA_TOKEN_AV1_REGISTRATION
echidna_token: ECHIDNA_TOKEN_AV1_REGISTRATION
build_override: |
status: NOTE-WD
steps:
Expand Down
6 changes: 4 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
avc_codec_registration.html
av1_codec_registration.src.html
codec_registry.html
vorbis_codec_registration.html
flac_codec_registration.src.html
av1_codec_registration.src.html
mp3_codec_registration.html
flac_codec_registration.html
opus_codec_registration.html
/index.html
out/

8 changes: 6 additions & 2 deletions codec_registry.src.html
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,9 @@
<tr>
<td>mp3</td>
<td>MP3</td>
<td>N/A</td>
<td>[MP3 WebCodecs
Registration](https://www.w3.org/TR/webcodecs-mp3-codec-registration/)
[[WEBCODECS-MP3-CODEC-REGISTRATION]]</td>
</tr>
<tr>
<td>mp4a.*</td>
Expand All @@ -108,7 +110,9 @@
<tr>
<td>opus</td>
<td>Opus</td>
<td>TODO (AudioDecoderConfig.description)</td>
<td>[Opus WebCodecs
Registration](https://www.w3.org/TR/webcodecs-opus-codec-registration/)
[[WEBCODECS-OPUS-CODEC-REGISTRATION]]</td>
</tr>
<tr>
<td>vorbis</td>
Expand Down
7 changes: 4 additions & 3 deletions flac_codec_registration.src.html
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,15 @@
{{AudioDecoderConfig.description}} is required, and has to be the following:

- The bytes `0x66 0x4C 0x61 0x43` ("`fLaC`" in ASCII)
- A `METADATA_BLOCK` of type `STEAMINFO`as described in [[FLAC]]
- A `METADATA_BLOCK` of type `STEAMINFO` as described in [[FLAC]]
- Optionaly other `METADATA_BLOCK`, that are not used by the specification

The {{AudioDecoderConfig.sampleRate}} and {{AudioDecoderConfig.channelCount}}
members are overridden by what the decoder finds in the
{{AudioDecoderConfig.description}}.

NOTE: This corresponds to the
NOTE: This corresponds to the beginning of a FLAC bitstream, before the audio
frames.

EncodedAudioChunk type {#encodedaudiochunk-type}
================================================
Expand All @@ -90,7 +91,7 @@
FLAC is always "[=EncodedAudioChunkType/key=]".

NOTE: Once the initialization has succeeded, any FLAC packet can be decoded at
any time without error, but this might not result in the expected audio output.
any time without error, but this might not result in the expected audio output.

Privacy and Security Considerations {#privacy-and-security-considerations}
==========================================================================
Expand Down
20 changes: 20 additions & 0 deletions index.src.html
Original file line number Diff line number Diff line change
Expand Up @@ -4687,6 +4687,7 @@

Privacy Considerations{#privacy-considerations}
===============================================

The primary privacy impact is an increased ability to fingerprint users by
querying for different codec capabilities to establish a codec feature profile.
Much of this profile is already exposed by existing APIs. Such profiles are very
Expand Down Expand Up @@ -4726,3 +4727,22 @@
may implement a "privacy budget", which depletes as authors use WebCodecs and
other identifying APIs. Upon exhaustion of the privacy budget, codec
capabilities could be reduced to a common baseline or prompt for user approval.

Best Practices for Authors Using WebCodecs{#best-practices-developers}
======================================================================

While WebCodecs internally operates on background threads, authors working with
realtime media or in contended main thread environments should ensure their
media pipelines operate in worker contexts entirely independent of the main
thread where possible. For example, realtime media processing of {{VideoFrame}}s
should generally be done in a worker context.

The main thread has significant potential for high contention and jank that may
go unnoticed in development, yet degrade inconsistently across devices and User
Agents in the field -- potentially dramatically impacting the end user
experience. Ensuring the media pipeline is decoupled from the main thread helps
provide a smooth experience for end users.

Authors using the main thread for their media pipeline should be sure of their
target frame rates, main thread work load, how their application will be
embedded, and the class of devices their users will be using.
96 changes: 96 additions & 0 deletions mp3_codec_registration.src.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
<pre class='metadata'>
Title: MP3 WebCodecs Registration
Repository: w3c/webcodecs
Status: NOTE-ED
Shortname: webcodecs-mp3-codec-registration
Level: none
Group: mediawg
ED: https://w3c.github.io/webcodecs/mp3_codec_registration.html
TR: https://www.w3.org/TR/webcodecs-mp3-codec-registration/
Editor: Chris Cunningham, w3cid 114832, Google Inc. https://www.google.com/
Editor: Paul Adenot, w3cid 62410, Mozilla https://www.mozilla.org/
Editor: Bernard Aboba, w3cid 65611, Microsoft Corporation https://www.microsoft.com/

Abstract: This registration is entered into the [[webcodecs-codec-registry]].
It describes, for MP3, the (1) fully qualified codec strings, (2)
the {{AudioDecoderConfig.description}} bytes, (3) the codec-specific
{{EncodedAudioChunk}} [=EncodedAudioChunk/[[internal data]]=] bytes, and (4)
the values of {{EncodedAudioChunk}} [=EncodedAudioChunk/[[type]]=].

The registration is not intended to include any information on whether a
codec format is encumbered by intellectual property claims. Implementers and
authors are advised to seek appropriate legal counsel in this matter if they
intend to implement or use a specific codec format. Implementers of
WebCodecs are not required to support the MP3 codec.

This registration is non-normative.

Markup Shorthands:css no, markdown yes, dfn yes
!Participate: <a href="https://github.com/w3c/webcodecs">Git Repository.</a>
!Participate: <a href="https://github.com/w3c/webcodecs/issues/new">File an issue.</a>
!Version History: <a href="https://github.com/w3c/webcodecs/commits">https://github.com/w3c/webcodecs/commits</a>
</pre>

<pre class='anchors'>
spec: WEBCODECS; urlPrefix: https://w3c.github.io/webcodecs/#
type: attribute
text: AudioDecoderConfig.description; url: dom-audiodecoderconfig-description
text: AudioDecoderConfig.sampleRate; url: dom-audiodecoderconfig-samplerate
text: AudioDecoderConfig.channelCount; url: dom-audiodecoderconfig-channelcount
type: dfn
for: EncodedAudioChunkType; text: key; url: dom-encodedaudiochunktype-key
for: EncodedAudioChunk; text: [[internal data]]; url: dom-encodedaudiochunk-internal-data-slot
for: EncodedAudioChunk; text: [[type]]; url: dom-encodedaudiochunk-type-slot
type: interface
text: EncodedAudioChunk; url: encodedaudiochunk
type: dictionary
text: AudioDecoderConfig; url: dictdef-audiodecoderconfig
</pre>

<pre class='biblio'>
{
"MP3": {
"href": "https://www.iso.org/standard/26797.html",
"title": "ISO/IEC 13818-3:1998 - Information technology — Generic coding of moving pictures and associated audio information — Part 3: Audio",
"publisher": "ISO",
"date": "1998-04"
}
}
</pre>

Fully qualified codec strings {#fully-qualified-codec-strings}
==============================================================

The codec string is `"mp3"`.

EncodedAudioChunk data {#encodedaudiochunk-data}
================================================

{{EncodedAudioChunk}} [=EncodedAudioChunk/[[internal data]]=] is expected to be
a "frame", as described in the section 2.4.2.2 of the [[MP3]] specification.

AudioDecoderConfig description {#audiodecoderconfig-description}
================================================================

{{AudioDecoderConfig.description}} is not used for this codec.

The {{AudioDecoderConfig.sampleRate}} and {{AudioDecoderConfig.channelCount}}
members are ignored.


EncodedAudioChunk type {#encodedaudiochunk-type}
================================================

The [=EncodedAudioChunk/[[type]]=] for an {{EncodedAudioChunk}} containing
mp3 is always "[=EncodedAudioChunkType/key=]".

NOTE: Once the initialization has succeeded, any mp3 packet can be decoded at
any time without error, but this might not result in the expected audio
output.

Privacy and Security Considerations {#privacy-and-security-considerations}
==========================================================================

Please refer to the [[WEBCODECS#privacy-considerations|Privacy Considerations]]
and [[WEBCODECS#security-considerations|Security Considerations]] sections in
[[WEBCODECS]].
110 changes: 110 additions & 0 deletions opus_codec_registration.src.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
<pre class='metadata'>
Title: Opus WebCodecs Registration
Repository: w3c/webcodecs
Status: NOTE-ED
Shortname: webcodecs-opus-codec-registration
Level: none
Group: mediawg
ED: https://w3c.github.io/webcodecs/opus_codec_registration.html
TR: https://www.w3.org/TR/webcodecs-opus-codec-registration/
Editor: Chris Cunningham, w3cid 114832, Google Inc. https://www.google.com/
Editor: Paul Adenot, w3cid 62410, Mozilla https://www.mozilla.org/
Editor: Bernard Aboba, w3cid 65611, Microsoft Corporation https://www.microsoft.com/

Abstract: This registration is entered into the [[webcodecs-codec-registry]].
It describes, for Opus, the (1) fully qualified codec strings, (2)
the {{AudioDecoderConfig.description}} bytes, (3) the codec-specific
{{EncodedAudioChunk}} [=EncodedAudioChunk/[[internal data]]=] bytes, and (4)
the values of {{EncodedAudioChunk}} [=EncodedAudioChunk/[[type]]=].

The registration is not intended to include any information on whether a
codec format is encumbered by intellectual property claims. Implementers and
authors are advised to seek appropriate legal counsel in this matter if they
intend to implement or use a specific codec format. Implementers of
WebCodecs are not required to support the Opus codec.

This registration is non-normative.

Markup Shorthands:css no, markdown yes, dfn yes
!Participate: <a href="https://github.com/w3c/webcodecs">Git Repository.</a>
!Participate: <a href="https://github.com/w3c/webcodecs/issues/new">File an issue.</a>
!Version History: <a href="https://github.com/w3c/webcodecs/commits">https://github.com/w3c/webcodecs/commits</a>
</pre>

<pre class='anchors'>
spec: WEBCODECS; urlPrefix: https://w3c.github.io/webcodecs/#
type: attribute
text: AudioDecoderConfig.description; url: dom-audiodecoderconfig-description
type: dfn
for: EncodedAudioChunkType; text: key; url: dom-encodedaudiochunktype-key
for: EncodedAudioChunk; text: [[internal data]]; url: dom-encodedaudiochunk-internal-data-slot
for: EncodedAudioChunk; text: [[type]]; url: dom-encodedaudiochunk-type-slot
type: method
for: AudioDecoder; text: AudioDecoder.decode; url: dom-audiodecoder-decode
type: interface
text: EncodedAudioChunk; url: encodedaudiochunk
type: dictionary
text: AudioDecoderConfig; url: dictdef-audiodecoderconfig
</pre>

<pre class='biblio'>
{
"OPUS": {
"href": "https://datatracker.ietf.org/doc/html/rfc6716",
"title": "RFC 6716: Definition of the Opus Audio Codec",
"publisher": "IETF",
"date": "September 2012"
},
"OPUS-IN-OGG": {
"href": "https://datatracker.ietf.org/doc/html/rfc7845",
"title": "RFC 7845: Ogg Encapsulation for the Opus Audio Codec",
"publisher": "IETF",
"date": "April 2016"
}
}
</pre>

Fully qualified codec strings {#fully-qualified-codec-strings}
==============================================================

The codec string is `"opus"`.

EncodedAudioChunk data {#encodedaudiochunk-data}
================================================

An {{EncodedAudioChunk}} containing Opus can be in two different formats,
depending on if {{AudioDecoderConfig.description}} has been set during
initialization.


AudioDecoderConfig description {#audiodecoderconfig-description}
================================================================

{{AudioDecoderConfig.description}} can optionally set to an Identification
Header, described in section 5.1 of [[OPUS-IN-OGG]].

If an {{AudioDecoderConfig.description}} has been set, the
{{EncodedAudioChunk}}s passed to the {{AudioDecoder.decode}}} method have to be
in audio data packets, as described in [section
2](https://datatracker.ietf.org/doc/html/rfc7845#section-3) of [[OPUS-IN-OGG]].

If an {{AudioDecoderConfig.description}} has not been set, then the
{{EncodedAudioChunk}}s passed to the {{AudioDecoder.decode}} method have to be
Opus packets, as described in [section
3](https://datatracker.ietf.org/doc/html/rfc6716#section-3) of [[OPUS]].

EncodedAudioChunk type {#encodedaudiochunk-type}
================================================

The [=EncodedAudioChunk/[[type]]=] for an {{EncodedAudioChunk}} containing
Opus is always "[=EncodedAudioChunkType/key=]".

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.

Privacy and Security Considerations {#privacy-and-security-considerations}
==========================================================================

Please refer to the [[WEBCODECS#privacy-considerations|Privacy Considerations]]
and [[WEBCODECS#security-considerations|Security Considerations]] sections in
[[WEBCODECS]].

0 comments on commit ab99231

Please sign in to comment.