Index: webrtc/video_encoder.h |
diff --git a/webrtc/video_encoder.h b/webrtc/video_encoder.h |
index 39a27a8bfcdb32707a10f759f00e244fc4227bc0..79f8a3d92d67eea30490efab9201068cfa6baeaf 100644 |
--- a/webrtc/video_encoder.h |
+++ b/webrtc/video_encoder.h |
@@ -18,6 +18,7 @@ |
#include "webrtc/common_types.h" |
#include "webrtc/typedefs.h" |
#include "webrtc/video_frame.h" |
+#include "webrtc/base/optional.h" |
namespace webrtc { |
@@ -68,7 +69,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. |
@@ -150,6 +164,12 @@ class VideoEncoder { |
// Return value : WEBRTC_VIDEO_CODEC_OK if OK, < 0 otherwise. |
virtual int32_t SetRates(uint32_t bitrate, uint32_t framerate) = 0; |
+ // 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; } |