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 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 
00313 PA_C_DECL_BEGIN
00314 
00316 typedef struct pa_stream pa_stream;
00317 
00319 typedef void (*pa_stream_success_cb_t) (pa_stream*s, int success, void *userdata);
00320 
00322 typedef void (*pa_stream_request_cb_t)(pa_stream *p, size_t bytes, void *userdata);
00323 
00325 typedef void (*pa_stream_notify_cb_t)(pa_stream *p, void *userdata);
00326 
00330 pa_stream* pa_stream_new(
00331         pa_context *c                     ,
00332         const char *name                  ,
00333         const pa_sample_spec *ss          ,
00334         const pa_channel_map *map         );
00335 
00339 pa_stream* pa_stream_new_with_proplist(
00340         pa_context *c                     ,
00341         const char *name                  ,
00342         const pa_sample_spec *ss          ,
00343         const pa_channel_map *map         ,
00344         pa_proplist *p                    );
00345 
00347 void pa_stream_unref(pa_stream *s);
00348 
00350 pa_stream *pa_stream_ref(pa_stream *s);
00351 
00353 pa_stream_state_t pa_stream_get_state(pa_stream *p);
00354 
00356 pa_context* pa_stream_get_context(pa_stream *p);
00357 
00362 uint32_t pa_stream_get_index(pa_stream *s);
00363 
00372 uint32_t pa_stream_get_device_index(pa_stream *s);
00373 
00382 const char *pa_stream_get_device_name(pa_stream *s);
00383 
00388 int pa_stream_is_suspended(pa_stream *s);
00389 
00392 int pa_stream_is_corked(pa_stream *s);
00393 
00395 int pa_stream_connect_playback(
00396         pa_stream *s                  ,
00397         const char *dev                ,
00398         const pa_buffer_attr *attr    ,
00399         pa_stream_flags_t flags       ,
00400         pa_cvolume *volume            ,
00401         pa_stream *sync_stream        );
00402 
00404 int pa_stream_connect_record(
00405         pa_stream *s                   ,
00406         const char *dev               ,
00407         const pa_buffer_attr *attr    ,
00408         pa_stream_flags_t flags       );
00409 
00411 int pa_stream_disconnect(pa_stream *s);
00412 
00420 int pa_stream_write(
00421         pa_stream *p             ,
00422         const void *data         ,
00423         size_t nbytes            ,
00424         pa_free_cb_t free_cb     ,
00425         int64_t offset,          
00426         pa_seek_mode_t seek      );
00427 
00433 int pa_stream_peek(
00434         pa_stream *p                 ,
00435         const void **data            ,
00436         size_t *nbytes               );
00437 
00440 int pa_stream_drop(pa_stream *p);
00441 
00443 size_t pa_stream_writable_size(pa_stream *p);
00444 
00446 size_t pa_stream_readable_size(pa_stream *p);
00447 
00449 pa_operation* pa_stream_drain(pa_stream *s, pa_stream_success_cb_t cb, void *userdata);
00450 
00455 pa_operation* pa_stream_update_timing_info(pa_stream *p, pa_stream_success_cb_t cb, void *userdata);
00456 
00458 void pa_stream_set_state_callback(pa_stream *s, pa_stream_notify_cb_t cb, void *userdata);
00459 
00462 void pa_stream_set_write_callback(pa_stream *p, pa_stream_request_cb_t cb, void *userdata);
00463 
00466 void pa_stream_set_read_callback(pa_stream *p, pa_stream_request_cb_t cb, void *userdata);
00467 
00469 void pa_stream_set_overflow_callback(pa_stream *p, pa_stream_notify_cb_t cb, void *userdata);
00470 
00472 void pa_stream_set_underflow_callback(pa_stream *p, pa_stream_notify_cb_t cb, void *userdata);
00473 
00479 void pa_stream_set_started_callback(pa_stream *p, pa_stream_notify_cb_t cb, void *userdata);
00480 
00484 void pa_stream_set_latency_update_callback(pa_stream *p, pa_stream_notify_cb_t cb, void *userdata);
00485 
00491 void pa_stream_set_moved_callback(pa_stream *p, pa_stream_notify_cb_t cb, void *userdata);
00492 
00501 void pa_stream_set_suspended_callback(pa_stream *p, pa_stream_notify_cb_t cb, void *userdata);
00502 
00504 pa_operation* pa_stream_cork(pa_stream *s, int b, pa_stream_success_cb_t cb, void *userdata);
00505 
00510 pa_operation* pa_stream_flush(pa_stream *s, pa_stream_success_cb_t cb, void *userdata);
00511 
00514 pa_operation* pa_stream_prebuf(pa_stream *s, pa_stream_success_cb_t cb, void *userdata);
00515 
00519 pa_operation* pa_stream_trigger(pa_stream *s, pa_stream_success_cb_t cb, void *userdata);
00520 
00522 pa_operation* pa_stream_set_name(pa_stream *s, const char *name, pa_stream_success_cb_t cb, void *userdata);
00523 
00539 int pa_stream_get_time(pa_stream *s, pa_usec_t *r_usec);
00540 
00545 int pa_stream_get_latency(pa_stream *s, pa_usec_t *r_usec, int *negative);
00546 
00557 const pa_timing_info* pa_stream_get_timing_info(pa_stream *s);
00558 
00560 const pa_sample_spec* pa_stream_get_sample_spec(pa_stream *s);
00561 
00563 const pa_channel_map* pa_stream_get_channel_map(pa_stream *s);
00564 
00573 const pa_buffer_attr* pa_stream_get_buffer_attr(pa_stream *s);
00574 
00583 pa_operation *pa_stream_set_buffer_attr(pa_stream *s, const pa_buffer_attr *attr, pa_stream_success_cb_t cb, void *userdata);
00584 
00590 pa_operation *pa_stream_update_sample_rate(pa_stream *s, uint32_t rate, pa_stream_success_cb_t cb, void *userdata);
00591 
00598 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);
00599 
00602 pa_operation *pa_stream_proplist_remove(pa_stream *s, const char *const keys[], pa_stream_success_cb_t cb, void *userdata);
00603 
00608 int pa_stream_set_monitor_stream(pa_stream *s, uint32_t sink_input_idx);
00609 
00612 uint32_t pa_stream_get_monitor_stream(pa_stream *s);
00613 
00614 PA_C_DECL_END
00615 
00616 #endif

Generated on Tue Sep 16 10:58:58 2008 for PulseAudio by  doxygen 1.5.4