[PATCH 05/13] dsound: New resampler; old/unused names removed; new vars/fields/functions.
Krzysztof Nikiel
knik00 at gmail.com
Fri Feb 11 03:24:58 CST 2011
---
dlls/dsound/dsound_private.h | 43
++++++++++++++++-------------------------
1 files changed, 17 insertions(+), 26 deletions(-)
diff --git a/dlls/dsound/dsound_private.h b/dlls/dsound/dsound_private.h
index 542b997..64a1c4d 100644
--- a/dlls/dsound/dsound_private.h
+++ b/dlls/dsound/dsound_private.h
@@ -39,6 +39,7 @@ extern int ds_snd_shadow_maxsize;
extern int ds_hw_accel;
extern int ds_default_sample_rate;
extern int ds_default_bits_per_sample;
+extern int ds_resample_quality;
/*****************************************************************************
* Predeclare the interface implementation structures
@@ -63,14 +64,6 @@ typedef struct SecondaryBufferImpl
SecondaryBufferImpl;
typedef struct DirectSoundDevice DirectSoundDevice;
typedef struct DirectSoundCaptureDevice DirectSoundCaptureDevice;
-/* dsound_convert.h */
-typedef void (*bitsconvertfunc)(const void *, void *, UINT, UINT, INT,
UINT, UINT);
-extern const bitsconvertfunc convertbpp[5][4];
-typedef void (*mixfunc)(const void *, void *, unsigned);
-extern const mixfunc mixfunctions[4];
-typedef void (*normfunc)(const void *, void *, unsigned);
-extern const normfunc normfunctions[4];
-
/*****************************************************************************
* IDirectSoundDevice implementation structure
*/
@@ -98,14 +91,9 @@ struct DirectSoundDevice
PrimaryBufferImpl* primary;
DSBUFFERDESC dsbd;
DWORD speaker_config;
- LPBYTE tmp_buffer, mix_buffer;
- DWORD tmp_buffer_len, mix_buffer_len;
DSVOLUMEPAN volpan;
- mixfunc mixfunction;
- normfunc normfunction;
-
/* DirectSound3DListener fields */
IDirectSound3DListenerImpl* listener;
DS3DLISTENER ds3dl;
@@ -171,17 +159,19 @@ struct IDirectSoundBufferImpl
PIDSDRIVERBUFFER hwbuf;
PWAVEFORMATEX pwfx;
BufferMemory* buffer;
- LPBYTE tmp_buffer;
- DWORD playflags,state,leadin;
- DWORD writelead,buflen;
+ DWORD playflags,state;
+ DWORD buflen;
DWORD nAvgBytesPerSec;
- DWORD freq, tmp_buffer_len, max_buffer_len;
+ DWORD freq;
DSVOLUMEPAN volpan;
DSBUFFERDESC dsbd;
- /* used for frequency conversion (PerfectPitch) */
- ULONG freqneeded, freqAdjust, freqAcc,
freqAccNext, resampleinmixer;
- /* used for mixing */
- DWORD primary_mixpos, buf_mixpos, sec_mixpos;
+
+ /* resampler fields */
+ DWORD outfreq, inpos, infrac;
+ DOUBLE outfreq_1;
+ DWORD firstep, firdelay;
+ INT quality;
+
/* IDirectSoundNotifyImpl fields */
IDirectSoundNotifyImpl* notify;
@@ -197,7 +187,6 @@ struct IDirectSoundBufferImpl
/* IKsPropertySet fields */
IKsBufferPropertySetImpl* iks;
- bitsconvertfunc convert;
struct list entry;
};
@@ -385,13 +374,10 @@ HRESULT DSOUND_ReopenDevice(DirectSoundDevice *device,
BOOL forcewave);
HRESULT DSOUND_FullDuplexCreate(REFIID riid, LPDIRECTSOUNDFULLDUPLEX*
ppDSFD);
/* mixer.c */
-DWORD DSOUND_bufpos_to_mixpos(const DirectSoundDevice* device, DWORD pos);
void DSOUND_CheckEvent(const IDirectSoundBufferImpl *dsb, DWORD playpos,
int len);
void DSOUND_RecalcVolPan(PDSVOLUMEPAN volpan);
void DSOUND_AmpFactorToVolPan(PDSVOLUMEPAN volpan);
-void DSOUND_RecalcFormat(IDirectSoundBufferImpl *dsb);
-void DSOUND_MixToTemporary(const IDirectSoundBufferImpl *dsb, DWORD
writepos, DWORD mixlen, BOOL inmixer);
-DWORD DSOUND_secpos_to_bufpos(const IDirectSoundBufferImpl *dsb, DWORD
secpos, DWORD secmixpos, DWORD* overshot);
+DWORD DSOUND_secpos_to_bufpos(const IDirectSoundBufferImpl *dsb, DWORD
secpos);
void CALLBACK DSOUND_timer(UINT timerID, UINT msg, DWORD_PTR dwUser,
DWORD_PTR dw1, DWORD_PTR dw2);
void CALLBACK DSOUND_callback(HWAVEOUT hwo, UINT msg, DWORD_PTR dwUser,
DWORD_PTR dw1, DWORD_PTR dw2);
@@ -405,6 +391,11 @@ void DSOUND_Calc3DBuffer(IDirectSoundBufferImpl *dsb);
HRESULT DSOUND_CaptureCreate(REFIID riid, LPDIRECTSOUNDCAPTURE *ppDSC);
HRESULT DSOUND_CaptureCreate8(REFIID riid, LPDIRECTSOUNDCAPTURE8 *ppDSC8);
+/* resample.c */
+DWORD DSOUND_PullBuffer(IDirectSoundBufferImpl *dsb, DWORD writepos, DWORD
mixlen);
+void DSOUND_RecalcFormat(IDirectSoundBufferImpl *dsb);
+
+
#define STATE_STOPPED 0
#define STATE_STARTING 1
#define STATE_PLAYING 2
--
1.7.2.3
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.winehq.org/pipermail/wine-patches/attachments/20110211/2aa4e39a/attachment.htm>
More information about the wine-patches
mailing list