VideoStreamEncoder: Remove check for zero VideoCodec.maxBitrate.
maxBitrate is set to a minimum of kEncoderMinBitrateKbps in VideoCodecInitializer::SetupCodec and cannot be zero at this point. Bug: none Change-Id: I4e062b054d99fabc1a9650260db03dd45b033c3c Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/230142 Reviewed-by: Erik Språng <sprang@webrtc.org> Commit-Queue: Åsa Persson <asapersson@webrtc.org> Cr-Commit-Position: refs/heads/main@{#35094}
This commit is contained in:
parent
be4b792f76
commit
29b4049abc
@ -990,7 +990,6 @@ void VideoStreamEncoder::ReconfigureEncoder() {
|
|||||||
for (size_t i = 0; i < codec.numberOfSimulcastStreams; ++i) {
|
for (size_t i = 0; i < codec.numberOfSimulcastStreams; ++i) {
|
||||||
log_stream << i << ": " << codec.simulcastStream[i].width << "x"
|
log_stream << i << ": " << codec.simulcastStream[i].width << "x"
|
||||||
<< codec.simulcastStream[i].height
|
<< codec.simulcastStream[i].height
|
||||||
<< " fps: " << codec.simulcastStream[i].maxFramerate
|
|
||||||
<< " min_kbps: " << codec.simulcastStream[i].minBitrate
|
<< " min_kbps: " << codec.simulcastStream[i].minBitrate
|
||||||
<< " target_kbps: " << codec.simulcastStream[i].targetBitrate
|
<< " target_kbps: " << codec.simulcastStream[i].targetBitrate
|
||||||
<< " max_kbps: " << codec.simulcastStream[i].maxBitrate
|
<< " max_kbps: " << codec.simulcastStream[i].maxBitrate
|
||||||
@ -1006,10 +1005,10 @@ void VideoStreamEncoder::ReconfigureEncoder() {
|
|||||||
for (size_t i = 0; i < num_spatial_layers; ++i) {
|
for (size_t i = 0; i < num_spatial_layers; ++i) {
|
||||||
log_stream << i << ": " << codec.spatialLayers[i].width << "x"
|
log_stream << i << ": " << codec.spatialLayers[i].width << "x"
|
||||||
<< codec.spatialLayers[i].height
|
<< codec.spatialLayers[i].height
|
||||||
<< " fps: " << codec.spatialLayers[i].maxFramerate
|
|
||||||
<< " min_kbps: " << codec.spatialLayers[i].minBitrate
|
<< " min_kbps: " << codec.spatialLayers[i].minBitrate
|
||||||
<< " target_kbps: " << codec.spatialLayers[i].targetBitrate
|
<< " target_kbps: " << codec.spatialLayers[i].targetBitrate
|
||||||
<< " max_kbps: " << codec.spatialLayers[i].maxBitrate
|
<< " max_kbps: " << codec.spatialLayers[i].maxBitrate
|
||||||
|
<< " max_fps: " << codec.spatialLayers[i].maxFramerate
|
||||||
<< " max_qp: " << codec.spatialLayers[i].qpMax
|
<< " max_qp: " << codec.spatialLayers[i].qpMax
|
||||||
<< " num_tl: " << codec.spatialLayers[i].numberOfTemporalLayers
|
<< " num_tl: " << codec.spatialLayers[i].numberOfTemporalLayers
|
||||||
<< " active: "
|
<< " active: "
|
||||||
@ -1059,23 +1058,6 @@ void VideoStreamEncoder::ReconfigureEncoder() {
|
|||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
|
|
||||||
if (codec.maxBitrate == 0) {
|
|
||||||
// max is one bit per pixel
|
|
||||||
codec.maxBitrate =
|
|
||||||
(static_cast<int>(codec.height) * static_cast<int>(codec.width) *
|
|
||||||
static_cast<int>(codec.maxFramerate)) /
|
|
||||||
1000;
|
|
||||||
if (codec.startBitrate > codec.maxBitrate) {
|
|
||||||
// But if the user tries to set a higher start bit rate we will
|
|
||||||
// increase the max accordingly.
|
|
||||||
codec.maxBitrate = codec.startBitrate;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (codec.startBitrate > codec.maxBitrate) {
|
|
||||||
codec.startBitrate = codec.maxBitrate;
|
|
||||||
}
|
|
||||||
|
|
||||||
rate_allocator_ =
|
rate_allocator_ =
|
||||||
settings_.bitrate_allocator_factory->CreateVideoBitrateAllocator(codec);
|
settings_.bitrate_allocator_factory->CreateVideoBitrateAllocator(codec);
|
||||||
rate_allocator_->SetLegacyConferenceMode(
|
rate_allocator_->SetLegacyConferenceMode(
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user