diff options
author | Pierre Ossman <ossman@cendio.se> | 2006-05-29 12:19:46 +0200 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2006-05-29 12:19:46 +0200 |
commit | e945a42f2c28c271a56ce0546d38f0c33c4b8125 (patch) | |
tree | 245157d31dbe9aa7427f52b782c0d2cf3cd60390 /polyp/polyp.h | |
parent | a80fb39fa7cfdf1a5b157b526d3eebe0cd73716e (diff) |
Update Polypaudio plug-in to the 0.9.0 API
The new version of Polypaudio includes a threading abstraction that
allows application of a more synchronous nature to use the API more
easily. Using this, the complexity of the Polypaudio plug-in is greatly
reduced and also removes the risk of stalling the communications layer.
Signed-off-by: Pierre Ossman <ossman@cendio.se>
Diffstat (limited to 'polyp/polyp.h')
-rw-r--r-- | polyp/polyp.h | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/polyp/polyp.h b/polyp/polyp.h index 8c2ab95..f210e18 100644 --- a/polyp/polyp.h +++ b/polyp/polyp.h @@ -21,32 +21,27 @@ #include <alsa/asoundlib.h> #include <polyp/polypaudio.h> -#include <polyp/mainloop.h> #define ARRAY_SIZE(a) (sizeof(a)/sizeof((a)[0])) typedef struct snd_polyp { - pa_mainloop *mainloop; + pa_threaded_mainloop *mainloop; pa_context *context; int thread_fd, main_fd; - pthread_t thread; - int thread_running; - enum { POLYP_STATE_INIT, - POLYP_STATE_CONNECTED, POLYP_STATE_READY, - POLYP_STATE_POLLING, } state; } snd_polyp_t; -int polyp_start_poll(snd_polyp_t *p); -int polyp_finish_poll(snd_polyp_t *p); - int polyp_check_connection(snd_polyp_t *p); +void polyp_stream_state_cb(pa_stream *s, void * userdata); +void polyp_stream_success_cb(pa_stream *s, int success, void *userdata); +void polyp_context_success_cb(pa_context *c, int success, void *userdata); + int polyp_wait_operation(snd_polyp_t *p, pa_operation *o); int polyp_wait_stream_state(snd_polyp_t *p, pa_stream *stream, pa_stream_state_t target); @@ -54,8 +49,9 @@ snd_polyp_t *polyp_new(); void polyp_free(snd_polyp_t *p); int polyp_connect(snd_polyp_t *p, const char *server); -int polyp_start_thread(snd_polyp_t *p); +void polyp_poll_activate(snd_polyp_t *p); +void polyp_poll_deactivate(snd_polyp_t *p); int polyp_poll_descriptors_count(snd_polyp_t *p); int polyp_poll_descriptors(snd_polyp_t *p, struct pollfd *pfd, unsigned int space); int polyp_poll_revents(snd_polyp_t *p, struct pollfd *pfd, unsigned int nfds, unsigned short *revents); |