1 // Copyright 2019 The Chromium Authors
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef MEDIA_MOJO_MOJOM_SUPPORTED_VIDEO_DECODER_CONFIG_MOJOM_TRAITS_H_
6 #define MEDIA_MOJO_MOJOM_SUPPORTED_VIDEO_DECODER_CONFIG_MOJOM_TRAITS_H_
8 #include "media/base/ipc/media_param_traits.h"
9 #include "media/base/supported_video_decoder_config.h"
10 #include "media/mojo/mojom/media_types.mojom.h"
11 #include "media/mojo/mojom/video_decoder.mojom.h"
12 #include "ui/gfx/geometry/mojom/geometry_mojom_traits.h"
17 struct StructTraits<media::mojom::SupportedVideoDecoderConfigDataView,
18 media::SupportedVideoDecoderConfig> {
19 static media::VideoCodecProfile profile_min(
20 const media::SupportedVideoDecoderConfig& input) {
21 return input.profile_min;
24 static media::VideoCodecProfile profile_max(
25 const media::SupportedVideoDecoderConfig& input) {
26 return input.profile_max;
29 static const gfx::Size& coded_size_min(
30 const media::SupportedVideoDecoderConfig& input) {
31 return input.coded_size_min;
34 static const gfx::Size& coded_size_max(
35 const media::SupportedVideoDecoderConfig& input) {
36 return input.coded_size_max;
39 static bool allow_encrypted(const media::SupportedVideoDecoderConfig& input) {
40 return input.allow_encrypted;
43 static bool require_encrypted(
44 const media::SupportedVideoDecoderConfig& input) {
45 return input.require_encrypted;
48 static bool Read(media::mojom::SupportedVideoDecoderConfigDataView input,
49 media::SupportedVideoDecoderConfig* output);
54 #endif // MEDIA_MOJO_MOJOM_SUPPORTED_VIDEO_DECODER_CONFIG_MOJOM_TRAITS_H_