PulseAudio  3.0
stream.h
Go to the documentation of this file.
1 #ifndef foostreamhfoo
2 #define foostreamhfoo
3 
4 /***
5  This file is part of PulseAudio.
6 
7  Copyright 2004-2006 Lennart Poettering
8  Copyright 2006 Pierre Ossman <ossman@cendio.se> for Cendio AB
9 
10  PulseAudio is free software; you can redistribute it and/or modify
11  it under the terms of the GNU Lesser General Public License as published
12  by the Free Software Foundation; either version 2.1 of the License,
13  or (at your option) any later version.
14 
15  PulseAudio is distributed in the hope that it will be useful, but
16  WITHOUT ANY WARRANTY; without even the implied warranty of
17  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18  General Public License for more details.
19 
20  You should have received a copy of the GNU Lesser General Public License
21  along with PulseAudio; if not, write to the Free Software
22  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
23  USA.
24 ***/
25 
26 #include <sys/types.h>
27 
28 #include <pulse/sample.h>
29 #include <pulse/format.h>
30 #include <pulse/channelmap.h>
31 #include <pulse/volume.h>
32 #include <pulse/def.h>
33 #include <pulse/cdecl.h>
34 #include <pulse/operation.h>
35 #include <pulse/context.h>
36 #include <pulse/proplist.h>
37 
319 PA_C_DECL_BEGIN
320 
322 typedef struct pa_stream pa_stream;
323 
325 typedef void (*pa_stream_success_cb_t) (pa_stream*s, int success, void *userdata);
326 
328 typedef void (*pa_stream_request_cb_t)(pa_stream *p, size_t nbytes, void *userdata);
329 
331 typedef void (*pa_stream_notify_cb_t)(pa_stream *p, void *userdata);
332 
339 typedef void (*pa_stream_event_cb_t)(pa_stream *p, const char *name, pa_proplist *pl, void *userdata);
340 
345  pa_context *c ,
346  const char *name ,
347  const pa_sample_spec *ss ,
348  const pa_channel_map *map );
349 
354  pa_context *c ,
355  const char *name ,
356  const pa_sample_spec *ss ,
357  const pa_channel_map *map ,
358  pa_proplist *p );
359 
365  pa_context *c ,
366  const char *name ,
367  pa_format_info * const * formats ,
368  unsigned int n_formats ,
369  pa_proplist *p );
370 
372 void pa_stream_unref(pa_stream *s);
373 
376 
379 
382 
387 uint32_t pa_stream_get_index(pa_stream *s);
388 
399 
409 const char *pa_stream_get_device_name(pa_stream *s);
410 
416 
420 
440  pa_stream *s ,
441  const char *dev ,
442  const pa_buffer_attr *attr ,
443  pa_stream_flags_t flags ,
444  const pa_cvolume *volume ,
445  pa_stream *sync_stream );
446 
449  pa_stream *s ,
450  const char *dev ,
451  const pa_buffer_attr *attr ,
452  pa_stream_flags_t flags );
453 
456 
490  pa_stream *p,
491  void **data,
492  size_t *nbytes);
493 
504  pa_stream *p);
505 
528 int pa_stream_write(
529  pa_stream *p ,
530  const void *data ,
531  size_t nbytes ,
532  pa_free_cb_t free_cb ,
533  int64_t offset,
534  pa_seek_mode_t seek );
535 
552 int pa_stream_peek(
553  pa_stream *p ,
554  const void **data ,
555  size_t *nbytes );
556 
559 int pa_stream_drop(pa_stream *p);
560 
563 
566 
572 
578 
581 
585 
588 
591 
597 
600 
607 
612 
619 
629 
632 void pa_stream_set_event_callback(pa_stream *p, pa_stream_event_cb_t cb, void *userdata);
633 
640 
651 pa_operation* pa_stream_cork(pa_stream *s, int b, pa_stream_success_cb_t cb, void *userdata);
652 
658 
662 
667 
669 pa_operation* pa_stream_set_name(pa_stream *s, const char *name, pa_stream_success_cb_t cb, void *userdata);
670 
702 int pa_stream_get_time(pa_stream *s, pa_usec_t *r_usec);
703 
716 int pa_stream_get_latency(pa_stream *s, pa_usec_t *r_usec, int *negative);
717 
733 
736 
739 
742 
752 
762 
768 pa_operation *pa_stream_update_sample_rate(pa_stream *s, uint32_t rate, pa_stream_success_cb_t cb, void *userdata);
769 
777 
780 pa_operation *pa_stream_proplist_remove(pa_stream *s, const char *const keys[], pa_stream_success_cb_t cb, void *userdata);
781 
786 int pa_stream_set_monitor_stream(pa_stream *s, uint32_t sink_input_idx);
787 
792 
793 PA_C_DECL_END
794 
795 #endif