stream.h

Go to the documentation of this file.
00001 #ifndef foostreamhfoo
00002 #define foostreamhfoo
00003 
00004 /* $Id: stream.h 1036 2006-06-19 22:11:49Z lennart $ */
00005 
00006 /***
00007   This file is part of PulseAudio.
00008  
00009   PulseAudio is free software; you can redistribute it and/or modify
00010   it under the terms of the GNU Lesser General Public License as published
00011   by the Free Software Foundation; either version 2 of the License,
00012   or (at your option) any later version.
00013  
00014   PulseAudio is distributed in the hope that it will be useful, but
00015   WITHOUT ANY WARRANTY; without even the implied warranty of
00016   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
00017   General Public License for more details.
00018  
00019   You should have received a copy of the GNU Lesser General Public License
00020   along with PulseAudio; if not, write to the Free Software
00021   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
00022   USA.
00023 ***/
00024 
00025 #include <sys/types.h>
00026 
00027 #include <pulse/sample.h>
00028 #include <pulse/channelmap.h>
00029 #include <pulse/volume.h>
00030 #include <pulse/def.h>
00031 #include <pulse/cdecl.h>
00032 #include <pulse/operation.h>
00033 
00262 PA_C_DECL_BEGIN
00263 
00265 typedef struct pa_stream pa_stream;
00266 
00268 typedef void (*pa_stream_success_cb_t) (pa_stream*s, int success, void *userdata);
00269 
00271 typedef void (*pa_stream_request_cb_t)(pa_stream *p, size_t length, void *userdata);
00272 
00274 typedef void (*pa_stream_notify_cb_t)(pa_stream *p, void *userdata);
00275 
00277 pa_stream* pa_stream_new(
00278         pa_context *c                     ,             
00279         const char *name                  ,
00280         const pa_sample_spec *ss          ,
00281         const pa_channel_map *map         );
00282 
00284 void pa_stream_unref(pa_stream *s);
00285 
00287 pa_stream *pa_stream_ref(pa_stream *s);
00288 
00290 pa_stream_state_t pa_stream_get_state(pa_stream *p);
00291 
00293 pa_context* pa_stream_get_context(pa_stream *p);
00294 
00296 uint32_t pa_stream_get_index(pa_stream *s);
00297 
00299 int pa_stream_connect_playback(
00300         pa_stream *s                  ,
00301         const char *dev                ,
00302         const pa_buffer_attr *attr    ,
00303         pa_stream_flags_t flags       ,
00304         pa_cvolume *volume            ,
00305         pa_stream *sync_stream        );
00306 
00308 int pa_stream_connect_record(
00309         pa_stream *s                   ,
00310         const char *dev               ,
00311         const pa_buffer_attr *attr    ,
00312         pa_stream_flags_t flags       );
00313 
00315 int pa_stream_disconnect(pa_stream *s);
00316 
00324 int pa_stream_write(
00325         pa_stream *p             ,
00326         const void *data         ,
00327         size_t length            ,
00328         pa_free_cb_t free_cb     ,
00329         int64_t offset,          
00330         pa_seek_mode_t seek      );
00331 
00337 int pa_stream_peek(
00338         pa_stream *p                 ,
00339         const void **data            ,
00340         size_t *length              );
00341 
00344 int pa_stream_drop(pa_stream *p);
00345 
00347 size_t pa_stream_writable_size(pa_stream *p);
00348 
00350 size_t pa_stream_readable_size(pa_stream *p);
00351 
00353 pa_operation* pa_stream_drain(pa_stream *s, pa_stream_success_cb_t cb, void *userdata);
00354 
00359 pa_operation* pa_stream_update_timing_info(pa_stream *p, pa_stream_success_cb_t cb, void *userdata);
00360 
00362 void pa_stream_set_state_callback(pa_stream *s, pa_stream_notify_cb_t cb, void *userdata);
00363 
00366 void pa_stream_set_write_callback(pa_stream *p, pa_stream_request_cb_t cb, void *userdata);
00367 
00370 void pa_stream_set_read_callback(pa_stream *p, pa_stream_request_cb_t cb, void *userdata);
00371 
00373 void pa_stream_set_overflow_callback(pa_stream *p, pa_stream_notify_cb_t cb, void *userdata);
00374 
00376 void pa_stream_set_underflow_callback(pa_stream *p, pa_stream_notify_cb_t cb, void *userdata);
00377 
00379 void pa_stream_set_latency_update_callback(pa_stream *p, pa_stream_notify_cb_t cb, void *userdata);
00380 
00382 pa_operation* pa_stream_cork(pa_stream *s, int b, pa_stream_success_cb_t cb, void *userdata);
00383 
00387 pa_operation* pa_stream_flush(pa_stream *s, pa_stream_success_cb_t cb, void *userdata);
00388 
00391 pa_operation* pa_stream_prebuf(pa_stream *s, pa_stream_success_cb_t cb, void *userdata);
00392 
00396 pa_operation* pa_stream_trigger(pa_stream *s, pa_stream_success_cb_t cb, void *userdata);
00397 
00399 pa_operation* pa_stream_set_name(pa_stream *s, const char *name, pa_stream_success_cb_t cb, void *userdata);
00400 
00416 int pa_stream_get_time(pa_stream *s, pa_usec_t *r_usec);
00417 
00422 int pa_stream_get_latency(pa_stream *s, pa_usec_t *r_usec, int *negative);
00423 
00434 const pa_timing_info* pa_stream_get_timing_info(pa_stream *s);
00435 
00437 const pa_sample_spec* pa_stream_get_sample_spec(pa_stream *s);
00438 
00440 const pa_channel_map* pa_stream_get_channel_map(pa_stream *s);
00441 
00445 const pa_buffer_attr* pa_stream_get_buffer_attr(pa_stream *s);
00446 
00447 PA_C_DECL_END
00448 
00449 #endif

Generated on Wed May 30 19:36:31 2007 for PulseAudio by  doxygen 1.5.1