[M120 Migration][MM] Framerate calculation
[platform/framework/web/chromium-efl.git] / media / mojo / mojom / supported_video_decoder_config_mojom_traits.h
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.
4
5 #ifndef MEDIA_MOJO_MOJOM_SUPPORTED_VIDEO_DECODER_CONFIG_MOJOM_TRAITS_H_
6 #define MEDIA_MOJO_MOJOM_SUPPORTED_VIDEO_DECODER_CONFIG_MOJOM_TRAITS_H_
7
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"
13
14 namespace mojo {
15
16 template <>
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;
22   }
23
24   static media::VideoCodecProfile profile_max(
25       const media::SupportedVideoDecoderConfig& input) {
26     return input.profile_max;
27   }
28
29   static const gfx::Size& coded_size_min(
30       const media::SupportedVideoDecoderConfig& input) {
31     return input.coded_size_min;
32   }
33
34   static const gfx::Size& coded_size_max(
35       const media::SupportedVideoDecoderConfig& input) {
36     return input.coded_size_max;
37   }
38
39   static bool allow_encrypted(const media::SupportedVideoDecoderConfig& input) {
40     return input.allow_encrypted;
41   }
42
43   static bool require_encrypted(
44       const media::SupportedVideoDecoderConfig& input) {
45     return input.require_encrypted;
46   }
47
48   static bool Read(media::mojom::SupportedVideoDecoderConfigDataView input,
49                    media::SupportedVideoDecoderConfig* output);
50 };
51
52 }  // namespace mojo
53
54 #endif  // MEDIA_MOJO_MOJOM_SUPPORTED_VIDEO_DECODER_CONFIG_MOJOM_TRAITS_H_