windows_audio_common.h

Go to the documentation of this file.
00001 /*****************************************************************************
00002  * windows_common.h: Windows Audio common code
00003  *****************************************************************************
00004  * Copyright (C) 2001-2009 VideoLAN
00005  * $Id: cd5e36684426bf4d9de35fab4170237c59e2f489 $
00006  *
00007  * Authors: Gildas Bazin <gbazin@videolan.org>
00008  *          Jean-Baptiste Kempf <jb@videolan.org>
00009  *
00010  * This program is free software; you can redistribute it and/or modify
00011  * it under the terms of the GNU General Public License as published by
00012  * the Free Software Foundation; either version 2 of the License, or
00013  * (at your option) any later version.
00014  *
00015  * This program is distributed in the hope that it will be useful,
00016  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00017  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00018  * GNU General Public License for more details.
00019  *
00020  * You should have received a copy of the GNU General Public License
00021  * along with this program; if not, write to the Free Software
00022  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
00023  *****************************************************************************/
00024 
00025 #include <windows.h>
00026 #include <mmsystem.h>
00027 
00028 /*****************************************************************************
00029  * DirectSound GUIDs.
00030  * Defining them here allows us to get rid of the dxguid library during
00031  * the linking stage.
00032  *****************************************************************************/
00033 
00034 #define INITGUID /* Doesn't define the DEFINE_GUID as extern */
00035 #include <initguid.h>
00036 
00037 #ifndef WAVE_FORMAT_IEEE_FLOAT
00038 #   define WAVE_FORMAT_IEEE_FLOAT 0x0003
00039 #endif
00040 
00041 #ifndef WAVE_FORMAT_DOLBY_AC3_SPDIF
00042 #   define WAVE_FORMAT_DOLBY_AC3_SPDIF 0x0092
00043 #endif
00044 
00045 #ifndef WAVE_FORMAT_EXTENSIBLE
00046 #define  WAVE_FORMAT_EXTENSIBLE   0xFFFE
00047 #endif
00048 
00049 DEFINE_GUID( _KSDATAFORMAT_SUBTYPE_IEEE_FLOAT, WAVE_FORMAT_IEEE_FLOAT, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71 );
00050 DEFINE_GUID( _KSDATAFORMAT_SUBTYPE_PCM, WAVE_FORMAT_PCM, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71 );
00051 DEFINE_GUID( _KSDATAFORMAT_SUBTYPE_DOLBY_AC3_SPDIF, WAVE_FORMAT_DOLBY_AC3_SPDIF, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71 );
00052 
00053 static const GUID __KSDATAFORMAT_SUBTYPE_IEEE_FLOAT = {WAVE_FORMAT_IEEE_FLOAT, 0x0000, 0x0010, {0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}};
00054 static const GUID __KSDATAFORMAT_SUBTYPE_PCM = {WAVE_FORMAT_PCM, 0x0000, 0x0010, {0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}};
00055 static const GUID __KSDATAFORMAT_SUBTYPE_DOLBY_AC3_SPDIF = {WAVE_FORMAT_DOLBY_AC3_SPDIF, 0x0000, 0x0010, {0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}};
00056 
00057 
00058 #define FRAMES_NUM 8                                      /* Needs to be > 3 */
00059 
00060 #ifndef _WAVEFORMATEXTENSIBLE_
00061 typedef struct {
00062     WAVEFORMATEX    Format;
00063     union {
00064         WORD wValidBitsPerSample;       /* bits of precision  */
00065         WORD wSamplesPerBlock;          /* valid if wBitsPerSample==0 */
00066         WORD wReserved;                 /* If neither applies, set to zero. */
00067     } Samples;
00068     DWORD           dwChannelMask;      /* which channels are */
00069                                         /* present in stream  */
00070     GUID            SubFormat;
00071 } WAVEFORMATEXTENSIBLE, *PWAVEFORMATEXTENSIBLE;
00072 #endif
00073 
00074 
00075 #ifndef SPEAKER_FRONT_LEFT
00076 #   define SPEAKER_FRONT_LEFT             0x1
00077 #   define SPEAKER_FRONT_RIGHT            0x2
00078 #   define SPEAKER_FRONT_CENTER           0x4
00079 #   define SPEAKER_LOW_FREQUENCY          0x8
00080 #   define SPEAKER_BACK_LEFT              0x10
00081 #   define SPEAKER_BACK_RIGHT             0x20
00082 #   define SPEAKER_FRONT_LEFT_OF_CENTER   0x40
00083 #   define SPEAKER_FRONT_RIGHT_OF_CENTER  0x80
00084 #   define SPEAKER_BACK_CENTER            0x100
00085 #   define SPEAKER_SIDE_LEFT              0x200
00086 #   define SPEAKER_SIDE_RIGHT             0x400
00087 #   define SPEAKER_TOP_CENTER             0x800
00088 #   define SPEAKER_TOP_FRONT_LEFT         0x1000
00089 #   define SPEAKER_TOP_FRONT_CENTER       0x2000
00090 #   define SPEAKER_TOP_FRONT_RIGHT        0x4000
00091 #   define SPEAKER_TOP_BACK_LEFT          0x8000
00092 #   define SPEAKER_TOP_BACK_CENTER        0x10000
00093 #   define SPEAKER_TOP_BACK_RIGHT         0x20000
00094 #   define SPEAKER_RESERVED               0x80000000
00095 #endif
00096 
00097 #ifndef DSSPEAKER_DSSPEAKER_DIRECTOUT
00098 #   define DSSPEAKER_DSSPEAKER_DIRECTOUT         0x00000000
00099 #endif
00100 #ifndef DSSPEAKER_HEADPHONE
00101 #   define DSSPEAKER_HEADPHONE         0x00000001
00102 #endif
00103 #ifndef DSSPEAKER_MONO
00104 #   define DSSPEAKER_MONO              0x00000002
00105 #endif
00106 #ifndef DSSPEAKER_QUAD
00107 #   define DSSPEAKER_QUAD              0x00000003
00108 #endif
00109 #ifndef DSSPEAKER_STEREO
00110 #   define DSSPEAKER_STEREO            0x00000004
00111 #endif
00112 #ifndef DSSPEAKER_SURROUND
00113 #   define DSSPEAKER_SURROUND          0x00000005
00114 #endif
00115 #ifndef DSSPEAKER_5POINT1
00116 #   define DSSPEAKER_5POINT1           0x00000006
00117 #endif
00118 #ifndef DSSPEAKER_7POINT1
00119 #   define DSSPEAKER_7POINT1           0x00000007
00120 #endif
00121 #ifndef DSSPEAKER_7POINT1_SURROUND
00122 #   define DSSPEAKER_7POINT1_SURROUND           0x00000008
00123 #endif
00124 #ifndef DSSPEAKER_7POINT1_WIDE
00125 #   define DSSPEAKER_7POINT1_WIDE           DSSPEAKER_7POINT1
00126 #endif
00127 
00128 static const uint32_t pi_channels_src[] =
00129     { AOUT_CHAN_LEFT, AOUT_CHAN_RIGHT,
00130       AOUT_CHAN_MIDDLELEFT, AOUT_CHAN_MIDDLERIGHT,
00131       AOUT_CHAN_REARLEFT, AOUT_CHAN_REARRIGHT, AOUT_CHAN_REARCENTER,
00132       AOUT_CHAN_CENTER, AOUT_CHAN_LFE, 0 };
00133 static const uint32_t pi_channels_in[] =
00134     { SPEAKER_FRONT_LEFT, SPEAKER_FRONT_RIGHT,
00135       SPEAKER_SIDE_LEFT, SPEAKER_SIDE_RIGHT,
00136       SPEAKER_BACK_LEFT, SPEAKER_BACK_RIGHT, SPEAKER_BACK_CENTER,
00137       SPEAKER_FRONT_CENTER, SPEAKER_LOW_FREQUENCY, 0 };
00138 static const uint32_t pi_channels_out[] =
00139     { SPEAKER_FRONT_LEFT, SPEAKER_FRONT_RIGHT,
00140       SPEAKER_FRONT_CENTER, SPEAKER_LOW_FREQUENCY,
00141       SPEAKER_BACK_LEFT, SPEAKER_BACK_RIGHT,
00142       SPEAKER_BACK_CENTER,
00143       SPEAKER_SIDE_LEFT, SPEAKER_SIDE_RIGHT, 0 };
00144 
00145 #define FLOAT_TEXT N_("Use float32 output")
00146 #define FLOAT_LONGTEXT N_( \
00147     "The option allows you to enable or disable the high-quality float32 " \
00148     "audio output mode (which is not well supported by some soundcards)." )
00149 

Generated on Tue May 25 08:04:53 2010 for VLC by  doxygen 1.5.6