annotate src/audio/pulse/SDL_pulseaudio.h @ 4001:6831b8723a85 SDL-1.2

Don't initialize the audio buffer passed to the application's audio callback, since they are expected to entirely fill it with data or silence. For legacy apps that might expect the buffer to already have silence and thus may not fill the buffer in the callback, there's an environment variable to expose the old behaviour. Fixes Bugzilla #416.
author Ryan C. Gordon <icculus@icculus.org>
date Thu, 05 Jul 2007 02:24:36 +0000
parents 42e83d81224b
children a1b03ba2fcd0
rev   line source
3939
42e83d81224b Committed PulseAudio driver. Thanks, Stephan!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
1 /*
42e83d81224b Committed PulseAudio driver. Thanks, Stephan!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
2 SDL - Simple DirectMedia Layer
42e83d81224b Committed PulseAudio driver. Thanks, Stephan!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
3 Copyright (C) 1997-2007 Sam Lantinga
42e83d81224b Committed PulseAudio driver. Thanks, Stephan!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
4
42e83d81224b Committed PulseAudio driver. Thanks, Stephan!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
5 This library is free software; you can redistribute it and/or
42e83d81224b Committed PulseAudio driver. Thanks, Stephan!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
6 modify it under the terms of the GNU Lesser General Public
42e83d81224b Committed PulseAudio driver. Thanks, Stephan!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
7 License as published by the Free Software Foundation; either
42e83d81224b Committed PulseAudio driver. Thanks, Stephan!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
8 version 2.1 of the License, or (at your option) any later version.
42e83d81224b Committed PulseAudio driver. Thanks, Stephan!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
9
42e83d81224b Committed PulseAudio driver. Thanks, Stephan!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
10 This library is distributed in the hope that it will be useful,
42e83d81224b Committed PulseAudio driver. Thanks, Stephan!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
42e83d81224b Committed PulseAudio driver. Thanks, Stephan!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
42e83d81224b Committed PulseAudio driver. Thanks, Stephan!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
13 Lesser General Public License for more details.
42e83d81224b Committed PulseAudio driver. Thanks, Stephan!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
14
42e83d81224b Committed PulseAudio driver. Thanks, Stephan!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
15 You should have received a copy of the GNU Lesser General Public
42e83d81224b Committed PulseAudio driver. Thanks, Stephan!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
16 License along with this library; if not, write to the Free Software
42e83d81224b Committed PulseAudio driver. Thanks, Stephan!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
17 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
42e83d81224b Committed PulseAudio driver. Thanks, Stephan!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
18
42e83d81224b Committed PulseAudio driver. Thanks, Stephan!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
19 Stéphan Kochen
42e83d81224b Committed PulseAudio driver. Thanks, Stephan!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
20 stephan@kochen.nl
42e83d81224b Committed PulseAudio driver. Thanks, Stephan!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
21
42e83d81224b Committed PulseAudio driver. Thanks, Stephan!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
22 Based on parts of the ALSA and ESounD output drivers.
42e83d81224b Committed PulseAudio driver. Thanks, Stephan!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
23 */
42e83d81224b Committed PulseAudio driver. Thanks, Stephan!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
24 #include "SDL_config.h"
42e83d81224b Committed PulseAudio driver. Thanks, Stephan!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
25
42e83d81224b Committed PulseAudio driver. Thanks, Stephan!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
26 #ifndef _SDL_pulseaudio_h
42e83d81224b Committed PulseAudio driver. Thanks, Stephan!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
27 #define _SDL_pulseaudio_h
42e83d81224b Committed PulseAudio driver. Thanks, Stephan!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
28
42e83d81224b Committed PulseAudio driver. Thanks, Stephan!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
29 #include "../SDL_sysaudio.h"
42e83d81224b Committed PulseAudio driver. Thanks, Stephan!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
30
42e83d81224b Committed PulseAudio driver. Thanks, Stephan!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
31 /* Hidden "this" pointer for the video functions */
42e83d81224b Committed PulseAudio driver. Thanks, Stephan!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
32 #define _THIS SDL_AudioDevice *this
42e83d81224b Committed PulseAudio driver. Thanks, Stephan!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
33
42e83d81224b Committed PulseAudio driver. Thanks, Stephan!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
34 struct SDL_PrivateAudioData {
42e83d81224b Committed PulseAudio driver. Thanks, Stephan!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
35 /* The audio stream handle */
42e83d81224b Committed PulseAudio driver. Thanks, Stephan!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
36 pa_simple * stream;
42e83d81224b Committed PulseAudio driver. Thanks, Stephan!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
37
42e83d81224b Committed PulseAudio driver. Thanks, Stephan!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
38 /* The parent process id, to detect when application quits */
42e83d81224b Committed PulseAudio driver. Thanks, Stephan!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
39 pid_t parent;
42e83d81224b Committed PulseAudio driver. Thanks, Stephan!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
40
42e83d81224b Committed PulseAudio driver. Thanks, Stephan!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
41 /* Raw mixing buffer */
42e83d81224b Committed PulseAudio driver. Thanks, Stephan!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
42 Uint8 *mixbuf;
42e83d81224b Committed PulseAudio driver. Thanks, Stephan!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
43 int mixlen;
42e83d81224b Committed PulseAudio driver. Thanks, Stephan!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
44 };
42e83d81224b Committed PulseAudio driver. Thanks, Stephan!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
45
42e83d81224b Committed PulseAudio driver. Thanks, Stephan!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
46 /* Old variable names */
42e83d81224b Committed PulseAudio driver. Thanks, Stephan!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
47 #define stream (this->hidden->stream)
42e83d81224b Committed PulseAudio driver. Thanks, Stephan!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
48 #define parent (this->hidden->parent)
42e83d81224b Committed PulseAudio driver. Thanks, Stephan!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
49 #define mixbuf (this->hidden->mixbuf)
42e83d81224b Committed PulseAudio driver. Thanks, Stephan!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
50 #define mixlen (this->hidden->mixlen)
42e83d81224b Committed PulseAudio driver. Thanks, Stephan!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
51
42e83d81224b Committed PulseAudio driver. Thanks, Stephan!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
52 #endif /* _SDL_pulseaudio_h */
42e83d81224b Committed PulseAudio driver. Thanks, Stephan!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
53