Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
fa844516
Commit
fa844516
authored
Dec 28, 2006
by
Ken Thomases
Committed by
Alexandre Julliard
Dec 29, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winecoreaudio: Implement CoreAudio_wiAudioUnitIOProc, the input callback.
parent
959ec2aa
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
73 additions
and
1 deletion
+73
-1
audio.c
dlls/winmm/winecoreaudio/audio.c
+73
-1
No files found.
dlls/winmm/winecoreaudio/audio.c
View file @
fa844516
...
@@ -68,6 +68,15 @@ enum
...
@@ -68,6 +68,15 @@ enum
};
};
typedef
UInt32
AudioUnitRenderActionFlags
;
typedef
UInt32
AudioUnitRenderActionFlags
;
typedef
long
ComponentResult
;
extern
ComponentResult
AudioUnitRender
(
AudioUnit
ci
,
AudioUnitRenderActionFlags
*
ioActionFlags
,
const
AudioTimeStamp
*
inTimeStamp
,
UInt32
inOutputBusNumber
,
UInt32
inNumberFrames
,
AudioBufferList
*
ioData
)
AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER
;
/* only allow 10 output devices through this driver, this ought to be adequate */
/* only allow 10 output devices through this driver, this ought to be adequate */
#define MAX_WAVEOUTDRV (1)
#define MAX_WAVEOUTDRV (1)
#define MAX_WAVEINDRV (1)
#define MAX_WAVEINDRV (1)
...
@@ -2118,7 +2127,70 @@ OSStatus CoreAudio_wiAudioUnitIOProc(void *inRefCon,
...
@@ -2118,7 +2127,70 @@ OSStatus CoreAudio_wiAudioUnitIOProc(void *inRefCon,
UInt32
inNumberFrames
,
UInt32
inNumberFrames
,
AudioBufferList
*
ioData
)
AudioBufferList
*
ioData
)
{
{
return
noErr
;
WINE_WAVEIN
*
wwi
=
(
WINE_WAVEIN
*
)
inRefCon
;
OSStatus
err
=
noErr
;
BOOL
needNotify
=
FALSE
;
WAVEHDR
*
lpStorePtr
;
unsigned
int
dataToStore
;
unsigned
int
dataStored
=
0
;
if
(
wwi
->
trace_on
)
fprintf
(
stderr
,
"trace:wave:CoreAudio_wiAudioUnitIOProc (ioActionFlags = %08lx, inTimeStamp = { %f, %llu, %f, %llu, %08lx }, inBusNumber = %lu, inNumberFrames = %lu)
\n
"
,
*
ioActionFlags
,
inTimeStamp
->
mSampleTime
,
inTimeStamp
->
mHostTime
,
inTimeStamp
->
mRateScalar
,
inTimeStamp
->
mWordClockTime
,
inTimeStamp
->
mFlags
,
inBusNumber
,
inNumberFrames
);
/* Render into audio buffer */
err
=
AudioUnitRender
(
wwi
->
audioUnit
,
ioActionFlags
,
inTimeStamp
,
inBusNumber
,
inNumberFrames
,
wwi
->
bufferList
);
if
(
err
)
{
if
(
wwi
->
err_on
)
fprintf
(
stderr
,
"err:wave:CoreAudio_wiAudioUnitIOProc AudioUnitRender failed with error %li
\n
"
,
err
);
return
err
;
}
/* Copy from audio buffer to the wavehdrs */
dataToStore
=
wwi
->
bufferList
->
mBuffers
[
0
].
mDataByteSize
;
OSSpinLockLock
(
&
wwi
->
lock
);
lpStorePtr
=
wwi
->
lpQueuePtr
;
while
(
dataToStore
>
0
&&
wwi
->
state
==
WINE_WS_PLAYING
&&
lpStorePtr
)
{
unsigned
int
room
=
lpStorePtr
->
dwBufferLength
-
lpStorePtr
->
dwBytesRecorded
;
unsigned
int
toCopy
;
if
(
wwi
->
trace_on
)
fprintf
(
stderr
,
"trace:wave:CoreAudio_wiAudioUnitIOProc Looking to store %u bytes to wavehdr %p, which has room for %u
\n
"
,
dataToStore
,
lpStorePtr
,
room
);
if
(
room
>=
dataToStore
)
toCopy
=
dataToStore
;
else
toCopy
=
room
;
if
(
toCopy
>
0
)
{
memcpy
(
lpStorePtr
->
lpData
+
lpStorePtr
->
dwBytesRecorded
,
(
char
*
)
wwi
->
bufferList
->
mBuffers
[
0
].
mData
+
dataStored
,
toCopy
);
lpStorePtr
->
dwBytesRecorded
+=
toCopy
;
wwi
->
dwTotalRecorded
+=
toCopy
;
dataStored
+=
toCopy
;
dataToStore
-=
toCopy
;
room
-=
toCopy
;
}
if
(
room
==
0
)
{
lpStorePtr
=
lpStorePtr
->
lpNext
;
needNotify
=
TRUE
;
}
}
OSSpinLockUnlock
(
&
wwi
->
lock
);
if
(
needNotify
)
wodSendNotifyInputCompletionsMessage
(
wwi
);
return
err
;
}
}
#else
#else
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment