| # Copyright 2018 The Chromium Authors. All rights reserved. |
| # Use of this source code is governed by a BSD-style license that can be |
| # found in the LICENSE file. |
| |
| import("//build/config/features.gni") |
| import("//build/config/ui.gni") |
| import("//media/gpu/args.gni") |
| import("//tools/generate_stubs/rules.gni") |
| import("//ui/gl/features.gni") |
| import("//ui/ozone/ozone.gni") |
| |
| assert(use_vaapi) |
| |
| generate_stubs("libva_stubs") { |
| extra_header = "va_stub_header.fragment" |
| sigs = [ "va.sigs" ] |
| if (use_x11) { |
| sigs += [ "va_x11.sigs" ] |
| } |
| if (is_linux) { |
| sigs += [ "va_drm.sigs" ] |
| } |
| output_name = "va_stubs" |
| deps = [ |
| "//base", |
| ] |
| } |
| |
| source_set("vaapi") { |
| defines = [ "MEDIA_GPU_IMPLEMENTATION" ] |
| sources = [ |
| "accelerated_video_encoder.cc", |
| "accelerated_video_encoder.h", |
| "h264_encoder.cc", |
| "h264_encoder.h", |
| "va_surface.cc", |
| "va_surface.h", |
| "vaapi_common.cc", |
| "vaapi_common.h", |
| "vaapi_h264_accelerator.cc", |
| "vaapi_h264_accelerator.h", |
| "vaapi_jpeg_decode_accelerator.cc", |
| "vaapi_jpeg_decode_accelerator.h", |
| "vaapi_jpeg_decoder.cc", |
| "vaapi_jpeg_decoder.h", |
| "vaapi_jpeg_encode_accelerator.cc", |
| "vaapi_jpeg_encode_accelerator.h", |
| "vaapi_jpeg_encoder.cc", |
| "vaapi_jpeg_encoder.h", |
| "vaapi_picture.cc", |
| "vaapi_picture.h", |
| "vaapi_picture_factory.cc", |
| "vaapi_picture_factory.h", |
| "vaapi_utils.cc", |
| "vaapi_utils.h", |
| "vaapi_video_decode_accelerator.cc", |
| "vaapi_video_decode_accelerator.h", |
| "vaapi_video_encode_accelerator.cc", |
| "vaapi_video_encode_accelerator.h", |
| "vaapi_vp8_accelerator.cc", |
| "vaapi_vp8_accelerator.h", |
| "vaapi_vp9_accelerator.cc", |
| "vaapi_vp9_accelerator.h", |
| "vaapi_wrapper.cc", |
| "vaapi_wrapper.h", |
| "vp8_encoder.cc", |
| "vp8_encoder.h", |
| "vp9_encoder.cc", |
| "vp9_encoder.h", |
| ] |
| |
| configs += [ "//third_party/libyuv:libyuv_config" ] |
| |
| deps = [ |
| ":libva_stubs", |
| "//base", |
| "//gpu/ipc/service", |
| "//media", |
| "//media/gpu:common", |
| "//third_party/libyuv", |
| "//ui/gfx/geometry", |
| ] |
| |
| if (is_linux) { |
| configs += [ "//build/config/linux/libva" ] |
| } |
| |
| if (use_x11) { |
| configs += [ "//build/config/linux:x11" ] |
| deps += [ "//ui/gfx/x" ] |
| sources += [ |
| "vaapi_picture_tfp.cc", |
| "vaapi_picture_tfp.h", |
| ] |
| } |
| |
| if (ozone_platform_gbm || use_egl) { |
| sources += [ |
| "vaapi_picture_native_pixmap.cc", |
| "vaapi_picture_native_pixmap.h", |
| ] |
| if (ozone_platform_gbm) { |
| sources += [ |
| "vaapi_picture_native_pixmap_ozone.cc", |
| "vaapi_picture_native_pixmap_ozone.h", |
| ] |
| deps += [ "//ui/ozone" ] |
| } |
| if (use_egl) { |
| sources += [ |
| "vaapi_picture_native_pixmap_egl.cc", |
| "vaapi_picture_native_pixmap_egl.h", |
| ] |
| } |
| } |
| } |
| |
| source_set("unit_test") { |
| testonly = true |
| sources = [ |
| "vaapi_video_decode_accelerator_unittest.cc", |
| ] |
| deps = [ |
| ":vaapi", |
| "//base/test:test_support", |
| "//gpu:test_support", |
| "//media/gpu:common", |
| "//mojo/core/embedder", |
| "//testing/gmock", |
| "//testing/gtest", |
| "//ui/gfx:test_support", |
| "//ui/gfx/geometry", |
| ] |
| } |
| |
| source_set("jpeg_decoder_unit_test") { |
| testonly = true |
| sources = [ |
| "vaapi_jpeg_decoder_unittest.cc", |
| ] |
| deps = [ |
| ":vaapi", |
| "//base", |
| "//base/test:test_support", |
| "//media:test_support", |
| "//testing/gtest", |
| "//ui/gfx/geometry", |
| ] |
| } |