Below is our instantiation code for simulcasting. On the receiver end the RIDs are swapped,
0 is the high quality while 2 is the low quality. And everything we do does not change the index. It feels like we are missing something basic.
if (isVideoCallEnabled()) {
val l = RtpParameters.Encoding("0", true, 4.0)
val m = RtpParameters.Encoding("1", true, 4.0)
val h = RtpParameters.Encoding("2", true, 4.0)
l.apply {
minBitrateBps = 100_000
maxBitrateBps = 300_000
maxFramerate = 30
}
m.apply {
minBitrateBps = 300_000
maxBitrateBps = 600_000
maxFramerate = 30
}
h.apply {
minBitrateBps = 600_000
maxBitrateBps = 1_200_000
maxFramerate = 30
}
val listOfEncodings = listOf(
l, m, h
)
val transceiver = peerConnection?.addTransceiver(
localVideoTrack,
RtpTransceiver.RtpTransceiverInit(
RtpTransceiver.RtpTransceiverDirection.SEND_ONLY,
listOf(),
listOfEncodings
)
)