Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
b1ff68b8
Commit
b1ff68b8
authored
Dec 04, 2014
by
Mark Harmstone
Committed by
Alexandre Julliard
Dec 04, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mmdevapi: Allow GetPropValue function in audio drivers.
parent
a4fcba60
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
38 additions
and
0 deletions
+38
-0
devenum.c
dlls/mmdevapi/devenum.c
+33
-0
main.c
dlls/mmdevapi/main.c
+3
-0
mmdevapi.h
dlls/mmdevapi/mmdevapi.h
+2
-0
No files found.
dlls/mmdevapi/devenum.c
View file @
b1ff68b8
...
...
@@ -264,6 +264,25 @@ static HRESULT MMDevice_SetPropValue(const GUID *devguid, DWORD flow, REFPROPERT
return
hr
;
}
static
HRESULT
set_driver_prop_value
(
GUID
*
id
,
const
EDataFlow
flow
,
const
PROPERTYKEY
*
prop
)
{
HRESULT
hr
;
PROPVARIANT
pv
;
if
(
!
drvs
.
pGetPropValue
)
return
E_NOTIMPL
;
hr
=
drvs
.
pGetPropValue
(
id
,
prop
,
&
pv
);
if
(
SUCCEEDED
(
hr
))
{
MMDevice_SetPropValue
(
id
,
flow
,
prop
,
&
pv
);
PropVariantClear
(
&
pv
);
}
return
hr
;
}
/* Creates or updates the state of a device
* If GUID is null, a random guid will be assigned
* and the device will be created
...
...
@@ -279,6 +298,10 @@ static MMDevice *MMDevice_Create(WCHAR *name, GUID *id, EDataFlow flow, DWORD st
{
0x233164c8
,
0x1b2c
,
0x4c7d
,
{
0xbc
,
0x68
,
0xb6
,
0x71
,
0x68
,
0x7a
,
0x25
,
0x67
}},
1
};
static
const
PROPERTYKEY
devicepath_key
=
{
{
0xb3f8fa53
,
0x0004
,
0x438e
,
{
0x90
,
0x03
,
0x51
,
0xa4
,
0x6e
,
0x13
,
0x9b
,
0xfc
}},
2
};
for
(
i
=
0
;
i
<
MMDevice_count
;
++
i
)
{
MMDevice
*
device
=
MMDevice_head
[
i
];
...
...
@@ -338,6 +361,16 @@ static MMDevice *MMDevice_Create(WCHAR *name, GUID *id, EDataFlow flow, DWORD st
pv
.
u
.
pwszVal
=
guidstr
;
MMDevice_SetPropValue
(
id
,
flow
,
&
deviceinterface_key
,
&
pv
);
set_driver_prop_value
(
id
,
flow
,
&
devicepath_key
);
if
(
FAILED
(
set_driver_prop_value
(
id
,
flow
,
&
PKEY_AudioEndpoint_FormFactor
)))
{
pv
.
vt
=
VT_UI4
;
pv
.
u
.
ulVal
=
(
flow
==
eCapture
)
?
Microphone
:
Speakers
;
MMDevice_SetPropValue
(
id
,
flow
,
&
PKEY_AudioEndpoint_FormFactor
,
&
pv
);
}
RegCloseKey
(
keyprop
);
}
RegCloseKey
(
key
);
...
...
dlls/mmdevapi/main.c
View file @
b1ff68b8
...
...
@@ -97,6 +97,9 @@ static BOOL load_driver(const WCHAR *name, DriverFuncs *driver)
LDFC
(
GetAudioSessionManager
);
#undef LDFC
/* optional - do not fail if not found */
driver
->
pGetPropValue
=
(
void
*
)
GetProcAddress
(
driver
->
module
,
"GetPropValue"
);
driver
->
priority
=
driver
->
pGetPriority
();
lstrcpyW
(
driver
->
module_name
,
driver_module
);
...
...
dlls/mmdevapi/mmdevapi.h
View file @
b1ff68b8
...
...
@@ -54,6 +54,8 @@ typedef struct _DriverFuncs {
IAudioClient
**
out
);
HRESULT
(
WINAPI
*
pGetAudioSessionManager
)(
IMMDevice
*
device
,
IAudioSessionManager2
**
out
);
HRESULT
(
WINAPI
*
pGetPropValue
)(
GUID
*
guid
,
const
PROPERTYKEY
*
prop
,
PROPVARIANT
*
out
);
}
DriverFuncs
;
extern
DriverFuncs
drvs
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