| OLD | NEW |
| (Empty) | |
| 1 # Copyright 2016 The Chromium Authors. All rights reserved. |
| 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("//build/config/features.gni") |
| 6 import("//build/config/ui.gni") |
| 7 import("//media/gpu/args.gni") |
| 8 import("//media/media_options.gni") |
| 9 import("//testing/test.gni") |
| 10 |
| 11 if (is_mac) { |
| 12 import("//build/config/mac/mac_sdk.gni") |
| 13 } |
| 14 |
| 15 if (is_chromeos && current_cpu != "arm") { |
| 16 action("libva_generate_stubs") { |
| 17 extra_header = "va_stub_header.fragment" |
| 18 |
| 19 script = "../../tools/generate_stubs/generate_stubs.py" |
| 20 sources = [ |
| 21 "va.sigs", |
| 22 ] |
| 23 inputs = [ |
| 24 extra_header, |
| 25 ] |
| 26 if (use_x11) { |
| 27 sources += [ "va_x11.sigs" ] |
| 28 } |
| 29 if (use_ozone) { |
| 30 sources += [ "va_drm.sigs" ] |
| 31 } |
| 32 stubs_filename_root = "va_stubs" |
| 33 |
| 34 outputs = [ |
| 35 "$target_gen_dir/$stubs_filename_root.cc", |
| 36 "$target_gen_dir/$stubs_filename_root.h", |
| 37 ] |
| 38 args = [ |
| 39 "-i", |
| 40 rebase_path("$target_gen_dir", root_build_dir), |
| 41 "-o", |
| 42 rebase_path("$target_gen_dir", root_build_dir), |
| 43 "-t", |
| 44 "posix_stubs", |
| 45 "-e", |
| 46 rebase_path(extra_header, root_build_dir), |
| 47 "-s", |
| 48 stubs_filename_root, |
| 49 "-p", |
| 50 "media/gpu", |
| 51 ] |
| 52 |
| 53 args += rebase_path(sources, root_build_dir) |
| 54 } |
| 55 } |
| 56 |
| 57 if (is_chromeos && use_v4lplugin) { |
| 58 action("libv4l2_generate_stubs") { |
| 59 extra_header = "v4l2_stub_header.fragment" |
| 60 |
| 61 script = "../../tools/generate_stubs/generate_stubs.py" |
| 62 sources = [ |
| 63 "v4l2.sig", |
| 64 ] |
| 65 inputs = [ |
| 66 extra_header, |
| 67 ] |
| 68 stubs_filename_root = "v4l2_stubs" |
| 69 |
| 70 outputs = [ |
| 71 "$target_gen_dir/$stubs_filename_root.cc", |
| 72 "$target_gen_dir/$stubs_filename_root.h", |
| 73 ] |
| 74 args = [ |
| 75 "-i", |
| 76 rebase_path("$target_gen_dir", root_build_dir), |
| 77 "-o", |
| 78 rebase_path("$target_gen_dir", root_build_dir), |
| 79 "-t", |
| 80 "posix_stubs", |
| 81 "-e", |
| 82 rebase_path(extra_header, root_build_dir), |
| 83 "-s", |
| 84 stubs_filename_root, |
| 85 "-p", |
| 86 "media/gpu", |
| 87 ] |
| 88 |
| 89 args += rebase_path(sources, root_build_dir) |
| 90 } |
| 91 } |
| 92 |
| 93 if (is_mac) { |
| 94 action("libvt_generate_stubs") { |
| 95 extra_header = "vt_stubs_header.fragment" |
| 96 |
| 97 script = "../../tools/generate_stubs/generate_stubs.py" |
| 98 sources = [ |
| 99 "vt.sig", |
| 100 ] |
| 101 inputs = [ |
| 102 extra_header, |
| 103 ] |
| 104 stubs_filename_root = "vt_stubs" |
| 105 |
| 106 outputs = [ |
| 107 "$target_gen_dir/$stubs_filename_root.cc", |
| 108 "$target_gen_dir/$stubs_filename_root.h", |
| 109 ] |
| 110 args = [ |
| 111 "-i", |
| 112 rebase_path("$target_gen_dir", root_build_dir), |
| 113 "-o", |
| 114 rebase_path("$target_gen_dir", root_build_dir), |
| 115 "-t", |
| 116 "posix_stubs", |
| 117 "-e", |
| 118 rebase_path(extra_header, root_build_dir), |
| 119 "-s", |
| 120 stubs_filename_root, |
| 121 "-p", |
| 122 "media/gpu", |
| 123 ] |
| 124 |
| 125 args += rebase_path(sources, root_build_dir) |
| 126 } |
| 127 } |
| 128 |
| 129 component("gpu") { |
| 130 output_name = "media_gpu" |
| 131 |
| 132 # Only local test code and, GPU service code in the media layer, and |
| 133 # media-related content code should access //media/gpu. |
| 134 visibility = [ |
| 135 "//content/gpu:*", |
| 136 "//content/public/gpu:*", |
| 137 "//content/renderer:*", |
| 138 "//media/gpu/ipc/service", |
| 139 ":*", |
| 140 ] |
| 141 |
| 142 defines = [ "MEDIA_GPU_IMPLEMENTATION" ] |
| 143 |
| 144 sources = [ |
| 145 "fake_video_decode_accelerator.cc", |
| 146 "fake_video_decode_accelerator.h", |
| 147 "gpu_video_accelerator_util.cc", |
| 148 "gpu_video_accelerator_util.h", |
| 149 "gpu_video_decode_accelerator_factory_impl.cc", |
| 150 "gpu_video_decode_accelerator_factory_impl.h", |
| 151 "gpu_video_decode_accelerator_helpers.h", |
| 152 "shared_memory_region.cc", |
| 153 "shared_memory_region.h", |
| 154 ] |
| 155 |
| 156 public_deps = [ |
| 157 "//base", |
| 158 "//gpu", |
| 159 "//media", |
| 160 "//ui/gfx/geometry", |
| 161 ] |
| 162 deps = [ |
| 163 "//ui/display/types", |
| 164 "//ui/gl", |
| 165 "//ui/platform_window", |
| 166 ] |
| 167 libs = [] |
| 168 ldflags = [] |
| 169 |
| 170 if (is_mac) { |
| 171 sources += [ |
| 172 "vt_mac.h", |
| 173 "vt_video_decode_accelerator_mac.cc", |
| 174 "vt_video_decode_accelerator_mac.h", |
| 175 "vt_video_encode_accelerator_mac.cc", |
| 176 "vt_video_encode_accelerator_mac.h", |
| 177 ] + get_target_outputs(":libvt_generate_stubs") |
| 178 deps += [ ":libvt_generate_stubs" ] |
| 179 lib_dirs = [ "$mac_sdk_path/usr/lib" ] |
| 180 |
| 181 # TODO(markdittmer): Determine which libs are needed here. |
| 182 libs += [ |
| 183 # "AVFoundation.framework", |
| 184 # "CoreMedia.framework", |
| 185 # "CoreVideo.framework", |
| 186 # "IOSurface.framework", |
| 187 # "OpenGL.framework", |
| 188 # "QuartzCore.framework", |
| 189 # "sandbox", |
| 190 ] |
| 191 } |
| 192 |
| 193 if (is_android) { |
| 194 sources += [ |
| 195 "android_copying_backing_strategy.cc", |
| 196 "android_copying_backing_strategy.h", |
| 197 "android_deferred_rendering_backing_strategy.cc", |
| 198 "android_deferred_rendering_backing_strategy.h", |
| 199 "android_video_decode_accelerator.cc", |
| 200 "android_video_decode_accelerator.h", |
| 201 "avda_codec_image.cc", |
| 202 "avda_codec_image.h", |
| 203 "avda_return_on_failure.h", |
| 204 "avda_shared_state.cc", |
| 205 "avda_shared_state.h", |
| 206 "avda_state_provider.h", |
| 207 ] |
| 208 |
| 209 if (enable_webrtc) { |
| 210 deps += [ "//third_party/libyuv" ] |
| 211 sources += [ |
| 212 "android_video_encode_accelerator.cc", |
| 213 "android_video_encode_accelerator.h", |
| 214 ] |
| 215 } |
| 216 |
| 217 if (mojo_media_host == "gpu") { |
| 218 deps += [ "//media/mojo/services:cdm_service" ] |
| 219 } |
| 220 } |
| 221 |
| 222 if (is_chromeos) { |
| 223 sources += [ |
| 224 "accelerated_video_decoder.h", |
| 225 "h264_decoder.cc", |
| 226 "h264_decoder.h", |
| 227 "h264_dpb.cc", |
| 228 "h264_dpb.h", |
| 229 "vp8_decoder.cc", |
| 230 "vp8_decoder.h", |
| 231 "vp8_picture.cc", |
| 232 "vp8_picture.h", |
| 233 "vp9_decoder.cc", |
| 234 "vp9_decoder.h", |
| 235 "vp9_picture.cc", |
| 236 "vp9_picture.h", |
| 237 ] |
| 238 if (use_v4lplugin) { |
| 239 defines += [ "USE_LIBV4L2" ] |
| 240 sources += get_target_outputs(":libv4l2_generate_stubs") |
| 241 deps += [ ":libv4l2_generate_stubs" ] |
| 242 } |
| 243 if (use_v4l2_codec) { |
| 244 defines += [ "USE_V4L2_CODEC" ] |
| 245 deps += [ "//third_party/libyuv" ] |
| 246 sources += [ |
| 247 "generic_v4l2_device.cc", |
| 248 "generic_v4l2_device.h", |
| 249 "v4l2_device.cc", |
| 250 "v4l2_device.h", |
| 251 "v4l2_image_processor.cc", |
| 252 "v4l2_image_processor.h", |
| 253 "v4l2_jpeg_decode_accelerator.cc", |
| 254 "v4l2_jpeg_decode_accelerator.h", |
| 255 "v4l2_slice_video_decode_accelerator.cc", |
| 256 "v4l2_slice_video_decode_accelerator.h", |
| 257 "v4l2_video_decode_accelerator.cc", |
| 258 "v4l2_video_decode_accelerator.h", |
| 259 "v4l2_video_encode_accelerator.cc", |
| 260 "v4l2_video_encode_accelerator.h", |
| 261 ] |
| 262 libs = [ |
| 263 "EGL", |
| 264 "GLESv2", |
| 265 ] |
| 266 } |
| 267 if (current_cpu == "arm") { |
| 268 sources += [ |
| 269 "tegra_v4l2_device.cc", |
| 270 "tegra_v4l2_device.h", |
| 271 ] |
| 272 } |
| 273 if (current_cpu != "arm") { |
| 274 sources += [ |
| 275 "va_surface.h", |
| 276 "vaapi_jpeg_decode_accelerator.cc", |
| 277 "vaapi_jpeg_decode_accelerator.h", |
| 278 "vaapi_jpeg_decoder.cc", |
| 279 "vaapi_jpeg_decoder.h", |
| 280 "vaapi_picture.cc", |
| 281 "vaapi_picture.h", |
| 282 "vaapi_video_decode_accelerator.cc", |
| 283 "vaapi_video_decode_accelerator.h", |
| 284 "vaapi_video_encode_accelerator.cc", |
| 285 "vaapi_video_encode_accelerator.h", |
| 286 "vaapi_wrapper.cc", |
| 287 "vaapi_wrapper.h", |
| 288 ] + get_target_outputs(":libva_generate_stubs") |
| 289 configs += [ |
| 290 "//third_party/libva:libva_config", |
| 291 "//third_party/libyuv:libyuv_config", |
| 292 ] |
| 293 deps += [ |
| 294 ":libva_generate_stubs", |
| 295 "//media", |
| 296 "//third_party/libyuv", |
| 297 ] |
| 298 if (use_x11) { |
| 299 sources += [ |
| 300 "vaapi_tfp_picture.cc", |
| 301 "vaapi_tfp_picture.h", |
| 302 ] |
| 303 } |
| 304 if (use_ozone) { |
| 305 sources += [ |
| 306 "vaapi_drm_picture.cc", |
| 307 "vaapi_drm_picture.h", |
| 308 ] |
| 309 } |
| 310 } |
| 311 } |
| 312 |
| 313 if (is_win) { |
| 314 sources += [ |
| 315 "dxva_video_decode_accelerator_win.cc", |
| 316 "dxva_video_decode_accelerator_win.h", |
| 317 ] |
| 318 configs += [ |
| 319 "//build/config/compiler:no_size_t_to_int_warning", |
| 320 "//third_party/khronos:khronos_headers", |
| 321 ] |
| 322 deps += [ "//ui/gl" ] |
| 323 libs += [ |
| 324 "d3d9.lib", |
| 325 "d3d11.lib", |
| 326 "dxva2.lib", |
| 327 "strmiids.lib", |
| 328 "mf.lib", |
| 329 "mfplat.lib", |
| 330 "mfuuid.lib", |
| 331 ] |
| 332 ldflags += [ |
| 333 "/DELAYLOAD:d3d9.dll", |
| 334 "/DELAYLOAD:d3d11.dll", |
| 335 "/DELAYLOAD:dxva2.dll", |
| 336 "/DELAYLOAD:mf.dll", |
| 337 "/DELAYLOAD:mfplat.dll", |
| 338 ] |
| 339 |
| 340 # TODO(GYP): extract_xinput action. |
| 341 } |
| 342 |
| 343 if (use_x11) { |
| 344 deps += [ "//ui/gfx/x" ] |
| 345 } |
| 346 } |
| 347 |
| 348 if (is_android) { |
| 349 # TODO(GYP): Port Windows and ChromeOS logic. |
| 350 test("video_decode_accelerator_unittest") { |
| 351 deps = [ |
| 352 ":gpu", |
| 353 "//base", |
| 354 "//media", |
| 355 "//testing/gtest", |
| 356 "//ui/base", |
| 357 "//ui/gfx", |
| 358 "//ui/gfx:test_support", |
| 359 "//ui/gfx/geometry", |
| 360 "//ui/gl", |
| 361 "//ui/gl:test_support", |
| 362 ] |
| 363 configs += [ "//third_party/khronos:khronos_headers" ] |
| 364 sources = [ |
| 365 "video_accelerator_unittest_helpers.h", |
| 366 ] |
| 367 if (is_android) { |
| 368 sources += [ "android_video_decode_accelerator_unittest.cc" ] |
| 369 } else { |
| 370 sources += [ |
| 371 "rendering_helper.cc", |
| 372 "rendering_helper.h", |
| 373 "video_decode_accelerator_unittest.cc", |
| 374 ] |
| 375 } |
| 376 |
| 377 if (is_android) { |
| 378 deps += [ |
| 379 "//gpu:test_support", |
| 380 "//media/base/android", |
| 381 "//media/base/android:media_java", |
| 382 "//media/capture/video/android:capture_java", |
| 383 "//testing/gmock", |
| 384 "//ui/android:ui_java", |
| 385 ] |
| 386 } |
| 387 } |
| 388 } |
| OLD | NEW |