• Main Page
  • Related Pages
  • Data Structures
  • Files
  • Examples
  • File List
  • Globals

stream.h

Go to the documentation of this file.
00001 #ifndef foostreamhfoo
00002 #define foostreamhfoo
00003 
00004 /***
00005   This file is part of PulseAudio.
00006 
00007   Copyright 2004-2006 Lennart Poettering
00008   Copyright 2006 Pierre Ossman <ossman@cendio.se> for Cendio AB
00009 
00010   PulseAudio is free software; you can redistribute it and/or modify
00011   it under the terms of the GNU Lesser General Public License as published
00012   by the Free Software Foundation; either version 2.1 of the License,
00013   or (at your option) any later version.
00014 
00015   PulseAudio is distributed in the hope that it will be useful, but
00016   WITHOUT ANY WARRANTY; without even the implied warranty of
00017   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
00018   General Public License for more details.
00019 
00020   You should have received a copy of the GNU Lesser General Public License
00021   along with PulseAudio; if not, write to the Free Software
00022   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
00023   USA.
00024 ***/
00025 
00026 #include <sys/types.h>
00027 
00028 #include <pulse/sample.h>
00029 #include <pulse/channelmap.h>
00030 #include <pulse/volume.h>
00031 #include <pulse/def.h>
00032 #include <pulse/cdecl.h>
00033 #include <pulse/operation.h>
00034 #include <pulse/context.h>
00035 #include <pulse/proplist.h>
00036 
00315 PA_C_DECL_BEGIN
00316 
00318 typedef struct pa_stream pa_stream;
00319 
00321 typedef void (*pa_stream_success_cb_t) (pa_stream*s, int success, void *userdata);
00322 
00324 typedef void (*pa_stream_request_cb_t)(pa_stream *p, size_t nbytes, void *userdata);
00325 
00327 typedef void (*pa_stream_notify_cb_t)(pa_stream *p, void *userdata);
00328 
00335 typedef void (*pa_stream_event_cb_t)(pa_stream *p, const char *name, pa_proplist *pl, void *userdata);
00336 
00340 pa_stream* pa_stream_new(
00341         pa_context *c                     ,
00342         const char *name                  ,
00343         const pa_sample_spec *ss          ,
00344         const pa_channel_map *map         );
00345 
00349 pa_stream* pa_stream_new_with_proplist(
00350         pa_context *c                     ,
00351         const char *name                  ,
00352         const pa_sample_spec *ss          ,
00353         const pa_channel_map *map         ,
00354         pa_proplist *p                    );
00355 
00357 void pa_stream_unref(pa_stream *s);
00358 
00360 pa_stream *pa_stream_ref(pa_stream *s);
00361 
00363 pa_stream_state_t pa_stream_get_state(pa_stream *p);
00364 
00366 pa_context* pa_stream_get_context(pa_stream *p);
00367 
00372 uint32_t pa_stream_get_index(pa_stream *s);
00373 
00382 uint32_t pa_stream_get_device_index(pa_stream *s);
00383 
00392 const char *pa_stream_get_device_name(pa_stream *s);
00393 
00398 int pa_stream_is_suspended(pa_stream *s);
00399 
00402 int pa_stream_is_corked(pa_stream *s);
00403 
00420 int pa_stream_connect_playback(
00421         pa_stream *s                  ,
00422         const char *dev                ,
00423         const pa_buffer_attr *attr    ,
00424         pa_stream_flags_t flags       ,
00425         const pa_cvolume *volume      ,
00426         pa_stream *sync_stream        );
00427 
00429 int pa_stream_connect_record(
00430         pa_stream *s                   ,
00431         const char *dev               ,
00432         const pa_buffer_attr *attr    ,
00433         pa_stream_flags_t flags       );
00434 
00436 int pa_stream_disconnect(pa_stream *s);
00437 
00466 int pa_stream_begin_write(
00467         pa_stream *p,
00468         void **data,
00469         size_t *nbytes);
00470 
00480 int pa_stream_cancel_write(
00481         pa_stream *p);
00482 
00503 int pa_stream_write(
00504         pa_stream *p             ,
00505         const void *data         ,
00506         size_t nbytes            ,
00507         pa_free_cb_t free_cb     ,
00508         int64_t offset,          
00509         pa_seek_mode_t seek      );
00510 
00517 int pa_stream_peek(
00518         pa_stream *p                 ,
00519         const void **data            ,
00520         size_t *nbytes               );
00521 
00524 int pa_stream_drop(pa_stream *p);
00525 
00527 size_t pa_stream_writable_size(pa_stream *p);
00528 
00530 size_t pa_stream_readable_size(pa_stream *p);
00531 
00535 pa_operation* pa_stream_drain(pa_stream *s, pa_stream_success_cb_t cb, void *userdata);
00536 
00541 pa_operation* pa_stream_update_timing_info(pa_stream *p, pa_stream_success_cb_t cb, void *userdata);
00542 
00544 void pa_stream_set_state_callback(pa_stream *s, pa_stream_notify_cb_t cb, void *userdata);
00545 
00548 void pa_stream_set_write_callback(pa_stream *p, pa_stream_request_cb_t cb, void *userdata);
00549 
00552 void pa_stream_set_read_callback(pa_stream *p, pa_stream_request_cb_t cb, void *userdata);
00553 
00555 void pa_stream_set_overflow_callback(pa_stream *p, pa_stream_notify_cb_t cb, void *userdata);
00556 
00558 void pa_stream_set_underflow_callback(pa_stream *p, pa_stream_notify_cb_t cb, void *userdata);
00559 
00565 void pa_stream_set_started_callback(pa_stream *p, pa_stream_notify_cb_t cb, void *userdata);
00566 
00570 void pa_stream_set_latency_update_callback(pa_stream *p, pa_stream_notify_cb_t cb, void *userdata);
00571 
00577 void pa_stream_set_moved_callback(pa_stream *p, pa_stream_notify_cb_t cb, void *userdata);
00578 
00587 void pa_stream_set_suspended_callback(pa_stream *p, pa_stream_notify_cb_t cb, void *userdata);
00588 
00591 void pa_stream_set_event_callback(pa_stream *p, pa_stream_event_cb_t cb, void *userdata);
00592 
00598 void pa_stream_set_buffer_attr_callback(pa_stream *p, pa_stream_notify_cb_t cb, void *userdata);
00599 
00610 pa_operation* pa_stream_cork(pa_stream *s, int b, pa_stream_success_cb_t cb, void *userdata);
00611 
00616 pa_operation* pa_stream_flush(pa_stream *s, pa_stream_success_cb_t cb, void *userdata);
00617 
00620 pa_operation* pa_stream_prebuf(pa_stream *s, pa_stream_success_cb_t cb, void *userdata);
00621 
00625 pa_operation* pa_stream_trigger(pa_stream *s, pa_stream_success_cb_t cb, void *userdata);
00626 
00628 pa_operation* pa_stream_set_name(pa_stream *s, const char *name, pa_stream_success_cb_t cb, void *userdata);
00629 
00661 int pa_stream_get_time(pa_stream *s, pa_usec_t *r_usec);
00662 
00673 int pa_stream_get_latency(pa_stream *s, pa_usec_t *r_usec, int *negative);
00674 
00689 const pa_timing_info* pa_stream_get_timing_info(pa_stream *s);
00690 
00692 const pa_sample_spec* pa_stream_get_sample_spec(pa_stream *s);
00693 
00695 const pa_channel_map* pa_stream_get_channel_map(pa_stream *s);
00696 
00705 const pa_buffer_attr* pa_stream_get_buffer_attr(pa_stream *s);
00706 
00715 pa_operation *pa_stream_set_buffer_attr(pa_stream *s, const pa_buffer_attr *attr, pa_stream_success_cb_t cb, void *userdata);
00716 
00722 pa_operation *pa_stream_update_sample_rate(pa_stream *s, uint32_t rate, pa_stream_success_cb_t cb, void *userdata);
00723 
00730 pa_operation *pa_stream_proplist_update(pa_stream *s, pa_update_mode_t mode, pa_proplist *p, pa_stream_success_cb_t cb, void *userdata);
00731 
00734 pa_operation *pa_stream_proplist_remove(pa_stream *s, const char *const keys[], pa_stream_success_cb_t cb, void *userdata);
00735 
00740 int pa_stream_set_monitor_stream(pa_stream *s, uint32_t sink_input_idx);
00741 
00744 uint32_t pa_stream_get_monitor_stream(pa_stream *s);
00745 
00746 PA_C_DECL_END
00747 
00748 #endif

Generated on Mon Aug 23 2010 00:25:21 for PulseAudio by  doxygen 1.7.1