webrtc-java icon indicating copy to clipboard operation
webrtc-java copied to clipboard

Ignored codec preferences

Open akislyak opened this issue 3 years ago • 0 comments

Describe the bug I need to restrict codec specification that used in SDP negotiation so I set a List<RTCRtpCodecCapability> containing only one 'opus' to an instance of 'RTCRtpTransceiver' but underlying library ignores this. I got SDP offer having all default codecs. I saw JNI class 'JNI_RTCRtpTransceiver.cpp' has commented lines 144-148 it might be a reason.

To Reproduce Steps to reproduce the behavior:

    val audioCodecs = listOf(factory.getRtpReceiverCapabilities(MediaType.AUDIO)
        .codecs
        .first { it.name.contains("opus") }!!)
.
.
.
    val audionTransceiver = peerConnection.addTransceiver(audioTrack, audioInit)
    audionTransceiver.codecPreferences = audioCodecs

Expected behavior SDP offer has only 'opus' as a preferred codec

Desktop (please complete the following information):

  • OS: mac os
  • Version 0.6.0:macos-x86_64

Remarks: Is it really need to comment those lines?

akislyak avatar Feb 09 '22 13:02 akislyak