Commit c9f95c80 authored by Thomas Guillem's avatar Thomas Guillem

WIP: hack to have pulse audio

parent e60fdfd9
......@@ -117,7 +117,7 @@ VLC_CONFIGURE_ARGS="\
--enable-zvbi \
--disable-fluidsynth \
--disable-jack \
--disable-pulse \
--enable-pulse \
--disable-alsa \
--disable-samplerate \
--disable-sdl \
......@@ -286,12 +286,35 @@ cd ../../
###################
VLC_BUILD_DIR=build-tizen-${TARGET_TUPLE}
mkdir -p $VLC_BUILD_DIR && cd $VLC_BUILD_DIR
mkdir -p ${PROJECTPATH}/vlc/${VLC_BUILD_DIR}
#####################
# FAKE VLC DEPS #
#####################
VLC_HACK_PREFIX=${PROJECTPATH}/vlc/${VLC_BUILD_DIR}/prefix
VLC_HACK_INCLUDES="${PROJECTPATH}/hacks/vlc/include"
VLC_HACK_LIB="${VLC_HACK_PREFIX}/lib"
mkdir -p ${VLC_HACK_LIB}
echo ${VLC_HACK_PREFIX}
cd ${PROJECTPATH}/hacks/vlc
for symbols in *.symbols; do
so_file="`basename $symbols .symbols`"
c_file="`basename $so_file .so`.c"
rm -f ${VLC_HACK_PREFIX}/$c_file ${VLC_HACK_LIB}/$so_file
for s in `cat $symbols`; do echo "void $s() {}" >> ${VLC_HACK_PREFIX}/$c_file; done
${CC} ${VLC_HACK_PREFIX}/$c_file -shared -o ${VLC_HACK_LIB}/$so_file -fPIC
done
#############
# CONFIGURE #
#############
cd ${PROJECTPATH}/vlc/${VLC_BUILD_DIR}
if [ ! -e ./config.h -o "$RELEASE" = 1 ]; then
CPPFLAGS="$CPPFLAGS" \
CFLAGS="$CFLAGS ${EXTRA_CFLAGS}" \
......@@ -303,6 +326,8 @@ NM="${CROSS_COMPILE}nm" \
STRIP="${CROSS_COMPILE}strip" \
RANLIB="${CROSS_COMPILE}ranlib" \
AR="${CROSS_COMPILE}ar" \
PULSE_CFLAGS="-I${VLC_HACK_INCLUDES}" \
PULSE_LIBS="-L${VLC_HACK_LIB} -lpulse" \
PKG_CONFIG_LIBDIR=../contrib/$TARGET_TUPLE/lib/pkgconfig \
sh ../configure --host=$TARGET_TUPLE --build=x86_64-unknown-linux \
${EXTRA_PARAMS} ${VLC_CONFIGURE_ARGS} ${OPTS}
......
#!/bin/sh
for i in *.so; do
nm -D --defined-only $i | awk '{print $3}' \
| grep -vE "^(__aeabi|__bss_start|__bss_end__|_bss_end__|_edata|__end__|_init|_fini|_end)" > $i.symbols
done
#ifndef foopulsecdeclhfoo
#define foopulsecdeclhfoo
/***
This file is part of PulseAudio.
Copyright 2004-2006 Lennart Poettering
PulseAudio is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published
by the Free Software Foundation; either version 2.1 of the License,
or (at your option) any later version.
PulseAudio is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with PulseAudio; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
USA.
***/
/** \file
* C++ compatibility support */
#ifdef __cplusplus
/** If using C++ this macro enables C mode, otherwise does nothing */
#define PA_C_DECL_BEGIN extern "C" {
/** If using C++ this macros switches back to C++ mode, otherwise does nothing */
#define PA_C_DECL_END }
#else
/** If using C++ this macro enables C mode, otherwise does nothing */
#define PA_C_DECL_BEGIN
/** If using C++ this macros switches back to C++ mode, otherwise does nothing */
#define PA_C_DECL_END
#endif
#endif
#ifndef foochannelmaphfoo
#define foochannelmaphfoo
/***
This file is part of PulseAudio.
Copyright 2005-2006 Lennart Poettering
Copyright 2006 Pierre Ossman <ossman@cendio.se> for Cendio AB
PulseAudio is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published
by the Free Software Foundation; either version 2.1 of the License,
or (at your option) any later version.
PulseAudio is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with PulseAudio; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
USA.
***/
#include <pulse/sample.h>
#include <pulse/cdecl.h>
#include <pulse/gccmacro.h>
#include <pulse/version.h>
/** \page channelmap Channel Maps
*
* \section overv_sec Overview
*
* Channel maps provide a way to associate channels in a stream with a
* specific speaker position. This relieves applications of having to
* make sure their channel order is identical to the final output.
*
* \section init_sec Initialisation
*
* A channel map consists of an array of \ref pa_channel_position values,
* one for each channel. This array is stored together with a channel count
* in a pa_channel_map structure.
*
* Before filling the structure, the application must initialise it using
* pa_channel_map_init(). There are also a number of convenience functions
* for standard channel mappings:
*
* \li pa_channel_map_init_mono() - Create a channel map with only mono audio.
* \li pa_channel_map_init_stereo() - Create a standard stereo mapping.
* \li pa_channel_map_init_auto() - Create a standard channel map for a specific number of channels
* \li pa_channel_map_init_extend() - Similar to
* pa_channel_map_init_auto() but synthesize a channel map if no
* predefined one is known for the specified number of channels.
*
* \section conv_sec Convenience Functions
*
* The library contains a number of convenience functions for dealing with
* channel maps:
*
* \li pa_channel_map_valid() - Tests if a channel map is valid.
* \li pa_channel_map_equal() - Tests if two channel maps are identical.
* \li pa_channel_map_snprint() - Creates a textual description of a channel
* map.
*/
/** \file
* Constants and routines for channel mapping handling
*
* See also \subpage channelmap
*/
PA_C_DECL_BEGIN
/** A list of channel labels */
typedef enum pa_channel_position {
PA_CHANNEL_POSITION_INVALID = -1,
PA_CHANNEL_POSITION_MONO = 0,
PA_CHANNEL_POSITION_FRONT_LEFT, /**< Apple, Dolby call this 'Left' */
PA_CHANNEL_POSITION_FRONT_RIGHT, /**< Apple, Dolby call this 'Right' */
PA_CHANNEL_POSITION_FRONT_CENTER, /**< Apple, Dolby call this 'Center' */
/** \cond fulldocs */
PA_CHANNEL_POSITION_LEFT = PA_CHANNEL_POSITION_FRONT_LEFT,
PA_CHANNEL_POSITION_RIGHT = PA_CHANNEL_POSITION_FRONT_RIGHT,
PA_CHANNEL_POSITION_CENTER = PA_CHANNEL_POSITION_FRONT_CENTER,
/** \endcond */
PA_CHANNEL_POSITION_REAR_CENTER, /**< Microsoft calls this 'Back Center', Apple calls this 'Center Surround', Dolby calls this 'Surround Rear Center' */
PA_CHANNEL_POSITION_REAR_LEFT, /**< Microsoft calls this 'Back Left', Apple calls this 'Left Surround' (!), Dolby calls this 'Surround Rear Left' */
PA_CHANNEL_POSITION_REAR_RIGHT, /**< Microsoft calls this 'Back Right', Apple calls this 'Right Surround' (!), Dolby calls this 'Surround Rear Right' */
PA_CHANNEL_POSITION_LFE, /**< Microsoft calls this 'Low Frequency', Apple calls this 'LFEScreen' */
/** \cond fulldocs */
PA_CHANNEL_POSITION_SUBWOOFER = PA_CHANNEL_POSITION_LFE,
/** \endcond */
PA_CHANNEL_POSITION_FRONT_LEFT_OF_CENTER, /**< Apple, Dolby call this 'Left Center' */
PA_CHANNEL_POSITION_FRONT_RIGHT_OF_CENTER, /**< Apple, Dolby call this 'Right Center */
PA_CHANNEL_POSITION_SIDE_LEFT, /**< Apple calls this 'Left Surround Direct', Dolby calls this 'Surround Left' (!) */
PA_CHANNEL_POSITION_SIDE_RIGHT, /**< Apple calls this 'Right Surround Direct', Dolby calls this 'Surround Right' (!) */
PA_CHANNEL_POSITION_AUX0,
PA_CHANNEL_POSITION_AUX1,
PA_CHANNEL_POSITION_AUX2,
PA_CHANNEL_POSITION_AUX3,
PA_CHANNEL_POSITION_AUX4,
PA_CHANNEL_POSITION_AUX5,
PA_CHANNEL_POSITION_AUX6,
PA_CHANNEL_POSITION_AUX7,
PA_CHANNEL_POSITION_AUX8,
PA_CHANNEL_POSITION_AUX9,
PA_CHANNEL_POSITION_AUX10,
PA_CHANNEL_POSITION_AUX11,
PA_CHANNEL_POSITION_AUX12,
PA_CHANNEL_POSITION_AUX13,
PA_CHANNEL_POSITION_AUX14,
PA_CHANNEL_POSITION_AUX15,
PA_CHANNEL_POSITION_AUX16,
PA_CHANNEL_POSITION_AUX17,
PA_CHANNEL_POSITION_AUX18,
PA_CHANNEL_POSITION_AUX19,
PA_CHANNEL_POSITION_AUX20,
PA_CHANNEL_POSITION_AUX21,
PA_CHANNEL_POSITION_AUX22,
PA_CHANNEL_POSITION_AUX23,
PA_CHANNEL_POSITION_AUX24,
PA_CHANNEL_POSITION_AUX25,
PA_CHANNEL_POSITION_AUX26,
PA_CHANNEL_POSITION_AUX27,
PA_CHANNEL_POSITION_AUX28,
PA_CHANNEL_POSITION_AUX29,
PA_CHANNEL_POSITION_AUX30,
PA_CHANNEL_POSITION_AUX31,
PA_CHANNEL_POSITION_TOP_CENTER, /**< Apple calls this 'Top Center Surround' */
PA_CHANNEL_POSITION_TOP_FRONT_LEFT, /**< Apple calls this 'Vertical Height Left' */
PA_CHANNEL_POSITION_TOP_FRONT_RIGHT, /**< Apple calls this 'Vertical Height Right' */
PA_CHANNEL_POSITION_TOP_FRONT_CENTER, /**< Apple calls this 'Vertical Height Center' */
PA_CHANNEL_POSITION_TOP_REAR_LEFT, /**< Microsoft and Apple call this 'Top Back Left' */
PA_CHANNEL_POSITION_TOP_REAR_RIGHT, /**< Microsoft and Apple call this 'Top Back Right' */
PA_CHANNEL_POSITION_TOP_REAR_CENTER, /**< Microsoft and Apple call this 'Top Back Center' */
PA_CHANNEL_POSITION_MAX
} pa_channel_position_t;
/** \cond fulldocs */
#define PA_CHANNEL_POSITION_INVALID PA_CHANNEL_POSITION_INVALID
#define PA_CHANNEL_POSITION_MONO PA_CHANNEL_POSITION_MONO
#define PA_CHANNEL_POSITION_LEFT PA_CHANNEL_POSITION_LEFT
#define PA_CHANNEL_POSITION_RIGHT PA_CHANNEL_POSITION_RIGHT
#define PA_CHANNEL_POSITION_CENTER PA_CHANNEL_POSITION_CENTER
#define PA_CHANNEL_POSITION_FRONT_LEFT PA_CHANNEL_POSITION_FRONT_LEFT
#define PA_CHANNEL_POSITION_FRONT_RIGHT PA_CHANNEL_POSITION_FRONT_RIGHT
#define PA_CHANNEL_POSITION_FRONT_CENTER PA_CHANNEL_POSITION_FRONT_CENTER
#define PA_CHANNEL_POSITION_REAR_CENTER PA_CHANNEL_POSITION_REAR_CENTER
#define PA_CHANNEL_POSITION_REAR_LEFT PA_CHANNEL_POSITION_REAR_LEFT
#define PA_CHANNEL_POSITION_REAR_RIGHT PA_CHANNEL_POSITION_REAR_RIGHT
#define PA_CHANNEL_POSITION_LFE PA_CHANNEL_POSITION_LFE
#define PA_CHANNEL_POSITION_SUBWOOFER PA_CHANNEL_POSITION_SUBWOOFER
#define PA_CHANNEL_POSITION_FRONT_LEFT_OF_CENTER PA_CHANNEL_POSITION_FRONT_LEFT_OF_CENTER
#define PA_CHANNEL_POSITION_FRONT_RIGHT_OF_CENTER PA_CHANNEL_POSITION_FRONT_RIGHT_OF_CENTER
#define PA_CHANNEL_POSITION_SIDE_LEFT PA_CHANNEL_POSITION_SIDE_LEFT
#define PA_CHANNEL_POSITION_SIDE_RIGHT PA_CHANNEL_POSITION_SIDE_RIGHT
#define PA_CHANNEL_POSITION_AUX0 PA_CHANNEL_POSITION_AUX0
#define PA_CHANNEL_POSITION_AUX1 PA_CHANNEL_POSITION_AUX1
#define PA_CHANNEL_POSITION_AUX2 PA_CHANNEL_POSITION_AUX2
#define PA_CHANNEL_POSITION_AUX3 PA_CHANNEL_POSITION_AUX3
#define PA_CHANNEL_POSITION_AUX4 PA_CHANNEL_POSITION_AUX4
#define PA_CHANNEL_POSITION_AUX5 PA_CHANNEL_POSITION_AUX5
#define PA_CHANNEL_POSITION_AUX6 PA_CHANNEL_POSITION_AUX6
#define PA_CHANNEL_POSITION_AUX7 PA_CHANNEL_POSITION_AUX7
#define PA_CHANNEL_POSITION_AUX8 PA_CHANNEL_POSITION_AUX8
#define PA_CHANNEL_POSITION_AUX9 PA_CHANNEL_POSITION_AUX9
#define PA_CHANNEL_POSITION_AUX10 PA_CHANNEL_POSITION_AUX10
#define PA_CHANNEL_POSITION_AUX11 PA_CHANNEL_POSITION_AUX11
#define PA_CHANNEL_POSITION_AUX12 PA_CHANNEL_POSITION_AUX12
#define PA_CHANNEL_POSITION_AUX13 PA_CHANNEL_POSITION_AUX13
#define PA_CHANNEL_POSITION_AUX14 PA_CHANNEL_POSITION_AUX14
#define PA_CHANNEL_POSITION_AUX15 PA_CHANNEL_POSITION_AUX15
#define PA_CHANNEL_POSITION_AUX16 PA_CHANNEL_POSITION_AUX16
#define PA_CHANNEL_POSITION_AUX17 PA_CHANNEL_POSITION_AUX17
#define PA_CHANNEL_POSITION_AUX18 PA_CHANNEL_POSITION_AUX18
#define PA_CHANNEL_POSITION_AUX19 PA_CHANNEL_POSITION_AUX19
#define PA_CHANNEL_POSITION_AUX20 PA_CHANNEL_POSITION_AUX20
#define PA_CHANNEL_POSITION_AUX21 PA_CHANNEL_POSITION_AUX21
#define PA_CHANNEL_POSITION_AUX22 PA_CHANNEL_POSITION_AUX22
#define PA_CHANNEL_POSITION_AUX23 PA_CHANNEL_POSITION_AUX23
#define PA_CHANNEL_POSITION_AUX24 PA_CHANNEL_POSITION_AUX24
#define PA_CHANNEL_POSITION_AUX25 PA_CHANNEL_POSITION_AUX25
#define PA_CHANNEL_POSITION_AUX26 PA_CHANNEL_POSITION_AUX26
#define PA_CHANNEL_POSITION_AUX27 PA_CHANNEL_POSITION_AUX27
#define PA_CHANNEL_POSITION_AUX28 PA_CHANNEL_POSITION_AUX28
#define PA_CHANNEL_POSITION_AUX29 PA_CHANNEL_POSITION_AUX29
#define PA_CHANNEL_POSITION_AUX30 PA_CHANNEL_POSITION_AUX30
#define PA_CHANNEL_POSITION_AUX31 PA_CHANNEL_POSITION_AUX31
#define PA_CHANNEL_POSITION_TOP_CENTER PA_CHANNEL_POSITION_TOP_CENTER
#define PA_CHANNEL_POSITION_TOP_FRONT_LEFT PA_CHANNEL_POSITION_TOP_FRONT_LEFT
#define PA_CHANNEL_POSITION_TOP_FRONT_RIGHT PA_CHANNEL_POSITION_TOP_FRONT_RIGHT
#define PA_CHANNEL_POSITION_TOP_FRONT_CENTER PA_CHANNEL_POSITION_TOP_FRONT_CENTER
#define PA_CHANNEL_POSITION_TOP_REAR_LEFT PA_CHANNEL_POSITION_TOP_REAR_LEFT
#define PA_CHANNEL_POSITION_TOP_REAR_RIGHT PA_CHANNEL_POSITION_TOP_REAR_RIGHT
#define PA_CHANNEL_POSITION_TOP_REAR_CENTER PA_CHANNEL_POSITION_TOP_REAR_CENTER
#define PA_CHANNEL_POSITION_MAX PA_CHANNEL_POSITION_MAX
/** \endcond */
/** A mask of channel positions. \since 0.9.16 */
typedef uint64_t pa_channel_position_mask_t;
/** Makes a bit mask from a channel position. \since 0.9.16 */
#define PA_CHANNEL_POSITION_MASK(f) ((pa_channel_position_mask_t) (1ULL << (f)))
/** A list of channel mapping definitions for pa_channel_map_init_auto() */
typedef enum pa_channel_map_def {
PA_CHANNEL_MAP_AIFF,
/**< The mapping from RFC3551, which is based on AIFF-C */
/** \cond fulldocs */
PA_CHANNEL_MAP_ALSA,
/**< The default mapping used by ALSA. This mapping is probably
* not too useful since ALSA's default channel mapping depends on
* the device string used. */
/** \endcond */
PA_CHANNEL_MAP_AUX,
/**< Only aux channels */
PA_CHANNEL_MAP_WAVEEX,
/**< Microsoft's WAVEFORMATEXTENSIBLE mapping. This mapping works
* as if all LSBs of dwChannelMask are set. */
/** \cond fulldocs */
PA_CHANNEL_MAP_OSS,
/**< The default channel mapping used by OSS as defined in the OSS
* 4.0 API specs. This mapping is probably not too useful since
* the OSS API has changed in this respect and no longer knows a
* default channel mapping based on the number of channels. */
/** \endcond */
/**< Upper limit of valid channel mapping definitions */
PA_CHANNEL_MAP_DEF_MAX,
PA_CHANNEL_MAP_DEFAULT = PA_CHANNEL_MAP_AIFF
/**< The default channel map */
} pa_channel_map_def_t;
/** \cond fulldocs */
#define PA_CHANNEL_MAP_AIFF PA_CHANNEL_MAP_AIFF
#define PA_CHANNEL_MAP_ALSA PA_CHANNEL_MAP_ALSA
#define PA_CHANNEL_MAP_AUX PA_CHANNEL_MAP_AUX
#define PA_CHANNEL_MAP_WAVEEX PA_CHANNEL_MAP_WAVEEX
#define PA_CHANNEL_MAP_OSS PA_CHANNEL_MAP_OSS
#define PA_CHANNEL_MAP_DEF_MAX PA_CHANNEL_MAP_DEF_MAX
#define PA_CHANNEL_MAP_DEFAULT PA_CHANNEL_MAP_DEFAULT
/** \endcond */
/** A channel map which can be used to attach labels to specific
* channels of a stream. These values are relevant for conversion and
* mixing of streams */
typedef struct pa_channel_map {
uint8_t channels;
/**< Number of channels */
pa_channel_position_t map[PA_CHANNELS_MAX];
/**< Channel labels */
} pa_channel_map;
/** Initialize the specified channel map and return a pointer to
* it. The channel map will have a defined state but
* pa_channel_map_valid() will fail for it. */
pa_channel_map* pa_channel_map_init(pa_channel_map *m);
/** Initialize the specified channel map for monaural audio and return a pointer to it */
pa_channel_map* pa_channel_map_init_mono(pa_channel_map *m);
/** Initialize the specified channel map for stereophonic audio and return a pointer to it */
pa_channel_map* pa_channel_map_init_stereo(pa_channel_map *m);
/** Initialize the specified channel map for the specified number of
* channels using default labels and return a pointer to it. This call
* will fail (return NULL) if there is no default channel map known for this
* specific number of channels and mapping. */
pa_channel_map* pa_channel_map_init_auto(pa_channel_map *m, unsigned channels, pa_channel_map_def_t def);
/** Similar to pa_channel_map_init_auto() but instead of failing if no
* default mapping is known with the specified parameters it will
* synthesize a mapping based on a known mapping with fewer channels
* and fill up the rest with AUX0...AUX31 channels \since 0.9.11 */
pa_channel_map* pa_channel_map_init_extend(pa_channel_map *m, unsigned channels, pa_channel_map_def_t def);
/** Return a text label for the specified channel position */
const char* pa_channel_position_to_string(pa_channel_position_t pos) PA_GCC_PURE;
/** The inverse of pa_channel_position_to_string(). \since 0.9.16 */
pa_channel_position_t pa_channel_position_from_string(const char *s) PA_GCC_PURE;
/** Return a human readable text label for the specified channel position. \since 0.9.7 */
const char* pa_channel_position_to_pretty_string(pa_channel_position_t pos);
/** The maximum length of strings returned by
* pa_channel_map_snprint(). Please note that this value can change
* with any release without warning and without being considered API
* or ABI breakage. You should not use this definition anywhere where
* it might become part of an ABI. */
#define PA_CHANNEL_MAP_SNPRINT_MAX 336
/** Make a human readable string from the specified channel map */
char* pa_channel_map_snprint(char *s, size_t l, const pa_channel_map *map);
/** Parse a channel position list or well-known mapping name into a
* channel map structure. This turns the output of
* pa_channel_map_snprint() and pa_channel_map_to_name() back into a
* pa_channel_map */
pa_channel_map *pa_channel_map_parse(pa_channel_map *map, const char *s);
/** Compare two channel maps. Return 1 if both match. */
int pa_channel_map_equal(const pa_channel_map *a, const pa_channel_map *b) PA_GCC_PURE;
/** Return non-zero if the specified channel map is considered valid */
int pa_channel_map_valid(const pa_channel_map *map) PA_GCC_PURE;
/** Return non-zero if the specified channel map is compatible with
* the specified sample spec. \since 0.9.12 */
int pa_channel_map_compatible(const pa_channel_map *map, const pa_sample_spec *ss) PA_GCC_PURE;
/** Returns non-zero if every channel defined in b is also defined in a. \since 0.9.15 */
int pa_channel_map_superset(const pa_channel_map *a, const pa_channel_map *b) PA_GCC_PURE;
/** Returns non-zero if it makes sense to apply a volume 'balance'
* with this mapping, i.e.\ if there are left/right channels
* available. \since 0.9.15 */
int pa_channel_map_can_balance(const pa_channel_map *map) PA_GCC_PURE;
/** Returns non-zero if it makes sense to apply a volume 'fade'
* (i.e.\ 'balance' between front and rear) with this mapping, i.e.\ if
* there are front/rear channels available. \since 0.9.15 */
int pa_channel_map_can_fade(const pa_channel_map *map) PA_GCC_PURE;
/** Tries to find a well-known channel mapping name for this channel
* mapping, i.e.\ "stereo", "surround-71" and so on. If the channel
* mapping is unknown NULL will be returned. This name can be parsed
* with pa_channel_map_parse() \since 0.9.15 */
const char* pa_channel_map_to_name(const pa_channel_map *map) PA_GCC_PURE;
/** Tries to find a human readable text label for this channel
mapping, i.e.\ "Stereo", "Surround 7.1" and so on. If the channel
mapping is unknown NULL will be returned. \since 0.9.15 */
const char* pa_channel_map_to_pretty_name(const pa_channel_map *map) PA_GCC_PURE;
/** Returns TRUE if the specified channel position is available at
* least once in the channel map. \since 0.9.16 */
int pa_channel_map_has_position(const pa_channel_map *map, pa_channel_position_t p) PA_GCC_PURE;
/** Generates a bit mask from a channel map. \since 0.9.16 */
pa_channel_position_mask_t pa_channel_map_mask(const pa_channel_map *map) PA_GCC_PURE;
PA_C_DECL_END
#endif
#ifndef foocontexthfoo
#define foocontexthfoo
/***
This file is part of PulseAudio.
Copyright 2004-2006 Lennart Poettering
Copyright 2006 Pierre Ossman <ossman@cendio.se> for Cendio AB
PulseAudio is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published
by the Free Software Foundation; either version 2.1 of the License,
or (at your option) any later version.
PulseAudio is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with PulseAudio; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
USA.
***/
#include <pulse/sample.h>
#include <pulse/def.h>
#include <pulse/mainloop-api.h>
#include <pulse/cdecl.h>
#include <pulse/operation.h>
#include <pulse/proplist.h>
#include <pulse/version.h>
/** \page async Asynchronous API
*
* \section overv_sec Overview
*
* The asynchronous API is the native interface to the PulseAudio library.
* It allows full access to all available functionality. This however means that
* it is rather complex and can take some time to fully master.
*
* \section mainloop_sec Main Loop Abstraction
*
* The API is based around an asynchronous event loop, or main loop,
* abstraction. This abstraction contains three basic elements:
*
* \li Deferred events - Events that will trigger as soon as possible. Note
* that some implementations may block all other events
* when a deferred event is active.
* \li I/O events - Events that trigger on file descriptor activities.
* \li Times events - Events that trigger after a fixed amount of time.
*
* The abstraction is represented as a number of function pointers in the
* pa_mainloop_api structure.
*
* To actually be able to use these functions, an implementation needs to
* be coupled to the abstraction. There are three of these shipped with
* PulseAudio, but any other can be used with a minimal amount of work,
* provided it supports the three basic events listed above.
*
* The implementations shipped with PulseAudio are:
*
* \li \subpage mainloop - A minimal but fast implementation based on poll().
* \li \subpage threaded_mainloop - A special version of the previous
* implementation where all of PulseAudio's
* internal handling runs in a separate
* thread.
* \li \subpage glib-mainloop - A wrapper around GLib's main loop.
*
* UNIX signals may be hooked to a main loop using the functions from
* \ref mainloop-signal.h. These rely only on the main loop abstraction
* and can therefore be used with any of the implementations.
*
* \section refcnt_sec Reference Counting
*
* Almost all objects in PulseAudio are reference counted. What that means
* is that you rarely malloc() or free() any objects. Instead you increase
* and decrease their reference counts. Whenever an object's reference
* count reaches zero, that object gets destroy and any resources it uses
* get freed.
*
* The benefit of this design is that an application need not worry about
* whether or not it needs to keep an object around in case the library is
* using it internally. If it is, then it has made sure it has its own
* reference to it.
*
* Whenever the library creates an object, it will have an initial
* reference count of one. Most of the time, this single reference will be
* sufficient for the application, so all required reference count
* interaction will be a single call to the objects unref function.
*
* \section context_sec Context
*
* A context is the basic object for a connection to a PulseAudio server.
* It multiplexes commands, data streams and events through a single
* channel.
*
* There is no need for more than one context per application, unless
* connections to multiple servers are needed.
*
* \subsection ops_subsec Operations
*
* All operations on the context are performed asynchronously. I.e. the
* client will not wait for the server to complete the request. To keep
* track of all these in-flight operations, the application is given a
* pa_operation object for each asynchronous operation.
*
* There are only two actions (besides reference counting) that can be
* performed on a pa_operation: querying its state with
* pa_operation_get_state() and aborting it with pa_operation_cancel().
*
* A pa_operation object is reference counted, so an application must
* make sure to unreference it, even if it has no intention of using it.
*
* \subsection conn_subsec Connecting
*
* A context must be connected to a server before any operation can be
* issued. Calling pa_context_connect() will initiate the connection
* procedure. Unlike most asynchronous operations, connecting does not
* result in a pa_operation object. Instead, the application should
* register a callback using pa_context_set_state_callback().
*
* \subsection disc_subsec Disconnecting
*
* When the sound support is no longer needed, the connection needs to be
* closed using pa_context_disconnect(). This is an immediate function that
* works synchronously.
*
* Since the context object has references to other objects it must be
* disconnected after use or there is a high risk of memory leaks. If the
* connection has terminated by itself, then there is no need to explicitly
* disconnect the context using pa_context_disconnect().
*
* \section Functions
*
* The sound server's functionality can be divided into a number of
* subsections:
*
* \li \subpage streams
* \li \subpage scache
* \li \subpage introspect
* \li \subpage subscribe
*/
/** \file
* Connection contexts for asynchronous communication with a
* server. A pa_context object wraps a connection to a PulseAudio
* server using its native protocol.
*
* See also \subpage async
*/
PA_C_DECL_BEGIN
/** An opaque connection context to a daemon */
typedef struct pa_context pa_context;
/** Generic notification callback prototype */
typedef void (*pa_context_notify_cb_t)(pa_context *c, void *userdata);
/** A generic callback for operation completion */
typedef void (*pa_context_success_cb_t) (pa_context *c, int success, void *userdata);
/** A callback for asynchronous meta/policy event messages. The set
* of defined events can be extended at any time. Also, server modules
* may introduce additional message types so make sure that your
* callback function ignores messages it doesn't know. \since
* 0.9.15 */
typedef void (*pa_context_event_cb_t)(pa_context *c, const char *name, pa_proplist *p, void *userdata);
/** Instantiate a new connection context with an abstract mainloop API
* and an application name. It is recommended to use pa_context_new_with_proplist()
* instead and specify some initial properties.*/
pa_context *pa_context_new(pa_mainloop_api *mainloop, const char *name);
/** Instantiate a new connection context with an abstract mainloop API
* and an application name, and specify the initial client property
* list. \since 0.9.11 */
pa_context *pa_context_new_with_proplist(pa_mainloop_api *mainloop, const char *name, pa_proplist *proplist);
/** Decrease the reference counter of the context by one */
void pa_context_unref(pa_context *c);
/** Increase the reference counter of the context by one */
pa_context* pa_context_ref(pa_context *c);
/** Set a callback function that is called whenever the context status changes */
void pa_context_set_state_callback(pa_context *c, pa_context_notify_cb_t cb, void *userdata);
/** Set a callback function that is called whenever a meta/policy
* control event is received. \since 0.9.15 */
void pa_context_set_event_callback(pa_context *p, pa_context_event_cb_t cb, void *userdata);
/** Return the error number of the last failed operation */
int pa_context_errno(pa_context *c);
/** Return non-zero if some data is pending to be written to the connection */
int pa_context_is_pending(pa_context *c);
/** Return the current context status */
pa_context_state_t pa_context_get_state(pa_context *c);
/** Connect the context to the specified server. If server is NULL,
connect to the default server. This routine may but will not always
return synchronously on error. Use pa_context_set_state_callback() to
be notified when the connection is established. If flags doesn't have
PA_CONTEXT_NOAUTOSPAWN set and no specific server is specified or
accessible a new daemon is spawned. If api is non-NULL, the functions
specified in the structure are used when forking a new child
process. */
int pa_context_connect(pa_context *c, const char *server, pa_context_flags_t flags, const pa_spawn_api *api);
/** Terminate the context connection immediately */
void pa_context_disconnect(pa_context *c);
/** Drain the context. If there is nothing to drain, the function returns NULL */
pa_operation* pa_context_drain(pa_context *c, pa_context_notify_cb_t cb, void *userdata);
/** Tell the daemon to exit. The returned operation is unlikely to
* complete successfully, since the daemon probably died before
* returning a success notification */
pa_operation* pa_context_exit_daemon(pa_context *c, pa_context_success_cb_t cb, void *userdata);
/** Set the name of the default sink. */
pa_operation* pa_context_set_default_sink(pa_context *c, const char *name, pa_context_success_cb_t cb, void *userdata);
/** Set the name of the default source. */
pa_operation* pa_context_set_default_source(pa_context *c, const char *name, pa_context_success_cb_t cb, void *userdata);
/** Returns 1 when the connection is to a local daemon. Returns negative when no connection has been made yet. */
int pa_context_is_local(pa_context *c);
/** Set a different application name for context on the server. */
pa_operation* pa_context_set_name(pa_context *c, const char *name, pa_context_success_cb_t cb, void *userdata);
/** Return the server name this context is connected to. */
const char* pa_context_get_server(pa_context *c);
/** Return the protocol version of the library. */
uint32_t pa_context_get_protocol_version(pa_context *c);
/** Return the protocol version of the connected server. */
uint32_t pa_context_get_server_protocol_version(pa_context *c);
/** Update the property list of the client, adding new entries. Please
* note that it is highly recommended to set as much properties
* initially via pa_context_new_with_proplist() as possible instead a
* posteriori with this function, since that information may then be
* used to route streams of the client to the right device. \since 0.9.11 */
pa_operation *pa_context_proplist_update(pa_context *c, pa_update_mode_t mode, pa_proplist *p, pa_context_success_cb_t cb, void *userdata);
/** Update the property list of the client, remove entries. \since 0.9.11 */
pa_operation *pa_context_proplist_remove(pa_context *c, const char *const keys[], pa_context_success_cb_t cb, void *userdata);
/** Return the client index this context is
* identified in the server with. This is useful for usage with the
* introspection functions, such as pa_context_get_client_info(). \since 0.9.11 */
uint32_t pa_context_get_index(pa_context *s);
/** Create a new timer event source for the specified time (wrapper
* for mainloop->time_new). \since 0.9.16 */
pa_time_event* pa_context_rttime_new(pa_context *c, pa_usec_t usec, pa_time_event_cb_t cb, void *userdata);
/** Restart a running or expired timer event source (wrapper for
* mainloop->time_restart). \since 0.9.16 */
void pa_context_rttime_restart(pa_context *c, pa_time_event *e,</