blob: 0322bbf7f1a3e09d67eff5822b1546f2445f5f34 [file] [log] [blame]
# Copyright 2019 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/chromeos/ui_mode.gni")
import("//build/config/features.gni")
import("//build/config/ui.gni")
import("//media/gpu/args.gni")
import("//testing/test.gni")
import("//tools/generate_stubs/rules.gni")
import("//ui/gl/features.gni")
assert(use_v4l2_codec)
if (use_v4lplugin) {
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_status.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_h264_legacy.cc",
"v4l2_video_decoder_delegate_h264_legacy.h",
"v4l2_video_decoder_delegate_vp8.cc",
"v4l2_video_decoder_delegate_vp8.h",
"v4l2_video_decoder_delegate_vp8_legacy.cc",
"v4l2_video_decoder_delegate_vp8_legacy.h",
"v4l2_video_decoder_delegate_vp9_chromium.cc",
"v4l2_video_decoder_delegate_vp9_chromium.h",
"v4l2_video_decoder_delegate_vp9_legacy.cc",
"v4l2_video_decoder_delegate_vp9_legacy.h",
"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 = [
"//base",
"//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 (use_v4lplugin) {
deps += [ ":libv4l2_stubs" ]
}
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",
]
}
}
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/v4l2_ioctl_shim.cc",
"test/v4l2_ioctl_shim.h",
"test/v4l2_stateless_decoder.cc",
"test/vp9_decoder.cc",
"test/vp9_decoder.h",
]
deps = [
"//base",
"//media",
"//media:test_support",
"//media/gpu:common",
]
}