Kaido Kert | 25902c6 | 2024-06-17 17:10:28 -0700 | [diff] [blame^] | 1 | # Copyright 2017 The Chromium Authors |
Kaido Kert | 08336fa | 2022-02-08 14:10:50 -0800 | [diff] [blame] | 2 | # Use of this source code is governed by a BSD-style license that can be |
| 3 | # found in the LICENSE file. |
| 4 | |
| 5 | import("//media/media_options.gni") |
| 6 | |
| 7 | source_set("video") { |
| 8 | # Do not expand the visibility here without double-checking with OWNERS, this |
| 9 | # is a roll-up target which is part of the //media component. Most other DEPs |
| 10 | # should be using //media and not directly DEP this roll-up target. |
| 11 | visibility = [ |
| 12 | "//media", |
| 13 | "//media/filters", |
| 14 | "//media/formats", |
| 15 | "//media/renderers", |
| 16 | ] |
| 17 | |
| 18 | sources = [ |
Kaido Kert | 25902c6 | 2024-06-17 17:10:28 -0700 | [diff] [blame^] | 19 | "bit_reader_macros.h", |
Kaido Kert | 08336fa | 2022-02-08 14:10:50 -0800 | [diff] [blame] | 20 | "gpu_memory_buffer_video_frame_pool.cc", |
| 21 | "gpu_memory_buffer_video_frame_pool.h", |
| 22 | "gpu_video_accelerator_factories.cc", |
| 23 | "gpu_video_accelerator_factories.h", |
| 24 | "h264_bit_reader.cc", |
| 25 | "h264_bit_reader.h", |
| 26 | "h264_level_limits.cc", |
| 27 | "h264_level_limits.h", |
| 28 | "h264_parser.cc", |
| 29 | "h264_parser.h", |
| 30 | "h264_poc.cc", |
| 31 | "h264_poc.h", |
| 32 | "half_float_maker.cc", |
| 33 | "half_float_maker.h", |
Kaido Kert | 25902c6 | 2024-06-17 17:10:28 -0700 | [diff] [blame^] | 34 | "offloading_video_encoder.cc", |
| 35 | "offloading_video_encoder.h", |
Kaido Kert | 08336fa | 2022-02-08 14:10:50 -0800 | [diff] [blame] | 36 | "picture.cc", |
| 37 | "picture.h", |
| 38 | "renderable_gpu_memory_buffer_video_frame_pool.cc", |
| 39 | "renderable_gpu_memory_buffer_video_frame_pool.h", |
| 40 | "trace_util.cc", |
| 41 | "trace_util.h", |
| 42 | "video_decode_accelerator.cc", |
| 43 | "video_decode_accelerator.h", |
| 44 | "video_encode_accelerator.cc", |
| 45 | "video_encode_accelerator.h", |
| 46 | "video_encode_accelerator_adapter.cc", |
| 47 | "video_encode_accelerator_adapter.h", |
| 48 | "video_encoder_fallback.cc", |
| 49 | "video_encoder_fallback.h", |
| 50 | "video_encoder_info.cc", |
| 51 | "video_encoder_info.h", |
| 52 | ] |
| 53 | |
| 54 | if (enable_platform_hevc) { |
| 55 | sources += [ |
| 56 | "h265_nalu_parser.cc", |
| 57 | "h265_nalu_parser.h", |
| 58 | ] |
Kaido Kert | 25902c6 | 2024-06-17 17:10:28 -0700 | [diff] [blame^] | 59 | if (enable_hevc_parser_and_hw_decoder) { |
Kaido Kert | 08336fa | 2022-02-08 14:10:50 -0800 | [diff] [blame] | 60 | sources += [ |
| 61 | "h265_parser.cc", |
| 62 | "h265_parser.h", |
Kaido Kert | 25902c6 | 2024-06-17 17:10:28 -0700 | [diff] [blame^] | 63 | "h265_poc.cc", |
| 64 | "h265_poc.h", |
Kaido Kert | 08336fa | 2022-02-08 14:10:50 -0800 | [diff] [blame] | 65 | ] |
| 66 | } |
| 67 | } |
| 68 | |
| 69 | public_deps = [ "//gpu/command_buffer/client:gles2_interface" ] |
| 70 | |
| 71 | deps = [ |
| 72 | "//build:chromeos_buildflags", |
| 73 | "//gpu/command_buffer/client", |
| 74 | "//gpu/command_buffer/common", |
| 75 | "//gpu/ipc/common", |
| 76 | "//media/base", |
| 77 | "//third_party/libyuv", |
| 78 | "//ui/gfx", |
| 79 | "//ui/gl", |
| 80 | ] |
| 81 | |
| 82 | configs += [ "//media:subcomponent_config" ] |
| 83 | |
Kaido Kert | 25902c6 | 2024-06-17 17:10:28 -0700 | [diff] [blame^] | 84 | if (enable_libaom) { |
| 85 | sources += [ |
| 86 | "av1_video_encoder.cc", |
| 87 | "av1_video_encoder.h", |
| 88 | ] |
| 89 | |
| 90 | public_deps += [ "//third_party/libaom" ] |
| 91 | } |
| 92 | |
Kaido Kert | 08336fa | 2022-02-08 14:10:50 -0800 | [diff] [blame] | 93 | if (media_use_libvpx) { |
| 94 | sources += [ |
| 95 | "vpx_video_encoder.cc", |
| 96 | "vpx_video_encoder.h", |
| 97 | ] |
| 98 | deps += [ "//third_party/libvpx" ] |
| 99 | } |
| 100 | |
| 101 | if (proprietary_codecs && media_use_openh264) { |
| 102 | sources += [ |
| 103 | "openh264_video_encoder.cc", |
| 104 | "openh264_video_encoder.h", |
| 105 | ] |
| 106 | deps += [ "//third_party/openh264:encoder" ] |
| 107 | } |
| 108 | } |
| 109 | |
| 110 | # Note: This is a roll-up only target; do not expand the visibility. DEPS should |
| 111 | # depend on the //media:test_support target instead. |
| 112 | static_library("test_support") { |
| 113 | visibility = [ "//media:test_support" ] |
| 114 | testonly = true |
| 115 | sources = [ |
| 116 | "fake_gpu_memory_buffer.cc", |
| 117 | "fake_gpu_memory_buffer.h", |
| 118 | "fake_video_encode_accelerator.cc", |
| 119 | "fake_video_encode_accelerator.h", |
| 120 | "mock_gpu_memory_buffer_video_frame_pool.cc", |
| 121 | "mock_gpu_memory_buffer_video_frame_pool.h", |
| 122 | "mock_gpu_video_accelerator_factories.cc", |
| 123 | "mock_gpu_video_accelerator_factories.h", |
| 124 | "mock_video_decode_accelerator.cc", |
| 125 | "mock_video_decode_accelerator.h", |
| 126 | "mock_video_encode_accelerator.cc", |
| 127 | "mock_video_encode_accelerator.h", |
| 128 | ] |
| 129 | configs += [ "//media:media_config" ] |
| 130 | deps = [ |
| 131 | "//base", |
| 132 | "//gpu/command_buffer/client:gles2_interface", |
| 133 | "//gpu/command_buffer/common", |
| 134 | "//media/base:test_support", |
| 135 | "//services/viz/public/cpp/gpu", |
| 136 | "//testing/gmock", |
| 137 | "//ui/gfx", |
| 138 | ] |
| 139 | } |
| 140 | |
| 141 | source_set("unit_tests") { |
| 142 | testonly = true |
| 143 | sources = [ |
| 144 | "gpu_memory_buffer_video_frame_pool_unittest.cc", |
| 145 | "h264_bit_reader_unittest.cc", |
| 146 | "h264_parser_unittest.cc", |
| 147 | "h264_poc_unittest.cc", |
| 148 | "half_float_maker_unittest.cc", |
Kaido Kert | 25902c6 | 2024-06-17 17:10:28 -0700 | [diff] [blame^] | 149 | "offloading_video_encoder_unittest.cc", |
Kaido Kert | 08336fa | 2022-02-08 14:10:50 -0800 | [diff] [blame] | 150 | "renderable_gpu_memory_buffer_video_frame_pool_unittest.cc", |
| 151 | "software_video_encoder_test.cc", |
| 152 | "video_encode_accelerator_adapter_test.cc", |
| 153 | "video_encoder_fallback_test.cc", |
| 154 | ] |
| 155 | if (enable_platform_hevc) { |
| 156 | sources += [ "h265_nalu_parser_unittest.cc" ] |
Kaido Kert | 25902c6 | 2024-06-17 17:10:28 -0700 | [diff] [blame^] | 157 | if (enable_hevc_parser_and_hw_decoder) { |
| 158 | sources += [ |
| 159 | "h265_parser_unittest.cc", |
| 160 | "h265_poc_unittest.cc", |
| 161 | ] |
Kaido Kert | 08336fa | 2022-02-08 14:10:50 -0800 | [diff] [blame] | 162 | } |
| 163 | } |
| 164 | |
| 165 | configs += [ "//media:media_config" ] |
| 166 | deps = [ |
| 167 | "//base", |
| 168 | "//base/test:test_support", |
| 169 | "//components/viz/test:test_support", |
| 170 | "//gpu:test_support", |
| 171 | "//gpu/command_buffer/client:gles2_interface", |
| 172 | "//gpu/command_buffer/common", |
| 173 | "//media:test_support", |
| 174 | "//testing/gmock", |
| 175 | "//testing/gtest", |
Kaido Kert | 25902c6 | 2024-06-17 17:10:28 -0700 | [diff] [blame^] | 176 | "//third_party/libvpx:libvpx", |
Kaido Kert | 08336fa | 2022-02-08 14:10:50 -0800 | [diff] [blame] | 177 | "//third_party/libyuv:libyuv", |
| 178 | "//ui/gfx", |
| 179 | ] |
| 180 | } |
| 181 | |
| 182 | fuzzer_test("media_h264_parser_fuzzer") { |
| 183 | sources = [ "h264_parser_fuzzertest.cc" ] |
| 184 | deps = [ |
| 185 | "//base", |
| 186 | "//media", |
| 187 | "//ui/gfx/geometry", |
| 188 | ] |
| 189 | } |
| 190 | |
Kaido Kert | 25902c6 | 2024-06-17 17:10:28 -0700 | [diff] [blame^] | 191 | if (enable_hevc_parser_and_hw_decoder) { |
Kaido Kert | 08336fa | 2022-02-08 14:10:50 -0800 | [diff] [blame] | 192 | fuzzer_test("media_h265_parser_fuzzer") { |
| 193 | sources = [ "h265_parser_fuzzertest.cc" ] |
| 194 | deps = [ |
| 195 | "//base", |
| 196 | "//media", |
| 197 | ] |
| 198 | } |
| 199 | } |