Question about desiredBitrate

In simulcast consumer, we will calculate the desired bitrate.

	uint32_t SimulcastConsumer::GetDesiredBitrate() const
	{
		MS_TRACE();

		MS_ASSERT(this->externallyManagedBitrate, "bitrate is not externally managed");

		if (!IsActive())
			return 0u;

		auto nowMs = DepLibUV::GetTimeMs();
		uint32_t desiredBitrate{ 0u };

		for (int sIdx{ static_cast<int>(this->producerRtpStreams.size()) - 1 }; sIdx >= 0; --sIdx)
		{
			auto* producerRtpStream = this->producerRtpStreams.at(sIdx);

			if (!producerRtpStream)
				continue;

			desiredBitrate = producerRtpStream->GetBitrate(nowMs);

			if (desiredBitrate)
				break;
		}

		// If consumer.rtpParameters.encodings[0].maxBitrate was given and it's
		// greater than computed one, then use it.
		auto maxBitrate = this->rtpParameters.encodings[0].maxBitrate;

		if (maxBitrate > desiredBitrate)
			desiredBitrate = maxBitrate;

		return desiredBitrate;
	}

The function try to find out the highest active layer, and get it’s bitrate as desiredBitrate.
My question is why don’t we use the bitrate of preferred layer ?
In some situations, we only want to watch the speaker in big picture, and the others in small picture.

This desired bitrate is just used by the TransportCongestionClient to generate RTP probation. This RTP probation is just about sending a chunk of few RTP packets from time to time. The aim here is to be ready fo the “worst” case in which the receiver wishes to consumer the highest Consumer layers.

If we subscribe 8 video stream, the highest layer of them are 1080p, the desired bitrate will be quite large(more than 10MB), but we will never subscribe them all in 1080p, because the performance of pc or phone is not enough.

Yes, but nothing happens. mediasoup won’t send the “total desired bitrate” to the endpoint anyway but just the preferred layers.