| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // The <code>chrome.webrtcAudioPrivate</code> API allows enumeration | 5 // The <code>chrome.webrtcAudioPrivate</code> API allows enumeration |
| 6 // of audio output (sink) devices as well as getting and setting the | 6 // of audio output (sink) devices. |
| 7 // active device for a given requesting process. | |
| 8 // | 7 // |
| 9 // Note that device IDs as used in this API are opaque (i.e. they are | 8 // Note that device IDs as used in this API are opaque (i.e. they are |
| 10 // not the hardware identifier of the device) and while they are | 9 // not the hardware identifier of the device) and while they are |
| 11 // unique and persistent across sessions, they are valid only to the | 10 // unique and persistent across sessions, they are valid only to the |
| 12 // extension calling this API (i.e. they cannot be shared between | 11 // extension calling this API (i.e. they cannot be shared between |
| 13 // extensions). | 12 // extensions). |
| 14 // | 13 // |
| 15 // See http://goo.gl/8rOmgk for further documentation of this API. | 14 // See http://goo.gl/8rOmgk for further documentation of this API. |
| 16 | 15 |
| 17 namespace webrtcAudioPrivate { | 16 namespace webrtcAudioPrivate { |
| (...skipping 14 matching lines...) Expand all Loading... |
| 32 // | 31 // |
| 33 // TODO(joi): Do unplugged devices even get included in enumeration? | 32 // TODO(joi): Do unplugged devices even get included in enumeration? |
| 34 boolean isReady; | 33 boolean isReady; |
| 35 // True if this device is the default audio sink device on the | 34 // True if this device is the default audio sink device on the |
| 36 // machine. | 35 // machine. |
| 37 boolean isDefault; | 36 boolean isDefault; |
| 38 }; | 37 }; |
| 39 | 38 |
| 40 callback GetSinksCallback = void(SinkInfo[] sinkInfo); | 39 callback GetSinksCallback = void(SinkInfo[] sinkInfo); |
| 41 callback SinkIdCallback = void(DOMString sinkId); | 40 callback SinkIdCallback = void(DOMString sinkId); |
| 42 callback CompletionCallback = void(); | |
| 43 | 41 |
| 44 dictionary RequestInfo { | 42 dictionary RequestInfo { |
| 45 // The tab identifier from the chrome.tabs API, if the request is from a | 43 // The tab identifier from the chrome.tabs API, if the request is from a |
| 46 // tab. | 44 // tab. |
| 47 long? tabId; | 45 long? tabId; |
| 48 // The guest process id for the requester, if the request is from a | 46 // The guest process id for the requester, if the request is from a |
| 49 // webview. | 47 // webview. |
| 50 long? guestProcessId; | 48 long? guestProcessId; |
| 51 }; | 49 }; |
| 52 | 50 |
| 53 dictionary AudioExperiments { | 51 dictionary AudioExperiments { |
| 54 // Enables or disables the new acoustic echo canceller (AEC3) in WebRTC. | 52 // Enables or disables the new acoustic echo canceller (AEC3) in WebRTC. |
| 55 boolean? enableAec3; | 53 boolean? enableAec3; |
| 56 }; | 54 }; |
| 57 | 55 |
| 58 interface Functions { | 56 interface Functions { |
| 59 // Retrieves a list of available audio sink devices. | 57 // Retrieves a list of available audio sink devices. |
| 60 static void getSinks(GetSinksCallback callback); | 58 static void getSinks(GetSinksCallback callback); |
| 61 | 59 |
| 62 // Retrieves the currently active audio sink for the given requesting | |
| 63 // process. | |
| 64 static void getActiveSink(RequestInfo request, | |
| 65 SinkIdCallback callback); | |
| 66 | |
| 67 // Sets the active audio sink device for the specified requesting process. | |
| 68 static void setActiveSink(RequestInfo request, | |
| 69 DOMString sinkId, | |
| 70 optional CompletionCallback callback); | |
| 71 | |
| 72 // Given a security origin and an input device ID valid for that | 60 // Given a security origin and an input device ID valid for that |
| 73 // security origin, retrieve an audio sink ID valid for the | 61 // security origin, retrieve an audio sink ID valid for the |
| 74 // extension, or the empty string if there is no associated audio | 62 // extension, or the empty string if there is no associated audio |
| 75 // sink. | 63 // sink. |
| 76 // | 64 // |
| 77 // The associated sink ID can be used as a sink ID for | 65 // The associated sink ID can be used as a sink ID for |
| 78 // setActiveSink. It is valid irrespective of which process you are | 66 // setActiveSink. It is valid irrespective of which process you are |
| 79 // setting the active sink for. | 67 // setting the active sink for. |
| 80 static void getAssociatedSink(DOMString securityOrigin, | 68 static void getAssociatedSink(DOMString securityOrigin, |
| 81 DOMString sourceIdInOrigin, | 69 DOMString sourceIdInOrigin, |
| 82 SinkIdCallback cb); | 70 SinkIdCallback cb); |
| 83 | 71 |
| 84 // Sets the active audio experiments. | 72 // Sets the active audio experiments. |
| 85 // |request|: Information about the requesting process. | 73 // |request|: Information about the requesting process. |
| 86 // |securityOrigin|: The origin to restrict the settings to. | 74 // |securityOrigin|: The origin to restrict the settings to. |
| 87 // |audioExperiments|: The experiments to enable or disable. | 75 // |audioExperiments|: The experiments to enable or disable. |
| 88 static void setAudioExperiments(RequestInfo request, | 76 static void setAudioExperiments(RequestInfo request, |
| 89 DOMString securityOrigin, | 77 DOMString securityOrigin, |
| 90 AudioExperiments audioExperiments); | 78 AudioExperiments audioExperiments); |
| 91 }; | 79 }; |
| 92 | 80 |
| 93 interface Events { | 81 interface Events { |
| 94 // Fired when audio sink devices are added or removed. | 82 // Fired when audio sink devices are added or removed. |
| 95 static void onSinksChanged(); | 83 static void onSinksChanged(); |
| 96 }; | 84 }; |
| 97 }; | 85 }; |
| OLD | NEW |