Commit 7319e26b authored by Simon Morlat's avatar Simon Morlat
Browse files

don't use libmedia on HP Slate 21.

parent 9909bb8a
......@@ -39,7 +39,7 @@ using namespace::fake_android;
/*notification duration for audio callbacks, in ms*/
static const float audio_buf_ms=0.01;
static MSSndCard * android_snd_card_new(void);
static MSSndCard * android_snd_card_new(SoundDeviceDescription *d);
static MSFilter * ms_android_snd_read_new(void);
static MSFilter * ms_android_snd_write_new(void);
static Library *libmedia=0;
......@@ -236,6 +236,7 @@ static void android_snd_card_detect(MSSndCardManager *m){
bool audio_system_loaded=false;
bool string8_loaded=false;
bool refbase_loaded=false;
SoundDeviceDescription *d;
if (get_sdk_version()>19){
/*it is actually working well on android 5 on Nexus 4 but crashes on Samsung S5, due to, maybe
......@@ -262,9 +263,10 @@ static void android_snd_card_detect(MSSndCardManager *m){
audio_track_loaded=AudioTrackImpl::init(libmedia);
audio_system_loaded=AudioSystemImpl::init(libmedia);
}
if (audio_record_loaded && audio_track_loaded && audio_system_loaded && string8_loaded && refbase_loaded){
d=sound_device_description_get();
if (audio_record_loaded && audio_track_loaded && audio_system_loaded && string8_loaded && refbase_loaded && !(d->flags & DEVICE_HAS_UNSTANDARD_LIBMEDIA)){
ms_message("Native android sound support available.");
MSSndCard *card=android_snd_card_new();
MSSndCard *card=android_snd_card_new(d);
ms_snd_card_manager_add_card(m,card);
return;
}
......@@ -297,15 +299,14 @@ MSSndCardDesc android_native_snd_card_desc={
static MSSndCard * android_snd_card_new(void)
static MSSndCard * android_snd_card_new(SoundDeviceDescription *d)
{
MSSndCard * obj;
SoundDeviceDescription *d;
obj=ms_snd_card_new(&android_native_snd_card_desc);
obj->name=ms_strdup("android sound card");
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
......
......@@ -129,6 +129,8 @@ static SoundDeviceDescription devices[]={
{ "Enspert", "IGGY", "" , 0, 320 ,0}, /*Wiko iggy*/
{ "Yota Devices Limited", "YD201", "msm8974", DEVICE_HAS_BUILTIN_AEC | DEVICE_HAS_BUILTIN_OPENSLES_AEC, 0, 48000 }, /* Yotaphone 2 */
{ "Hewlett-Packard", "Slate 21 Pro", "tegra4", DEVICE_HAS_UNSTANDARD_LIBMEDIA, 250 },
{ NULL, NULL, NULL, 0, 0,0}
};
......@@ -274,6 +276,7 @@ SoundDeviceDescription * sound_device_description_get(void){
}
if (d->flags & DEVICE_HAS_CRAPPY_ANDROID_FASTTRACK) ms_warning("Fasttrack playback mode is crappy on this device, not using it.");
if (d->flags & DEVICE_HAS_CRAPPY_ANDROID_FASTRECORD) ms_warning("Fasttrack record mode is crappy on this device, not using it.");
if (d->flags & DEVICE_HAS_UNSTANDARD_LIBMEDIA) ms_warning("This device has unstandart libmedia.");
ms_message("Sound device information for [%s/%s/%s] is: builtin=[%s], delay=[%i] ms",
manufacturer,model,platform, (d->flags & DEVICE_HAS_BUILTIN_AEC) ? "yes" : "no", d->delay);
return d;
......
......@@ -30,6 +30,7 @@
#define DEVICE_HAS_BUILTIN_OPENSLES_AEC (1<<3) /*set when the device automatically enables it's AEC when using OpenSLES */
#define DEVICE_HAS_CRAPPY_ANDROID_FASTTRACK (1<<4) /*set when the AUDIO_OUTPUT_FLAG_FAST flag of android AudioTrack doesn't work*/
#define DEVICE_HAS_CRAPPY_ANDROID_FASTRECORD (1<<5) /*set when the AUDIO_INPUT_FLAG_FAST flag of android AudioRecord doesn't work*/
#define DEVICE_HAS_UNSTANDARD_LIBMEDIA (1<<6) /*set when the libmedia backend shall not be used because of proprietary modifications made into it by the manufacturer*/
struct SoundDeviceAudioHacks {
const char *equalizer;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment