Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Gabriel Ivăncescu
wine
Commits
5716a20d
Commit
5716a20d
authored
1 year ago
by
Davide Beatrici
Committed by
Alexandre Julliard
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
wineoss: Use mmdevapi's AudioClient's Initialize.
parent
f5d89202
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dlls/wineoss.drv/mmdevdrv.c
+3
-133
3 additions, 133 deletions
dlls/wineoss.drv/mmdevdrv.c
with
3 additions
and
133 deletions
dlls/wineoss.drv/mmdevdrv.c
+
3
−
133
View file @
5716a20d
...
...
@@ -82,17 +82,11 @@ extern const IAudioClock2Vtbl AudioClock2_Vtbl;
extern
const
IAudioStreamVolumeVtbl
AudioStreamVolume_Vtbl
;
extern
const
IChannelAudioVolumeVtbl
ChannelAudioVolume_Vtbl
;
extern
HRESULT
main_loop_start
(
void
)
DECLSPEC_HIDDEN
;
extern
struct
audio_session_wrapper
*
session_wrapper_create
(
struct
audio_client
*
client
)
DECLSPEC_HIDDEN
;
extern
HRESULT
stream_release
(
stream_handle
stream
,
HANDLE
timer_thread
);
extern
WCHAR
*
get_application_name
(
void
);
extern
void
set_stream_volumes
(
struct
audio_client
*
This
);
void
DECLSPEC_HIDDEN
sessions_lock
(
void
)
{
EnterCriticalSection
(
&
g_sessions_lock
);
...
...
@@ -406,40 +400,6 @@ static ULONG WINAPI AudioClient_Release(IAudioClient3 *iface)
return
ref
;
}
static
void
dump_fmt
(
const
WAVEFORMATEX
*
fmt
)
{
TRACE
(
"wFormatTag: 0x%x ("
,
fmt
->
wFormatTag
);
switch
(
fmt
->
wFormatTag
){
case
WAVE_FORMAT_PCM
:
TRACE
(
"WAVE_FORMAT_PCM"
);
break
;
case
WAVE_FORMAT_IEEE_FLOAT
:
TRACE
(
"WAVE_FORMAT_IEEE_FLOAT"
);
break
;
case
WAVE_FORMAT_EXTENSIBLE
:
TRACE
(
"WAVE_FORMAT_EXTENSIBLE"
);
break
;
default:
TRACE
(
"Unknown"
);
break
;
}
TRACE
(
")
\n
"
);
TRACE
(
"nChannels: %u
\n
"
,
fmt
->
nChannels
);
TRACE
(
"nSamplesPerSec: %lu
\n
"
,
fmt
->
nSamplesPerSec
);
TRACE
(
"nAvgBytesPerSec: %lu
\n
"
,
fmt
->
nAvgBytesPerSec
);
TRACE
(
"nBlockAlign: %u
\n
"
,
fmt
->
nBlockAlign
);
TRACE
(
"wBitsPerSample: %u
\n
"
,
fmt
->
wBitsPerSample
);
TRACE
(
"cbSize: %u
\n
"
,
fmt
->
cbSize
);
if
(
fmt
->
wFormatTag
==
WAVE_FORMAT_EXTENSIBLE
){
WAVEFORMATEXTENSIBLE
*
fmtex
=
(
void
*
)
fmt
;
TRACE
(
"dwChannelMask: %08lx
\n
"
,
fmtex
->
dwChannelMask
);
TRACE
(
"Samples: %04x
\n
"
,
fmtex
->
Samples
.
wReserved
);
TRACE
(
"SubFormat: %s
\n
"
,
wine_dbgstr_guid
(
&
fmtex
->
SubFormat
));
}
}
static
void
session_init_vols
(
AudioSession
*
session
,
UINT
channels
)
{
if
(
session
->
channel_count
<
channels
){
...
...
@@ -519,100 +479,10 @@ HRESULT get_audio_session(const GUID *sessionguid,
return
S_OK
;
}
static
HRESULT
WINAPI
AudioC
lient_Initialize
(
IAudioClient3
*
iface
,
extern
HRESULT
WINAPI
c
lient_Initialize
(
IAudioClient3
*
iface
,
AUDCLNT_SHAREMODE
mode
,
DWORD
flags
,
REFERENCE_TIME
duration
,
REFERENCE_TIME
period
,
const
WAVEFORMATEX
*
fmt
,
const
GUID
*
sessionguid
)
{
ACImpl
*
This
=
impl_from_IAudioClient3
(
iface
);
struct
create_stream_params
params
;
stream_handle
stream
;
unsigned
int
i
,
channel_count
;
WCHAR
*
name
;
TRACE
(
"(%p)->(%x, %lx, %s, %s, %p, %s)
\n
"
,
This
,
mode
,
flags
,
wine_dbgstr_longlong
(
duration
),
wine_dbgstr_longlong
(
period
),
fmt
,
debugstr_guid
(
sessionguid
));
if
(
!
fmt
)
return
E_POINTER
;
dump_fmt
(
fmt
);
if
(
mode
!=
AUDCLNT_SHAREMODE_SHARED
&&
mode
!=
AUDCLNT_SHAREMODE_EXCLUSIVE
)
return
E_INVALIDARG
;
if
(
flags
&
~
(
AUDCLNT_STREAMFLAGS_CROSSPROCESS
|
AUDCLNT_STREAMFLAGS_LOOPBACK
|
AUDCLNT_STREAMFLAGS_EVENTCALLBACK
|
AUDCLNT_STREAMFLAGS_NOPERSIST
|
AUDCLNT_STREAMFLAGS_RATEADJUST
|
AUDCLNT_SESSIONFLAGS_EXPIREWHENUNOWNED
|
AUDCLNT_SESSIONFLAGS_DISPLAY_HIDE
|
AUDCLNT_SESSIONFLAGS_DISPLAY_HIDEWHENEXPIRED
|
AUDCLNT_STREAMFLAGS_SRC_DEFAULT_QUALITY
|
AUDCLNT_STREAMFLAGS_AUTOCONVERTPCM
)){
FIXME
(
"Unknown flags: %08lx
\n
"
,
flags
);
return
E_INVALIDARG
;
}
sessions_lock
();
if
(
This
->
stream
){
sessions_unlock
();
return
AUDCLNT_E_ALREADY_INITIALIZED
;
}
if
(
FAILED
(
params
.
result
=
main_loop_start
())){
sessions_unlock
();
return
params
.
result
;
}
params
.
name
=
name
=
get_application_name
();
params
.
device
=
This
->
device_name
;
params
.
flow
=
This
->
dataflow
;
params
.
share
=
mode
;
params
.
flags
=
flags
;
params
.
duration
=
duration
;
params
.
period
=
period
;
params
.
fmt
=
fmt
;
params
.
channel_count
=
&
channel_count
;
params
.
stream
=
&
stream
;
OSS_CALL
(
create_stream
,
&
params
);
free
(
name
);
if
(
FAILED
(
params
.
result
)){
sessions_unlock
();
return
params
.
result
;
}
This
->
vols
=
malloc
(
channel_count
*
sizeof
(
float
));
if
(
!
This
->
vols
){
params
.
result
=
E_OUTOFMEMORY
;
goto
exit
;
}
for
(
i
=
0
;
i
<
channel_count
;
++
i
)
This
->
vols
[
i
]
=
1
.
f
;
params
.
result
=
get_audio_session
(
sessionguid
,
This
->
parent
,
channel_count
,
&
This
->
session
);
exit:
if
(
FAILED
(
params
.
result
)){
stream_release
(
stream
,
NULL
);
free
(
This
->
vols
);
This
->
vols
=
NULL
;
}
else
{
list_add_tail
(
&
This
->
session
->
clients
,
&
This
->
entry
);
This
->
stream
=
stream
;
This
->
channel_count
=
channel_count
;
set_stream_volumes
(
This
);
}
sessions_unlock
();
return
params
.
result
;
}
const
GUID
*
sessionguid
);
extern
HRESULT
WINAPI
client_GetBufferSize
(
IAudioClient3
*
iface
,
UINT32
*
frames
);
...
...
@@ -671,7 +541,7 @@ static const IAudioClient3Vtbl AudioClient3_Vtbl =
AudioClient_QueryInterface
,
AudioClient_AddRef
,
AudioClient_Release
,
AudioC
lient_Initialize
,
c
lient_Initialize
,
client_GetBufferSize
,
client_GetStreamLatency
,
client_GetCurrentPadding
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment