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

Issue 1541353002: Add offset support to BitstreamBuffer. (Closed)

Created:
5 years ago by Owen Lin
Modified:
4 years, 9 months ago
CC:
chromium-reviews, danakj+watch_chromium.org, darin-cc_chromium.org, feature-media-reviews_chromium.org, jam, jbauman+watch_chromium.org, kalyank, mcasas+watch_chromium.org, piman+watch_chromium.org, posciak+watch_chromium.org, sievers+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Add offset support to BitstreamBuffer. The actual data in the shared memory may start at some offset from the start of shared memory. TEST=Run vda_unittest and play YT on peach-pit. BUG=b/25829285 Committed: https://crrev.com/f450e22ba96da85ad9a126f5f17e5fd886e81ba7 Cr-Commit-Position: refs/heads/master@{#379746}

Patch Set 1 #

Total comments: 8

Patch Set 2 : Address review comment. #

Patch Set 3 : Handle the offset with a helper class #

Total comments: 34

Patch Set 4 : address posciak's comments #

Total comments: 12

Patch Set 5 : rebase #

Patch Set 6 : fix a DCHECK #

Patch Set 7 : address review comment and fix one flush issue #

Total comments: 4

Patch Set 8 : address nits and rebase #

Total comments: 4

Patch Set 9 : address xhwang's comments #

Patch Set 10 : fix compiling errors on android #

Total comments: 7

Patch Set 11 : address dcheng's comments #

Total comments: 2

Patch Set 12 : validate the range of offset. #

Patch Set 13 : simply rebase #

Patch Set 14 : rebase over crrev.com/1645873002 #

Total comments: 17

Patch Set 15 : address dcheng's comment #

Patch Set 16 : rebase CL to run try bot #

Patch Set 17 : address dcheng's comments #

Total comments: 1

Patch Set 18 : address review comments and rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+291 lines, -183 lines) Patch
M content/common/gpu/client/gpu_jpeg_decode_accelerator_host.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +2 lines, -1 line 0 comments Download
M content/common/gpu/media/android_video_decode_accelerator.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 3 chunks +11 lines, -10 lines 0 comments Download
M content/common/gpu/media/android_video_encode_accelerator.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 2 chunks +6 lines, -8 lines 0 comments Download
M content/common/gpu/media/gpu_video_decode_accelerator.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +3 lines, -0 lines 0 comments Download
M content/common/gpu/media/gpu_video_decode_accelerator.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +11 lines, -0 lines 0 comments Download
M content/common/gpu/media/media_messages.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 3 chunks +11 lines, -0 lines 0 comments Download
A content/common/gpu/media/shared_memory_region.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +57 lines, -0 lines 0 comments Download
A content/common/gpu/media/shared_memory_region.cc View 1 2 3 4 5 6 7 1 chunk +42 lines, -0 lines 0 comments Download
M content/common/gpu/media/v4l2_jpeg_decode_accelerator.h View 1 2 3 4 2 chunks +6 lines, -5 lines 0 comments Download
M content/common/gpu/media/v4l2_jpeg_decode_accelerator.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 7 chunks +17 lines, -20 lines 0 comments Download
M content/common/gpu/media/v4l2_slice_video_decode_accelerator.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 6 chunks +8 lines, -12 lines 0 comments Download
M content/common/gpu/media/v4l2_video_decode_accelerator.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 7 chunks +46 lines, -52 lines 0 comments Download
M content/common/gpu/media/v4l2_video_encode_accelerator.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 3 chunks +7 lines, -10 lines 0 comments Download
M content/common/gpu/media/vaapi_jpeg_decode_accelerator.h View 1 2 3 4 2 chunks +5 lines, -4 lines 0 comments Download
M content/common/gpu/media/vaapi_jpeg_decode_accelerator.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 7 chunks +17 lines, -17 lines 0 comments Download
M content/common/gpu/media/vaapi_video_decode_accelerator.h View 1 2 3 4 2 chunks +2 lines, -3 lines 0 comments Download
M content/common/gpu/media/vaapi_video_decode_accelerator.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 4 chunks +8 lines, -11 lines 0 comments Download
M content/common/gpu/media/vaapi_video_encode_accelerator.cc View 1 2 3 4 4 chunks +9 lines, -15 lines 0 comments Download
M content/content_common.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +2 lines, -0 lines 0 comments Download
M content/renderer/media/rtc_video_decoder.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +1 line, -1 line 0 comments Download
M media/base/bitstream_buffer.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 3 chunks +16 lines, -4 lines 0 comments Download
M media/base/bitstream_buffer.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +3 lines, -9 lines 0 comments Download
M media/filters/gpu_video_decoder.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 69 (22 generated)
Owen Lin
PTAL
5 years ago (2015-12-23 08:37:50 UTC) #2
kcwu
lgtm
5 years ago (2015-12-23 08:59:30 UTC) #3
Pawel Osciak
https://codereview.chromium.org/1541353002/diff/1/content/common/gpu/client/gpu_jpeg_decode_accelerator_host.cc File content/common/gpu/client/gpu_jpeg_decode_accelerator_host.cc (right): https://codereview.chromium.org/1541353002/diff/1/content/common/gpu/client/gpu_jpeg_decode_accelerator_host.cc#newcode179 content/common/gpu/client/gpu_jpeg_decode_accelerator_host.cc:179: decode_params.input_buffer_offset = bitstream_buffer.offset(); We must do a base::checked_cast here ...
4 years, 12 months ago (2015-12-24 00:58:01 UTC) #4
Pawel Osciak
https://codereview.chromium.org/1541353002/diff/1/media/base/bitstream_buffer.h File media/base/bitstream_buffer.h (right): https://codereview.chromium.org/1541353002/diff/1/media/base/bitstream_buffer.h#newcode47 media/base/bitstream_buffer.h:47: On 2015/12/24 00:58:01, Pawel Osciak wrote: > Please add ...
4 years, 12 months ago (2015-12-24 01:01:38 UTC) #5
Owen Lin
https://codereview.chromium.org/1541353002/diff/1/content/common/gpu/client/gpu_jpeg_decode_accelerator_host.cc File content/common/gpu/client/gpu_jpeg_decode_accelerator_host.cc (right): https://codereview.chromium.org/1541353002/diff/1/content/common/gpu/client/gpu_jpeg_decode_accelerator_host.cc#newcode179 content/common/gpu/client/gpu_jpeg_decode_accelerator_host.cc:179: decode_params.input_buffer_offset = bitstream_buffer.offset(); On 2015/12/24 00:58:01, Pawel Osciak wrote: ...
4 years, 12 months ago (2015-12-24 08:01:35 UTC) #6
Owen Lin
Please take another look. Thanks.
4 years, 12 months ago (2015-12-28 08:28:03 UTC) #8
Pawel Osciak
Please also at least test compilation for Intel and veyron, as the bots don't do ...
4 years, 11 months ago (2015-12-31 02:05:54 UTC) #10
Owen Lin
PTAL. Thanks. https://codereview.chromium.org/1541353002/diff/60001/content/common/gpu/client/gpu_video_decode_accelerator_host.cc File content/common/gpu/client/gpu_video_decode_accelerator_host.cc (right): https://codereview.chromium.org/1541353002/diff/60001/content/common/gpu/client/gpu_video_decode_accelerator_host.cc#newcode132 content/common/gpu/client/gpu_video_decode_accelerator_host.cc:132: params.size = base::checked_cast<uint32>(bitstream_buffer.size()); On 2015/12/31 02:05:53, Pawel ...
4 years, 11 months ago (2016-01-04 08:54:18 UTC) #11
Pawel Osciak
https://chromiumcodereview.appspot.com/1541353002/diff/80001/content/common/gpu/media/shared_memory_region.cc File content/common/gpu/media/shared_memory_region.cc (right): https://chromiumcodereview.appspot.com/1541353002/diff/80001/content/common/gpu/media/shared_memory_region.cc#newcode18 content/common/gpu/media/shared_memory_region.cc:18: DCHECK_LT(offset_, 0) << "Invalid offset: " << offset_; DCHECK_GE ...
4 years, 11 months ago (2016-01-05 06:22:51 UTC) #12
Owen Lin
Also tested on peach_pit with a modified vda_unittest with offset. https://codereview.chromium.org/1541353002/diff/80001/content/common/gpu/media/shared_memory_region.cc File content/common/gpu/media/shared_memory_region.cc (right): https://codereview.chromium.org/1541353002/diff/80001/content/common/gpu/media/shared_memory_region.cc#newcode18 ...
4 years, 11 months ago (2016-01-06 03:45:46 UTC) #13
Pawel Osciak
lgtm % tiny nits, sorry https://chromiumcodereview.appspot.com/1541353002/diff/140001/content/common/gpu/media/shared_memory_region.h File content/common/gpu/media/shared_memory_region.h (right): https://chromiumcodereview.appspot.com/1541353002/diff/140001/content/common/gpu/media/shared_memory_region.h#newcode35 content/common/gpu/media/shared_memory_region.h:35: // to the memory ...
4 years, 11 months ago (2016-01-12 07:33:05 UTC) #14
Owen Lin
Need owners' review. PTAL, thanks. https://codereview.chromium.org/1541353002/diff/140001/content/common/gpu/media/shared_memory_region.h File content/common/gpu/media/shared_memory_region.h (right): https://codereview.chromium.org/1541353002/diff/140001/content/common/gpu/media/shared_memory_region.h#newcode35 content/common/gpu/media/shared_memory_region.h:35: // to the memory ...
4 years, 11 months ago (2016-01-13 04:09:02 UTC) #16
ccameron
On 2016/01/13 04:09:02, Owen Lin wrote: > Need owners' review. PTAL, thanks. content/common/gpu lgtm stamp
4 years, 11 months ago (2016-01-13 10:33:27 UTC) #17
xhwang
https://chromiumcodereview.appspot.com/1541353002/diff/160001/media/base/bitstream_buffer.h File media/base/bitstream_buffer.h (right): https://chromiumcodereview.appspot.com/1541353002/diff/160001/media/base/bitstream_buffer.h#newcode32 media/base/bitstream_buffer.h:32: off_t offset); I never used off_t before. After a ...
4 years, 11 months ago (2016-01-13 18:54:54 UTC) #18
Owen Lin
https://codereview.chromium.org/1541353002/diff/160001/media/base/bitstream_buffer.h File media/base/bitstream_buffer.h (right): https://codereview.chromium.org/1541353002/diff/160001/media/base/bitstream_buffer.h#newcode32 media/base/bitstream_buffer.h:32: off_t offset); On 2016/01/13 18:54:54, xhwang wrote: > I ...
4 years, 11 months ago (2016-01-14 03:56:34 UTC) #19
xhwang
lgtm
4 years, 11 months ago (2016-01-14 20:31:50 UTC) #20
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1541353002/180001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1541353002/180001
4 years, 11 months ago (2016-01-15 06:58:00 UTC) #22
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: android_compile_dbg on tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/android_compile_dbg/builds/8672)
4 years, 11 months ago (2016-01-15 07:13:01 UTC) #24
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1541353002/280001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1541353002/280001
4 years, 11 months ago (2016-01-22 04:28:15 UTC) #30
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
4 years, 11 months ago (2016-01-22 05:37:35 UTC) #32
dcheng
Personally, I think that offset should be some unsigned type and that the burdening of ...
4 years, 11 months ago (2016-01-22 18:27:39 UTC) #33
Pawel Osciak
https://codereview.chromium.org/1541353002/diff/280001/content/common/gpu/media/gpu_video_decode_accelerator.cc File content/common/gpu/media/gpu_video_decode_accelerator.cc (right): https://codereview.chromium.org/1541353002/diff/280001/content/common/gpu/media/gpu_video_decode_accelerator.cc#newcode514 content/common/gpu/media/gpu_video_decode_accelerator.cc:514: params.offset, params.presentation_timestamp); On 2016/01/22 18:27:39, dcheng wrote: > Where ...
4 years, 11 months ago (2016-01-25 08:20:02 UTC) #34
Owen Lin
https://codereview.chromium.org/1541353002/diff/280001/content/common/gpu/media/gpu_video_decode_accelerator.cc File content/common/gpu/media/gpu_video_decode_accelerator.cc (right): https://codereview.chromium.org/1541353002/diff/280001/content/common/gpu/media/gpu_video_decode_accelerator.cc#newcode514 content/common/gpu/media/gpu_video_decode_accelerator.cc:514: params.offset, params.presentation_timestamp); On 2016/01/22 18:27:39, dcheng wrote: > Where ...
4 years, 11 months ago (2016-01-25 09:30:59 UTC) #35
dcheng
https://codereview.chromium.org/1541353002/diff/300001/content/common/gpu/media/gpu_video_decode_accelerator.cc File content/common/gpu/media/gpu_video_decode_accelerator.cc (right): https://codereview.chromium.org/1541353002/diff/300001/content/common/gpu/media/gpu_video_decode_accelerator.cc#newcode514 content/common/gpu/media/gpu_video_decode_accelerator.cc:514: checked_cast<off_t>(params.offset), params.presentation_timestamp); Should this really crash the GPU (I ...
4 years, 11 months ago (2016-01-25 19:09:18 UTC) #36
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1541353002/320001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1541353002/320001
4 years, 10 months ago (2016-01-29 02:51:48 UTC) #38
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
4 years, 10 months ago (2016-01-29 04:06:24 UTC) #40
Owen Lin
https://codereview.chromium.org/1541353002/diff/300001/content/common/gpu/media/gpu_video_decode_accelerator.cc File content/common/gpu/media/gpu_video_decode_accelerator.cc (right): https://codereview.chromium.org/1541353002/diff/300001/content/common/gpu/media/gpu_video_decode_accelerator.cc#newcode514 content/common/gpu/media/gpu_video_decode_accelerator.cc:514: checked_cast<off_t>(params.offset), params.presentation_timestamp); On 2016/01/25 19:09:18, dcheng wrote: > Should ...
4 years, 10 months ago (2016-01-29 05:38:17 UTC) #41
dcheng
On 2016/01/29 at 05:38:17, owenlin wrote: > https://codereview.chromium.org/1541353002/diff/300001/content/common/gpu/media/gpu_video_decode_accelerator.cc > File content/common/gpu/media/gpu_video_decode_accelerator.cc (right): > > https://codereview.chromium.org/1541353002/diff/300001/content/common/gpu/media/gpu_video_decode_accelerator.cc#newcode514 ...
4 years, 10 months ago (2016-01-29 22:34:19 UTC) #42
Owen Lin
On 2016/01/29 22:34:19, dcheng wrote: > On 2016/01/29 at 05:38:17, owenlin wrote: > > > ...
4 years, 10 months ago (2016-02-01 02:39:30 UTC) #43
wuchengli1
dcheng@ PTAL. Thanks.
4 years, 10 months ago (2016-02-02 06:49:16 UTC) #45
dcheng
On 2016/02/01 at 02:39:30, owenlin wrote: > On 2016/01/29 22:34:19, dcheng wrote: > > On ...
4 years, 10 months ago (2016-02-02 07:25:29 UTC) #46
Pawel Osciak
On 2016/02/02 07:25:29, dcheng wrote: > > ParamTraits is not just for serialization / deserialization: ...
4 years, 10 months ago (2016-02-02 08:09:00 UTC) #47
Owen Lin
On 2016/02/02 08:09:00, Pawel Osciak wrote: > On 2016/02/02 07:25:29, dcheng wrote: > > > ...
4 years, 10 months ago (2016-02-02 08:47:25 UTC) #48
dcheng
On 2016/02/02 at 08:47:25, owenlin wrote: > On 2016/02/02 08:09:00, Pawel Osciak wrote: > > ...
4 years, 10 months ago (2016-02-02 23:04:40 UTC) #49
Owen Lin
dcheng@, PTAL. Patch #13 is the rebase of the original code over the TOT. You ...
4 years, 10 months ago (2016-02-24 07:41:01 UTC) #51
dcheng
Overall, seems reasonable. One random thought (I don't expect this to be implemented in this ...
4 years, 9 months ago (2016-03-01 01:48:43 UTC) #52
Owen Lin
https://codereview.chromium.org/1541353002/diff/380001/content/common/gpu/gpu_messages.cc File content/common/gpu/gpu_messages.cc (right): https://codereview.chromium.org/1541353002/diff/380001/content/common/gpu/gpu_messages.cc#newcode19 content/common/gpu/gpu_messages.cc:19: WriteParam(m, static_cast<int64_t>(p.offset())); On 2016/03/01 01:48:43, dcheng wrote: > Does ...
4 years, 9 months ago (2016-03-02 02:50:53 UTC) #54
dcheng
https://codereview.chromium.org/1541353002/diff/380001/content/common/gpu/gpu_messages.cc File content/common/gpu/gpu_messages.cc (right): https://codereview.chromium.org/1541353002/diff/380001/content/common/gpu/gpu_messages.cc#newcode19 content/common/gpu/gpu_messages.cc:19: WriteParam(m, static_cast<int64_t>(p.offset())); On 2016/03/02 at 02:50:52, Owen Lin wrote: ...
4 years, 9 months ago (2016-03-02 05:58:20 UTC) #55
Owen Lin
On 2016/03/02 05:58:20, dcheng wrote: > https://codereview.chromium.org/1541353002/diff/380001/content/common/gpu/gpu_messages.cc > File content/common/gpu/gpu_messages.cc (right): > > https://codereview.chromium.org/1541353002/diff/380001/content/common/gpu/gpu_messages.cc#newcode19 > ...
4 years, 9 months ago (2016-03-02 06:32:12 UTC) #56
dcheng
On 2016/03/02 at 06:32:12, owenlin wrote: > On 2016/03/02 05:58:20, dcheng wrote: > > https://codereview.chromium.org/1541353002/diff/380001/content/common/gpu/gpu_messages.cc ...
4 years, 9 months ago (2016-03-02 07:44:33 UTC) #57
Owen Lin
On 2016/03/02 07:44:33, dcheng wrote: > On 2016/03/02 at 06:32:12, owenlin wrote: > > On ...
4 years, 9 months ago (2016-03-02 09:23:46 UTC) #59
Owen Lin
Hi Daniel, would you like to take another look. Thanks.
4 years, 9 months ago (2016-03-04 07:11:50 UTC) #60
dcheng
ipc lgtm with comment addressed https://codereview.chromium.org/1541353002/diff/480001/content/common/gpu/media_messages.cc File content/common/gpu/media_messages.cc (right): https://codereview.chromium.org/1541353002/diff/480001/content/common/gpu/media_messages.cc#newcode20 content/common/gpu/media_messages.cc:20: WriteParam(m, static_cast<int64_t>(p.offset())); static_cast<uint64_t> (and ...
4 years, 9 months ago (2016-03-05 01:30:57 UTC) #61
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1541353002/500001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1541353002/500001
4 years, 9 months ago (2016-03-08 03:03:40 UTC) #64
commit-bot: I haz the power
Committed patchset #18 (id:500001)
4 years, 9 months ago (2016-03-08 04:53:21 UTC) #66
commit-bot: I haz the power
Patchset 18 (id:??) landed as https://crrev.com/f450e22ba96da85ad9a126f5f17e5fd886e81ba7 Cr-Commit-Position: refs/heads/master@{#379746}
4 years, 9 months ago (2016-03-08 04:54:47 UTC) #68
kcwu
4 years, 9 months ago (2016-03-16 06:20:53 UTC) #69
Message was sent while issue was closed.
Ah, just found I have some comments forgot to publish.

https://codereview.chromium.org/1541353002/diff/380001/content/common/gpu/med...
File content/common/gpu/media/gpu_video_decode_accelerator.cc (right):

https://codereview.chromium.org/1541353002/diff/380001/content/common/gpu/med...
content/common/gpu/media/gpu_video_decode_accelerator.cc:492: void
GpuVideoDecodeAccelerator::CallOrPostNotifyError(
unused?

https://codereview.chromium.org/1541353002/diff/380001/content/common/gpu/med...
File content/common/gpu/media/shared_memory_region.cc (right):

https://codereview.chromium.org/1541353002/diff/380001/content/common/gpu/med...
content/common/gpu/media/shared_memory_region.cc:1: // Copyright (c) 2015 The
Chromium Authors. All rights reserved.
s/(c) 2015/2016/

https://codereview.chromium.org/1541353002/diff/380001/content/common/gpu/med...
content/common/gpu/media/shared_memory_region.cc:17: alignment_size_(offset %
base::SysInfo::VMAllocationGranularity()) {
How about name it |offset_to_alignment| or |padding_size|? My first impression
for "size" of |alignment_size_| is something like 4096, so I feel it a little
confusing.

https://codereview.chromium.org/1541353002/diff/380001/content/common/gpu/med...
File content/common/gpu/media/shared_memory_region.h (right):

https://codereview.chromium.org/1541353002/diff/380001/content/common/gpu/med...
content/common/gpu/media/shared_memory_region.h:1: // Copyright (c) 2015 The
Chromium Authors. All rights reserved.
s/(c) 2015/2016/

Powered by Google App Engine
This is Rietveld 408576698