summaryrefslogtreecommitdiff
path: root/chromium/media/mojo/mojom/stable/BUILD.gn
blob: dd961a6853f432f2579c6ca9ed3331f14658e31f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
# Copyright 2021 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

import("//media/gpu/args.gni")
import("//mojo/public/tools/bindings/mojom.gni")

mojom("stable_video_decoder") {
  generate_java = true

  sources = [
    "stable_video_decoder.mojom",
    "stable_video_decoder_types.mojom",
  ]

  enabled_features = []
  if (is_linux || is_chromeos_ash) {
    enabled_features += [ "is_linux_or_chromeos_ash" ]
  }

  public_deps = [
    ":native_pixmap_handle",
    "//media/mojo/mojom:encryption_pattern",
    "//mojo/public/mojom/base",
    "//sandbox/policy/mojom",
    "//ui/gfx/geometry/mojom",
    "//ui/gfx/mojom",
  ]

  cpp_typemaps = [
    {
      types = [
        {
          mojom = "media.stable.mojom.CdmContextEvent"
          cpp = "::media::CdmContext::Event"
        },
        {
          mojom = "media.stable.mojom.ColorSpacePrimaryID"
          cpp = "::gfx::ColorSpace::PrimaryID"
        },
        {
          mojom = "media.stable.mojom.ColorSpaceTransferID"
          cpp = "::gfx::ColorSpace::TransferID"
        },
        {
          mojom = "media.stable.mojom.ColorSpaceMatrixID"
          cpp = "::gfx::ColorSpace::MatrixID"
        },
        {
          mojom = "media.stable.mojom.ColorSpaceRangeID"
          cpp = "::gfx::ColorSpace::RangeID"
        },
        {
          mojom = "media.stable.mojom.ColorSpace"
          cpp = "::gfx::ColorSpace"
        },
        {
          mojom = "media.stable.mojom.ColorVolumeMetadata"
          cpp = "::gfx::ColorVolumeMetadata"
        },
        {
          mojom = "media.stable.mojom.DecoderBuffer"
          cpp = "::scoped_refptr<::media::DecoderBuffer>"
          nullable_is_same_type = true
        },
        {
          mojom = "media.stable.mojom.DecryptConfig"
          cpp = "::std::unique_ptr<::media::DecryptConfig>"
          move_only = true
          nullable_is_same_type = true
        },
        {
          mojom = "media.stable.mojom.DecryptStatus"
          cpp = "::media::Decryptor::Status"
        },
        {
          mojom = "media.stable.mojom.EncryptionScheme"
          cpp = "::media::EncryptionScheme"
        },
        {
          mojom = "media.stable.mojom.HDRMetadata"
          cpp = "::gfx::HDRMetadata"
        },
        {
          mojom = "media.stable.mojom.MediaLogRecord.Type"
          cpp = "::media::MediaLogRecord::Type"
        },
        {
          mojom = "media.stable.mojom.MediaLogRecord"
          cpp = "::media::MediaLogRecord"
        },
        {
          mojom = "media.stable.mojom.NativeGpuMemoryBufferHandle"
          cpp = "::gfx::GpuMemoryBufferHandle"
          move_only = true
        },
        {
          mojom = "media.stable.mojom.StatusData"
          cpp = "::media::internal::StatusData"
        },
        {
          mojom = "media.stable.mojom.Status"
          cpp = "::media::DecoderStatus"
        },
        {
          mojom = "media.stable.mojom.SubsampleEntry"
          cpp = "::media::SubsampleEntry"
        },
        {
          mojom = "media.stable.mojom.SupportedVideoDecoderConfig"
          cpp = "::media::SupportedVideoDecoderConfig"
        },
        {
          mojom = "media.stable.mojom.VideoCodec"
          cpp = "::media::VideoCodec"
        },
        {
          mojom = "media.stable.mojom.VideoCodecProfile"
          cpp = "::media::VideoCodecProfile"
        },
        {
          mojom = "media.stable.mojom.VideoDecoderConfig"
          cpp = "::media::VideoDecoderConfig"
        },
        {
          mojom = "media.stable.mojom.VideoDecoderType"
          cpp = "::media::VideoDecoderType"
        },
        {
          mojom = "media.stable.mojom.VideoFrame"
          cpp = "::scoped_refptr<::media::VideoFrame>"
          nullable_is_same_type = true
        },
        {
          mojom = "media.stable.mojom.VideoFrameMetadata"
          cpp = "::media::VideoFrameMetadata"
        },
        {
          mojom = "media.stable.mojom.VideoPixelFormat"
          cpp = "::media::VideoPixelFormat"
        },
        {
          mojom = "media.stable.mojom.WaitingReason"
          cpp = "::media::WaitingReason"
        },
      ]
      traits_headers = [ "stable_video_decoder_types_mojom_traits.h" ]
      traits_sources = [ "stable_video_decoder_types_mojom_traits.cc" ]
      traits_deps = [
        "//gpu/ipc/common",
        "//media/gpu:buffer_validation",
      ]

      if (use_vaapi) {
        traits_deps += [ "//media/gpu/vaapi:vaapi_status" ]
      }

      if (use_v4l2_codec) {
        traits_deps += [ "//media/gpu/v4l2:v4l2_status" ]
      }
    },
  ]
}

mojom("native_pixmap_handle") {
  generate_java = true

  sources = [ "native_pixmap_handle.mojom" ]

  if (is_linux || is_chromeos) {
    cpp_typemaps = [
      {
        types = [
          {
            mojom = "media.stable.mojom.NativePixmapHandle"
            cpp = "::gfx::NativePixmapHandle"
            move_only = true
          },
          {
            mojom = "media.stable.mojom.NativePixmapPlane"
            cpp = "::gfx::NativePixmapPlane"
            move_only = true
          },
        ]
        traits_headers = [
          "native_pixmap_handle_mojom_traits.h",
          "//ui/gfx/native_pixmap_handle.h",
        ]
        traits_sources = [ "native_pixmap_handle_mojom_traits.cc" ]
        traits_public_deps = [ "//ui/gfx:memory_buffer" ]
      },
    ]
  }
}