Bug 1885602 - Part 5: Implement navigating to the SUMO help topic from the menu heade...
[gecko.git] / dom / webidl / AudioDecoder.webidl
blob55cfe8e5e37dd63c7e2e59210f971964a5b132e0
1 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
4  * You can obtain one at http://mozilla.org/MPL/2.0/.
5  *
6  * The origin of this IDL file is
7  * https://w3c.github.io/webcodecs/#audiodecoder
8  */
10 [Exposed=(Window,DedicatedWorker), SecureContext, Pref="dom.media.webcodecs.enabled"]
11 interface AudioDecoder : EventTarget {
12   [Throws]
13   constructor(AudioDecoderInit init);
15   readonly attribute CodecState state;
16   readonly attribute unsigned long decodeQueueSize;
17   attribute EventHandler ondequeue;
19   [Throws]
20   undefined configure(AudioDecoderConfig config);
21   [Throws]
22   undefined decode(EncodedAudioChunk chunk);
23   [NewObject, Throws]
24   Promise<undefined> flush();
25   [Throws]
26   undefined reset();
27   [Throws]
28   undefined close();
30   [NewObject, Throws]
31   static Promise<AudioDecoderSupport> isConfigSupported(AudioDecoderConfig config);
34 dictionary AudioDecoderInit {
35   required AudioDataOutputCallback output;
36   required WebCodecsErrorCallback error;
39 callback AudioDataOutputCallback = undefined(AudioData output);
41 dictionary AudioDecoderSupport {
42   boolean supported;
43   AudioDecoderConfig config;
46 dictionary AudioDecoderConfig {
47   required DOMString codec;
48   required [EnforceRange] unsigned long sampleRate;
49   required [EnforceRange] unsigned long numberOfChannels;
51   // Bug 1696216: Should be AllowSharedBufferSource
52   ([AllowShared] ArrayBufferView or [AllowShared] ArrayBuffer) description;