Reland "RtpEncodingParameters::request_resolution patch 1"
This reverts commit b625101da8d798c936cfd695505a5514644158b0.
Reason for revert: Found problem that was specific how
configuration is handled for VP9. A 1-line change in webrtc_video_engine.cc line 3715.
Thanks Rasmus and great that this was tested!
Original change's description:
> Revert "RtpEncodingParameters::request_resolution patch 1"
>
> This reverts commit ef7359e679e579ccb79afacf5c42e8c6020124e2.
>
> Reason for revert: Breaks downstream test
>
> Original change's description:
> > 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}
>
> Bug: webrtc:14451
> Change-Id: I4b9590e23ec38e9e1c2e51a4600ef96b129439f2
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/276541
> Commit-Queue: Björn Terelius <terelius@webrtc.org>
> Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
> Reviewed-by: Jonas Oreland <jonaso@webrtc.org>
> Owners-Override: Björn Terelius <terelius@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#38176}
Bug: webrtc:14451
Change-Id: Ica9b74180bce22d09bf289126bb5ac137bf9eb70
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/276543
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Commit-Queue: Jonas Oreland <jonaso@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38178}
diff --git a/api/video/video_source_interface.h b/api/video/video_source_interface.h
index 5eb4ebf..72937c7 100644
--- a/api/video/video_source_interface.h
+++ b/api/video/video_source_interface.h
@@ -80,6 +80,24 @@
// Note that the `resolutions` can change while frames are in flight and
// should only be used as a hint when constructing the webrtc::VideoFrame.
std::vector<FrameSize> resolutions;
+
+ // This is the resolution requested by the user using RtpEncodingParameters.
+ absl::optional<FrameSize> requested_resolution;
+
+ // `active` : is (any) of the layers/sink(s) active.
+ bool is_active = false;
+
+ // This sub-struct contains information computed by VideoBroadcaster
+ // that aggregates several VideoSinkWants (and sends them to
+ // AdaptedVideoTrackSource).
+ struct Aggregates {
+ // `active_without_requested_resolution` is set by VideoBroadcaster
+ // when aggregating sink wants if there exists any sink (encoder) that is
+ // active but has not set the `requested_resolution`, i.e is relying on
+ // OnOutputFormatRequest to handle encode resolution.
+ bool any_active_without_requested_resolution = false;
+ };
+ absl::optional<Aggregates> aggregates;
};
inline bool operator==(const VideoSinkWants::FrameSize& a,
@@ -87,6 +105,11 @@
return a.width == b.width && a.height == b.height;
}
+inline bool operator!=(const VideoSinkWants::FrameSize& a,
+ const VideoSinkWants::FrameSize& b) {
+ return !(a == b);
+}
+
template <typename VideoFrameT>
class VideoSourceInterface {
public: