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

Unified Diff: webrtc/media/engine/videoencodersoftwarefallbackwrapper.h

Issue 2988963002: Add support for a forced software encoder fallback. (Closed)
Patch Set: add max pixel limit Created 3 years, 4 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/media/engine/videoencodersoftwarefallbackwrapper.h
diff --git a/webrtc/media/engine/videoencodersoftwarefallbackwrapper.h b/webrtc/media/engine/videoencodersoftwarefallbackwrapper.h
index 61c1a11c8d32e798b043c033c3cbecde17b91df8..2003c2b9bff8e9ad53f5ab5dc5461af1f0eedbef 100644
--- a/webrtc/media/engine/videoencodersoftwarefallbackwrapper.h
+++ b/webrtc/media/engine/videoencodersoftwarefallbackwrapper.h
@@ -46,9 +46,27 @@ class VideoEncoderSoftwareFallbackWrapper : public VideoEncoder {
ScalingSettings GetScalingSettings() const override;
const char *ImplementationName() const override;
+ // If |forced_fallback_enabled_| is true and the encoded resolution
+ // is <= |max_pixels|:
+ // The forced fallback is enabled if the target bitrate is below |low_kbps|
+ // for more than |min_low_ms|. If the bitrate is above |high_kbps|, the forced
sprang_webrtc 2017/08/07 08:59:12 Does same time limit apply for high_kbps?
åsapersson 2017/08/08 10:40:54 No, updated comment.
+ // fallback is disabled.
+ struct ForcedFallbackParams {
+ rtc::Optional<int64_t> start_ms;
brandtr 2017/08/04 11:16:23 IIUC, start_ms is the timestamp when we go below |
åsapersson 2017/08/08 10:40:54 Added comment.
brandtr 2017/08/09 09:05:02 Thanks. It's easier to understand now.
+ uint32_t low_kbps = 100;
+ uint32_t high_kbps = 150;
+ int64_t min_low_ms = 10000;
+ const int max_pixels = 76800; // 320 * 240
brandtr 2017/08/04 11:16:23 Maybe remove comment and write max_pixels = 320 *
åsapersson 2017/08/08 10:40:54 Done.
+ };
+
private:
bool InitFallbackEncoder();
+ bool StartForcedFallback();
+ bool TryReleaseForcedFallbackEncoder();
+ bool TryReInitForcedFallbackEncoder();
+ void ValidateSettingsForForcedFallback();
+
// Settings used in the last InitEncode call and used if a dynamic fallback to
// software is required.
VideoCodec codec_settings_;
@@ -71,6 +89,9 @@ class VideoEncoderSoftwareFallbackWrapper : public VideoEncoder {
std::unique_ptr<webrtc::VideoEncoder> fallback_encoder_;
std::string fallback_implementation_name_;
EncodedImageCallback* callback_;
+
+ bool forced_fallback_enabled_;
brandtr 2017/08/04 11:16:23 How about |forced_fallback_possible_|? This member
åsapersson 2017/08/08 10:40:54 Done.
+ ForcedFallbackParams forced_fallback_;
};
} // namespace webrtc

Powered by Google App Engine
This is Rietveld 408576698