annotate libao2/audio_out.c @ 1294:0a8e0c7ddd0c

video decoder stuff
author arpi
date Sun, 08 Jul 2001 12:29:38 +0000
parents e21c96e28062
children a444bd456fcc
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
954
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
1 #include <stdio.h>
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
2 #include <stdlib.h>
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
3
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
4 #include "../config.h"
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
5 #include "audio_out.h"
1058
cab5ba9ffc6c fixed AFMT_ stuff (inclue afmt.h)
arpi_esp
parents: 1047
diff changeset
6 #include "afmt.h"
1038
b36fb1ae4b53 applied solaris8/netbsd/other fixes patch by J¸«ärgen Keil <jk@tools.de>
arpi_esp
parents: 1032
diff changeset
7
954
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
8 // there are some globals:
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
9 int ao_samplerate=0;
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
10 int ao_channels=0;
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
11 int ao_format=0;
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
12 int ao_bps=0;
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
13 int ao_outburst=OUTBURST; // config.h default
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
14 int ao_buffersize=-1;
1185
e21c96e28062 ao_subdevice implemented
al3x
parents: 1121
diff changeset
15 char *ao_subdevice = NULL;
954
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
16
1038
b36fb1ae4b53 applied solaris8/netbsd/other fixes patch by J¸«ärgen Keil <jk@tools.de>
arpi_esp
parents: 1032
diff changeset
17 #ifdef USE_OSS_AUDIO
954
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
18 extern ao_functions_t audio_out_oss;
1038
b36fb1ae4b53 applied solaris8/netbsd/other fixes patch by J¸«ärgen Keil <jk@tools.de>
arpi_esp
parents: 1032
diff changeset
19 #endif
954
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
20 //extern ao_functions_t audio_out_ossold;
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
21 extern ao_functions_t audio_out_null;
1007
e2de3386725f fixed HAVE_ALSA5 var. bug. sorry :(
pontscho
parents: 995
diff changeset
22 #ifdef HAVE_ALSA5
e2de3386725f fixed HAVE_ALSA5 var. bug. sorry :(
pontscho
parents: 995
diff changeset
23 extern ao_functions_t audio_out_alsa5;
e2de3386725f fixed HAVE_ALSA5 var. bug. sorry :(
pontscho
parents: 995
diff changeset
24 #endif
1032
e34336f4feaf add esd support and disabled default.
pontscho
parents: 1007
diff changeset
25 #ifdef HAVE_ALSA9
e34336f4feaf add esd support and disabled default.
pontscho
parents: 1007
diff changeset
26 extern ao_functions_t audio_out_alsa9;
e34336f4feaf add esd support and disabled default.
pontscho
parents: 1007
diff changeset
27 #endif
e34336f4feaf add esd support and disabled default.
pontscho
parents: 1007
diff changeset
28 #ifdef HAVE_ESD
e34336f4feaf add esd support and disabled default.
pontscho
parents: 1007
diff changeset
29 extern ao_functions_t audio_out_esd;
e34336f4feaf add esd support and disabled default.
pontscho
parents: 1007
diff changeset
30 #endif
966
69b4f944ce08 Added support for sdl audio out (buggy pre-alpha).
atmosfear
parents: 954
diff changeset
31 #ifdef HAVE_SDL
69b4f944ce08 Added support for sdl audio out (buggy pre-alpha).
atmosfear
parents: 954
diff changeset
32 extern ao_functions_t audio_out_sdl;
69b4f944ce08 Added support for sdl audio out (buggy pre-alpha).
atmosfear
parents: 954
diff changeset
33 #endif
1038
b36fb1ae4b53 applied solaris8/netbsd/other fixes patch by J¸«ärgen Keil <jk@tools.de>
arpi_esp
parents: 1032
diff changeset
34 #ifdef USE_SUN_AUDIO
b36fb1ae4b53 applied solaris8/netbsd/other fixes patch by J¸«ärgen Keil <jk@tools.de>
arpi_esp
parents: 1032
diff changeset
35 extern ao_functions_t audio_out_sun;
b36fb1ae4b53 applied solaris8/netbsd/other fixes patch by J¸«ärgen Keil <jk@tools.de>
arpi_esp
parents: 1032
diff changeset
36 #endif
1107
9d764880d989 Added raw PCM writer ao driver.
atmosfear
parents: 1058
diff changeset
37 extern ao_functions_t audio_out_pcm;
1185
e21c96e28062 ao_subdevice implemented
al3x
parents: 1121
diff changeset
38 extern ao_functions_t audio_out_pss;
954
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
39
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
40 ao_functions_t* audio_out_drivers[] =
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
41 {
1038
b36fb1ae4b53 applied solaris8/netbsd/other fixes patch by J¸«ärgen Keil <jk@tools.de>
arpi_esp
parents: 1032
diff changeset
42 #ifdef USE_OSS_AUDIO
954
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
43 &audio_out_oss,
1038
b36fb1ae4b53 applied solaris8/netbsd/other fixes patch by J¸«ärgen Keil <jk@tools.de>
arpi_esp
parents: 1032
diff changeset
44 #endif
954
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
45 &audio_out_null,
1007
e2de3386725f fixed HAVE_ALSA5 var. bug. sorry :(
pontscho
parents: 995
diff changeset
46 #ifdef HAVE_ALSA5
995
4f94faa145c1 add alsa support by al3x
pontscho
parents: 966
diff changeset
47 &audio_out_alsa5,
1007
e2de3386725f fixed HAVE_ALSA5 var. bug. sorry :(
pontscho
parents: 995
diff changeset
48 #endif
1032
e34336f4feaf add esd support and disabled default.
pontscho
parents: 1007
diff changeset
49 #ifdef HAVE_ALSA9
e34336f4feaf add esd support and disabled default.
pontscho
parents: 1007
diff changeset
50 &audio_out_alsa9,
e34336f4feaf add esd support and disabled default.
pontscho
parents: 1007
diff changeset
51 #endif
e34336f4feaf add esd support and disabled default.
pontscho
parents: 1007
diff changeset
52 #ifdef HAVE_ESD
e34336f4feaf add esd support and disabled default.
pontscho
parents: 1007
diff changeset
53 &audio_out_esd,
e34336f4feaf add esd support and disabled default.
pontscho
parents: 1007
diff changeset
54 #endif
966
69b4f944ce08 Added support for sdl audio out (buggy pre-alpha).
atmosfear
parents: 954
diff changeset
55 #ifdef HAVE_SDL
69b4f944ce08 Added support for sdl audio out (buggy pre-alpha).
atmosfear
parents: 954
diff changeset
56 &audio_out_sdl,
69b4f944ce08 Added support for sdl audio out (buggy pre-alpha).
atmosfear
parents: 954
diff changeset
57 #endif
1038
b36fb1ae4b53 applied solaris8/netbsd/other fixes patch by J¸«ärgen Keil <jk@tools.de>
arpi_esp
parents: 1032
diff changeset
58 #ifdef USE_SUN_AUDIO
b36fb1ae4b53 applied solaris8/netbsd/other fixes patch by J¸«ärgen Keil <jk@tools.de>
arpi_esp
parents: 1032
diff changeset
59 &audio_out_sun,
b36fb1ae4b53 applied solaris8/netbsd/other fixes patch by J¸«ärgen Keil <jk@tools.de>
arpi_esp
parents: 1032
diff changeset
60 #endif
1107
9d764880d989 Added raw PCM writer ao driver.
atmosfear
parents: 1058
diff changeset
61 &audio_out_pcm,
1185
e21c96e28062 ao_subdevice implemented
al3x
parents: 1121
diff changeset
62 // &audio_out_pss,
954
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
63 NULL
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
64 };
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
65
995
4f94faa145c1 add alsa support by al3x
pontscho
parents: 966
diff changeset
66 char *audio_out_format_name(int format)
4f94faa145c1 add alsa support by al3x
pontscho
parents: 966
diff changeset
67 {
4f94faa145c1 add alsa support by al3x
pontscho
parents: 966
diff changeset
68 switch (format)
4f94faa145c1 add alsa support by al3x
pontscho
parents: 966
diff changeset
69 {
1047
3239a22b956e par kozmetikai valtoztatas, meg van ami nem :) cvs diff..
al3x
parents: 1038
diff changeset
70 case AFMT_MU_LAW:
1121
2cd5ab1bee75 audio_format_out_name update
al3x
parents: 1107
diff changeset
71 return("Mu-Law");
1047
3239a22b956e par kozmetikai valtoztatas, meg van ami nem :) cvs diff..
al3x
parents: 1038
diff changeset
72 case AFMT_A_LAW:
1121
2cd5ab1bee75 audio_format_out_name update
al3x
parents: 1107
diff changeset
73 return("A-Law");
1047
3239a22b956e par kozmetikai valtoztatas, meg van ami nem :) cvs diff..
al3x
parents: 1038
diff changeset
74 case AFMT_IMA_ADPCM:
1121
2cd5ab1bee75 audio_format_out_name update
al3x
parents: 1107
diff changeset
75 return("Ima-ADPCM");
995
4f94faa145c1 add alsa support by al3x
pontscho
parents: 966
diff changeset
76 case AFMT_S8:
1047
3239a22b956e par kozmetikai valtoztatas, meg van ami nem :) cvs diff..
al3x
parents: 1038
diff changeset
77 return("Signed 8-bit");
995
4f94faa145c1 add alsa support by al3x
pontscho
parents: 966
diff changeset
78 case AFMT_U8:
1047
3239a22b956e par kozmetikai valtoztatas, meg van ami nem :) cvs diff..
al3x
parents: 1038
diff changeset
79 return("Unsigned 8-bit");
995
4f94faa145c1 add alsa support by al3x
pontscho
parents: 966
diff changeset
80 case AFMT_U16_LE:
1047
3239a22b956e par kozmetikai valtoztatas, meg van ami nem :) cvs diff..
al3x
parents: 1038
diff changeset
81 return("Unsigned 16-bit (Little-Endian)");
995
4f94faa145c1 add alsa support by al3x
pontscho
parents: 966
diff changeset
82 case AFMT_U16_BE:
1047
3239a22b956e par kozmetikai valtoztatas, meg van ami nem :) cvs diff..
al3x
parents: 1038
diff changeset
83 return("Unsigned 16-bit (Big-Endian)");
995
4f94faa145c1 add alsa support by al3x
pontscho
parents: 966
diff changeset
84 case AFMT_S16_LE:
1047
3239a22b956e par kozmetikai valtoztatas, meg van ami nem :) cvs diff..
al3x
parents: 1038
diff changeset
85 return("Signed 16-bit (Little-Endian)");
995
4f94faa145c1 add alsa support by al3x
pontscho
parents: 966
diff changeset
86 case AFMT_S16_BE:
1047
3239a22b956e par kozmetikai valtoztatas, meg van ami nem :) cvs diff..
al3x
parents: 1038
diff changeset
87 return("Unsigned 16-bit (Big-Endian)");
3239a22b956e par kozmetikai valtoztatas, meg van ami nem :) cvs diff..
al3x
parents: 1038
diff changeset
88 case AFMT_MPEG:
3239a22b956e par kozmetikai valtoztatas, meg van ami nem :) cvs diff..
al3x
parents: 1038
diff changeset
89 return("MPEG (2) audio");
1121
2cd5ab1bee75 audio_format_out_name update
al3x
parents: 1107
diff changeset
90 /*
2cd5ab1bee75 audio_format_out_name update
al3x
parents: 1107
diff changeset
91 the following two formats are not available with old linux kernel
2cd5ab1bee75 audio_format_out_name update
al3x
parents: 1107
diff changeset
92 headers (e.g. in 2.2.16)
2cd5ab1bee75 audio_format_out_name update
al3x
parents: 1107
diff changeset
93 */
1058
cab5ba9ffc6c fixed AFMT_ stuff (inclue afmt.h)
arpi_esp
parents: 1047
diff changeset
94 #ifdef AFMT_S32_LE
1047
3239a22b956e par kozmetikai valtoztatas, meg van ami nem :) cvs diff..
al3x
parents: 1038
diff changeset
95 case AFMT_S32_LE:
1058
cab5ba9ffc6c fixed AFMT_ stuff (inclue afmt.h)
arpi_esp
parents: 1047
diff changeset
96 return("Signed 32-bit (Little-Endian)");
cab5ba9ffc6c fixed AFMT_ stuff (inclue afmt.h)
arpi_esp
parents: 1047
diff changeset
97 #endif
cab5ba9ffc6c fixed AFMT_ stuff (inclue afmt.h)
arpi_esp
parents: 1047
diff changeset
98 #ifdef AFMT_S32_BE
1047
3239a22b956e par kozmetikai valtoztatas, meg van ami nem :) cvs diff..
al3x
parents: 1038
diff changeset
99 case AFMT_S32_BE:
1058
cab5ba9ffc6c fixed AFMT_ stuff (inclue afmt.h)
arpi_esp
parents: 1047
diff changeset
100 return("Signed 32-bit (Big-Endian)");
cab5ba9ffc6c fixed AFMT_ stuff (inclue afmt.h)
arpi_esp
parents: 1047
diff changeset
101 #endif
995
4f94faa145c1 add alsa support by al3x
pontscho
parents: 966
diff changeset
102 }
1047
3239a22b956e par kozmetikai valtoztatas, meg van ami nem :) cvs diff..
al3x
parents: 1038
diff changeset
103 return("Unknown");
995
4f94faa145c1 add alsa support by al3x
pontscho
parents: 966
diff changeset
104 }