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

Unified Diff: webrtc/video_encoder.h

Issue 2398963003: Move usage of QualityScaler to ViEEncoder. (Closed)
Patch Set: Stats now properly reflect scaling status Created 4 years, 2 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
« webrtc/video/vie_encoder.cc ('K') | « webrtc/video/vie_encoder_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/video_encoder.h
diff --git a/webrtc/video_encoder.h b/webrtc/video_encoder.h
index 9bfec55eb7ddc48659b0063ebc13fa3c4f49c7bb..1ac6bd2892541f0f3cb27709260e9645f39f36dd 100644
--- a/webrtc/video_encoder.h
+++ b/webrtc/video_encoder.h
@@ -18,6 +18,8 @@
#include "webrtc/common_types.h"
#include "webrtc/typedefs.h"
#include "webrtc/video_frame.h"
+#include "webrtc/base/optional.h"
+#include "webrtc/modules/video_coding/utility/quality_scaler.h"
namespace webrtc {
@@ -81,7 +83,6 @@ class VideoEncoder {
kVp9,
kUnsupportedCodec,
};
-
static VideoEncoder* Create(EncoderType codec_type);
static VideoCodecVP8 GetDefaultVp8Settings();
@@ -159,6 +160,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 QualityScaler::Settings GetQPThresholds() const {
+ return QualityScaler::Settings(false);
+ }
+
virtual int32_t SetPeriodicKeyFrames(bool enable) { return -1; }
virtual void OnDroppedFrame() {}
virtual bool SupportsNativeHandle() const { return false; }
@@ -189,6 +196,7 @@ class VideoEncoderSoftwareFallbackWrapper : public VideoEncoder {
int32_t SetRates(uint32_t bitrate, uint32_t framerate) override;
void OnDroppedFrame() override;
bool SupportsNativeHandle() const override;
+ QualityScaler::Settings GetQPThresholds() const override;
private:
bool InitFallbackEncoder();
« webrtc/video/vie_encoder.cc ('K') | « webrtc/video/vie_encoder_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698