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
3735ecac
Commit
3735ecac
authored
Sep 27, 2011
by
Andrew Eikum
Committed by
Alexandre Julliard
Sep 27, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dsound: Reimplement capturing devices on mmdevapi.
parent
e786998d
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
23 additions
and
66 deletions
+23
-66
capture.c
dlls/dsound/capture.c
+0
-0
dsound.c
dlls/dsound/dsound.c
+2
-2
dsound_main.c
dlls/dsound/dsound_main.c
+7
-55
dsound_private.h
dlls/dsound/dsound_private.h
+14
-9
No files found.
dlls/dsound/capture.c
View file @
3735ecac
This diff is collapsed.
Click to expand it.
dlls/dsound/dsound.c
View file @
3735ecac
...
...
@@ -1343,7 +1343,7 @@ HRESULT DirectSoundDevice_GetCaps(
return
DS_OK
;
}
static
BOOL
DSOUND_check_supported
(
IAudioClient
*
client
,
DWORD
rate
,
BOOL
DSOUND_check_supported
(
IAudioClient
*
client
,
DWORD
rate
,
DWORD
depth
,
WORD
channels
)
{
WAVEFORMATEX
fmt
,
*
junk
;
...
...
@@ -1364,7 +1364,7 @@ static BOOL DSOUND_check_supported(IAudioClient *client, DWORD rate,
return
hr
==
S_OK
;
}
static
UINT
DSOUND_create_timer
(
LPTIMECALLBACK
cb
,
DWORD_PTR
user
)
UINT
DSOUND_create_timer
(
LPTIMECALLBACK
cb
,
DWORD_PTR
user
)
{
UINT
triggertime
=
DS_TIME_DEL
,
res
=
DS_TIME_RES
,
id
;
TIMECAPS
time
;
...
...
dlls/dsound/dsound_main.c
View file @
3735ecac
...
...
@@ -68,6 +68,9 @@ WINE_DEFAULT_DEBUG_CHANNEL(dsound);
struct
list
DSOUND_renderers
=
LIST_INIT
(
DSOUND_renderers
);
CRITICAL_SECTION
DSOUND_renderers_lock
;
struct
list
DSOUND_capturers
=
LIST_INIT
(
DSOUND_capturers
);
CRITICAL_SECTION
DSOUND_capturers_lock
;
GUID
DSOUND_renderer_guids
[
MAXWAVEDRIVERS
];
GUID
DSOUND_capture_guids
[
MAXWAVEDRIVERS
];
...
...
@@ -652,64 +655,17 @@ DirectSoundCaptureEnumerateW(
LPDSENUMCALLBACKW
lpDSEnumCallback
,
LPVOID
lpContext
)
{
unsigned
devs
,
wid
;
DSDRIVERDESC
desc
;
GUID
guid
;
int
err
;
WCHAR
wDesc
[
MAXPNAMELEN
];
WCHAR
wName
[
MAXPNAMELEN
];
TRACE
(
"(%p,%p)
\n
"
,
lpDSEnumCallback
,
lpContext
);
if
(
lpDSEnumCallback
==
NULL
)
{
WARN
(
"invalid parameter: lpDSEnumCallback == NULL
\n
"
);
WARN
(
"invalid parameter: lpDSEnumCallback == NULL
\n
"
);
return
DSERR_INVALIDPARAM
;
}
setup_dsound_options
();
devs
=
waveInGetNumDevs
();
if
(
devs
>
0
)
{
if
(
GetDeviceID
(
&
DSDEVID_DefaultCapture
,
&
guid
)
==
DS_OK
)
{
for
(
wid
=
0
;
wid
<
devs
;
++
wid
)
{
if
(
IsEqualGUID
(
&
guid
,
&
DSOUND_capture_guids
[
wid
]
)
)
{
err
=
mmErr
(
waveInMessage
(
UlongToHandle
(
wid
),
DRV_QUERYDSOUNDDESC
,(
DWORD_PTR
)
&
desc
,
0
));
if
(
err
==
DS_OK
)
{
TRACE
(
"calling lpDSEnumCallback(NULL,
\"
%s
\"
,
\"
%s
\"
,%p)
\n
"
,
"Primary Sound Capture Driver"
,
desc
.
szDrvname
,
lpContext
);
MultiByteToWideChar
(
CP_ACP
,
0
,
"Primary Sound Capture Driver"
,
-
1
,
wDesc
,
sizeof
(
wDesc
)
/
sizeof
(
WCHAR
)
);
MultiByteToWideChar
(
CP_ACP
,
0
,
desc
.
szDrvname
,
-
1
,
wName
,
sizeof
(
wName
)
/
sizeof
(
WCHAR
)
);
wName
[(
sizeof
(
wName
)
/
sizeof
(
WCHAR
))
-
1
]
=
'\0'
;
if
(
lpDSEnumCallback
(
NULL
,
wDesc
,
wName
,
lpContext
)
==
FALSE
)
return
DS_OK
;
}
}
}
}
}
for
(
wid
=
0
;
wid
<
devs
;
++
wid
)
{
err
=
mmErr
(
waveInMessage
(
UlongToHandle
(
wid
),
DRV_QUERYDSOUNDDESC
,(
DWORD_PTR
)
&
desc
,
0
));
if
(
err
==
DS_OK
)
{
TRACE
(
"calling lpDSEnumCallback(%s,
\"
%s
\"
,
\"
%s
\"
,%p)
\n
"
,
debugstr_guid
(
&
DSOUND_capture_guids
[
wid
]),
desc
.
szDesc
,
desc
.
szDrvname
,
lpContext
);
MultiByteToWideChar
(
CP_ACP
,
0
,
desc
.
szDesc
,
-
1
,
wDesc
,
sizeof
(
wDesc
)
/
sizeof
(
WCHAR
)
);
wDesc
[(
sizeof
(
wDesc
)
/
sizeof
(
WCHAR
))
-
1
]
=
'\0'
;
MultiByteToWideChar
(
CP_ACP
,
0
,
desc
.
szDrvname
,
-
1
,
wName
,
sizeof
(
wName
)
/
sizeof
(
WCHAR
)
);
wName
[(
sizeof
(
wName
)
/
sizeof
(
WCHAR
))
-
1
]
=
'\0'
;
if
(
lpDSEnumCallback
(
&
DSOUND_capture_guids
[
wid
],
wDesc
,
wName
,
lpContext
)
==
FALSE
)
return
DS_OK
;
}
}
return
DS_OK
;
return
enumerate_mmdevices
(
eCapture
,
DSOUND_capture_guids
,
lpDSEnumCallback
,
lpContext
);
}
/*******************************************************************************
...
...
@@ -877,21 +833,17 @@ HRESULT WINAPI DllCanUnloadNow(void)
*/
BOOL
WINAPI
DllMain
(
HINSTANCE
hInstDLL
,
DWORD
fdwReason
,
LPVOID
lpvReserved
)
{
int
i
;
TRACE
(
"(%p %d %p)
\n
"
,
hInstDLL
,
fdwReason
,
lpvReserved
);
switch
(
fdwReason
)
{
case
DLL_PROCESS_ATTACH
:
TRACE
(
"DLL_PROCESS_ATTACH
\n
"
);
for
(
i
=
0
;
i
<
MAXWAVEDRIVERS
;
i
++
)
{
DSOUND_capture
[
i
]
=
NULL
;
INIT_GUID
(
DSOUND_capture_guids
[
i
],
0xbd6dd71b
,
0x3deb
,
0x11d1
,
0xb1
,
0x71
,
0x00
,
0xc0
,
0x4f
,
0xc2
,
0x00
,
0x00
+
i
);
}
instance
=
hInstDLL
;
DisableThreadLibraryCalls
(
hInstDLL
);
/* Increase refcount on dsound by 1 */
GetModuleHandleExW
(
GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS
,
(
LPCWSTR
)
hInstDLL
,
&
hInstDLL
);
InitializeCriticalSection
(
&
DSOUND_renderers_lock
);
InitializeCriticalSection
(
&
DSOUND_capturers_lock
);
InitializeCriticalSection
(
&
g_devenum_lock
);
break
;
case
DLL_PROCESS_DETACH
:
...
...
dlls/dsound/dsound_private.h
View file @
3735ecac
...
...
@@ -280,21 +280,22 @@ struct DirectSoundCaptureDevice
DSDRIVERDESC
drvdesc
;
DSCDRIVERCAPS
drvcaps
;
/* wave driver info */
HWAVEIN
hwi
;
/* more stuff */
LPBYTE
buffer
;
DWORD
buflen
;
DWORD
buflen
,
write_pos_bytes
;
PWAVEFORMATEX
pwfx
;
IDirectSoundCaptureBufferImpl
*
capture_buffer
;
DWORD
state
;
LPWAVEHDR
pwave
;
int
nrofpwaves
;
int
index
;
UINT
timerID
;
CRITICAL_SECTION
lock
;
IMMDevice
*
mmdevice
;
IAudioClient
*
client
;
IAudioCaptureClient
*
capture
;
struct
list
entry
;
};
/*****************************************************************************
...
...
@@ -428,10 +429,10 @@ HRESULT DSOUND_CaptureCreate8(REFIID riid, LPDIRECTSOUNDCAPTURE8 *ppDSC8) DECLSP
#define DSOUND_FREQSHIFT (20)
extern
CRITICAL_SECTION
DSOUND_renderers_lock
DECLSPEC_HIDDEN
;
extern
CRITICAL_SECTION
DSOUND_capturers_lock
DECLSPEC_HIDDEN
;
extern
struct
list
DSOUND_capturers
DECLSPEC_HIDDEN
;
extern
struct
list
DSOUND_renderers
DECLSPEC_HIDDEN
;
extern
DirectSoundCaptureDevice
*
DSOUND_capture
[
MAXWAVEDRIVERS
]
DECLSPEC_HIDDEN
;
extern
GUID
DSOUND_renderer_guids
[
MAXWAVEDRIVERS
]
DECLSPEC_HIDDEN
;
extern
GUID
DSOUND_capture_guids
[
MAXWAVEDRIVERS
]
DECLSPEC_HIDDEN
;
...
...
@@ -440,3 +441,7 @@ void setup_dsound_options(void) DECLSPEC_HIDDEN;
const
char
*
dumpCooperativeLevel
(
DWORD
level
)
DECLSPEC_HIDDEN
;
HRESULT
get_mmdevice
(
EDataFlow
flow
,
const
GUID
*
tgt
,
IMMDevice
**
device
)
DECLSPEC_HIDDEN
;
BOOL
DSOUND_check_supported
(
IAudioClient
*
client
,
DWORD
rate
,
DWORD
depth
,
WORD
channels
)
DECLSPEC_HIDDEN
;
UINT
DSOUND_create_timer
(
LPTIMECALLBACK
cb
,
DWORD_PTR
user
)
DECLSPEC_HIDDEN
;
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