# Copyright (c) 2022 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("streams_config") {
  sources = [
    "encoder_stream_factory.cc",
    "encoder_stream_factory.h",
    "simulcast.cc",
    "simulcast.h",
  ]

  deps = [
    ":encoder_config",
    "../../api:array_view",
    "../../api:field_trials_view",
    "../../api/units:data_rate",
    "../../api/video:resolution",
    "../../api/video:video_codec_constants",
    "../../api/video_codecs:video_codecs_api",
    "../../call/adaptation:resource_adaptation",
    "../../media:media_constants",
    "../../media:video_adapter",
    "../../modules/video_coding:video_coding_utility",
    "../../modules/video_coding:webrtc_vp9_helpers",
    "../../rtc_base:checks",
    "../../rtc_base:logging",
    "../../rtc_base/experiments:field_trial_parser",
    "../../rtc_base/experiments:min_video_bitrate_experiment",
    "../../rtc_base/experiments:normalize_simulcast_size_experiment",
    "../../rtc_base/experiments:rate_control_settings",
    "//third_party/abseil-cpp/absl/algorithm:container",
    "//third_party/abseil-cpp/absl/strings",
  ]
}

rtc_library("encoder_config") {
  sources = [
    "video_encoder_config.cc",
    "video_encoder_config.h",
  ]

  deps = [
    "../../api:field_trials_view",
    "../../api:scoped_refptr",
    "../../api/video:resolution",
    "../../api/video_codecs:scalability_mode",
    "../../api/video_codecs:video_codecs_api",
    "../../rtc_base:checks",
    "../../rtc_base:refcount",
    "../../rtc_base:stringutils",
  ]
}

if (rtc_include_tests) {
  rtc_library("video_config_tests") {
    testonly = true

    defines = []
    sources = [
      "encoder_stream_factory_unittest.cc",
      "simulcast_unittest.cc",
    ]
    deps = [
      ":streams_config",
      "../../api/video_codecs:scalability_mode",
      "../../call/adaptation:resource_adaptation",
      "../../media:media_constants",
      "../../rtc_base/experiments:min_video_bitrate_experiment",
      "../../test:explicit_key_value_config",
      "../../test:test_support",
    ]
    if (!build_with_mozilla) {
      deps += [ "../../media:rtc_media_base" ]
    }
  }
}
