licode room publish过程解析
2019-03-08 10:22:44 0 举报
licode room publish过程解析
作者其他创作
大纲/内容
connection._createWrtc(addon)
一个erizoJS.client有多个connections(每个cilent对应一个浏览器,每个浏览器publish一路,subscribe多路,每一路是一个connection)每个connection有一个webrtcconncetion,每个conncetion有多个mediaStreams(暂时不知道为什么)每个publisher有一个connection,每个publisher有一个muxer(一对多转发)每个erizoJS对应一个erizoJScontroller,由erizoJScontroller接收rpc消息(pubLish、subscribe等)
erizocontroller_server
webrtcstack.createoffer
responseid:streamIderizoId
erizocontroller
nuve_server
callbackoffer body
webrtcconnection.init解析:
erizoJS
this.muxer = new addon.OneToManyProcessor()
JS_publisher
callrpc'ErizoAgent'createErizoJS
createoffersendonlystreamId
addPublisherclientidstreamid(由client生成)
stream init
client.getOrCreateConnectionconnect.id: '${client.id}_自增ID'
roomcontroller
client/channel
onSignalingMessagemsg.type: 'offer'
publishers[streamId] = erizoId;subscribers[streamId] = [];
nuve
nuve_resource_db
emit 'launch-erizo'
emit
监听点对点连接client的消息:signaling_message、publish、subscribe、updateStreamAttributes、unpublish、unsubscribe
callback{type: 'ready'}
erizoJS_server
webrtcstack.processAnswer
signaling_message_erizo
id(erizoJS_id)是由erizoAgent.erizolist随机生成的子进程erizoProcess启动erizoJS
接收rpc命令
CONN_SDP_PROCESSED
room.publish
建立websocket连接
erizoAgent
basic_client
创建webrtc的peerconncetion
emit 'access-accepted'
new Clientid:clientId
populateStreamFunctionscreateLocalStreamErizoConnection
processSignaling'ErizoJS_jsID'clinetIdstreamIdmsg
rpc callback返回erizoId(JS_id)agentiderizo.position(暂时不知道什么作用)
getusermedia
processSignalingclientidstreamIDmsg
onAddStream
rpc bindbroadcast 'ErizoJS''ErizoJS_'+id
erizoJScontroller
client
JS_clientJS_connection
callrpc'initializing'
room.sendMessage('onAddStream'
new channelnew client点对点信令连接
erizoconnection
room
createSdpConstraints
erizo_client
call rpc'ErizoJS_' + erizoID'addPublisher'
JS_subscriber
0 条评论
回复 删除
下一页