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

Issue 2908303003: media: Create Mojo StructTraits for VideoFrame (Closed)

Created:
3 years, 6 months ago by sandersd (OOO until July 31)
Modified:
3 years, 6 months ago
Reviewers:
xhwang, yzshen1, dcheng
CC:
chromium-reviews, feature-media-reviews_chromium.org, qsr+mojo_chromium.org, viettrungluu+watch_chromium.org, posciak+watch_chromium.org, yzshen+watch_chromium.org, abarth-chromium, Aaron Boodman, alokp+watch_chromium.org, darin (slow to review)
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

media: Create Mojo StructTraits for VideoFrame This replaces the existing TypeConverter code for VideoFrames. BUG=611224 Review-Url: https://codereview.chromium.org/2908303003 Cr-Commit-Position: refs/heads/master@{#478413} Committed: https://chromium.googlesource.com/chromium/src/+/5ad3de8f2d39653bdabf40403b1dc48ae92c8320

Patch Set 1 #

Patch Set 2 : Fix dependency cycle #

Patch Set 3 : Code formatting. #

Total comments: 26

Patch Set 4 : Address most comments. #

Total comments: 4

Patch Set 5 : Best guess for deps. #

Patch Set 6 : std includes #

Patch Set 7 : Unittests. #

Patch Set 8 : Fix mailbox array size. #

Patch Set 9 : Remove DCHECKs that don't compile on Windows. #

Patch Set 10 : Switch to explicit interface request for unittest. #

Patch Set 11 : Correct mojo_cdm_allocator_unittest.cc #

Total comments: 6

Patch Set 12 : Context object. #

Total comments: 1

Patch Set 13 : Eagerly initialize the context object. #

Total comments: 4

Patch Set 14 : Remove death test. #

Total comments: 7
Unified diffs Side-by-side diffs Delta from patch set Stats (+484 lines, -199 lines) Patch
M media/mojo/BUILD.gn View 1 2 3 4 5 6 2 chunks +2 lines, -0 lines 0 comments Download
M media/mojo/clients/mojo_decryptor.h View 1 1 chunk +1 line, -1 line 0 comments Download
M media/mojo/clients/mojo_decryptor.cc View 1 1 chunk +4 lines, -11 lines 0 comments Download
M media/mojo/clients/mojo_video_decoder.h View 1 chunk +1 line, -1 line 0 comments Download
M media/mojo/clients/mojo_video_decoder.cc View 1 2 chunks +4 lines, -4 lines 0 comments Download
M media/mojo/common/media_type_converters_unittest.cc View 1 2 3 4 5 4 chunks +0 lines, -148 lines 0 comments Download
M media/mojo/common/mojo_shared_buffer_video_frame.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 3 chunks +7 lines, -23 lines 0 comments Download
M media/mojo/common/mojo_shared_buffer_video_frame.cc View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +48 lines, -0 lines 0 comments Download
M media/mojo/interfaces/BUILD.gn View 1 2 3 4 5 6 1 chunk +10 lines, -0 lines 0 comments Download
M media/mojo/interfaces/media_types.mojom View 1 1 chunk +2 lines, -1 line 0 comments Download
A media/mojo/interfaces/traits_test_service.mojom View 1 2 3 4 5 6 1 chunk +12 lines, -0 lines 0 comments Download
M media/mojo/interfaces/typemaps.gni View 1 chunk +1 line, -0 lines 0 comments Download
A media/mojo/interfaces/video_frame.typemap View 1 2 3 4 1 chunk +37 lines, -0 lines 0 comments Download
A media/mojo/interfaces/video_frame_struct_traits.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +74 lines, -0 lines 0 comments Download
A media/mojo/interfaces/video_frame_struct_traits.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +161 lines, -0 lines 7 comments Download
A media/mojo/interfaces/video_frame_struct_traits_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +112 lines, -0 lines 0 comments Download
M media/mojo/services/mojo_cdm_allocator_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +4 lines, -4 lines 0 comments Download
M media/mojo/services/mojo_decryptor_service.cc View 1 2 1 chunk +3 lines, -5 lines 0 comments Download
M media/mojo/services/mojo_video_decoder_service.cc View 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 63 (38 generated)
sandersd (OOO until July 31)
Requesting early review (unittests are missing, TypeConverter is still in the codebase). Looking for feedback ...
3 years, 6 months ago (2017-06-03 00:11:12 UTC) #3
dcheng
(I'm assuming this supersedes the other CL) https://codereview.chromium.org/2908303003/diff/40001/media/mojo/clients/mojo_decryptor.cc File media/mojo/clients/mojo_decryptor.cc (right): https://codereview.chromium.org/2908303003/diff/40001/media/mojo/clients/mojo_decryptor.cc#newcode227 media/mojo/clients/mojo_decryptor.cc:227: const scoped_refptr<VideoFrame>& ...
3 years, 6 months ago (2017-06-05 20:33:02 UTC) #4
sandersd (OOO until July 31)
(Replies to just a few comments, since some of the answers may be relevant before ...
3 years, 6 months ago (2017-06-05 20:46:14 UTC) #5
sandersd (OOO until July 31)
https://codereview.chromium.org/2908303003/diff/40001/media/mojo/common/mojo_shared_buffer_video_frame.h File media/mojo/common/mojo_shared_buffer_video_frame.h (right): https://codereview.chromium.org/2908303003/diff/40001/media/mojo/common/mojo_shared_buffer_video_frame.h#newcode76 media/mojo/common/mojo_shared_buffer_video_frame.h:76: // handle. Caller should call duplicate the handle if ...
3 years, 6 months ago (2017-06-06 01:05:47 UTC) #6
sandersd (OOO until July 31)
+xhwang@ to review changes to mojo_shared_buffer_video_frame.cc.
3 years, 6 months ago (2017-06-06 01:07:01 UTC) #8
xhwang
looking good to me! Do you need to remove the type converter code for VideoFrame? ...
3 years, 6 months ago (2017-06-06 05:51:15 UTC) #9
sandersd (OOO until July 31)
> Do you need to remove the type converter code for VideoFrame? Yes, that will ...
3 years, 6 months ago (2017-06-06 18:07:37 UTC) #10
xhwang
https://codereview.chromium.org/2908303003/diff/50001/media/mojo/clients/mojo_decryptor.h File media/mojo/clients/mojo_decryptor.h (right): https://codereview.chromium.org/2908303003/diff/50001/media/mojo/clients/mojo_decryptor.h#newcode66 media/mojo/clients/mojo_decryptor.h:66: const scoped_refptr<VideoFrame>& video_frame, On 2017/06/06 18:07:37, sandersd wrote: > ...
3 years, 6 months ago (2017-06-06 18:12:47 UTC) #11
sandersd (OOO until July 31)
I believe this CL is complete now. I'm not entirely sure that the includes and ...
3 years, 6 months ago (2017-06-07 00:36:53 UTC) #12
dcheng
https://codereview.chromium.org/2908303003/diff/40001/media/mojo/interfaces/video_frame_struct_traits.cc File media/mojo/interfaces/video_frame_struct_traits.cc (right): https://codereview.chromium.org/2908303003/diff/40001/media/mojo/interfaces/video_frame_struct_traits.cc#newcode16 media/mojo/interfaces/video_frame_struct_traits.cc:16: data(const scoped_refptr<media::VideoFrame>& input) { On 2017/06/06 01:05:47, sandersd wrote: ...
3 years, 6 months ago (2017-06-08 09:41:08 UTC) #34
yzshen1
https://codereview.chromium.org/2908303003/diff/40001/media/mojo/interfaces/video_frame_struct_traits.cc File media/mojo/interfaces/video_frame_struct_traits.cc (right): https://codereview.chromium.org/2908303003/diff/40001/media/mojo/interfaces/video_frame_struct_traits.cc#newcode16 media/mojo/interfaces/video_frame_struct_traits.cc:16: data(const scoped_refptr<media::VideoFrame>& input) { On 2017/06/08 09:41:08, dcheng wrote: ...
3 years, 6 months ago (2017-06-08 17:45:14 UTC) #35
sandersd (OOO until July 31)
https://codereview.chromium.org/2908303003/diff/40001/media/mojo/interfaces/video_frame_struct_traits.cc File media/mojo/interfaces/video_frame_struct_traits.cc (right): https://codereview.chromium.org/2908303003/diff/40001/media/mojo/interfaces/video_frame_struct_traits.cc#newcode16 media/mojo/interfaces/video_frame_struct_traits.cc:16: data(const scoped_refptr<media::VideoFrame>& input) { On 2017/06/08 17:45:14, yzshen1 wrote: ...
3 years, 6 months ago (2017-06-08 20:10:09 UTC) #36
dcheng
LGTM with comments addressed. https://codereview.chromium.org/2908303003/diff/210001/media/mojo/interfaces/video_frame_struct_traits.cc File media/mojo/interfaces/video_frame_struct_traits.cc (right): https://codereview.chromium.org/2908303003/diff/210001/media/mojo/interfaces/video_frame_struct_traits.cc#newcode86 media/mojo/interfaces/video_frame_struct_traits.cc:86: if (!ctx->has_data) { Rather than ...
3 years, 6 months ago (2017-06-08 20:43:15 UTC) #39
sandersd (OOO until July 31)
xhwang@: Ping.
3 years, 6 months ago (2017-06-08 21:56:36 UTC) #42
sandersd (OOO until July 31)
dcheng@: Any explanation why the death test fails on Windows?
3 years, 6 months ago (2017-06-08 23:39:56 UTC) #45
dcheng
On 2017/06/08 23:39:56, sandersd wrote: > dcheng@: Any explanation why the death test fails on ...
3 years, 6 months ago (2017-06-09 06:39:30 UTC) #46
yzshen1
On 2017/06/09 06:39:30, dcheng wrote: > On 2017/06/08 23:39:56, sandersd wrote: > > dcheng@: Any ...
3 years, 6 months ago (2017-06-09 16:18:04 UTC) #47
xhwang
lgtm % nit, thanks! https://codereview.chromium.org/2908303003/diff/230001/media/mojo/services/mojo_cdm_allocator_unittest.cc File media/mojo/services/mojo_cdm_allocator_unittest.cc (right): https://codereview.chromium.org/2908303003/diff/230001/media/mojo/services/mojo_cdm_allocator_unittest.cc#newcode89 media/mojo/services/mojo_cdm_allocator_unittest.cc:89: const int kWidth = 9; ...
3 years, 6 months ago (2017-06-09 16:54:53 UTC) #48
sandersd (OOO until July 31)
https://codereview.chromium.org/2908303003/diff/230001/media/mojo/services/mojo_cdm_allocator_unittest.cc File media/mojo/services/mojo_cdm_allocator_unittest.cc (right): https://codereview.chromium.org/2908303003/diff/230001/media/mojo/services/mojo_cdm_allocator_unittest.cc#newcode89 media/mojo/services/mojo_cdm_allocator_unittest.cc:89: const int kWidth = 9; On 2017/06/09 16:54:52, xhwang ...
3 years, 6 months ago (2017-06-09 18:26:33 UTC) #49
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/2908303003/250001
3 years, 6 months ago (2017-06-09 21:01:06 UTC) #56
commit-bot: I haz the power
Committed patchset #14 (id:250001) as https://chromium.googlesource.com/chromium/src/+/5ad3de8f2d39653bdabf40403b1dc48ae92c8320
3 years, 6 months ago (2017-06-09 21:06:43 UTC) #59
dcheng
https://codereview.chromium.org/2908303003/diff/250001/media/mojo/interfaces/video_frame_struct_traits.cc File media/mojo/interfaces/video_frame_struct_traits.cc (right): https://codereview.chromium.org/2908303003/diff/250001/media/mojo/interfaces/video_frame_struct_traits.cc#newcode51 media/mojo/interfaces/video_frame_struct_traits.cc:51: NOTREACHED() << "Unsupported VideoFrame conversion"; As mentioned, there shouldn't ...
3 years, 6 months ago (2017-06-09 21:52:23 UTC) #60
sandersd (OOO until July 31)
https://codereview.chromium.org/2908303003/diff/250001/media/mojo/interfaces/video_frame_struct_traits.cc File media/mojo/interfaces/video_frame_struct_traits.cc (right): https://codereview.chromium.org/2908303003/diff/250001/media/mojo/interfaces/video_frame_struct_traits.cc#newcode51 media/mojo/interfaces/video_frame_struct_traits.cc:51: NOTREACHED() << "Unsupported VideoFrame conversion"; On 2017/06/09 21:52:23, dcheng ...
3 years, 6 months ago (2017-06-09 22:07:01 UTC) #61
dcheng
https://codereview.chromium.org/2908303003/diff/250001/media/mojo/interfaces/video_frame_struct_traits.cc File media/mojo/interfaces/video_frame_struct_traits.cc (right): https://codereview.chromium.org/2908303003/diff/250001/media/mojo/interfaces/video_frame_struct_traits.cc#newcode51 media/mojo/interfaces/video_frame_struct_traits.cc:51: NOTREACHED() << "Unsupported VideoFrame conversion"; On 2017/06/09 22:07:01, sandersd ...
3 years, 6 months ago (2017-06-10 00:39:33 UTC) #62
sandersd (OOO until July 31)
3 years, 6 months ago (2017-06-10 01:18:21 UTC) #63
Message was sent while issue was closed.
https://codereview.chromium.org/2908303003/diff/250001/media/mojo/interfaces/...
File media/mojo/interfaces/video_frame_struct_traits.cc (right):

https://codereview.chromium.org/2908303003/diff/250001/media/mojo/interfaces/...
media/mojo/interfaces/video_frame_struct_traits.cc:89:
DCHECK_EQ(input.end_of_stream(), data.is_null());
On 2017/06/10 00:39:32, dcheng wrote:
> On 2017/06/09 22:07:01, sandersd wrote:
> > On 2017/06/09 21:52:23, dcheng wrote:
> > > Ditto here: this needs to be handled gracefully (which I think it already
> is,
> > > but there shouldn't be a DCHECK)
> > 
> > Yes, in this case we just trust |end_of_stream|, which is not dangerous.
There
> > is no serialization path for them to be out of sync, so this DCHECK isn't
> adding
> > anything beyond a sanity check of the serialization code.
> > 
> > That said, this also looks like a correct use of a DCHECK to me (that is, it
> > verifies a precondition). Why is it so important to remove DCHECKs?
> > 
> > I would propose that the correct solution here is actually to add another
> entry
> > to the VideoFrameData enum to signal EOS; then these fields cannot possibly
be
> > out of sync. (EOS frames would still contain redundant fields, but there
would
> > be no possible source for confusion.)
> 
> But this is deserialization, and a bad process can write whatever it wants. If
> /when we have mojo fuzzing, this DCHECK() will start getting tripped.

Fuzzing false-positives is a very convincing answer :-)

Powered by Google App Engine
This is Rietveld 408576698