# Copyright (c) 2021 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_source_set("send_queue") {
  deps = [
    "../../../api:array_view",
    "../common:internal_types",
    "../packet:chunk",
    "../packet:data",
    "../public:socket",
    "../public:types",
  ]
  sources = [ "send_queue.h" ]
  absl_deps = [ "//third_party/abseil-cpp/absl/types:optional" ]
}

rtc_library("rr_send_queue") {
  deps = [
    ":send_queue",
    ":stream_scheduler",
    "../../../api:array_view",
    "../../../rtc_base:checks",
    "../../../rtc_base:logging",
    "../../../rtc_base/containers:flat_map",
    "../common:internal_types",
    "../common:str_join",
    "../packet:data",
    "../public:socket",
    "../public:types",
  ]
  sources = [
    "rr_send_queue.cc",
    "rr_send_queue.h",
  ]
  absl_deps = [
    "//third_party/abseil-cpp/absl/algorithm:container",
    "//third_party/abseil-cpp/absl/algorithm:container",
    "//third_party/abseil-cpp/absl/strings",
    "//third_party/abseil-cpp/absl/types:optional",
  ]
}

rtc_library("stream_scheduler") {
  deps = [
    ":send_queue",
    "../../../api:array_view",
    "../../../rtc_base:checks",
    "../../../rtc_base:logging",
    "../../../rtc_base:strong_alias",
    "../../../rtc_base/containers:flat_set",
    "../common:str_join",
    "../packet:chunk",
    "../packet:data",
    "../packet:sctp_packet",
    "../public:socket",
    "../public:types",
  ]
  sources = [
    "stream_scheduler.cc",
    "stream_scheduler.h",
  ]
  absl_deps = [
    "//third_party/abseil-cpp/absl/algorithm:container",
    "//third_party/abseil-cpp/absl/memory",
    "//third_party/abseil-cpp/absl/strings",
    "//third_party/abseil-cpp/absl/types:optional",
  ]
}

rtc_library("retransmission_error_counter") {
  deps = [
    "../../../rtc_base:checks",
    "../../../rtc_base:logging",
    "../public:types",
  ]
  sources = [
    "retransmission_error_counter.cc",
    "retransmission_error_counter.h",
  ]
  absl_deps = [ "//third_party/abseil-cpp/absl/strings" ]
}

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

rtc_library("outstanding_data") {
  deps = [
    ":retransmission_timeout",
    ":send_queue",
    "../../../api:array_view",
    "../../../api/units:time_delta",
    "../../../rtc_base:checks",
    "../../../rtc_base:logging",
    "../../../rtc_base/containers:flat_set",
    "../common:internal_types",
    "../common:math",
    "../common:sequence_numbers",
    "../common:str_join",
    "../packet:chunk",
    "../packet:data",
    "../public:socket",
    "../public:types",
    "../timer",
  ]
  sources = [
    "outstanding_data.cc",
    "outstanding_data.h",
  ]
  absl_deps = [
    "//third_party/abseil-cpp/absl/algorithm:container",
    "//third_party/abseil-cpp/absl/strings",
    "//third_party/abseil-cpp/absl/types:optional",
  ]
}

rtc_library("retransmission_queue") {
  deps = [
    ":outstanding_data",
    ":retransmission_timeout",
    ":send_queue",
    "../../../api:array_view",
    "../../../rtc_base:checks",
    "../../../rtc_base:logging",
    "../../../rtc_base:stringutils",
    "../common:math",
    "../common:sequence_numbers",
    "../common:str_join",
    "../packet:chunk",
    "../packet:data",
    "../public:socket",
    "../public:types",
    "../timer",
  ]
  sources = [
    "retransmission_queue.cc",
    "retransmission_queue.h",
  ]
  absl_deps = [
    "//third_party/abseil-cpp/absl/algorithm:container",
    "//third_party/abseil-cpp/absl/strings",
    "//third_party/abseil-cpp/absl/types:optional",
  ]
}

if (rtc_include_tests) {
  rtc_source_set("mock_send_queue") {
    testonly = true
    deps = [
      ":send_queue",
      "../../../api:array_view",
      "../../../test:test_support",
    ]
    absl_deps = [ "//third_party/abseil-cpp/absl/types:optional" ]
    sources = [ "mock_send_queue.h" ]
  }

  rtc_library("dcsctp_tx_unittests") {
    testonly = true

    deps = [
      ":mock_send_queue",
      ":outstanding_data",
      ":retransmission_error_counter",
      ":retransmission_queue",
      ":retransmission_timeout",
      ":rr_send_queue",
      ":send_queue",
      ":stream_scheduler",
      "../../../api:array_view",
      "../../../api/task_queue:task_queue",
      "../../../rtc_base:checks",
      "../../../rtc_base:gunit_helpers",
      "../../../test:test_support",
      "../common:handover_testing",
      "../common:internal_types",
      "../common:math",
      "../common:sequence_numbers",
      "../packet:chunk",
      "../packet:data",
      "../packet:sctp_packet",
      "../public:socket",
      "../public:types",
      "../socket:mock_callbacks",
      "../socket:mock_callbacks",
      "../testing:data_generator",
      "../testing:testing_macros",
      "../timer",
    ]
    absl_deps = [ "//third_party/abseil-cpp/absl/types:optional" ]
    sources = [
      "outstanding_data_test.cc",
      "retransmission_error_counter_test.cc",
      "retransmission_queue_test.cc",
      "retransmission_timeout_test.cc",
      "rr_send_queue_test.cc",
      "stream_scheduler_test.cc",
    ]
  }
}
