linphone-CallManager.java文件分析
来源:互联网 发布:oracle导入txt数据 编辑:程序博客网 时间:2024/06/07 00:21
说明
进行会话的管理,重新加入会话等
功能
- 创建会话
- 重新进入Video
- 重新设置参数
- 更新会话
UML类图
CallManger.java
package org.linphone;import org.linphone.core.LinphoneAddress;import org.linphone.core.LinphoneCall;import org.linphone.core.LinphoneCallParams;import org.linphone.core.LinphoneCore;import org.linphone.core.LinphoneCoreException;import org.linphone.mediastream.Log;/** * Handle call updating, reinvites. * * @author Guillaume Beraudo * */public class CallManager { private static CallManager instance; private CallManager() {} public static final synchronized CallManager getInstance() { if (instance == null) instance = new CallManager(); return instance; } private BandwidthManager bm() { return BandwidthManager.getInstance(); } /** * * @params LinphoneAddress linphone拨打电话的地址承载类 * @params boolean 是否支持video * @params lowBandwidth 是否是lowBandwidth */ public void inviteAddress(LinphoneAddress lAddress, boolean videoEnabled, boolean lowBandwidth) throws LinphoneCoreException { LinphoneCore lc = LinphoneManager.getLc(); LinphoneCallParams params = lc.createCallParams(null); bm().updateWithProfileSettings(lc, params); if (videoEnabled && params.getVideoEnabled()) { params.setVideoEnabled(true); } else { params.setVideoEnabled(false); } if (lowBandwidth) { params.enableLowBandwidth(true); Log.d("Low bandwidth enabled in call params"); } lc.inviteAddressWithParams(lAddress, params); } /** * Add video to a currently running voice only call. * No re-invite is sent if the current call is already video * or if the bandwidth settings are too low. * @return if updateCall called */ boolean reinviteWithVideo() { LinphoneCore lc = LinphoneManager.getLc(); LinphoneCall lCall = lc.getCurrentCall(); if (lCall == null) { Log.e("Trying to reinviteWithVideo while not in call: doing nothing"); return false; } LinphoneCallParams params = lCall.getCurrentParamsCopy(); if (params.getVideoEnabled()) return false; // Check if video possible regarding bandwidth limitations bm().updateWithProfileSettings(lc, params); // Abort if not enough bandwidth... if (!params.getVideoEnabled()) { return false; } // Not yet in video call: try to re-invite with video lc.updateCall(lCall, params); return true; } /** * Re-invite with parameters updated from profile. */ void reinvite() { LinphoneCore lc = LinphoneManager.getLc(); LinphoneCall lCall = lc.getCurrentCall(); if (lCall == null) { Log.e("Trying to reinvite while not in call: doing nothing"); return; } LinphoneCallParams params = lCall.getCurrentParamsCopy(); bm().updateWithProfileSettings(lc, params); lc.updateCall(lCall, params); } /** * Change the preferred video size used by linphone core. (impact landscape/portrait buffer). * Update current call, without reinvite. * The camera will be restarted when mediastreamer chain is recreated and setParameters is called. */ public void updateCall() { LinphoneCore lc = LinphoneManager.getLc(); LinphoneCall lCall = lc.getCurrentCall(); if (lCall == null) { Log.e("Trying to updateCall while not in call: doing nothing"); return; } LinphoneCallParams params = lCall.getCurrentParamsCopy(); bm().updateWithProfileSettings(lc, params); lc.updateCall(lCall, null); }}
0 0
- linphone-CallManager.java文件分析
- linphone-LinphoneManager.java文件分析
- linphone-LinphoneCoreFactory.java文件分析
- linphone-LinphoneAddress.java文件分析
- linphone-LpConfig.java文件分析
- linphone-LinponeCore.java文件分析
- linphone-LinphoneContent.java文件分析
- linphone-LinphoneInfoMessage.java文件分析
- linphone-PresenceModel.java文件分析
- linphone-PresenceActivity.java文件分析
- linphone-PresenceService.java文件分析
- linphone-PresencePerson.java文件分析
- linphone-PresenceNote.java文件分析
- linphone-Tunnelconfig.java文件分析
- linphone-KeepAliveReceiver.java文件分析
- linphone-BootReceiver.java文件分析
- linphone-NetworkManger.java文件分析
- linphone-LinphonePreferences.java文件分析
- CRC32学习总结
- 图的深度优先搜索(Depth First Search,DFS)
- [1.1] 面向对象编程之get-set方法与构造器详解
- webservice基础
- POJ1915 BFS
- linphone-CallManager.java文件分析
- 深入解析淘宝Diamond之客户端架构
- 图片边框
- final修饰符
- 树莓派 Learning 002 装机后的必要操作 --- 06 共用键鼠 之 windows和树莓派
- String的==和equals()
- 【数组14】构建乘积数组
- HDU-5326 Work
- Leetcode 106. Construct Binary Tree from Inorder and Postorder Traversal (Medium) (cpp)