| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "remoting/host/video_frame_recorder_host_extension.h" | 5 #include "remoting/host/video_frame_recorder_host_extension.h" |
| 6 | 6 |
| 7 #include "base/base64.h" | 7 #include "base/base64.h" |
| 8 #include "base/json/json_reader.h" | 8 #include "base/json/json_reader.h" |
| 9 #include "base/json/json_writer.h" | 9 #include "base/json/json_writer.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 // Name of the extension message type field, and its value for this extension. | 24 // Name of the extension message type field, and its value for this extension. |
| 25 const char kType[] = "type"; | 25 const char kType[] = "type"; |
| 26 const char kVideoRecorderType[] = "video-recorder"; | 26 const char kVideoRecorderType[] = "video-recorder"; |
| 27 | 27 |
| 28 class VideoFrameRecorderHostExtensionSession : public HostExtensionSession { | 28 class VideoFrameRecorderHostExtensionSession : public HostExtensionSession { |
| 29 public: | 29 public: |
| 30 explicit VideoFrameRecorderHostExtensionSession(int64_t max_content_bytes); | 30 explicit VideoFrameRecorderHostExtensionSession(int64_t max_content_bytes); |
| 31 virtual ~VideoFrameRecorderHostExtensionSession(); | 31 virtual ~VideoFrameRecorderHostExtensionSession(); |
| 32 | 32 |
| 33 // remoting::HostExtensionSession interface. | 33 // remoting::HostExtensionSession interface. |
| 34 virtual void OnCreateVideoEncoder(scoped_ptr<VideoEncoder>* encoder) OVERRIDE; | 34 virtual void OnCreateVideoEncoder(scoped_ptr<VideoEncoder>* encoder) override; |
| 35 virtual bool ModifiesVideoPipeline() const OVERRIDE; | 35 virtual bool ModifiesVideoPipeline() const override; |
| 36 virtual bool OnExtensionMessage( | 36 virtual bool OnExtensionMessage( |
| 37 ClientSessionControl* client_session_control, | 37 ClientSessionControl* client_session_control, |
| 38 protocol::ClientStub* client_stub, | 38 protocol::ClientStub* client_stub, |
| 39 const protocol::ExtensionMessage& message) OVERRIDE; | 39 const protocol::ExtensionMessage& message) override; |
| 40 | 40 |
| 41 private: | 41 private: |
| 42 // Handlers for the different frame recorder extension message types. | 42 // Handlers for the different frame recorder extension message types. |
| 43 void OnStart(); | 43 void OnStart(); |
| 44 void OnStop(); | 44 void OnStop(); |
| 45 void OnNextFrame(protocol::ClientStub* client_stub); | 45 void OnNextFrame(protocol::ClientStub* client_stub); |
| 46 | 46 |
| 47 VideoEncoderVerbatim verbatim_encoder_; | 47 VideoEncoderVerbatim verbatim_encoder_; |
| 48 VideoFrameRecorder video_frame_recorder_; | 48 VideoFrameRecorder video_frame_recorder_; |
| 49 bool first_frame_; | 49 bool first_frame_; |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 189 | 189 |
| 190 scoped_ptr<HostExtensionSession> | 190 scoped_ptr<HostExtensionSession> |
| 191 VideoFrameRecorderHostExtension::CreateExtensionSession( | 191 VideoFrameRecorderHostExtension::CreateExtensionSession( |
| 192 ClientSessionControl* client_session_control, | 192 ClientSessionControl* client_session_control, |
| 193 protocol::ClientStub* client_stub) { | 193 protocol::ClientStub* client_stub) { |
| 194 return make_scoped_ptr( | 194 return make_scoped_ptr( |
| 195 new VideoFrameRecorderHostExtensionSession(max_content_bytes_)); | 195 new VideoFrameRecorderHostExtensionSession(max_content_bytes_)); |
| 196 } | 196 } |
| 197 | 197 |
| 198 } // namespace remoting | 198 } // namespace remoting |
| OLD | NEW |