stream.h

Go to the documentation of this file.
00001 #ifndef foostreamhfoo
00002 #define foostreamhfoo
00003 
00004 /* $Id: stream.h 1426 2007-02-13 15:35:19Z ossman $ */
00005 
00006 /***
00007   This file is part of PulseAudio.
00008 
00009   Copyright 2004-2006 Lennart Poettering
00010   Copyright 2006 Pierre Ossman <ossman@cendio.se> for Cendio AB
00011 
00012   PulseAudio is free software; you can redistribute it and/or modify
00013   it under the terms of the GNU Lesser General Public License as published
00014   by the Free Software Foundation; either version 2 of the License,
00015   or (at your option) any later version.
00016 
00017   PulseAudio is distributed in the hope that it will be useful, but
00018   WITHOUT ANY WARRANTY; without even the implied warranty of
00019   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
00020   General Public License for more details.
00021 
00022   You should have received a copy of the GNU Lesser General Public License
00023   along with PulseAudio; if not, write to the Free Software
00024   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
00025   USA.
00026 ***/
00027 
00028 #include <sys/types.h>
00029 
00030 #include <pulse/sample.h>
00031 #include <pulse/channelmap.h>
00032 #include <pulse/volume.h>
00033 #include <pulse/def.h>
00034 #include <pulse/cdecl.h>
00035 #include <pulse/operation.h>
00036 
00265 PA_C_DECL_BEGIN
00266 
00268 typedef struct pa_stream pa_stream;
00269 
00271 typedef void (*pa_stream_success_cb_t) (pa_stream*s, int success, void *userdata);
00272 
00274 typedef void (*pa_stream_request_cb_t)(pa_stream *p, size_t length, void *userdata);
00275 
00277 typedef void (*pa_stream_notify_cb_t)(pa_stream *p, void *userdata);
00278 
00280 pa_stream* pa_stream_new(
00281         pa_context *c                     ,
00282         const char *name                  ,
00283         const pa_sample_spec *ss          ,
00284         const pa_channel_map *map         );
00285 
00287 void pa_stream_unref(pa_stream *s);
00288 
00290 pa_stream *pa_stream_ref(pa_stream *s);
00291 
00293 pa_stream_state_t pa_stream_get_state(pa_stream *p);
00294 
00296 pa_context* pa_stream_get_context(pa_stream *p);
00297 
00299 uint32_t pa_stream_get_index(pa_stream *s);
00300 
00302 int pa_stream_connect_playback(
00303         pa_stream *s                  ,
00304         const char *dev                ,
00305         const pa_buffer_attr *attr    ,
00306         pa_stream_flags_t flags       ,
00307         pa_cvolume *volume            ,
00308         pa_stream *sync_stream        );
00309 
00311 int pa_stream_connect_record(
00312         pa_stream *s                   ,
00313         const char *dev               ,
00314         const pa_buffer_attr *attr    ,
00315         pa_stream_flags_t flags       );
00316 
00318 int pa_stream_disconnect(pa_stream *s);
00319 
00327 int pa_stream_write(
00328         pa_stream *p             ,
00329         const void *data         ,
00330         size_t length            ,
00331         pa_free_cb_t free_cb     ,
00332         int64_t offset,          
00333         pa_seek_mode_t seek      );
00334 
00340 int pa_stream_peek(
00341         pa_stream *p                 ,
00342         const void **data            ,
00343         size_t *length              );
00344 
00347 int pa_stream_drop(pa_stream *p);
00348 
00350 size_t pa_stream_writable_size(pa_stream *p);
00351 
00353 size_t pa_stream_readable_size(pa_stream *p);
00354 
00356 pa_operation* pa_stream_drain(pa_stream *s, pa_stream_success_cb_t cb, void *userdata);
00357 
00362 pa_operation* pa_stream_update_timing_info(pa_stream *p, pa_stream_success_cb_t cb, void *userdata);
00363 
00365 void pa_stream_set_state_callback(pa_stream *s, pa_stream_notify_cb_t cb, void *userdata);
00366 
00369 void pa_stream_set_write_callback(pa_stream *p, pa_stream_request_cb_t cb, void *userdata);
00370 
00373 void pa_stream_set_read_callback(pa_stream *p, pa_stream_request_cb_t cb, void *userdata);
00374 
00376 void pa_stream_set_overflow_callback(pa_stream *p, pa_stream_notify_cb_t cb, void *userdata);
00377 
00379 void pa_stream_set_underflow_callback(pa_stream *p, pa_stream_notify_cb_t cb, void *userdata);
00380 
00382 void pa_stream_set_latency_update_callback(pa_stream *p, pa_stream_notify_cb_t cb, void *userdata);
00383 
00385 pa_operation* pa_stream_cork(pa_stream *s, int b, pa_stream_success_cb_t cb, void *userdata);
00386 
00390 pa_operation* pa_stream_flush(pa_stream *s, pa_stream_success_cb_t cb, void *userdata);
00391 
00394 pa_operation* pa_stream_prebuf(pa_stream *s, pa_stream_success_cb_t cb, void *userdata);
00395 
00399 pa_operation* pa_stream_trigger(pa_stream *s, pa_stream_success_cb_t cb, void *userdata);
00400 
00402 pa_operation* pa_stream_set_name(pa_stream *s, const char *name, pa_stream_success_cb_t cb, void *userdata);
00403 
00419 int pa_stream_get_time(pa_stream *s, pa_usec_t *r_usec);
00420 
00425 int pa_stream_get_latency(pa_stream *s, pa_usec_t *r_usec, int *negative);
00426 
00437 const pa_timing_info* pa_stream_get_timing_info(pa_stream *s);
00438 
00440 const pa_sample_spec* pa_stream_get_sample_spec(pa_stream *s);
00441 
00443 const pa_channel_map* pa_stream_get_channel_map(pa_stream *s);
00444 
00448 const pa_buffer_attr* pa_stream_get_buffer_attr(pa_stream *s);
00449 
00450 PA_C_DECL_END
00451 
00452 #endif

Generated on Wed Jan 23 11:06:29 2008 for PulseAudio by  doxygen 1.5.4