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

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: Fix build break on Windows 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/05/04 16:40:44 What would it mean for a caller to set one of thes
Hzj_jie 2016/05/04 19:18:03 Oh, we have discussed this in an early iteration,
joedow 2016/05/04 22:58:49 OK, I'd like to prevent a caller from partially in
+ 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