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

Issue 2673373003: getUserMeida: report device starting states (Closed)

Created:
3 years, 10 months ago by braveyao
Modified:
3 years, 9 months ago
Reviewers:
miu, dcheng, chfremer
CC:
chromium-reviews, mlamouri+watch-content_chromium.org, viettrungluu+watch_chromium.org, qsr+mojo_chromium.org, Aaron Boodman, posciak+watch_chromium.org, chfremer+watch_chromium.org, mac-reviews_chromium.org, jam, yzshen+watch_chromium.org, abarth-chromium, feature-media-reviews_chromium.org, darin-cc_chromium.org, mcasas+watch+vc_chromium.org, agrieve+watch_chromium.org, xjz+watch_chromium.org, darin (slow to review), miu+watch_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

getUserMeida: report device starting states Chromium used to report device started immediately at requesting user media, despite the device operation results. This causes several kinds of problems. - Notification of capture starting is shown before device starts. - gUM gets successful callback even if the device fails to start. So we decide to make gUM return the real device starting states (here we focus on the video capturing). This is the first part of the complete modification. The design doc is here, https://goo.gl/WTZkEl The complete CL is here, https://codereview.chromium.org/2658643002 This CL implements the device-started-state reporting part. Each device will report OnStarted event all the way back to VideoCaptureImpl when it's started successfully(Error report has been done already). This CL also includes all the necessary modifications due to the interface change. This CL will take no effect to getUserMedia behavior at present until another CL which will handle the OnStarted event is landed. BUG=674959, 651910 Review-Url: https://codereview.chromium.org/2673373003 Cr-Commit-Position: refs/heads/master@{#453388} Committed: https://chromium.googlesource.com/chromium/src/+/a18b95669ed38c0931818534ce17f131a006e476

Patch Set 1 #

Total comments: 34

Patch Set 2 : rebase to Feb 10 #

Patch Set 3 : address comments on PS#1 #

Total comments: 4

Patch Set 4 : address comments on PS#3 #

Total comments: 20

Patch Set 5 : rebase to Feb16 #

Patch Set 6 : address comments on PS#4 and revise unittests #

Total comments: 10

Patch Set 7 : address comments on PS#6 and restore added state check in frame callback. #

Total comments: 10

Patch Set 8 : address comments on PS#7 #

Total comments: 17

Patch Set 9 : rebase to Feb27 #

Patch Set 10 : address comments on PS#8 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+220 lines, -43 lines) Patch
M content/browser/media/capture/desktop_capture_device.cc View 1 2 3 4 5 6 7 8 1 chunk +2 lines, -0 lines 0 comments Download
M content/browser/media/capture/desktop_capture_device_aura_unittest.cc View 1 2 3 4 5 6 7 8 9 3 chunks +5 lines, -0 lines 0 comments Download
M content/browser/media/capture/desktop_capture_device_unittest.cc View 1 2 7 chunks +7 lines, -0 lines 0 comments Download
M content/browser/media/capture/screen_capture_device_android_unittest.cc View 1 2 3 4 5 6 7 8 9 3 chunks +5 lines, -0 lines 0 comments Download
M content/browser/media/capture/web_contents_video_capture_device_unittest.cc View 1 2 3 4 5 6 7 8 12 chunks +32 lines, -19 lines 0 comments Download
M content/browser/renderer_host/media/video_capture_controller.h View 1 2 3 4 5 6 7 8 1 chunk +1 line, -0 lines 0 comments Download
M content/browser/renderer_host/media/video_capture_controller.cc View 1 2 3 4 5 6 7 8 1 chunk +10 lines, -0 lines 0 comments Download
M content/browser/renderer_host/media/video_capture_controller_event_handler.h View 1 2 3 4 5 6 7 8 9 2 chunks +8 lines, -0 lines 0 comments Download
M content/browser/renderer_host/media/video_capture_controller_unittest.cc View 1 2 3 4 5 6 7 8 1 chunk +1 line, -0 lines 0 comments Download
M content/browser/renderer_host/media/video_capture_host.h View 1 2 3 4 5 6 7 8 1 chunk +1 line, -0 lines 0 comments Download
M content/browser/renderer_host/media/video_capture_host.cc View 1 2 3 4 5 6 7 8 2 chunks +12 lines, -5 lines 0 comments Download
M content/browser/renderer_host/media/video_capture_manager_unittest.cc View 1 2 3 4 5 6 7 8 11 chunks +11 lines, -0 lines 0 comments Download
M content/browser/renderer_host/media/video_capture_unittest.cc View 1 2 3 4 5 6 7 8 9 2 chunks +5 lines, -1 line 0 comments Download
M content/browser/renderer_host/media/video_frame_receiver_on_io_thread.h View 1 2 3 4 5 6 7 8 1 chunk +1 line, -0 lines 0 comments Download
M content/browser/renderer_host/media/video_frame_receiver_on_io_thread.cc View 1 2 3 4 5 6 7 8 1 chunk +6 lines, -0 lines 0 comments Download
M content/renderer/media/video_capture_impl.h View 2 chunks +8 lines, -8 lines 0 comments Download
M media/capture/content/android/java/src/org/chromium/media/ScreenCapture.java View 2 chunks +4 lines, -3 lines 0 comments Download
M media/capture/content/android/screen_capture_machine_android.cc View 1 2 3 4 5 2 chunks +9 lines, -3 lines 0 comments Download
M media/capture/content/screen_capture_device_core.cc View 1 2 3 4 2 chunks +3 lines, -1 line 0 comments Download
M media/capture/content/thread_safe_capture_oracle.h View 6 1 chunk +3 lines, -0 lines 0 comments Download
M media/capture/content/thread_safe_capture_oracle.cc View 1 2 3 4 5 6 7 8 1 chunk +6 lines, -0 lines 0 comments Download
M media/capture/video/android/java/src/org/chromium/media/VideoCapture.java View 1 chunk +3 lines, -0 lines 0 comments Download
M media/capture/video/android/java/src/org/chromium/media/VideoCaptureCamera.java View 1 2 3 4 5 6 7 2 chunks +9 lines, -1 line 0 comments Download
M media/capture/video/android/java/src/org/chromium/media/VideoCaptureCamera2.java View 1 2 3 4 5 6 1 chunk +1 line, -0 lines 0 comments Download
M media/capture/video/android/video_capture_device_android.h View 1 chunk +3 lines, -0 lines 0 comments Download
M media/capture/video/android/video_capture_device_android.cc View 1 chunk +6 lines, -0 lines 0 comments Download
M media/capture/video/fake_video_capture_device.cc View 1 2 3 4 5 6 7 8 2 chunks +2 lines, -0 lines 0 comments Download
M media/capture/video/fake_video_capture_device_unittest.cc View 1 2 3 4 5 6 7 8 5 chunks +7 lines, -1 line 0 comments Download
M media/capture/video/file_video_capture_device.cc View 6 1 chunk +1 line, -0 lines 0 comments Download
M media/capture/video/linux/v4l2_capture_delegate.cc View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download
M media/capture/video/linux/v4l2_capture_delegate_unittest.cc View 1 2 3 4 5 2 chunks +2 lines, -0 lines 0 comments Download
M media/capture/video/mac/video_capture_device_decklink_mac.h View 1 chunk +3 lines, -0 lines 0 comments Download
M media/capture/video/mac/video_capture_device_decklink_mac.mm View 6 2 chunks +10 lines, -0 lines 0 comments Download
M media/capture/video/mac/video_capture_device_mac.mm View 1 2 3 6 1 chunk +1 line, -0 lines 0 comments Download
M media/capture/video/video_capture_device.h View 1 2 3 4 5 6 7 8 2 chunks +8 lines, -1 line 0 comments Download
M media/capture/video/video_capture_device_client.h View 1 1 chunk +1 line, -0 lines 0 comments Download
M media/capture/video/video_capture_device_client.cc View 1 2 3 4 5 6 7 8 1 chunk +4 lines, -0 lines 0 comments Download
M media/capture/video/video_capture_device_client_unittest.cc View 1 2 3 4 5 6 7 8 1 chunk +1 line, -0 lines 0 comments Download
M media/capture/video/video_capture_device_unittest.cc View 1 2 3 4 5 6 7 8 6 chunks +6 lines, -0 lines 0 comments Download
M media/capture/video/video_frame_receiver.h View 1 2 3 4 5 6 7 8 1 chunk +1 line, -0 lines 0 comments Download
M media/capture/video/win/video_capture_device_mf_win.cc View 1 2 3 6 1 chunk +1 line, -0 lines 0 comments Download
M media/capture/video/win/video_capture_device_win.cc View 1 2 3 6 1 chunk +1 line, -0 lines 0 comments Download
M services/video_capture/public/interfaces/receiver.mojom View 1 chunk +1 line, -0 lines 0 comments Download
M services/video_capture/receiver_mojo_to_media_adapter.h View 1 2 3 4 5 6 7 8 1 chunk +1 line, -0 lines 0 comments Download
M services/video_capture/receiver_mojo_to_media_adapter.cc View 1 2 3 4 5 6 7 8 1 chunk +4 lines, -0 lines 0 comments Download
M services/video_capture/test/mock_receiver.h View 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 143 (108 generated)
braveyao
Hi, this cl is to report starting states of video capture devices to VideoCaptureImpl. Another ...
3 years, 10 months ago (2017-02-06 22:22:20 UTC) #6
miu
PS1 comments. I took a look at content/browser/media/capture/* and media/capture/*. There seem to be a ...
3 years, 10 months ago (2017-02-09 22:21:50 UTC) #7
chfremer
Looks good overall. My only concern is about tightening the contract a little bit to ...
3 years, 10 months ago (2017-02-09 23:34:52 UTC) #8
braveyao
Thanks so much for your comments! All addressed/responded. PTAL! miu@, all the device implementations have ...
3 years, 10 months ago (2017-02-14 01:05:49 UTC) #19
chfremer
A few more specific recommendations regarding the interface contracts. https://codereview.chromium.org/2673373003/diff/1/content/browser/renderer_host/media/video_capture_host.cc File content/browser/renderer_host/media/video_capture_host.cc (right): https://codereview.chromium.org/2673373003/diff/1/content/browser/renderer_host/media/video_capture_host.cc#newcode125 content/browser/renderer_host/media/video_capture_host.cc:125: ...
3 years, 10 months ago (2017-02-14 19:21:23 UTC) #22
braveyao
Hi miu@ and chfremer@, all comments addressed in PS#4. PTAL! https://codereview.chromium.org/2673373003/diff/1/content/browser/media/capture/desktop_capture_device_aura_unittest.cc File content/browser/media/capture/desktop_capture_device_aura_unittest.cc (right): https://codereview.chromium.org/2673373003/diff/1/content/browser/media/capture/desktop_capture_device_aura_unittest.cc#newcode59 ...
3 years, 10 months ago (2017-02-15 21:47:16 UTC) #43
chfremer
I have a couple more questions, especially about threading. https://codereview.chromium.org/2673373003/diff/1/content/browser/renderer_host/media/video_capture_unittest.cc File content/browser/renderer_host/media/video_capture_unittest.cc (right): https://codereview.chromium.org/2673373003/diff/1/content/browser/renderer_host/media/video_capture_unittest.cc#newcode249 content/browser/renderer_host/media/video_capture_unittest.cc:249: ...
3 years, 10 months ago (2017-02-16 01:00:50 UTC) #44
braveyao
Hi Chfremer@ & Miu@, all comments addressed/answered. PTAL. PS: I didn't really understand the MOCK_METHOD, ...
3 years, 10 months ago (2017-02-17 20:37:22 UTC) #73
chfremer
Most things look resolved. For the rest, I have follow-up questions. https://codereview.chromium.org/2673373003/diff/1/content/browser/renderer_host/media/video_capture_unittest.cc File content/browser/renderer_host/media/video_capture_unittest.cc (right): ...
3 years, 10 months ago (2017-02-17 23:51:15 UTC) #74
miu
https://codereview.chromium.org/2673373003/diff/250001/media/capture/content/thread_safe_capture_oracle.cc File media/capture/content/thread_safe_capture_oracle.cc (right): https://codereview.chromium.org/2673373003/diff/250001/media/capture/content/thread_safe_capture_oracle.cc#newcode230 media/capture/content/thread_safe_capture_oracle.cc:230: if (!client_ || !capture_) Dropping frames at this stage ...
3 years, 10 months ago (2017-02-18 01:18:46 UTC) #77
braveyao
On 2017/02/18 01:18:46, miu wrote: > https://codereview.chromium.org/2673373003/diff/250001/media/capture/content/thread_safe_capture_oracle.cc > File media/capture/content/thread_safe_capture_oracle.cc (right): > > https://codereview.chromium.org/2673373003/diff/250001/media/capture/content/thread_safe_capture_oracle.cc#newcode230 > ...
3 years, 10 months ago (2017-02-18 02:04:54 UTC) #78
chfremer
On 2017/02/18 02:04:54, braveyao wrote: > On 2017/02/18 01:18:46, miu wrote: > > > https://codereview.chromium.org/2673373003/diff/250001/media/capture/content/thread_safe_capture_oracle.cc ...
3 years, 10 months ago (2017-02-18 02:32:26 UTC) #81
braveyao
On 2017/02/18 02:32:26, chfremer wrote: > On 2017/02/18 02:04:54, braveyao wrote: > > On 2017/02/18 ...
3 years, 10 months ago (2017-02-18 19:05:37 UTC) #82
miu
On 2017/02/18 02:32:26, chfremer wrote: > 1.) We could take the first arriving frame as ...
3 years, 10 months ago (2017-02-18 21:43:21 UTC) #83
miu
On 2017/02/18 19:05:37, braveyao wrote: > Ah, I got an idea: > Keep VCD as ...
3 years, 10 months ago (2017-02-18 21:49:03 UTC) #84
braveyao
On 2017/02/18 21:49:03, miu wrote: > On 2017/02/18 19:05:37, braveyao wrote: > > Ah, I ...
3 years, 10 months ago (2017-02-21 18:41:23 UTC) #91
chfremer
On 2017/02/21 18:41:23, braveyao wrote: > On 2017/02/18 21:49:03, miu wrote: > > On 2017/02/18 ...
3 years, 10 months ago (2017-02-21 22:24:08 UTC) #94
braveyao
PS#7 is based on the final decision made. PTAL! https://codereview.chromium.org/2673373003/diff/1/content/browser/renderer_host/media/video_capture_unittest.cc File content/browser/renderer_host/media/video_capture_unittest.cc (right): https://codereview.chromium.org/2673373003/diff/1/content/browser/renderer_host/media/video_capture_unittest.cc#newcode251 content/browser/renderer_host/media/video_capture_unittest.cc:251: ...
3 years, 10 months ago (2017-02-22 18:06:44 UTC) #100
chfremer
Overall I think this approach should work well. Just two more code questions and a ...
3 years, 10 months ago (2017-02-22 19:13:58 UTC) #101
braveyao
Hi chfremer@, thanks for the suggestions. All addressed. PTAL! https://codereview.chromium.org/2673373003/diff/320001/content/browser/renderer_host/media/video_capture_controller.cc File content/browser/renderer_host/media/video_capture_controller.cc (right): https://codereview.chromium.org/2673373003/diff/320001/content/browser/renderer_host/media/video_capture_controller.cc#newcode476 content/browser/renderer_host/media/video_capture_controller.cc:476: ...
3 years, 10 months ago (2017-02-23 00:06:26 UTC) #107
chfremer
PS8 lgtm % comment for VideoCaptureCamera.java Thanks for putting in the effort to address all ...
3 years, 10 months ago (2017-02-23 17:49:53 UTC) #110
braveyao
Thanks chfremer@ for all the help here. Learnt a lot :) And the comment is ...
3 years, 10 months ago (2017-02-23 18:08:09 UTC) #111
chfremer
https://codereview.chromium.org/2673373003/diff/360001/media/capture/video/android/java/src/org/chromium/media/VideoCaptureCamera.java File media/capture/video/android/java/src/org/chromium/media/VideoCaptureCamera.java (right): https://codereview.chromium.org/2673373003/diff/360001/media/capture/video/android/java/src/org/chromium/media/VideoCaptureCamera.java#newcode418 media/capture/video/android/java/src/org/chromium/media/VideoCaptureCamera.java:418: mIsRunning = true; On 2017/02/23 18:08:09, braveyao wrote: > ...
3 years, 10 months ago (2017-02-23 19:07:08 UTC) #112
miu
On 2017/02/21 18:41:23, braveyao wrote: > Another reason that OnStarted() is necessary is because devices ...
3 years, 10 months ago (2017-02-24 22:15:46 UTC) #113
miu
Was about to sign-off in this, but there seems to be a threading issue in ...
3 years, 10 months ago (2017-02-24 22:16:45 UTC) #114
chfremer
https://codereview.chromium.org/2673373003/diff/360001/media/capture/video/video_capture_device.h File media/capture/video/video_capture_device.h (right): https://codereview.chromium.org/2673373003/diff/360001/media/capture/video/video_capture_device.h#newcode90 media/capture/video/video_capture_device.h:90: // (OnStarted, OnLog, OnError) may be called concurrently. On ...
3 years, 10 months ago (2017-02-24 22:25:35 UTC) #115
braveyao
Hi miu@, thanks for the concern. Please check the answers. And I've tried the refreshframe ...
3 years, 10 months ago (2017-02-24 22:53:37 UTC) #116
miu
lgtm https://codereview.chromium.org/2673373003/diff/360001/media/capture/video/video_capture_device.h File media/capture/video/video_capture_device.h (right): https://codereview.chromium.org/2673373003/diff/360001/media/capture/video/video_capture_device.h#newcode90 media/capture/video/video_capture_device.h:90: // (OnStarted, OnLog, OnError) may be called concurrently. ...
3 years, 10 months ago (2017-02-24 23:02:22 UTC) #117
braveyao
+ dcheng@, for OWNER's review to services/video_capture/public/interfaces/receiver.mojom. Thanks a lot!
3 years, 10 months ago (2017-02-24 23:25:36 UTC) #119
dcheng
LGTM with nits addressed Also, please fix typos in CL description meida => media, foucs ...
3 years, 10 months ago (2017-02-25 07:27:04 UTC) #120
braveyao
Thanks so much dcheng@. All comments addressed/answered. https://codereview.chromium.org/2673373003/diff/360001/content/browser/media/capture/web_contents_video_capture_device_unittest.cc File content/browser/media/capture/web_contents_video_capture_device_unittest.cc (right): https://codereview.chromium.org/2673373003/diff/360001/content/browser/media/capture/web_contents_video_capture_device_unittest.cc#newcode638 content/browser/media/capture/web_contents_video_capture_device_unittest.cc:638: auto client ...
3 years, 9 months ago (2017-02-27 23:18:54 UTC) #135
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2673373003/420001
3 years, 9 months ago (2017-02-27 23:19:41 UTC) #138
dcheng
https://codereview.chromium.org/2673373003/diff/360001/media/capture/video/fake_video_capture_device_unittest.cc File media/capture/video/fake_video_capture_device_unittest.cc (right): https://codereview.chromium.org/2673373003/diff/360001/media/capture/video/fake_video_capture_device_unittest.cc#newcode556 media/capture/video/fake_video_capture_device_unittest.cc:556: auto client = CreateClient(); On 2017/02/27 23:18:53, braveyao wrote: ...
3 years, 9 months ago (2017-02-27 23:22:31 UTC) #139
commit-bot: I haz the power
Committed patchset #10 (id:420001) as https://chromium.googlesource.com/chromium/src/+/a18b95669ed38c0931818534ce17f131a006e476
3 years, 9 months ago (2017-02-27 23:30:06 UTC) #142
braveyao
3 years, 9 months ago (2017-02-28 23:57:23 UTC) #143
Message was sent while issue was closed.
https://codereview.chromium.org/2673373003/diff/360001/media/capture/video/fa...
File media/capture/video/fake_video_capture_device_unittest.cc (right):

https://codereview.chromium.org/2673373003/diff/360001/media/capture/video/fa...
media/capture/video/fake_video_capture_device_unittest.cc:556: auto client =
CreateClient();
On 2017/02/27 23:22:31, dcheng wrote:
> On 2017/02/27 23:18:53, braveyao wrote:
> > On 2017/02/25 07:27:03, dcheng wrote:
> > > Ditto about auto: it's not really obvious what CreateClient() is
returning,
> > IMO.
> > 
> > auto is used a lot in this unittest. And in this cl the only purpose is to
add
> a
> > EXPECT_CALL to client obj. Its type is not the concern here.
> > So I think it's OK.
> 
> I understand that, but I think the style in this rest of this file is probably
> wrong (it should not be using auto, per our style guidelines). It'd be OK to
> address in a followup, if you want to keep consistency.

Acknowledged.
Addressed in the following up cl. Will add you as reviewer soon.

Powered by Google App Engine
This is Rietveld 408576698