| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "content/browser/renderer_host/video_capture_controller.h" | 5 #include "content/browser/renderer_host/video_capture_controller.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/stl_util-inl.h" | 8 #include "base/stl_util-inl.h" |
| 9 #include "content/browser/browser_thread.h" | 9 #include "content/browser/browser_thread.h" |
| 10 #include "content/browser/media_stream/video_capture_manager.h" | 10 #include "content/browser/media_stream/video_capture_manager.h" |
| 11 #include "media/base/yuv_convert.h" | 11 #include "media/base/yuv_convert.h" |
| 12 | 12 |
| 13 #if defined(OS_WIN) | 13 #if defined(OS_WIN) |
| 14 #include "content/common/section_util_win.h" | 14 #include "content/common/section_util_win.h" |
| 15 #endif | 15 #endif |
| 16 | 16 |
| 17 // The number of TransportDIBs VideoCaptureController allocate. | 17 // The number of TransportDIBs VideoCaptureController allocate. |
| 18 static const size_t kNoOfDIBS = 3; | 18 static const size_t kNoOfDIBS = 3; |
| 19 | 19 |
| 20 VideoCaptureController::VideoCaptureController( | 20 VideoCaptureController::VideoCaptureController( |
| 21 ControllerId id, | 21 const VideoCaptureControllerID& id, |
| 22 base::ProcessHandle render_process, | 22 base::ProcessHandle render_process, |
| 23 EventHandler* event_handler) | 23 VideoCaptureControllerEventHandler* event_handler) |
| 24 : render_handle_(render_process), | 24 : render_handle_(render_process), |
| 25 report_ready_to_delete_(false), | 25 report_ready_to_delete_(false), |
| 26 event_handler_(event_handler), | 26 event_handler_(event_handler), |
| 27 id_(id) {} | 27 id_(id) {} |
| 28 | 28 |
| 29 VideoCaptureController::~VideoCaptureController() { | 29 VideoCaptureController::~VideoCaptureController() { |
| 30 // Delete all TransportDIBs. | 30 // Delete all TransportDIBs. |
| 31 STLDeleteContainerPairSecondPointers(owned_dibs_.begin(), | 31 STLDeleteContainerPairSecondPointers(owned_dibs_.begin(), |
| 32 owned_dibs_.end()); | 32 owned_dibs_.end()); |
| 33 } | 33 } |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 216 } | 216 } |
| 217 | 217 |
| 218 if (ready_to_delete_now) { | 218 if (ready_to_delete_now) { |
| 219 event_handler_->OnReadyToDelete(id_); | 219 event_handler_->OnReadyToDelete(id_); |
| 220 } | 220 } |
| 221 if (stopped_task) { | 221 if (stopped_task) { |
| 222 stopped_task->Run(); | 222 stopped_task->Run(); |
| 223 delete stopped_task; | 223 delete stopped_task; |
| 224 } | 224 } |
| 225 } | 225 } |
| OLD | NEW |