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" |
11 #include "base/values.h" | 11 #include "base/values.h" |
12 #include "remoting/codec/video_encoder_verbatim.h" | 12 #include "remoting/codec/video_encoder_verbatim.h" |
| 13 #include "remoting/host/client_session_control.h" |
13 #include "remoting/host/host_extension_session.h" | 14 #include "remoting/host/host_extension_session.h" |
14 #include "remoting/host/video_frame_recorder.h" | 15 #include "remoting/host/video_frame_recorder.h" |
15 #include "remoting/proto/control.pb.h" | 16 #include "remoting/proto/control.pb.h" |
16 #include "remoting/proto/video.pb.h" | 17 #include "remoting/proto/video.pb.h" |
17 #include "remoting/protocol/client_stub.h" | 18 #include "remoting/protocol/client_stub.h" |
18 #include "third_party/webrtc/modules/desktop_capture/desktop_frame.h" | 19 #include "third_party/webrtc/modules/desktop_capture/desktop_frame.h" |
19 | 20 |
20 namespace remoting { | 21 namespace remoting { |
21 | 22 |
22 namespace { | 23 namespace { |
(...skipping 26 matching lines...) Expand all Loading... |
49 | 50 |
50 private: | 51 private: |
51 VideoEncoderVerbatim verbatim_encoder; | 52 VideoEncoderVerbatim verbatim_encoder; |
52 VideoFrameRecorder video_frame_recorder; | 53 VideoFrameRecorder video_frame_recorder; |
53 bool first_frame_; | 54 bool first_frame_; |
54 | 55 |
55 DISALLOW_COPY_AND_ASSIGN(VideoFrameRecorderHostExtensionSession); | 56 DISALLOW_COPY_AND_ASSIGN(VideoFrameRecorderHostExtensionSession); |
56 }; | 57 }; |
57 | 58 |
58 VideoFrameRecorderHostExtensionSession::VideoFrameRecorderHostExtensionSession( | 59 VideoFrameRecorderHostExtensionSession::VideoFrameRecorderHostExtensionSession( |
| 60 ClientSessionControl* client_session_control, |
59 int64_t max_content_bytes) : first_frame_(false) { | 61 int64_t max_content_bytes) : first_frame_(false) { |
60 video_frame_recorder.SetMaxContentBytes(max_content_bytes); | 62 video_frame_recorder.SetMaxContentBytes(max_content_bytes); |
| 63 client_session_control->ResetVideoPipeline(); |
61 } | 64 } |
62 | 65 |
63 scoped_ptr<VideoEncoder> | 66 scoped_ptr<VideoEncoder> |
64 VideoFrameRecorderHostExtensionSession::OnCreateVideoEncoder( | 67 VideoFrameRecorderHostExtensionSession::OnCreateVideoEncoder( |
65 scoped_ptr<VideoEncoder> encoder) { | 68 scoped_ptr<VideoEncoder> encoder) { |
66 video_frame_recorder.DetachVideoEncoderWrapper(); | 69 video_frame_recorder.DetachVideoEncoderWrapper(); |
67 return video_frame_recorder.WrapVideoEncoder(encoder.Pass()); | 70 return video_frame_recorder.WrapVideoEncoder(encoder.Pass()); |
68 } | 71 } |
69 | 72 |
70 bool VideoFrameRecorderHostExtensionSession::ModifiesVideoPipeline() const { | 73 bool VideoFrameRecorderHostExtensionSession::ModifiesVideoPipeline() const { |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 | 166 |
164 scoped_ptr<HostExtensionSession> | 167 scoped_ptr<HostExtensionSession> |
165 VideoFrameRecorderHostExtension::CreateExtensionSession( | 168 VideoFrameRecorderHostExtension::CreateExtensionSession( |
166 ClientSessionControl* client_session_control, | 169 ClientSessionControl* client_session_control, |
167 protocol::ClientStub* client_stub) { | 170 protocol::ClientStub* client_stub) { |
168 return scoped_ptr<HostExtensionSession>( | 171 return scoped_ptr<HostExtensionSession>( |
169 new VideoFrameRecorderHostExtensionSession(max_content_bytes_)); | 172 new VideoFrameRecorderHostExtensionSession(max_content_bytes_)); |
170 } | 173 } |
171 | 174 |
172 } // namespace remoting | 175 } // namespace remoting |
OLD | NEW |