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
9ca8792c
Commit
9ca8792c
authored
Oct 14, 2013
by
jehan
Browse files
add support for Kindle Fire
parent
4749e833
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
28 additions
and
4 deletions
+28
-4
java/.classpath
java/.classpath
+2
-0
java/.project
java/.project
+16
-0
src/android/androidsound.cpp
src/android/androidsound.cpp
+8
-4
src/audiofilters/devices.c
src/audiofilters/devices.c
+1
-0
src/audiofilters/devices.h
src/audiofilters/devices.h
+1
-0
No files found.
java/.classpath
View file @
9ca8792c
...
...
@@ -3,5 +3,7 @@
<classpathentry
kind=
"src"
path=
"src"
/>
<classpathentry
kind=
"src"
path=
"gen"
/>
<classpathentry
kind=
"con"
path=
"com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"
/>
<classpathentry
exported=
"true"
kind=
"con"
path=
"com.android.ide.eclipse.adt.LIBRARIES"
/>
<classpathentry
exported=
"true"
kind=
"con"
path=
"com.android.ide.eclipse.adt.DEPENDENCIES"
/>
<classpathentry
kind=
"output"
path=
"bin/classes"
/>
</classpath>
java/.project
View file @
9ca8792c
...
...
@@ -5,6 +5,12 @@
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>
org.eclipse.cdt.managedbuilder.core.genmakebuilder
</name>
<triggers>
clean,full,incremental,
</triggers>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>
com.android.ide.eclipse.adt.ResourceManagerBuilder
</name>
<arguments>
...
...
@@ -25,9 +31,19 @@
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>
org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder
</name>
<triggers>
full,incremental,
</triggers>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>
com.android.ide.eclipse.adt.AndroidNature
</nature>
<nature>
org.eclipse.jdt.core.javanature
</nature>
<nature>
org.eclipse.cdt.core.cnature
</nature>
<nature>
org.eclipse.cdt.core.ccnature
</nature>
<nature>
org.eclipse.cdt.managedbuilder.core.managedBuildNature
</nature>
<nature>
org.eclipse.cdt.managedbuilder.core.ScannerConfigNature
</nature>
</natures>
</projectDescription>
src/android/androidsound.cpp
View file @
9ca8792c
...
...
@@ -52,7 +52,7 @@ static int std_sample_rates[]={
};
struct
AndroidNativeSndCardData
{
AndroidNativeSndCardData
(
int
forced_rate
=
0
)
:
mVoipMode
(
0
)
,
mIoHandle
(
0
){
AndroidNativeSndCardData
(
int
forced_rate
,
audio_source_t
capture_source
)
:
mVoipMode
(
0
)
,
mIoHandle
(
0
),
mCaptureSource
(
capture_source
){
/* try to use the same sampling rate as the playback.*/
int
hwrate
;
enableVoipMode
();
...
...
@@ -121,6 +121,7 @@ struct AndroidNativeSndCardData{
int
mRecRate
;
int
mRecFrames
;
audio_io_handle_t
mIoHandle
;
audio_source_t
mCaptureSource
;
};
struct
AndroidSndReadData
{
...
...
@@ -274,7 +275,8 @@ static MSSndCard * android_snd_card_new(void)
d
=
sound_device_description_get
();
if
(
d
->
flags
&
DEVICE_HAS_BUILTIN_AEC
)
obj
->
capabilities
|=
MS_SND_CARD_CAP_BUILTIN_ECHO_CANCELLER
;
obj
->
latency
=
d
->
delay
;
obj
->
data
=
new
AndroidNativeSndCardData
(
d
->
recommended_rate
);
obj
->
data
=
new
AndroidNativeSndCardData
(
d
->
recommended_rate
,(
d
->
flags
&
DEVICE_USE_ANDROID_MIC
)
?
AUDIO_SOURCE_MIC
:
AUDIO_SOURCE_VOICE_COMMUNICATION
);
return
obj
;
}
...
...
@@ -389,7 +391,7 @@ static void android_snd_read_preprocess(MSFilter *obj){
ad
->
mFilter
=
obj
;
ad
->
read_samples
=
0
;
ad
->
started
=
FALSE
;
ad
->
audio_source
=
AUDIO_SOURCE_VOICE_COMMUNICATION
;
ad
->
audio_source
=
ad
->
mCard
->
mCaptureSource
;
/*some device require to capture from MIC instead of from voice communications*/
for
(
int
i
=
0
;
i
<
2
;
i
++
){
ad
->
rec
=
new
AudioRecord
(
ad
->
audio_source
,
ad
->
rate
,
...
...
@@ -399,8 +401,10 @@ static void android_snd_read_preprocess(MSFilter *obj){
(
AudioRecord
::
record_flags
)
0
/*flags ??*/
,
android_snd_read_cb
,
ad
,
notify_frames
,
0
);
ss
=
ad
->
rec
->
initCheck
();
ms_message
(
"Setting up AudioRecord source=%i,rate=%i,framecount=%i"
,
ad
->
audio_source
,
ad
->
rate
,
ad
->
rec_buf_size
);
if
(
ss
!=
0
){
ms_error
(
"Problem when setting up AudioRecord:%s
source=%i,rate=%i,framecount=%i"
,
strerror
(
-
ss
),
ad
->
audio_source
,
ad
->
rate
,
ad
->
rec_buf_size
);
ms_error
(
"Problem when setting up AudioRecord:%s
"
,
strerror
(
-
ss
)
);
delete
ad
->
rec
;
ad
->
rec
=
0
;
if
(
i
==
0
)
{
...
...
src/audiofilters/devices.c
View file @
9ca8792c
...
...
@@ -105,6 +105,7 @@ static SoundDeviceDescription devices[]={
{
"asus"
,
"Nexus 7"
,
""
,
0
,
170
},
{
"Amazon"
,
"KFTT"
,
"omap4"
,
DEVICE_USE_ANDROID_MIC
,
200
},
{
NULL
,
NULL
,
NULL
,
0
,
0
,
0
}
};
...
...
src/audiofilters/devices.h
View file @
9ca8792c
...
...
@@ -26,6 +26,7 @@
#define DEVICE_HAS_BUILTIN_AEC (1)
#define DEVICE_HAS_BUILTIN_AEC_CRAPPY (1<<1)
/*set when the device is claiming to have AEC but we should not trust it */
#define DEVICE_USE_ANDROID_MIC (1<<2)
/*set when the device needs to capture using MIC instead of Voice communication (I.E kindle fire) */
struct
SoundDeviceDescription
{
const
char
*
manufacturer
;
...
...
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