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

Issue 2620763003: Reland [Mojo Video Capture] Simplify media::VideoCaptureDevice::Client:Buffer to a struct (Closed)

Created:
3 years, 11 months ago by chfremer
Modified:
3 years, 11 months ago
Reviewers:
mcasas, miu
CC:
chromium-reviews, qsr+mojo_chromium.org, Aaron Boodman, posciak+watch_chromium.org, chfremer+watch_chromium.org, viettrungluu+watch_chromium.org, jam, yzshen+watch_chromium.org, abarth-chromium, feature-media-reviews_chromium.org, darin-cc_chromium.org, mcasas+watch+vc_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

Reland [Mojo Video Capture] Simplify media::VideoCaptureDevice::Client:Buffer to a struct PatchSet#1 is the state as previously reviewed, landed, reverted, and merged with the fix from https://codereview.chromium.org/2621743002/. PatchSet#2: Because the original CL introduced another new SharedMemoryHandle-not-getting-closed issue, this PatchSet has the fix for this. Instead of fixing this by attaching ownership of the handle to a VideoFrame, I decided to instead add a method GetNonOwnedSharedMemoryHandleForLegacyIPC() to interface VideoCaptureDevice::Client::Buffer::HandleProvider. This allows us to avoid the otherwise introduced extra step of wrapping/unwrapping a new file handle copy. Description of original CL: In interface media::VideoCaptureDevice::Client, change interface Buffer to a move-only struct. The new struct separates the concerns of providing access handles (for in-process as well as for inter-process transit) from access permissions. This allows clients to explicitly obtain in-process memory-mapped handles when they need it. Clients who only want to pass along the buffer or move it across process boundaries do not need memory-mapped handles. In interface media::VideoCaptureBufferPool, renamed GetBufferHandle() -> GetHandleForInProcessAccess() GetHandleForTransit() -> GetHandleForInterProcessTransit(). Removed outdated implementation in video_capture Mojo service. We leave the implementation empty, until refactoring the interfaces has been completed. This CL is part of the Mojo Video Capture work. For the bigger picture, see [1] CL1.9.10 For a peek at the follow-up CLs, please see https://codereview.chromium.org/2607203002/ https://codereview.chromium.org/2602983002/ BUG=584797 TEST= content_unittests --gtest_filter="*Video*", video_capture_unittests, Apprtc loopback on Debug, Desktop Capture Example extension on Release [1] https://docs.google.com/a/chromium.org/document/d/1Qw7rw1AJy0QHXjha36jZNiEuxsxWslJ_X-zpOhijvI8/edit?usp=sharing Review-Url: https://codereview.chromium.org/2573223002 Cr-Original-Commit-Position: refs/heads/master@{#442066} Committed: https://chromium.googlesource.com/chromium/src/+/e1aac992b0399db7776661f4ac2c43094c265de7 Review-Url: https://codereview.chromium.org/2620763003 Cr-Commit-Position: refs/heads/master@{#444191} Committed: https://chromium.googlesource.com/chromium/src/+/03c86be79f1ccae3c1923d1cff9106d15abdbf21

Patch Set 1 #

Patch Set 2 : Let Buffer::HandleProvider provide a handle for legacy IPC instead of requiring wrapping/unwrapping. #

Total comments: 5

Patch Set 3 : Merge-in changes from upstream #

Unified diffs Side-by-side diffs Delta from patch set Stats (+562 lines, -821 lines) Patch
M content/browser/media/capture/desktop_capture_device_aura_unittest.cc View 2 chunks +12 lines, -13 lines 0 comments Download
M content/browser/media/capture/desktop_capture_device_unittest.cc View 1 chunk +17 lines, -18 lines 0 comments Download
M content/browser/media/capture/screen_capture_device_android_unittest.cc View 1 chunk +17 lines, -18 lines 0 comments Download
M content/browser/media/capture/web_contents_video_capture_device_unittest.cc View 6 chunks +23 lines, -68 lines 0 comments Download
M content/browser/renderer_host/media/video_capture_buffer_pool_unittest.cc View 3 chunks +4 lines, -4 lines 0 comments Download
M content/browser/renderer_host/media/video_capture_controller.h View 1 2 4 chunks +4 lines, -13 lines 0 comments Download
M content/browser/renderer_host/media/video_capture_controller.cc View 1 2 6 chunks +17 lines, -31 lines 0 comments Download
M content/browser/renderer_host/media/video_capture_controller_unittest.cc View 12 chunks +96 lines, -132 lines 0 comments Download
M content/browser/renderer_host/media/video_capture_device_client_unittest.cc View 1 chunk +1 line, -1 line 0 comments Download
M content/browser/renderer_host/media/video_capture_gpu_jpeg_decoder.h View 1 chunk +1 line, -2 lines 0 comments Download
M content/browser/renderer_host/media/video_capture_gpu_jpeg_decoder.cc View 1 4 chunks +17 lines, -15 lines 0 comments Download
M content/browser/renderer_host/media/video_capture_manager.cc View 1 2 2 chunks +1 line, -5 lines 0 comments Download
M content/browser/renderer_host/media/video_frame_receiver_on_io_thread.h View 1 chunk +1 line, -1 line 0 comments Download
M content/browser/renderer_host/media/video_frame_receiver_on_io_thread.cc View 1 chunk +1 line, -1 line 0 comments Download
M media/capture/content/thread_safe_capture_oracle.h View 1 chunk +7 lines, -8 lines 0 comments Download
M media/capture/content/thread_safe_capture_oracle.cc View 5 chunks +10 lines, -9 lines 0 comments Download
M media/capture/video/fake_video_capture_device.cc View 1 chunk +9 lines, -6 lines 0 comments Download
M media/capture/video/fake_video_capture_device_unittest.cc View 1 3 chunks +66 lines, -35 lines 0 comments Download
M media/capture/video/linux/v4l2_capture_delegate_unittest.cc View 3 chunks +9 lines, -11 lines 0 comments Download
M media/capture/video/shared_memory_buffer_tracker.h View 1 2 chunks +4 lines, -8 lines 0 comments Download
M media/capture/video/shared_memory_buffer_tracker.cc View 1 2 chunks +10 lines, -20 lines 0 comments Download
M media/capture/video/video_capture_buffer_handle.h View 1 chunk +2 lines, -7 lines 0 comments Download
M media/capture/video/video_capture_buffer_pool.h View 1 1 chunk +7 lines, -3 lines 0 comments Download
M media/capture/video/video_capture_buffer_pool_impl.h View 1 1 chunk +5 lines, -2 lines 0 comments Download
M media/capture/video/video_capture_buffer_pool_impl.cc View 1 2 chunks +18 lines, -6 lines 0 comments Download
M media/capture/video/video_capture_buffer_tracker.h View 1 1 chunk +3 lines, -3 lines 0 comments Download
M media/capture/video/video_capture_device.h View 1 2 6 chunks +54 lines, -28 lines 0 comments Download
M media/capture/video/video_capture_device.cc View 1 chunk +20 lines, -4 lines 0 comments Download
M media/capture/video/video_capture_device_client.h View 2 chunks +20 lines, -28 lines 0 comments Download
M media/capture/video/video_capture_device_client.cc View 1 11 chunks +83 lines, -73 lines 0 comments Download
M media/capture/video/video_capture_device_unittest.cc View 2 chunks +12 lines, -13 lines 0 comments Download
M media/capture/video/video_capture_jpeg_decoder.h View 2 chunks +4 lines, -5 lines 0 comments Download
M media/capture/video/video_frame_receiver.h View 1 chunk +1 line, -1 line 0 comments Download
M services/video_capture/BUILD.gn View 1 chunk +0 lines, -6 lines 0 comments Download
D services/video_capture/buffer_tracker_factory_impl.h View 1 chunk +0 lines, -26 lines 0 comments Download
D services/video_capture/buffer_tracker_factory_impl.cc View 1 chunk +0 lines, -22 lines 0 comments Download
M services/video_capture/device_media_to_mojo_adapter.cc View 2 chunks +3 lines, -2 lines 0 comments Download
D services/video_capture/mojo_shared_memory_buffer_handle.h View 1 chunk +0 lines, -35 lines 0 comments Download
D services/video_capture/mojo_shared_memory_buffer_handle.cc View 1 chunk +0 lines, -45 lines 0 comments Download
D services/video_capture/mojo_shared_memory_buffer_tracker.h View 1 chunk +0 lines, -37 lines 0 comments Download
D services/video_capture/mojo_shared_memory_buffer_tracker.cc View 1 chunk +0 lines, -50 lines 0 comments Download
M services/video_capture/receiver_mojo_to_media_adapter.h View 1 chunk +1 line, -1 line 0 comments Download
M services/video_capture/receiver_mojo_to_media_adapter.cc View 1 chunk +2 lines, -5 lines 0 comments Download

Depends on Patchset:

Dependent Patchsets:

Messages

Total messages: 26 (17 generated)
chfremer
miu@: PTAL mcasas@: PTAL This is a reland with a small fix added on top.
3 years, 11 months ago (2017-01-11 17:50:35 UTC) #8
mcasas
lgtm and looking forward to removing all this duplication mojo-ipc ASAP. https://codereview.chromium.org/2620763003/diff/20001/media/capture/video/shared_memory_buffer_tracker.cc File media/capture/video/shared_memory_buffer_tracker.cc (right): ...
3 years, 11 months ago (2017-01-12 00:25:26 UTC) #9
chfremer
ping miu@: Please RS
3 years, 11 months ago (2017-01-12 23:49:19 UTC) #10
miu
lgtm. Apologies for the delays (branch point coming up and all!). https://codereview.chromium.org/2620763003/diff/20001/media/capture/video/video_capture_buffer_tracker.h File media/capture/video/video_capture_buffer_tracker.h (right): ...
3 years, 11 months ago (2017-01-13 20:34:38 UTC) #11
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/2620763003/20001
3 years, 11 months ago (2017-01-13 23:23:32 UTC) #13
commit-bot: I haz the power
Failed to apply patch for media/capture/video/video_capture_device.h: While running git apply --index -p1; error: patch failed: ...
3 years, 11 months ago (2017-01-14 03:38:11 UTC) #15
chfremer
Thanks for the review! https://codereview.chromium.org/2620763003/diff/20001/media/capture/video/video_capture_buffer_tracker.h File media/capture/video/video_capture_buffer_tracker.h (right): https://codereview.chromium.org/2620763003/diff/20001/media/capture/video/video_capture_buffer_tracker.h#newcode56 media/capture/video/video_capture_buffer_tracker.h:56: GetNonOwnedSharedMemoryHandleForLegacyIPC() = 0; On 2017/01/13 ...
3 years, 11 months ago (2017-01-17 23:35:58 UTC) #20
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/2620763003/40001
3 years, 11 months ago (2017-01-17 23:36:43 UTC) #23
commit-bot: I haz the power
3 years, 11 months ago (2017-01-17 23:46:57 UTC) #26
Message was sent while issue was closed.
Committed patchset #3 (id:40001) as
https://chromium.googlesource.com/chromium/src/+/03c86be79f1ccae3c1923d1cff91...

Powered by Google App Engine
This is Rietveld 408576698