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
9cd13ecb
Commit
9cd13ecb
authored
Jun 08, 2023
by
Davide Beatrici
Committed by
Alexandre Julliard
Jun 08, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winepulse: Move AudioClient's GetDevicePeriod, GetMixFormat, IsFormatSupported into mmdevapi.
parent
3fd8c85f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
126 additions
and
84 deletions
+126
-84
client.c
dlls/mmdevapi/client.c
+117
-0
mmdevdrv.c
dlls/winepulse.drv/mmdevdrv.c
+9
-84
No files found.
dlls/mmdevapi/client.c
View file @
9cd13ecb
...
...
@@ -80,6 +80,40 @@ static inline struct audio_client *impl_from_IAudioStreamVolume(IAudioStreamVolu
return
CONTAINING_RECORD
(
iface
,
struct
audio_client
,
IAudioStreamVolume_iface
);
}
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
DWORD
CALLBACK
timer_loop_func
(
void
*
user
)
{
struct
timer_loop_params
params
;
...
...
@@ -210,6 +244,89 @@ const IAudioCaptureClientVtbl AudioCaptureClient_Vtbl =
capture_GetNextPacketSize
};
HRESULT
WINAPI
client_IsFormatSupported
(
IAudioClient3
*
iface
,
AUDCLNT_SHAREMODE
mode
,
const
WAVEFORMATEX
*
fmt
,
WAVEFORMATEX
**
out
)
{
struct
audio_client
*
This
=
impl_from_IAudioClient3
(
iface
);
struct
is_format_supported_params
params
;
TRACE
(
"(%p)->(%x, %p, %p)
\n
"
,
This
,
mode
,
fmt
,
out
);
if
(
fmt
)
dump_fmt
(
fmt
);
params
.
device
=
This
->
device_name
;
params
.
flow
=
This
->
dataflow
;
params
.
share
=
mode
;
params
.
fmt_in
=
fmt
;
params
.
fmt_out
=
NULL
;
if
(
out
)
{
*
out
=
NULL
;
if
(
mode
==
AUDCLNT_SHAREMODE_SHARED
)
params
.
fmt_out
=
CoTaskMemAlloc
(
sizeof
(
*
params
.
fmt_out
));
}
WINE_UNIX_CALL
(
is_format_supported
,
&
params
);
if
(
params
.
result
==
S_FALSE
)
*
out
=
&
params
.
fmt_out
->
Format
;
else
CoTaskMemFree
(
params
.
fmt_out
);
return
params
.
result
;
}
HRESULT
WINAPI
client_GetMixFormat
(
IAudioClient3
*
iface
,
WAVEFORMATEX
**
pwfx
)
{
struct
audio_client
*
This
=
impl_from_IAudioClient3
(
iface
);
struct
get_mix_format_params
params
;
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
pwfx
);
if
(
!
pwfx
)
return
E_POINTER
;
*
pwfx
=
NULL
;
params
.
device
=
This
->
device_name
;
params
.
flow
=
This
->
dataflow
;
params
.
fmt
=
CoTaskMemAlloc
(
sizeof
(
WAVEFORMATEXTENSIBLE
));
if
(
!
params
.
fmt
)
return
E_OUTOFMEMORY
;
WINE_UNIX_CALL
(
get_mix_format
,
&
params
);
if
(
SUCCEEDED
(
params
.
result
))
{
*
pwfx
=
&
params
.
fmt
->
Format
;
dump_fmt
(
*
pwfx
);
}
else
CoTaskMemFree
(
params
.
fmt
);
return
params
.
result
;
}
HRESULT
WINAPI
client_GetDevicePeriod
(
IAudioClient3
*
iface
,
REFERENCE_TIME
*
defperiod
,
REFERENCE_TIME
*
minperiod
)
{
struct
audio_client
*
This
=
impl_from_IAudioClient3
(
iface
);
struct
get_device_period_params
params
;
TRACE
(
"(%p)->(%p, %p)
\n
"
,
This
,
defperiod
,
minperiod
);
if
(
!
defperiod
&&
!
minperiod
)
return
E_POINTER
;
params
.
device
=
This
->
device_name
;
params
.
flow
=
This
->
dataflow
;
params
.
def_period
=
defperiod
;
params
.
min_period
=
minperiod
;
WINE_UNIX_CALL
(
get_device_period
,
&
params
);
return
params
.
result
;
}
HRESULT
WINAPI
client_Start
(
IAudioClient3
*
iface
)
{
struct
audio_client
*
This
=
impl_from_IAudioClient3
(
iface
);
...
...
dlls/winepulse.drv/mmdevdrv.c
View file @
9cd13ecb
...
...
@@ -853,90 +853,15 @@ static HRESULT WINAPI AudioClient_GetCurrentPadding(IAudioClient3 *iface,
return
params
.
result
;
}
static
HRESULT
WINAPI
AudioC
lient_IsFormatSupported
(
IAudioClient3
*
iface
,
extern
HRESULT
WINAPI
c
lient_IsFormatSupported
(
IAudioClient3
*
iface
,
AUDCLNT_SHAREMODE
mode
,
const
WAVEFORMATEX
*
fmt
,
WAVEFORMATEX
**
out
)
{
ACImpl
*
This
=
impl_from_IAudioClient3
(
iface
);
struct
is_format_supported_params
params
;
TRACE
(
"(%p)->(%x, %p, %p)
\n
"
,
This
,
mode
,
fmt
,
out
);
if
(
fmt
)
dump_fmt
(
fmt
);
params
.
device
=
This
->
device_name
;
params
.
flow
=
This
->
dataflow
;
params
.
share
=
mode
;
params
.
fmt_in
=
fmt
;
params
.
fmt_out
=
NULL
;
WAVEFORMATEX
**
out
);
if
(
out
)
{
*
out
=
NULL
;
if
(
mode
==
AUDCLNT_SHAREMODE_SHARED
)
params
.
fmt_out
=
CoTaskMemAlloc
(
sizeof
(
*
params
.
fmt_out
));
}
pulse_call
(
is_format_supported
,
&
params
);
extern
HRESULT
WINAPI
client_GetMixFormat
(
IAudioClient3
*
iface
,
WAVEFORMATEX
**
pwfx
);
if
(
params
.
result
==
S_FALSE
)
*
out
=
&
params
.
fmt_out
->
Format
;
else
CoTaskMemFree
(
params
.
fmt_out
);
return
params
.
result
;
}
static
HRESULT
WINAPI
AudioClient_GetMixFormat
(
IAudioClient3
*
iface
,
WAVEFORMATEX
**
pwfx
)
{
ACImpl
*
This
=
impl_from_IAudioClient3
(
iface
);
struct
get_mix_format_params
params
;
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
pwfx
);
if
(
!
pwfx
)
return
E_POINTER
;
*
pwfx
=
NULL
;
params
.
device
=
This
->
device_name
;
params
.
flow
=
This
->
dataflow
;
params
.
fmt
=
CoTaskMemAlloc
(
sizeof
(
WAVEFORMATEXTENSIBLE
));
if
(
!
params
.
fmt
)
return
E_OUTOFMEMORY
;
pulse_call
(
get_mix_format
,
&
params
);
if
(
SUCCEEDED
(
params
.
result
))
{
*
pwfx
=
&
params
.
fmt
->
Format
;
dump_fmt
(
*
pwfx
);
}
else
{
CoTaskMemFree
(
params
.
fmt
);
}
return
params
.
result
;
}
static
HRESULT
WINAPI
AudioClient_GetDevicePeriod
(
IAudioClient3
*
iface
,
REFERENCE_TIME
*
defperiod
,
REFERENCE_TIME
*
minperiod
)
{
struct
get_device_period_params
params
;
ACImpl
*
This
=
impl_from_IAudioClient3
(
iface
);
TRACE
(
"(%p)->(%p, %p)
\n
"
,
This
,
defperiod
,
minperiod
);
if
(
!
defperiod
&&
!
minperiod
)
return
E_POINTER
;
params
.
flow
=
This
->
dataflow
;
params
.
device
=
This
->
device_name
;
params
.
def_period
=
defperiod
;
params
.
min_period
=
minperiod
;
pulse_call
(
get_device_period
,
&
params
);
return
params
.
result
;
}
extern
HRESULT
WINAPI
client_GetDevicePeriod
(
IAudioClient3
*
iface
,
REFERENCE_TIME
*
defperiod
,
REFERENCE_TIME
*
minperiod
);
extern
HRESULT
WINAPI
client_Start
(
IAudioClient3
*
iface
);
...
...
@@ -980,9 +905,9 @@ static const IAudioClient3Vtbl AudioClient3_Vtbl =
AudioClient_GetBufferSize
,
AudioClient_GetStreamLatency
,
AudioClient_GetCurrentPadding
,
AudioC
lient_IsFormatSupported
,
AudioC
lient_GetMixFormat
,
AudioC
lient_GetDevicePeriod
,
c
lient_IsFormatSupported
,
c
lient_GetMixFormat
,
c
lient_GetDevicePeriod
,
client_Start
,
client_Stop
,
client_Reset
,
...
...
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