mediaSoup总体架构分析

先来张总体架构图吧,从官网拿的,根据这个图来分析下

mediaSoup总体架构分析_第1张图片

A worker represents a mediasoup C++ subprocess that runs in a single CPU core and handles Router instances.

可以看到每个worker相当于一个sfu,核心转发逻辑是router,下面我们来分析下这个router

A router enables injection, selection and forwarding of media streams through Transport instances created on it.

router维护了订阅关系:mapProducerConsumer。当producer有数据过来会直接转发给订阅它的consumer

mediaSoup总体架构分析_第2张图片

你可能感兴趣的:(mediaSoup总体架构分析)