Bug 1526591 - Remove devtools.inspector.shapesHighlighter.enabled pref. r=rcaliman
[gecko.git] / dom / media / CubebUtils.h
blobeebaee81356db7be371fb8cffeacd74f4f379621
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim:set ts=2 sw=2 sts=2 et cindent: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #if !defined(CubebUtils_h_)
8 # define CubebUtils_h_
10 # include "cubeb/cubeb.h"
11 # include "nsString.h"
12 # include "mozilla/RefPtr.h"
14 class AudioDeviceInfo;
16 namespace mozilla {
17 namespace CubebUtils {
19 typedef cubeb_devid AudioDeviceID;
21 // Initialize Audio Library. Some Audio backends require initializing the
22 // library before using it.
23 void InitLibrary();
25 // Shutdown Audio Library. Some Audio backends require shutting down the
26 // library after using it.
27 void ShutdownLibrary();
29 // Returns the maximum number of channels supported by the audio hardware.
30 uint32_t MaxNumberOfChannels();
32 // Get the sample rate the hardware/mixer runs at. Thread safe.
33 uint32_t PreferredSampleRate();
35 enum Side { Input, Output };
37 double GetVolumeScale();
38 bool GetFirstStream();
39 cubeb* GetCubebContext();
40 void ReportCubebStreamInitFailure(bool aIsFirstStream);
41 void ReportCubebBackendUsed();
42 uint32_t GetCubebPlaybackLatencyInMilliseconds();
43 uint32_t GetCubebMSGLatencyInFrames(cubeb_stream_params* params);
44 bool CubebLatencyPrefSet();
45 void GetCurrentBackend(nsAString& aBackend);
46 void GetDeviceCollection(nsTArray<RefPtr<AudioDeviceInfo>>& aDeviceInfos,
47 Side aSide);
48 cubeb_stream_prefs GetDefaultStreamPrefs();
49 char* GetForcedOutputDevice();
51 # ifdef MOZ_WIDGET_ANDROID
52 uint32_t AndroidGetAudioOutputSampleRate();
53 uint32_t AndroidGetAudioOutputFramesPerBuffer();
54 # endif
56 # ifdef ENABLE_SET_CUBEB_BACKEND
57 void ForceSetCubebContext(cubeb* aCubebContext);
58 # endif
59 } // namespace CubebUtils
60 } // namespace mozilla
62 #endif // CubebUtils_h_