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

Issue 235353002: Extract VideoCaptureDeviceFactory out of VideoCaptureDevice and use for File and FakeVCD. (Closed)

Created:
6 years, 8 months ago by mcasas
Modified:
6 years, 7 months ago
CC:
chromium-reviews, fischman+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
Visibility:
Public.

Description

Extract VideoCaptureDeviceFactory out of VideoCaptureDevice and use for File and FakeVCD. VideoCaptureDeviceFactory is owned by VideoCaptureManager. VideoCaptureManager gets a VCDF on construction. This can be a real devices factory or a test one (Fake/File). All VCM operations previously static are now made through the Factory API regardless of the type. The previous MSM::UseFakeDevice() disappears and unittests MediaStreamDispatcherHostTest, MediaStreamManagerTest, VideoCaptureHostTest, add the --use-fake-device-for-media-stream flag to command line and depend on MSM reacting to it via injecting a fake factory to VCM on creation. Those tests also retrieve a weak reference to the Fake Factory to manipulate it. FakeVideoCapture::SetFailNextCreate() and associated member are removed, unused. BUG=323913 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=266380

Patch Set 1 : #

Total comments: 16

Patch Set 2 : perkj@s comments #

Total comments: 18

Patch Set 3 : perkj@s comments #

Total comments: 22

Patch Set 4 : tommi@s comments. FakeVCD PopulateFormatRoster() removed, the list comes from unit tests. #

Total comments: 21

Patch Set 5 : perkj@s comments #

Total comments: 6

Patch Set 6 : tommi@s nits #

Total comments: 2

Patch Set 7 : perkj@ nit #

Unified diffs Side-by-side diffs Delta from patch set Stats (+420 lines, -288 lines) Patch
M content/browser/renderer_host/media/audio_renderer_host_unittest.cc View 1 2 3 chunks +4 lines, -1 line 0 comments Download
M content/browser/renderer_host/media/media_stream_dispatcher_host_unittest.cc View 1 2 3 4 8 chunks +18 lines, -14 lines 0 comments Download
M content/browser/renderer_host/media/media_stream_manager.h View 1 2 2 chunks +3 lines, -5 lines 0 comments Download
M content/browser/renderer_host/media/media_stream_manager.cc View 1 2 3 4 5 3 chunks +21 lines, -11 lines 0 comments Download
M content/browser/renderer_host/media/media_stream_manager_unittest.cc View 1 2 2 chunks +6 lines, -5 lines 0 comments Download
M content/browser/renderer_host/media/video_capture_host_unittest.cc View 1 2 3 chunks +5 lines, -2 lines 0 comments Download
M content/browser/renderer_host/media/video_capture_manager.h View 1 2 3 4 6 chunks +12 lines, -16 lines 0 comments Download
M content/browser/renderer_host/media/video_capture_manager.cc View 1 2 7 chunks +9 lines, -56 lines 0 comments Download
M content/browser/renderer_host/media/video_capture_manager_unittest.cc View 1 2 3 4 5 6 7 chunks +13 lines, -8 lines 0 comments Download
M media/media.gyp View 1 2 2 chunks +6 lines, -0 lines 0 comments Download
M media/video/capture/fake_video_capture_device.h View 1 2 3 2 chunks +14 lines, -25 lines 0 comments Download
M media/video/capture/fake_video_capture_device.cc View 1 2 3 4 chunks +8 lines, -77 lines 0 comments Download
A media/video/capture/fake_video_capture_device_factory.h View 1 2 3 4 1 chunk +44 lines, -0 lines 0 comments Download
A media/video/capture/fake_video_capture_device_factory.cc View 1 2 3 4 5 1 chunk +51 lines, -0 lines 0 comments Download
M media/video/capture/file_video_capture_device.h View 2 chunks +8 lines, -10 lines 0 comments Download
M media/video/capture/file_video_capture_device.cc View 1 3 chunks +5 lines, -49 lines 0 comments Download
A media/video/capture/file_video_capture_device_factory.h View 1 2 3 4 1 chunk +31 lines, -0 lines 0 comments Download
A media/video/capture/file_video_capture_device_factory.cc View 1 2 3 1 chunk +64 lines, -0 lines 0 comments Download
A media/video/capture/video_capture_device_factory.h View 1 2 3 1 chunk +46 lines, -0 lines 0 comments Download
A media/video/capture/video_capture_device_factory.cc View 1 2 3 1 chunk +33 lines, -0 lines 0 comments Download
M media/video/capture/video_capture_device_unittest.cc View 1 2 3 8 chunks +19 lines, -9 lines 0 comments Download

Messages

Total messages: 23 (0 generated)
perkj_chrome
initial comments. https://codereview.chromium.org/235353002/diff/40001/content/browser/renderer_host/media/video_capture_manager.cc File content/browser/renderer_host/media/video_capture_manager.cc (right): https://codereview.chromium.org/235353002/diff/40001/content/browser/renderer_host/media/video_capture_manager.cc#newcode23 content/browser/renderer_host/media/video_capture_manager.cc:23: #include "media/video/capture/fake_video_capture_device_factory.h" You should not need these ...
6 years, 8 months ago (2014-04-15 09:34:00 UTC) #1
mcasas
perkj@ PTAL. As discussed offline, going Factory all the way with a factory-to-old-static-methods forwarding in ...
6 years, 8 months ago (2014-04-15 13:47:08 UTC) #2
mcasas
Adding tommi@ to reviewers.
6 years, 8 months ago (2014-04-16 20:12:30 UTC) #3
tommi (sloooow) - chröme
I have a few things to take care of before the weekend so I won't ...
6 years, 8 months ago (2014-04-17 07:37:58 UTC) #4
perkj_chrome
Nice cleanup. I think this will be great in the end. https://codereview.chromium.org/235353002/diff/100001/content/browser/renderer_host/media/media_stream_manager.cc File content/browser/renderer_host/media/media_stream_manager.cc (right): ...
6 years, 8 months ago (2014-04-17 08:39:09 UTC) #5
mcasas
perkj@ PTAL. The VCDF thread checker is hit in browser_tests, need to figure out why. ...
6 years, 8 months ago (2014-04-23 06:20:27 UTC) #6
tommi (sloooow) - chröme
a big improvement! https://codereview.chromium.org/235353002/diff/140001/content/browser/renderer_host/media/video_capture_manager_unittest.cc File content/browser/renderer_host/media/video_capture_manager_unittest.cc (right): https://codereview.chromium.org/235353002/diff/140001/content/browser/renderer_host/media/video_capture_manager_unittest.cc#newcode84 content/browser/renderer_host/media/video_capture_manager_unittest.cc:84: static_cast<media::FakeVideoCaptureDeviceFactory*>( indent https://codereview.chromium.org/235353002/diff/140001/media/video/capture/fake_video_capture_device_factory.cc File media/video/capture/fake_video_capture_device_factory.cc (right): ...
6 years, 8 months ago (2014-04-23 14:33:58 UTC) #7
mcasas
tommi@, perkj@ PTAL. A small area changed around FakeVCD::PopulateFormatsRoster(), since FakeVCD does not see its ...
6 years, 8 months ago (2014-04-23 15:13:29 UTC) #8
perkj_chrome
Very nice indeed. Some more comments. https://codereview.chromium.org/235353002/diff/180001/content/browser/renderer_host/media/media_stream_dispatcher_host_unittest.cc File content/browser/renderer_host/media/media_stream_dispatcher_host_unittest.cc (right): https://codereview.chromium.org/235353002/diff/180001/content/browser/renderer_host/media/media_stream_dispatcher_host_unittest.cc#newcode694 content/browser/renderer_host/media/media_stream_dispatcher_host_unittest.cc:694: video_capture_device_factory_->set_number_of_devices(number_of_fake_devices); No need ...
6 years, 8 months ago (2014-04-24 14:43:32 UTC) #9
mcasas
perkj@, tommi@ PTAL https://codereview.chromium.org/235353002/diff/180001/content/browser/renderer_host/media/media_stream_dispatcher_host_unittest.cc File content/browser/renderer_host/media/media_stream_dispatcher_host_unittest.cc (right): https://codereview.chromium.org/235353002/diff/180001/content/browser/renderer_host/media/media_stream_dispatcher_host_unittest.cc#newcode694 content/browser/renderer_host/media/media_stream_dispatcher_host_unittest.cc:694: video_capture_device_factory_->set_number_of_devices(number_of_fake_devices); On 2014/04/24 14:43:32, perkj wrote: ...
6 years, 8 months ago (2014-04-24 20:20:25 UTC) #10
tommi (sloooow) - chröme
lgtm https://codereview.chromium.org/235353002/diff/200001/content/browser/renderer_host/media/media_stream_manager.cc File content/browser/renderer_host/media/media_stream_manager.cc (right): https://codereview.chromium.org/235353002/diff/200001/content/browser/renderer_host/media/media_stream_manager.cc#newcode1454 content/browser/renderer_host/media/media_stream_manager.cc:1454: video_capture_manager_ = new VideoCaptureManager( too much indent https://codereview.chromium.org/235353002/diff/200001/content/browser/renderer_host/media/video_capture_manager_unittest.cc ...
6 years, 8 months ago (2014-04-24 21:14:10 UTC) #11
mcasas
perkj@ PTAL dalecurtis@: media/media.gyp (/PTAL if you feel inclined to it). https://codereview.chromium.org/235353002/diff/200001/content/browser/renderer_host/media/media_stream_manager.cc File content/browser/renderer_host/media/media_stream_manager.cc (right): ...
6 years, 8 months ago (2014-04-25 08:33:10 UTC) #12
perkj_chrome
LGTM https://codereview.chromium.org/235353002/diff/180001/media/video/capture/fake_video_capture_device_factory.cc File media/video/capture/fake_video_capture_device_factory.cc (right): https://codereview.chromium.org/235353002/diff/180001/media/video/capture/fake_video_capture_device_factory.cc#newcode16 media/video/capture/fake_video_capture_device_factory.cc:16: for (int32 n = 0; n < number_of_devices_; ...
6 years, 8 months ago (2014-04-25 08:43:30 UTC) #13
mcasas
On 2014/04/25 08:43:30, perkj wrote: > LGTM > > https://codereview.chromium.org/235353002/diff/180001/media/video/capture/fake_video_capture_device_factory.cc > File media/video/capture/fake_video_capture_device_factory.cc (right): > ...
6 years, 8 months ago (2014-04-25 08:56:47 UTC) #14
DaleCurtis
media.gyp lgtm
6 years, 8 months ago (2014-04-25 19:56:33 UTC) #15
mcasas
The CQ bit was checked by mcasas@chromium.org
6 years, 8 months ago (2014-04-25 20:13:48 UTC) #16
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/mcasas@chromium.org/235353002/240001
6 years, 8 months ago (2014-04-25 22:06:39 UTC) #17
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 8 months ago (2014-04-25 23:19:45 UTC) #18
commit-bot: I haz the power
Try jobs failed on following builders: tryserver.chromium on win_chromium_rel
6 years, 8 months ago (2014-04-25 23:19:45 UTC) #19
mcasas
The CQ bit was checked by mcasas@chromium.org
6 years, 8 months ago (2014-04-26 06:24:40 UTC) #20
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/mcasas@chromium.org/235353002/240001
6 years, 8 months ago (2014-04-26 06:25:42 UTC) #21
commit-bot: I haz the power
Change committed as 266380
6 years, 8 months ago (2014-04-26 22:15:55 UTC) #22
mcasas
6 years, 7 months ago (2014-04-28 15:01:19 UTC) #23
Message was sent while issue was closed.
Publishing drafts. Please ignore.

https://codereview.chromium.org/235353002/diff/220001/content/browser/rendere...
File content/browser/renderer_host/media/video_capture_manager_unittest.cc
(right):

https://codereview.chromium.org/235353002/diff/220001/content/browser/rendere...
content/browser/renderer_host/media/video_capture_manager_unittest.cc:147:
static const int32 kNumberOfFakeDevices = 2;
On 2014/04/25 08:43:31, perkj wrote:
> nit: This is only used once and can be declared just before use as const
int32.

Done.

Powered by Google App Engine
This is Rietveld 408576698