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

Unified Diff: webrtc/video_encoder.h

Issue 2474993002: Pass selected cricket::VideoCodec down to internal H264 encoder (Closed)
Patch Set: Fix. 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
Index: webrtc/video_encoder.h
diff --git a/webrtc/video_encoder.h b/webrtc/video_encoder.h
index d8b7921bc07fad057cfc438021c41c6219b134a6..0a36251ed2cf8c508219c24b60895d06580127c7 100644
--- a/webrtc/video_encoder.h
+++ b/webrtc/video_encoder.h
@@ -16,6 +16,7 @@
#include <vector>
#include "webrtc/common_types.h"
+#include "webrtc/media/base/codec.h"
#include "webrtc/typedefs.h"
#include "webrtc/video_frame.h"
@@ -75,18 +76,10 @@ class EncodedImageCallback {
class VideoEncoder {
public:
- enum EncoderType {
- kH264,
- kVp8,
- kVp9,
- kUnsupportedCodec,
- };
-
- static VideoEncoder* Create(EncoderType codec_type);
+ static VideoEncoder* Create(const cricket::VideoCodec& codec);
// 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 bool IsSupportedSoftware(const cricket::VideoCodec& codec);
static VideoCodecVP8 GetDefaultVp8Settings();
static VideoCodecVP9 GetDefaultVp9Settings();
@@ -174,7 +167,7 @@ class VideoEncoder {
// hardware restrictions, such as max resolution.
class VideoEncoderSoftwareFallbackWrapper : public VideoEncoder {
public:
- VideoEncoderSoftwareFallbackWrapper(VideoCodecType codec_type,
+ VideoEncoderSoftwareFallbackWrapper(const cricket::VideoCodec& codec,
webrtc::VideoEncoder* encoder);
int32_t InitEncode(const VideoCodec* codec_settings,
@@ -213,7 +206,7 @@ class VideoEncoderSoftwareFallbackWrapper : public VideoEncoder {
uint32_t packet_loss_;
int64_t rtt_;
- const EncoderType encoder_type_;
+ const cricket::VideoCodec codec_;
webrtc::VideoEncoder* const encoder_;
std::unique_ptr<webrtc::VideoEncoder> fallback_encoder_;

Powered by Google App Engine
This is Rietveld 408576698