Index: webrtc/video_encoder.h |
diff --git a/webrtc/video_encoder.h b/webrtc/video_encoder.h |
index 3a997176a980b6aafc9fda79dfe8de89c84cb7f3..c749a82261aef60c6f42dbc40f667b46b526186d 100644 |
--- a/webrtc/video_encoder.h |
+++ b/webrtc/video_encoder.h |
@@ -19,6 +19,7 @@ |
#include "webrtc/common_types.h" |
#include "webrtc/typedefs.h" |
#include "webrtc/video_frame.h" |
+#include "webrtc/base/optional.h" |
namespace webrtc { |
@@ -69,7 +70,20 @@ class VideoEncoder { |
kVp9, |
kUnsupportedCodec, |
}; |
- |
+ struct QpThresholds { |
+ QpThresholds(int l, int h) : low(l), high(h) {} |
+ QpThresholds() : low(-1), high(-1) {} |
+ int low; |
+ int high; |
+ }; |
+ struct ScalingSettings { |
+ ScalingSettings(bool on, int low, int high) |
+ : enabled(on), |
+ thresholds(rtc::Optional<QpThresholds>(QpThresholds(low, high))) {} |
+ explicit ScalingSettings(bool on) : enabled(on) {} |
+ const bool enabled; |
+ const rtc::Optional<QpThresholds> thresholds; |
+ }; |
static VideoEncoder* Create(EncoderType codec_type); |
// Returns true if this type of encoder can be created using |
// VideoEncoder::Create. |
@@ -161,6 +175,12 @@ class VideoEncoder { |
return SetRates(allocation.get_sum_kbps(), framerate); |
} |
+ // Any encoder implementation wishing to use the WebRTC provided |
+ // quality scaler must implement this method. |
+ virtual ScalingSettings GetScalingSettings() const { |
+ return ScalingSettings(false); |
+ } |
+ |
virtual int32_t SetPeriodicKeyFrames(bool enable) { return -1; } |
virtual void OnDroppedFrame() {} |
virtual bool SupportsNativeHandle() const { return false; } |