Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(216)

Unified Diff: webrtc/video/vie_encoder.h

Issue 2918143003: Set overuse detector max frame interval based on target frame rate. (Closed)
Patch Set: Addressed comments, fixed last adaptation fps, fixed unit tests Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: webrtc/video/vie_encoder.h
diff --git a/webrtc/video/vie_encoder.h b/webrtc/video/vie_encoder.h
index f2d7cfdae2084609589bb26b196a273483a457e0..17de4818bb0c3d0597c70074a86b711e352fe5e6 100644
--- a/webrtc/video/vie_encoder.h
+++ b/webrtc/video/vie_encoder.h
@@ -77,7 +77,8 @@ class ViEEncoder : public rtc::VideoSinkInterface<VideoFrame>,
SendStatisticsProxy* stats_proxy,
const VideoSendStream::Config::EncoderSettings& settings,
rtc::VideoSinkInterface<VideoFrame>* pre_encode_callback,
- EncodedFrameObserver* encoder_timing);
+ EncodedFrameObserver* encoder_timing,
+ std::unique_ptr<OveruseFrameDetector> overuse_detector);
~ViEEncoder();
// RegisterProcessThread register |module_process_thread| with those objects
// that use it. Registration has to happen on the thread where
@@ -129,6 +130,7 @@ class ViEEncoder : public rtc::VideoSinkInterface<VideoFrame>,
// These methods are protected for easier testing.
void AdaptUp(AdaptReason reason) override;
void AdaptDown(AdaptReason reason) override;
+ static CpuOveruseOptions GetCpuOveruseOptions(bool full_overuse_time);
private:
class ConfigureEncoderTask;
@@ -229,7 +231,8 @@ class ViEEncoder : public rtc::VideoSinkInterface<VideoFrame>,
const VideoCodecType codec_type_;
vcm::VideoSender video_sender_ ACCESS_ON(&encoder_queue_);
- OveruseFrameDetector overuse_detector_ ACCESS_ON(&encoder_queue_);
+ std::unique_ptr<OveruseFrameDetector> overuse_detector_
+ ACCESS_ON(&encoder_queue_);
std::unique_ptr<QualityScaler> quality_scaler_ ACCESS_ON(&encoder_queue_);
SendStatisticsProxy* const stats_proxy_;
@@ -243,6 +246,9 @@ class ViEEncoder : public rtc::VideoSinkInterface<VideoFrame>,
VideoEncoderConfig encoder_config_ ACCESS_ON(&encoder_queue_);
std::unique_ptr<VideoBitrateAllocator> rate_allocator_
ACCESS_ON(&encoder_queue_);
+ // The maximum frame rate of the current codec configuration, as determined
+ // at the last ReconfigureEncoder() call.
+ int max_framerate_ ACCESS_ON(&encoder_queue_);
// Set when ConfigureEncoder has been called in order to lazy reconfigure the
// encoder on the next frame.
@@ -270,6 +276,8 @@ class ViEEncoder : public rtc::VideoSinkInterface<VideoFrame>,
int input_pixel_count_;
// Framerate received from the source at the time of the adaptation.
int framerate_fps_;
+ // The selected framerate, as result of downscaling request (if any).
+ rtc::Optional<int> selected_framerate_fps_;
// Indicates if request was to adapt up or down.
enum class Mode { kAdaptUp, kAdaptDown } mode_;
};

Powered by Google App Engine
This is Rietveld 408576698