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

Issue 2686763002: [Mojo Video Capture] Split OnIncomingCapturedVideoFrame() to OnNewBuffer() and OnFrameReadyInBuffer( (Closed)

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

Description

[Mojo Video Capture] Split OnIncomingCapturedVideoFrame() to OnNewBuffer() and OnFrameReadyInBuffer() In interface media::VideoFrameReceiver, instead of method OnIncomingCapturedVideoFrame() use two methods OnNewBufferHandle() and OnFrameReadyInBuffer(). This matches the Mojo interface exposed to the Renderers by VideoCaptureHost. Instead of requiring the VideoFrameReceiver implementation (VideoCaptureController) to set and release a consumer hold, we pass in a |buffer_read_permission| that encapsulates the hold using the RAII pattern. This allows us to remove the |frame_buffer_pool_| member from VideoCaptureController. Use struct mojom::VideoFrameInfo when receiving frames as media::VideoFrameReceiver (e.g. VideoCaptureController). This will allow us to have it receive frames from the Mojo service in a later step. This required some changes in media/capture/BUILD.gn, because the component formerly named "capture" (now renamed to "capture_lib") now depends on media/capture/mojo:capture_types, which in turn depends on classes formerly part of "capture". I moved these classes to a new component "capture_base". Since it had to be updated, freed video_capture_device_client_unittest.cc from unnecessary context, which allowed moving it from content/ to media/capture/video, which is where the class under test lives. This CL is part of the Mojo Video Capture work. For the bigger picture, see [1] CL11b BUG=584797 TEST= content_unittests --gtest_filter="*Video*", capture_unittests --gtest_filter="VideoCaptureDeviceClientTest*" Apprtc loopback on Debug, Desktop Capture Example extension on Release On Android content_shell, run video capture sample from [2], put to background, then restore from background. [1] https://docs.google.com/a/chromium.org/document/d/1Qw7rw1AJy0QHXjha36jZNiEuxsxWslJ_X-zpOhijvI8/edit?usp=sharing [2] https://webrtc.github.io/samples/src/content/getusermedia/gum/ Review-Url: https://codereview.chromium.org/2686763002 Cr-Commit-Position: refs/heads/master@{#452548} Committed: https://chromium.googlesource.com/chromium/src/+/e09db164377ade3a5559dd9b1fae1f47756894b0

Patch Set 1 #

Total comments: 26

Patch Set 2 : miu@ comments #

Patch Set 3 : Remove unused bool accidentally introduced in PS2 #

Total comments: 4

Patch Set 4 : Rebase #

Patch Set 5 : Move CloneTraits to right location. #

Total comments: 2

Patch Set 6 : Move CloneTraits out of namespace internal #

Patch Set 7 : Put clone_traits.h in component "bindings" instead of source_set "struct_traits" #

Total comments: 14

Patch Set 8 : mcasas@ suggestions #

Total comments: 4

Patch Set 9 : mcasas@ suggestions mk2 #

Patch Set 10 : rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+516 lines, -1088 lines) Patch
M content/browser/media/capture/web_contents_video_capture_device_unittest.cc View 1 2 3 1 chunk +1 line, -2 lines 0 comments Download
M content/browser/renderer_host/media/video_capture_controller.h View 1 2 3 4 5 6 7 8 8 chunks +28 lines, -57 lines 0 comments Download
M content/browser/renderer_host/media/video_capture_controller.cc View 1 2 3 4 5 6 7 8 10 chunks +78 lines, -103 lines 0 comments Download
M content/browser/renderer_host/media/video_capture_controller_event_handler.h View 1 2 chunks +5 lines, -3 lines 0 comments Download
M content/browser/renderer_host/media/video_capture_controller_unittest.cc View 1 12 chunks +36 lines, -74 lines 0 comments Download
D content/browser/renderer_host/media/video_capture_device_client_unittest.cc View 1 chunk +0 lines, -258 lines 0 comments Download
M content/browser/renderer_host/media/video_capture_gpu_jpeg_decoder.cc View 1 2 chunks +15 lines, -5 lines 0 comments Download
M content/browser/renderer_host/media/video_capture_host.h View 1 1 chunk +4 lines, -3 lines 0 comments Download
M content/browser/renderer_host/media/video_capture_host.cc View 1 2 3 4 3 chunks +3 lines, -13 lines 0 comments Download
M content/browser/renderer_host/media/video_capture_manager.h View 1 2 3 4 5 6 7 8 9 1 chunk +0 lines, -1 line 0 comments Download
M content/browser/renderer_host/media/video_capture_manager.cc View 1 2 3 4 5 6 7 8 9 8 chunks +13 lines, -49 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 1 chunk +4 lines, -3 lines 0 comments Download
M content/browser/renderer_host/media/video_frame_receiver_on_io_thread.h View 1 chunk +12 lines, -4 lines 0 comments Download
M content/browser/renderer_host/media/video_frame_receiver_on_io_thread.cc View 1 chunk +27 lines, -11 lines 0 comments Download
M content/test/BUILD.gn View 1 2 3 4 5 6 7 8 9 1 chunk +0 lines, -1 line 0 comments Download
M media/base/BUILD.gn View 1 2 3 4 5 6 7 8 9 1 chunk +0 lines, -3 lines 0 comments Download
M media/capture/BUILD.gn View 5 chunks +34 lines, -17 lines 0 comments Download
M media/capture/content/thread_safe_capture_oracle.cc View 1 2 chunks +3 lines, -3 lines 0 comments Download
M media/capture/mojo/OWNERS View 1 chunk +2 lines, -0 lines 0 comments Download
M media/capture/mojo/video_capture_types.typemap View 1 chunk +1 line, -0 lines 0 comments Download
M media/capture/video/fake_video_capture_device.cc View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -1 line 0 comments Download
M media/capture/video/video_capture_device.h View 1 3 chunks +8 lines, -22 lines 0 comments Download
M media/capture/video/video_capture_device.cc View 1 1 chunk +5 lines, -5 lines 0 comments Download
M media/capture/video/video_capture_device_client.cc View 1 2 3 4 5 6 7 8 7 chunks +51 lines, -33 lines 0 comments Download
A + media/capture/video/video_capture_device_client_unittest.cc View 9 chunks +78 lines, -69 lines 0 comments Download
M media/capture/video/video_capture_jpeg_decoder.h View 2 chunks +8 lines, -3 lines 0 comments Download
M media/capture/video/video_frame_receiver.h View 1 2 chunks +32 lines, -10 lines 0 comments Download
M media/capture/video_capture_types.h View 1 chunk +1 line, -1 line 0 comments Download
M mojo/common/values_struct_traits.h View 1 2 3 4 5 2 chunks +7 lines, -0 lines 0 comments Download
M mojo/common/values_struct_traits.cc View 1 2 3 4 5 1 chunk +8 lines, -0 lines 0 comments Download
M mojo/public/cpp/bindings/BUILD.gn View 1 2 3 4 5 6 7 8 9 2 chunks +2 lines, -1 line 0 comments Download
A + mojo/public/cpp/bindings/clone_traits.h View 1 2 3 4 5 7 chunks +9 lines, -84 lines 0 comments Download
M mojo/public/cpp/bindings/lib/clone_equals_util.h View 1 2 3 4 5 1 chunk +0 lines, -161 lines 0 comments Download
A + mojo/public/cpp/bindings/lib/equals_traits.h View 1 2 3 4 5 3 chunks +3 lines, -70 lines 0 comments Download
M mojo/public/cpp/bindings/lib/wtf_clone_equals_util.h View 1 2 3 4 5 3 chunks +6 lines, -4 lines 0 comments Download
M mojo/public/tools/bindings/generators/cpp_templates/module.h.tmpl View 1 2 3 4 5 1 chunk +2 lines, -1 line 0 comments Download
M mojo/public/tools/bindings/generators/cpp_templates/wrapper_class_template_definition.tmpl View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M mojo/public/tools/bindings/generators/cpp_templates/wrapper_union_class_template_definition.tmpl View 1 2 3 4 5 1 chunk +2 lines, -2 lines 0 comments Download
M services/video_capture/receiver_mojo_to_media_adapter.h View 1 chunk +12 lines, -4 lines 0 comments Download
M services/video_capture/receiver_mojo_to_media_adapter.cc View 2 chunks +14 lines, -6 lines 0 comments Download

Dependent Patchsets:

Messages

Total messages: 82 (55 generated)
chfremer
miu@: PTAL mcasas@: PTAL
3 years, 10 months ago (2017-02-08 18:33:27 UTC) #12
chfremer
On 2017/02/08 18:33:27, chfremer wrote: > miu@: PTAL > mcasas@: PTAL ping
3 years, 10 months ago (2017-02-13 21:33:00 UTC) #15
miu
Sorry. I was waiting for mcasas@ to make comments first, as he was a part ...
3 years, 10 months ago (2017-02-13 23:47:20 UTC) #16
miu
Comments on PS1: https://codereview.chromium.org/2686763002/diff/30001/content/browser/renderer_host/media/video_capture_controller.cc File content/browser/renderer_host/media/video_capture_controller.cc (right): https://codereview.chromium.org/2686763002/diff/30001/content/browser/renderer_host/media/video_capture_controller.cc#newcode49 content/browser/renderer_host/media/video_capture_controller.cc:49: // This manual copy routine is ...
3 years, 10 months ago (2017-02-14 00:41:28 UTC) #17
chfremer
PTAL Addressed miu@ comments. https://codereview.chromium.org/2686763002/diff/30001/content/browser/renderer_host/media/video_capture_controller.cc File content/browser/renderer_host/media/video_capture_controller.cc (right): https://codereview.chromium.org/2686763002/diff/30001/content/browser/renderer_host/media/video_capture_controller.cc#newcode49 content/browser/renderer_host/media/video_capture_controller.cc:49: // This manual copy routine ...
3 years, 10 months ago (2017-02-14 21:15:16 UTC) #20
chfremer
rockot@: Please review changes in mojo/public/cpp. I added a template specialization for CloneTraits to support ...
3 years, 10 months ago (2017-02-14 21:17:29 UTC) #22
miu
PS3 lgtm (but I'll defer to rockot@ on the CloneTraits for base::DictionaryValue). https://codereview.chromium.org/2686763002/diff/70001/content/browser/renderer_host/media/video_capture_controller.h File content/browser/renderer_host/media/video_capture_controller.h ...
3 years, 10 months ago (2017-02-15 22:15:00 UTC) #29
Ken Rockot(use gerrit already)
On 2017/02/14 at 21:17:29, chfremer wrote: > rockot@: Please review changes in mojo/public/cpp. > > ...
3 years, 10 months ago (2017-02-15 22:20:34 UTC) #30
chfremer
On 2017/02/15 22:20:34, Ken Rockot wrote: > On 2017/02/14 at 21:17:29, chfremer wrote: > > ...
3 years, 10 months ago (2017-02-15 22:34:11 UTC) #31
Ken Rockot(use gerrit already)
On 2017/02/15 at 22:34:11, chfremer wrote: > On 2017/02/15 22:20:34, Ken Rockot wrote: > > ...
3 years, 10 months ago (2017-02-15 22:39:37 UTC) #32
chfremer
On 2017/02/15 22:39:37, Ken Rockot wrote: > On 2017/02/15 at 22:34:11, chfremer wrote: > > ...
3 years, 10 months ago (2017-02-15 23:24:21 UTC) #34
Ken Rockot(use gerrit already)
On Wed, Feb 15, 2017 at 3:24 PM, <chfremer@chromium.org> wrote: > On 2017/02/15 22:39:37, Ken ...
3 years, 10 months ago (2017-02-15 23:37:00 UTC) #35
Ken Rockot(use gerrit already)
Actually adding yzshen to the reviewer list to make sure he sees this. Yuzhu please ...
3 years, 10 months ago (2017-02-16 05:23:57 UTC) #37
yzshen1
On 2017/02/16 05:23:57, Ken Rockot wrote: > Actually adding yzshen to the reviewer list to ...
3 years, 10 months ago (2017-02-16 07:26:28 UTC) #38
yzshen1
I looked at the code a little closer. How about: 1) move CloneTraits out of ...
3 years, 10 months ago (2017-02-16 17:23:17 UTC) #39
chfremer
yzshen@: PTAL I moved CloneTraits out of the namespace internal. https://codereview.chromium.org/2686763002/diff/130001/mojo/public/cpp/bindings/lib/clone_equals_util.h File mojo/public/cpp/bindings/lib/clone_equals_util.h (right): https://codereview.chromium.org/2686763002/diff/130001/mojo/public/cpp/bindings/lib/clone_equals_util.h#newcode15 ...
3 years, 10 months ago (2017-02-16 18:15:50 UTC) #42
yzshen1
The changes regarding CloneTraits LGTM
3 years, 10 months ago (2017-02-16 18:36:11 UTC) #45
mcasas
Looking good, a few comments/suggestions. https://codereview.chromium.org/2686763002/diff/170001/content/browser/renderer_host/media/video_capture_controller.cc File content/browser/renderer_host/media/video_capture_controller.cc (right): https://codereview.chromium.org/2686763002/diff/170001/content/browser/renderer_host/media/video_capture_controller.cc#newcode149 content/browser/renderer_host/media/video_capture_controller.cc:149: } Agree with miu@, ...
3 years, 10 months ago (2017-02-16 22:35:56 UTC) #50
chfremer
mcasas@: PTAL Incorporated most of the suggestions. https://codereview.chromium.org/2686763002/diff/70001/content/browser/renderer_host/media/video_capture_controller.h File content/browser/renderer_host/media/video_capture_controller.h (right): https://codereview.chromium.org/2686763002/diff/70001/content/browser/renderer_host/media/video_capture_controller.h#newcode137 content/browser/renderer_host/media/video_capture_controller.h:137: bool HasZeroConsumerHoldCount() ...
3 years, 10 months ago (2017-02-16 23:37:57 UTC) #51
mcasas
lgtm % tiny comments https://codereview.chromium.org/2686763002/diff/190001/content/browser/renderer_host/media/video_capture_controller.h File content/browser/renderer_host/media/video_capture_controller.h (right): https://codereview.chromium.org/2686763002/diff/190001/content/browser/renderer_host/media/video_capture_controller.h#newcode137 content/browser/renderer_host/media/video_capture_controller.h:137: bool has_consumers() const { return ...
3 years, 10 months ago (2017-02-16 23:45:08 UTC) #54
chfremer
xhwang@: please RS media/base/BUILD.gn tsepez@: please RS media/capture/mojo/* and mojo/common/* https://codereview.chromium.org/2686763002/diff/190001/content/browser/renderer_host/media/video_capture_controller.h File content/browser/renderer_host/media/video_capture_controller.h (right): https://codereview.chromium.org/2686763002/diff/190001/content/browser/renderer_host/media/video_capture_controller.h#newcode137 ...
3 years, 10 months ago (2017-02-16 23:57:20 UTC) #56
Tom Sepez
RS LGTM
3 years, 10 months ago (2017-02-17 00:45:09 UTC) #57
xhwang
media/base/BUILD.gn LGTM, thank for the clean-up!
3 years, 10 months ago (2017-02-21 20:52:35 UTC) #58
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/2686763002/210001
3 years, 10 months ago (2017-02-22 17:12:30 UTC) #69
commit-bot: I haz the power
Failed to apply patch for media/capture/video/fake_video_capture_device.cc: While running git apply --index -p1; error: patch failed: ...
3 years, 10 months ago (2017-02-22 20:07:10 UTC) #71
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/2686763002/230001
3 years, 10 months ago (2017-02-23 17:51:41 UTC) #78
commit-bot: I haz the power
3 years, 10 months ago (2017-02-23 18:03:40 UTC) #82
Message was sent while issue was closed.
Committed patchset #10 (id:230001) as
https://chromium.googlesource.com/chromium/src/+/e09db164377ade3a5559dd9b1fae...

Powered by Google App Engine
This is Rietveld 408576698