winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
December 2006
----- 2025 -----
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
4 participants
720 discussions
Start a n
N
ew thread
Ken Thomases : winecoreaudio: Implement widAddBuffer.
by Alexandre Julliard
29 Dec '06
29 Dec '06
Module: wine Branch: master Commit: 58ea6abe726c935a602b210297a2cd4a76405704 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=58ea6abe726c935a602b21029…
Author: Ken Thomases <ken(a)codeweavers.com> Date: Thu Dec 28 11:06:02 2006 -0600 winecoreaudio: Implement widAddBuffer. --- dlls/winmm/winecoreaudio/audio.c | 31 +++++++++++++++++++++++++++++-- 1 files changed, 29 insertions(+), 2 deletions(-) diff --git a/dlls/winmm/winecoreaudio/audio.c b/dlls/winmm/winecoreaudio/audio.c index 51e71a8..f40d8f8 100644 --- a/dlls/winmm/winecoreaudio/audio.c +++ b/dlls/winmm/winecoreaudio/audio.c @@ -1666,6 +1666,9 @@ static DWORD widClose(WORD wDevID) */ static DWORD widAddBuffer(WORD wDevID, LPWAVEHDR lpWaveHdr, DWORD dwSize) { + DWORD ret = MMSYSERR_NOERROR; + WINE_WAVEIN* wwi; + TRACE("(%u, %p, %08X);\n", wDevID, lpWaveHdr, dwSize); if (wDevID >= MAX_WAVEINDRV) @@ -1684,8 +1687,32 @@ static DWORD widAddBuffer(WORD wDevID, L return WAVERR_STILLPLAYING; } - FIXME("unimplemented\n"); - return MMSYSERR_NOTENABLED; + wwi = &WInDev[wDevID]; + OSSpinLockLock(&wwi->lock); + + if (wwi->state == WINE_WS_CLOSED) + { + WARN("Trying to add buffer to closed device.\n"); + ret = MMSYSERR_INVALHANDLE; + } + else + { + LPWAVEHDR* wh; + + lpWaveHdr->dwFlags |= WHDR_INQUEUE; + lpWaveHdr->dwFlags &= ~WHDR_DONE; + lpWaveHdr->dwBytesRecorded = 0; + lpWaveHdr->lpNext = NULL; + + /* insert buffer at end of queue */ + for (wh = &(wwi->lpQueuePtr); *wh; wh = &((*wh)->lpNext)) + /* Do nothing */; + *wh = lpWaveHdr; + } + + OSSpinLockUnlock(&wwi->lock); + + return ret; }
1
0
0
0
Ken Thomases : winecoreaudio: Implement widOpen and widClose.
by Alexandre Julliard
29 Dec '06
29 Dec '06
Module: wine Branch: master Commit: 5432adaaac04ca76891f396b3d0966918db08a89 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=5432adaaac04ca76891f396b3…
Author: Ken Thomases <ken(a)codeweavers.com> Date: Thu Dec 28 11:05:31 2006 -0600 winecoreaudio: Implement widOpen and widClose. --- dlls/winmm/winecoreaudio/audio.c | 132 +++++++++++++++++++++++++++++++++++-- 1 files changed, 124 insertions(+), 8 deletions(-) diff --git a/dlls/winmm/winecoreaudio/audio.c b/dlls/winmm/winecoreaudio/audio.c index 0ab9109..51e71a8 100644 --- a/dlls/winmm/winecoreaudio/audio.c +++ b/dlls/winmm/winecoreaudio/audio.c @@ -160,6 +160,8 @@ typedef struct { typedef struct { /* Access to the following fields is synchronized across threads. */ volatile int state; + LPWAVEHDR lpQueuePtr; + DWORD dwTotalRecorded; /* Synchronization mechanism to protect above fields */ OSSpinLock lock; @@ -170,15 +172,20 @@ typedef struct { /* Record the arguments used when opening the device. */ WAVEOPENDESC waveDesc; WORD wFlags; + PCMWAVEFORMAT format; + + AudioUnit audioUnit; + + /* Record state of debug channels at open. Used to control fprintf's since + * we can't use Wine debug channel calls in non-Wine AudioUnit threads. */ + BOOL trace_on; + BOOL warn_on; + BOOL err_on; /* These fields aren't used. */ #if 0 CoreAudio_Device *cadev; - PCMWAVEFORMAT format; - LPWAVEHDR lpQueuePtr; - DWORD dwTotalRecorded; - AudioUnit audioUnit; AudioStreamBasicDescription streamDescription; #endif } WINE_WAVEIN; @@ -202,6 +209,9 @@ extern OSStatus AudioUnitUninitialize(Au extern int AudioUnit_SetVolume(AudioUnit au, float left, float right); extern int AudioUnit_GetVolume(AudioUnit au, float *left, float *right); +extern int AudioUnit_CreateInputUnit(void* wwi, AudioUnit* out_au, + WORD nChannels, DWORD nSamplesPerSec, WORD wBitsPerSample); + OSStatus CoreAudio_woAudioUnitIOProc(void *inRefCon, AudioUnitRenderActionFlags *ioActionFlags, const AudioTimeStamp *inTimeStamp, @@ -1510,6 +1520,8 @@ static DWORD widGetDevCaps(WORD wDevID, */ static DWORD widOpen(WORD wDevID, LPWAVEOPENDESC lpDesc, DWORD dwFlags) { + WINE_WAVEIN* wwi; + TRACE("(%u, %p, %08X);\n", wDevID, lpDesc, dwFlags); if (lpDesc == NULL) { @@ -1522,8 +1534,72 @@ static DWORD widOpen(WORD wDevID, LPWAVE return MMSYSERR_BADDEVICEID; } - FIXME("unimplemented\n"); - return MMSYSERR_NOTENABLED; + TRACE("Format: tag=%04X nChannels=%d nSamplesPerSec=%d wBitsPerSample=%d !\n", + lpDesc->lpFormat->wFormatTag, lpDesc->lpFormat->nChannels, + lpDesc->lpFormat->nSamplesPerSec, lpDesc->lpFormat->wBitsPerSample); + + if (lpDesc->lpFormat->wFormatTag != WAVE_FORMAT_PCM || + lpDesc->lpFormat->nChannels == 0 || + lpDesc->lpFormat->nSamplesPerSec == 0 + ) + { + WARN("Bad format: tag=%04X nChannels=%d nSamplesPerSec=%d wBitsPerSample=%d !\n", + lpDesc->lpFormat->wFormatTag, lpDesc->lpFormat->nChannels, + lpDesc->lpFormat->nSamplesPerSec, lpDesc->lpFormat->wBitsPerSample); + return WAVERR_BADFORMAT; + } + + if (dwFlags & WAVE_FORMAT_QUERY) + { + TRACE("Query format: tag=%04X nChannels=%d nSamplesPerSec=%d !\n", + lpDesc->lpFormat->wFormatTag, lpDesc->lpFormat->nChannels, + lpDesc->lpFormat->nSamplesPerSec); + return MMSYSERR_NOERROR; + } + + wwi = &WInDev[wDevID]; + if (!OSSpinLockTry(&wwi->lock)) + return MMSYSERR_ALLOCATED; + + if (wwi->state != WINE_WS_CLOSED) + { + OSSpinLockUnlock(&wwi->lock); + return MMSYSERR_ALLOCATED; + } + + wwi->state = WINE_WS_STOPPED; + wwi->wFlags = HIWORD(dwFlags & CALLBACK_TYPEMASK); + + memcpy(&wwi->waveDesc, lpDesc, sizeof(WAVEOPENDESC)); + memcpy(&wwi->format, lpDesc->lpFormat, sizeof(PCMWAVEFORMAT)); + + if (wwi->format.wBitsPerSample == 0) + { + WARN("Resetting zeroed wBitsPerSample\n"); + wwi->format.wBitsPerSample = 8 * + (wwi->format.wf.nAvgBytesPerSec / + wwi->format.wf.nSamplesPerSec) / + wwi->format.wf.nChannels; + } + + wwi->dwTotalRecorded = 0; + + wwi->trace_on = TRACE_ON(wave); + wwi->warn_on = WARN_ON(wave); + wwi->err_on = ERR_ON(wave); + + if (!AudioUnit_CreateInputUnit(wwi, &wwi->audioUnit, + wwi->format.wf.nChannels, wwi->format.wf.nSamplesPerSec, + wwi->format.wBitsPerSample)) + { + ERR("AudioUnit_CreateInputUnit failed\n"); + OSSpinLockUnlock(&wwi->lock); + return MMSYSERR_ERROR; + } + + OSSpinLockUnlock(&wwi->lock); + + return widNotifyClient(wwi, WIM_OPEN, 0L, 0L); } @@ -1532,6 +1608,9 @@ static DWORD widOpen(WORD wDevID, LPWAVE */ static DWORD widClose(WORD wDevID) { + DWORD ret = MMSYSERR_NOERROR; + WINE_WAVEIN* wwi; + TRACE("(%u);\n", wDevID); if (wDevID >= MAX_WAVEINDRV) @@ -1540,8 +1619,45 @@ static DWORD widClose(WORD wDevID) return MMSYSERR_BADDEVICEID; } - FIXME("unimplemented\n"); - return MMSYSERR_NOTENABLED; + wwi = &WInDev[wDevID]; + OSSpinLockLock(&wwi->lock); + if (wwi->state == WINE_WS_CLOSED) + { + WARN("Device already closed.\n"); + ret = MMSYSERR_INVALHANDLE; + } + else if (wwi->lpQueuePtr) + { + WARN("Buffers in queue.\n"); + ret = WAVERR_STILLPLAYING; + } + else + { + wwi->state = WINE_WS_CLOSED; + } + + OSSpinLockUnlock(&wwi->lock); + + if (ret == MMSYSERR_NOERROR) + { + OSStatus err = AudioUnitUninitialize(wwi->audioUnit); + if (err) + { + ERR("AudioUnitUninitialize return %c%c%c%c\n", (char) (err >> 24), + (char) (err >> 16), + (char) (err >> 8), + (char) err); + } + + if (!AudioUnit_CloseAudioUnit(wwi->audioUnit)) + { + ERR("Can't close AudioUnit\n"); + } + + ret = widNotifyClient(wwi, WIM_CLOSE, 0L, 0L); + } + + return ret; }
1
0
0
0
Ken Thomases : winecoreaudio: Add AudioUnit_CreateInputUnit to create an input audio unit.
by Alexandre Julliard
29 Dec '06
29 Dec '06
Module: wine Branch: master Commit: 30a1b293516d03457a98b8758c3bee5e38052de1 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=30a1b293516d03457a98b8758…
Author: Ken Thomases <ken(a)codeweavers.com> Date: Thu Dec 28 11:05:24 2006 -0600 winecoreaudio: Add AudioUnit_CreateInputUnit to create an input audio unit. --- dlls/winmm/winecoreaudio/audiounit.c | 133 ++++++++++++++++++++++++++++++++++ 1 files changed, 133 insertions(+), 0 deletions(-) diff --git a/dlls/winmm/winecoreaudio/audiounit.c b/dlls/winmm/winecoreaudio/audiounit.c index fe1c7ec..03b4d00 100644 --- a/dlls/winmm/winecoreaudio/audiounit.c +++ b/dlls/winmm/winecoreaudio/audiounit.c @@ -33,6 +33,13 @@ extern OSStatus CoreAudio_woAudioUnitIOP UInt32 inNumberFrames, AudioBufferList *ioData); +extern OSStatus CoreAudio_wiAudioUnitIOProc(void *inRefCon, + AudioUnitRenderActionFlags *ioActionFlags, + const AudioTimeStamp *inTimeStamp, + UInt32 inBusNumber, + UInt32 inNumberFrames, + AudioBufferList *ioData); + int AudioUnit_CreateDefaultAudioUnit(void *wwo, AudioUnit *au) { OSStatus err; @@ -121,4 +128,130 @@ int AudioUnit_GetVolume(AudioUnit au, fl *right = *left; return 1; } + + +int AudioUnit_CreateInputUnit(void* wwi, AudioUnit* out_au, + WORD nChannels, DWORD nSamplesPerSec, WORD wBitsPerSample) +{ + OSStatus err = noErr; + ComponentDescription description; + Component component; + AudioUnit au; + UInt32 param; + AURenderCallbackStruct callback; + AudioDeviceID defaultInputDevice; + AudioStreamBasicDescription desiredFormat; + + + /* Open the AudioOutputUnit */ + description.componentType = kAudioUnitType_Output; + description.componentSubType = kAudioUnitSubType_HALOutput; + description.componentManufacturer = kAudioUnitManufacturer_Apple; + description.componentFlags = 0; + description.componentFlagsMask = 0; + + component = FindNextComponent(NULL, &description); + if (!component) + { + ERR("FindNextComponent(kAudioUnitSubType_HALOutput) failed\n"); + return 0; + } + + err = OpenAComponent(component, &au); + if (err != noErr || au == NULL) + { + ERR("OpenAComponent failed: %08lx\n", err); + return 0; + } + + /* Configure the AudioOutputUnit */ + /* The AUHAL has two buses (AKA elements). Bus 0 is output from the app + * to the device. Bus 1 is input from the device to the app. Each bus + * has two ends (AKA scopes). Data goes from the input scope to the + * output scope. The terminology is somewhat confusing because the terms + * "input" and "output" have two meanings. Here's a summary: + * + * Bus 0, input scope: refers to the source of data to be output as sound + * Bus 0, output scope: refers to the actual sound output device + * Bus 1, input scope: refers to the actual sound input device + * Bus 1, output scope: refers to the destination of data received by the input device + */ + + /* Enable input on the AUHAL */ + param = 1; + err = AudioUnitSetProperty(au, kAudioOutputUnitProperty_EnableIO, kAudioUnitScope_Input, 1, ¶m, sizeof(param)); + if (err != noErr) + { + ERR("Couldn't enable input on AUHAL: %08lx\n", err); + goto error; + } + + /* Disable Output on the AUHAL */ + param = 0; + err = AudioUnitSetProperty(au, kAudioOutputUnitProperty_EnableIO, kAudioUnitScope_Output, 0, ¶m, sizeof(param)); + if (err != noErr) + { + ERR("Couldn't disable output on AUHAL: %08lx\n", err); + goto error; + } + + /* Find the default input device */ + param = sizeof(defaultInputDevice); + err = AudioHardwareGetProperty(kAudioHardwarePropertyDefaultInputDevice, ¶m, &defaultInputDevice); + if (err != noErr || defaultInputDevice == kAudioDeviceUnknown) + { + ERR("Couldn't get the default audio device ID: %08lx\n", err); + goto error; + } + + /* Set the current device to the default input device. */ + err = AudioUnitSetProperty(au, kAudioOutputUnitProperty_CurrentDevice, kAudioUnitScope_Global, 0, &defaultInputDevice, sizeof(defaultInputDevice)); + if (err != noErr) + { + ERR("Couldn't set current device of AUHAL to default input device: %08lx\n", err); + goto error; + } + + /* Setup render callback */ + /* This will be called when the AUHAL has input data. However, it won't + * be passed the data itself. The callback will have to all AudioUnitRender. */ + callback.inputProc = CoreAudio_wiAudioUnitIOProc; + callback.inputProcRefCon = wwi; + err = AudioUnitSetProperty(au, kAudioOutputUnitProperty_SetInputCallback, kAudioUnitScope_Global, 0, &callback, sizeof(callback)); + if (err != noErr) + { + ERR("Couldn't set input callback of AUHAL: %08lx\n", err); + goto error; + } + + /* Setup the desired data format. */ + desiredFormat.mFormatID = kAudioFormatLinearPCM; + desiredFormat.mFormatFlags = kLinearPCMFormatFlagIsPacked; + if (wBitsPerSample != 8) + desiredFormat.mFormatFlags |= kLinearPCMFormatFlagIsSignedInteger; + desiredFormat.mSampleRate = nSamplesPerSec; + desiredFormat.mChannelsPerFrame = nChannels; + desiredFormat.mFramesPerPacket = 1; + desiredFormat.mBitsPerChannel = wBitsPerSample; + desiredFormat.mBytesPerFrame = desiredFormat.mBitsPerChannel * desiredFormat.mChannelsPerFrame / 8; + desiredFormat.mBytesPerPacket = desiredFormat.mBytesPerFrame * desiredFormat.mFramesPerPacket; + + /* Set the AudioOutputUnit output data format */ + err = AudioUnitSetProperty(au, kAudioUnitProperty_StreamFormat, kAudioUnitScope_Output, 1, &desiredFormat, sizeof(desiredFormat)); + if (err != noErr) + { + ERR("Couldn't set desired input format of AUHAL: %08lx\n", err); + goto error; + } + + *out_au = au; + + return 1; + +error: + if (au) + CloseComponent(au); + return 0; +} + #endif
1
0
0
0
Ken Thomases : winecoreaudio: Add stub implementation of CoreAudio_wiAudioUnitIOProc.
by Alexandre Julliard
29 Dec '06
29 Dec '06
Module: wine Branch: master Commit: 8ba3daaf5c9ba7430476c99f7108a7397b204d81 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=8ba3daaf5c9ba7430476c99f7…
Author: Ken Thomases <ken(a)codeweavers.com> Date: Thu Dec 28 11:05:15 2006 -0600 winecoreaudio: Add stub implementation of CoreAudio_wiAudioUnitIOProc. It will serve as the input callback called when our Audio Unit has sound data available. --- dlls/winmm/winecoreaudio/audio.c | 17 +++++++++++++++++ 1 files changed, 17 insertions(+), 0 deletions(-) diff --git a/dlls/winmm/winecoreaudio/audio.c b/dlls/winmm/winecoreaudio/audio.c index 1f3e6a7..0ab9109 100644 --- a/dlls/winmm/winecoreaudio/audio.c +++ b/dlls/winmm/winecoreaudio/audio.c @@ -208,6 +208,12 @@ OSStatus CoreAudio_woAudioUnitIOProc(voi UInt32 inBusNumber, UInt32 inNumberFrames, AudioBufferList *ioData); +OSStatus CoreAudio_wiAudioUnitIOProc(void *inRefCon, + AudioUnitRenderActionFlags *ioActionFlags, + const AudioTimeStamp *inTimeStamp, + UInt32 inBusNumber, + UInt32 inNumberFrames, + AudioBufferList *ioData); /* These strings used only for tracing */ @@ -1685,6 +1691,17 @@ DWORD WINAPI CoreAudio_widMessage(WORD w return MMSYSERR_NOTSUPPORTED; } + +OSStatus CoreAudio_wiAudioUnitIOProc(void *inRefCon, + AudioUnitRenderActionFlags *ioActionFlags, + const AudioTimeStamp *inTimeStamp, + UInt32 inBusNumber, + UInt32 inNumberFrames, + AudioBufferList *ioData) +{ + return noErr; +} + #else /**************************************************************************
1
0
0
0
Ken Thomases : winecoreaudio: Initial implementation of widGetDevCaps.
by Alexandre Julliard
29 Dec '06
29 Dec '06
Module: wine Branch: master Commit: 5319b64b39f090c2f6ed55d2ba2bcc25721920c9 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=5319b64b39f090c2f6ed55d2b…
Author: Ken Thomases <ken(a)codeweavers.com> Date: Thu Dec 28 11:03:50 2006 -0600 winecoreaudio: Initial implementation of widGetDevCaps. --- dlls/winmm/winecoreaudio/audio.c | 64 ++++++++++++++++++++++++++++++-------- 1 files changed, 51 insertions(+), 13 deletions(-) diff --git a/dlls/winmm/winecoreaudio/audio.c b/dlls/winmm/winecoreaudio/audio.c index 1b07bed..1f3e6a7 100644 --- a/dlls/winmm/winecoreaudio/audio.c +++ b/dlls/winmm/winecoreaudio/audio.c @@ -158,27 +158,33 @@ typedef struct { } WINE_WAVEOUT; typedef struct { + /* Access to the following fields is synchronized across threads. */ volatile int state; - CoreAudio_Device *cadev; + + /* Synchronization mechanism to protect above fields */ + OSSpinLock lock; + + /* Capabilities description */ + WAVEINCAPSW caps; + + /* Record the arguments used when opening the device. */ WAVEOPENDESC waveDesc; WORD wFlags; + +/* These fields aren't used. */ +#if 0 + CoreAudio_Device *cadev; PCMWAVEFORMAT format; LPWAVEHDR lpQueuePtr; DWORD dwTotalRecorded; - WAVEINCAPSW caps; - + AudioUnit audioUnit; AudioStreamBasicDescription streamDescription; - - /* BOOL bTriggerSupport; - WORD wDevID; - char interface_name[32];*/ - - /* synchronization stuff */ - OSSpinLock lock; +#endif } WINE_WAVEIN; static WINE_WAVEOUT WOutDev [MAX_WAVEOUTDRV]; +static WINE_WAVEIN WInDev [MAX_WAVEINDRV]; static CFMessagePortRef Port_SendToMessageThread; @@ -505,7 +511,39 @@ LONG CoreAudio_WaveInit(void) WOutDev[i].lock = 0; /* initialize the mutex */ } - + + for (i = 0; i < MAX_WAVEINDRV; ++i) + { + memset(&WInDev[i], 0, sizeof(WInDev[i])); + + /* Establish preconditions for widOpen */ + WInDev[i].state = WINE_WS_CLOSED; + WInDev[i].lock = 0; /* initialize the mutex */ + + /* Fill in capabilities. widGetDevCaps can be called at any time. */ + WInDev[i].caps.wMid = 0xcafe; /* Manufac ID */ + WInDev[i].caps.wPid = 0x0001; /* Product ID */ + WInDev[i].caps.vDriverVersion = 0x0001; + + snprintf(szPname, sizeof(szPname), "CoreAudio WaveIn %d", i); + MultiByteToWideChar(CP_ACP, 0, szPname, -1, WInDev[i].caps.szPname, sizeof(WInDev[i].caps.szPname)/sizeof(WCHAR)); + + WInDev[i].caps.dwFormats |= WAVE_FORMAT_4M08; + WInDev[i].caps.dwFormats |= WAVE_FORMAT_4S08; + WInDev[i].caps.dwFormats |= WAVE_FORMAT_4S16; + WInDev[i].caps.dwFormats |= WAVE_FORMAT_4M16; + WInDev[i].caps.dwFormats |= WAVE_FORMAT_2M08; + WInDev[i].caps.dwFormats |= WAVE_FORMAT_2S08; + WInDev[i].caps.dwFormats |= WAVE_FORMAT_2M16; + WInDev[i].caps.dwFormats |= WAVE_FORMAT_2S16; + WInDev[i].caps.dwFormats |= WAVE_FORMAT_1M08; + WInDev[i].caps.dwFormats |= WAVE_FORMAT_1S08; + WInDev[i].caps.dwFormats |= WAVE_FORMAT_1M16; + WInDev[i].caps.dwFormats |= WAVE_FORMAT_1S16; + + WInDev[i].caps.wChannels = 2; + } + /* create mach messages handler */ srandomdev(); messageThreadPortName = CFStringCreateWithFormat(kCFAllocatorDefault, NULL, @@ -1456,8 +1494,8 @@ static DWORD widGetDevCaps(WORD wDevID, return MMSYSERR_BADDEVICEID; } - FIXME("unimplemented\n"); - return MMSYSERR_NOTENABLED; + memcpy(lpCaps, &WInDev[wDevID].caps, min(dwSize, sizeof(*lpCaps))); + return MMSYSERR_NOERROR; }
1
0
0
0
Ken Thomases : winecoreaudio: Initial stub implementation of audio input support.
by Alexandre Julliard
29 Dec '06
29 Dec '06
Module: wine Branch: master Commit: eccfe6e8a30a7826926fd5c1be0cae7f24660d8c URL:
http://source.winehq.org/git/wine.git/?a=commit;h=eccfe6e8a30a7826926fd5c1b…
Author: Ken Thomases <ken(a)codeweavers.com> Date: Thu Dec 28 11:03:26 2006 -0600 winecoreaudio: Initial stub implementation of audio input support. --- dlls/winmm/winecoreaudio/audio.c | 253 ++++++++++++++++++++++- dlls/winmm/winecoreaudio/winecoreaudio.drv.spec | 1 + 2 files changed, 253 insertions(+), 1 deletions(-) diff --git a/dlls/winmm/winecoreaudio/audio.c b/dlls/winmm/winecoreaudio/audio.c index d7dc314..1b07bed 100644 --- a/dlls/winmm/winecoreaudio/audio.c +++ b/dlls/winmm/winecoreaudio/audio.c @@ -1259,7 +1259,7 @@ static DWORD wodDevInterface(UINT wDevID } /************************************************************************** -* wodMessage (WINEJACK.7) +* wodMessage (WINECOREAUDIO.7) */ DWORD WINAPI CoreAudio_wodMessage(UINT wDevID, UINT wMsg, DWORD dwUser, DWORD dwParam1, DWORD dwParam2) @@ -1406,9 +1406,260 @@ OSStatus CoreAudio_woAudioUnitIOProc(voi if (needNotify) wodSendNotifyCompletionsMessage(wwo); return noErr; } + + +/*======================================================================* + * Low level WAVE IN implementation * + *======================================================================*/ + +/************************************************************************** + * widNotifyClient [internal] + */ +static DWORD widNotifyClient(WINE_WAVEIN* wwi, WORD wMsg, DWORD dwParam1, DWORD dwParam2) +{ + TRACE("wMsg = 0x%04x dwParm1 = %04X dwParam2 = %04X\n", wMsg, dwParam1, dwParam2); + + switch (wMsg) + { + case WIM_OPEN: + case WIM_CLOSE: + case WIM_DATA: + if (wwi->wFlags != DCB_NULL && + !DriverCallback(wwi->waveDesc.dwCallback, wwi->wFlags, + (HDRVR)wwi->waveDesc.hWave, wMsg, wwi->waveDesc.dwInstance, + dwParam1, dwParam2)) + { + WARN("can't notify client !\n"); + return MMSYSERR_ERROR; + } + break; + default: + FIXME("Unknown callback message %u\n", wMsg); + return MMSYSERR_INVALPARAM; + } + return MMSYSERR_NOERROR; +} + + +/************************************************************************** + * widGetDevCaps [internal] + */ +static DWORD widGetDevCaps(WORD wDevID, LPWAVEINCAPSW lpCaps, DWORD dwSize) +{ + TRACE("(%u, %p, %u);\n", wDevID, lpCaps, dwSize); + + if (lpCaps == NULL) return MMSYSERR_NOTENABLED; + + if (wDevID >= MAX_WAVEINDRV) + { + TRACE("MAX_WAVEINDRV reached !\n"); + return MMSYSERR_BADDEVICEID; + } + + FIXME("unimplemented\n"); + return MMSYSERR_NOTENABLED; +} + + +/************************************************************************** + * widOpen [internal] + */ +static DWORD widOpen(WORD wDevID, LPWAVEOPENDESC lpDesc, DWORD dwFlags) +{ + TRACE("(%u, %p, %08X);\n", wDevID, lpDesc, dwFlags); + if (lpDesc == NULL) + { + WARN("Invalid Parameter !\n"); + return MMSYSERR_INVALPARAM; + } + if (wDevID >= MAX_WAVEINDRV) + { + TRACE ("MAX_WAVEINDRV reached !\n"); + return MMSYSERR_BADDEVICEID; + } + + FIXME("unimplemented\n"); + return MMSYSERR_NOTENABLED; +} + + +/************************************************************************** + * widClose [internal] + */ +static DWORD widClose(WORD wDevID) +{ + TRACE("(%u);\n", wDevID); + + if (wDevID >= MAX_WAVEINDRV) + { + WARN("bad device ID !\n"); + return MMSYSERR_BADDEVICEID; + } + + FIXME("unimplemented\n"); + return MMSYSERR_NOTENABLED; +} + + +/************************************************************************** + * widAddBuffer [internal] + */ +static DWORD widAddBuffer(WORD wDevID, LPWAVEHDR lpWaveHdr, DWORD dwSize) +{ + TRACE("(%u, %p, %08X);\n", wDevID, lpWaveHdr, dwSize); + + if (wDevID >= MAX_WAVEINDRV) + { + WARN("invalid device ID\n"); + return MMSYSERR_INVALHANDLE; + } + if (!(lpWaveHdr->dwFlags & WHDR_PREPARED)) + { + TRACE("never been prepared !\n"); + return WAVERR_UNPREPARED; + } + if (lpWaveHdr->dwFlags & WHDR_INQUEUE) + { + TRACE("header already in use !\n"); + return WAVERR_STILLPLAYING; + } + + FIXME("unimplemented\n"); + return MMSYSERR_NOTENABLED; +} + + +/************************************************************************** + * widStart [internal] + */ +static DWORD widStart(WORD wDevID) +{ + TRACE("(%u);\n", wDevID); + if (wDevID >= MAX_WAVEINDRV) + { + WARN("invalid device ID\n"); + return MMSYSERR_INVALHANDLE; + } + + FIXME("unimplemented\n"); + return MMSYSERR_NOTENABLED; +} + + +/************************************************************************** + * widStop [internal] + */ +static DWORD widStop(WORD wDevID) +{ + TRACE("(%u);\n", wDevID); + if (wDevID >= MAX_WAVEINDRV) + { + WARN("invalid device ID\n"); + return MMSYSERR_INVALHANDLE; + } + + FIXME("unimplemented\n"); + return MMSYSERR_NOTENABLED; +} + + +/************************************************************************** + * widReset [internal] + */ +static DWORD widReset(WORD wDevID) +{ + TRACE("(%u);\n", wDevID); + if (wDevID >= MAX_WAVEINDRV) + { + WARN("invalid device ID\n"); + return MMSYSERR_INVALHANDLE; + } + + FIXME("unimplemented\n"); + return MMSYSERR_NOTENABLED; +} + + +/************************************************************************** + * widGetNumDevs [internal] + */ +static DWORD widGetNumDevs(void) +{ + return MAX_WAVEINDRV; +} + + +/************************************************************************** + * widDevInterfaceSize [internal] + */ +static DWORD widDevInterfaceSize(UINT wDevID, LPDWORD dwParam1) +{ + TRACE("(%u, %p)\n", wDevID, dwParam1); + + FIXME("unimplemented\n"); + return MMSYSERR_NOTENABLED; +} + + +/************************************************************************** + * widDevInterface [internal] + */ +static DWORD widDevInterface(UINT wDevID, PWCHAR dwParam1, DWORD dwParam2) +{ + FIXME("unimplemented\n"); + return MMSYSERR_NOTENABLED; +} + + +/************************************************************************** + * widMessage (WINECOREAUDIO.6) + */ +DWORD WINAPI CoreAudio_widMessage(WORD wDevID, WORD wMsg, DWORD dwUser, + DWORD dwParam1, DWORD dwParam2) +{ + TRACE("(%u, %04X, %08X, %08X, %08X);\n", + wDevID, wMsg, dwUser, dwParam1, dwParam2); + + switch (wMsg) + { + case DRVM_INIT: + case DRVM_EXIT: + case DRVM_ENABLE: + case DRVM_DISABLE: + /* FIXME: Pretend this is supported */ + return 0; + case WIDM_OPEN: return widOpen (wDevID, (LPWAVEOPENDESC)dwParam1, dwParam2); + case WIDM_CLOSE: return widClose (wDevID); + case WIDM_ADDBUFFER: return widAddBuffer (wDevID, (LPWAVEHDR)dwParam1, dwParam2); + case WIDM_PREPARE: return MMSYSERR_NOTSUPPORTED; + case WIDM_UNPREPARE: return MMSYSERR_NOTSUPPORTED; + case WIDM_GETDEVCAPS: return widGetDevCaps (wDevID, (LPWAVEINCAPSW)dwParam1, dwParam2); + case WIDM_GETNUMDEVS: return widGetNumDevs (); + case WIDM_RESET: return widReset (wDevID); + case WIDM_START: return widStart (wDevID); + case WIDM_STOP: return widStop (wDevID); + case DRV_QUERYDEVICEINTERFACESIZE: return widDevInterfaceSize (wDevID, (LPDWORD)dwParam1); + case DRV_QUERYDEVICEINTERFACE: return widDevInterface (wDevID, (PWCHAR)dwParam1, dwParam2); + default: + FIXME("unknown message %d!\n", wMsg); + } + + return MMSYSERR_NOTSUPPORTED; +} + #else /************************************************************************** + * widMessage (WINECOREAUDIO.6) + */ +DWORD WINAPI CoreAudio_widMessage(WORD wDevID, WORD wMsg, DWORD dwUser, + DWORD dwParam1, DWORD dwParam2) +{ + FIXME("(%u, %04X, %08X, %08X, %08X): CoreAudio support not compiled into wine\n", wDevID, wMsg, dwUser, dwParam1, dwParam2); + return MMSYSERR_NOTENABLED; +} + +/************************************************************************** * wodMessage (WINECOREAUDIO.7) */ DWORD WINAPI CoreAudio_wodMessage(WORD wDevID, WORD wMsg, DWORD dwUser, diff --git a/dlls/winmm/winecoreaudio/winecoreaudio.drv.spec b/dlls/winmm/winecoreaudio/winecoreaudio.drv.spec index 4445838..49fbfb2 100644 --- a/dlls/winmm/winecoreaudio/winecoreaudio.drv.spec +++ b/dlls/winmm/winecoreaudio/winecoreaudio.drv.spec @@ -1,2 +1,3 @@ @ stdcall -private DriverProc(long long long long long) CoreAudio_DriverProc +@ stdcall -private widMessage(long long long long long) CoreAudio_widMessage @ stdcall -private wodMessage(long long long long long) CoreAudio_wodMessage
1
0
0
0
Chris Robinson : d3d8: Don't report Shader Model 2.0 or higher.
by Alexandre Julliard
29 Dec '06
29 Dec '06
Module: wine Branch: master Commit: b66a52856c6767fd4b345ea04fe0277bf24117b6 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=b66a52856c6767fd4b345ea04…
Author: Chris Robinson <chris.kcat(a)gmail.com> Date: Sat Dec 23 05:41:53 2006 -0800 d3d8: Don't report Shader Model 2.0 or higher. --- dlls/d3d8/device.c | 9 +++++++++ dlls/d3d8/directx.c | 9 +++++++++ dlls/d3d8/tests/device.c | 21 +++++++++++++++++++++ 3 files changed, 39 insertions(+), 0 deletions(-) diff --git a/dlls/d3d8/device.c b/dlls/d3d8/device.c index b21eb6c..e9bc3ac 100644 --- a/dlls/d3d8/device.c +++ b/dlls/d3d8/device.c @@ -169,6 +169,15 @@ static HRESULT WINAPI IDirect3DDevice8Im D3D8CAPSTOWINECAPS(pCaps, pWineCaps) hrc = IWineD3DDevice_GetDeviceCaps(This->WineD3DDevice, pWineCaps); HeapFree(GetProcessHeap(), 0, pWineCaps); + + /* D3D8 doesn't support SM 2.0 or higher, so clamp to 1.x */ + if(pCaps->PixelShaderVersion > D3DPS_VERSION(1,4)){ + pCaps->PixelShaderVersion = D3DPS_VERSION(1,4); + } + if(pCaps->VertexShaderVersion > D3DVS_VERSION(1,1)){ + pCaps->VertexShaderVersion = D3DVS_VERSION(1,1); + } + TRACE("Returning %p %p\n", This, pCaps); return hrc; } diff --git a/dlls/d3d8/directx.c b/dlls/d3d8/directx.c index c3d0679..8b6ff6c 100644 --- a/dlls/d3d8/directx.c +++ b/dlls/d3d8/directx.c @@ -176,6 +176,15 @@ static HRESULT WINAPI IDirect3D8Impl_G D3D8CAPSTOWINECAPS(pCaps, pWineCaps) hrc = IWineD3D_GetDeviceCaps(This->WineD3D, Adapter, DeviceType, pWineCaps); HeapFree(GetProcessHeap(), 0, pWineCaps); + + /* D3D8 doesn't support SM 2.0 or higher, so clamp to 1.x */ + if(pCaps->PixelShaderVersion > D3DPS_VERSION(1,4)){ + pCaps->PixelShaderVersion = D3DPS_VERSION(1,4); + } + if(pCaps->VertexShaderVersion > D3DVS_VERSION(1,1)){ + pCaps->VertexShaderVersion = D3DVS_VERSION(1,1); + } + TRACE("(%p) returning %p\n", This, pCaps); return hrc; } diff --git a/dlls/d3d8/tests/device.c b/dlls/d3d8/tests/device.c index 0214117..b3c4c64 100644 --- a/dlls/d3d8/tests/device.c +++ b/dlls/d3d8/tests/device.c @@ -696,6 +696,26 @@ cleanup: if(pDevice) IDirect3D8_Release(pDevice); } +static void test_shader_versions(void) +{ + HRESULT hr; + IDirect3D8 *pD3d = NULL; + D3DCAPS8 d3dcaps; + + pD3d = pDirect3DCreate8( D3D_SDK_VERSION ); + ok(pD3d != NULL, "Failed to create IDirect3D8 object\n"); + if (pD3d != NULL) { + hr = IDirect3D8_GetDeviceCaps(pD3d, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, &d3dcaps); + ok(SUCCEEDED(hr), "Failed to get D3D8 caps (%s)\n", DXGetErrorString8(hr)); + if (SUCCEEDED(hr)) { + ok(d3dcaps.VertexShaderVersion <= D3DVS_VERSION(1,1), "Unexpected VertexShaderVersion (%#x > %#x)\n", d3dcaps.VertexShaderVersion, D3DVS_VERSION(1,1)); + ok(d3dcaps.PixelShaderVersion <= D3DPS_VERSION(1,4), "Unexpected PixelShaderVersion (%#x > %#x)\n", d3dcaps.PixelShaderVersion, D3DPS_VERSION(1,4)); + } + IDirect3D8_Release(pD3d); + } +} + + /* Test adapter display modes */ static void test_display_modes(void) { @@ -733,6 +753,7 @@ START_TEST(device) if (pDirect3DCreate8) { test_display_modes(); + test_shader_versions(); test_swapchain(); test_refcount(); test_mipmap_levels();
1
0
0
0
Stefan Dösinger : wined3d: Add empty transform states to the state table.
by Alexandre Julliard
29 Dec '06
29 Dec '06
Module: wine Branch: master Commit: b58715e8abeecf7342c6430c7af42b6892708198 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=b58715e8abeecf7342c6430c7…
Author: Stefan Dösinger <stefandoesinger(a)gmx.at> Date: Thu Dec 28 18:57:16 2006 +0100 wined3d: Add empty transform states to the state table. --- dlls/wined3d/state.c | 514 ++++++++++++++++++++++++++++++++++++++++ dlls/wined3d/wined3d_private.h | 5 +- 2 files changed, 518 insertions(+), 1 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=b58715e8abeecf7342c64…
1
0
0
0
Stefan Dösinger : wined3d: Do not setup states for unlocking if unlocking is disabled.
by Alexandre Julliard
29 Dec '06
29 Dec '06
Module: wine Branch: master Commit: 603038a07af6efd73aad4472a2ad0a6447403068 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=603038a07af6efd73aad4472a…
Author: Stefan Dösinger <stefandoesinger(a)gmx.at> Date: Thu Dec 28 18:30:12 2006 +0100 wined3d: Do not setup states for unlocking if unlocking is disabled. --- dlls/wined3d/surface.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c index c030f36..b3799da 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c @@ -1141,7 +1141,7 @@ static HRESULT WINAPI IWineD3DSurfaceImp IWineD3DSwapChainImpl *implSwapChain; IWineD3DDevice_GetSwapChain((IWineD3DDevice *)myDevice, 0, (IWineD3DSwapChain **)&implSwapChain); - if (backbuf || iface == implSwapChain->frontBuffer || iface == myDevice->render_targets[0]) { + if ((backbuf || iface == implSwapChain->frontBuffer || iface == myDevice->render_targets[0]) && wined3d_settings.rendertargetlock_mode != RTL_DISABLE) { int tex; ENTER_GL(); @@ -1221,7 +1221,7 @@ static HRESULT WINAPI IWineD3DSurfaceImp /** restore clean dirty state */ IWineD3DSurface_CleanDirtyRect(iface); - } else { + } else if(wined3d_settings.rendertargetlock_mode != RTL_DISABLE) { FIXME("unsupported unlocking to Rendering surface surf@%p usage(%s)\n", This, debug_d3dusage(This->resource.usage)); } IWineD3DSwapChain_Release((IWineD3DSwapChain *)implSwapChain);
1
0
0
0
Andrew Talbot : sane.ds: Qualify use of WINE_DEFAULT_DEBUG_CHANNEL.
by Alexandre Julliard
29 Dec '06
29 Dec '06
Module: wine Branch: master Commit: ea93e5fb240c3c7eb80820d9ab5bd6f91c982f00 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=ea93e5fb240c3c7eb80820d9a…
Author: Andrew Talbot <Andrew.Talbot(a)talbotville.com> Date: Thu Dec 28 22:03:01 2006 +0000 sane.ds: Qualify use of WINE_DEFAULT_DEBUG_CHANNEL. With grateful acknowledgement to Marcus Meissner. --- dlls/sane.ds/ui.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dlls/sane.ds/ui.c b/dlls/sane.ds/ui.c index befb5cc..da9dfb9 100644 --- a/dlls/sane.ds/ui.c +++ b/dlls/sane.ds/ui.c @@ -37,10 +37,10 @@ #include "wine/debug.h" #include "resource.h" -WINE_DEFAULT_DEBUG_CHANNEL(twain); - #ifdef HAVE_SANE +WINE_DEFAULT_DEBUG_CHANNEL(twain); + #define ID_BASE 0x100 #define ID_EDIT_BASE 0x1000 #define ID_STATIC_BASE 0x2000
1
0
0
0
← Newer
1
2
3
4
5
6
7
8
...
72
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
Results per page:
10
25
50
100
200