Mercurial > mplayer.hg
annotate libao2/audio_out.c @ 2673:1d79b0f4889a
*** empty log message ***
author | gabucino |
---|---|
date | Sun, 04 Nov 2001 10:42:32 +0000 |
parents | 9d8d69fc517c |
children | b24661a9924e |
rev | line source |
---|---|
954 | 1 #include <stdio.h> |
2 #include <stdlib.h> | |
3 | |
4 #include "../config.h" | |
5 #include "audio_out.h" | |
1058 | 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 | 8 // there are some globals: |
9 int ao_samplerate=0; | |
10 int ao_channels=0; | |
11 int ao_format=0; | |
12 int ao_bps=0; | |
13 int ao_outburst=OUTBURST; // config.h default | |
14 int ao_buffersize=-1; | |
1185 | 15 char *ao_subdevice = NULL; |
954 | 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 | 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 | 20 //extern ao_functions_t audio_out_ossold; |
21 extern ao_functions_t audio_out_null; | |
1007 | 22 #ifdef HAVE_ALSA5 |
23 extern ao_functions_t audio_out_alsa5; | |
24 #endif | |
1032 | 25 #ifdef HAVE_ALSA9 |
26 extern ao_functions_t audio_out_alsa9; | |
27 #endif | |
28 #ifdef HAVE_ESD | |
29 extern ao_functions_t audio_out_esd; | |
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 |
2450 | 37 #ifdef USE_SGI_AUDIO |
38 extern ao_functions_t audio_out_sgi; | |
39 #endif | |
2645 | 40 #ifdef HAVE_DXR3 |
41 extern ao_functions_t audio_out_dxr3; | |
42 #endif | |
1107 | 43 extern ao_functions_t audio_out_pcm; |
1185 | 44 extern ao_functions_t audio_out_pss; |
954 | 45 |
46 ao_functions_t* audio_out_drivers[] = | |
47 { | |
1038
b36fb1ae4b53
applied solaris8/netbsd/other fixes patch by J¸«ärgen Keil <jk@tools.de>
arpi_esp
parents:
1032
diff
changeset
|
48 #ifdef USE_OSS_AUDIO |
954 | 49 &audio_out_oss, |
1038
b36fb1ae4b53
applied solaris8/netbsd/other fixes patch by J¸«ärgen Keil <jk@tools.de>
arpi_esp
parents:
1032
diff
changeset
|
50 #endif |
1725
24e75b632740
Move the sun audio driver near the start of the list of audio drivers, so
jkeil
parents:
1528
diff
changeset
|
51 #ifdef USE_SUN_AUDIO |
24e75b632740
Move the sun audio driver near the start of the list of audio drivers, so
jkeil
parents:
1528
diff
changeset
|
52 &audio_out_sun, |
24e75b632740
Move the sun audio driver near the start of the list of audio drivers, so
jkeil
parents:
1528
diff
changeset
|
53 #endif |
2450 | 54 #ifdef USE_SGI_AUDIO |
55 &audio_out_sgi, | |
56 #endif | |
954 | 57 &audio_out_null, |
1007 | 58 #ifdef HAVE_ALSA5 |
995 | 59 &audio_out_alsa5, |
1007 | 60 #endif |
1032 | 61 #ifdef HAVE_ALSA9 |
62 &audio_out_alsa9, | |
63 #endif | |
64 #ifdef HAVE_ESD | |
65 &audio_out_esd, | |
66 #endif | |
966
69b4f944ce08
Added support for sdl audio out (buggy pre-alpha).
atmosfear
parents:
954
diff
changeset
|
67 #ifdef HAVE_SDL |
69b4f944ce08
Added support for sdl audio out (buggy pre-alpha).
atmosfear
parents:
954
diff
changeset
|
68 &audio_out_sdl, |
69b4f944ce08
Added support for sdl audio out (buggy pre-alpha).
atmosfear
parents:
954
diff
changeset
|
69 #endif |
2645 | 70 #ifdef HAVE_DXR3 |
71 &audio_out_dxr3, | |
72 #endif | |
1107 | 73 &audio_out_pcm, |
1185 | 74 // &audio_out_pss, |
954 | 75 NULL |
76 }; | |
77 | |
995 | 78 char *audio_out_format_name(int format) |
79 { | |
80 switch (format) | |
81 { | |
1047
3239a22b956e
par kozmetikai valtoztatas, meg van ami nem :) cvs diff..
al3x
parents:
1038
diff
changeset
|
82 case AFMT_MU_LAW: |
1121 | 83 return("Mu-Law"); |
1047
3239a22b956e
par kozmetikai valtoztatas, meg van ami nem :) cvs diff..
al3x
parents:
1038
diff
changeset
|
84 case AFMT_A_LAW: |
1121 | 85 return("A-Law"); |
1047
3239a22b956e
par kozmetikai valtoztatas, meg van ami nem :) cvs diff..
al3x
parents:
1038
diff
changeset
|
86 case AFMT_IMA_ADPCM: |
1121 | 87 return("Ima-ADPCM"); |
995 | 88 case AFMT_S8: |
1047
3239a22b956e
par kozmetikai valtoztatas, meg van ami nem :) cvs diff..
al3x
parents:
1038
diff
changeset
|
89 return("Signed 8-bit"); |
995 | 90 case AFMT_U8: |
1047
3239a22b956e
par kozmetikai valtoztatas, meg van ami nem :) cvs diff..
al3x
parents:
1038
diff
changeset
|
91 return("Unsigned 8-bit"); |
995 | 92 case AFMT_U16_LE: |
1047
3239a22b956e
par kozmetikai valtoztatas, meg van ami nem :) cvs diff..
al3x
parents:
1038
diff
changeset
|
93 return("Unsigned 16-bit (Little-Endian)"); |
995 | 94 case AFMT_U16_BE: |
1047
3239a22b956e
par kozmetikai valtoztatas, meg van ami nem :) cvs diff..
al3x
parents:
1038
diff
changeset
|
95 return("Unsigned 16-bit (Big-Endian)"); |
995 | 96 case AFMT_S16_LE: |
1047
3239a22b956e
par kozmetikai valtoztatas, meg van ami nem :) cvs diff..
al3x
parents:
1038
diff
changeset
|
97 return("Signed 16-bit (Little-Endian)"); |
995 | 98 case AFMT_S16_BE: |
2450 | 99 return("Signed 16-bit (Big-Endian)"); |
1047
3239a22b956e
par kozmetikai valtoztatas, meg van ami nem :) cvs diff..
al3x
parents:
1038
diff
changeset
|
100 case AFMT_MPEG: |
3239a22b956e
par kozmetikai valtoztatas, meg van ami nem :) cvs diff..
al3x
parents:
1038
diff
changeset
|
101 return("MPEG (2) audio"); |
1528
a444bd456fcc
ac3/spdif patch by German Gomez Garcia <german@piraos.com>
arpi
parents:
1185
diff
changeset
|
102 case AFMT_AC3: |
a444bd456fcc
ac3/spdif patch by German Gomez Garcia <german@piraos.com>
arpi
parents:
1185
diff
changeset
|
103 return("AC3"); |
1121 | 104 /* |
105 the following two formats are not available with old linux kernel | |
106 headers (e.g. in 2.2.16) | |
107 */ | |
1058 | 108 #ifdef AFMT_S32_LE |
1047
3239a22b956e
par kozmetikai valtoztatas, meg van ami nem :) cvs diff..
al3x
parents:
1038
diff
changeset
|
109 case AFMT_S32_LE: |
1058 | 110 return("Signed 32-bit (Little-Endian)"); |
111 #endif | |
112 #ifdef AFMT_S32_BE | |
1047
3239a22b956e
par kozmetikai valtoztatas, meg van ami nem :) cvs diff..
al3x
parents:
1038
diff
changeset
|
113 case AFMT_S32_BE: |
1058 | 114 return("Signed 32-bit (Big-Endian)"); |
115 #endif | |
995 | 116 } |
1047
3239a22b956e
par kozmetikai valtoztatas, meg van ami nem :) cvs diff..
al3x
parents:
1038
diff
changeset
|
117 return("Unknown"); |
995 | 118 } |