Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(120)

Unified Diff: webrtc/modules/audio_device/win/audio_device_core_win.cc

Issue 2103863004: UMA log for audio_device Init and Start(Playout|Recording). Make Init return a more specific error … (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Rename variable. Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: webrtc/modules/audio_device/win/audio_device_core_win.cc
diff --git a/webrtc/modules/audio_device/win/audio_device_core_win.cc b/webrtc/modules/audio_device/win/audio_device_core_win.cc
index 811a04d2fef8971f6c3e888e12a4f4fe72c22ffc..0c2d89033e9cbf90c4047e24e9c019821d82f9b5 100644
--- a/webrtc/modules/audio_device/win/audio_device_core_win.cc
+++ b/webrtc/modules/audio_device/win/audio_device_core_win.cc
@@ -35,6 +35,7 @@
#include <strsafe.h>
#include <uuids.h>
+#include "webrtc/base/logging.h"
#include "webrtc/base/platform_thread.h"
#include "webrtc/system_wrappers/include/sleep.h"
#include "webrtc/system_wrappers/include/trace.h"
@@ -333,7 +334,9 @@ bool AudioDeviceWindowsCore::CoreAudioIsSupported()
int temp_ok(0);
bool available(false);
- ok |= p->Init();
+ if (p->Init() != InitStatus::OK) {
+ ok |= -1;
+ }
int16_t numDevsRec = p->RecordingDevices();
for (uint16_t i = 0; i < numDevsRec; i++)
@@ -675,31 +678,27 @@ int32_t AudioDeviceWindowsCore::ActiveAudioLayer(AudioDeviceModule::AudioLayer&
// Init
// ----------------------------------------------------------------------------
-int32_t AudioDeviceWindowsCore::Init()
-{
-
- CriticalSectionScoped lock(&_critSect);
+AudioDeviceGeneric::InitStatus AudioDeviceWindowsCore::Init() {
+ CriticalSectionScoped lock(&_critSect);
- if (_initialized)
- {
- return 0;
- }
+ if (_initialized) {
+ return InitStatus::OK;
+ }
- _playWarning = 0;
- _playError = 0;
- _recWarning = 0;
- _recError = 0;
+ _playWarning = 0;
+ _playError = 0;
+ _recWarning = 0;
+ _recError = 0;
- // Enumerate all audio rendering and capturing endpoint devices.
- // Note that, some of these will not be able to select by the user.
- // The complete collection is for internal use only.
- //
- _EnumerateEndpointDevicesAll(eRender);
- _EnumerateEndpointDevicesAll(eCapture);
+ // Enumerate all audio rendering and capturing endpoint devices.
+ // Note that, some of these will not be able to select by the user.
+ // The complete collection is for internal use only.
+ _EnumerateEndpointDevicesAll(eRender);
+ _EnumerateEndpointDevicesAll(eCapture);
- _initialized = true;
+ _initialized = true;
- return 0;
+ return InitStatus::OK;
}
// ----------------------------------------------------------------------------

Powered by Google App Engine
This is Rietveld 408576698