RtpEncodingParameters::request_resolution patch 1

This patch adds RtpEncodingParameters::request_resolution
with documentation and plumming. No behaviour is changed yet.

Bug: webrtc:14451
Change-Id: I1f4f83a312ee8c293e3d8f02b950751e62048304
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/276262
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Commit-Queue: Jonas Oreland <jonaso@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38172}
This commit is contained in:
Jonas Oreland
2022-09-22 14:27:46 +02:00
committed by WebRTC LUCI CQ
parent 42f5fe540c
commit ef7359e679
18 changed files with 305 additions and 37 deletions

View File

@ -84,6 +84,7 @@ rtc_library("video_codecs_api") {
"../units:data_rate",
"../video:encoded_image",
"../video:render_resolution",
"../video:resolution",
"../video:video_bitrate_allocation",
"../video:video_codec_constants",
"../video:video_frame",

View File

@ -18,6 +18,7 @@
#include "absl/types/optional.h"
#include "api/scoped_refptr.h"
#include "api/video/resolution.h"
#include "api/video_codecs/scalability_mode.h"
#include "api/video_codecs/sdp_video_format.h"
#include "api/video_codecs/video_codec.h"
@ -32,10 +33,11 @@ struct VideoStream {
VideoStream(const VideoStream& other);
std::string ToString() const;
// Width in pixels.
// Width/Height in pixels.
// This is the actual width and height used to configure encoder,
// which might be less than `requested_resolution` due to adaptation
// or due to the source providing smaller frames than requested.
size_t width;
// Height in pixels.
size_t height;
// Frame rate in fps.
@ -69,6 +71,17 @@ struct VideoStream {
// If this stream is enabled by the user, or not.
bool active;
// An optional user supplied max_frame_resolution
// than can be set independently of (adapted) VideoSource.
// This value is set from RtpEncodingParameters::requested_resolution
// (i.e. used for signaling app-level settings).
//
// The actual encode resolution is in `width` and `height`,
// which can be lower than requested_resolution,
// e.g. if source only provides lower resolution or
// if resource adaptation is active.
absl::optional<Resolution> requested_resolution;
};
class VideoEncoderConfig {