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
b4c0b77b
Commit
b4c0b77b
authored
Oct 06, 2017
by
Andrew Eikum
Committed by
Alexandre Julliard
Oct 06, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wineandroid: Support 32-bit float audio format.
Signed-off-by:
Andrew Eikum
<
aeikum@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
d2f904e0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
15 deletions
+23
-15
build.gradle.in
dlls/wineandroid.drv/build.gradle.in
+1
-1
mmdevdrv.c
dlls/wineandroid.drv/mmdevdrv.c
+22
-14
No files found.
dlls/wineandroid.drv/build.gradle.in
View file @
b4c0b77b
...
...
@@ -58,7 +58,7 @@ tasks.whenTaskAdded { t ->
android
{
compileSdkVersion
17
compileSdkVersion
21
buildToolsVersion "25.0.3"
defaultConfig
...
...
dlls/wineandroid.drv/mmdevdrv.c
View file @
b4c0b77b
...
...
@@ -649,23 +649,36 @@ static HRESULT get_audio_session(const GUID *sessionguid,
static
HRESULT
waveformat_to_pcm
(
ACImpl
*
This
,
const
WAVEFORMATEX
*
fmt
,
SLAndroidDataFormat_PCM_EX
*
pcm
)
{
/* only support non-float PCM */
if
(
fmt
->
wFormatTag
!=
WAVE_FORMAT_PCM
&&
!
(
fmt
->
wFormatTag
==
WAVE_FORMAT_EXTENSIBLE
&&
IsEqualGUID
(
&
((
WAVEFORMATEXTENSIBLE
*
)
fmt
)
->
SubFormat
,
&
KSDATAFORMAT_SUBTYPE_PCM
)))
return
AUDCLNT_E_UNSUPPORTED_FORMAT
;
/* TODO: does android only support 16-bit PCM? */
if
(
fmt
->
nSamplesPerSec
<
8000
||
fmt
->
nSamplesPerSec
>
48000
)
return
AUDCLNT_E_UNSUPPORTED_FORMAT
;
pcm
->
formatType
=
SL_ANDROID_DATAFORMAT_PCM_EX
;
pcm
->
numChannels
=
fmt
->
nChannels
;
pcm
->
sampleRate
=
fmt
->
nSamplesPerSec
*
1000
;
/* sampleRate is in milli-Hz */
pcm
->
bitsPerSample
=
fmt
->
wBitsPerSample
;
pcm
->
containerSize
=
fmt
->
wBitsPerSample
;
if
(
fmt
->
wFormatTag
==
WAVE_FORMAT_PCM
||
(
fmt
->
wFormatTag
==
WAVE_FORMAT_EXTENSIBLE
&&
IsEqualGUID
(
&
((
WAVEFORMATEXTENSIBLE
*
)
fmt
)
->
SubFormat
,
&
KSDATAFORMAT_SUBTYPE_PCM
))){
if
(
pcm
->
bitsPerSample
==
8
)
pcm
->
representation
=
SL_ANDROID_PCM_REPRESENTATION_UNSIGNED_INT
;
else
if
(
pcm
->
bitsPerSample
==
16
)
pcm
->
representation
=
SL_ANDROID_PCM_REPRESENTATION_SIGNED_INT
;
else
return
AUDCLNT_E_UNSUPPORTED_FORMAT
;
}
else
if
(
fmt
->
wFormatTag
==
WAVE_FORMAT_IEEE_FLOAT
||
(
fmt
->
wFormatTag
==
WAVE_FORMAT_EXTENSIBLE
&&
IsEqualGUID
(
&
((
WAVEFORMATEXTENSIBLE
*
)
fmt
)
->
SubFormat
,
&
KSDATAFORMAT_SUBTYPE_IEEE_FLOAT
))){
if
(
pcm
->
bitsPerSample
==
32
)
pcm
->
representation
=
SL_ANDROID_PCM_REPRESENTATION_FLOAT
;
else
return
AUDCLNT_E_UNSUPPORTED_FORMAT
;
}
else
return
AUDCLNT_E_UNSUPPORTED_FORMAT
;
/* only up to stereo */
pcm
->
numChannels
=
fmt
->
nChannels
;
if
(
pcm
->
numChannels
==
1
)
pcm
->
channelMask
=
SL_SPEAKER_FRONT_CENTER
;
else
if
(
This
->
dataflow
==
eRender
&&
pcm
->
numChannels
==
2
)
...
...
@@ -675,11 +688,6 @@ static HRESULT waveformat_to_pcm(ACImpl *This, const WAVEFORMATEX *fmt, SLAndroi
pcm
->
endianness
=
SL_BYTEORDER_LITTLEENDIAN
;
if
(
pcm
->
bitsPerSample
==
8
)
pcm
->
representation
=
SL_ANDROID_PCM_REPRESENTATION_UNSIGNED_INT
;
else
pcm
->
representation
=
SL_ANDROID_PCM_REPRESENTATION_SIGNED_INT
;
return
S_OK
;
}
...
...
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