webrtc_video_camera_to_jni
2019-07-25 10:28:52 0 举报
webrtc摄像头数据发往jni层流程
作者其他创作
大纲/内容
WebSocketRTCClient
这里把new出来的2个红色的对象设置到capturer(jni层实现的)
startListening
initialize
3.回调到VidoCapturer
startCapturer
createPeerConnection
CameraSession.Events
void onCameraOpening(); void onCameraError(); void onCameraDisconnected(); void onCameraClosed(); void onByteBufferFrameCaptured(); void onTextureFrameCaptured();
onTextureFrameCaptured
create
MediaStream
PeerConnectionFactory
SurfaceTextureHelper
private final Handler handler; private final EglBase eglBase; private final int oesTextureId; private OnTextureFrameAvailableListener listener;
+ operation1(params):returnType- operation2(params)- operation3()
oesTextureId = GlUtil.generateTexture(GLES11Ext.GL_TEXTURE_EXTERNAL_OES); surfaceTexture = new SurfaceTexture(oesTextureId); surfaceTexture.setOnFrameAvailableListener(new SurfaceTexture.OnFrameAvailableListener() { @Override public void onFrameAvailable(SurfaceTexture surfaceTexture) { hasPendingTexture = true; tryDeliverTextureFrame(); } });
CameraEnumerator
startCall
CapturerObserver
camera = android.hardware.Camera.open(cameraId);camera.setPreviewTexture(surfaceTextureHelper.getSurfaceTexture());listenForTextureFrames()camera.startPreview();
CallActivity
initalize
createViddeoSource
CameraCapturer
cameraSessionEventsHandler attribute2:type attribute3:type
createMediaStream
1.这里是视频帧回调的起始点(helper类有一个单独的线程)
2.回调传递到session
PeerConnectionClient
AndroidVideoTrackSourceObserver
connectToRoom
onConnectedToRoom
Camera1Session
new
addTrack
VideoCapturer
VideoCapture
0.startPreview触发流程开始从1跑起来
createCapturer
0 条评论
回复 删除
下一页