Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(620)

Side by Side Diff: remoting/host/screen_recorder.cc

Issue 10870071: Renamed Encoder -> VideoEncoder. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed comments Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « remoting/host/screen_recorder.h ('k') | remoting/host/screen_recorder_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/screen_recorder.h" 5 #include "remoting/host/screen_recorder.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 19 matching lines...) Expand all
30 30
31 // Maximum number of frames that can be processed similtaneously. 31 // Maximum number of frames that can be processed similtaneously.
32 // TODO(hclam): Move this value to CaptureScheduler. 32 // TODO(hclam): Move this value to CaptureScheduler.
33 static const int kMaxRecordings = 2; 33 static const int kMaxRecordings = 2;
34 34
35 ScreenRecorder::ScreenRecorder( 35 ScreenRecorder::ScreenRecorder(
36 scoped_refptr<base::SingleThreadTaskRunner> capture_task_runner, 36 scoped_refptr<base::SingleThreadTaskRunner> capture_task_runner,
37 scoped_refptr<base::SingleThreadTaskRunner> encode_task_runner, 37 scoped_refptr<base::SingleThreadTaskRunner> encode_task_runner,
38 scoped_refptr<base::SingleThreadTaskRunner> network_task_runner, 38 scoped_refptr<base::SingleThreadTaskRunner> network_task_runner,
39 VideoFrameCapturer* capturer, 39 VideoFrameCapturer* capturer,
40 Encoder* encoder) 40 VideoEncoder* encoder)
41 : capture_task_runner_(capture_task_runner), 41 : capture_task_runner_(capture_task_runner),
42 encode_task_runner_(encode_task_runner), 42 encode_task_runner_(encode_task_runner),
43 network_task_runner_(network_task_runner), 43 network_task_runner_(network_task_runner),
44 capturer_(capturer), 44 capturer_(capturer),
45 encoder_(encoder), 45 encoder_(encoder),
46 network_stopped_(false), 46 network_stopped_(false),
47 encoder_stopped_(false), 47 encoder_stopped_(false),
48 max_recordings_(kMaxRecordings), 48 max_recordings_(kMaxRecordings),
49 recordings_(0), 49 recordings_(0),
50 frame_skipped_(false), 50 frame_skipped_(false),
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 116
117 ScreenRecorder::~ScreenRecorder() { 117 ScreenRecorder::~ScreenRecorder() {
118 } 118 }
119 119
120 VideoFrameCapturer* ScreenRecorder::capturer() { 120 VideoFrameCapturer* ScreenRecorder::capturer() {
121 DCHECK(capture_task_runner_->BelongsToCurrentThread()); 121 DCHECK(capture_task_runner_->BelongsToCurrentThread());
122 DCHECK(capturer_); 122 DCHECK(capturer_);
123 return capturer_; 123 return capturer_;
124 } 124 }
125 125
126 Encoder* ScreenRecorder::encoder() { 126 VideoEncoder* ScreenRecorder::encoder() {
127 DCHECK(encode_task_runner_->BelongsToCurrentThread()); 127 DCHECK(encode_task_runner_->BelongsToCurrentThread());
128 DCHECK(encoder_.get()); 128 DCHECK(encoder_.get());
129 return encoder_.get(); 129 return encoder_.get();
130 } 130 }
131 131
132 bool ScreenRecorder::is_recording() { 132 bool ScreenRecorder::is_recording() {
133 DCHECK(capture_task_runner_->BelongsToCurrentThread()); 133 DCHECK(capture_task_runner_->BelongsToCurrentThread());
134 return capture_timer_.get() != NULL; 134 return capture_timer_.get() != NULL;
135 } 135 }
136 136
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after
364 packet->set_encode_time_ms(encode_time_ms); 364 packet->set_encode_time_ms(encode_time_ms);
365 scheduler_.RecordEncodeTime(encode_time); 365 scheduler_.RecordEncodeTime(encode_time);
366 } 366 }
367 367
368 network_task_runner_->PostTask( 368 network_task_runner_->PostTask(
369 FROM_HERE, base::Bind(&ScreenRecorder::DoSendVideoPacket, this, 369 FROM_HERE, base::Bind(&ScreenRecorder::DoSendVideoPacket, this,
370 base::Passed(packet.Pass()))); 370 base::Passed(packet.Pass())));
371 } 371 }
372 372
373 } // namespace remoting 373 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/host/screen_recorder.h ('k') | remoting/host/screen_recorder_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698