Open Bug 1746481 Opened 3 years ago Updated 3 years ago

We have two different bitrate calculation algorithms

Categories

(Core :: WebRTC: Audio/Video, task, P3)

task

Tracking

()

People

(Reporter: bwc, Unassigned)

References

(Blocks 1 open bug)

Details

We have one in WebrtcVideoConduit::OnControlConfigChange, and another in SelectBitrates (which is used by VideoStreamFactory). These are implemented somewhat differently, which is probably not what we want. See https://bugzilla.mozilla.org/show_bug.cgi?id=1706917#c35

Also, note that if we handle bug 1746477 by making the "factory" just a passthrough, the SelectBitrates implementation will simply go away; we want to think this one through and decide how we want to reconcile before we do that.

^

Flags: needinfo?(apehrson)

Also, while we're looking at this, I should note that it looks like VideoStreamFactory::mMinBitrate is probably unnecessary; the site where we use this, we have a webrtc::VideoEncoderConfig, which has the same value in min_transmit_bitrate_bps.

I should also note that SelectBitrates does not use mPrefMaxBitrate (except to assert that it is either not set, or set to a large enough value that it would not have imposed any additional constraint):

https://searchfox.org/mozilla-central/rev/125116c312b0a9c438d44e16011b116950caf17e/dom/media/webrtc/libwebrtcglue/VideoStreamFactory.cpp#111

The code in OnControlConfigChange does seem to take the pref max into account.

One reason these are inherently different is that the SelectBitrates logic depends on the input frame resolution. And that involves setting the target bitrate. We need to look into what options we have here -- can we skip setting that and upstream will do something reasonable? Doesn't seem like it at first glance.

Flags: needinfo?(apehrson)
You need to log in before you can comment on or make changes to this bug.