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

Unified Diff: remoting/protocol/fake_connection_to_client.cc

Issue 1923573006: Implement a dummy host to do capturing and analysis only. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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/fake_connection_to_client.cc
diff --git a/remoting/protocol/fake_connection_to_client.cc b/remoting/protocol/fake_connection_to_client.cc
index 8d115f5a38255e8fa32987b77eb747464fe04861..6c622d884ef7095df39d2c15b50647de5ff2db2e 100644
--- a/remoting/protocol/fake_connection_to_client.cc
+++ b/remoting/protocol/fake_connection_to_client.cc
@@ -6,7 +6,9 @@
#include <utility>
+#include "remoting/codec/video_encoder.h"
#include "remoting/protocol/session.h"
+#include "remoting/protocol/video_frame_pump.h"
#include "third_party/webrtc/modules/desktop_capture/desktop_capturer.h"
namespace remoting {
@@ -42,6 +44,19 @@ void FakeConnectionToClient::SetEventHandler(EventHandler* event_handler) {
std::unique_ptr<VideoStream> FakeConnectionToClient::StartVideoStream(
std::unique_ptr<webrtc::DesktopCapturer> desktop_capturer) {
+ if (video_stub_ && video_encode_task_runner_) {
joedow 2016/04/28 22:53:54 Should it be an error if you have one but not the
Hzj_jie 2016/05/03 19:07:05 It's a good point, indeed I have not thought about
+ std::unique_ptr<VideoEncoder> video_encoder =
+ VideoEncoder::Create(session_->config());
+
+ std::unique_ptr<protocol::VideoFramePump> pump(
+ new protocol::VideoFramePump(video_encode_task_runner_,
+ std::move(desktop_capturer),
+ std::move(video_encoder),
+ video_stub_));
+ video_feedback_stub_ = pump->video_feedback_stub();
+ return std::move(pump);
+ }
+
std::unique_ptr<FakeVideoStream> result(new FakeVideoStream());
last_video_stream_ = result->GetWeakPtr();
return std::move(result);

Powered by Google App Engine
This is Rietveld 408576698