Rename the webrtc_adm_linux* namespaces to webrtc::adm_linux*

We shouldn't pollute the global namespace.

BUG=webrtc:7484

Review-Url: https://codereview.webrtc.org/2818563003
Cr-Commit-Position: refs/heads/master@{#17734}
This commit is contained in:
kwiberg 2017-04-18 01:26:40 -07:00 committed by Commit bot
parent a5d555dbba
commit 6daffe206d
10 changed files with 49 additions and 38 deletions

View File

@ -27,7 +27,8 @@
#include "webrtc/modules/audio_device/linux/alsasymboltable_linux.h"
namespace webrtc_adm_linux_alsa {
namespace webrtc {
namespace adm_linux_alsa {
LATE_BINDING_SYMBOL_TABLE_DEFINE_BEGIN(AlsaSymbolTable, "libasound.so.2")
#define X(sym) \
@ -36,4 +37,5 @@ ALSA_SYMBOLS_LIST
#undef X
LATE_BINDING_SYMBOL_TABLE_DEFINE_END(AlsaSymbolTable)
} // namespace webrtc_adm_linux_alsa
} // namespace adm_linux_alsa
} // namespace webrtc

View File

@ -30,7 +30,8 @@
#include "webrtc/modules/audio_device/linux/latebindingsymboltable_linux.h"
namespace webrtc_adm_linux_alsa {
namespace webrtc {
namespace adm_linux_alsa {
// The ALSA symbols we need, as an X-Macro list.
// This list must contain precisely every libasound function that is used in
@ -142,6 +143,7 @@ ALSA_SYMBOLS_LIST
#undef X
LATE_BINDING_SYMBOL_TABLE_DECLARE_END(AlsaSymbolTable)
} // namespace webrtc_adm_linux_alsa
} // namespace adm_linux_alsa
} // namespace webrtc
#endif // WEBRTC_AUDIO_DEVICE_ALSASYMBOLTABLE_LINUX_H

View File

@ -18,13 +18,13 @@
#include "webrtc/system_wrappers/include/sleep.h"
#include "webrtc/system_wrappers/include/trace.h"
webrtc_adm_linux_alsa::AlsaSymbolTable AlsaSymbolTable;
webrtc::adm_linux_alsa::AlsaSymbolTable AlsaSymbolTable;
// Accesses ALSA functions through our late-binding symbol table instead of
// directly. This way we don't have to link to libasound, which means our binary
// will work on systems that don't have it.
#define LATE(sym) \
LATESYM_GET(webrtc_adm_linux_alsa::AlsaSymbolTable, &AlsaSymbolTable, sym)
LATESYM_GET(webrtc::adm_linux_alsa::AlsaSymbolTable, &AlsaSymbolTable, sym)
// Redefine these here to be able to do late-binding
#undef snd_ctl_card_info_alloca

View File

@ -17,13 +17,14 @@
#include "webrtc/system_wrappers/include/event_wrapper.h"
#include "webrtc/system_wrappers/include/trace.h"
webrtc_adm_linux_pulse::PulseAudioSymbolTable PaSymbolTable;
webrtc::adm_linux_pulse::PulseAudioSymbolTable PaSymbolTable;
// Accesses Pulse functions through our late-binding symbol table instead of
// directly. This way we don't have to link to libpulse, which means our binary
// will work on systems that don't have it.
#define LATE(sym) \
LATESYM_GET(webrtc_adm_linux_pulse::PulseAudioSymbolTable, &PaSymbolTable, sym)
#define LATE(sym) \
LATESYM_GET(webrtc::adm_linux_pulse::PulseAudioSymbolTable, &PaSymbolTable, \
sym)
namespace webrtc
{

View File

@ -13,13 +13,13 @@
#include "webrtc/modules/audio_device/linux/audio_mixer_manager_alsa_linux.h"
#include "webrtc/system_wrappers/include/trace.h"
extern webrtc_adm_linux_alsa::AlsaSymbolTable AlsaSymbolTable;
extern webrtc::adm_linux_alsa::AlsaSymbolTable AlsaSymbolTable;
// Accesses ALSA functions through our late-binding symbol table instead of
// directly. This way we don't have to link to libalsa, which means our binary
// will work on systems that don't have it.
#define LATE(sym) \
LATESYM_GET(webrtc_adm_linux_alsa::AlsaSymbolTable, &AlsaSymbolTable, sym)
LATESYM_GET(webrtc::adm_linux_alsa::AlsaSymbolTable, &AlsaSymbolTable, sym)
namespace webrtc
{

View File

@ -14,14 +14,14 @@
#include "webrtc/system_wrappers/include/trace.h"
#include "webrtc/base/checks.h"
extern webrtc_adm_linux_pulse::PulseAudioSymbolTable PaSymbolTable;
extern webrtc::adm_linux_pulse::PulseAudioSymbolTable PaSymbolTable;
// Accesses Pulse functions through our late-binding symbol table instead of
// directly. This way we don't have to link to libpulse, which means our
// binary will work on systems that don't have it.
#define LATE(sym) \
LATESYM_GET(webrtc_adm_linux_pulse::PulseAudioSymbolTable, \
&PaSymbolTable, sym)
#define LATE(sym) \
LATESYM_GET(webrtc::adm_linux_pulse::PulseAudioSymbolTable, &PaSymbolTable, \
sym)
namespace webrtc
{

View File

@ -16,10 +16,8 @@
#include <dlfcn.h>
#endif
// TODO(grunell): Either put inside webrtc namespace or use webrtc:: instead.
using namespace webrtc;
namespace webrtc_adm_linux {
namespace webrtc {
namespace adm_linux {
inline static const char *GetDllError() {
#ifdef WEBRTC_LINUX
@ -107,4 +105,5 @@ bool InternalLoadSymbols(DllHandle handle,
return true;
}
} // namespace webrtc_adm_linux
} // namespace adm_linux
} // namespace webrtc

View File

@ -22,7 +22,8 @@
// supports Linux and pure C symbols.
// See talk/sound/pulseaudiosymboltable.(h|cc) for an example.
namespace webrtc_adm_linux {
namespace webrtc {
namespace adm_linux {
#ifdef WEBRTC_LINUX
typedef void *DllHandle;
@ -132,18 +133,19 @@ enum {
ClassName##_SYMBOL_TABLE_INDEX_##sym,
// This macro completes the header declaration.
#define LATE_BINDING_SYMBOL_TABLE_DECLARE_END(ClassName) \
ClassName##_SYMBOL_TABLE_SIZE \
}; \
\
extern const char ClassName##_kDllName[]; \
extern const char *const \
ClassName##_kSymbolNames[ClassName##_SYMBOL_TABLE_SIZE]; \
\
typedef ::webrtc_adm_linux::LateBindingSymbolTable<ClassName##_SYMBOL_TABLE_SIZE, \
ClassName##_kDllName, \
ClassName##_kSymbolNames> \
ClassName;
#define LATE_BINDING_SYMBOL_TABLE_DECLARE_END(ClassName) \
ClassName##_SYMBOL_TABLE_SIZE \
} \
; \
\
extern const char ClassName##_kDllName[]; \
extern const char* const \
ClassName##_kSymbolNames[ClassName##_SYMBOL_TABLE_SIZE]; \
\
typedef ::webrtc::adm_linux::LateBindingSymbolTable< \
ClassName##_SYMBOL_TABLE_SIZE, ClassName##_kDllName, \
ClassName##_kSymbolNames> \
ClassName;
// This macro must be invoked in a .cc file to define a previously-declared
// symbol table class.
@ -170,6 +172,7 @@ const char *const ClassName##_kSymbolNames[ClassName##_SYMBOL_TABLE_SIZE] = {
(*reinterpret_cast<typeof(&sym)>( \
(inst)->GetSymbol(LATESYM_INDEXOF(ClassName, sym))))
} // namespace webrtc_adm_linux
} // namespace adm_linux
} // namespace webrtc
#endif // WEBRTC_ADM_LATEBINDINGSYMBOLTABLE_LINUX_H

View File

@ -27,7 +27,8 @@
#include "webrtc/modules/audio_device/linux/pulseaudiosymboltable_linux.h"
namespace webrtc_adm_linux_pulse {
namespace webrtc {
namespace adm_linux_pulse {
LATE_BINDING_SYMBOL_TABLE_DEFINE_BEGIN(PulseAudioSymbolTable, "libpulse.so.0")
#define X(sym) \
@ -36,4 +37,5 @@ PULSE_AUDIO_SYMBOLS_LIST
#undef X
LATE_BINDING_SYMBOL_TABLE_DEFINE_END(PulseAudioSymbolTable)
} // namespace webrtc_adm_linux_pulse
} // namespace adm_linux_pulse
} // namespace webrtc

View File

@ -30,7 +30,8 @@
#include "webrtc/modules/audio_device/linux/latebindingsymboltable_linux.h"
namespace webrtc_adm_linux_pulse {
namespace webrtc {
namespace adm_linux_pulse {
// The PulseAudio symbols we need, as an X-Macro list.
// This list must contain precisely every libpulse function that is used in
@ -99,6 +100,7 @@ PULSE_AUDIO_SYMBOLS_LIST
#undef X
LATE_BINDING_SYMBOL_TABLE_DECLARE_END(PulseAudioSymbolTable)
} // namespace webrtc_adm_linux_pulse
} // namespace adm_linux_pulse
} // namespace webrtc
#endif // WEBRTC_AUDIO_DEVICE_PULSEAUDIOSYMBOLTABLE_LINUX_H