本文是在乐视做Phone开发时,预研视频通话功能的文档
//发起升级请求
VideoCallImpl.sendSessionModifyRequest()
logv("[sendSessionModifyRequest]current: " + originalProfile + ", requesting: " + requestProfile);
//收到native层上报的消息
ImsVTProvider.postEventFromNative()
Log.d(TAG, "postEventFromNative : msg = SESSION_EVENT_RECV_SESSION_CONFIG_RSP");
//InCallUI收到消息
InCallVideoCallCallback.onSessionModifyResponseReceived()
Log.d(this, "onSessionModifyResponseReceived status=" + status + " requestedProfile=" + requestedProfile
+ " responseProfile=" + responseProfile);
InCallUI.Call.setSessionModificationState()
Log.d(this, "setSessionModificationState " + state + " mSessionModificationState=" + mSessionModificationState);
CallCardPresenter.onSessionModificationStateChange()
Log.d(this, "onSessionModificationStateChange : sessionModificationState = " + sessionModificationState);
ImsVTProvider.postEventFromNative()
Log.d(TAG, "postEventFromNative : msg = SESSION_EVENT_RECV_SESSION_CONFIG_REQ");
InCallVideoCallCallback.onSessionModifyRequestReceived()
Log.d(this, " onSessionModifyRequestReceived videoProfile=" + videoProfile);
Log.d(this, "VideoState[pre:" + previousVideoState + ",new:" + newVideoState + ",preVC:"
+ wasVideoCall + ",curVC" + isVideoCall);
InCallVideoCallCallbackNotifier.upgradeToVideoRequest()
Log.d(this, "upgradeToVideoRequest call = " + call + " new video state = " + videoState);
VideoSessionController.onUpgradeToVideoRequest()
logd("onUpgradeToVideoRequest callId = " + getId(call) + " new video state = " + videoState);
InCallUI.Call.setRequestedVideoState()
Log.d(this, "setRequestedVideoState - video state= " + videoState);
Log.d(this, "setRequestedVideoState - mSessionModificationState=" + mSessionModificationState
+ " video state= " + videoState);
CallList.onUpgradeToVideo()
Log.d(this, "onUpgradeToVideo call=" + call);
VideoCallImpl.setCamera()
logv("[setCamera]cameraId = " + cameraId);
ImsVTProvider.postEventFromNative()
Log.d(TAG, "postEventFromNative : msg = MSG_PEER_CAMERA_OPEN");
//VideoCallPresenter收到通话信息的变化
VideoCallPresenter.onStateChange()
Log.d(this, "onStateChange oldState" + oldState + " newState=" + newState +" isVideoMode=" + isVideoMode());
VideoCallPresenter.checkForVideoCallChange()
Log.d(this, "checkForVideoCallChange: videoCall=" + videoCall + " mVideoCall=" + mVideoCall);
VideoCallPresenter.checkForVideoStateChange()
Log.d(this, "checkForVideoStateChange: isVideoCall= " + isVideoCall + " hasVideoStateChanged=" +
hasVideoStateChanged + " isVideoMode=" + isVideoMode() + " previousVideoState: " +
VideoProfile.videoStateToString(mCurrentVideoState) + " newVideoState: "+
VideoProfile.videoStateToString(call.getVideoState()));
//当视频通话成功建立,isVideoCall = true
VideoCallPresenter.enterVideoMode()
Log.d(this, "enterVideoMode videoCall= " + videoCall + " videoState: " + newVideoState);
//videoCallFragment初始化
VideoCallFragment.inflateVideoCallViews()
Log.d(this, "inflateVideoCallViews");
Log.d(this, "inflateVideoCallViews: sVideoSurfacesInUse=" + sVideoSurfacesInUse);
Log.d(this, " inflateVideoCallViews screenSize" + screenSize);
VideoCallSurface.VideoCallSurface()
Log.d(this, "VideoCallSurface: surfaceId=" + surfaceId + " width=" + width + " height=" + height);
Log.d(this, "recreateView: SavedSurfaceTexture=" + mSavedSurfaceTexture + "
areSameSurfaces=" + areSameSurfaces);
VideoCallSurface.onSurfaceTextureAvailable()
Log.d(this, " onSurfaceTextureAvailable mSurfaceId=" + mSurfaceId + " surfaceTexture=" +
surfaceTexture + " width=" + width+ " height=" + height + " mSavedSurfaceTexture=" +
mSavedSurfaceTexture);
VideoCallPresenter.onSurfaceCreated()
Log.d(this, "onSurfaceCreated surface=" + surface + " mVideoCall=" + mVideoCall);
Log.d(this, "onSurfaceCreated PreviewSurfaceState=" + mPreviewSurfaceState);
Log.d(this, "onSurfaceCreated presenter=" + this);
VideoCallImpl.setPreviewSurface()
logv("[setPreviewSurface]preview = " + surface);
VideoCallImpl.setDisplaySurface()
logv("[setDisplaySurface]display = " + surface);