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

Unified Diff: webrtc/modules/audio_device/linux/audio_device_alsa_linux.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/linux/audio_device_alsa_linux.cc
diff --git a/webrtc/modules/audio_device/linux/audio_device_alsa_linux.cc b/webrtc/modules/audio_device/linux/audio_device_alsa_linux.cc
index bdbccde05012ec35cd71048008e5a0182216fa57..f7315de2afc7177dabe041a4fe59cdcf572c4f35 100644
--- a/webrtc/modules/audio_device/linux/audio_device_alsa_linux.cc
+++ b/webrtc/modules/audio_device/linux/audio_device_alsa_linux.cc
@@ -10,6 +10,7 @@
#include <assert.h>
+#include "webrtc/base/logging.h"
#include "webrtc/modules/audio_device/audio_device_config.h"
#include "webrtc/modules/audio_device/linux/audio_device_alsa_linux.h"
@@ -155,32 +156,25 @@ int32_t AudioDeviceLinuxALSA::ActiveAudioLayer(
return 0;
}
-int32_t AudioDeviceLinuxALSA::Init()
-{
-
- CriticalSectionScoped lock(&_critSect);
+AudioDeviceGeneric::InitStatus AudioDeviceLinuxALSA::Init() {
+ CriticalSectionScoped lock(&_critSect);
- // Load libasound
- if (!AlsaSymbolTable.Load())
- {
- // Alsa is not installed on
- // this system
- WEBRTC_TRACE(kTraceError, kTraceAudioDevice, _id,
- " failed to load symbol table");
- return -1;
- }
+ // Load libasound
+ if (!AlsaSymbolTable.Load()) {
+ // Alsa is not installed on this system
+ LOG(LS_ERROR) << "failed to load symbol table";
+ return InitStatus::OTHER_ERROR;
+ }
- if (_initialized)
- {
- return 0;
- }
+ if (_initialized) {
+ return InitStatus::OK;
+ }
#if defined(USE_X11)
//Get X display handle for typing detection
_XDisplay = XOpenDisplay(NULL);
- if (!_XDisplay)
- {
- WEBRTC_TRACE(kTraceWarning, kTraceAudioDevice, _id,
- " failed to open X display, typing detection will not work");
+ if (!_XDisplay) {
+ LOG(LS_WARNING)
+ << "failed to open X display, typing detection will not work";
}
#endif
_playWarning = 0;
@@ -190,7 +184,7 @@ int32_t AudioDeviceLinuxALSA::Init()
_initialized = true;
- return 0;
+ return InitStatus::OK;
}
int32_t AudioDeviceLinuxALSA::Terminate()

Powered by Google App Engine
This is Rietveld 408576698