blob: 467c9f4601569e219d0b1a6f4a2e4ea1c581ae3e [file] [log] [blame]
# Copyright 2018 The Fuchsia 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/fuchsia/rules.gni")
import("//build/package.gni")
declare_args() {
amlogic_decoder_tests = false
}
driver_module("amlogic_decoder") {
output_name = "amlogic_video_decoder"
deps = [
":sources",
]
if (amlogic_decoder_tests) {
testonly = true
deps += [ ":tests" ]
}
}
config("sources_include_config") {
include_dirs = [ "." ]
}
source_set("test_support") {
deps = [
"//zircon/public/lib/ddk",
"//zircon/public/lib/driver",
]
sources = [
"tests/test_support.h",
]
}
source_set("sources") {
sources = [
# Driver structure:
"device_ctx.cc",
"device_ctx.h",
"driver_ctx.cc",
"driver_ctx.h",
# HW driving:
"amlogic-video.cc",
"amlogic-video.h",
"binding.c",
"firmware_blob.cc",
"firmware_blob.h",
"macros.h",
"mpeg12_decoder.cc",
"mpeg12_decoder.h",
"registers.h",
"video_decoder.h",
# CodecFactory+Codec interface handling:
"codec_impl.cc",
"codec_impl.h",
"device_fidl.cc",
"device_fidl.h",
"local_codec_factory.cc",
"local_codec_factory.h",
]
public_deps = [
"//zircon/public/lib/async-loop-cpp",
"//zircon/public/lib/ddk",
"//zircon/public/lib/driver",
"//zircon/public/lib/fbl",
"//zircon/public/lib/hwreg",
"//zircon/public/lib/zx",
]
deps = [
":test_support",
"//garnet/public/lib/fidl/cpp",
"//garnet/public/lib/fxl",
"//garnet/public/lib/media/fidl:media_codec",
]
if (amlogic_decoder_tests) {
testonly = true
defines = [ "ENABLE_DECODER_TESTS" ]
}
public_configs = [ ":sources_include_config" ]
}
source_set("tests") {
testonly = true
deps = [
":sources",
":test_support",
"//third_party/googletest:gtest",
]
sources = [
"tests/integration/test_mpeg2.cc",
"tests/test_support.cc",
"tests/unit_tests/test_binding.cc",
]
}
copy("video-ucode") {
sources = [
"firmware/video_ucode.bin",
]
outputs = [
"$root_out_dir/firmware/amlogic_video_ucode.bin",
]
}
package("amlogic_video_decoder") {
deprecated_system_image = true
if (amlogic_decoder_tests) {
testonly = true
}
deps = [
":amlogic_decoder",
":video-ucode($shlib_toolchain)",
]
drivers = [
{
name = "amlogic_video_decoder.so"
},
]
libraries = [
{
name = "firmware/amlogic_video_ucode.bin"
},
]
}