PortAudio  2.0
pa_linux_pulseaudio_block_internal.h
Go to the documentation of this file.
1 
2 /*
3  * PulseAudio host to play natively in Linux based systems without
4  * ALSA emulation
5  *
6  * Copyright (c) 2014-2023 Tuukka Pasanen <tuukka.pasanen@ilmi.fi>
7  * Copyright (c) 2016 Sqweek
8  *
9  * Based on the Open Source API proposed by Ross Bencina
10  * Copyright (c) 1999-2002 Ross Bencina, Phil Burk
11  *
12  * Permission is hereby granted, free of charge, to any person obtaining
13  * a copy of this software and associated documentation files
14  * (the "Software"), to deal in the Software without restriction,
15  * including without limitation the rights to use, copy, modify, merge,
16  * publish, distribute, sublicense, and/or sell copies of the Software,
17  * and to permit persons to whom the Software is furnished to do so,
18  * subject to the following conditions:
19  *
20  * The above copyright notice and this permission notice shall be
21  * included in all copies or substantial portions of the Software.
22  *
23  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
24  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
25  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
26  * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
27  * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
28  * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
29  * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
30  */
31 
32 /*
33  * The text above constitutes the entire PortAudio license; however,
34  * the PortAudio community also makes the following non-binding requests:
35  *
36  * Any person wishing to distribute modifications to the Software is
37  * requested to send the modifications to the original developer so that
38  * they can be incorporated into the canonical version. It is also
39  * requested that these non-binding requests be included along with the
40  * license above.
41  */
42 
43 #ifndef _PA_HOSTAPI_PULSEAUDIO_BLOCK_H_
44 #define _PA_HOSTAPI_PULSEAUDIO_BLOCK_H_
45 
46 #include "pa_util.h"
47 #include "pa_allocation.h"
48 #include "pa_hostapi.h"
49 #include "pa_stream.h"
50 #include "pa_cpuload.h"
51 #include "pa_process.h"
52 
53 #include "pa_unix_util.h"
54 #include "pa_ringbuffer.h"
55 
56 /* PulseAudio headers */
57 #include <stdio.h>
58 #include <string.h>
59 #include <pulse/pulseaudio.h>
60 
62 
63 #ifdef __cplusplus
64 extern "C"
65 {
66 #endif /* __cplusplus */
67 
69 
71 
73 
75 
77  void *buffer,
78  unsigned long frames );
79 
81  const void *buffer,
82  unsigned long frames );
83 
85 
86 #ifdef __cplusplus
87 }
88 #endif /* __cplusplus */
89 
90 
91 #endif
Single-reader single-writer lock-free ring buffer.
PaError PaPulseAudio_StartStreamBlock(PaStream *stream)
PaError PaPulseAudio_CloseStreamBlock(PaStream *stream)
void PaStream
Definition: portaudio.h:644
PaError PaPulseAudio_WriteStreamBlock(PaStream *s, const void *buffer, unsigned long frames)
Definition: pa_linux_pulseaudio_block.c:98
signed long PaPulseAudio_GetStreamReadAvailableBlock(PaStream *s)
Definition: pa_linux_pulseaudio_block.c:186
PaError PaPulseAudio_StopStreamBlock(PaStream *stream)
Buffer Processor prototypes. A Buffer Processor performs buffer length adaption, coordinates sample f...
PaError PaPulseAudio_ReadStreamBlock(PaStream *s, void *buffer, unsigned long frames)
Definition: pa_linux_pulseaudio_block.c:61
Allocation Group prototypes. An Allocation Group makes it easy to allocate multiple blocks of memory ...
Interfaces and representation structures used by pa_front.c to manage and communicate with host API i...
Stream interfaces, representation structures and helper functions used to interface between pa_front...
int PaError
Definition: portaudio.h:122
Prototypes for utility functions used by PortAudio implementations.
PaError PaPulseAudio_AbortStreamBlock(PaStream *stream)
char buffer[NUM_BYTES]
Definition: recplay.c:26
Functions to assist in measuring the CPU utilization of a callback stream. Used to implement the Pa_G...