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

Issue 1179323002: Video Capture: extract storage info from pixel format in VideoCaptureFormat. (Closed)

Created:
5 years, 6 months ago by mcasas
Modified:
5 years, 6 months ago
Reviewers:
hubbe, DaleCurtis, dcheng, miu
CC:
chromium-reviews, darin-cc_chromium.org, feature-media-reviews_chromium.org, jam, mcasas+watch_chromium.org, miu+watch_chromium.org, posciak+watch_chromium.org, wjia+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Video Capture: extract storage info from pixel format in VideoCaptureFormat. Video Capture Devices treat both Texture and GpuMemoryBuffer as a VideoPixelFormat, but they are storage types. Moreover, this merging prevents capture devices from indicating a combination of Storage and Capture formats, i.e. Texture + ARGB, or GpuMemoryBuffer+YUY2. This CL separates both concepts and updates necessary call points. It also extends the translation VideoCaptureFormat --> VideoFrame in VideoCaptureDeviceClient and in VideoCaptureBufferPool. VideoCaptureBufferPool::ReserveOutputBuffer() also gets a param to specify the StorageType. This separation also allows for VideoCaptureBufferPool to operate using VideoPixel{Format, Storage} ISO VideoFrame types, which spares the constant conversion between ones and others. Test: All video captures working exactly as before. BUG=440843 TBR=dcheng@chromium.org for media_param_traits.cc (Rationale: the change is small and I'm still going to be actively working in this area so we can follow up in other reviews). Committed: https://crrev.com/957fb245c45052e2c4b2bb0f59e165ba05096904 Cr-Commit-Position: refs/heads/master@{#335872}

Patch Set 1 : #

Total comments: 6

Patch Set 2 : miu@s comments #

Patch Set 3 : Tracker working with VideoPixel{Format,Storage} ISO VideoFrame counterparts. Rebased. #

Total comments: 4

Patch Set 4 : hubbe@s comments and minor rebase #

Total comments: 27

Patch Set 5 : second round of comments from hubbe@. Rebase #

Total comments: 12

Patch Set 6 : miu@ comments. Rebase #

Patch Set 7 : miu@s comments #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+275 lines, -212 lines) Patch
M content/browser/media/capture/aura_window_capture_machine.cc View 1 2 3 4 1 chunk +4 lines, -2 lines 1 comment Download
M content/browser/media/capture/desktop_capture_device_aura_unittest.cc View 1 2 3 4 1 chunk +8 lines, -2 lines 0 comments Download
M content/browser/media/capture/desktop_capture_device_unittest.cc View 1 2 3 4 1 chunk +6 lines, -2 lines 0 comments Download
M content/browser/media/capture/web_contents_video_capture_device_unittest.cc View 1 2 3 4 5 1 chunk +4 lines, -3 lines 0 comments Download
M content/browser/media/media_internals_unittest.cc View 1 chunk +7 lines, -7 lines 0 comments Download
M content/browser/renderer_host/media/video_capture_buffer_pool.h View 1 2 3 4 4 chunks +10 lines, -8 lines 0 comments Download
M content/browser/renderer_host/media/video_capture_buffer_pool.cc View 1 2 3 4 5 9 chunks +23 lines, -67 lines 0 comments Download
M content/browser/renderer_host/media/video_capture_buffer_pool_unittest.cc View 1 2 3 4 5 5 chunks +30 lines, -14 lines 0 comments Download
M content/browser/renderer_host/media/video_capture_controller.cc View 1 2 3 4 5 1 chunk +0 lines, -1 line 0 comments Download
M content/browser/renderer_host/media/video_capture_controller_unittest.cc View 1 2 3 4 5 12 chunks +34 lines, -25 lines 0 comments Download
M content/browser/renderer_host/media/video_capture_device_client.h View 1 2 1 chunk +4 lines, -2 lines 0 comments Download
M content/browser/renderer_host/media/video_capture_device_client.cc View 1 2 3 4 5 8 chunks +35 lines, -27 lines 1 comment Download
M content/common/media/media_param_traits.cc View 1 2 3 4 5 6 2 chunks +7 lines, -5 lines 1 comment Download
M media/base/video_capture_types.h View 1 2 3 4 5 4 chunks +17 lines, -2 lines 1 comment Download
M media/base/video_capture_types.cc View 1 2 3 4 6 chunks +37 lines, -16 lines 0 comments Download
M media/capture/screen_capture_device_core.cc View 1 2 3 4 5 6 1 chunk +7 lines, -5 lines 0 comments Download
M media/capture/thread_safe_capture_oracle.cc View 1 2 3 4 2 chunks +10 lines, -6 lines 0 comments Download
M media/video/capture/fake_video_capture_device.h View 1 chunk +1 line, -0 lines 0 comments Download
M media/video/capture/fake_video_capture_device.cc View 1 2 3 4 5 chunks +16 lines, -10 lines 0 comments Download
M media/video/capture/fake_video_capture_device_unittest.cc View 1 2 3 4 1 chunk +7 lines, -4 lines 0 comments Download
M media/video/capture/video_capture_device.h View 1 2 3 4 1 chunk +3 lines, -2 lines 0 comments Download
M media/video/capture/video_capture_device_unittest.cc View 1 2 3 4 1 chunk +5 lines, -2 lines 0 comments Download

Messages

Total messages: 39 (17 generated)
miu
https://codereview.chromium.org/1179323002/diff/40001/content/browser/media/capture/content_video_capture_device_core.cc File content/browser/media/capture/content_video_capture_device_core.cc (right): https://codereview.chromium.org/1179323002/diff/40001/content/browser/media/capture/content_video_capture_device_core.cc#newcode240 content/browser/media/capture/content_video_capture_device_core.cc:240: if (params.requested_format.pixel_format != media::PIXEL_FORMAT_I420 && I think you meant ...
5 years, 6 months ago (2015-06-13 00:41:37 UTC) #4
hubbe
https://codereview.chromium.org/1179323002/diff/130001/media/base/video_capture_types.cc File media/base/video_capture_types.cc (right): https://codereview.chromium.org/1179323002/diff/130001/media/base/video_capture_types.cc#newcode77 media/base/video_capture_types.cc:77: std::string VideoCaptureFormat::ToString() const { What is this function used ...
5 years, 6 months ago (2015-06-16 21:11:35 UTC) #10
mcasas
hubbe@ PTAL https://codereview.chromium.org/1179323002/diff/40001/content/browser/media/capture/content_video_capture_device_core.cc File content/browser/media/capture/content_video_capture_device_core.cc (right): https://codereview.chromium.org/1179323002/diff/40001/content/browser/media/capture/content_video_capture_device_core.cc#newcode240 content/browser/media/capture/content_video_capture_device_core.cc:240: if (params.requested_format.pixel_format != media::PIXEL_FORMAT_I420 && On 2015/06/13 ...
5 years, 6 months ago (2015-06-16 23:14:02 UTC) #11
hubbe
https://codereview.chromium.org/1179323002/diff/150001/content/browser/media/capture/aura_window_capture_machine.cc File content/browser/media/capture/aura_window_capture_machine.cc (right): https://codereview.chromium.org/1179323002/diff/150001/content/browser/media/capture/aura_window_capture_machine.cc#newcode282 content/browser/media/capture/aura_window_capture_machine.cc:282: media::PIXEL_STORAGE_TEXTURE) { Dcheck that pixel_format is ARGB? https://codereview.chromium.org/1179323002/diff/150001/content/browser/media/capture/desktop_capture_device_aura_unittest.cc File ...
5 years, 6 months ago (2015-06-18 19:23:11 UTC) #12
mcasas
hubbe@ PTAL https://codereview.chromium.org/1179323002/diff/150001/content/browser/media/capture/aura_window_capture_machine.cc File content/browser/media/capture/aura_window_capture_machine.cc (right): https://codereview.chromium.org/1179323002/diff/150001/content/browser/media/capture/aura_window_capture_machine.cc#newcode282 content/browser/media/capture/aura_window_capture_machine.cc:282: media::PIXEL_STORAGE_TEXTURE) { On 2015/06/18 19:23:10, hubbe wrote: ...
5 years, 6 months ago (2015-06-19 02:58:36 UTC) #15
mcasas
dalecurtis@ PTAL/Owners RS
5 years, 6 months ago (2015-06-23 22:33:55 UTC) #17
miu
https://codereview.chromium.org/1179323002/diff/210001/media/base/video_capture_types.h File media/base/video_capture_types.h (right): https://codereview.chromium.org/1179323002/diff/210001/media/base/video_capture_types.h#newcode108 media/base/video_capture_types.h:108: VideoPixelStorage pixel_storage; Should this extra field be added in ...
5 years, 6 months ago (2015-06-23 22:58:15 UTC) #18
mcasas
miu@ PTAL (just addressed your comments and added a DCHECK, sorry for the rebase) https://codereview.chromium.org/1179323002/diff/210001/media/base/video_capture_types.h ...
5 years, 6 months ago (2015-06-23 23:24:44 UTC) #21
hubbe
lgtm https://codereview.chromium.org/1179323002/diff/150001/media/base/video_capture_types.h File media/base/video_capture_types.h (right): https://codereview.chromium.org/1179323002/diff/150001/media/base/video_capture_types.h#newcode37 media/base/video_capture_types.h:37: // Format are possible, though some are very ...
5 years, 6 months ago (2015-06-23 23:35:41 UTC) #22
miu
https://codereview.chromium.org/1179323002/diff/210001/media/base/video_capture_types.h File media/base/video_capture_types.h (right): https://codereview.chromium.org/1179323002/diff/210001/media/base/video_capture_types.h#newcode108 media/base/video_capture_types.h:108: VideoPixelStorage pixel_storage; On 2015/06/23 23:24:43, mcasas wrote: > On ...
5 years, 6 months ago (2015-06-23 23:35:55 UTC) #23
mcasas
On 2015/06/23 23:35:41, hubbe wrote: > lgtm > > https://codereview.chromium.org/1179323002/diff/150001/media/base/video_capture_types.h > File media/base/video_capture_types.h (right): > ...
5 years, 6 months ago (2015-06-23 23:58:44 UTC) #24
mcasas
miu@ PTAL https://codereview.chromium.org/1179323002/diff/210001/media/base/video_capture_types.h File media/base/video_capture_types.h (right): https://codereview.chromium.org/1179323002/diff/210001/media/base/video_capture_types.h#newcode108 media/base/video_capture_types.h:108: VideoPixelStorage pixel_storage; On 2015/06/23 23:35:55, miu wrote: ...
5 years, 6 months ago (2015-06-24 00:16:39 UTC) #25
miu
lgtm
5 years, 6 months ago (2015-06-24 00:20:39 UTC) #26
DaleCurtis
rs lgtm
5 years, 6 months ago (2015-06-24 00:25:28 UTC) #27
mcasas
inferno@ content/common/media/media_param_traits.cc PTAL
5 years, 6 months ago (2015-06-24 00:34:18 UTC) #29
mcasas
dcheng@ PTAL at content/common/media/media_param_traits.cc
5 years, 6 months ago (2015-06-24 01:22:36 UTC) #31
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1179323002/290001
5 years, 6 months ago (2015-06-24 03:08:06 UTC) #34
commit-bot: I haz the power
Committed patchset #7 (id:290001)
5 years, 6 months ago (2015-06-24 04:11:53 UTC) #35
commit-bot: I haz the power
Patchset 7 (id:??) landed as https://crrev.com/957fb245c45052e2c4b2bb0f59e165ba05096904 Cr-Commit-Position: refs/heads/master@{#335872}
5 years, 6 months ago (2015-06-24 04:12:39 UTC) #36
dcheng
Umm... is there any particular reason this had to be TBRed? I received this code ...
5 years, 6 months ago (2015-06-24 18:40:12 UTC) #37
dcheng
A revert of this CL (patchset #7 id:290001) has been created in https://codereview.chromium.org/1204843004/ by dcheng@chromium.org. ...
5 years, 6 months ago (2015-06-24 19:00:56 UTC) #38
dcheng
5 years, 6 months ago (2015-06-24 19:01:14 UTC) #39
Message was sent while issue was closed.
https://codereview.chromium.org/1179323002/diff/290001/content/browser/media/...
File content/browser/media/capture/aura_window_capture_machine.cc (right):

https://codereview.chromium.org/1179323002/diff/290001/content/browser/media/...
content/browser/media/capture/aura_window_capture_machine.cc:311:
DCHECK_EQ(capture_params_.requested_format.pixel_format,
DCHECK_EQ(expected, actual) is the convention.

https://codereview.chromium.org/1179323002/diff/290001/content/browser/render...
File content/browser/renderer_host/media/video_capture_device_client.cc (right):

https://codereview.chromium.org/1179323002/diff/290001/content/browser/render...
content/browser/renderer_host/media/video_capture_device_client.cc:219:
DCHECK_EQ(frame_format.pixel_storage, media::PIXEL_STORAGE_CPU);
Same comment: this should be DCHECK_EQ(actual, expected)

https://codereview.chromium.org/1179323002/diff/290001/content/common/media/m...
File content/common/media/media_param_traits.cc (right):

https://codereview.chromium.org/1179323002/diff/290001/content/common/media/m...
content/common/media/media_param_traits.cc:78: !iter->ReadInt(&pixel_storage))
Please change all of these to use ReadParam(). This will simplify your IsValid()
method (you won't need to check that the enum values are in bounds, for
example), and you won't need the awkward static_cast below.

https://codereview.chromium.org/1179323002/diff/290001/media/base/video_captu...
File media/base/video_capture_types.h (right):

https://codereview.chromium.org/1179323002/diff/290001/media/base/video_captu...
media/base/video_capture_types.h:40: enum VideoPixelStorage {
enum class.

Powered by Google App Engine
This is Rietveld 408576698