Skip to content

Commit

Permalink
Bug 1917721 - Add WPT testing AAC AudioDecoderConfig w/o description …
Browse files Browse the repository at this point in the history
…r=media-playback-reviewers,padenot

Add a AAC-without-AudioDecoderConfig-description WPT for bug 1891082.

Differential Revision: https://phabricator.services.mozilla.com/D221279
  • Loading branch information
ChunMinChang committed Oct 3, 2024
1 parent c185123 commit de44af6
Show file tree
Hide file tree
Showing 2 changed files with 66 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,46 @@
if os == "android": NOTRUN


[audioDecoder-codec-specific.https.any.worker.html?mp4_raw_aac_no_desc]
expected:
if os == "android": ERROR
[Test isConfigSupported()]
expected:
if os == "android": NOTRUN

[Test that AudioDecoder.isConfigSupported() returns a parsed configuration]
expected:
if os == "android": NOTRUN

[Test configure()]
expected:
if os == "android": NOTRUN

[Verify closed AudioDecoder operations]
expected:
if os == "android": NOTRUN

[Test decoding]
expected:
if os == "android": NOTRUN

[Test decoding a with negative timestamp]
expected:
if os == "android": NOTRUN

[Test decoding after flush]
expected:
if os == "android": NOTRUN

[Test reset during flush]
expected:
if os == "android": NOTRUN

[AudioDecoder decodeQueueSize test]
expected:
if os == "android": NOTRUN


[audioDecoder-codec-specific.https.any.html?opus]
expected:
if (os == "android") and not debug: [OK, ERROR]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// META: script=/webcodecs/utils.js
// META: variant=?adts_aac
// META: variant=?mp4_aac
// META: variant=?mp4_raw_aac_no_desc
// META: variant=?mp3
// META: variant=?opus
// META: variant=?pcm_alaw
Expand Down Expand Up @@ -70,6 +71,30 @@ const MP4_AAC_DATA = {
duration: 21333
};

// By spec, if the description is absent, the bitstream defaults to ADTS format.
// However, this is added to ensure compatibility and handle potential misuse cases.
const MP4_AAC_DATA_NO_DESCRIPTION = {
src: 'sfx-aac.mp4',
config: {
codec: 'mp4a.40.2',
sampleRate: 48000,
numberOfChannels: 1,
},
chunks: [
{offset: 44, size: 241},
{offset: 285, size: 273},
{offset: 558, size: 251},
{offset: 809, size: 118},
{offset: 927, size: 223},
{offset: 1150, size: 141},
{offset: 1291, size: 217},
{offset: 1508, size: 159},
{offset: 1667, size: 209},
{offset: 1876, size: 176},
],
duration: 21333
};

const OPUS_DATA = {
src: 'sfx-opus.ogg',
config: {
Expand Down Expand Up @@ -162,6 +187,7 @@ promise_setup(async () => {
'?adts_aac': ADTS_AAC_DATA,
'?mp3': MP3_DATA,
'?mp4_aac': MP4_AAC_DATA,
'?mp4_raw_aac_no_desc': MP4_AAC_DATA_NO_DESCRIPTION,
'?opus': OPUS_DATA,
'?pcm_alaw': PCM_ALAW_DATA,
'?pcm_ulaw': PCM_ULAW_DATA,
Expand Down

0 comments on commit de44af6

Please sign in to comment.