Index: remoting/host/chromoting_host.cc |
diff --git a/remoting/host/chromoting_host.cc b/remoting/host/chromoting_host.cc |
index 6558dbb1c5de20ef3525bce125fb4bf8a2183f6e..299777d6d66e9461935c59ad8b57a758e2855e63 100644 |
--- a/remoting/host/chromoting_host.cc |
+++ b/remoting/host/chromoting_host.cc |
@@ -18,6 +18,7 @@ |
#include "remoting/host/desktop_environment.h" |
#include "remoting/host/host_config.h" |
#include "remoting/host/input_injector.h" |
+#include "remoting/host/video_frame_recorder.h" |
#include "remoting/protocol/connection_to_client.h" |
#include "remoting/protocol/client_stub.h" |
#include "remoting/protocol/host_stub.h" |
@@ -84,6 +85,7 @@ ChromotingHost::ChromotingHost( |
authenticating_client_(false), |
reject_authenticating_client_(false), |
enable_curtaining_(false), |
+ enable_video_frame_recording_(false), |
weak_factory_(this) { |
DCHECK(network_task_runner_->BelongsToCurrentThread()); |
DCHECK(signal_strategy); |
@@ -172,6 +174,21 @@ void ChromotingHost::SetMaximumSessionDuration( |
max_session_duration_ = max_session_duration; |
} |
+void ChromotingHost::SetEnableVideoFrameRecording(bool enable) { |
+ DCHECK(network_task_runner_->BelongsToCurrentThread()); |
+ |
+ if (enable_video_frame_recording_ == enable) |
+ return; |
+ |
+ enable_video_frame_recording_ = enable; |
+ |
+ // Disconnect existing clients if recording is being disabled, in case |
+ // one of them is using it. |
+ if (!enable) { |
Sergey Ulanov
2014/07/11 18:38:03
nit: remove {}
|
+ DisconnectAllClients(); |
+ } |
+} |
+ |
//////////////////////////////////////////////////////////////////////////// |
// protocol::ClientSession::EventHandler implementation. |
void ChromotingHost::OnSessionAuthenticating(ClientSession* client) { |
@@ -331,6 +348,12 @@ void ChromotingHost::OnIncomingSession( |
max_session_duration_, |
pairing_registry_); |
+ // Set a video frame recorder if recording is enabled. |
+ if (enable_video_frame_recording_) { |
+ client->set_video_frame_recorder( |
+ scoped_ptr<VideoFrameRecorder>(new VideoFrameRecorder())); |
+ } |
+ |
// Registers capabilities provided by host extensions. |
for (HostExtensionList::iterator extension = extensions_.begin(); |
extension != extensions_.end(); ++extension) { |