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

Issue 616833004: chrome://media-internals: update MediaInternals when devices capabilities are enumerated. (Closed)

Created:
6 years, 2 months ago by mcasas
Modified:
6 years, 2 months ago
CC:
chromium-reviews, posciak+watch_chromium.org, jam, mcasas+watch_chromium.org, feature-media-reviews_chromium.org, darin-cc_chromium.org, wjia+watch_chromium.org, miu+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Project:
chromium
Visibility:
Public.

Description

chrome://media-internals: update MediaInternals when devices capabilities are enumerated. Ping MediaInternals with the capabilities list from VideoCaptureManager. \ Moved VideoCaptureManager::DeviceInfo to media::VideoCaptureDeviceInfo in its own file. This is used from VCM to send the list of video capture devices to MediaInternals, after enumeration. Sprinkle some nice "const auto &" and range for loops on the affected areas, those features are approved [1]. [1] http://chromium-cpp.appspot.com/ BUG=344882 Committed: https://crrev.com/fcb5c7de8085887dae1359a12c74df1f44692b72 Cr-Commit-Position: refs/heads/master@{#299251}

Patch Set 1 : #

Total comments: 20

Patch Set 2 : burnik@ comments. Rebased. Refactored capabilities update. #

Total comments: 14

Patch Set 3 : Win+Mac, use SetInteger for capture_api_type(). #

Patch Set 4 : Moved DeviceInfo to media::VideoCaptureDevice and used from VCM and MediaInternals. Other perkj@ co… #

Total comments: 8

Patch Set 5 : Added VideoCaptureDeviceInfo in its very own file. #

Total comments: 8

Patch Set 6 : perkj@s comments #

Total comments: 18

Patch Set 7 : wolenetz@ comments #

Total comments: 2

Patch Set 8 : Refactored MediaInternalsTest and added a proto video-capture-capabilities TEST_F #

Total comments: 6

Patch Set 9 : wolenetz@ and xhwang@ final comments #

Patch Set 10 : FakeVCDFactory needs to specify capture API for Win. Linux/CrOs MediaInternalsVideoCaptureDeviceTes… #

Unified diffs Side-by-side diffs Delta from patch set Stats (+257 lines, -145 lines) Patch
M content/browser/media/media_internals.h View 1 2 3 4 5 6 7 8 4 chunks +22 lines, -16 lines 0 comments Download
M content/browser/media/media_internals.cc View 1 2 3 4 5 6 7 8 7 chunks +50 lines, -24 lines 0 comments Download
M content/browser/media/media_internals_proxy.cc View 1 2 3 4 5 6 1 chunk +2 lines, -1 line 0 comments Download
M content/browser/media/media_internals_unittest.cc View 1 2 3 4 5 6 7 8 9 4 chunks +84 lines, -36 lines 0 comments Download
M content/browser/renderer_host/media/video_capture_manager.h View 1 2 3 4 5 6 6 chunks +12 lines, -21 lines 0 comments Download
M content/browser/renderer_host/media/video_capture_manager.cc View 1 2 3 4 5 6 7 8 9 chunks +26 lines, -37 lines 0 comments Download
M content/browser/resources/media/main.js View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M media/BUILD.gn View 1 2 3 4 5 6 1 chunk +2 lines, -0 lines 0 comments Download
M media/media.gyp View 1 2 3 4 5 6 3 chunks +4 lines, -2 lines 0 comments Download
M media/video/capture/fake_video_capture_device_factory.cc View 1 2 3 4 5 6 7 8 9 1 chunk +6 lines, -6 lines 0 comments Download
A media/video/capture/video_capture_device_info.h View 1 2 3 4 5 6 1 chunk +28 lines, -0 lines 0 comments Download
A media/video/capture/video_capture_device_info.cc View 1 2 3 4 1 chunk +19 lines, -0 lines 0 comments Download
M media/video/capture/video_capture_types.h View 1 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 61 (27 generated)
mcasas
xians@ PTAL burnik@ FYI/PTAL.
6 years, 2 months ago (2014-10-02 15:02:06 UTC) #3
burnik
I'll pull in the patch and come up with a preview. Probably over the weekend. ...
6 years, 2 months ago (2014-10-03 11:15:41 UTC) #7
burnik
Look closely. :-) https://codereview.chromium.org/616833004/diff/60001/content/browser/media/media_internals.cc File content/browser/media/media_internals.cc (right): https://codereview.chromium.org/616833004/diff/60001/content/browser/media/media_internals.cc#newcode217 content/browser/media/media_internals.cc:217: void MediaInternals::SendEverything() { This is a ...
6 years, 2 months ago (2014-10-05 23:08:55 UTC) #8
mcasas
burnik@, perkj@ PTAL https://codereview.chromium.org/616833004/diff/60001/content/browser/media/media_internals.cc File content/browser/media/media_internals.cc (right): https://codereview.chromium.org/616833004/diff/60001/content/browser/media/media_internals.cc#newcode217 content/browser/media/media_internals.cc:217: void MediaInternals::SendEverything() { On 2014/10/05 23:08:55, ...
6 years, 2 months ago (2014-10-07 11:25:40 UTC) #11
perkj_chrome
https://codereview.chromium.org/616833004/diff/100001/content/browser/media/media_internals.cc File content/browser/media/media_internals.cc (right): https://codereview.chromium.org/616833004/diff/100001/content/browser/media/media_internals.cc#newcode247 content/browser/media/media_internals.cc:247: // TODO(mcasas): Send the capabilities to JS in a ...
6 years, 2 months ago (2014-10-07 14:12:51 UTC) #12
burnik
LGTM, but fix the bots! :) https://codereview.chromium.org/616833004/diff/100001/content/browser/media/media_internals.cc File content/browser/media/media_internals.cc (right): https://codereview.chromium.org/616833004/diff/100001/content/browser/media/media_internals.cc#newcode237 content/browser/media/media_internals.cc:237: name_and_format.a.capture_api_type()); Looks like ...
6 years, 2 months ago (2014-10-07 14:17:02 UTC) #13
mcasas
guys PTAL. https://codereview.chromium.org/616833004/diff/100001/content/browser/media/media_internals.cc File content/browser/media/media_internals.cc (right): https://codereview.chromium.org/616833004/diff/100001/content/browser/media/media_internals.cc#newcode237 content/browser/media/media_internals.cc:237: name_and_format.a.capture_api_type()); On 2014/10/07 14:17:02, burnik wrote: > ...
6 years, 2 months ago (2014-10-07 14:54:44 UTC) #16
perkj_chrome
https://codereview.chromium.org/616833004/diff/100001/content/browser/media/media_internals.cc File content/browser/media/media_internals.cc (right): https://codereview.chromium.org/616833004/diff/100001/content/browser/media/media_internals.cc#newcode230 content/browser/media/media_internals.cc:230: DCHECK(video_devices_cached_data_.empty()); You dont' need a member variable video_devices_cached_data_? https://codereview.chromium.org/616833004/diff/100001/content/browser/media/media_internals.cc#newcode247 ...
6 years, 2 months ago (2014-10-07 15:51:24 UTC) #17
mcasas
perkj@ PTAL. Moved DeviceInfo from VCM to VCDevice to avoid the extra name+formats copy. https://codereview.chromium.org/616833004/diff/100001/content/browser/media/media_internals.cc ...
6 years, 2 months ago (2014-10-08 11:31:04 UTC) #18
perkj_chrome
https://codereview.chromium.org/616833004/diff/180001/content/browser/media/media_internals.cc File content/browser/media/media_internals.cc (right): https://codereview.chromium.org/616833004/diff/180001/content/browser/media/media_internals.cc#newcode238 content/browser/media/media_internals.cc:238: int cont = 0; nit. s/ count https://codereview.chromium.org/616833004/diff/180001/content/browser/media/media_internals.cc#newcode244 content/browser/media/media_internals.cc:244: ...
6 years, 2 months ago (2014-10-08 11:50:00 UTC) #19
mcasas
perkj@ PTAL https://codereview.chromium.org/616833004/diff/180001/content/browser/media/media_internals.cc File content/browser/media/media_internals.cc (right): https://codereview.chromium.org/616833004/diff/180001/content/browser/media/media_internals.cc#newcode238 content/browser/media/media_internals.cc:238: int cont = 0; On 2014/10/08 11:49:59, ...
6 years, 2 months ago (2014-10-08 14:05:18 UTC) #22
perkj_chrome
looks like you need to update the gn files as well. https://codereview.chromium.org/616833004/diff/240001/content/browser/renderer_host/media/video_capture_manager.cc File content/browser/renderer_host/media/video_capture_manager.cc (right): ...
6 years, 2 months ago (2014-10-08 14:26:37 UTC) #23
mcasas
perkj@ PTAL https://codereview.chromium.org/616833004/diff/240001/content/browser/renderer_host/media/video_capture_manager.cc File content/browser/renderer_host/media/video_capture_manager.cc (right): https://codereview.chromium.org/616833004/diff/240001/content/browser/renderer_host/media/video_capture_manager.cc#newcode556 content/browser/renderer_host/media/video_capture_manager.cc:556: BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, base::Bind( On 2014/10/08 14:26:36, perkj ...
6 years, 2 months ago (2014-10-08 14:49:39 UTC) #25
perkj_chrome
lgtm. Please let the owner of media_internals also review.
6 years, 2 months ago (2014-10-09 14:46:06 UTC) #26
mcasas
dalecurtis@: media/{media.gyp,BUILD.gn} and media_internals.*
6 years, 2 months ago (2014-10-09 14:49:03 UTC) #28
DaleCurtis
I'm traveling, so +Wolenetz
6 years, 2 months ago (2014-10-09 18:48:00 UTC) #30
wolenetz
Thanks for the excuse to page-in some media-internals code :) Other than minor nits/questions, can ...
6 years, 2 months ago (2014-10-09 20:51:43 UTC) #31
wolenetz
Also: https://codereview.chromium.org/616833004/diff/280001/content/browser/media/media_internals.cc File content/browser/media/media_internals.cc (right): https://codereview.chromium.org/616833004/diff/280001/content/browser/media/media_internals.cc#newcode247 content/browser/media/media_internals.cc:247: // to JS is implemented in a similar ...
6 years, 2 months ago (2014-10-09 20:55:05 UTC) #32
mcasas
wolenetz@ PTAL. https://codereview.chromium.org/616833004/diff/280001/content/browser/media/media_internals.cc File content/browser/media/media_internals.cc (right): https://codereview.chromium.org/616833004/diff/280001/content/browser/media/media_internals.cc#newcode222 content/browser/media/media_internals.cc:222: "media.onReceiveEverything", &audio_streams_cached_data_); On 2014/10/09 20:51:43, wolenetz wrote: ...
6 years, 2 months ago (2014-10-10 11:30:42 UTC) #33
wolenetz
lgtm % 1 persistent nit :) Thanks! https://codereview.chromium.org/616833004/diff/440001/content/browser/renderer_host/media/video_capture_manager.cc File content/browser/renderer_host/media/video_capture_manager.cc (right): https://codereview.chromium.org/616833004/diff/440001/content/browser/renderer_host/media/video_capture_manager.cc#newcode562 content/browser/renderer_host/media/video_capture_manager.cc:562: for (const ...
6 years, 2 months ago (2014-10-10 18:16:17 UTC) #35
wolenetz
Hmm. It looks like I'm not yet an owner of content/browser/resources/media. +xhwang
6 years, 2 months ago (2014-10-10 18:18:30 UTC) #37
xhwang
lgtm % naming nits https://codereview.chromium.org/616833004/diff/710001/content/browser/media/media_internals.cc File content/browser/media/media_internals.cc (right): https://codereview.chromium.org/616833004/diff/710001/content/browser/media/media_internals.cc#newcode228 content/browser/media/media_internals.cc:228: const media::VideoCaptureDeviceInfos& name_and_formats) { names_and_formats ...
6 years, 2 months ago (2014-10-10 19:40:07 UTC) #38
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/616833004/950001
6 years, 2 months ago (2014-10-11 13:20:23 UTC) #40
commit-bot: I haz the power
Try jobs failed on following builders: linux_gpu_triggered_tests on tryserver.chromium.gpu (http://build.chromium.org/p/tryserver.chromium.gpu/builders/linux_gpu_triggered_tests/builds/67511)
6 years, 2 months ago (2014-10-11 14:08:03 UTC) #42
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/616833004/950001
6 years, 2 months ago (2014-10-11 15:35:38 UTC) #44
commit-bot: I haz the power
Try jobs failed on following builders: linux_gpu_triggered_tests on tryserver.chromium.gpu (http://build.chromium.org/p/tryserver.chromium.gpu/builders/linux_gpu_triggered_tests/builds/67518)
6 years, 2 months ago (2014-10-11 16:24:44 UTC) #46
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/616833004/800002
6 years, 2 months ago (2014-10-11 17:18:59 UTC) #49
commit-bot: I haz the power
Try jobs failed on following builders: android_dbg_tests_recipe on tryserver.chromium.linux (http://build.chromium.org/p/tryserver.chromium.linux/builders/android_dbg_tests_recipe/builds/17569)
6 years, 2 months ago (2014-10-11 17:36:06 UTC) #51
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/616833004/1370001
6 years, 2 months ago (2014-10-11 17:47:36 UTC) #54
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_rel_swarming on tryserver.chromium.linux (http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_rel_swarming/builds/24887)
6 years, 2 months ago (2014-10-11 19:08:19 UTC) #56
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/616833004/1370001
6 years, 2 months ago (2014-10-11 19:12:23 UTC) #58
commit-bot: I haz the power
Committed patchset #10 (id:1370001)
6 years, 2 months ago (2014-10-11 20:22:31 UTC) #59
commit-bot: I haz the power
Patchset 10 (id:??) landed as https://crrev.com/fcb5c7de8085887dae1359a12c74df1f44692b72 Cr-Commit-Position: refs/heads/master@{#299251}
6 years, 2 months ago (2014-10-11 20:23:21 UTC) #60
mcasas
6 years, 2 months ago (2014-10-11 21:12:37 UTC) #61
Message was sent while issue was closed.
https://codereview.chromium.org/616833004/diff/440001/content/browser/rendere...
File content/browser/renderer_host/media/video_capture_manager.cc (right):

https://codereview.chromium.org/616833004/diff/440001/content/browser/rendere...
content/browser/renderer_host/media/video_capture_manager.cc:562: for (const
auto &it : devices_info_cache_) {
On 2014/10/10 18:16:17, wolenetz wrote:
> nit: "auto &" -> "auto& ": not done

Sneaky! Double checked all autos, should be done now.

https://codereview.chromium.org/616833004/diff/710001/content/browser/media/m...
File content/browser/media/media_internals.cc (right):

https://codereview.chromium.org/616833004/diff/710001/content/browser/media/m...
content/browser/media/media_internals.cc:228: const
media::VideoCaptureDeviceInfos& name_and_formats) {
On 2014/10/10 19:40:06, xhwang wrote:
> names_and_formats is ambiguous. It's really vector_of_name_and_formats. How
> about just use video_capture_device_infos?

Done.

https://codereview.chromium.org/616833004/diff/710001/content/browser/media/m...
content/browser/media/media_internals.cc:231: for (const auto& name_and_format :
name_and_formats) {
On 2014/10/10 19:40:06, xhwang wrote:
> ditto, s/name_and_format/video_capture_device_info

Done.

https://codereview.chromium.org/616833004/diff/710001/content/browser/media/m...
File content/browser/media/media_internals_unittest.cc (right):

https://codereview.chromium.org/616833004/diff/710001/content/browser/media/m...
content/browser/media/media_internals_unittest.cc:110:
update_cb_(base::Bind(&MediaInternalsAudioLogTest::UpdateCallbackImpl,
On 2014/10/10 18:16:17, wolenetz wrote:
> aside: Use ..TestBase in bind? On second thought, I think it's best how you
have
> it currently, in case future change overrides that ..TestBase method in this
> class.

Acknowledged.

Powered by Google App Engine
This is Rietveld 408576698