webrtcgraceful-degradationopenwebrtc

What does libwebrtc's DegradationPreference:: Balanced do?


I am integrating a opensource libwebrtc from https://opensource.apple.com/source/WebCore/WebCore-7604.5.6/Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp.auto.html.

In the code I see

switch (rtcParameters.degradation_preference) {
    case webrtc::DegradationPreference::MAINTAIN_FRAMERATE:
        parameters.degradationPreference = RTCRtpParameters::DegradationPreference::MaintainFramerate;
        break;
    case webrtc::DegradationPreference::MAINTAIN_RESOLUTION:
        parameters.degradationPreference = RTCRtpParameters::DegradationPreference::MaintainResolution;
        break;
    case webrtc::DegradationPreference::BALANCED:
        parameters.degradationPreference = RTCRtpParameters::DegradationPreference::Balanced;
        break;
    };

What is the internal behavior when the BALANCED option is selected?

I have looked through the opensource documentation and searched the web, but I have not found relevant information. I'd appreciate if anyone can point me to the right place.


Solution

  • Using Chromiums codesearch which includes the original sources is way more helpful than Apple's copy: https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/api/rtp_parameters.h;l=88;drc=d31d2d07343b6515b61bb4b7f7c4ce32bd7e38d4 it is a mix between the two options, maintaining framerate or resolution.

    The concrete implementation can be found here