Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
BC
public
mediastreamer2
Commits
1de47782
Commit
1de47782
authored
Feb 19, 2014
by
Sylvain Berfini
Browse files
Fix warnings with opensles Android soundcard
parent
a16157a6
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/android/androidsound_opensles.cpp
View file @
1de47782
...
...
@@ -318,6 +318,7 @@ static void android_native_snd_card_uninit(MSSndCard *card) {
static
SLresult
opensles_recorder_init
(
OpenSLESInputContext
*
ictx
)
{
SLresult
result
;
SLuint32
sample_rate
=
convertSamplerate
(
ictx
->
opensles_context
->
samplerate
);
SLuint32
channels
=
(
SLuint32
)
ictx
->
opensles_context
->
nchannels
;
SLDataLocator_IODevice
loc_dev
=
{
SL_DATALOCATOR_IODEVICE
,
...
...
@@ -338,7 +339,7 @@ static SLresult opensles_recorder_init(OpenSLESInputContext *ictx) {
SLDataFormat_PCM
format_pcm
=
{
SL_DATAFORMAT_PCM
,
ictx
->
opensles_context
->
n
channels
,
channels
,
sample_rate
,
SL_PCMSAMPLEFORMAT_FIXED_16
,
SL_PCMSAMPLEFORMAT_FIXED_16
,
...
...
@@ -653,23 +654,24 @@ static SLresult opensles_mixer_init(OpenSLESOutputContext *octx) {
static
SLresult
opensles_sink_init
(
OpenSLESOutputContext
*
octx
)
{
SLresult
result
;
SLuint32
sample_rate
=
convertSamplerate
(
octx
->
opensles_context
->
samplerate
);
SLuint32
channels
=
(
SLuint32
)
octx
->
opensles_context
->
nchannels
;
SLDataFormat_PCM
format_pcm
;
if
(
octx
->
opensles_context
->
n
channels
==
1
)
{
if
(
channels
==
1
)
{
format_pcm
=
{
SL_DATAFORMAT_PCM
,
octx
->
opensles_context
->
n
channels
,
channels
,
sample_rate
,
SL_PCMSAMPLEFORMAT_FIXED_16
,
SL_PCMSAMPLEFORMAT_FIXED_16
,
SL_SPEAKER_FRONT_CENTER
,
SL_BYTEORDER_LITTLEENDIAN
};
}
else
if
(
octx
->
opensles_context
->
n
channels
==
2
)
{
}
else
if
(
channels
==
2
)
{
format_pcm
=
{
SL_DATAFORMAT_PCM
,
octx
->
opensles_context
->
n
channels
,
channels
,
sample_rate
,
SL_PCMSAMPLEFORMAT_FIXED_16
,
SL_PCMSAMPLEFORMAT_FIXED_16
,
...
...
@@ -677,7 +679,7 @@ static SLresult opensles_sink_init(OpenSLESOutputContext *octx) {
SL_BYTEORDER_LITTLEENDIAN
};
}
else
{
ms_error
(
"OpenSLES Error trying to use %i channels"
,
octx
->
opensles_context
->
n
channels
);
ms_error
(
"OpenSLES Error trying to use %i channels"
,
channels
);
}
SLDataLocator_AndroidSimpleBufferQueue
loc_bufq
=
{
...
...
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