...
 
Commits (1)
......@@ -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
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
#ifndef fooerrorhfoo
#define fooerrorhfoo
/***
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/cdecl.h>
#include <pulse/version.h>
/** \file
* Error management */
PA_C_DECL_BEGIN
/** Return a human readable error message for the specified numeric error code */
const char* pa_strerror(int error);
PA_C_DECL_END
#endif
#ifndef foopulseextdevicemanagerhfoo
#define foopulseextdevicemanagerhfoo
/***
This file is part of PulseAudio.
Copyright 2008 Lennart Poettering
Copyright 2009 Colin Guthrie
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/cdecl.h>
#include <pulse/context.h>
#include <pulse/version.h>
/** \file
*
* Routines for controlling module-device-manager
*/
PA_C_DECL_BEGIN
typedef struct pa_ext_device_manager_role_priority_info {
const char *role;
uint32_t priority;
} pa_ext_device_manager_role_priority_info;
/** Stores information about one device in the device database that is
* maintained by module-device-manager. \since 0.9.21 */
typedef struct pa_ext_device_manager_info {
const char *name; /**< Identifier string of the device. A string like "sink:" or similar followed by the name of the device. */
const char *description; /**< The description of the device when it was last seen, if applicable and saved */
const char *icon; /**< The icon given to the device */
uint32_t index; /**< The device index if it is currently available or PA_INVALID_INDEX */
uint32_t n_role_priorities; /**< How many role priorities do we have? */
pa_ext_device_manager_role_priority_info *role_priorities; /**< An array of role priority structures or NULL */
} pa_ext_device_manager_info;
/** Callback prototype for pa_ext_device_manager_test(). \since 0.9.21 */
typedef void (*pa_ext_device_manager_test_cb_t)(
pa_context *c,
uint32_t version,
void *userdata);
/** Test if this extension module is available in the server. \since 0.9.21 */
pa_operation *pa_ext_device_manager_test(
pa_context *c,
pa_ext_device_manager_test_cb_t cb,
void *userdata);
/** Callback prototype for pa_ext_device_manager_read(). \since 0.9.21 */
typedef void (*pa_ext_device_manager_read_cb_t)(
pa_context *c,
const pa_ext_device_manager_info *info,
int eol,
void *userdata);
/** Read all entries from the device database. \since 0.9.21 */
pa_operation *pa_ext_device_manager_read(
pa_context *c,
pa_ext_device_manager_read_cb_t cb,
void *userdata);
/** Sets the description for a device. \since 0.9.21 */
pa_operation *pa_ext_device_manager_set_device_description(
pa_context *c,
const char* device,
const char* description,
pa_context_success_cb_t cb,
void *userdata);
/** Delete entries from the device database. \since 0.9.21 */
pa_operation *pa_ext_device_manager_delete(
pa_context *c,
const char *const s[],
pa_context_success_cb_t cb,
void *userdata);
/** Enable the role-based device-priority routing mode. \since 0.9.21 */
pa_operation *pa_ext_device_manager_enable_role_device_priority_routing(
pa_context *c,
int enable,
pa_context_success_cb_t cb,
void *userdata);
/** Prefer a given device in the priority list. \since 0.9.21 */
pa_operation *pa_ext_device_manager_reorder_devices_for_role(
pa_context *c,
const char* role,
const char** devices,
pa_context_success_cb_t cb,
void *userdata);
/** Subscribe to changes in the device database. \since 0.9.21 */
pa_operation *pa_ext_device_manager_subscribe(
pa_context *c,
int enable,
pa_context_success_cb_t cb,
void *userdata);
/** Callback prototype for pa_ext_device_manager_set_subscribe_cb(). \since 0.9.21 */
typedef void (*pa_ext_device_manager_subscribe_cb_t)(
pa_context *c,
void *userdata);
/** Set the subscription callback that is called when
* pa_ext_device_manager_subscribe() was called. \since 0.9.21 */
void pa_ext_device_manager_set_subscribe_cb(
pa_context *c,
pa_ext_device_manager_subscribe_cb_t cb,
void *userdata);
PA_C_DECL_END
#endif
#ifndef foopulseextdevicerestorehfoo
#define foopulseextdevicerestorehfoo
/***
This file is part of PulseAudio.
Copyright 2008 Lennart Poettering
Copyright 2011 Colin Guthrie
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/context.h>
#include <pulse/format.h>
#include <pulse/version.h>
/** \file
*
* Routines for controlling module-device-restore
*/
PA_C_DECL_BEGIN
/** Stores information about one device in the device database that is
* maintained by module-device-manager. \since 1.0 */
typedef struct pa_ext_device_restore_info {
pa_device_type_t type; /**< Device type sink or source? */
uint32_t index; /**< The device index */
uint8_t n_formats; /**< How many formats do we have? */
pa_format_info **formats; /**< An array of formats (may be NULL if n_formats == 0) */
} pa_ext_device_restore_info;
/** Callback prototype for pa_ext_device_restore_test(). \since 1.0 */
typedef void (*pa_ext_device_restore_test_cb_t)(
pa_context *c,
uint32_t version,
void *userdata);
/** Test if this extension module is available in the server. \since 1.0 */
pa_operation *pa_ext_device_restore_test(
pa_context *c,
pa_ext_device_restore_test_cb_t cb,
void *userdata);
/** Subscribe to changes in the device database. \since 1.0 */
pa_operation *pa_ext_device_restore_subscribe(
pa_context *c,
int enable,
pa_context_success_cb_t cb,
void *userdata);
/** Callback prototype for pa_ext_device_restore_set_subscribe_cb(). \since 1.0 */
typedef void (*pa_ext_device_restore_subscribe_cb_t)(
pa_context *c,
pa_device_type_t type,
uint32_t idx,
void *userdata);
/** Set the subscription callback that is called when
* pa_ext_device_restore_subscribe() was called. \since 1.0 */
void pa_ext_device_restore_set_subscribe_cb(
pa_context *c,
pa_ext_device_restore_subscribe_cb_t cb,
void *userdata);
/** Callback prototype for pa_ext_device_restore_read_formats(). \since 1.0 */
typedef void (*pa_ext_device_restore_read_device_formats_cb_t)(
pa_context *c,
const pa_ext_device_restore_info *info,
int eol,
void *userdata);
/** Read the formats for all present devices from the device database. \since 1.0 */
pa_operation *pa_ext_device_restore_read_formats_all(
pa_context *c,
pa_ext_device_restore_read_device_formats_cb_t cb,
void *userdata);
/** Read an entry from the device database. \since 1.0 */
pa_operation *pa_ext_device_restore_read_formats(
pa_context *c,
pa_device_type_t type,
uint32_t idx,
pa_ext_device_restore_read_device_formats_cb_t cb,
void *userdata);
/** Read an entry from the device database. \since 1.0 */
pa_operation *pa_ext_device_restore_save_formats(
pa_context *c,
pa_device_type_t type,
uint32_t idx,
uint8_t n_formats,
pa_format_info **formats,
pa_context_success_cb_t cb,
void *userdata);
PA_C_DECL_END
#endif
#ifndef foopulseextstreamrestorehfoo
#define foopulseextstreamrestorehfoo
/***
This file is part of PulseAudio.
Copyright 2008 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.
***/
#include <pulse/cdecl.h>
#include <pulse/context.h>
#include <pulse/version.h>
#include <pulse/volume.h>
#include <pulse/channelmap.h>
/** \file
*
* Routines for controlling module-stream-restore
*/
PA_C_DECL_BEGIN
/** Stores information about one entry in the stream database that is
* maintained by module-stream-restore. \since 0.9.12 */
typedef struct pa_ext_stream_restore_info {
const char *name; /**< Identifier string of the stream. A string like "sink-input-by-role:" or similar followed by some arbitrary property value. */
pa_channel_map channel_map; /**< The channel map for the volume field, if applicable */
pa_cvolume volume; /**< The volume of the stream when it was seen last, if applicable and saved */
const char *device; /**< The sink/source of the stream when it was last seen, if applicable and saved */
int mute; /**< The boolean mute state of the stream when it was last seen, if applicable and saved */
} pa_ext_stream_restore_info;
/** Callback prototype for pa_ext_stream_restore_test(). \since 0.9.12 */
typedef void (*pa_ext_stream_restore_test_cb_t)(
pa_context *c,
uint32_t version,
void *userdata);
/** Test if this extension module is available in the server. \since 0.9.12 */
pa_operation *pa_ext_stream_restore_test(
pa_context *c,
pa_ext_stream_restore_test_cb_t cb,
void *userdata);
/** Callback prototype for pa_ext_stream_restore_read(). \since 0.9.12 */
typedef void (*pa_ext_stream_restore_read_cb_t)(
pa_context *c,
const pa_ext_stream_restore_info *info,
int eol,
void *userdata);
/** Read all entries from the stream database. \since 0.9.12 */
pa_operation *pa_ext_stream_restore_read(
pa_context *c,
pa_ext_stream_restore_read_cb_t cb,
void *userdata);
/** Store entries in the stream database. \since 0.9.12 */
pa_operation *pa_ext_stream_restore_write(
pa_context *c,
pa_update_mode_t mode,
const pa_ext_stream_restore_info data[],
unsigned n,
int apply_immediately,
pa_context_success_cb_t cb,
void *userdata);
/** Delete entries from the stream database. \since 0.9.12 */
pa_operation *pa_ext_stream_restore_delete(
pa_context *c,
const char *const s[],
pa_context_success_cb_t cb,
void *userdata);
/** Subscribe to changes in the stream database. \since 0.9.12 */
pa_operation *pa_ext_stream_restore_subscribe(
pa_context *c,
int enable,
pa_context_success_cb_t cb,
void *userdata);
/** Callback prototype for pa_ext_stream_restore_set_subscribe_cb(). \since 0.9.12 */
typedef void (*pa_ext_stream_restore_subscribe_cb_t)(
pa_context *c,
void *userdata);
/** Set the subscription callback that is called when
* pa_ext_stream_restore_subscribe() was called. \since 0.9.12 */
void pa_ext_stream_restore_set_subscribe_cb(
pa_context *c,
pa_ext_stream_restore_subscribe_cb_t cb,
void *userdata);
PA_C_DECL_END
#endif
This diff is collapsed.
#ifndef foopulsegccmacrohfoo
#define foopulsegccmacrohfoo
/***
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
* GCC attribute macros */
#if defined(__GNUC__)
#ifdef __MINGW32__
/* libintl overrides printf with a #define. As this breaks this attribute,
* it has a workaround. However the workaround isn't enabled for MINGW
* builds (only cygwin) */
#define PA_GCC_PRINTF_ATTR(a,b) __attribute__ ((format (__printf__, a, b)))
#else
#define PA_GCC_PRINTF_ATTR(a,b) __attribute__ ((format (printf, a, b)))
#endif
#else
/** If we're in GNU C, use some magic for detecting invalid format strings */
#define PA_GCC_PRINTF_ATTR(a,b)
#endif
#if defined(__GNUC__) && (__GNUC__ >= 4)
#define PA_GCC_SENTINEL __attribute__ ((sentinel))
#else
/** Macro for usage of GCC's sentinel compilation warnings */
#define PA_GCC_SENTINEL
#endif
#ifdef __GNUC__
#define PA_GCC_NORETURN __attribute__((noreturn))
#else
/** Macro for no-return functions */
#define PA_GCC_NORETURN
#endif
#ifdef __GNUC__
#define PA_GCC_UNUSED __attribute__ ((unused))
#else
/** Macro for not used function, variable or parameter */
#define PA_GCC_UNUSED
#endif
#ifdef __GNUC__
#define PA_GCC_DESTRUCTOR __attribute__ ((destructor))
#else
/** Call this function when process terminates */
#define PA_GCC_DESTRUCTOR
#endif
#ifndef PA_GCC_PURE
#ifdef __GNUC__
#define PA_GCC_PURE __attribute__ ((pure))
#else
/** This function's return value depends only the arguments list and global state **/
#define PA_GCC_PURE
#endif
#endif
#ifndef PA_GCC_CONST
#ifdef __GNUC__
#define PA_GCC_CONST __attribute__ ((const))
#else
/** This function's return value depends only the arguments list (stricter version of PA_GCC_PURE) **/
#define PA_GCC_CONST
#endif
#endif
#ifndef PA_GCC_DEPRECATED
#ifdef __GNUC__
#define PA_GCC_DEPRECATED __attribute__ ((deprecated))
#else
/** This function is deprecated **/
#define PA_GCC_DEPRECATED
#endif
#endif
#ifndef PA_GCC_PACKED
#ifdef __GNUC__
#define PA_GCC_PACKED __attribute__ ((packed))
#else
/** Structure shall be packed in memory **/
#define PA_GCC_PACKED
#endif
#endif
#ifndef PA_GCC_ALLOC_SIZE
#if defined(__GNUC__) && (__GNUC__ >= 4) && (__GNUC_MINOR__ >= 3)
#define PA_GCC_ALLOC_SIZE(x) __attribute__ ((__alloc_size__(x)))
#define PA_GCC_ALLOC_SIZE2(x,y) __attribute__ ((__alloc_size__(x,y)))
#else
/** Macro for usage of GCC's alloc_size attribute */
#define PA_GCC_ALLOC_SIZE(x)
/** Macro for usage of GCC's alloc_size attribute */
#define PA_GCC_ALLOC_SIZE2(x,y)
#endif
#endif
#ifndef PA_GCC_MALLOC
#ifdef __GNUC__
#define PA_GCC_MALLOC __attribute__ ((malloc))
#else
/** Macro for usage of GCC's malloc attribute */
#define PA_GCC_MALLOC
#endif
#endif
#ifndef PA_GCC_WEAKREF
#if defined(__GNUC__) && defined(__ELF__) && (((__GNUC__ == 4) && (__GNUC_MINOR__ > 1)) || (__GNUC__ > 4))
/** Macro for usage of GCC's weakref attribute */
#define PA_GCC_WEAKREF(x) __attribute__((weakref(#x)))
#endif
#endif
#endif
#ifndef fooglibmainloophfoo
#define fooglibmainloophfoo
/***
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 <glib.h>
#include <pulse/mainloop-api.h>
#include <pulse/cdecl.h>
#include <pulse/version.h>
/** \page glib-mainloop GLIB Main Loop Bindings
*
* \section overv_sec Overview
*
* The GLIB main loop bindings are extremely easy to use. All that is
* required is to create a pa_glib_mainloop object using
* pa_glib_mainloop_new(). When the main loop abstraction is needed, it is
* provided by pa_glib_mainloop_get_api().
*
*/
/** \file
* GLIB main loop support
*
* See also \subpage glib-mainloop
*/
PA_C_DECL_BEGIN
/** An opaque GLIB main loop object */
typedef struct pa_glib_mainloop pa_glib_mainloop;
/** Create a new GLIB main loop object for the specified GLIB main
* loop context. Takes an argument c for the
* GMainContext to use. If c is NULL the default context is used. */
pa_glib_mainloop *pa_glib_mainloop_new(GMainContext *c);
/** Free the GLIB main loop object */
void pa_glib_mainloop_free(pa_glib_mainloop* g);
/** Return the abstract main loop API vtable for the GLIB main loop
object. No need to free the API as it is owned by the loop
and is destroyed when the loop is freed. */
pa_mainloop_api* pa_glib_mainloop_get_api(pa_glib_mainloop *g);
PA_C_DECL_END
#endif
This diff is collapsed.
#ifndef foomainloopapihfoo
#define foomainloopapihfoo
/***
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
Lesser 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 <sys/time.h>
#include <pulse/cdecl.h>
#include <pulse/version.h>
/** \file
*
* Main loop abstraction layer. Both the PulseAudio core and the
* PulseAudio client library use a main loop abstraction layer. Due to
* this it is possible to embed PulseAudio into other
* applications easily. Two main loop implementations are
* currently available:
* \li A minimal implementation based on the C library's poll() function (See \ref mainloop.h)
* \li A wrapper around the GLIB main loop. Use this to embed PulseAudio into your GLIB/GTK+/GNOME programs (See \ref glib-mainloop.h)
*
* The structure pa_mainloop_api is used as vtable for the main loop abstraction.
*
* This mainloop abstraction layer has no direct support for UNIX signals. Generic, mainloop implementation agnostic support is available through \ref mainloop-signal.h.
* */
PA_C_DECL_BEGIN
/** An abstract mainloop API vtable */
typedef struct pa_mainloop_api pa_mainloop_api;
/** A bitmask for IO events */
typedef enum pa_io_event_flags {
PA_IO_EVENT_NULL = 0, /**< No event */
PA_IO_EVENT_INPUT = 1, /**< Input event */
PA_IO_EVENT_OUTPUT = 2, /**< Output event */
PA_IO_EVENT_HANGUP = 4, /**< Hangup event */
PA_IO_EVENT_ERROR = 8 /**< Error event */
} pa_io_event_flags_t;
/** An opaque IO event source object */
typedef struct pa_io_event pa_io_event;
/** An IO event callback prototype \since 0.9.3 */
typedef void (*pa_io_event_cb_t)(pa_mainloop_api*ea, pa_io_event* e, int fd, pa_io_event_flags_t events, void *userdata);
/** A IO event destroy callback prototype \ since 0.9.3 */
typedef void (*pa_io_event_destroy_cb_t)(pa_mainloop_api*a, pa_io_event *e, void *userdata);
/** An opaque timer event source object */
typedef struct pa_time_event pa_time_event;
/** A time event callback prototype \since 0.9.3 */
typedef void (*pa_time_event_cb_t)(pa_mainloop_api*a, pa_time_event* e, const struct timeval *tv, void *userdata);
/** A time event destroy callback prototype \ since 0.9.3 */
typedef void (*pa_time_event_destroy_cb_t)(pa_mainloop_api*a, pa_time_event *e, void *userdata);
/** An opaque deferred event source object. Events of this type are triggered once in every main loop iteration */
typedef struct pa_defer_event pa_defer_event;
/** A defer event callback prototype \since 0.9.3 */
typedef void (*pa_defer_event_cb_t)(pa_mainloop_api*a, pa_defer_event* e, void *userdata);
/** A defer event destroy callback prototype \ since 0.9.3 */
typedef void (*pa_defer_event_destroy_cb_t)(pa_mainloop_api*a, pa_defer_event *e, void *userdata);
/** An abstract mainloop API vtable */
struct pa_mainloop_api {
/** A pointer to some private, arbitrary data of the main loop implementation */
void *userdata;
/** Create a new IO event source object */
pa_io_event* (*io_new)(pa_mainloop_api*a, int fd, pa_io_event_flags_t events, pa_io_event_cb_t cb, void *userdata);
/** Enable or disable IO events on this object */
void (*io_enable)(pa_io_event* e, pa_io_event_flags_t events);
/** Free a IO event source object */
void (*io_free)(pa_io_event* e);
/** Set a function that is called when the IO event source is destroyed. Use this to free the userdata argument if required */
void (*io_set_destroy)(pa_io_event *e, pa_io_event_destroy_cb_t cb);
/** Create a new timer event source object for the specified Unix time */
pa_time_event* (*time_new)(pa_mainloop_api*a, const struct timeval *tv, pa_time_event_cb_t cb, void *userdata);
/** Restart a running or expired timer event source with a new Unix time */
void (*time_restart)(pa_time_event* e, const struct timeval *tv);
/** Free a deferred timer event source object */
void (*time_free)(pa_time_event* e);
/** Set a function that is called when the timer event source is destroyed. Use this to free the userdata argument if required */
void (*time_set_destroy)(pa_time_event *e, pa_time_event_destroy_cb_t cb);
/** Create a new deferred event source object */
pa_defer_event* (*defer_new)(pa_mainloop_api*a, pa_defer_event_cb_t cb, void *userdata);
/** Enable or disable a deferred event source temporarily */
void (*defer_enable)(pa_defer_event* e, int b);
/** Free a deferred event source object */
void (*defer_free)(pa_defer_event* e);
/** Set a function that is called when the deferred event source is destroyed. Use this to free the userdata argument if required */
void (*defer_set_destroy)(pa_defer_event *e, pa_defer_event_destroy_cb_t cb);
/** Exit the main loop and return the specified retval*/
void (*quit)(pa_mainloop_api*a, int retval);
};
/** Run the specified callback function once from the main loop using an anonymous defer event. */
void pa_mainloop_api_once(pa_mainloop_api*m, void (*callback)(pa_mainloop_api*m, void *userdata), void *userdata);
PA_C_DECL_END
#endif
#ifndef foomainloopsignalhfoo
#define foomainloopsignalhfoo
/***
This file is part of PulseAudio.
Copyright 2004-2008 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/mainloop-api.h>
#include <pulse/cdecl.h>
PA_C_DECL_BEGIN
/** \file
* UNIX signal support for main loops. In contrast to other
* main loop event sources such as timer and IO events, UNIX signal
* support requires modification of the global process
* environment. Due to this the generic main loop abstraction layer as
* defined in \ref mainloop-api.h doesn't have direct support for UNIX
* signals. However, you may hook signal support into an abstract main loop via the routines defined herein.
*/
/** An opaque UNIX signal event source object */
typedef struct pa_signal_event pa_signal_event;
/** Callback prototype for signal events */
typedef void (*pa_signal_cb_t) (pa_mainloop_api *api, pa_signal_event*e, int sig, void *userdata);
/** Destroy callback prototype for signal events */
typedef void (*pa_signal_destroy_cb_t) (pa_mainloop_api *api, pa_signal_event*e, void *userdata);
/** Initialize the UNIX signal subsystem and bind it to the specified main loop */
int pa_signal_init(pa_mainloop_api *api);
/** Cleanup the signal subsystem */
void pa_signal_done(void);
/** Create a new UNIX signal event source object */
pa_signal_event* pa_signal_new(int sig, pa_signal_cb_t callback, void *userdata);
/** Free a UNIX signal event source object */
void pa_signal_free(pa_signal_event *e);
/** Set a function that is called when the signal event source is destroyed. Use this to free the userdata argument if required */
void pa_signal_set_destroy(pa_signal_event *e, pa_signal_destroy_cb_t callback);
PA_C_DECL_END
#endif
#ifndef foomainloophfoo
#define foomainloophfoo
/***
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/mainloop-api.h>
#include <pulse/cdecl.h>
PA_C_DECL_BEGIN
struct pollfd;
/** \page mainloop Main Loop
*
* \section overv_sec Overview
*
* The built-in main loop implementation is based on the poll() system call.
* It supports the functions defined in the main loop abstraction and very
* little else.
*
* The main loop is created using pa_mainloop_new() and destroyed using
* pa_mainloop_free(). To get access to the main loop abstraction,
* pa_mainloop_get_api() is used.
*
* \section iter_sec Iteration
*
* The main loop is designed around the concept of iterations. Each iteration
* consists of three steps that repeat during the application's entire
* lifetime:
*
* -# Prepare - Build a list of file descriptors
* that need to be monitored and calculate the next timeout.
* -# Poll - Execute the actual poll() system call.
* -# Dispatch - Dispatch any events that have fired.
*
* When using the main loop, the application can either execute each
* iteration, one at a time, using pa_mainloop_iterate(), or let the library
* iterate automatically using pa_mainloop_run().
*
* \section thread_sec Threads
*
* The main loop functions are designed to be thread safe, but the objects
* are not. What this means is that multiple main loops can be used, but only
* one object per thread.
*
*/
/** \file
*
* A minimal main loop implementation based on the C library's poll()
* function. Using the routines defined herein you may create a simple
* main loop supporting the generic main loop abstraction layer as
* defined in \ref mainloop-api.h. This implementation is thread safe
* as long as you access the main loop object from a single thread only.
*
* See also \subpage mainloop
*/
/** An opaque main loop object */
typedef struct pa_mainloop pa_mainloop;
/** Allocate a new main loop object */
pa_mainloop *pa_mainloop_new(void);
/** Free a main loop object */
void pa_mainloop_free(pa_mainloop* m);
/** Prepare for a single iteration of the main loop. Returns a negative value
on error or exit request. timeout specifies a maximum timeout for the subsequent
poll, or -1 for blocking behaviour. .*/
int pa_mainloop_prepare(pa_mainloop *m, int timeout);
/** Execute the previously prepared poll. Returns a negative value on error.*/
int pa_mainloop_poll(pa_mainloop *m);
/** Dispatch timeout, io and deferred events from the previously executed poll. Returns
a negative value on error. On success returns the number of source dispatched. */
int pa_mainloop_dispatch(pa_mainloop *m);
/** Return the return value as specified with the main loop's quit() routine. */
int pa_mainloop_get_retval(pa_mainloop *m);
/** Run a single iteration of the main loop. This is a convenience function
for pa_mainloop_prepare(), pa_mainloop_poll() and pa_mainloop_dispatch().
Returns a negative value on error or exit request. If block is nonzero,
block for events if none are queued. Optionally return the return value as
specified with the main loop's quit() routine in the integer variable retval points
to. On success returns the number of sources dispatched in this iteration. */
int pa_mainloop_iterate(pa_mainloop *m, int block, int *retval);
/** Run unlimited iterations of the main loop object until the main loop's quit() routine is called. */
int pa_mainloop_run(pa_mainloop *m, int *retval);
/** Return the abstract main loop abstraction layer vtable for this
main loop. No need to free the API as it is owned by the loop
and is destroyed when the loop is freed. */
pa_mainloop_api* pa_mainloop_get_api(pa_mainloop*m);
/** Shutdown the main loop */
void pa_mainloop_quit(pa_mainloop *m, int r);
/** Interrupt a running poll (for threaded systems) */
void pa_mainloop_wakeup(pa_mainloop *m);
/** Generic prototype of a poll() like function */
typedef int (*pa_poll_func)(struct pollfd *ufds, unsigned long nfds, int timeout, void*userdata);
/** Change the poll() implementation */
void pa_mainloop_set_poll_func(pa_mainloop *m, pa_poll_func poll_func, void *userdata);
PA_C_DECL_END
#endif
#ifndef foooperationhfoo
#define foooperationhfoo
/***
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.
***/
#include <pulse/cdecl.h>
#include <pulse/def.h>
#include <pulse/version.h>
/** \file
* Asynchronous operations */
PA_C_DECL_BEGIN
/** An asynchronous operation object */
typedef struct pa_operation pa_operation;
/** A callback for operation state changes */
typedef void (*pa_operation_notify_cb_t) (pa_operation *o, void *userdata);
/** Increase the reference count by one */
pa_operation *pa_operation_ref(pa_operation *o);
/** Decrease the reference count by one */
void pa_operation_unref(pa_operation *o);
/** Cancel the operation. Beware! This will not necessarily cancel the
* execution of the operation on the server side. However it will make
* sure that the callback associated with this operation will not be
* called anymore, effectively disabling the operation from the client
* side's view. */
void pa_operation_cancel(pa_operation *o);
/** Return the current status of the operation */
pa_operation_state_t pa_operation_get_state(pa_operation *o);
/** Set the callback function that is called when the operation state
* changes. Usually this is not necessary, since the functions that
* create pa_operation objects already take a callback that is called
* when the operation finishes. Registering a state change callback is
* mainly useful, if you want to get called back also if the operation
* gets cancelled. \since 4.0 */
void pa_operation_set_state_callback(pa_operation *o, pa_operation_notify_cb_t cb, void *userdata);
PA_C_DECL_END
#endif
This diff is collapsed.
#ifndef foopulseaudiohfoo
#define foopulseaudiohfoo
/***
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
Lesser 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/mainloop-api.h>
#include <pulse/sample.h>
#include <pulse/format.h>
#include <pulse/def.h>
#include <pulse/context.h>
#include <pulse/stream.h>
#include <pulse/introspect.h>
#include <pulse/subscribe.h>
#include <pulse/scache.h>
#include <pulse/version.h>
#include <pulse/error.h>
#include <pulse/operation.h>
#include <pulse/channelmap.h>
#include <pulse/volume.h>
#include <pulse/xmalloc.h>
#include <pulse/utf8.h>
#include <pulse/thread-mainloop.h>
#include <pulse/mainloop.h>
#include <pulse/mainloop-signal.h>
#include <pulse/util.h>
#include <pulse/timeval.h>
#include <pulse/proplist.h>
#include <pulse/rtclock.h>
/** \file
* Include all libpulse header files at once. The following files are
* included: \ref mainloop-api.h, \ref sample.h, \ref def.h, \ref
* context.h, \ref stream.h, \ref introspect.h, \ref subscribe.h, \ref
* scache.h, \ref version.h, \ref error.h, \ref channelmap.h, \ref
* operation.h,\ref volume.h, \ref xmalloc.h, \ref utf8.h, \ref
* thread-mainloop.h, \ref mainloop.h, \ref util.h, \ref proplist.h,
* \ref timeval.h, \ref rtclock.h and \ref mainloop-signal.h at
* once */
/** \mainpage
*
* \section intro_sec Introduction
*
* This document describes the client API for the PulseAudio sound
* server. The API comes in two flavours to accommodate different styles
* of applications and different needs in complexity:
*
* \li The complete but somewhat complicated to use asynchronous API
* \li The simplified, easy to use, but limited synchronous API
*
* All strings in PulseAudio are in the UTF-8 encoding, regardless of current
* locale. Some functions will filter invalid sequences from the string, some
* will simply fail. To ensure reliable behaviour, make sure everything you
* pass to the API is already in UTF-8.
* \section simple_sec Simple API
*
* Use this if you develop your program in synchronous style and just
* need a way to play or record data on the sound server. See
* \subpage simple for more details.
*
* \section async_sec Asynchronous API
*
* Use this if you develop your programs in asynchronous, event loop
* based style or if you want to use the advanced features of the
* PulseAudio API. A guide can be found in \subpage async.
*
* By using the built-in threaded main loop, it is possible to achieve a
* pseudo-synchronous API, which can be useful in synchronous applications
* where the simple API is insufficient. See the \ref async page for
* details.
*
* \section thread_sec Threads
*
* The PulseAudio client libraries are not designed to be directly
* thread-safe. They are however designed to be reentrant and
* threads-aware.
*
* To use the libraries in a threaded environment, you must assure that
* all objects are only used in one thread at a time. Normally, this means
* that all objects belonging to a single context must be accessed from the
* same thread.
*
* The included main loop implementation is also not thread safe. Take care
* to make sure event objects are not manipulated when any other code is
* using the main loop.
*
* \section error_sec Error Handling
*
* Every function should explicitly document how errors are reported to
* the caller. Unfortunately, currently a lot of that documentation is
* missing. Here is an overview of the general conventions used.
*
* The PulseAudio API indicates error conditions by returning a negative
* integer value or a NULL pointer. On success, zero or a positive integer
* value or a valid pointer is returned.
*
* Functions of the \ref simple generally return -1 or NULL on failure and
* can optionally store an error code (see ::pa_error_code) using a pointer
* argument.
*
* Functions of the \ref async return an negative error code or NULL on
* failure (see ::pa_error_code). In the later case, pa_context_errno()
* can be used to obtain the error code of the last failed operation.
*
* An error code can be turned into a human readable message using
* pa_strerror().
*
* \section pkgconfig pkg-config
*
* The PulseAudio libraries provide pkg-config snippets for the different
* modules:
*
* \li libpulse - The asynchronous API and the internal main loop implementation.
* \li libpulse-mainloop-glib - GLIB 2.x main loop bindings.
* \li libpulse-simple - The simple PulseAudio API.
*/
#endif
#ifndef foortclockfoo
#define foortclockfoo
/***
This file is part of PulseAudio.
Copyright 2004-2009 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
Lesser 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/cdecl.h>
#include <pulse/sample.h>
/** \file
* Monotonic clock utilities. */
PA_C_DECL_BEGIN
/** Return the current monotonic system time in usec, if such a clock
* is available. If it is not available this will return the
* wallclock time instead. \since 0.9.16 */
pa_usec_t pa_rtclock_now(void);
PA_C_DECL_END
#endif
This diff is collapsed.
#ifndef fooscachehfoo
#define fooscachehfoo
/***
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 <sys/types.h>
#include <pulse/context.h>
#include <pulse/stream.h>
#include <pulse/cdecl.h>
#include <pulse/version.h>
/** \page scache Sample Cache
*
* \section overv_sec Overview
*
* The sample cache provides a simple way of overcoming high network latencies
* and reducing bandwidth. Instead of streaming a sound precisely when it
* should be played, it is stored on the server and only the command to start
* playing it needs to be sent.
*
* \section create_sec Creation
*
* To create a sample, the normal stream API is used (see \ref streams). The
* function pa_stream_connect_upload() will make sure the stream is stored as
* a sample on the server.
*
* To complete the upload, pa_stream_finish_upload() is called and the sample
* will receive the same name as the stream. If the upload should be aborted,
* simply call pa_stream_disconnect().
*
* \section play_sec Playing samples
*
* To play back a sample, simply call pa_context_play_sample():
*
* \code
* pa_operation *o;
*
* o = pa_context_play_sample(my_context,
* "sample2", // Name of my sample
* NULL, // Use default sink
* PA_VOLUME_NORM, // Full volume
* NULL, // Don't need a callback
* NULL
* );
* if (o)
* pa_operation_unref(o);
* \endcode
*
* \section rem_sec Removing samples
*
* When a sample is no longer needed, it should be removed on the server to
* save resources. The sample is deleted using pa_context_remove_sample().
*/
/** \file
* All sample cache related routines
*
* See also \subpage scache
*/
PA_C_DECL_BEGIN
/** Callback prototype for pa_context_play_sample_with_proplist(). The
* idx value is the index of the sink input object, or
* PA_INVALID_INDEX on failure. \since 0.9.11 */
typedef void (*pa_context_play_sample_cb_t)(pa_context *c, uint32_t idx, void *userdata);
/** Make this stream a sample upload stream */
int pa_stream_connect_upload(pa_stream *s, size_t length);
/** Finish the sample upload, the stream name will become the sample
* name. You cancel a sample upload by issuing
* pa_stream_disconnect() */
int pa_stream_finish_upload(pa_stream *s);
/** Remove a sample from the sample cache. Returns an operation object which may be used to cancel the operation while it is running */
pa_operation* pa_context_remove_sample(pa_context *c, const char *name, pa_context_success_cb_t cb, void *userdata);
/** Play a sample from the sample cache to the specified device. If
* the latter is NULL use the default sink. Returns an operation
* object */
pa_operation* pa_context_play_sample(
pa_context *c /**< Context */,
const char *name /**< Name of the sample to play */,
const char *dev /**< Sink to play this sample on */,
pa_volume_t volume /**< Volume to play this sample with. Starting with 0.9.15 you may pass here PA_VOLUME_INVALID which will leave the decision about the volume to the server side which is a good idea. */ ,
pa_context_success_cb_t cb /**< Call this function after successfully starting playback, or NULL */,
void *userdata /**< Userdata to pass to the callback */);
/** Play a sample from the sample cache to the specified device,
* allowing specification of a property list for the playback
* stream. If the latter is NULL use the default sink. Returns an
* operation object. \since 0.9.11 */
pa_operation* pa_context_play_sample_with_proplist(
pa_context *c /**< Context */,
const char *name /**< Name of the sample to play */,
const char *dev /**< Sink to play this sample on */,
pa_volume_t volume /**< Volume to play this sample with. Starting with 0.9.15 you may pass here PA_VOLUME_INVALID which will leave the decision about the volume to the server side which is a good idea. */ ,
pa_proplist *proplist /**< Property list for this sound. The property list of the cached entry will be merged into this property list */,
pa_context_play_sample_cb_t cb /**< Call this function after successfully starting playback, or NULL */,
void *userdata /**< Userdata to pass to the callback */);
PA_C_DECL_END
#endif
#ifndef foosimplehfoo
#define foosimplehfoo
/***
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 <sys/types.h>
#include <pulse/sample.h>
#include <pulse/channelmap.h>
#include <pulse/def.h>
#include <pulse/cdecl.h>
#include <pulse/version.h>
/** \page simple Simple API
*
* \section overv_sec Overview
*
* The simple API is designed for applications with very basic sound
* playback or capture needs. It can only support a single stream per
* connection and has no support for handling of complex features like
* events, channel mappings and volume control. It is, however, very simple
* to use and quite sufficient for many programs.
*
* \section conn_sec Connecting
*
* The first step before using the sound system is to connect to the
* server. This is normally done this way:
*
* \code
* pa_simple *s;
* pa_sample_spec ss;
*
* ss.format = PA_SAMPLE_S16NE;
* ss.channels = 2;
* ss.rate = 44100;
*
* s = pa_simple_new(NULL, // Use the default server.
* "Fooapp", // Our application's name.
* PA_STREAM_PLAYBACK,
* NULL, // Use the default device.
* "Music", // Description of our stream.
* &ss, // Our sample format.
* NULL, // Use default channel map
* NULL, // Use default buffering attributes.
* NULL, // Ignore error code.
* );
* \endcode
*
* At this point a connected object is returned, or NULL if there was a
* problem connecting.
*
* \section transfer_sec Transferring data
*
* Once the connection is established to the server, data can start flowing.
* Using the connection is very similar to the normal read() and write()
* system calls. The main difference is that they're called pa_simple_read()
* and pa_simple_write(). Note that these operations always block.
*
* \section ctrl_sec Buffer control
*
* If a playback stream is used then a few other operations are available:
*
* \li pa_simple_drain() - Will wait for all sent data to finish playing.
* \li pa_simple_flush() - Will throw away all data currently in buffers.
* \li pa_simple_get_latency() - Will return the total latency of
* the playback pipeline.
*
* \section cleanup_sec Cleanup
*
* Once playback or capture is complete, the connection should be closed
* and resources freed. This is done through:
*
* \code
* pa_simple_free(s);
* \endcode
*/
/** \file
* A simple but limited synchronous playback and recording
* API. This is a synchronous, simplified wrapper around the standard
* asynchronous API.
*
* See also \subpage simple
*/
/** \example pacat-simple.c
* A simple playback tool using the simple API */
/** \example parec-simple.c
* A simple recording tool using the simple API */
PA_C_DECL_BEGIN
/** \struct pa_simple
* An opaque simple connection object */
typedef struct pa_simple pa_simple;
/** Create a new connection to the server. */
pa_simple* pa_simple_new(
const char *server, /**< Server name, or NULL for default */
const char *name, /**< A descriptive name for this client (application name, ...) */
pa_stream_direction_t dir, /**< Open this stream for recording or playback? */
const char *dev, /**< Sink (resp. source) name, or NULL for default */
const char *stream_name, /**< A descriptive name for this stream (application name, song title, ...) */
const pa_sample_spec *ss, /**< The sample type to use */
const pa_channel_map *map, /**< The channel map to use, or NULL for default */
const pa_buffer_attr *attr, /**< Buffering attributes, or NULL for default */
int *error /**< A pointer where the error code is stored when the routine returns NULL. It is OK to pass NULL here. */
);
/** Close and free the connection to the server. The connection object becomes invalid when this is called. */
void pa_simple_free(pa_simple *s);
/** Write some data to the server. */
int pa_simple_write(pa_simple *s, const void *data, size_t bytes, int *error);
/** Wait until all data already written is played by the daemon. */
int pa_simple_drain(pa_simple *s, int *error);
/** Read some data from the server. */
int pa_simple_read(pa_simple *s, void *data, size_t bytes, int *error);
/** Return the playback latency. */
pa_usec_t pa_simple_get_latency(pa_simple *s, int *error);
/** Flush the playback buffer. This discards any audio in the buffer. */
int pa_simple_flush(pa_simple *s, int *error);
PA_C_DECL_END
#endif
This diff is collapsed.
#ifndef foosubscribehfoo
#define foosubscribehfoo
/***
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 <inttypes.h>
#include <pulse/def.h>
#include <pulse/context.h>
#include <pulse/cdecl.h>
#include <pulse/version.h>
/** \page subscribe Event Subscription
*
* \section overv_sec Overview
*
* The application can be notified, asynchronously, whenever the internal
* layout of the server changes. Possible notifications are described in the
* \ref pa_subscription_event_type and \ref pa_subscription_mask
* enumerations.
*
* The application sets the notification mask using pa_context_subscribe()
* and the function that will be called whenever a notification occurs using
* pa_context_set_subscribe_callback().
*
* The callback will be called with a \ref pa_subscription_event_type_t
* representing the event that caused the callback. Clients can examine what
* object changed using \ref PA_SUBSCRIPTION_EVENT_FACILITY_MASK. The actual
* event type can then be extracted with \ref PA_SUBSCRIPTION_EVENT_TYPE_MASK.
* Please note that the masked values are integers, not flags (so you will
* check the object/event type using a comparison not a binary AND). For
* example, the callback might look something like:
*
@verbatim
void my_subscription_callback(pa_context *c, pa_subscription_event_type_t t,
uint32_t idx, void *userdata)
{
if ((t & PA_SUBSCRIPTION_EVENT_FACILITY_MASK) == PA_SUBSCRIPTION_EVENT_SOURCE) {
if ((t & PA_SUBSCRIPTION_EVENT_TYPE_MASK) == PA_SUBSCRIPTION_EVENT_NEW) {
... a source was added, let's do stuff! ...
}
}
}
@endverbatim
*/
/** \file
* Daemon introspection event subscription subsystem.
*
* See also \subpage subscribe
*/
PA_C_DECL_BEGIN
/** Subscription event callback prototype */
typedef void (*pa_context_subscribe_cb_t)(pa_context *c, pa_subscription_event_type_t t, uint32_t idx, void *userdata);
/** Enable event notification */
pa_operation* pa_context_subscribe(pa_context *c, pa_subscription_mask_t m, pa_context_success_cb_t cb, void *userdata);
/** Set the context specific call back function that is called whenever the state of the daemon changes */
void pa_context_set_subscribe_callback(pa_context *c, pa_context_subscribe_cb_t cb, void *userdata);
PA_C_DECL_END
#endif
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.