Chromium Code Reviews| 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 #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 <set> | 7 #include <set> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| 11 #include "base/logging.h" | 11 #include "base/logging.h" |
| 12 #include "base/message_loop/message_loop.h" | 12 #include "base/message_loop/message_loop.h" |
| 13 #include "base/stl_util.h" | 13 #include "base/stl_util.h" |
| 14 #include "base/strings/stringprintf.h" | |
| 14 #include "base/task_runner_util.h" | 15 #include "base/task_runner_util.h" |
| 15 #include "base/threading/sequenced_worker_pool.h" | 16 #include "base/threading/sequenced_worker_pool.h" |
| 17 #include "content/browser/renderer_host/media/media_stream_manager.h" | |
|
perkj_chrome
2014/01/20 11:07:08
I think this include is the wrong direction.
If yo
vrk (LEFT CHROMIUM)
2014/01/22 02:25:42
I was originally going to add more logging in a se
| |
| 16 #include "content/browser/renderer_host/media/video_capture_controller.h" | 18 #include "content/browser/renderer_host/media/video_capture_controller.h" |
| 17 #include "content/browser/renderer_host/media/video_capture_controller_event_han dler.h" | 19 #include "content/browser/renderer_host/media/video_capture_controller_event_han dler.h" |
| 18 #include "content/browser/renderer_host/media/web_contents_video_capture_device. h" | 20 #include "content/browser/renderer_host/media/web_contents_video_capture_device. h" |
| 19 #include "content/public/browser/browser_thread.h" | 21 #include "content/public/browser/browser_thread.h" |
| 20 #include "content/public/browser/desktop_media_id.h" | 22 #include "content/public/browser/desktop_media_id.h" |
| 21 #include "content/public/common/content_switches.h" | 23 #include "content/public/common/content_switches.h" |
| 22 #include "content/public/common/media_stream_request.h" | 24 #include "content/public/common/media_stream_request.h" |
| 23 #include "media/base/media_switches.h" | 25 #include "media/base/media_switches.h" |
| 24 #include "media/base/scoped_histogram_timer.h" | 26 #include "media/base/scoped_histogram_timer.h" |
| 25 #include "media/video/capture/fake_video_capture_device.h" | 27 #include "media/video/capture/fake_video_capture_device.h" |
| (...skipping 403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 429 names_snapshot.begin(); | 431 names_snapshot.begin(); |
| 430 it != names_snapshot.end(); ++it) { | 432 it != names_snapshot.end(); ++it) { |
| 431 if (it_device_info->name.id() == it->id()) { | 433 if (it_device_info->name.id() == it->id()) { |
| 432 new_devices_info_cache.push_back(*it_device_info); | 434 new_devices_info_cache.push_back(*it_device_info); |
| 433 names_snapshot.erase(it); | 435 names_snapshot.erase(it); |
| 434 break; | 436 break; |
| 435 } | 437 } |
| 436 } | 438 } |
| 437 } | 439 } |
| 438 | 440 |
| 441 MediaStreamManager::AddLogMessage( | |
| 442 "VCM::GADIODT found the following devices:"); | |
|
Henrik Grunell
2014/01/17 08:51:25
If there's no devices, will that be clear to the l
vrk (LEFT CHROMIUM)
2014/01/22 02:25:42
Sure, added special log message for this case.
| |
| 439 // Get the supported capture formats for the new devices in |names_snapshot|. | 443 // Get the supported capture formats for the new devices in |names_snapshot|. |
| 440 for (media::VideoCaptureDevice::Names::const_iterator it = | 444 for (media::VideoCaptureDevice::Names::const_iterator it = |
| 441 names_snapshot.begin(); | 445 names_snapshot.begin(); |
| 442 it != names_snapshot.end(); ++it) { | 446 it != names_snapshot.end(); ++it) { |
| 443 media::VideoCaptureFormats supported_formats; | 447 media::VideoCaptureFormats supported_formats; |
| 444 DeviceInfo device_info(*it, media::VideoCaptureFormats()); | 448 DeviceInfo device_info(*it, media::VideoCaptureFormats()); |
| 445 switch (artificial_device_source_for_testing_) { | 449 switch (artificial_device_source_for_testing_) { |
| 446 case DISABLED: | 450 case DISABLED: |
| 447 media::VideoCaptureDevice::GetDeviceSupportedFormats( | 451 media::VideoCaptureDevice::GetDeviceSupportedFormats( |
| 448 *it, &(device_info.supported_formats)); | 452 *it, &(device_info.supported_formats)); |
| 449 break; | 453 break; |
| 450 case TEST_PATTERN: | 454 case TEST_PATTERN: |
| 451 media::FakeVideoCaptureDevice::GetDeviceSupportedFormats( | 455 media::FakeVideoCaptureDevice::GetDeviceSupportedFormats( |
| 452 *it, &(device_info.supported_formats)); | 456 *it, &(device_info.supported_formats)); |
| 453 break; | 457 break; |
| 454 case Y4M_FILE: | 458 case Y4M_FILE: |
| 455 media::FileVideoCaptureDevice::GetDeviceSupportedFormats( | 459 media::FileVideoCaptureDevice::GetDeviceSupportedFormats( |
| 456 *it, &(device_info.supported_formats)); | 460 *it, &(device_info.supported_formats)); |
| 457 break; | 461 break; |
| 458 } | 462 } |
| 459 new_devices_info_cache.push_back(device_info); | 463 new_devices_info_cache.push_back(device_info); |
| 464 MediaStreamManager::AddLogMessage(device_info.name.GetNameAndModel() + "(" + | |
|
Henrik Grunell
2014/01/17 08:51:25
Perhaps " ("? (Space added)
vrk (LEFT CHROMIUM)
2014/01/22 02:25:42
Done.
| |
| 465 device_info.name.id()); | |
|
Henrik Grunell
2014/01/17 08:51:25
End string with ")"?
vrk (LEFT CHROMIUM)
2014/01/22 02:25:42
Done.
| |
| 460 } | 466 } |
| 461 return new_devices_info_cache; | 467 return new_devices_info_cache; |
| 462 } | 468 } |
| 463 | 469 |
| 464 VideoCaptureManager::DeviceEntry* | 470 VideoCaptureManager::DeviceEntry* |
| 465 VideoCaptureManager::GetDeviceEntryForMediaStreamDevice( | 471 VideoCaptureManager::GetDeviceEntryForMediaStreamDevice( |
| 466 const MediaStreamDevice& device_info) { | 472 const MediaStreamDevice& device_info) { |
| 467 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 473 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 468 | 474 |
| 469 for (DeviceEntries::iterator it = devices_.begin(); | 475 for (DeviceEntries::iterator it = devices_.begin(); |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 544 DeviceInfos& device_vector) { | 550 DeviceInfos& device_vector) { |
| 545 for (DeviceInfos::iterator it = device_vector.begin(); | 551 for (DeviceInfos::iterator it = device_vector.begin(); |
| 546 it != device_vector.end(); ++it) { | 552 it != device_vector.end(); ++it) { |
| 547 if (it->name.id() == id) | 553 if (it->name.id() == id) |
| 548 return &(*it); | 554 return &(*it); |
| 549 } | 555 } |
| 550 return NULL; | 556 return NULL; |
| 551 } | 557 } |
| 552 | 558 |
| 553 } // namespace content | 559 } // namespace content |
| OLD | NEW |