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

Unified Diff: webrtc/video/vie_encoder.h

Issue 2351633002: Let ViEEncoder handle resolution changes. (Closed)
Patch Set: Rebased Created 4 years, 3 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 c534b5566caae4b7b5b49cca6bab7e9b0202bad2..4f5a5dd4d8e1ffd15dc235ed6b3b9bb2e5f4409f 100644
--- a/webrtc/video/vie_encoder.h
+++ b/webrtc/video/vie_encoder.h
@@ -99,11 +99,27 @@ class ViEEncoder : public rtc::VideoSinkInterface<VideoFrame>,
private:
class EncodeTask;
- class VideoSourceProxy;
class ConfigureEncoderTask;
+ class VideoSourceProxy;
+
+ struct VideoFrameInfo {
+ VideoFrameInfo(int width,
+ int height,
+ VideoRotation rotation,
+ bool is_texture)
+ : width(width),
+ height(height),
+ rotation(rotation),
+ is_texture(is_texture) {}
+ int width;
+ int height;
+ webrtc::VideoRotation rotation;
+ bool is_texture;
+ };
void ConfigureEncoderOnTaskQueue(VideoEncoderConfig config,
size_t max_data_payload_length);
+ void ReconfigureEncoder();
// Implements VideoSinkInterface.
void OnFrame(const VideoFrame& video_frame) override;
@@ -138,7 +154,6 @@ class ViEEncoder : public rtc::VideoSinkInterface<VideoFrame>,
const VideoSendStream::Config::EncoderSettings settings_;
const VideoCodecType codec_type_;
- const std::unique_ptr<VideoProcessing> vp_;
vcm::VideoSender video_sender_ ACCESS_ON(&encoder_queue_);
OveruseFrameDetector overuse_detector_ ACCESS_ON(&encoder_queue_);
@@ -159,7 +174,12 @@ class ViEEncoder : public rtc::VideoSinkInterface<VideoFrame>,
std::unique_ptr<SimulcastRateAllocator> rate_allocator_
ACCESS_ON(&encoder_queue_);
- uint32_t encoder_start_bitrate_bps_ ACCESS_ON(&encoder_queue_);
+ // Set when ConfigureEncoder has been called in order to lazy reconfigure the
+ // encoder on the next frame.
+ bool pending_encoder_reconfiguration_ ACCESS_ON(&encoder_queue_);
+ rtc::Optional<VideoFrameInfo> last_frame_info_ ACCESS_ON(&encoder_queue_);
+
+ unsigned int encoder_start_bitrate_bps_ ACCESS_ON(&encoder_queue_);
size_t max_data_payload_length_ ACCESS_ON(&encoder_queue_);
uint32_t last_observed_bitrate_bps_ ACCESS_ON(&encoder_queue_);
bool encoder_paused_and_dropped_frame_ ACCESS_ON(&encoder_queue_);

Powered by Google App Engine
This is Rietveld 408576698