Add support for RtpEncodingParameters::max_framerate
This adds the framework support for the max_framerate parameter. It doesn't implement it in any encoder yet. Bug: webrtc:11117 Change-Id: I329624cc0205c828498d3623a2e13dd3f97e1629 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/160184 Reviewed-by: Steve Anton <steveanton@webrtc.org> Reviewed-by: Erik Språng <sprang@webrtc.org> Reviewed-by: Åsa Persson <asapersson@webrtc.org> Commit-Queue: Florent Castelli <orphis@webrtc.org> Cr-Commit-Position: refs/heads/master@{#29907}
This commit is contained in:

committed by
Commit Bot

parent
f534a64047
commit
15be5282e9
@ -89,17 +89,13 @@ VideoCodec VideoCodecInitializer::VideoEncoderConfigToVideoCodec(
|
||||
kDefaultOutlierFrameSizePercent};
|
||||
RTC_DCHECK_LE(streams.size(), kMaxSimulcastStreams);
|
||||
|
||||
int max_framerate = 0;
|
||||
|
||||
for (size_t i = 0; i < streams.size(); ++i) {
|
||||
SimulcastStream* sim_stream = &video_codec.simulcastStream[i];
|
||||
RTC_DCHECK_GT(streams[i].width, 0);
|
||||
RTC_DCHECK_GT(streams[i].height, 0);
|
||||
RTC_DCHECK_GT(streams[i].max_framerate, 0);
|
||||
// Different framerates not supported per stream at the moment, unless it's
|
||||
// screenshare where there is an exception and a simulcast encoder adapter,
|
||||
// which supports different framerates, is used instead.
|
||||
if (config.content_type != VideoEncoderConfig::ContentType::kScreen) {
|
||||
RTC_DCHECK_EQ(streams[i].max_framerate, streams[0].max_framerate);
|
||||
}
|
||||
RTC_DCHECK_GE(streams[i].min_bitrate_bps, 0);
|
||||
RTC_DCHECK_GE(streams[i].target_bitrate_bps, streams[i].min_bitrate_bps);
|
||||
RTC_DCHECK_GE(streams[i].max_bitrate_bps, streams[i].target_bitrate_bps);
|
||||
@ -126,6 +122,7 @@ VideoCodec VideoCodecInitializer::VideoEncoderConfigToVideoCodec(
|
||||
video_codec.maxBitrate += streams[i].max_bitrate_bps / 1000;
|
||||
video_codec.qpMax = std::max(video_codec.qpMax,
|
||||
static_cast<unsigned int>(streams[i].max_qp));
|
||||
max_framerate = std::max(max_framerate, streams[i].max_framerate);
|
||||
}
|
||||
|
||||
if (video_codec.maxBitrate == 0) {
|
||||
@ -137,8 +134,7 @@ VideoCodec VideoCodecInitializer::VideoEncoderConfigToVideoCodec(
|
||||
if (video_codec.maxBitrate < kEncoderMinBitrateKbps)
|
||||
video_codec.maxBitrate = kEncoderMinBitrateKbps;
|
||||
|
||||
RTC_DCHECK_GT(streams[0].max_framerate, 0);
|
||||
video_codec.maxFramerate = streams[0].max_framerate;
|
||||
video_codec.maxFramerate = max_framerate;
|
||||
|
||||
// Set codec specific options
|
||||
if (config.encoder_specific_settings)
|
||||
|
Reference in New Issue
Block a user