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

Unified Diff: webrtc/video_encoder.h

Issue 2398963003: Move usage of QualityScaler to ViEEncoder. (Closed)
Patch Set: rebase Created 4 years, 1 month 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
« no previous file with comments | « 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 f8a04f2e74a9056bf5dbdc4b676e820e83c1ac8a..0a21fa345af6fd86f969d0a646f3d60937f332ec 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 {
@@ -59,10 +60,38 @@ class EncodedImageCallback {
const EncodedImage& encoded_image,
const CodecSpecificInfo* codec_specific_info,
const RTPFragmentationHeader* fragmentation) = 0;
+
+ virtual void OnDroppedFrame() {}
};
class VideoEncoder {
public:
+ enum EncoderType {
+ kH264,
+ kVp8,
+ 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.
+ static bool IsSupportedSoftware(EncoderType codec_type);
+ static EncoderType CodecToEncoderType(VideoCodecType codec_type);
+
static VideoCodecVP8 GetDefaultVp8Settings();
static VideoCodecVP9 GetDefaultVp9Settings();
static VideoCodecH264 GetDefaultH264Settings();
@@ -148,8 +177,13 @@ 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; }
virtual const char* ImplementationName() const { return "unknown"; }
};
« no previous file with comments | « webrtc/video/vie_encoder_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698