pulse_stubs.c revision 820e4bc68518ef74f801cc055cb6d1522b3eddf4
/* $Id$ */
/** @file
* Stubs for libpulse.
*/
/*
* Copyright (C) 2006-2010 Oracle Corporation
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
* General Public License (GPL) as published by the Free Software
* Foundation, in version 2 as it comes in the "COPYING" file of the
* VirtualBox OSE distribution. VirtualBox OSE is distributed in the
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
#define LOG_GROUP LOG_GROUP_DEV_AUDIO
#include <pulse/pulseaudio.h>
#include "pulse_stubs.h"
#define VBOX_PULSE_LIB "libpulse.so.0"
\
{ \
}
\
{ \
}
#if PA_PROTOCOL_VERSION >= 16
#else
#endif
PROXY_STUB (pa_stream_disconnect, int,
(pa_stream *s),
(s))
(pa_stream *s),
(s))
PROXY_STUB (pa_stream_write, int,
(pa_stream *s),
(s))
(pa_stream *p),
(p))
const pa_channel_map *map),
(pa_stream *s),
(s))
PROXY_STUB (pa_stream_peek, int,
PROXY_STUB (pa_stream_drop, int,
(pa_stream *p),
(p))
(pa_stream *p),
(p))
PROXY_STUB (pa_context_connect, int,
const pa_spawn_api *api),
(pa_context *c),
(c))
(pa_context *c),
(c))
(pa_context *c),
(c))
PROXY_STUB (pa_context_errno, int,
(pa_context *c),
(c))
(pa_threaded_mainloop *m),
(m))
(pa_threaded_mainloop *m),
(m))
(pa_threaded_mainloop* m),
(m))
(pa_threaded_mainloop *m, int wait_for_accept),
(m, wait_for_accept))
(pa_threaded_mainloop *m),
(m))
(void),
())
(pa_threaded_mainloop *m),
(m))
(pa_threaded_mainloop *m),
(m))
(pa_threaded_mainloop *m),
(m))
(const pa_sample_spec *spec),
(spec))
(const pa_sample_spec *spec),
(spec))
PROXY_STUB (pa_sample_format_to_string, const char*,
(pa_sample_format_t f),
(f))
PROXY_STUB (pa_sample_spec_valid, int,
(const pa_sample_spec *spec),
(spec))
(pa_operation *o),
(o))
(pa_operation *o),
(o))
(pa_operation *o),
(o))
PROXY_STUB (pa_strerror, const char*,
(int error),
(error))
(pa_stream *p),
(p))
typedef struct
{
const char *name;
void (**fn)(void);
} SHARED_FUNC;
static SHARED_FUNC SharedFuncs[] =
{
};
/**
* Try to dynamically load the PulseAudio libraries. This function is not
* thread-safe, and should be called before attempting to use any of the
* PulseAudio functions.
*
* @returns iprt status code
*/
int audioLoadPulseLib(void)
{
int rc = VINF_SUCCESS;
unsigned i;
LogFlowFunc(("\n"));
/* If this is not NO then the function has obviously been called twice,
which is likely to be a bug. */
if (NO != isLibLoaded)
{
}
isLibLoaded = FAIL;
if (RT_FAILURE(rc))
{
return rc;
}
for (i=0; i<RT_ELEMENTS(SharedFuncs); i++)
{
if (RT_FAILURE(rc))
return rc;
}
isLibLoaded = YES;
return rc;
}