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

media / video / BUILD.gn [blame]

# Copyright 2017 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/media_options.gni")

source_set("video") {
  # Do not expand the visibility here without double-checking with OWNERS, this
  # is a roll-up target which is part of the //media component. Most other DEPs
  # should be using //media and not directly DEP this roll-up target.
  visibility = [
    "//media",
    "//media/filters",
    "//media/formats",
    "//media/renderers",
  ]

  sources = [
    "alpha_video_encoder_wrapper.cc",
    "alpha_video_encoder_wrapper.h",
    "gpu_memory_buffer_video_frame_pool.cc",
    "gpu_memory_buffer_video_frame_pool.h",
    "gpu_video_accelerator_factories.cc",
    "gpu_video_accelerator_factories.h",
    "offloading_video_encoder.cc",
    "offloading_video_encoder.h",
    "picture.cc",
    "picture.h",
    "renderable_gpu_memory_buffer_video_frame_pool.cc",
    "renderable_gpu_memory_buffer_video_frame_pool.h",
    "trace_util.cc",
    "trace_util.h",
    "video_decode_accelerator.cc",
    "video_decode_accelerator.h",
    "video_encode_accelerator.cc",
    "video_encode_accelerator.h",
    "video_encode_accelerator_adapter.cc",
    "video_encode_accelerator_adapter.h",
    "video_encoder_fallback.cc",
    "video_encoder_fallback.h",
    "video_encoder_info.cc",
    "video_encoder_info.h",
  ]

  public_deps = [ "//gpu/command_buffer/client:gles2_interface" ]

  deps = [
    "//build:chromeos_buildflags",
    "//gpu/command_buffer/client",
    "//gpu/command_buffer/common",
    "//gpu/ipc/common",
    "//media/base",
    "//third_party/libyuv",
    "//ui/gfx",
    "//ui/gl",
  ]

  configs += [ "//media:subcomponent_config" ]

  if (enable_libaom) {
    sources += [
      "av1_video_encoder.cc",
      "av1_video_encoder.h",
    ]

    public_deps += [ "//third_party/libaom" ]
  }

  if (media_use_libvpx) {
    sources += [
      "vpx_video_encoder.cc",
      "vpx_video_encoder.h",
    ]
    deps += [ "//third_party/libvpx" ]
  }

  if (proprietary_codecs && media_use_openh264) {
    sources += [
      "openh264_video_encoder.cc",
      "openh264_video_encoder.h",
    ]
    deps += [ "//third_party/openh264:encoder" ]
  }

  if (is_apple) {
    deps += [ "//media/base/mac:mac" ]
  }
}

# Note: This is a roll-up only target; do not expand the visibility. DEPS should
# depend on the //media:test_support target instead.
static_library("test_support") {
  visibility = [ "//media:test_support" ]
  testonly = true
  sources = [
    "fake_gpu_memory_buffer.cc",
    "fake_gpu_memory_buffer.h",
    "fake_video_encode_accelerator.cc",
    "fake_video_encode_accelerator.h",
    "mock_gpu_memory_buffer_video_frame_pool.cc",
    "mock_gpu_memory_buffer_video_frame_pool.h",
    "mock_gpu_video_accelerator_factories.cc",
    "mock_gpu_video_accelerator_factories.h",
    "mock_video_encode_accelerator.cc",
    "mock_video_encode_accelerator.h",
  ]
  configs += [ "//media:media_config" ]
  deps = [
    "//base",
    "//gpu/command_buffer/client:gles2_interface",
    "//gpu/command_buffer/common",
    "//media/base:test_support",
    "//services/viz/public/cpp/gpu",
    "//testing/gmock",
    "//ui/gfx",
  ]
}

source_set("unit_tests") {
  testonly = true
  sources = [
    "alpha_video_encoder_wrapper_unittest.cc",
    "gpu_memory_buffer_video_frame_pool_unittest.cc",
    "offloading_video_encoder_unittest.cc",
    "renderable_gpu_memory_buffer_video_frame_pool_unittest.cc",
    "software_video_encoder_test.cc",
    "video_encode_accelerator_adapter_test.cc",
    "video_encoder_fallback_test.cc",
  ]

  configs += [ "//media:media_config" ]
  deps = [
    "//base",
    "//base/test:test_support",
    "//components/viz/test:test_support",
    "//gpu:test_support",
    "//gpu/command_buffer/client:gles2_interface",
    "//gpu/command_buffer/common",
    "//media:test_support",
    "//testing/gmock",
    "//testing/gtest",
    "//third_party/libvpx:libvpx",
    "//third_party/libyuv:libyuv",
    "//ui/gfx",
  ]
}