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.h" | 5 #include "remoting/host/video_frame_recorder.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/location.h" | 8 #include "base/location.h" |
9 #include "base/single_thread_task_runner.h" | 9 #include "base/single_thread_task_runner.h" |
10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
(...skipping 20 matching lines...) Expand all Loading... |
31 | 31 |
32 base::WeakPtr<RecordingVideoEncoder> AsWeakPtr(); | 32 base::WeakPtr<RecordingVideoEncoder> AsWeakPtr(); |
33 | 33 |
34 void set_enable_recording(bool enable_recording) { | 34 void set_enable_recording(bool enable_recording) { |
35 DCHECK(!encoder_task_runner_.get() || | 35 DCHECK(!encoder_task_runner_.get() || |
36 encoder_task_runner_->BelongsToCurrentThread()); | 36 encoder_task_runner_->BelongsToCurrentThread()); |
37 enable_recording_ = enable_recording; | 37 enable_recording_ = enable_recording; |
38 } | 38 } |
39 | 39 |
40 // remoting::VideoEncoder interface. | 40 // remoting::VideoEncoder interface. |
41 virtual void SetLosslessEncode(bool want_lossless) override; | 41 void SetLosslessEncode(bool want_lossless) override; |
42 virtual void SetLosslessColor(bool want_lossless) override; | 42 void SetLosslessColor(bool want_lossless) override; |
43 virtual scoped_ptr<VideoPacket> Encode( | 43 scoped_ptr<VideoPacket> Encode(const webrtc::DesktopFrame& frame) override; |
44 const webrtc::DesktopFrame& frame) override; | |
45 | 44 |
46 private: | 45 private: |
47 scoped_ptr<VideoEncoder> encoder_; | 46 scoped_ptr<VideoEncoder> encoder_; |
48 scoped_refptr<base::TaskRunner> recorder_task_runner_; | 47 scoped_refptr<base::TaskRunner> recorder_task_runner_; |
49 base::WeakPtr<VideoFrameRecorder> recorder_; | 48 base::WeakPtr<VideoFrameRecorder> recorder_; |
50 | 49 |
51 bool enable_recording_; | 50 bool enable_recording_; |
52 scoped_refptr<base::SingleThreadTaskRunner> encoder_task_runner_; | 51 scoped_refptr<base::SingleThreadTaskRunner> encoder_task_runner_; |
53 | 52 |
54 base::WeakPtrFactory<RecordingVideoEncoder> weak_factory_; | 53 base::WeakPtrFactory<RecordingVideoEncoder> weak_factory_; |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
240 if (content_bytes_ + frame_bytes > max_content_bytes_) { | 239 if (content_bytes_ + frame_bytes > max_content_bytes_) { |
241 return; | 240 return; |
242 } | 241 } |
243 | 242 |
244 // Store the frame and update the content byte count. | 243 // Store the frame and update the content byte count. |
245 recorded_frames_.push_back(frame.release()); | 244 recorded_frames_.push_back(frame.release()); |
246 content_bytes_ += frame_bytes; | 245 content_bytes_ += frame_bytes; |
247 } | 246 } |
248 | 247 |
249 } // namespace remoting | 248 } // namespace remoting |
OLD | NEW |