OLD | NEW |
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 // Notes about usage of this object by VideoCaptureImplManager. | 5 // Notes about usage of this object by VideoCaptureImplManager. |
6 // | 6 // |
7 // VideoCaptureImplManager access this object by using a Unretained() | 7 // VideoCaptureImplManager access this object by using a Unretained() |
8 // binding and tasks on the IO thread. It is then important that | 8 // binding and tasks on the IO thread. It is then important that |
9 // VideoCaptureImpl never post task to itself. All operations must be | 9 // VideoCaptureImpl never post task to itself. All operations must be |
10 // synchronous. | 10 // synchronous. |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 | 66 |
67 void VideoCaptureImpl::DeInit() { | 67 void VideoCaptureImpl::DeInit() { |
68 DCHECK(thread_checker_.CalledOnValidThread()); | 68 DCHECK(thread_checker_.CalledOnValidThread()); |
69 if (state_ == VIDEO_CAPTURE_STATE_STARTED) | 69 if (state_ == VIDEO_CAPTURE_STATE_STARTED) |
70 Send(new VideoCaptureHostMsg_Stop(device_id_)); | 70 Send(new VideoCaptureHostMsg_Stop(device_id_)); |
71 message_filter_->RemoveDelegate(this); | 71 message_filter_->RemoveDelegate(this); |
72 } | 72 } |
73 | 73 |
74 void VideoCaptureImpl::SuspendCapture(bool suspend) { | 74 void VideoCaptureImpl::SuspendCapture(bool suspend) { |
75 DCHECK(thread_checker_.CalledOnValidThread()); | 75 DCHECK(thread_checker_.CalledOnValidThread()); |
76 suspended_ = suspend; | 76 Send(suspend ? |
| 77 static_cast<IPC::Message*>(new VideoCaptureHostMsg_Pause(device_id_)) : |
| 78 static_cast<IPC::Message*>( |
| 79 new VideoCaptureHostMsg_Resume(device_id_, session_id_, params_))); |
77 } | 80 } |
78 | 81 |
79 void VideoCaptureImpl::StartCapture( | 82 void VideoCaptureImpl::StartCapture( |
80 int client_id, | 83 int client_id, |
81 const media::VideoCaptureParams& params, | 84 const media::VideoCaptureParams& params, |
82 const VideoCaptureStateUpdateCB& state_update_cb, | 85 const VideoCaptureStateUpdateCB& state_update_cb, |
83 const VideoCaptureDeliverFrameCB& deliver_frame_cb) { | 86 const VideoCaptureDeliverFrameCB& deliver_frame_cb) { |
84 DCHECK(thread_checker_.CalledOnValidThread()); | 87 DCHECK(thread_checker_.CalledOnValidThread()); |
85 ClientInfo client_info; | 88 ClientInfo client_info; |
86 client_info.params = params; | 89 client_info.params = params; |
(...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
434 ClientInfoMap::iterator it = clients->find(client_id); | 437 ClientInfoMap::iterator it = clients->find(client_id); |
435 if (it != clients->end()) { | 438 if (it != clients->end()) { |
436 it->second.state_update_cb.Run(VIDEO_CAPTURE_STATE_STOPPED); | 439 it->second.state_update_cb.Run(VIDEO_CAPTURE_STATE_STOPPED); |
437 clients->erase(it); | 440 clients->erase(it); |
438 found = true; | 441 found = true; |
439 } | 442 } |
440 return found; | 443 return found; |
441 } | 444 } |
442 | 445 |
443 } // namespace content | 446 } // namespace content |
OLD | NEW |