| 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, GPU-related IPC 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/*", |
| 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 "avda_surface_tracker.cc", |
| 208 "avda_surface_tracker.h", |
| 209 ] |
| 210 |
| 211 if (enable_webrtc) { |
| 212 deps += [ "//third_party/libyuv" ] |
| 213 sources += [ |
| 214 "android_video_encode_accelerator.cc", |
| 215 "android_video_encode_accelerator.h", |
| 216 ] |
| 217 } |
| 218 |
| 219 if (mojo_media_host == "gpu") { |
| 220 deps += [ "//media/mojo/services:cdm_service" ] |
| 221 } |
| 222 } |
| 223 |
| 224 if (is_chromeos) { |
| 225 sources += [ |
| 226 "accelerated_video_decoder.h", |
| 227 "h264_decoder.cc", |
| 228 "h264_decoder.h", |
| 229 "h264_dpb.cc", |
| 230 "h264_dpb.h", |
| 231 "vp8_decoder.cc", |
| 232 "vp8_decoder.h", |
| 233 "vp8_picture.cc", |
| 234 "vp8_picture.h", |
| 235 "vp9_decoder.cc", |
| 236 "vp9_decoder.h", |
| 237 "vp9_picture.cc", |
| 238 "vp9_picture.h", |
| 239 ] |
| 240 if (use_v4lplugin) { |
| 241 defines += [ "USE_LIBV4L2" ] |
| 242 sources += get_target_outputs(":libv4l2_generate_stubs") |
| 243 deps += [ ":libv4l2_generate_stubs" ] |
| 244 } |
| 245 if (use_v4l2_codec) { |
| 246 defines += [ "USE_V4L2_CODEC" ] |
| 247 deps += [ "//third_party/libyuv" ] |
| 248 sources += [ |
| 249 "generic_v4l2_device.cc", |
| 250 "generic_v4l2_device.h", |
| 251 "v4l2_device.cc", |
| 252 "v4l2_device.h", |
| 253 "v4l2_image_processor.cc", |
| 254 "v4l2_image_processor.h", |
| 255 "v4l2_jpeg_decode_accelerator.cc", |
| 256 "v4l2_jpeg_decode_accelerator.h", |
| 257 "v4l2_slice_video_decode_accelerator.cc", |
| 258 "v4l2_slice_video_decode_accelerator.h", |
| 259 "v4l2_video_decode_accelerator.cc", |
| 260 "v4l2_video_decode_accelerator.h", |
| 261 "v4l2_video_encode_accelerator.cc", |
| 262 "v4l2_video_encode_accelerator.h", |
| 263 ] |
| 264 libs = [ |
| 265 "EGL", |
| 266 "GLESv2", |
| 267 ] |
| 268 } |
| 269 if (current_cpu == "arm") { |
| 270 sources += [ |
| 271 "tegra_v4l2_device.cc", |
| 272 "tegra_v4l2_device.h", |
| 273 ] |
| 274 } |
| 275 if (current_cpu != "arm") { |
| 276 sources += [ |
| 277 "va_surface.h", |
| 278 "vaapi_jpeg_decode_accelerator.cc", |
| 279 "vaapi_jpeg_decode_accelerator.h", |
| 280 "vaapi_jpeg_decoder.cc", |
| 281 "vaapi_jpeg_decoder.h", |
| 282 "vaapi_picture.cc", |
| 283 "vaapi_picture.h", |
| 284 "vaapi_video_decode_accelerator.cc", |
| 285 "vaapi_video_decode_accelerator.h", |
| 286 "vaapi_video_encode_accelerator.cc", |
| 287 "vaapi_video_encode_accelerator.h", |
| 288 "vaapi_wrapper.cc", |
| 289 "vaapi_wrapper.h", |
| 290 ] + get_target_outputs(":libva_generate_stubs") |
| 291 configs += [ |
| 292 "//third_party/libva:libva_config", |
| 293 "//third_party/libyuv:libyuv_config", |
| 294 ] |
| 295 deps += [ |
| 296 ":libva_generate_stubs", |
| 297 "//media", |
| 298 "//third_party/libyuv", |
| 299 ] |
| 300 if (use_x11) { |
| 301 sources += [ |
| 302 "vaapi_tfp_picture.cc", |
| 303 "vaapi_tfp_picture.h", |
| 304 ] |
| 305 } |
| 306 if (use_ozone) { |
| 307 sources += [ |
| 308 "vaapi_drm_picture.cc", |
| 309 "vaapi_drm_picture.h", |
| 310 ] |
| 311 } |
| 312 } |
| 313 } |
| 314 |
| 315 if (is_win) { |
| 316 sources += [ |
| 317 "dxva_video_decode_accelerator_win.cc", |
| 318 "dxva_video_decode_accelerator_win.h", |
| 319 ] |
| 320 configs += [ |
| 321 "//build/config/compiler:no_size_t_to_int_warning", |
| 322 "//third_party/khronos:khronos_headers", |
| 323 ] |
| 324 deps += [ "//ui/gl" ] |
| 325 libs += [ |
| 326 "d3d9.lib", |
| 327 "d3d11.lib", |
| 328 "dxva2.lib", |
| 329 "strmiids.lib", |
| 330 "mf.lib", |
| 331 "mfplat.lib", |
| 332 "mfuuid.lib", |
| 333 ] |
| 334 ldflags += [ |
| 335 "/DELAYLOAD:d3d9.dll", |
| 336 "/DELAYLOAD:d3d11.dll", |
| 337 "/DELAYLOAD:dxva2.dll", |
| 338 "/DELAYLOAD:mf.dll", |
| 339 "/DELAYLOAD:mfplat.dll", |
| 340 ] |
| 341 |
| 342 # TODO(GYP): extract_xinput action. |
| 343 } |
| 344 |
| 345 if (use_x11) { |
| 346 deps += [ "//ui/gfx/x" ] |
| 347 } |
| 348 } |
| 349 |
| 350 if (is_android || is_chromeos) { |
| 351 # TODO(GYP): Port Windows logic. |
| 352 test("video_decode_accelerator_unittest") { |
| 353 deps = [ |
| 354 ":gpu", |
| 355 "//base", |
| 356 "//media", |
| 357 "//media/gpu", |
| 358 "//testing/gtest", |
| 359 "//ui/base", |
| 360 "//ui/gfx", |
| 361 "//ui/gfx:test_support", |
| 362 "//ui/gfx/geometry", |
| 363 "//ui/gl", |
| 364 "//ui/gl:test_support", |
| 365 ] |
| 366 configs += [ "//third_party/khronos:khronos_headers" ] |
| 367 if (is_chromeos && target_cpu != "arm") { |
| 368 configs += [ "//third_party/libva:libva_config" ] |
| 369 } |
| 370 sources = [ |
| 371 "video_accelerator_unittest_helpers.h", |
| 372 ] |
| 373 if (is_android) { |
| 374 sources += [ "android_video_decode_accelerator_unittest.cc" ] |
| 375 } else { |
| 376 sources += [ |
| 377 "rendering_helper.cc", |
| 378 "rendering_helper.h", |
| 379 "video_decode_accelerator_unittest.cc", |
| 380 ] |
| 381 } |
| 382 |
| 383 if (is_android) { |
| 384 deps += [ |
| 385 "//gpu:test_support", |
| 386 "//media/base/android", |
| 387 "//media/base/android:media_java", |
| 388 "//media/capture/video/android:capture_java", |
| 389 "//testing/gmock", |
| 390 "//ui/android:ui_java", |
| 391 ] |
| 392 } |
| 393 if (is_chromeos && use_ozone) { |
| 394 deps += [ |
| 395 "//ui/display", # Used by rendering_helper.cc |
| 396 "//ui/ozone", # Used by rendering_helper.cc |
| 397 ] |
| 398 } |
| 399 if (use_x11) { |
| 400 configs += [ "//build/config/linux:x11" ] |
| 401 deps += [ "//ui/gfx/x" ] |
| 402 } |
| 403 } |
| 404 } |
| 405 |
| 406 if (is_chromeos || is_mac) { |
| 407 test("video_encode_accelerator_unittest") { |
| 408 deps = [ |
| 409 "//base", |
| 410 "//media", |
| 411 "//media/base:test_support", |
| 412 "//media/gpu", |
| 413 "//testing/gtest", |
| 414 "//ui/base", |
| 415 "//ui/gfx", |
| 416 "//ui/gfx:test_support", |
| 417 "//ui/gfx/geometry", |
| 418 "//ui/gl", |
| 419 "//ui/gl:test_support", |
| 420 ] |
| 421 configs += [ |
| 422 "//third_party/libva:libva_config", |
| 423 "//third_party/libyuv:libyuv_config", |
| 424 ] |
| 425 sources = [ |
| 426 "video_accelerator_unittest_helpers.h", |
| 427 "video_encode_accelerator_unittest.cc", |
| 428 ] |
| 429 if (use_x11) { |
| 430 deps += [ "//ui/gfx/x" ] |
| 431 } |
| 432 if (use_ozone) { |
| 433 deps += [ "//ui/ozone" ] |
| 434 } |
| 435 } |
| 436 } |
| OLD | NEW |