load("//cuttlefish/bazel:rules.bzl", "cf_cc_library")

package(
    default_visibility = ["//:android_cuttlefish"],
)

cf_cc_library(
    name = "audio_device",
    srcs = ["audio_device.cpp"],
    hdrs = ["audio_device.h"],
    deps = [
        "//cuttlefish/host/frontend/webrtc/libcommon:audio_source",
        "//libbase",
        "@libwebrtc",
    ],
)

cf_cc_library(
    name = "audio_source",
    hdrs = ["audio_source.h"],
)

cf_cc_library(
    name = "connection_controller",
    srcs = ["connection_controller.cpp"],
    hdrs = ["connection_controller.h"],
    deps = [
        "//cuttlefish/common/libs/utils:json",
        "//cuttlefish/host/frontend/webrtc/libcommon:peer_signaling_handler",
        "//cuttlefish/host/frontend/webrtc/libcommon:utils",
        "//cuttlefish/result",
        "//libbase",
        "@abseil-cpp//absl/log",
        "@abseil-cpp//absl/log:check",
        "@fmt",
        "@jsoncpp",
        "@libwebrtc",
    ],
)

cf_cc_library(
    name = "peer_connection_utils",
    srcs = ["peer_connection_utils.cpp"],
    hdrs = ["peer_connection_utils.h"],
    clang_format_enabled = False,
    deps = [
        "//cuttlefish/host/frontend/webrtc/libcommon:audio_device",
        "//cuttlefish/host/frontend/webrtc/libcommon:vp8only_encoder_factory",
        "//cuttlefish/result",
        "@libwebrtc",
    ],
)

cf_cc_library(
    name = "peer_signaling_handler",
    hdrs = ["peer_signaling_handler.h"],
    deps = [
        "//cuttlefish/result",
        "@jsoncpp",
    ],
)

cf_cc_library(
    name = "utils",
    srcs = ["utils.cpp"],
    hdrs = ["utils.h"],
    deps = [
        "//cuttlefish/common/libs/utils:json",
        "//cuttlefish/result",
        "//libbase",
        "@abseil-cpp//absl/log",
        "@fmt",
        "@jsoncpp",
        "@libwebrtc",
    ],
)

cf_cc_library(
    name = "vp8only_encoder_factory",
    srcs = ["vp8only_encoder_factory.cpp"],
    hdrs = ["vp8only_encoder_factory.h"],
    deps = [
        "@libwebrtc",
    ],
)
