| 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/media/video_capture_manager.h" | 5 #include "content/browser/renderer_host/media/video_capture_manager.h" |
| 6 | 6 |
| 7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
| 8 #include "content/browser/browser_thread.h" | 8 #include "content/browser/browser_thread.h" |
| 9 #include "media/video/capture/fake_video_capture_device.h" | 9 #include "media/video/capture/fake_video_capture_device.h" |
| 10 #include "media/video/capture/video_capture_device.h" | 10 #include "media/video/capture/video_capture_device.h" |
| 11 | 11 |
| 12 namespace media_stream { | 12 namespace media_stream { |
| 13 | 13 |
| 14 // Starting id for the first capture session. | 14 // Starting id for the first capture session. |
| 15 // VideoCaptureManager::kStartOpenSessionId is used as default id without | 15 // VideoCaptureManager::kStartOpenSessionId is used as default id without |
| 16 // explicitly calling open device. | 16 // explicitly calling open device. |
| 17 enum { kFirstSessionId = VideoCaptureManager::kStartOpenSessionId + 1 }; | 17 enum { kFirstSessionId = VideoCaptureManager::kStartOpenSessionId + 1 }; |
| 18 | 18 |
| 19 static ::base::LazyInstance<VideoCaptureManager> g_video_capture_manager( | |
| 20 base::LINKER_INITIALIZED); | |
| 21 | |
| 22 VideoCaptureManager* VideoCaptureManager::Get() { | |
| 23 return g_video_capture_manager.Pointer(); | |
| 24 } | |
| 25 | |
| 26 VideoCaptureManager::VideoCaptureManager() | 19 VideoCaptureManager::VideoCaptureManager() |
| 27 : vc_device_thread_("VideoCaptureManagerThread"), | 20 : vc_device_thread_("VideoCaptureManagerThread"), |
| 28 listener_(NULL), | 21 listener_(NULL), |
| 29 new_capture_session_id_(kFirstSessionId), | 22 new_capture_session_id_(kFirstSessionId), |
| 30 use_fake_device_(false) { | 23 use_fake_device_(false) { |
| 31 vc_device_thread_.Start(); | 24 vc_device_thread_.Start(); |
| 32 } | 25 } |
| 33 | 26 |
| 34 VideoCaptureManager::~VideoCaptureManager() { | 27 VideoCaptureManager::~VideoCaptureManager() { |
| 35 DCHECK(devices_.empty()); | 28 DCHECK(devices_.empty()); |
| (...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 372 it != devices_.end(); | 365 it != devices_.end(); |
| 373 it++) { | 366 it++) { |
| 374 if (device_info.device_id == it->second->device_name().unique_id) { | 367 if (device_info.device_id == it->second->device_name().unique_id) { |
| 375 return true; | 368 return true; |
| 376 } | 369 } |
| 377 } | 370 } |
| 378 return false; | 371 return false; |
| 379 } | 372 } |
| 380 | 373 |
| 381 } // namespace media_stream | 374 } // namespace media_stream |
| OLD | NEW |