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

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: Resolve review commnets Created 4 years, 7 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
« no previous file with comments | « remoting/protocol/fake_connection_to_client.h ('k') | remoting/protocol/ice_connection_to_client.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_) {
+ 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);
« no previous file with comments | « remoting/protocol/fake_connection_to_client.h ('k') | remoting/protocol/ice_connection_to_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698