Issue metadata
Sign in to add a comment
|
media_types.mojom contains many duplicate structs that are only used in C++. Should use IPC::ParamTraits instead |
||||||||||||||||||||||||
Issue descriptionSince this interface is only by C++ code and it's just for sending existing C++ classes, there's no need to duplicate all the media classes/structs in mojom. The existing classes can be sent and their existing IPC::ParamTraits used. See https://www.chromium.org/developers/design-documents/mojo/type-mapping#TOC-Using-Existing-IPC::ParamTraits See https://codereview.chromium.org/1896883002/ as an example of where we're sending a NativeStruct over mojo. Assigning to xhwang as initial owner; feel free to redirect. This should be a small amount of work but removes a lot of duplication and type conversions.
,
May 17 2016
IPC::ParamTraits don't exist[1][2][3] for most of the structs in media_types.mojom. Is the long term goal to use this IPC mechanism, or will we eventually move to defining it completely in mojom and remove the IPC stuff anyway? [1] chromecast code defines IPC::ParamTraits for AudioDecoderConfig, VideoDecoderConfig, and EncryptionScheme. They could be moved into the media code. [2] There is also an existing IPC_STRUCT_TRAITS_BEGIN(media::SubsampleEntry) in the media code. [3] There are no IPC::ParamTraits for media::DecryptConfig, media::DecoderBuffer, media::AudioBuffer, and media::VideoFrame. media::VideoFrame in particular supports multiple variants, with a mojo variant that uses mojo shared memory, so making a generic IPC::ParamTraits would be tough.
,
May 17 2016
Really? I saw that most of the structs/enums in media_types.mojom have IPC::ParamTraits. Some are not in media/, but can move as you say. These should all be used and then we can avoid duplicate structs. For the last few structs, we could create IPC param traits for existing structs. I'm guessing that'll be less work than typemaps/convertors/duplicate structs? For VideoFrame, if the mojom is using shared memory then sure we can keep that one in mojom :)
,
May 19 2016
I didn't check the enums. Out of the 9 enums used, 2 have IPC code in media/, and 6 are in chromecast. chromecast/common/media/cma_param_traits.cc has a note[1] that they can't use the definitions in media, not exactly sure why. I'm trying to determine the benefit of this. The document referenced in the original states "this should only be done if the interface will only be used by C++ and some factors prevent you from moving the definition to a mojom." We already have all the typemaps/convertors/etc. written for the types in media_types.mojom. Is this just to save duplicate code? What is the plan after we deprecate IPC? [1] https://code.google.com/p/chromium/codesearch#chromium/src/chromecast/common/media/cma_param_traits.cc&q=ChannelLayout%20IPC_ENUM&sq=package:chromium&type=cs&l=26
,
Sep 28 2016
For most of our types we don't have IPC::ParamTraits. We used to have some in chromecast code but they were removed since chromecast has switched to use mojo instead of IPC. With that I think we'll just use StructTraits instead of IPC::ParamTraits, which is tracked by issue 611224.
,
Oct 5 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/a24563fb83909069d596263b44269611e2d6c439 commit a24563fb83909069d596263b44269611e2d6c439 Author: jrummell <jrummell@chromium.org> Date: Wed Oct 05 03:40:08 2016 media: Use IPC_STRUCT_TRAITS to convert SubsampleEntry for mojo Rather than use a TypeConvertor, reference the existing IPC_STRUCT_TRAITS. BUG= 611750 TEST=media_mojo_unittests pass Review-Url: https://codereview.chromium.org/2388383002 Cr-Commit-Position: refs/heads/master@{#423066} [modify] https://crrev.com/a24563fb83909069d596263b44269611e2d6c439/media/base/ipc/media_param_traits_macros.h [modify] https://crrev.com/a24563fb83909069d596263b44269611e2d6c439/media/gpu/ipc/common/OWNERS [modify] https://crrev.com/a24563fb83909069d596263b44269611e2d6c439/media/gpu/ipc/common/media_param_traits_macros.h [modify] https://crrev.com/a24563fb83909069d596263b44269611e2d6c439/media/mojo/common/media_type_converters.cc [modify] https://crrev.com/a24563fb83909069d596263b44269611e2d6c439/media/mojo/common/media_type_converters.h [modify] https://crrev.com/a24563fb83909069d596263b44269611e2d6c439/media/mojo/interfaces/media_types.mojom [add] https://crrev.com/a24563fb83909069d596263b44269611e2d6c439/media/mojo/interfaces/media_types.typemap [modify] https://crrev.com/a24563fb83909069d596263b44269611e2d6c439/media/mojo/interfaces/typemaps.gni
,
Oct 5 2016
CC olka & maxmorin FYI |
|||||||||||||||||||||||||
►
Sign in to add a comment |
|||||||||||||||||||||||||
Comment 1 by xhw...@chromium.org
, May 13 2016Components: Internals>Media>Mojo
Labels: OS-All
Owner: jrumm...@chromium.org