mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-25 00:27:29 +09:00
parent
4e119039ec
commit
606356d1f9
4 changed files with 0 additions and 40 deletions
|
|
@ -345,7 +345,6 @@ AudioStream::Init(uint32_t aNumChannels, uint32_t aRate,
|
||||||
cubeb* cubebContext = CubebUtils::GetCubebContext();
|
cubeb* cubebContext = CubebUtils::GetCubebContext();
|
||||||
if (!cubebContext) {
|
if (!cubebContext) {
|
||||||
NS_WARNING("Can't get cubeb context!");
|
NS_WARNING("Can't get cubeb context!");
|
||||||
CubebUtils::ReportCubebStreamInitFailure(true);
|
|
||||||
return NS_ERROR_DOM_MEDIA_CUBEB_INITIALIZATION_ERR;
|
return NS_ERROR_DOM_MEDIA_CUBEB_INITIALIZATION_ERR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -367,10 +366,8 @@ AudioStream::OpenCubeb(cubeb* aContext, cubeb_stream_params& aParams,
|
||||||
latency_frames,
|
latency_frames,
|
||||||
DataCallback_S, StateCallback_S, this) == CUBEB_OK) {
|
DataCallback_S, StateCallback_S, this) == CUBEB_OK) {
|
||||||
mCubebStream.reset(stream);
|
mCubebStream.reset(stream);
|
||||||
CubebUtils::ReportCubebBackendUsed();
|
|
||||||
} else {
|
} else {
|
||||||
NS_WARNING(nsPrintfCString("AudioStream::OpenCubeb() %p failed to init cubeb", this).get());
|
NS_WARNING(nsPrintfCString("AudioStream::OpenCubeb() %p failed to init cubeb", this).get());
|
||||||
CubebUtils::ReportCubebStreamInitFailure(aIsFirst);
|
|
||||||
return NS_ERROR_FAILURE;
|
return NS_ERROR_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -239,31 +239,6 @@ cubeb* GetCubebContextUnlocked()
|
||||||
return sCubebContext;
|
return sCubebContext;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ReportCubebBackendUsed()
|
|
||||||
{
|
|
||||||
StaticMutexAutoLock lock(sMutex);
|
|
||||||
|
|
||||||
sAudioStreamInitEverSucceeded = true;
|
|
||||||
|
|
||||||
bool foundBackend = false;
|
|
||||||
for (uint32_t i = 0; i < ArrayLength(AUDIOSTREAM_BACKEND_ID_STR); i++) {
|
|
||||||
if (!strcmp(cubeb_get_backend_id(sCubebContext), AUDIOSTREAM_BACKEND_ID_STR[i])) {
|
|
||||||
foundBackend = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void ReportCubebStreamInitFailure(bool aIsFirst)
|
|
||||||
{
|
|
||||||
StaticMutexAutoLock lock(sMutex);
|
|
||||||
if (!aIsFirst && !sAudioStreamInitEverSucceeded) {
|
|
||||||
// This machine has no audio hardware, or it's in really bad shape, don't
|
|
||||||
// send this info, since we want CUBEB_BACKEND_INIT_FAILURE_OTHER to detect
|
|
||||||
// failures to open multiple streams in a process over time.
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
uint32_t GetCubebPlaybackLatencyInMilliseconds()
|
uint32_t GetCubebPlaybackLatencyInMilliseconds()
|
||||||
{
|
{
|
||||||
StaticMutexAutoLock lock(sMutex);
|
StaticMutexAutoLock lock(sMutex);
|
||||||
|
|
|
||||||
|
|
@ -35,8 +35,6 @@ double GetVolumeScale();
|
||||||
bool GetFirstStream();
|
bool GetFirstStream();
|
||||||
cubeb* GetCubebContext();
|
cubeb* GetCubebContext();
|
||||||
cubeb* GetCubebContextUnlocked();
|
cubeb* GetCubebContextUnlocked();
|
||||||
void ReportCubebStreamInitFailure(bool aIsFirstStream);
|
|
||||||
void ReportCubebBackendUsed();
|
|
||||||
uint32_t GetCubebPlaybackLatencyInMilliseconds();
|
uint32_t GetCubebPlaybackLatencyInMilliseconds();
|
||||||
Maybe<uint32_t> GetCubebMSGLatencyInFrames();
|
Maybe<uint32_t> GetCubebMSGLatencyInFrames();
|
||||||
bool CubebLatencyPrefSet();
|
bool CubebLatencyPrefSet();
|
||||||
|
|
|
||||||
|
|
@ -623,9 +623,6 @@ AudioCallbackDriver::Init()
|
||||||
cubeb* cubebContext = CubebUtils::GetCubebContext();
|
cubeb* cubebContext = CubebUtils::GetCubebContext();
|
||||||
if (!cubebContext) {
|
if (!cubebContext) {
|
||||||
NS_WARNING("Could not get cubeb context.");
|
NS_WARNING("Could not get cubeb context.");
|
||||||
if (!mFromFallback) {
|
|
||||||
CubebUtils::ReportCubebStreamInitFailure(true);
|
|
||||||
}
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -710,18 +707,11 @@ AudioCallbackDriver::Init()
|
||||||
NS_WARNING_ASSERTION(
|
NS_WARNING_ASSERTION(
|
||||||
rv == CUBEB_OK,
|
rv == CUBEB_OK,
|
||||||
"Could not set the audio stream volume in GraphDriver.cpp");
|
"Could not set the audio stream volume in GraphDriver.cpp");
|
||||||
CubebUtils::ReportCubebBackendUsed();
|
|
||||||
} else {
|
} else {
|
||||||
#ifdef MOZ_WEBRTC
|
#ifdef MOZ_WEBRTC
|
||||||
StaticMutexAutoUnlock unlock(AudioInputCubeb::Mutex());
|
StaticMutexAutoUnlock unlock(AudioInputCubeb::Mutex());
|
||||||
#endif
|
#endif
|
||||||
NS_WARNING("Could not create a cubeb stream for MediaStreamGraph, falling back to a SystemClockDriver");
|
NS_WARNING("Could not create a cubeb stream for MediaStreamGraph, falling back to a SystemClockDriver");
|
||||||
// Only report failures when we're not coming from a driver that was
|
|
||||||
// created itself as a fallback driver because of a previous audio driver
|
|
||||||
// failure.
|
|
||||||
if (!mFromFallback) {
|
|
||||||
CubebUtils::ReportCubebStreamInitFailure(firstStream);
|
|
||||||
}
|
|
||||||
// Fall back to a driver using a normal thread. If needed,
|
// Fall back to a driver using a normal thread. If needed,
|
||||||
// the graph will try to re-open an audio stream later.
|
// the graph will try to re-open an audio stream later.
|
||||||
MonitorAutoLock lock(GraphImpl()->GetMonitor());
|
MonitorAutoLock lock(GraphImpl()->GetMonitor());
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue