| # Copyright 2019 The Chromium Authors |
| # Use of this source code is governed by a BSD-style license that can be |
| # found in the LICENSE file. |
| |
| import("//build/config/chromeos/ui_mode.gni") |
| import("//build/config/features.gni") |
| import("//build/config/ui.gni") |
| import("//media/gpu/args.gni") |
| import("//media/media_options.gni") |
| import("//testing/test.gni") |
| import("//third_party/libgav1/options.gni") |
| import("//tools/generate_stubs/rules.gni") |
| import("//ui/gl/features.gni") |
| |
| assert(use_v4l2_codec) |
| |
| generate_stubs("libv4l2_stubs") { |
| extra_header = "v4l2_stub_header.fragment" |
| sigs = [ "v4l2.sig" ] |
| output_name = "v4l2_stubs" |
| deps = [ "//base" ] |
| } |
| |
| source_set("v4l2") { |
| defines = [ "MEDIA_GPU_IMPLEMENTATION" ] |
| sources = [ |
| "buffer_affinity_tracker.cc", |
| "buffer_affinity_tracker.h", |
| "generic_v4l2_device.cc", |
| "generic_v4l2_device.h", |
| "v4l2_decode_surface.cc", |
| "v4l2_decode_surface.h", |
| "v4l2_decode_surface_handler.h", |
| "v4l2_device.cc", |
| "v4l2_device.h", |
| "v4l2_device_poller.cc", |
| "v4l2_device_poller.h", |
| "v4l2_framerate_control.cc", |
| "v4l2_framerate_control.h", |
| "v4l2_image_processor_backend.cc", |
| "v4l2_image_processor_backend.h", |
| "v4l2_slice_video_decode_accelerator.cc", |
| "v4l2_slice_video_decode_accelerator.h", |
| "v4l2_stateful_workaround.cc", |
| "v4l2_stateful_workaround.h", |
| "v4l2_utils.cc", |
| "v4l2_utils.h", |
| "v4l2_vda_helpers.cc", |
| "v4l2_vda_helpers.h", |
| "v4l2_video_decode_accelerator.cc", |
| "v4l2_video_decode_accelerator.h", |
| "v4l2_video_decoder.cc", |
| "v4l2_video_decoder.h", |
| "v4l2_video_decoder_backend.cc", |
| "v4l2_video_decoder_backend.h", |
| "v4l2_video_decoder_backend_stateful.cc", |
| "v4l2_video_decoder_backend_stateful.h", |
| "v4l2_video_decoder_backend_stateless.cc", |
| "v4l2_video_decoder_backend_stateless.h", |
| "v4l2_video_decoder_delegate_h264.cc", |
| "v4l2_video_decoder_delegate_h264.h", |
| "v4l2_video_decoder_delegate_vp8.cc", |
| "v4l2_video_decoder_delegate_vp8.h", |
| "v4l2_video_decoder_delegate_vp9.cc", |
| "v4l2_video_decoder_delegate_vp9.h", |
| ] |
| |
| if (enable_hevc_parser_and_hw_decoder) { |
| sources += [ |
| "v4l2_video_decoder_delegate_h265.cc", |
| "v4l2_video_decoder_delegate_h265.h", |
| ] |
| } |
| |
| if (is_chromeos) { |
| sources += [ |
| # AV1 delegate depends on header files only in ChromeOS SDK |
| "v4l2_video_decoder_delegate_av1.cc", |
| "v4l2_video_decoder_delegate_av1.h", |
| |
| # TODO(crbug.com/901264): Encoders use hack for passing offset |
| # within a DMA-buf, which is not supported upstream. |
| "v4l2_video_encode_accelerator.cc", |
| "v4l2_video_encode_accelerator.h", |
| ] |
| } |
| |
| libs = [ |
| "EGL", |
| "GLESv2", |
| ] |
| |
| if (use_v4l2_codec_aml) { |
| sources += [ |
| "aml_v4l2_device.cc", |
| "aml_v4l2_device.h", |
| ] |
| defines += [ "AML_V4L2" ] |
| } |
| |
| configs += [ "//third_party/libyuv:libyuv_config" ] |
| |
| public_deps = [ "//ui/gl" ] |
| |
| deps = [ |
| ":libv4l2_stubs", |
| ":v4l2_status", |
| "//base", |
| "//gpu/command_buffer/service:gles2", |
| "//gpu/ipc/common", |
| "//gpu/ipc/service", |
| "//media", |
| "//media/gpu:buildflags", |
| "//media/gpu:common", |
| "//media/gpu/chromeos:common", |
| "//media/parsers", |
| "//third_party/libyuv", |
| "//ui/gfx/geometry", |
| "//ui/ozone", |
| ] |
| |
| if (is_chromeos_ash) { |
| sources += [ |
| "v4l2_jpeg_encode_accelerator.cc", |
| "v4l2_jpeg_encode_accelerator.h", |
| "v4l2_mjpeg_decode_accelerator.cc", |
| "v4l2_mjpeg_decode_accelerator.h", |
| ] |
| |
| deps += [ |
| "//components/chromeos_camera:jpeg_encode_accelerator", |
| "//components/chromeos_camera:mjpeg_decode_accelerator", |
| "//media/gpu:video_frame_mapper_common", |
| ] |
| } |
| |
| if (use_libgav1_parser) { |
| deps += [ "//third_party/libgav1:libgav1_parser" ] |
| } |
| } |
| |
| # The v4l2 status functionality is in its own source set so that it can be |
| # depended on without pulling the //media/gpu/v4l2:v4l2 target. |
| source_set("v4l2_status") { |
| sources = [ "v4l2_status.h" ] |
| |
| visibility = [ |
| ":v4l2", |
| "//media/mojo/mojom/stable:*", |
| ] |
| |
| deps = [ "//media" ] |
| } |
| |
| source_set("unit_test") { |
| testonly = true |
| sources = [ |
| "v4l2_device_unittest.cc", |
| "v4l2_stateful_workaround_unittest.cc", |
| ] |
| deps = [ |
| ":v4l2", |
| "//base", |
| "//media", |
| "//media:test_support", |
| "//testing/gtest", |
| "//ui/gfx:test_support", |
| "//ui/gl", |
| ] |
| } |
| |
| executable("v4l2_stateless_decoder") { |
| testonly = true |
| sources = [ |
| "test/h264_decoder.cc", |
| "test/h264_decoder.h", |
| "test/h264_dpb.cc", |
| "test/h264_dpb.h", |
| "test/upstream_pix_fmt.h", |
| "test/v4l2_ioctl_shim.cc", |
| "test/v4l2_ioctl_shim.h", |
| "test/v4l2_stateless_decoder.cc", |
| "test/video_decoder.cc", |
| "test/video_decoder.h", |
| "test/vp8_decoder.cc", |
| "test/vp8_decoder.h", |
| "test/vp9_decoder.cc", |
| "test/vp9_decoder.h", |
| ] |
| |
| if (is_chromeos) { |
| sources += [ |
| "test/av1_decoder.cc", |
| "test/av1_decoder.h", |
| ] |
| } |
| |
| deps = [ |
| "//base", |
| "//media", |
| "//media:test_support", |
| "//media/gpu:common", |
| "//media/parsers", |
| "//third_party/libyuv", |
| ] |
| |
| if (use_libgav1_parser) { |
| deps += [ "//third_party/libgav1:libgav1_parser" ] |
| } |
| } |
| |
| test("v4l2_unittest") { |
| testonly = true |
| sources = [ "v4l2_unittest.cc" ] |
| |
| deps = [ |
| ":v4l2", |
| "//base/test:test_support", |
| "//build/config/linux/libdrm", |
| "//media:test_support", |
| "//testing/gtest", |
| ] |
| } |