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

Unified Diff: webrtc/api/video_codecs/video_encoder_factory.h

Issue 3007073002: Add new video codec factories (Closed)
Patch Set: Add tests Created 3 years, 3 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
Index: webrtc/api/video_codecs/video_encoder_factory.h
diff --git a/webrtc/api/video_codecs/video_encoder_factory.h b/webrtc/api/video_codecs/video_encoder_factory.h
new file mode 100644
index 0000000000000000000000000000000000000000..a0b81fc95eafafd8350b8003f33f976af1461422
--- /dev/null
+++ b/webrtc/api/video_codecs/video_encoder_factory.h
@@ -0,0 +1,61 @@
+/*
+ * Copyright (c) 2017 The WebRTC project authors. All Rights Reserved.
+ *
+ * Use of this source code is governed by a BSD-style license
+ * that can be found in the LICENSE file in the root of the source
+ * tree. An additional intellectual property rights grant can be found
+ * in the file PATENTS. All contributing project authors may
+ * be found in the AUTHORS file in the root of the source tree.
+ */
+
+#ifndef WEBRTC_API_VIDEO_CODECS_VIDEO_ENCODER_FACTORY_H_
+#define WEBRTC_API_VIDEO_CODECS_VIDEO_ENCODER_FACTORY_H_
+
+#include <memory>
+#include <vector>
+
+namespace cricket {
+struct VideoCodec;
+} // namespace cricket
+
+namespace webrtc {
+
+class VideoEncoder;
+
+// A factory that creates VideoEncoders.
+// NOTE: This class is still under development and may change without notice.
+class VideoEncoderFactory {
+ public:
+ // TODO(magjed): Try to get rid of this struct.
+ struct CodecInfo {
+ // |is_hardware_accelerated| is true if the encoders created by this factory
+ // of the given codec will use hardware support.
+ bool is_hardware_accelerated;
+ // |has_internal_source| is true if encoders created by this factory of the
+ // given codec will use internal camera sources, meaning that they don't
+ // require/expect frames to be delivered via webrtc::VideoEncoder::Encode.
+ // This flag is used as the internal_source parameter to
+ // webrtc::ViEExternalCodec::RegisterExternalSendCodec.
+ bool has_internal_source;
+ };
+
+ // Returns a list of supported video codecs in order of preference, to use for
+ // signaling etc.
+ virtual std::vector<cricket::VideoCodec> GetSupportedCodecs() const = 0;
+
+ // Returns extra information about how the provided codec would be encoded,
stefan-webrtc 2017/09/06 12:40:42 What does "encoded" mean in this context? It sound
magjed_webrtc 2017/09/10 15:27:49 I updated the sentence to be more clear.
+ // provided it's supported.
+ // TODO(magjed): Try to get rid of this method.
+ virtual CodecInfo QueryVideoEncoder(
+ const cricket::VideoCodec& codec) const = 0;
+
+ // Creates a VideoEncoder for the specified codec.
+ virtual std::unique_ptr<VideoEncoder> CreateVideoEncoder(
+ const cricket::VideoCodec& codec) = 0;
+
+ virtual ~VideoEncoderFactory() {}
+};
+
+} // namespace webrtc
+
+#endif // WEBRTC_API_VIDEO_CODECS_VIDEO_ENCODER_FACTORY_H_

Powered by Google App Engine
This is Rietveld 408576698