crow-misia / libmediasoup-android

libmediasoupclient for Android
Apache License 2.0
10 stars 9 forks source link

Can't send multiple encoding layers in producer. #8

Closed ishabodiwala closed 1 year ago

ishabodiwala commented 1 year ago

Hi @crow-misia , In producer, we're attempting to send multiple encoding layers as list of RtpParameters.Encoding. For this, the 'genRtpEncodingParameters' method, which returns 'RtpParameters.Encoding,' is added to the 'RTCUtils' class. but get the error io.github.crow_misia.mediasoup.MediasoupException: error creating transceiver when we try to create producer.

fun genRtpEncodingParameters(
            rid: String?,
            active: Boolean,
            bitratePriority: Double?,
            networkPriority: Int?,
            maxBitrateBps: Int?,
            minBitrateBps: Int?,
            maxFramerate: Int?,
            numTemporalLayers: Int?,
            scaleResolutionDownBy: Double?,
            ssrc: Long?,
            adaptiveAudioPacketTime: Boolean?
        ): RtpParameters.Encoding? {
            return RtpParameters.Encoding(
                rid,
                active,
                bitratePriority!!,
                networkPriority!!,
                maxBitrateBps,
                minBitrateBps!!,
                maxFramerate,
                numTemporalLayers,
                scaleResolutionDownBy,
                ssrc,
                adaptiveAudioPacketTime!!
            )
        }

If we send single encoding parameter in the list, then it does not throw any error and working fine. After debugging we found that transceiver is not created due to Attempted to set an unimplemented parameter of RtpParameters.

ishabodiwala commented 1 year ago

Hi @crow-misia , By debuging and searching i found that Currently bitrate_priority and network_priority both are implemented "per-sender," meaning that these encoding parameters are used for the RtpSender as a whole, not for a specific encoding layer.This is done by setting these encoding parameters at index 0 of RtpParameters.encodings. because they are currently unimplemented to be used for a specific encoding layer. By setting index 1 and 2's bitrate priority and network priority to the corresponding default values of 1.00 and 1 , I am now able to send multiple encoding layers in the producer. But There is no change in video resolution based on which encoding was passed at consumer end when different layer was subscribed.

github-actions[bot] commented 1 year ago

This issue is stale because it has been open for 30 days with no activity.

github-actions[bot] commented 1 year ago

This issue was closed because it has been inactive for 14 days since being marked as stale.