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
75276f01
Commit
75276f01
authored
Jul 02, 2023
by
Davide Beatrici
Committed by
Alexandre Julliard
Jul 04, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winepulse: Move create_session into mmdevapi.
parent
b61e02f7
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
30 deletions
+30
-30
audiosessionmanager.c
dlls/mmdevapi/audiosessionmanager.c
+0
-2
session.c
dlls/mmdevapi/session.c
+24
-0
mmdevdrv.c
dlls/winepulse.drv/mmdevdrv.c
+6
-28
No files found.
dlls/mmdevapi/audiosessionmanager.c
View file @
75276f01
...
...
@@ -26,8 +26,6 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
mmdevapi
);
static
struct
list
g_sessions
=
LIST_INIT
(
g_sessions
);
static
CRITICAL_SECTION
g_sessions_lock
;
static
CRITICAL_SECTION_DEBUG
g_sessions_lock_debug
=
{
...
...
dlls/mmdevapi/session.c
View file @
75276f01
...
...
@@ -40,6 +40,8 @@ extern void sessions_unlock(void) DECLSPEC_HIDDEN;
extern
void
set_stream_volumes
(
struct
audio_client
*
This
)
DECLSPEC_HIDDEN
;
struct
list
sessions
=
LIST_INIT
(
sessions
);
static
inline
struct
audio_session_wrapper
*
impl_from_IAudioSessionControl2
(
IAudioSessionControl2
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
struct
audio_session_wrapper
,
IAudioSessionControl2_iface
);
...
...
@@ -572,6 +574,28 @@ void session_init_vols(struct audio_session *session, UINT channels)
}
}
struct
audio_session
*
session_create
(
const
GUID
*
guid
,
IMMDevice
*
device
,
UINT
channels
)
{
struct
audio_session
*
ret
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
struct
audio_session
));
if
(
!
ret
)
return
NULL
;
memcpy
(
&
ret
->
guid
,
guid
,
sizeof
(
GUID
));
ret
->
device
=
device
;
list_init
(
&
ret
->
clients
);
list_add_head
(
&
sessions
,
&
ret
->
entry
);
session_init_vols
(
ret
,
channels
);
ret
->
master_vol
=
1
.
f
;
return
ret
;
}
struct
audio_session_wrapper
*
session_wrapper_create
(
struct
audio_client
*
client
)
{
struct
audio_session_wrapper
*
ret
;
...
...
dlls/winepulse.drv/mmdevdrv.c
View file @
75276f01
...
...
@@ -56,7 +56,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(pulse);
#define NULL_PTR_ERR MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, RPC_X_NULL_REF_POINTER)
static
struct
list
g_sessions
=
LIST_INIT
(
g_sessions
)
;
extern
struct
list
sessions
;
static
struct
list
g_devices_cache
=
LIST_INIT
(
g_devices_cache
);
struct
device_cache
{
...
...
@@ -401,30 +401,8 @@ HRESULT WINAPI AUDDRV_GetAudioEndpoint(GUID *guid, IMMDevice *dev, IAudioClient
extern
void
session_init_vols
(
AudioSession
*
session
,
UINT
channels
);
static
AudioSession
*
create_session
(
const
GUID
*
guid
,
IMMDevice
*
device
,
UINT
num_channels
)
{
AudioSession
*
ret
;
ret
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
AudioSession
));
if
(
!
ret
)
return
NULL
;
memcpy
(
&
ret
->
guid
,
guid
,
sizeof
(
GUID
));
ret
->
device
=
device
;
list_init
(
&
ret
->
clients
);
list_add_head
(
&
g_sessions
,
&
ret
->
entry
);
session_init_vols
(
ret
,
num_channels
);
ret
->
master_vol
=
1
.
f
;
return
ret
;
}
extern
AudioSession
*
session_create
(
const
GUID
*
guid
,
IMMDevice
*
device
,
UINT
num_channels
);
/* if channels == 0, then this will return or create a session with
* matching dataflow and GUID. otherwise, channels must also match */
HRESULT
get_audio_session
(
const
GUID
*
sessionguid
,
...
...
@@ -433,7 +411,7 @@ HRESULT get_audio_session(const GUID *sessionguid,
AudioSession
*
session
;
if
(
!
sessionguid
||
IsEqualGUID
(
sessionguid
,
&
GUID_NULL
))
{
*
out
=
create_session
(
&
GUID_NULL
,
device
,
channels
);
*
out
=
session_create
(
&
GUID_NULL
,
device
,
channels
);
if
(
!*
out
)
return
E_OUTOFMEMORY
;
...
...
@@ -441,7 +419,7 @@ HRESULT get_audio_session(const GUID *sessionguid,
}
*
out
=
NULL
;
LIST_FOR_EACH_ENTRY
(
session
,
&
g_
sessions
,
AudioSession
,
entry
)
{
LIST_FOR_EACH_ENTRY
(
session
,
&
sessions
,
AudioSession
,
entry
)
{
if
(
session
->
device
==
device
&&
IsEqualGUID
(
sessionguid
,
&
session
->
guid
))
{
session_init_vols
(
session
,
channels
);
...
...
@@ -451,7 +429,7 @@ HRESULT get_audio_session(const GUID *sessionguid,
}
if
(
!*
out
)
{
*
out
=
create_session
(
sessionguid
,
device
,
channels
);
*
out
=
session_create
(
sessionguid
,
device
,
channels
);
if
(
!*
out
)
return
E_OUTOFMEMORY
;
}
...
...
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