Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1515)

Unified Diff: content/browser/renderer_host/media/video_capture_manager.cc

Issue 616833004: chrome://media-internals: update MediaInternals when devices capabilities are enumerated. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added VideoCaptureDeviceInfo in its very own file. Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/browser/renderer_host/media/video_capture_manager.cc
diff --git a/content/browser/renderer_host/media/video_capture_manager.cc b/content/browser/renderer_host/media/video_capture_manager.cc
index 7a28856273673092a84a4d761b278ab9dec96c7e..ad44459c10686fdd3ae277d1200601cc73c0bd5f 100644
--- a/content/browser/renderer_host/media/video_capture_manager.cc
+++ b/content/browser/renderer_host/media/video_capture_manager.cc
@@ -14,6 +14,7 @@
#include "base/task_runner_util.h"
#include "base/threading/sequenced_worker_pool.h"
#include "content/browser/media/capture/web_contents_video_capture_device.h"
+#include "content/browser/media/media_internals.h"
#include "content/browser/renderer_host/media/video_capture_controller.h"
#include "content/browser/renderer_host/media/video_capture_controller_event_handler.h"
#include "content/public/browser/browser_thread.h"
@@ -105,15 +106,6 @@ VideoCaptureManager::DeviceEntry::DeviceEntry(
VideoCaptureManager::DeviceEntry::~DeviceEntry() {}
-VideoCaptureManager::DeviceInfo::DeviceInfo() {}
-
-VideoCaptureManager::DeviceInfo::DeviceInfo(
- const media::VideoCaptureDevice::Name& name,
- const media::VideoCaptureFormats& supported_formats)
- : name(name),
- supported_formats(supported_formats) {}
-
-VideoCaptureManager::DeviceInfo::~DeviceInfo() {}
VideoCaptureManager::VideoCaptureManager(
scoped_ptr<media::VideoCaptureDeviceFactory> factory)
@@ -560,13 +552,18 @@ void VideoCaptureManager::OnDevicesInfoEnumerated(
}
devices_info_cache_ = new_devices_info_cache;
+ // Send a delayed update to MediaInternals about enumerated capabilities.
+ BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, base::Bind(
perkj_chrome 2014/10/08 14:26:36 Call directly instead as discussed.
mcasas 2014/10/08 14:49:39 Done.
+ &MediaInternals::UpdateVideoCaptureDeviceCapabilities,
+ base::Unretained(MediaInternals::GetInstance()),
+ devices_info_cache_));
+
// Walk the |devices_info_cache_| and transform from VCD::Name to
// StreamDeviceInfo for return purposes.
StreamDeviceInfoArray devices;
- for (DeviceInfos::const_iterator it = devices_info_cache_.begin();
- it != devices_info_cache_.end(); ++it) {
+ for (const auto &it : devices_info_cache_) {
devices.push_back(StreamDeviceInfo(
- stream_type, it->name.GetNameAndModel(), it->name.id()));
+ stream_type, it.name.GetNameAndModel(), it.name.id()));
}
listener_->DevicesEnumerated(stream_type, devices);
}
@@ -603,7 +600,6 @@ void VideoCaptureManager::ConsolidateDevicesInfoOnDeviceThread(
for (media::VideoCaptureDevice::Names::const_iterator it =
names_snapshot->begin();
it != names_snapshot->end(); ++it) {
- media::VideoCaptureFormats supported_formats;
DeviceInfo device_info(*it, media::VideoCaptureFormats());
video_capture_device_factory_->GetDeviceSupportedFormats(
*it, &(device_info.supported_formats));

Powered by Google App Engine
This is Rietveld 408576698