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
4e7d0397
Commit
4e7d0397
authored
Jun 06, 2011
by
Andrew Eikum
Committed by
Alexandre Julliard
Jun 06, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mmdevapi: Add support for IAudioSessionManager in IMMDevice::Activate.
parent
38d80c73
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
109 additions
and
1 deletion
+109
-1
devenum.c
dlls/mmdevapi/devenum.c
+1
-1
main.c
dlls/mmdevapi/main.c
+1
-0
mmdevapi.h
dlls/mmdevapi/mmdevapi.h
+2
-0
render.c
dlls/mmdevapi/tests/render.c
+105
-0
No files found.
dlls/mmdevapi/devenum.c
View file @
4e7d0397
...
...
@@ -547,7 +547,7 @@ static HRESULT WINAPI MMDevice_Activate(IMMDevice *iface, REFIID riid, DWORD cls
else
if
(
IsEqualIID
(
riid
,
&
IID_IAudioSessionManager
)
||
IsEqualIID
(
riid
,
&
IID_IAudioSessionManager2
))
{
FIXME
(
"IID_IAudioSessionManager unsupported
\n
"
);
hr
=
drvs
.
pGetAudioSessionManager
(
This
->
flow
,
(
IAudioSessionManager2
**
)
ppv
);
}
else
if
(
IsEqualIID
(
riid
,
&
IID_IBaseFilter
))
{
...
...
dlls/mmdevapi/main.c
View file @
4e7d0397
...
...
@@ -75,6 +75,7 @@ static BOOL load_driver(const WCHAR *name)
if(!drvs.p##n) { FreeLibrary(drvs.module); return FALSE; } } while(0)
LDFC
(
GetEndpointIDs
);
LDFC
(
GetAudioEndpoint
);
LDFC
(
GetAudioSessionManager
);
#undef LDFC
TRACE
(
"Successfully loaded %s
\n
"
,
wine_dbgstr_w
(
driver_module
));
...
...
dlls/mmdevapi/mmdevapi.h
View file @
4e7d0397
...
...
@@ -37,6 +37,8 @@ typedef struct _DriverFuncs {
void
***
keys
,
UINT
*
num
,
UINT
*
default_index
);
HRESULT
WINAPI
(
*
pGetAudioEndpoint
)(
void
*
key
,
IMMDevice
*
dev
,
EDataFlow
dataflow
,
IAudioClient
**
out
);
HRESULT
WINAPI
(
*
pGetAudioSessionManager
)(
EDataFlow
flow
,
IAudioSessionManager2
**
out
);
}
DriverFuncs
;
extern
DriverFuncs
drvs
DECLSPEC_HIDDEN
;
...
...
dlls/mmdevapi/tests/render.c
View file @
4e7d0397
...
...
@@ -1213,6 +1213,110 @@ static void test_volume_dependence(void)
IAudioClient_Release
(
ac
);
}
static
void
test_session_creation
(
void
)
{
IMMDevice
*
cap_dev
;
IAudioClient
*
ac
;
IAudioSessionManager
*
sesm
;
ISimpleAudioVolume
*
sav
;
GUID
session_guid
;
float
vol
;
HRESULT
hr
;
WAVEFORMATEX
*
fmt
;
CoCreateGuid
(
&
session_guid
);
hr
=
IMMDevice_Activate
(
dev
,
&
IID_IAudioSessionManager
,
CLSCTX_INPROC_SERVER
,
NULL
,
(
void
**
)
&
sesm
);
ok
(
hr
==
S_OK
,
"Activate failed: %08x
\n
"
,
hr
);
hr
=
IAudioSessionManager_GetSimpleAudioVolume
(
sesm
,
&
session_guid
,
FALSE
,
&
sav
);
ok
(
hr
==
S_OK
,
"GetSimpleAudioVolume failed: %08x
\n
"
,
hr
);
hr
=
ISimpleAudioVolume_SetMasterVolume
(
sav
,
0
.
6
f
,
NULL
);
ok
(
hr
==
S_OK
,
"SetMasterVolume failed: %08x
\n
"
,
hr
);
/* Release completely to show session persistence */
ISimpleAudioVolume_Release
(
sav
);
IAudioSessionManager_Release
(
sesm
);
/* test if we can create a capture audioclient in the session we just
* created from a SessionManager derived from a render device */
hr
=
IMMDeviceEnumerator_GetDefaultAudioEndpoint
(
mme
,
eCapture
,
eMultimedia
,
&
cap_dev
);
if
(
hr
==
S_OK
){
WAVEFORMATEX
*
cap_pwfx
;
IAudioClient
*
cap_ac
;
ISimpleAudioVolume
*
cap_sav
;
IAudioSessionManager
*
cap_sesm
;
hr
=
IMMDevice_Activate
(
cap_dev
,
&
IID_IAudioSessionManager
,
CLSCTX_INPROC_SERVER
,
NULL
,
(
void
**
)
&
cap_sesm
);
ok
(
hr
==
S_OK
,
"Activate failed: %08x
\n
"
,
hr
);
hr
=
IAudioSessionManager_GetSimpleAudioVolume
(
cap_sesm
,
&
session_guid
,
FALSE
,
&
cap_sav
);
ok
(
hr
==
S_OK
,
"GetSimpleAudioVolume failed: %08x
\n
"
,
hr
);
vol
=
0
.
5
f
;
hr
=
ISimpleAudioVolume_GetMasterVolume
(
cap_sav
,
&
vol
);
ok
(
hr
==
S_OK
,
"GetMasterVolume failed: %08x
\n
"
,
hr
);
ok
(
vol
==
1
.
f
,
"Got wrong volume: %f
\n
"
,
vol
);
ISimpleAudioVolume_Release
(
cap_sav
);
IAudioSessionManager_Release
(
cap_sesm
);
hr
=
IMMDevice_Activate
(
cap_dev
,
&
IID_IAudioClient
,
CLSCTX_INPROC_SERVER
,
NULL
,
(
void
**
)
&
cap_ac
);
ok
(
hr
==
S_OK
,
"Activate failed: %08x
\n
"
,
hr
);
hr
=
IAudioClient_GetMixFormat
(
cap_ac
,
&
cap_pwfx
);
ok
(
hr
==
S_OK
,
"GetMixFormat failed: %08x
\n
"
,
hr
);
hr
=
IAudioClient_Initialize
(
cap_ac
,
AUDCLNT_SHAREMODE_SHARED
,
0
,
5000000
,
0
,
cap_pwfx
,
&
session_guid
);
ok
(
hr
==
S_OK
,
"Initialize failed: %08x
\n
"
,
hr
);
hr
=
IAudioClient_GetService
(
cap_ac
,
&
IID_ISimpleAudioVolume
,
(
void
**
)
&
cap_sav
);
ok
(
hr
==
S_OK
,
"GetService failed: %08x
\n
"
,
hr
);
vol
=
0
.
5
f
;
hr
=
ISimpleAudioVolume_GetMasterVolume
(
cap_sav
,
&
vol
);
ok
(
hr
==
S_OK
,
"GetMasterVolume failed: %08x
\n
"
,
hr
);
ok
(
vol
==
1
.
f
,
"Got wrong volume: %f
\n
"
,
vol
);
CoTaskMemFree
(
cap_pwfx
);
ISimpleAudioVolume_Release
(
cap_sav
);
IAudioClient_Release
(
cap_ac
);
IMMDevice_Release
(
cap_dev
);
}
hr
=
IMMDevice_Activate
(
dev
,
&
IID_IAudioClient
,
CLSCTX_INPROC_SERVER
,
NULL
,
(
void
**
)
&
ac
);
ok
(
hr
==
S_OK
,
"Activation failed with %08x
\n
"
,
hr
);
hr
=
IAudioClient_GetMixFormat
(
ac
,
&
fmt
);
ok
(
hr
==
S_OK
,
"GetMixFormat failed: %08x
\n
"
,
hr
);
hr
=
IAudioClient_Initialize
(
ac
,
AUDCLNT_SHAREMODE_SHARED
,
AUDCLNT_STREAMFLAGS_NOPERSIST
,
5000000
,
0
,
fmt
,
&
session_guid
);
ok
(
hr
==
S_OK
,
"Initialize failed: %08x
\n
"
,
hr
);
hr
=
IAudioClient_GetService
(
ac
,
&
IID_ISimpleAudioVolume
,
(
void
**
)
&
sav
);
ok
(
hr
==
S_OK
,
"GetService failed: %08x
\n
"
,
hr
);
vol
=
0
.
5
f
;
hr
=
ISimpleAudioVolume_GetMasterVolume
(
sav
,
&
vol
);
ok
(
hr
==
S_OK
,
"GetMasterVolume failed: %08x
\n
"
,
hr
);
ok
(
fabs
(
vol
-
0
.
6
f
)
<
0
.
05
f
,
"Got wrong volume: %f
\n
"
,
vol
);
CoTaskMemFree
(
fmt
);
ISimpleAudioVolume_Release
(
sav
);
IAudioClient_Release
(
ac
);
}
START_TEST
(
render
)
{
HRESULT
hr
;
...
...
@@ -1246,6 +1350,7 @@ START_TEST(render)
test_channelvolume
();
test_simplevolume
();
test_volume_dependence
();
test_session_creation
();
IMMDevice_Release
(
dev
);
...
...
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