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

Issue 29423003: Added video capture capabilities retrieval and caching to VideoCaptureManager (Closed)

Created:
7 years, 2 months ago by mcasas
Modified:
7 years ago
CC:
chromium-reviews, fischman+watch_chromium.org, jam, joi+watch-content_chromium.org, feature-media-reviews_chromium.org, darin-cc_chromium.org, wjia+watch_chromium.org, miu+watch_chromium.org, tommi (sloooow) - chröme, ncarter (slow), miu
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Visibility:
Public.

Description

Added video capture capabilities retrieval and caching to VideoCaptureManager. The local cache of video capture names and capabilities is created in a codepath starting in EnumerateDevices. The cache is update during StartCaptureForClient() and StopCaptureForClient(). Also added unittests (http://goo.gl/QQbpXW). BUG=309554 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=235223

Patch Set 1 : #

Total comments: 4

Patch Set 2 : Changed mechanics of Caps enumeration to be asynchronous and 2 threaded. UT adapted. #

Total comments: 40

Patch Set 3 : tommi@'s round of comments addressed. More UT. Capabilities reset on closing device. #

Total comments: 12

Patch Set 4 : Overhauled following all the inputs. #

Total comments: 20

Patch Set 5 : perkj@ comments. #

Patch Set 6 : Defensive programming - against race conditions, id's not found, vectors that self-release etc. #

Total comments: 13

Patch Set 7 : perkj@'s comments #

Total comments: 24

Patch Set 8 : perkj@'s comments #

Total comments: 18

Patch Set 9 : perkj@'s comments #

Total comments: 19

Patch Set 10 : perkj@ nits and ncarter@ comments. #

Total comments: 12

Patch Set 11 : ncarter@: Removed double visit to Device thread. Removed ScopedVector<> use. #

Total comments: 31

Patch Set 12 : perkj@ comments and nits. #

Total comments: 25

Patch Set 13 : xians@ comments. #

Total comments: 16

Patch Set 14 : ncarter@ comments #

Total comments: 11

Patch Set 15 : perkj@ and xians@ comments #

Patch Set 16 : Mac implementation double checks for device_id on opening, unnecessary but maintained. #

Patch Set 17 : Removed RunUntilIdle between Stop and Close in UT, after Valgrind found a NULL addressing. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+325 lines, -83 lines) Patch
M content/browser/renderer_host/media/video_capture_controller.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +4 lines, -0 lines 0 comments Download
M content/browser/renderer_host/media/video_capture_controller.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +10 lines, -0 lines 0 comments Download
M content/browser/renderer_host/media/video_capture_manager.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 6 chunks +42 lines, -12 lines 0 comments Download
M content/browser/renderer_host/media/video_capture_manager.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 10 chunks +134 lines, -42 lines 0 comments Download
M content/browser/renderer_host/media/video_capture_manager_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 3 chunks +97 lines, -1 line 0 comments Download
M media/video/capture/fake_video_capture_device.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +3 lines, -0 lines 0 comments Download
M media/video/capture/fake_video_capture_device.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 3 chunks +24 lines, -9 lines 0 comments Download
M media/video/capture/mac/video_capture_device_mac.mm View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +9 lines, -2 lines 0 comments Download
M media/video/capture/video_capture_device.h View 1 2 3 4 5 6 7 8 9 10 2 chunks +2 lines, -8 lines 0 comments Download
M media/video/capture/video_capture_device.cc View 1 2 3 4 5 6 7 8 1 chunk +0 lines, -9 lines 0 comments Download

Messages

Total messages: 33 (0 generated)
mcasas
Hi perkj@, continuing our quest could you PTAL?
7 years, 2 months ago (2013-10-23 12:28:03 UTC) #1
perkj_chrome
https://codereview.chromium.org/29423003/diff/90001/content/browser/renderer_host/media/video_capture_manager.cc File content/browser/renderer_host/media/video_capture_manager.cc (right): https://codereview.chromium.org/29423003/diff/90001/content/browser/renderer_host/media/video_capture_manager.cc#newcode155 content/browser/renderer_host/media/video_capture_manager.cc:155: media::VideoCaptureCapabilities& formats = What happen after the camera has ...
7 years, 2 months ago (2013-10-23 13:19:45 UTC) #2
mcasas
Hi perkj@, I changed the mechanics of VCCaps retrieval to follow two threaded, asynchronous like ...
7 years, 1 month ago (2013-10-25 12:49:00 UTC) #3
tommi (sloooow) - chröme
drive-by https://codereview.chromium.org/29423003/diff/160001/content/browser/renderer_host/media/audio_input_device_manager_unittest.cc File content/browser/renderer_host/media/audio_input_device_manager_unittest.cc (right): https://codereview.chromium.org/29423003/diff/160001/content/browser/renderer_host/media/audio_input_device_manager_unittest.cc#newcode15 content/browser/renderer_host/media/audio_input_device_manager_unittest.cc:15: #include "media/audio/audio_manager_base.h" remove. (no other change in this ...
7 years, 1 month ago (2013-10-25 14:15:33 UTC) #4
mcasas
tommi@: thanks for the drive-in ;) -- comments addressed. perkj@ could you have a look ...
7 years, 1 month ago (2013-10-28 12:50:07 UTC) #5
perkj_chrome
https://codereview.chromium.org/29423003/diff/490001/content/browser/renderer_host/media/media_stream_provider.h File content/browser/renderer_host/media/media_stream_provider.h (right): https://codereview.chromium.org/29423003/diff/490001/content/browser/renderer_host/media/media_stream_provider.h#newcode65 content/browser/renderer_host/media/media_stream_provider.h:65: // Called by a MediaStreamProvider when available devices' formats ...
7 years, 1 month ago (2013-10-29 12:13:35 UTC) #6
miu
You should consult nick@ for changes to VideoCaptureManager and VideoCaptureDevice, as he just completed a ...
7 years, 1 month ago (2013-10-29 18:43:26 UTC) #7
tommi (sloooow) - chröme
https://codereview.chromium.org/29423003/diff/490001/content/browser/renderer_host/media/video_capture_manager.h File content/browser/renderer_host/media/video_capture_manager.h (right): https://codereview.chromium.org/29423003/diff/490001/content/browser/renderer_host/media/video_capture_manager.h#newcode206 content/browser/renderer_host/media/video_capture_manager.h:206: std::vector<class DeviceInfo> devices_info_cache_; On 2013/10/29 18:43:27, Yuri wrote: > ...
7 years, 1 month ago (2013-10-29 20:26:23 UTC) #8
mcasas
perkj@, miu@, tommi@ thanks for the review. Instead of closing every comment I overhauled a ...
7 years, 1 month ago (2013-10-30 15:37:51 UTC) #9
perkj_chrome
A few more comments. https://codereview.chromium.org/29423003/diff/630001/content/browser/renderer_host/media/media_stream_provider.h File content/browser/renderer_host/media/media_stream_provider.h (right): https://codereview.chromium.org/29423003/diff/630001/content/browser/renderer_host/media/media_stream_provider.h#newcode56 content/browser/renderer_host/media/media_stream_provider.h:56: virtual void Error(MediaStreamType stream_type, Please ...
7 years, 1 month ago (2013-10-31 09:46:00 UTC) #10
mcasas
Hi perkj@ following your review and offline comments, some more changes (also in .h file ...
7 years, 1 month ago (2013-10-31 14:25:23 UTC) #11
perkj_chrome
A few more. https://codereview.chromium.org/29423003/diff/790001/content/browser/renderer_host/media/video_capture_manager.cc File content/browser/renderer_host/media/video_capture_manager.cc (right): https://codereview.chromium.org/29423003/diff/790001/content/browser/renderer_host/media/video_capture_manager.cc#newcode241 content/browser/renderer_host/media/video_capture_manager.cc:241: found->device_in_use_ = true; Can you move ...
7 years, 1 month ago (2013-11-04 11:08:22 UTC) #12
mcasas
perkj@'s comments addressed/answered, PTAL! https://codereview.chromium.org/29423003/diff/790001/content/browser/renderer_host/media/video_capture_manager.cc File content/browser/renderer_host/media/video_capture_manager.cc (right): https://codereview.chromium.org/29423003/diff/790001/content/browser/renderer_host/media/video_capture_manager.cc#newcode241 content/browser/renderer_host/media/video_capture_manager.cc:241: found->device_in_use_ = true; On 2013/11/04 ...
7 years, 1 month ago (2013-11-04 18:32:15 UTC) #13
perkj_chrome
Sorry I missread |names_snapshot|. https://codereview.chromium.org/29423003/diff/790001/content/browser/renderer_host/media/video_capture_manager.cc File content/browser/renderer_host/media/video_capture_manager.cc (right): https://codereview.chromium.org/29423003/diff/790001/content/browser/renderer_host/media/video_capture_manager.cc#newcode376 content/browser/renderer_host/media/video_capture_manager.cc:376: devices_info_cache_.swap(new_devices_info); Ok - I misread ...
7 years, 1 month ago (2013-11-05 09:34:34 UTC) #14
mcasas
Hi perkj@, PTAL! https://codereview.chromium.org/29423003/diff/870001/content/browser/renderer_host/media/video_capture_manager.cc File content/browser/renderer_host/media/video_capture_manager.cc (right): https://codereview.chromium.org/29423003/diff/870001/content/browser/renderer_host/media/video_capture_manager.cc#newcode336 content/browser/renderer_host/media/video_capture_manager.cc:336: media::VideoCaptureDevice::Names new_device_names; On 2013/11/05 09:34:34, perkj ...
7 years, 1 month ago (2013-11-05 22:46:05 UTC) #15
perkj_chrome
Hej If you fix the below I think this cl is ready for another reviewer. ...
7 years, 1 month ago (2013-11-06 17:05:50 UTC) #16
mcasas
Hi perkj@, now the code looks pristine and changes are taken in. What about an ...
7 years, 1 month ago (2013-11-06 20:10:20 UTC) #17
perkj_chrome
LGTM with a few nits. Have you tested what happens if you remove a USB ...
7 years, 1 month ago (2013-11-07 10:49:11 UTC) #18
mcasas
ncarter@, PTAL! perkj@: Removing a Fake device is part of the unittests. Removing a real ...
7 years, 1 month ago (2013-11-07 17:14:30 UTC) #19
ncarter (slow)
https://codereview.chromium.org/29423003/diff/1090001/content/browser/renderer_host/media/video_capture_manager.cc File content/browser/renderer_host/media/video_capture_manager.cc (right): https://codereview.chromium.org/29423003/diff/1090001/content/browser/renderer_host/media/video_capture_manager.cc#newcode235 content/browser/renderer_host/media/video_capture_manager.cc:235: found->device_in_use_ = true; The VideoCaptureManager already knows whether a ...
7 years, 1 month ago (2013-11-07 22:43:01 UTC) #20
mcasas
ncarter@: PTAL! FWIW, I understand your concern of keeping the caps triplicated. Is also true ...
7 years, 1 month ago (2013-11-08 02:45:20 UTC) #21
ncarter (slow)
https://codereview.chromium.org/29423003/diff/1240001/content/browser/renderer_host/media/video_capture_manager.cc File content/browser/renderer_host/media/video_capture_manager.cc (right): https://codereview.chromium.org/29423003/diff/1240001/content/browser/renderer_host/media/video_capture_manager.cc#newcode150 content/browser/renderer_host/media/video_capture_manager.cc:150: const media::VideoCaptureDevice::Name* device_name, The interface to this function gets ...
7 years, 1 month ago (2013-11-09 01:49:10 UTC) #22
mcasas
ncarter@, perkj@, PTAL. Some comments: - Caching of a device running caps happens in the ...
7 years, 1 month ago (2013-11-11 17:39:59 UTC) #23
perkj_chrome
https://codereview.chromium.org/29423003/diff/1350001/content/browser/renderer_host/media/video_capture_controller.h File content/browser/renderer_host/media/video_capture_controller.h (right): https://codereview.chromium.org/29423003/diff/1350001/content/browser/renderer_host/media/video_capture_controller.h#newcode107 content/browser/renderer_host/media/video_capture_controller.h:107: const media::VideoCaptureParams& getVideoCaptureParams() const { GetVideoCaptureParams() https://codereview.chromium.org/29423003/diff/1350001/content/browser/renderer_host/media/video_capture_manager.cc File content/browser/renderer_host/media/video_capture_manager.cc ...
7 years, 1 month ago (2013-11-12 11:10:57 UTC) #24
mcasas
Thanks for the review perkj@, PTAL. ncarter@ any further comments? A bit of reviewer reshuffling, ...
7 years, 1 month ago (2013-11-12 12:21:52 UTC) #25
no longer working on chromium
It generally looks good. I don't know much about the video capability, so only do ...
7 years, 1 month ago (2013-11-12 16:47:59 UTC) #26
mcasas
xians@ thanks for the review, PTAL! https://codereview.chromium.org/29423003/diff/1490001/content/browser/renderer_host/media/video_capture_controller.h File content/browser/renderer_host/media/video_capture_controller.h (right): https://codereview.chromium.org/29423003/diff/1490001/content/browser/renderer_host/media/video_capture_controller.h#newcode107 content/browser/renderer_host/media/video_capture_controller.h:107: const media::VideoCaptureParams& GetVideoCaptureParams() ...
7 years, 1 month ago (2013-11-12 18:10:15 UTC) #27
ncarter (slow)
LGTM with the following fixes. https://codereview.chromium.org/29423003/diff/1570001/content/browser/renderer_host/media/video_capture_controller.cc File content/browser/renderer_host/media/video_capture_controller.cc (right): https://codereview.chromium.org/29423003/diff/1570001/content/browser/renderer_host/media/video_capture_controller.cc#newcode147 content/browser/renderer_host/media/video_capture_controller.cc:147: const media::VideoCaptureParams& params) { ...
7 years, 1 month ago (2013-11-12 20:56:45 UTC) #28
mcasas
ncarter@: comments addressed, thanks! Let me bring forward one of my replies for perkj@: > ...
7 years, 1 month ago (2013-11-13 11:40:37 UTC) #29
perkj_chrome
Just one question and a few nits. https://codereview.chromium.org/29423003/diff/1670001/content/browser/renderer_host/media/video_capture_controller.cc File content/browser/renderer_host/media/video_capture_controller.cc (right): https://codereview.chromium.org/29423003/diff/1670001/content/browser/renderer_host/media/video_capture_controller.cc#newcode158 content/browser/renderer_host/media/video_capture_controller.cc:158: video_capture_format_ = ...
7 years, 1 month ago (2013-11-13 13:04:17 UTC) #30
no longer working on chromium
some nits, lgtm if you address them. https://codereview.chromium.org/29423003/diff/1490001/media/video/capture/fake_video_capture_device.h File media/video/capture/fake_video_capture_device.h (right): https://codereview.chromium.org/29423003/diff/1490001/media/video/capture/fake_video_capture_device.h#newcode68 media/video/capture/fake_video_capture_device.h:68: static int ...
7 years, 1 month ago (2013-11-13 16:20:20 UTC) #31
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/mcasas@chromium.org/29423003/1480004
7 years, 1 month ago (2013-11-14 16:07:19 UTC) #32
commit-bot: I haz the power
7 years, 1 month ago (2013-11-14 20:08:06 UTC) #33
Message was sent while issue was closed.
Change committed as 235223

Powered by Google App Engine
This is Rietveld 408576698