chromium/media/capture/mojom/BUILD.gn

# Copyright 2016 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

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

mojom("video_capture") {
  generate_java = true
  sources = [ "video_capture.mojom" ]

  public_deps = [
    ":video_capture_buffer",
    ":video_capture_types",
    "//mojo/public/mojom/base",
    "//ui/gfx/geometry/mojom",
  ]

  export_class_attribute_blink = "BLINK_PLATFORM_EXPORT"
  export_define_blink = "BLINK_PLATFORM_IMPLEMENTATION=1"
  export_header_blink = "third_party/blink/public/platform/web_common.h"
}

mojom("video_capture_buffer") {
  generate_java = true
  sources = [ "video_capture_buffer.mojom" ]

  public_deps = [
    ":video_capture_types",
    "//gpu/ipc/common:interfaces",
    "//media//mojo/mojom:mojom",
    "//mojo/public/mojom/base",
    "//services/viz/public/mojom:shared_image_format",
    "//ui/gfx/geometry/mojom",
    "//ui/gfx/mojom",
  ]

  export_class_attribute_blink = "BLINK_PLATFORM_EXPORT"
  export_define_blink = "BLINK_PLATFORM_IMPLEMENTATION=1"
  export_header_blink = "third_party/blink/public/platform/web_common.h"
}

mojom("video_capture_types") {
  generate_java = true
  sources = [ "video_capture_types.mojom" ]

  public_deps = [
    "//mojo/public/mojom/base",
    "//ui/gfx/geometry/mojom",
  ]

  export_class_attribute_blink = "BLINK_PLATFORM_EXPORT"
  export_define_blink = "BLINK_PLATFORM_IMPLEMENTATION=1"
  export_header_blink = "third_party/blink/public/platform/web_common.h"

  shared_video_capture_cpp_typemap = {
    types = [
      {
        mojom = "media.mojom.ResolutionChangePolicy"
        cpp = "::media::ResolutionChangePolicy"
      },
      {
        mojom = "media.mojom.PowerLineFrequency"
        cpp = "::media::PowerLineFrequency"
      },
      {
        mojom = "media.mojom.VideoCapturePixelFormat"
        cpp = "::media::VideoPixelFormat"
      },
      {
        mojom = "media.mojom.VideoCaptureBufferType"
        cpp = "::media::VideoCaptureBufferType"
      },
      {
        mojom = "media.mojom.VideoCaptureControlSupport"
        cpp = "::media::VideoCaptureControlSupport"
      },
      {
        mojom = "media.mojom.VideoCaptureError"
        cpp = "::media::VideoCaptureError"
      },
      {
        mojom = "media.mojom.VideoCaptureFeedback"
        cpp = "::media::VideoCaptureFeedback"
      },
      {
        mojom = "media.mojom.VideoCaptureFrameDropReason"
        cpp = "::media::VideoCaptureFrameDropReason"
      },
      {
        mojom = "media.mojom.VideoCaptureFormat"
        cpp = "::media::VideoCaptureFormat"
      },
      {
        mojom = "media.mojom.VideoCaptureParams"
        cpp = "::media::VideoCaptureParams"
      },
      {
        mojom = "media.mojom.VideoCaptureDeviceDescriptor"
        cpp = "::media::VideoCaptureDeviceDescriptor"
      },
      {
        mojom = "media.mojom.VideoCaptureDeviceInfo"
        cpp = "::media::VideoCaptureDeviceInfo"
      },
      {
        mojom = "media.mojom.VideoFacingMode"
        cpp = "::media::VideoFacingMode"
      },
    ]
    traits_headers = [ "video_capture_types_mojom_traits.h" ]
    traits_public_deps = [ ":video_capture_mojom_support" ]
  }

  cpp_typemaps = [ shared_video_capture_cpp_typemap ]
  blink_cpp_typemaps = [ shared_video_capture_cpp_typemap ]
}

mojom("video_effects_manager") {
  sources = [ "video_effects_manager.mojom" ]

  public_deps = [
    "//mojo/public/mojom/base",
    "//ui/gfx/geometry/mojom",
  ]
}

component("video_capture_mojom_support") {
  sources = [
    "video_capture_types_mojom_traits.cc",
    "video_capture_types_mojom_traits.h",
  ]
  public_deps = [
    ":video_capture_shared_cpp_sources",
    "//media/capture:capture_base",
  ]
  deps = [
    "//media/base:video_facing",
    "//ui/gfx/geometry/mojom",
  ]
  defines = [ "IS_MEDIA_CAPTURE_MOJOM_TRAITS_IMPL" ]
}

mojom("image_capture") {
  sources = [ "image_capture.mojom" ]

  # ImageCapture Mojom interfaces are exposed publicly to layout tests which use
  # prepackaged redistributable JS bindings. It is therefore not desirable to
  # scramble these messages.
  scramble_message_ids = false
  webui_module_path = "/media/capture/mojom"

  # Since these are exposed to layout tests, they need legacy bindings as
  # well.
  generate_legacy_js_bindings = true
}

source_set("image_capture_types") {
  sources = [
    "image_capture_types.cc",
    "image_capture_types.h",
  ]

  deps = [ ":image_capture" ]
}