# Copyright (c) 2018 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("alr_experiment") {
  sources = [
    "alr_experiment.cc",
    "alr_experiment.h",
  ]
  deps = [
    "..:logging",
    "../../api:field_trials_view",
    "//third_party/abseil-cpp/absl/strings:string_view",
  ]
}

rtc_library("field_trial_parser") {
  sources = [
    "field_trial_list.cc",
    "field_trial_list.h",
    "field_trial_parser.cc",
    "field_trial_parser.h",
    "field_trial_units.cc",
    "field_trial_units.h",
    "struct_parameters_parser.cc",
    "struct_parameters_parser.h",
  ]
  deps = [
    "../../api/units:data_rate",
    "../../api/units:data_size",
    "../../api/units:time_delta",
    "../../rtc_base:checks",
    "../../rtc_base:logging",
    "../../rtc_base:safe_conversions",
    "../../rtc_base:stringutils",
    "//third_party/abseil-cpp/absl/memory",
    "//third_party/abseil-cpp/absl/strings:string_view",
  ]
}

rtc_library("quality_scaler_settings") {
  sources = [
    "quality_scaler_settings.cc",
    "quality_scaler_settings.h",
  ]
  deps = [
    ":field_trial_parser",
    "..:logging",
    "../../api:field_trials_view",
  ]
}

rtc_library("quality_scaling_experiment") {
  sources = [
    "quality_scaling_experiment.cc",
    "quality_scaling_experiment.h",
  ]
  deps = [
    "..:logging",
    "../../api:field_trials_view",
    "../../api/transport:field_trial_based_config",
    "../../api/video_codecs:video_codecs_api",
    "//third_party/abseil-cpp/absl/strings",
  ]
}

rtc_library("normalize_simulcast_size_experiment") {
  sources = [
    "normalize_simulcast_size_experiment.cc",
    "normalize_simulcast_size_experiment.h",
  ]
  deps = [
    "..:logging",
    "../../api:field_trials_view",
  ]
}

rtc_library("balanced_degradation_settings") {
  sources = [
    "balanced_degradation_settings.cc",
    "balanced_degradation_settings.h",
  ]
  deps = [
    ":field_trial_parser",
    "..:logging",
    "../../api:field_trials_view",
    "../../api/video_codecs:video_codecs_api",
    "../../system_wrappers:field_trial",
  ]
}

rtc_library("encoder_info_settings") {
  sources = [
    "encoder_info_settings.cc",
    "encoder_info_settings.h",
  ]
  deps = [
    ":field_trial_parser",
    "..:logging",
    "../../api:field_trials_view",
    "../../api/video_codecs:video_codecs_api",
    "//third_party/abseil-cpp/absl/strings:string_view",
  ]
}

rtc_library("rate_control_settings") {
  sources = [
    "rate_control_settings.cc",
    "rate_control_settings.h",
  ]
  deps = [
    ":field_trial_parser",
    "..:logging",
    "..:safe_conversions",
    "../../api:field_trials_view",
    "../../api/units:data_size",
    "../../api/video_codecs:video_codecs_api",
    "../../video/config:encoder_config",
    "//third_party/abseil-cpp/absl/strings",
  ]
}

rtc_library("keyframe_interval_settings_experiment") {
  sources = [
    "keyframe_interval_settings.cc",
    "keyframe_interval_settings.h",
  ]
  deps = [
    ":field_trial_parser",
    "../../api:field_trials_view",
  ]
}

rtc_library("stable_target_rate_experiment") {
  sources = [
    "stable_target_rate_experiment.cc",
    "stable_target_rate_experiment.h",
  ]
  deps = [
    ":field_trial_parser",
    "../../api:field_trials_view",
  ]
}

rtc_library("min_video_bitrate_experiment") {
  sources = [
    "min_video_bitrate_experiment.cc",
    "min_video_bitrate_experiment.h",
  ]
  deps = [
    ":field_trial_parser",
    "../../api:field_trials_view",
    "../../api/units:data_rate",
    "../../api/video:video_frame",
    "../../rtc_base:checks",
    "../../rtc_base:logging",
  ]
}

if (rtc_include_tests && !build_with_chromium) {
  rtc_library("experiments_unittests") {
    testonly = true

    sources = [
      "balanced_degradation_settings_unittest.cc",
      "encoder_info_settings_unittest.cc",
      "field_trial_list_unittest.cc",
      "field_trial_parser_unittest.cc",
      "field_trial_units_unittest.cc",
      "keyframe_interval_settings_unittest.cc",
      "min_video_bitrate_experiment_unittest.cc",
      "normalize_simulcast_size_experiment_unittest.cc",
      "quality_scaler_settings_unittest.cc",
      "quality_scaling_experiment_unittest.cc",
      "rate_control_settings_unittest.cc",
      "stable_target_rate_experiment_unittest.cc",
      "struct_parameters_parser_unittest.cc",
    ]
    deps = [
      ":balanced_degradation_settings",
      ":encoder_info_settings",
      ":field_trial_parser",
      ":keyframe_interval_settings_experiment",
      ":min_video_bitrate_experiment",
      ":normalize_simulcast_size_experiment",
      ":quality_scaler_settings",
      ":quality_scaling_experiment",
      ":rate_control_settings",
      ":stable_target_rate_experiment",
      "..:gunit_helpers",
      "../:rtc_base_tests_utils",
      "../../api/units:data_rate",
      "../../api/video:video_frame",
      "../../api/video_codecs:video_codecs_api",
      "../../system_wrappers:field_trial",
      "../../test:explicit_key_value_config",
      "../../test:field_trial",
      "../../test:scoped_key_value_config",
      "../../test:test_main",
      "../../test:test_support",
      "../../video/config:encoder_config",
      "//third_party/abseil-cpp/absl/strings:string_view",
    ]
  }
}
