Let ViEEncoder express resolution requests as Sinkwants.
This removes the VideoSendStream::LoadObserver interface and the implementation in WebrtcVideoSendStream and replace it with VideoSinkWants through the VideoSourceInterface.
To do that that, some stats for CPU adaptation is moved into VideoSendStream. Also handling of the CVO rtp header extension is moved to VideoSendStreamImpl.
BUG=webrtc:5687
TBR=mflodman@webrtc.org
Review-Url: https://codereview.webrtc.org/2304363002
Cr-Commit-Position: refs/heads/master@{#14877}
diff --git a/webrtc/test/frame_generator_capturer.h b/webrtc/test/frame_generator_capturer.h
index fa001c4..01bc04b 100644
--- a/webrtc/test/frame_generator_capturer.h
+++ b/webrtc/test/frame_generator_capturer.h
@@ -31,6 +31,17 @@
class FrameGeneratorCapturer : public VideoCapturer {
public:
+ class SinkWantsObserver {
+ public:
+ // OnSinkWantsChanged is called when FrameGeneratorCapturer::AddOrUpdateSink
+ // is called.
+ virtual void OnSinkWantsChanged(rtc::VideoSinkInterface<VideoFrame>* sink,
+ const rtc::VideoSinkWants& wants) = 0;
+
+ protected:
+ virtual ~SinkWantsObserver() {}
+ };
+
static FrameGeneratorCapturer* Create(size_t width,
size_t height,
int target_fps,
@@ -47,6 +58,8 @@
void Stop() override;
void ChangeResolution(size_t width, size_t height);
+ void SetSinkWantsObserver(SinkWantsObserver* observer);
+
void AddOrUpdateSink(rtc::VideoSinkInterface<VideoFrame>* sink,
const rtc::VideoSinkWants& wants) override;
void RemoveSink(rtc::VideoSinkInterface<VideoFrame>* sink) override;
@@ -68,6 +81,7 @@
Clock* const clock_;
bool sending_;
rtc::VideoSinkInterface<VideoFrame>* sink_ GUARDED_BY(&lock_);
+ SinkWantsObserver* sink_wants_observer_ GUARDED_BY(&lock_);
std::unique_ptr<EventTimerWrapper> tick_;
rtc::CriticalSection lock_;