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

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: 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 83b01a7fb1a2c30734bcc2c8dda5104ea9135a14..829a89d824fbee1a6ec6b67276c87d81a2b4c845 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"
@@ -497,11 +498,17 @@ void VideoCaptureManager::OnDevicesInfoEnumerated(
// Walk the |devices_info_cache_| and transform from VCD::Name to
// StreamDeviceInfo for return purposes.
+ MediaInternals::GetInstance()->PurgeVideoCaptureDeviceCapabilities();
burnik 2014/10/05 23:08:55 Maybe we can avoid this if we start of with an emp
mcasas 2014/10/07 11:25:40 Done.
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()));
+ // Send an update to MediaInternals later on.
burnik 2014/10/03 11:15:41 Nit: add empty line before comment.
mcasas 2014/10/07 11:25:40 Done.
+ BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, base::Bind(
+ &MediaInternals::UpdateVideoCaptureDeviceCapabilities,
+ base::Unretained(MediaInternals::GetInstance()),
+ it.name,
+ it.supported_formats));
burnik 2014/10/05 23:08:55 add devices_info_cache_.size() as last argument.
mcasas 2014/10/07 11:25:40 Done.
}
listener_->DevicesEnumerated(stream_type, devices);
}
@@ -538,7 +545,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