| # Copyright 2020 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/cipd.gni") |
| import("//build/package.gni") |
| import("//src/camera/bin/camera-gym/assets/convert_image.gni") |
| import("//src/camera/debug.gni") |
| |
| declare_args() { |
| camera_gym_configuration_cycle_time_ms = 10000 |
| camera_gym_enable_root_presenter = false |
| } |
| |
| name = "camera-gym" |
| |
| source_set("lib") { |
| sources = [ |
| "buffer_collage.cc", |
| "buffer_collage.h", |
| "lifecycle_impl.cc", |
| "lifecycle_impl.h", |
| "moving_window.cc", |
| "moving_window.h", |
| "stream_cycler.cc", |
| "stream_cycler.h", |
| ] |
| |
| public_deps = [ |
| "//sdk/fidl/fuchsia.camera3", |
| "//sdk/fidl/fuchsia.math", |
| "//sdk/fidl/fuchsia.modular", |
| "//sdk/fidl/fuchsia.sysmem", |
| "//sdk/fidl/fuchsia.ui.app", |
| "//sdk/fidl/fuchsia.ui.policy", |
| "//sdk/fidl/fuchsia.ui.scenic", |
| "//sdk/fidl/fuchsia.ui.views", |
| "//sdk/lib/sys/cpp", |
| "//sdk/lib/syslog/cpp", |
| "//sdk/lib/ui/scenic/cpp", |
| "//src/lib/fsl", |
| "//src/lib/fxl", |
| "//third_party/googletest:gtest_prod", |
| "//zircon/public/lib/fit", |
| "//zircon/system/ulib/async-loop:async-loop-cpp", |
| "//zircon/system/ulib/async-loop:async-loop-default", |
| "//zircon/system/ulib/fzl", |
| "//zircon/system/ulib/trace", |
| ] |
| |
| defines = [ |
| camera_debug_define, |
| "CONFIGURATION_CYCLE_TIME_MS=(${camera_gym_configuration_cycle_time_ms})", |
| ] |
| |
| if (camera_gym_enable_root_presenter) { |
| defines += [ "CAMERA_GYM_ENABLE_ROOT_PRESENTER=(true)" ] |
| } else { |
| defines += [ "CAMERA_GYM_ENABLE_ROOT_PRESENTER=(false)" ] |
| } |
| } |
| |
| executable("bin") { |
| output_name = "camera-gym" |
| |
| sources = [ "main.cc" ] |
| |
| deps = [ |
| ":lib", |
| "//zircon/system/ulib/trace-provider:trace-provider-with-fdio", |
| ] |
| |
| defines = [ camera_debug_define ] |
| } |
| |
| convert_image("mute_icon") { |
| input = "assets/mute.bin" |
| output = "$target_out_dir/mute.bin" |
| } |
| |
| converted_stream_title_files = [] |
| |
| if (internal_access) { |
| stream_title_files = [ |
| "c0s0.data", |
| "c0s1.data", |
| "c0s2.data", |
| "c1s0.data", |
| "c1s1.data", |
| "c2s0.data", |
| "c2s1.data", |
| ] |
| foreach(file, stream_title_files) { |
| convert_image(file) { |
| input = "//prebuilt/camera/camera_gym_assets/${file}" |
| output = "$target_out_dir/${file}" |
| } |
| converted_stream_title_files += [ file ] |
| } |
| } |
| |
| package("camera-gym-pkg") { |
| deps = [ |
| ":bin", |
| ":mute_icon", |
| ] |
| |
| package_name = "camera-gym" |
| |
| binaries = [ |
| { |
| name = name |
| }, |
| ] |
| |
| resources = [ |
| { |
| path = "$target_out_dir/mute.bin" |
| dest = "mute.bin" |
| }, |
| ] |
| |
| foreach(file, converted_stream_title_files) { |
| deps += [ ":${file}" ] |
| resources += [ |
| { |
| path = "$target_out_dir/${file}" |
| dest = file |
| }, |
| ] |
| } |
| |
| meta = [ |
| { |
| path = "camera-gym.cmx" |
| dest = "camera-gym.cmx" |
| }, |
| { |
| path = "camera-gym-manual.cmx" |
| dest = "camera-gym-manual.cmx" |
| }, |
| ] |
| } |
| |
| group("camera-gym") { |
| public_deps = [ |
| ":camera-gym-pkg", |
| "fidl:controller", |
| ] |
| } |