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

Unified Diff: remoting/protocol/webrtc_dummy_video_encoder.h

Issue 2329653002: Add WebrtcVideoEncoder interface (Closed)
Patch Set: Created 4 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: remoting/protocol/webrtc_dummy_video_encoder.h
diff --git a/remoting/protocol/webrtc_video_encoder_factory.h b/remoting/protocol/webrtc_dummy_video_encoder.h
similarity index 80%
rename from remoting/protocol/webrtc_video_encoder_factory.h
rename to remoting/protocol/webrtc_dummy_video_encoder.h
index a4b33f5e4edcf272788b93c8dd92d0d8291e0d0c..d211decb1a1c999146e95f58ab80777d44702d19 100644
--- a/remoting/protocol/webrtc_video_encoder_factory.h
+++ b/remoting/protocol/webrtc_dummy_video_encoder.h
@@ -2,19 +2,20 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef REMOTING_PROTOCOL_WEBRTC_VIDEO_ENCODER_FACTORY_H_
-#define REMOTING_PROTOCOL_WEBRTC_VIDEO_ENCODER_FACTORY_H_
+#ifndef REMOTING_PROTOCOL_DUMMY_WEBRTC_VIDEO_ENCODER_H_
+#define REMOTING_PROTOCOL_DUMMY_WEBRTC_VIDEO_ENCODER_H_
#include <memory>
#include <vector>
#include "base/callback.h"
#include "base/synchronization/lock.h"
-#include "remoting/proto/video.pb.h"
+#include "remoting/codec/webrtc_video_encoder.h"
#include "third_party/webrtc/media/engine/webrtcvideoencoderfactory.h"
#include "third_party/webrtc/modules/video_coding/include/video_codec_interface.h"
namespace remoting {
+namespace protocol {
using TargetBitrateCallback = base::Callback<void(int)>;
@@ -22,11 +23,11 @@ using TargetBitrateCallback = base::Callback<void(int)>;
// provided by remoting. Webrtc provides feedback on network bandwidth, latency
// & RTT and in turn remoting passes encoded frames as they get encoded
// through the capture pipeline.
Irfan 2016/09/12 21:34:24 Perhaps add comment on why these classes are "dumm
Sergey Ulanov 2016/09/12 22:50:02 Done.
-class WebrtcVideoEncoder : public webrtc::VideoEncoder {
+class WebrtcDummyVideoEncoder : public webrtc::VideoEncoder {
public:
enum State { kUninitialized = 0, kInitialized };
- explicit WebrtcVideoEncoder(webrtc::VideoCodecType codec);
- ~WebrtcVideoEncoder() override;
+ explicit WebrtcDummyVideoEncoder(webrtc::VideoCodecType codec);
+ ~WebrtcDummyVideoEncoder() override;
// webrtc::VideoEncoder overrides
int32_t InitEncode(const webrtc::VideoCodec* codec_settings,
@@ -42,7 +43,7 @@ class WebrtcVideoEncoder : public webrtc::VideoEncoder {
int32_t SetRates(uint32_t bitrate, uint32_t framerate) override;
webrtc::EncodedImageCallback::Result SendEncodedFrame(
- std::unique_ptr<VideoPacket> packet,
+ std::unique_ptr<WebrtcVideoEncoder::EncodedFrame> frame,
base::TimeTicks capture_time);
void SetKeyFrameRequestCallback(const base::Closure& key_frame_request);
void SetTargetBitrateCallback(const TargetBitrateCallback& target_bitrate_cb);
@@ -62,10 +63,11 @@ class WebrtcVideoEncoder : public webrtc::VideoEncoder {
// This is the external encoder factory implementation that is passed to
// WebRTC at the time of creation of peer connection. The external encoder
// factory primarily manages creation and destruction of encoder.
-class WebrtcVideoEncoderFactory : public cricket::WebRtcVideoEncoderFactory {
+class WebrtcDummyVideoEncoderFactory
+ : public cricket::WebRtcVideoEncoderFactory {
public:
- WebrtcVideoEncoderFactory();
- ~WebrtcVideoEncoderFactory() override;
+ WebrtcDummyVideoEncoderFactory();
+ ~WebrtcDummyVideoEncoderFactory() override;
webrtc::VideoEncoder* CreateVideoEncoder(
webrtc::VideoCodecType type) override;
@@ -77,7 +79,7 @@ class WebrtcVideoEncoderFactory : public cricket::WebRtcVideoEncoderFactory {
void DestroyVideoEncoder(webrtc::VideoEncoder* encoder) override;
webrtc::EncodedImageCallback::Result SendEncodedFrame(
- std::unique_ptr<VideoPacket> packet,
+ std::unique_ptr<WebrtcVideoEncoder::EncodedFrame> packet,
base::TimeTicks capture_time);
void SetKeyFrameRequestCallback(const base::Closure& key_frame_request);
@@ -89,9 +91,10 @@ class WebrtcVideoEncoderFactory : public cricket::WebRtcVideoEncoderFactory {
base::Closure key_frame_request_;
TargetBitrateCallback target_bitrate_cb_;
std::vector<cricket::WebRtcVideoEncoderFactory::VideoCodec> codecs_;
- std::vector<std::unique_ptr<WebrtcVideoEncoder>> encoders_;
+ std::vector<std::unique_ptr<WebrtcDummyVideoEncoder>> encoders_;
};
+} // namespace protocol
} // namespace remoting
-#endif // REMOTING_PROTOCOL_WEBRTC_VIDEO_ENCODER_FACTORY_H_
+#endif // REMOTING_PROTOCOL_DUMMY_WEBRTC_VIDEO_ENCODER_H_

Powered by Google App Engine
This is Rietveld 408576698