zenilib: zenilib/jni/external/openal-soft/Alc/backends/dsound.c File Reference

zenilib 0.5.3.0

- Main Page
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Macros | Functions | Variables
dsound.c File Reference
`#include "config.h"`
`#include <stdlib.h>`
`#include <stdio.h>`
`#include <memory.h>`
`#include <dsound.h>`
`#include <cguid.h>`
`#include <mmreg.h>`
`#include <ks.h>`
`#include <ksmedia.h>`
`#include "alMain.h"`
`#include "alu.h"`

Go to the source code of this file.

## Macros

#define | DirectSoundCaptureCreate pDirectSoundCaptureCreate
#define | DirectSoundCaptureEnumerateA pDirectSoundCaptureEnumerateA
#define | DirectSoundCreate pDirectSoundCreate
#define | DirectSoundEnumerateA pDirectSoundEnumerateA
#define | LOAD_FUNC(f)
#define | MAX_UPDATES 128

## Functions

void | alcDSoundDeinit (void)
ALCboolean | alcDSoundInit (BackendFuncs *FuncList)
void | alcDSoundProbe (enum DevProbe type)
| DEFINE_GUID (KSDATAFORMAT_SUBTYPE_PCM, 0x00000001, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71)
| DEFINE_GUID (KSDATAFORMAT_SUBTYPE_IEEE_FLOAT, 0x00000003, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71)
static ALCuint | DSoundAvailableSamples (ALCdevice *Device)
static ALCenum | DSoundCaptureSamples (ALCdevice *Device, ALCvoid *pBuffer, ALCuint lSamples)
static void | DSoundCloseCapture (ALCdevice *device)
static void | DSoundClosePlayback (ALCdevice *device)
static BOOL CALLBACK | DSoundEnumCaptureDevices (LPGUID guid, LPCSTR desc, LPCSTR drvname, LPVOID data)
static BOOL CALLBACK | DSoundEnumPlaybackDevices (LPGUID guid, LPCSTR desc, LPCSTR drvname, LPVOID data)
static ALCboolean | DSoundLoad (void)
static ALCenum | DSoundOpenCapture (ALCdevice *device, const ALCchar *deviceName)
static ALCenum | DSoundOpenPlayback (ALCdevice *device, const ALCchar *deviceName)
static ALuint | DSoundPlaybackProc (ALvoid *ptr)
static ALCboolean | DSoundResetPlayback (ALCdevice *device)
static void | DSoundStartCapture (ALCdevice *device)
static ALCboolean | DSoundStartPlayback (ALCdevice *device)
static void | DSoundStopCapture (ALCdevice *device)
static void | DSoundStopPlayback (ALCdevice *device)
static | HRESULT (WINAPI *pDirectSoundCreate)(LPCGUID pcGuidDevice

## Variables

static DevMap * | CaptureDeviceList
static void * | ds_handle
static const BackendFuncs | DSoundFuncs
static ALuint | NumCaptureDevices
static ALuint | NumPlaybackDevices
static void * | pContext
static DevMap * | PlaybackDeviceList
static IDirectSound ** | ppDS
static IDirectSoundCapture ** | ppDSC
static IDirectSound IUnknown * | pUnkOuter

## Macro Definition Documentation

#define DirectSoundCaptureCreate pDirectSoundCaptureCreate

Definition at line 57 of file dsound.c.

Referenced by DSoundLoad(), and DSoundOpenCapture().

#define DirectSoundCaptureEnumerateA pDirectSoundCaptureEnumerateA

Definition at line 58 of file dsound.c.

Referenced by alcDSoundProbe(), DSoundLoad(), and DSoundOpenCapture().

#define DirectSoundCreate pDirectSoundCreate

Definition at line 55 of file dsound.c.

Referenced by DSoundLoad(), and DSoundOpenPlayback().

#define DirectSoundEnumerateA pDirectSoundEnumerateA

Definition at line 56 of file dsound.c.

Referenced by alcDSoundProbe(), DSoundLoad(), and DSoundOpenPlayback().

#define LOAD_FUNC | ( |  | f | ) |

Value:
do { \
p##f = GetSymbol(ds_handle, #f); \
if(p##f == NULL) { \
CloseLib(ds_handle); \
ds_handle = NULL; \
return ALC_FALSE; \
} \
} while(0)
return
return
Definition: pngrutil.c:1266
NULL
#define NULL
Definition: ftobjs.h:61
f
GLclampf f
Definition: glew.h:3390
if
if(!yyg->yy_init)
Definition: glslang_lex.cpp:1037
ALC_FALSE
#define ALC_FALSE
Definition: alc.h:81
p
GLfloat GLfloat p
Definition: glew.h:14938
ds_handle
static void * ds_handle
Definition: dsound.c:49

Referenced by alsa_load(), DSoundLoad(), and pa_load().

#define MAX_UPDATES 128

Definition at line 93 of file dsound.c.

Referenced by DSoundResetPlayback().

## Function Documentation

void alcDSoundDeinit | ( | void |  | ) |

Definition at line 969 of file dsound.c.

References CaptureDeviceList, ds_handle, free, i, NULL, NumCaptureDevices, NumPlaybackDevices, and PlaybackDeviceList.

ALCboolean alcDSoundInit | ( | BackendFuncs * | FuncList | ) |

Definition at line 961 of file dsound.c.

References ALC_FALSE, ALC_TRUE, DSoundFuncs, and DSoundLoad().

void alcDSoundProbe | ( | enum DevProbe | type | ) |

Definition at line 990 of file dsound.c.

References ALL_DEVICE_PROBE, AppendAllDevicesList(), AppendCaptureDeviceList(), CAPTURE_DEVICE_PROBE, CaptureDeviceList, DirectSoundCaptureEnumerateA, DirectSoundEnumerateA, DSoundEnumCaptureDevices(), DSoundEnumPlaybackDevices(), ERR, free, HRESULT(), i, NULL, NumCaptureDevices, NumPlaybackDevices, and PlaybackDeviceList.

DEFINE_GUID | ( | KSDATAFORMAT_SUBTYPE_PCM | ,
|  | 0x00000001 | ,
|  | 0x0000 | ,
|  | 0x0010 | ,
|  | 0x80 | ,
|  | 0x00 | ,
|  | 0x00 | ,
|  | 0xaa | ,
|  | 0x00 | ,
|  | 0x38 | ,
|  | 0x9b | ,
|  | 0x71 |
| ) |  |

OpenAL cross platform audio library Copyright (C) 1999-2007 by authors. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details.

You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. Or go to http://www.gnu.org/copyleft/lgpl.html

DEFINE_GUID | ( | KSDATAFORMAT_SUBTYPE_IEEE_FLOAT | ,
|  | 0x00000003 | ,
|  | 0x0000 | ,
|  | 0x0010 | ,
|  | 0x80 | ,
|  | 0x00 | ,
|  | 0x00 | ,
|  | 0xaa | ,
|  | 0x00 | ,
|  | 0x38 | ,
|  | 0x9b | ,
|  | 0x71 |
| ) |  |

static ALCuint DSoundAvailableSamples | ( | ALCdevice * | Device | ) |

static

Definition at line 895 of file dsound.c.

References aluHandleDisconnect(), ALCdevice_struct::Connected, DWORD(), ERR, ALCdevice_struct::ExtraData, ALCdevice_struct::FmtChans, ALCdevice_struct::FmtType, FrameSizeFromDevFmt(), HRESULT(), NULL, RingBufferSize(), VOID(), and WriteRingBuffer().

static ALCenum DSoundCaptureSamples | ( | ALCdevice * | Device,
|  | ALCvoid * | pBuffer,
|  | ALCuint | lSamples
| ) |  |

static

Definition at line 888 of file dsound.c.

References ALC_NO_ERROR, ALCdevice_struct::ExtraData, and ReadRingBuffer().

static void DSoundCloseCapture | ( | ALCdevice * | device | ) |

static

Definition at line 841 of file dsound.c.

References DestroyRingBuffer(), ALCdevice_struct::ExtraData, free, and NULL.

static void DSoundClosePlayback | ( | ALCdevice * | device | ) |

static

Definition at line 396 of file dsound.c.

References ALCdevice_struct::ExtraData, free, and NULL.

static BOOL CALLBACK DSoundEnumCaptureDevices | ( | LPGUID | guid,
|  | LPCSTR | desc,
|  | LPCSTR | drvname,
|  | LPVOID | data
| ) |  |

static

Definition at line 174 of file dsound.c.

References CaptureDeviceList, HRESULT(), i, NULL, NumCaptureDevices, realloc, str, strdup(), TRACE, and TRUE.

Referenced by alcDSoundProbe(), and DSoundOpenCapture().

static BOOL CALLBACK DSoundEnumPlaybackDevices | ( | LPGUID | guid,
|  | LPCSTR | desc,
|  | LPCSTR | drvname,
|  | LPVOID | data
| ) |  |

static

Definition at line 124 of file dsound.c.

References HRESULT(), i, NULL, NumPlaybackDevices, PlaybackDeviceList, realloc, str, strdup(), TRACE, and TRUE.

Referenced by alcDSoundProbe(), and DSoundOpenPlayback().

static ALCboolean DSoundLoad | ( | void |  | ) |

static

Definition at line 95 of file dsound.c.

References ALC_FALSE, ALC_TRUE, DirectSoundCaptureCreate, DirectSoundCaptureEnumerateA, DirectSoundCreate, DirectSoundEnumerateA, ds_handle, ERR, LOAD_FUNC, and NULL.

Referenced by alcDSoundInit().

static ALCenum DSoundOpenCapture | ( | ALCdevice * | device,
|  | const ALCchar * | deviceName
| ) |  |

static

Definition at line 656 of file dsound.c.

References ALC_INVALID_ENUM, ALC_INVALID_VALUE, ALC_NO_ERROR, ALC_OUT_OF_MEMORY, BytesFromDevFmt(), calloc, CaptureDeviceList, tWAVEFORMATEX::cbSize, ChannelsFromDevFmt(), CreateRingBuffer(), DestroyRingBuffer(), DevFmtByte, DevFmtFloat, DevFmtInt, DevFmtMono, DevFmtQuad, DevFmtShort, DevFmtStereo, DevFmtTypeString(), DevFmtUByte, DevFmtUInt, DevFmtUShort, DevFmtX51, DevFmtX51Side, DevFmtX61, DevFmtX71, ALCdevice_struct::DeviceName, DirectSoundCaptureCreate, DirectSoundCaptureEnumerateA, DSoundEnumCaptureDevices(), WAVEFORMATEXTENSIBLE::dwChannelMask, ERR, ALCdevice_struct::ExtraData, ALCdevice_struct::FmtChans, ALCdevice_struct::FmtType, WAVEFORMATEXTENSIBLE::Format, free, ALCdevice_struct::Frequency, HRESULT(), i, maxu(), memset, tWAVEFORMATEX::nAvgBytesPerSec, tWAVEFORMATEX::nBlockAlign, tWAVEFORMATEX::nChannels, tWAVEFORMATEX::nSamplesPerSec, NULL, NumCaptureDevices, ALCdevice_struct::NumUpdates, WAVEFORMATEXTENSIBLE::Samples, SetDefaultWFXChannelOrder(), SPEAKER_BACK_CENTER, SPEAKER_BACK_LEFT, SPEAKER_BACK_RIGHT, SPEAKER_FRONT_CENTER, SPEAKER_FRONT_LEFT, SPEAKER_FRONT_RIGHT, SPEAKER_LOW_FREQUENCY, SPEAKER_SIDE_LEFT, SPEAKER_SIDE_RIGHT, strdup(), WAVEFORMATEXTENSIBLE::SubFormat, ALCdevice_struct::UpdateSize, WARN, WAVE_FORMAT_EXTENSIBLE, WAVE_FORMAT_PCM, tWAVEFORMATEX::wBitsPerSample, tWAVEFORMATEX::wFormatTag, and WAVEFORMATEXTENSIBLE::wValidBitsPerSample.

static ALCenum DSoundOpenPlayback | ( | ALCdevice * | device,
|  | const ALCchar * | deviceName
| ) |  |

static

Definition at line 331 of file dsound.c.

References ALC_INVALID_VALUE, ALC_NO_ERROR, ALC_OUT_OF_MEMORY, calloc, ALCdevice_struct::DeviceName, DirectSoundCreate, DirectSoundEnumerateA, DSoundEnumPlaybackDevices(), ERR, ALCdevice_struct::ExtraData, FALSE, free, HRESULT(), i, NULL, NumPlaybackDevices, PlaybackDeviceList, and strdup().

static ALuint DSoundPlaybackProc | ( | ALvoid * | ptr | ) |

static

Definition at line 224 of file dsound.c.

References ALCdevice_Lock, ALCdevice_Unlock, aluHandleDisconnect(), aluMixData(), BOOL(), DWORD(), ERR, ALCdevice_struct::ExtraData, FALSE, ALCdevice_struct::FmtChans, ALCdevice_struct::FmtType, FrameSizeFromDevFmt(), HRESULT(), memset, NULL, SetRTPriority(), TRUE, ALCdevice_struct::UpdateSize, VOID(), and WARN.

Referenced by DSoundStartPlayback().

static ALCboolean DSoundResetPlayback | ( | ALCdevice * | device | ) |

static

Definition at line 416 of file dsound.c.

References ALC_FALSE, ALC_TRUE, BytesFromDevFmt(), ChannelsFromDevFmt(), DevFmtByte, DevFmtFloat, DevFmtInt, DevFmtMono, DevFmtQuad, DevFmtShort, DevFmtStereo, DevFmtUByte, DevFmtUInt, DevFmtUShort, DevFmtX51, DevFmtX51Side, DevFmtX61, DevFmtX71, DEVICE_CHANNELS_REQUEST, DEVICE_SAMPLE_TYPE_REQUEST, DWORD(), ERR, ALCdevice_struct::ExtraData, ALCdevice_struct::Flags, ALCdevice_struct::FmtChans, ALCdevice_struct::FmtType, ALCdevice_struct::Frequency, HRESULT(), i, LPVOID(), MAX_UPDATES, memset, NULL, ALCdevice_struct::NumUpdates, SetDefaultWFXChannelOrder(), SPEAKER_BACK_CENTER, SPEAKER_BACK_LEFT, SPEAKER_BACK_RIGHT, SPEAKER_FRONT_CENTER, SPEAKER_FRONT_LEFT, SPEAKER_FRONT_RIGHT, SPEAKER_LOW_FREQUENCY, SPEAKER_SIDE_LEFT, SPEAKER_SIDE_RIGHT, ALCdevice_struct::UpdateSize, WAVE_FORMAT_EXTENSIBLE, and WAVE_FORMAT_PCM.

static void DSoundStartCapture | ( | ALCdevice * | device | ) |

static

Definition at line 862 of file dsound.c.

References aluHandleDisconnect(), ERR, ALCdevice_struct::ExtraData, and HRESULT().

static ALCboolean DSoundStartPlayback | ( | ALCdevice * | device | ) |

static

Definition at line 629 of file dsound.c.

References ALC_FALSE, ALC_TRUE, DSoundPlaybackProc(), ALCdevice_struct::ExtraData, NULL, and StartThread().

static void DSoundStopCapture | ( | ALCdevice * | device | ) |

static

Definition at line 875 of file dsound.c.

References aluHandleDisconnect(), ERR, ALCdevice_struct::ExtraData, and HRESULT().

static void DSoundStopPlayback | ( | ALCdevice * | device | ) |

static

Definition at line 640 of file dsound.c.

References ALCdevice_struct::ExtraData, NULL, and StopThread().

static HRESULT | ( | WINAPI * | pDirectSoundCreate | ) |

static

Referenced by alcDSoundProbe(), DSoundAvailableSamples(), DSoundEnumCaptureDevices(), DSoundEnumPlaybackDevices(), DSoundOpenCapture(), DSoundOpenPlayback(), DSoundPlaybackProc(), DSoundResetPlayback(), DSoundStartCapture(), and DSoundStopCapture().

## Variable Documentation

DevMap* CaptureDeviceList

static

Definition at line 90 of file dsound.c.

Referenced by alcDSoundDeinit(), alcDSoundProbe(), DSoundEnumCaptureDevices(), and DSoundOpenCapture().

void* ds_handle

static

Definition at line 49 of file dsound.c.

Referenced by alcDSoundDeinit(), and DSoundLoad().

const BackendFuncs DSoundFuncs

static

Initial value:
= {
DSoundOpenPlayback,
DSoundClosePlayback,
DSoundResetPlayback,
DSoundStartPlayback,
DSoundStopPlayback,
DSoundOpenCapture,
DSoundCloseCapture,
DSoundStartCapture,
DSoundStopCapture,
DSoundCaptureSamples,
DSoundAvailableSamples,
ALCdevice_LockDefault,
ALCdevice_UnlockDefault,
ALCdevice_GetLatencyDefault
}
DSoundCloseCapture
static void DSoundCloseCapture(ALCdevice *device)
Definition: dsound.c:841
DSoundStopPlayback
static void DSoundStopPlayback(ALCdevice *device)
Definition: dsound.c:640
DSoundOpenPlayback
static ALCenum DSoundOpenPlayback(ALCdevice *device, const ALCchar *deviceName)
Definition: dsound.c:331
DSoundOpenCapture
static ALCenum DSoundOpenCapture(ALCdevice *device, const ALCchar *deviceName)
Definition: dsound.c:656
ALCdevice_GetLatencyDefault
ALint64 ALCdevice_GetLatencyDefault(ALCdevice *device)
Definition: ALc.c:1285
DSoundResetPlayback
static ALCboolean DSoundResetPlayback(ALCdevice *device)
Definition: dsound.c:416
DSoundStartPlayback
static ALCboolean DSoundStartPlayback(ALCdevice *device)
Definition: dsound.c:629
DSoundStartCapture
static void DSoundStartCapture(ALCdevice *device)
Definition: dsound.c:862
DSoundAvailableSamples
static ALCuint DSoundAvailableSamples(ALCdevice *Device)
Definition: dsound.c:895
ALCdevice_LockDefault
void ALCdevice_LockDefault(ALCdevice *device)
Definition: ALc.c:1277
DSoundClosePlayback
static void DSoundClosePlayback(ALCdevice *device)
Definition: dsound.c:396
DSoundCaptureSamples
static ALCenum DSoundCaptureSamples(ALCdevice *Device, ALCvoid *pBuffer, ALCuint lSamples)
Definition: dsound.c:888
DSoundStopCapture
static void DSoundStopCapture(ALCdevice *device)
Definition: dsound.c:875
ALCdevice_UnlockDefault
void ALCdevice_UnlockDefault(ALCdevice *device)
Definition: ALc.c:1281

Definition at line 943 of file dsound.c.

Referenced by alcDSoundInit().

ALuint NumCaptureDevices

static

Definition at line 91 of file dsound.c.

Referenced by alcDSoundDeinit(), alcDSoundProbe(), DSoundEnumCaptureDevices(), and DSoundOpenCapture().

ALuint NumPlaybackDevices

static

Definition at line 89 of file dsound.c.

Referenced by alcDSoundDeinit(), alcDSoundProbe(), DSoundEnumPlaybackDevices(), and DSoundOpenPlayback().

static void * pContext

Definition at line 51 of file dsound.c.

DevMap* PlaybackDeviceList

static

Definition at line 88 of file dsound.c.

Referenced by alcDSoundDeinit(), alcDSoundProbe(), DSoundEnumPlaybackDevices(), and DSoundOpenPlayback().

IDirectSound** ppDS

Definition at line 50 of file dsound.c.

IDirectSoundCapture** ppDSC

Definition at line 52 of file dsound.c.

static IDirectSoundCapture IUnknown * pUnkOuter

Definition at line 50 of file dsound.c.