Bug 807492 Part 5 - Use the linux codepaths on BSD in audio_device r=jesup

Also open libpulse.so on OpenBSD, different versionning scheme.
This commit is contained in:
Landry Breuil 2013-06-13 08:41:59 +02:00
parent 2eadaff337
commit d876c8927b
4 changed files with 13 additions and 9 deletions

View File

@ -46,7 +46,7 @@ bool AudioDeviceUtility::StringCompare(
} // namespace webrtc
#elif defined(WEBRTC_LINUX) || defined(WEBRTC_MAC)
#elif defined(WEBRTC_LINUX) || defined(WEBRTC_BSD) || defined(WEBRTC_MAC)
// ============================================================================
// Linux & Mac
@ -109,6 +109,6 @@ bool AudioDeviceUtility::StringCompare(
} // namespace webrtc
#endif // defined(WEBRTC_LINUX) || defined(WEBRTC_MAC)
#endif // defined(WEBRTC_LINUX) || defined(WEBRTC_BSD) || defined(WEBRTC_MAC)

View File

@ -27,7 +27,7 @@
#include "latebindingsymboltable_linux.h"
#ifdef WEBRTC_LINUX
#if defined(WEBRTC_LINUX) || defined(WEBRTC_BSD)
#include <dlfcn.h>
#endif
@ -37,7 +37,7 @@ using namespace webrtc;
namespace webrtc_adm_linux {
inline static const char *GetDllError() {
#ifdef WEBRTC_LINUX
#if defined(WEBRTC_LINUX) || defined(WEBRTC_BSD)
char *err = dlerror();
if (err) {
return err;
@ -50,7 +50,7 @@ inline static const char *GetDllError() {
}
DllHandle InternalLoadDll(const char dll_name[]) {
#ifdef WEBRTC_LINUX
#if defined(WEBRTC_LINUX) || defined(WEBRTC_BSD)
DllHandle handle = dlopen(dll_name, RTLD_NOW);
#else
#error Not implemented
@ -63,7 +63,7 @@ DllHandle InternalLoadDll(const char dll_name[]) {
}
void InternalUnloadDll(DllHandle handle) {
#ifdef WEBRTC_LINUX
#if defined(WEBRTC_LINUX) || defined(WEBRTC_BSD)
if (dlclose(handle) != 0) {
WEBRTC_TRACE(kTraceError, kTraceAudioDevice, -1,
"%d", GetDllError());
@ -76,7 +76,7 @@ void InternalUnloadDll(DllHandle handle) {
static bool LoadSymbol(DllHandle handle,
const char *symbol_name,
void **symbol) {
#ifdef WEBRTC_LINUX
#if defined(WEBRTC_LINUX) || defined(WEBRTC_BSD)
*symbol = dlsym(handle, symbol_name);
char *err = dlerror();
if (err) {
@ -101,7 +101,7 @@ bool InternalLoadSymbols(DllHandle handle,
int num_symbols,
const char *const symbol_names[],
void *symbols[]) {
#ifdef WEBRTC_LINUX
#if defined(WEBRTC_LINUX) || defined(WEBRTC_BSD)
// Clear any old errors.
dlerror();
#endif

View File

@ -42,7 +42,7 @@
namespace webrtc_adm_linux {
#ifdef WEBRTC_LINUX
#if defined(WEBRTC_LINUX) || defined(WEBRTC_BSD)
typedef void *DllHandle;
const DllHandle kInvalidDllHandle = NULL;

View File

@ -29,7 +29,11 @@
namespace webrtc_adm_linux_pulse {
#ifdef __OpenBSD__
LATE_BINDING_SYMBOL_TABLE_DEFINE_BEGIN(PulseAudioSymbolTable, "libpulse.so")
#else
LATE_BINDING_SYMBOL_TABLE_DEFINE_BEGIN(PulseAudioSymbolTable, "libpulse.so.0")
#endif
#define X(sym) \
LATE_BINDING_SYMBOL_TABLE_DEFINE_ENTRY(PulseAudioSymbolTable, sym)
PULSE_AUDIO_SYMBOLS_LIST