mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-17 11:08:06 +00:00
correct no video error in android and set speakerphone always for special devices
(cherry picked from commit b9829e15a7)
This commit is contained in:
parent
d49fde2596
commit
65e7fca08c
3 changed files with 22 additions and 4 deletions
|
|
@ -1066,6 +1066,13 @@ public interface LinphoneCore {
|
|||
* @return true if speaker enabled, false otherwise
|
||||
*/
|
||||
boolean isSpeakerEnabled();
|
||||
|
||||
/**
|
||||
* Always Activates the speaker or not.
|
||||
* @param value
|
||||
*/
|
||||
void setSpeakerphoneAlwaysOn(boolean value);
|
||||
|
||||
/**
|
||||
* add a friend to the current buddy list, if subscription attribute is set, a SIP SUBSCRIBE message is sent.
|
||||
* @param lf LinphoenFriend to add
|
||||
|
|
|
|||
|
|
@ -96,6 +96,12 @@ public class LinphoneCoreFactoryImpl extends LinphoneCoreFactory {
|
|||
return true;
|
||||
}
|
||||
|
||||
private void setSpeaker(LinphoneCore lc) {
|
||||
boolean value = MediastreamerAndroidContext.getSpeakerphoneAlwaysOn(lc.getMSFactory());
|
||||
lc.setSpeakerphoneAlwaysOn(value);
|
||||
lc.enableSpeaker(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public LinphoneCore createLinphoneCore(LinphoneCoreListener listener,
|
||||
String userConfig, String factoryConfig, Object userdata, Object context)
|
||||
|
|
@ -104,11 +110,11 @@ public class LinphoneCoreFactoryImpl extends LinphoneCoreFactory {
|
|||
fcontext = (Context)context;
|
||||
boolean openh264DownloadEnabled = false;
|
||||
if (context != null) openh264DownloadEnabled = loadingDownloadedOpenH264(fcontext);
|
||||
|
||||
MediastreamerAndroidContext.setContext(context);
|
||||
File user = userConfig == null ? null : new File(userConfig);
|
||||
File factory = factoryConfig == null ? null : new File(factoryConfig);
|
||||
LinphoneCore lc = new LinphoneCoreImpl(listener, user, factory, userdata, context);
|
||||
MediastreamerAndroidContext.setContext(context,lc.getMSFactory());
|
||||
setSpeaker(lc);
|
||||
lc.enableDownloadOpenH264(openh264DownloadEnabled);
|
||||
return lc;
|
||||
} catch (IOException e) {
|
||||
|
|
@ -122,9 +128,9 @@ public class LinphoneCoreFactoryImpl extends LinphoneCoreFactory {
|
|||
fcontext = (Context)context;
|
||||
boolean openh264DownloadEnabled = false;
|
||||
if (context != null) openh264DownloadEnabled = loadingDownloadedOpenH264(fcontext);
|
||||
|
||||
MediastreamerAndroidContext.setContext(context);
|
||||
LinphoneCore lc = new LinphoneCoreImpl(listener, context);
|
||||
MediastreamerAndroidContext.setContext(context,lc.getMSFactory());
|
||||
setSpeaker(lc);
|
||||
lc.enableDownloadOpenH264(openh264DownloadEnabled);
|
||||
return lc;
|
||||
} catch (IOException e) {
|
||||
|
|
|
|||
|
|
@ -47,6 +47,7 @@ class LinphoneCoreImpl implements LinphoneCore {
|
|||
private AudioManager mAudioManager = null;
|
||||
private boolean openh264DownloadEnabled = false;
|
||||
private boolean mSpeakerEnabled = false;
|
||||
private boolean mSpeakerphoneAlwaysOn = false; //Speakerphone always on for some speacial devices
|
||||
private native long newLinphoneCore(LinphoneCoreListener listener,String userConfig,String factoryConfig,Object userdata, Object context);
|
||||
private native void iterate(long nativePtr);
|
||||
private native LinphoneProxyConfig getDefaultProxyConfig(long nativePtr);
|
||||
|
|
@ -446,6 +447,7 @@ class LinphoneCoreImpl implements LinphoneCore {
|
|||
}
|
||||
private native void forceSpeakerState(long nativePtr, boolean speakerOn);
|
||||
public void enableSpeaker(boolean value) {
|
||||
value = value || mSpeakerphoneAlwaysOn;
|
||||
final LinphoneCall call = getCurrentCall();
|
||||
mSpeakerEnabled = value;
|
||||
applyAudioHacks();
|
||||
|
|
@ -459,6 +461,9 @@ class LinphoneCoreImpl implements LinphoneCore {
|
|||
public boolean isSpeakerEnabled() {
|
||||
return mSpeakerEnabled;
|
||||
}
|
||||
public void setSpeakerphoneAlwaysOn(boolean value) {
|
||||
mSpeakerphoneAlwaysOn = value;
|
||||
}
|
||||
public synchronized void playDtmf(char number, int duration) {
|
||||
playDtmf(nativePtr,number, duration);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue