| 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 virtual void SetLosslessEncode(bool want_lossless) override; |
| 42 virtual void SetLosslessColor(bool want_lossless) OVERRIDE; | 42 virtual void SetLosslessColor(bool want_lossless) override; |
| 43 virtual scoped_ptr<VideoPacket> Encode( | 43 virtual scoped_ptr<VideoPacket> Encode( |
| 44 const webrtc::DesktopFrame& frame) OVERRIDE; | 44 const webrtc::DesktopFrame& frame) override; |
| 45 | 45 |
| 46 private: | 46 private: |
| 47 scoped_ptr<VideoEncoder> encoder_; | 47 scoped_ptr<VideoEncoder> encoder_; |
| 48 scoped_refptr<base::TaskRunner> recorder_task_runner_; | 48 scoped_refptr<base::TaskRunner> recorder_task_runner_; |
| 49 base::WeakPtr<VideoFrameRecorder> recorder_; | 49 base::WeakPtr<VideoFrameRecorder> recorder_; |
| 50 | 50 |
| 51 bool enable_recording_; | 51 bool enable_recording_; |
| 52 scoped_refptr<base::SingleThreadTaskRunner> encoder_task_runner_; | 52 scoped_refptr<base::SingleThreadTaskRunner> encoder_task_runner_; |
| 53 | 53 |
| 54 base::WeakPtrFactory<RecordingVideoEncoder> weak_factory_; | 54 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_) { | 240 if (content_bytes_ + frame_bytes > max_content_bytes_) { |
| 241 return; | 241 return; |
| 242 } | 242 } |
| 243 | 243 |
| 244 // Store the frame and update the content byte count. | 244 // Store the frame and update the content byte count. |
| 245 recorded_frames_.push_back(frame.release()); | 245 recorded_frames_.push_back(frame.release()); |
| 246 content_bytes_ += frame_bytes; | 246 content_bytes_ += frame_bytes; |
| 247 } | 247 } |
| 248 | 248 |
| 249 } // namespace remoting | 249 } // namespace remoting |
| OLD | NEW |