| 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 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 DCHECK(inserted); | 192 DCHECK(inserted); |
| 193 } | 193 } |
| 194 | 194 |
| 195 void VideoCaptureImpl::OnBufferDestroyed(int buffer_id) { | 195 void VideoCaptureImpl::OnBufferDestroyed(int buffer_id) { |
| 196 DCHECK(thread_checker_.CalledOnValidThread()); | 196 DCHECK(thread_checker_.CalledOnValidThread()); |
| 197 | 197 |
| 198 ClientBufferMap::iterator iter = client_buffers_.find(buffer_id); | 198 ClientBufferMap::iterator iter = client_buffers_.find(buffer_id); |
| 199 if (iter == client_buffers_.end()) | 199 if (iter == client_buffers_.end()) |
| 200 return; | 200 return; |
| 201 | 201 |
| 202 DCHECK(!iter->second || iter->second->HasOneRef()) | 202 DCHECK(!iter->second.get() || iter->second->HasOneRef()) |
| 203 << "Instructed to delete buffer we are still using."; | 203 << "Instructed to delete buffer we are still using."; |
| 204 client_buffers_.erase(iter); | 204 client_buffers_.erase(iter); |
| 205 } | 205 } |
| 206 | 206 |
| 207 void VideoCaptureImpl::OnBufferReceived(int buffer_id, | 207 void VideoCaptureImpl::OnBufferReceived(int buffer_id, |
| 208 const media::VideoCaptureFormat& format, | 208 const media::VideoCaptureFormat& format, |
| 209 base::TimeTicks timestamp) { | 209 base::TimeTicks timestamp) { |
| 210 DCHECK(thread_checker_.CalledOnValidThread()); | 210 DCHECK(thread_checker_.CalledOnValidThread()); |
| 211 | 211 |
| 212 // The capture pipeline supports only I420 for now. | 212 // The capture pipeline supports only I420 for now. |
| (...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 433 ClientInfoMap::iterator it = clients->find(client_id); | 433 ClientInfoMap::iterator it = clients->find(client_id); |
| 434 if (it != clients->end()) { | 434 if (it != clients->end()) { |
| 435 it->second.state_update_cb.Run(VIDEO_CAPTURE_STATE_STOPPED); | 435 it->second.state_update_cb.Run(VIDEO_CAPTURE_STATE_STOPPED); |
| 436 clients->erase(it); | 436 clients->erase(it); |
| 437 found = true; | 437 found = true; |
| 438 } | 438 } |
| 439 return found; | 439 return found; |
| 440 } | 440 } |
| 441 | 441 |
| 442 } // namespace content | 442 } // namespace content |
| OLD | NEW |