Bug 1288980 - Add libcubeb backend to about:support. r=felipc

This commit is contained in:
Matthew Gregan
2016-07-26 10:50:14 +12:00
parent 2170052c1d
commit f47ad8a984
8 changed files with 31 additions and 0 deletions

View File

@@ -30,6 +30,7 @@
#ifdef MOZ_FMP4
#include "MP4Decoder.h"
#endif
#include "CubebUtils.h"
#include "nsIScrollableFrame.h"
@@ -2326,6 +2327,13 @@ nsDOMWindowUtils::GetSupportsHardwareH264Decoding(JS::MutableHandle<JS::Value> a
return NS_OK;
}
NS_IMETHODIMP
nsDOMWindowUtils::GetCurrentAudioBackend(nsAString& aBackend)
{
CubebUtils::GetCurrentBackend(aBackend);
return NS_OK;
}
NS_IMETHODIMP
nsDOMWindowUtils::StartFrameTimeRecording(uint32_t *startIndex)
{

View File

@@ -1400,6 +1400,11 @@ interface nsIDOMWindowUtils : nsISupports {
*/
readonly attribute jsval supportsHardwareH264Decoding;
/**
* Returns the current audio backend as a free-form string.
*/
readonly attribute AString currentAudioBackend;
/**
* Record (and return) frame-intervals for frames which were presented
* between calling StartFrameTimeRecording and StopFrameTimeRecording.

View File

@@ -296,5 +296,15 @@ cubeb_stream_type ConvertChannelToCubebType(dom::AudioChannel aChannel)
}
#endif
void GetCurrentBackend(nsAString& aBackend)
{
const char* backend = cubeb_get_backend_id(GetCubebContext());
if (!backend) {
aBackend.AssignLiteral("unknown");
return;
}
aBackend.AssignASCII(backend);
}
} // namespace CubebUtils
} // namespace mozilla

View File

@@ -46,6 +46,7 @@ bool CubebLatencyPrefSet();
#if defined(__ANDROID__) && defined(MOZ_B2G)
cubeb_stream_type ConvertChannelToCubebType(dom::AudioChannel aChannel);
#endif
void GetCurrentBackend(nsAString& aBackend);
} // namespace CubebUtils
} // namespace mozilla

View File

@@ -368,6 +368,7 @@ var snapshotFormatters = {
addRowFromKey("features", "webglRenderer");
addRowFromKey("features", "webgl2Renderer");
addRowFromKey("features", "supportsHardwareH264", "hardwareH264");
addRowFromKey("features", "currentAudioBackend", "audioBackend");
addRowFromKey("features", "direct2DEnabled", "#Direct2D");
if ("directWriteEnabled" in data) {

View File

@@ -57,6 +57,7 @@ clearTypeParameters = ClearType Parameters
compositing = Compositing
hardwareH264 = Hardware H264 Decoding
audioBackend = Audio Backend
mainThreadNoOMTC = main thread, no OMTC
yes = Yes
no = No

View File

@@ -367,6 +367,8 @@ var dataProviders = {
});
promises.push(promise);
data.currentAudioBackend = winUtils.currentAudioBackend;
if (!data.numAcceleratedWindows && gfxInfo) {
let win = AppConstants.platform == "win";
let feature = win ? gfxInfo.FEATURE_DIRECT3D_9_LAYERS :

View File

@@ -228,6 +228,9 @@ const SNAPSHOT_SCHEMA = {
supportsHardwareH264: {
type: "string",
},
currentAudioBackend: {
type: "string",
},
numAcceleratedWindowsMessage: {
type: "array",
},