Skip to content
Snippets Groups Projects
Commit 127f7b8a authored by Alexander Lussier-Cullen's avatar Alexander Lussier-Cullen Committed by Adrien Béraud
Browse files

video_rtp_session: adjust bitrate start/max for higher resolution video

Normally with 1440p or higher video, the upward bitrate adjustment can
take awhile to reach acceptable levels for the resolution. Starting
these at a higher bitrate will allow the adjustment to be made more
quickly. Also, the maximum bitrate of 6000kbps is potentially
insufficient for these higher resolutions, so this is also adjusted.

The constant values used for the bitrate and max bitrate calculation
are mostly arbitrary and simply fit what values seem to work best for
1440p and 4k video.

Change-Id: I746eeddae5ac8183039cb757bba881475b9e2907
parent 6a7a4f40
No related branches found
No related tags found
No related merge requests found
......@@ -94,6 +94,13 @@ void
VideoRtpSession::updateMedia(const MediaDescription& send, const MediaDescription& receive)
{
BaseType::updateMedia(send, receive);
// adjust send->codec bitrate info for higher video resolutions
auto codecVideo = std::static_pointer_cast<jami::SystemVideoCodecInfo>(send_.codec);
if (codecVideo) {
auto const pixels = localVideoParams_.height * localVideoParams_.width;
codecVideo->bitrate = std::max((unsigned int)(pixels * 0.001), SystemCodecInfo::DEFAULT_VIDEO_BITRATE);
codecVideo->maxBitrate = std::max((unsigned int)(pixels * 0.0015), SystemCodecInfo::DEFAULT_MAX_BITRATE);
}
setupVideoBitrateInfo();
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment