# Copyright 2024 The WebRTC project authors. All rights reserved.
#
# Use of this source code is governed by a BSD-style license
# that can be found in the LICENSE file in the root of the source
# tree. An additional intellectual property rights grant can be found
# in the file PATENTS. All contributing project authors may
# be found in the AUTHORS file in the root of the source tree.

import("../../webrtc.gni")

rtc_library("frame_instrumentation_generator") {
  sources = [
    "frame_instrumentation_generator.cc",
    "frame_instrumentation_generator.h",
  ]
  deps = [
    ":generic_mapping_functions",
    ":halton_frame_sampler",
    "../../api:scoped_refptr",
    "../../api/video:encoded_image",
    "../../api/video:video_frame",
    "../../api/video:video_frame_type",
    "../../api/video_codecs:video_codecs_api",
    "../../common_video:frame_instrumentation_data",
    "../../modules:module_api_public",
    "../../modules/video_coding:video_coding_utility",
    "../../rtc_base:logging",
    "//third_party/abseil-cpp/absl/algorithm:container",
    "//third_party/abseil-cpp/absl/types:variant",
  ]
}

rtc_library("generic_mapping_functions") {
  sources = [
    "generic_mapping_functions.cc",
    "generic_mapping_functions.h",
  ]
  deps = [
    "../../api/video:video_frame",
    "../../api/video_codecs:video_codecs_api",
    "../../rtc_base:checks",
  ]
}

rtc_library("halton_frame_sampler") {
  sources = [
    "halton_frame_sampler.cc",
    "halton_frame_sampler.h",
  ]
  deps = [
    ":halton_sequence",
    "../../api:scoped_refptr",
    "../../api/video:video_frame",
    "../../rtc_base:checks",
    "../../rtc_base:logging",
  ]
}

rtc_library("halton_sequence") {
  sources = [
    "halton_sequence.cc",
    "halton_sequence.h",
  ]
  deps = [ "../../rtc_base:checks" ]
}

if (rtc_include_tests) {
  rtc_library("frame_instrumentation_generator_unittest") {
    testonly = true
    sources = [ "frame_instrumentation_generator_unittest.cc" ]
    deps = [
      ":frame_instrumentation_generator",
      "../../api:scoped_refptr",
      "../../api/video:encoded_image",
      "../../api/video:video_frame",
      "../../api/video:video_frame_type",
      "../../common_video:frame_instrumentation_data",
      "../../test:test_support",
      "//third_party/abseil-cpp/absl/types:variant",
    ]
  }

  rtc_library("generic_mapping_functions_unittest") {
    testonly = true
    sources = [ "generic_mapping_functions_unittest.cc" ]
    deps = [
      ":generic_mapping_functions",
      "../../api/video:video_frame",
      "../../test:test_support",
    ]
  }

  rtc_library("halton_frame_sampler_unittest") {
    testonly = true
    sources = [ "halton_frame_sampler_unittest.cc" ]
    deps = [
      ":halton_frame_sampler",
      "../../api:scoped_refptr",
      "../../api/video:video_frame",
      "../../test:test_support",
    ]
  }

  rtc_library("halton_sequence_unittest") {
    testonly = true
    sources = [ "halton_sequence_unittest.cc" ]
    deps = [
      ":halton_sequence",
      "../../test:test_support",
    ]
  }

  rtc_library("corruption_detection_tests") {
    testonly = true
    sources = []
    deps = [
      ":frame_instrumentation_generator_unittest",
      ":generic_mapping_functions_unittest",
      ":halton_frame_sampler_unittest",
      ":halton_sequence_unittest",
    ]
  }
}
