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 10 matching lines...) Expand all Loading... |
21 | 21 |
22 namespace { | 22 namespace { |
23 | 23 |
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 ~VideoFrameRecorderHostExtensionSession() override; |
32 | 32 |
33 // remoting::HostExtensionSession interface. | 33 // remoting::HostExtensionSession interface. |
34 virtual void OnCreateVideoEncoder(scoped_ptr<VideoEncoder>* encoder) override; | 34 void OnCreateVideoEncoder(scoped_ptr<VideoEncoder>* encoder) override; |
35 virtual bool ModifiesVideoPipeline() const override; | 35 bool ModifiesVideoPipeline() const override; |
36 virtual bool OnExtensionMessage( | 36 bool OnExtensionMessage(ClientSessionControl* client_session_control, |
37 ClientSessionControl* client_session_control, | 37 protocol::ClientStub* client_stub, |
38 protocol::ClientStub* client_stub, | 38 const protocol::ExtensionMessage& message) override; |
39 const protocol::ExtensionMessage& message) override; | |
40 | 39 |
41 private: | 40 private: |
42 // Handlers for the different frame recorder extension message types. | 41 // Handlers for the different frame recorder extension message types. |
43 void OnStart(); | 42 void OnStart(); |
44 void OnStop(); | 43 void OnStop(); |
45 void OnNextFrame(protocol::ClientStub* client_stub); | 44 void OnNextFrame(protocol::ClientStub* client_stub); |
46 | 45 |
47 VideoEncoderVerbatim verbatim_encoder_; | 46 VideoEncoderVerbatim verbatim_encoder_; |
48 VideoFrameRecorder video_frame_recorder_; | 47 VideoFrameRecorder video_frame_recorder_; |
49 bool first_frame_; | 48 bool first_frame_; |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 | 188 |
190 scoped_ptr<HostExtensionSession> | 189 scoped_ptr<HostExtensionSession> |
191 VideoFrameRecorderHostExtension::CreateExtensionSession( | 190 VideoFrameRecorderHostExtension::CreateExtensionSession( |
192 ClientSessionControl* client_session_control, | 191 ClientSessionControl* client_session_control, |
193 protocol::ClientStub* client_stub) { | 192 protocol::ClientStub* client_stub) { |
194 return make_scoped_ptr( | 193 return make_scoped_ptr( |
195 new VideoFrameRecorderHostExtensionSession(max_content_bytes_)); | 194 new VideoFrameRecorderHostExtensionSession(max_content_bytes_)); |
196 } | 195 } |
197 | 196 |
198 } // namespace remoting | 197 } // namespace remoting |
OLD | NEW |