From 99314abb69b90aa01a6d29a9f5469afb865c96b8 Mon Sep 17 00:00:00 2001 From: "A. Cody Schuffelen" Date: Thu, 31 Jul 2025 18:12:57 -0700 Subject: [PATCH 01/17] Extract `//cuttlefish/host/frontend/webrtc/libdevice:audio_frame_buffer` Bug: b/438313626 --- .../cuttlefish/host/frontend/webrtc/libdevice/BUILD.bazel | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/base/cvd/cuttlefish/host/frontend/webrtc/libdevice/BUILD.bazel b/base/cvd/cuttlefish/host/frontend/webrtc/libdevice/BUILD.bazel index f4af33f6638..27dc6324c9e 100644 --- a/base/cvd/cuttlefish/host/frontend/webrtc/libdevice/BUILD.bazel +++ b/base/cvd/cuttlefish/host/frontend/webrtc/libdevice/BUILD.bazel @@ -4,6 +4,11 @@ package( default_visibility = ["//:android_cuttlefish"], ) +cf_cc_library( + name = "audio_frame_buffer", + hdrs = ["audio_frame_buffer.h"], +) + cf_cc_library( name = "libdevice", srcs = [ @@ -21,7 +26,6 @@ cf_cc_library( "video_track_source_impl.cpp", ], hdrs = [ - "audio_frame_buffer.h", "audio_sink.h", "audio_track_source_impl.h", "camera_controller.h", @@ -52,6 +56,7 @@ cf_cc_library( "//cuttlefish/host/frontend/webrtc/libcommon:connection_controller", "//cuttlefish/host/frontend/webrtc/libcommon:peer_connection_utils", "//cuttlefish/host/frontend/webrtc/libcommon:utils", + "//cuttlefish/host/frontend/webrtc/libdevice:audio_frame_buffer", "//cuttlefish/host/frontend/webrtc_operator/constants:webrtc_signaling_headers", "//cuttlefish/host/libs/config:custom_actions", "//cuttlefish/host/libs/config:cuttlefish_config", From e75188d548463e2248d4f69e3ca22894bb230d6e Mon Sep 17 00:00:00 2001 From: "A. Cody Schuffelen" Date: Thu, 31 Jul 2025 18:15:01 -0700 Subject: [PATCH 02/17] Extract `//cuttlefish/host/frontend/webrtc/libdevice:audio_sink` Bug: b/438313626 --- base/cvd/cuttlefish/host/frontend/webrtc/BUILD.bazel | 1 + .../host/frontend/webrtc/libdevice/BUILD.bazel | 11 +++++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/base/cvd/cuttlefish/host/frontend/webrtc/BUILD.bazel b/base/cvd/cuttlefish/host/frontend/webrtc/BUILD.bazel index 127adbe2bad..4385ce9e47e 100644 --- a/base/cvd/cuttlefish/host/frontend/webrtc/BUILD.bazel +++ b/base/cvd/cuttlefish/host/frontend/webrtc/BUILD.bazel @@ -70,6 +70,7 @@ cf_cc_binary( "//cuttlefish/host/commands/kernel_log_monitor:kernel_log_monitor_utils", "//cuttlefish/host/frontend/webrtc/libcommon:audio_source", "//cuttlefish/host/frontend/webrtc/libdevice", + "//cuttlefish/host/frontend/webrtc/libdevice:audio_sink", "//cuttlefish/host/libs/audio_connector", "//cuttlefish/host/libs/config:config_constants", "//cuttlefish/host/libs/config:config_utils", diff --git a/base/cvd/cuttlefish/host/frontend/webrtc/libdevice/BUILD.bazel b/base/cvd/cuttlefish/host/frontend/webrtc/libdevice/BUILD.bazel index 27dc6324c9e..f75a88f4db4 100644 --- a/base/cvd/cuttlefish/host/frontend/webrtc/libdevice/BUILD.bazel +++ b/base/cvd/cuttlefish/host/frontend/webrtc/libdevice/BUILD.bazel @@ -9,6 +9,14 @@ cf_cc_library( hdrs = ["audio_frame_buffer.h"], ) +cf_cc_library( + name = "audio_sink", + hdrs = ["audio_sink.h"], + deps = [ + "//cuttlefish/host/frontend/webrtc/libdevice:audio_frame_buffer", + ], +) + cf_cc_library( name = "libdevice", srcs = [ @@ -26,7 +34,6 @@ cf_cc_library( "video_track_source_impl.cpp", ], hdrs = [ - "audio_sink.h", "audio_track_source_impl.h", "camera_controller.h", "camera_streamer.h", @@ -56,7 +63,7 @@ cf_cc_library( "//cuttlefish/host/frontend/webrtc/libcommon:connection_controller", "//cuttlefish/host/frontend/webrtc/libcommon:peer_connection_utils", "//cuttlefish/host/frontend/webrtc/libcommon:utils", - "//cuttlefish/host/frontend/webrtc/libdevice:audio_frame_buffer", + "//cuttlefish/host/frontend/webrtc/libdevice:audio_sink", "//cuttlefish/host/frontend/webrtc_operator/constants:webrtc_signaling_headers", "//cuttlefish/host/libs/config:custom_actions", "//cuttlefish/host/libs/config:cuttlefish_config", From b9d99ed96b45a409f212952399ea2fc3048c7e00 Mon Sep 17 00:00:00 2001 From: "A. Cody Schuffelen" Date: Thu, 31 Jul 2025 18:18:31 -0700 Subject: [PATCH 03/17] Extract `//cuttlefish/host/frontend/webrtc/libdevice:audio_track_source_impl` Bug: b/438313626 --- .../host/frontend/webrtc/libdevice/BUILD.bazel | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/base/cvd/cuttlefish/host/frontend/webrtc/libdevice/BUILD.bazel b/base/cvd/cuttlefish/host/frontend/webrtc/libdevice/BUILD.bazel index f75a88f4db4..09d5d6518b6 100644 --- a/base/cvd/cuttlefish/host/frontend/webrtc/libdevice/BUILD.bazel +++ b/base/cvd/cuttlefish/host/frontend/webrtc/libdevice/BUILD.bazel @@ -9,6 +9,17 @@ cf_cc_library( hdrs = ["audio_frame_buffer.h"], ) +cf_cc_library( + name = "audio_track_source_impl", + srcs = ["audio_track_source_impl.cpp"], + hdrs = ["audio_track_source_impl.h"], + deps = [ + "//cuttlefish/host/frontend/webrtc/libdevice:audio_sink", + "//libbase", + "@libwebrtc", + ], +) + cf_cc_library( name = "audio_sink", hdrs = ["audio_sink.h"], @@ -20,7 +31,6 @@ cf_cc_library( cf_cc_library( name = "libdevice", srcs = [ - "audio_track_source_impl.cpp", "camera_streamer.cpp", "client_handler.cpp", "data_channels.cpp", @@ -34,7 +44,6 @@ cf_cc_library( "video_track_source_impl.cpp", ], hdrs = [ - "audio_track_source_impl.h", "camera_controller.h", "camera_streamer.h", "client_handler.h", @@ -64,6 +73,7 @@ cf_cc_library( "//cuttlefish/host/frontend/webrtc/libcommon:peer_connection_utils", "//cuttlefish/host/frontend/webrtc/libcommon:utils", "//cuttlefish/host/frontend/webrtc/libdevice:audio_sink", + "//cuttlefish/host/frontend/webrtc/libdevice:audio_track_source_impl", "//cuttlefish/host/frontend/webrtc_operator/constants:webrtc_signaling_headers", "//cuttlefish/host/libs/config:custom_actions", "//cuttlefish/host/libs/config:cuttlefish_config", From 8934a8839381704cc6ed5aa92467af765e400ffd Mon Sep 17 00:00:00 2001 From: "A. Cody Schuffelen" Date: Thu, 31 Jul 2025 18:29:27 -0700 Subject: [PATCH 04/17] Extract `//cuttlefish/host/frontend/webrtc/libdevice:camera_controller` Bug: b/438313626 --- base/cvd/cuttlefish/host/frontend/webrtc/BUILD.bazel | 1 + .../host/frontend/webrtc/libdevice/BUILD.bazel | 10 +++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/base/cvd/cuttlefish/host/frontend/webrtc/BUILD.bazel b/base/cvd/cuttlefish/host/frontend/webrtc/BUILD.bazel index 4385ce9e47e..146f15bf7e8 100644 --- a/base/cvd/cuttlefish/host/frontend/webrtc/BUILD.bazel +++ b/base/cvd/cuttlefish/host/frontend/webrtc/BUILD.bazel @@ -71,6 +71,7 @@ cf_cc_binary( "//cuttlefish/host/frontend/webrtc/libcommon:audio_source", "//cuttlefish/host/frontend/webrtc/libdevice", "//cuttlefish/host/frontend/webrtc/libdevice:audio_sink", + "//cuttlefish/host/frontend/webrtc/libdevice:camera_controller", "//cuttlefish/host/libs/audio_connector", "//cuttlefish/host/libs/config:config_constants", "//cuttlefish/host/libs/config:config_utils", diff --git a/base/cvd/cuttlefish/host/frontend/webrtc/libdevice/BUILD.bazel b/base/cvd/cuttlefish/host/frontend/webrtc/libdevice/BUILD.bazel index 09d5d6518b6..50f7dd1b52e 100644 --- a/base/cvd/cuttlefish/host/frontend/webrtc/libdevice/BUILD.bazel +++ b/base/cvd/cuttlefish/host/frontend/webrtc/libdevice/BUILD.bazel @@ -28,6 +28,14 @@ cf_cc_library( ], ) +cf_cc_library( + name = "camera_controller", + hdrs = ["camera_controller.h"], + deps = [ + "@jsoncpp", + ], +) + cf_cc_library( name = "libdevice", srcs = [ @@ -44,7 +52,6 @@ cf_cc_library( "video_track_source_impl.cpp", ], hdrs = [ - "camera_controller.h", "camera_streamer.h", "client_handler.h", "connection_observer.h", @@ -74,6 +81,7 @@ cf_cc_library( "//cuttlefish/host/frontend/webrtc/libcommon:utils", "//cuttlefish/host/frontend/webrtc/libdevice:audio_sink", "//cuttlefish/host/frontend/webrtc/libdevice:audio_track_source_impl", + "//cuttlefish/host/frontend/webrtc/libdevice:camera_controller", "//cuttlefish/host/frontend/webrtc_operator/constants:webrtc_signaling_headers", "//cuttlefish/host/libs/config:custom_actions", "//cuttlefish/host/libs/config:cuttlefish_config", From 1611b943dfcb208a2af07dae566838389f57e6e3 Mon Sep 17 00:00:00 2001 From: "A. Cody Schuffelen" Date: Thu, 31 Jul 2025 19:59:31 -0700 Subject: [PATCH 05/17] Extract `//cuttlefish/host/frontend/webrtc/libdevice:camera_streamer` Bug: b/438313626 --- .../host/frontend/webrtc/libdevice/BUILD.bazel | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/base/cvd/cuttlefish/host/frontend/webrtc/libdevice/BUILD.bazel b/base/cvd/cuttlefish/host/frontend/webrtc/libdevice/BUILD.bazel index 50f7dd1b52e..f60f2ead065 100644 --- a/base/cvd/cuttlefish/host/frontend/webrtc/libdevice/BUILD.bazel +++ b/base/cvd/cuttlefish/host/frontend/webrtc/libdevice/BUILD.bazel @@ -36,10 +36,22 @@ cf_cc_library( ], ) +cf_cc_library( + name = "camera_streamer", + srcs = ["camera_streamer.cpp"], + hdrs = ["camera_streamer.h"], + deps = [ + "//cuttlefish/common/libs/utils:vsock_connection", + "//cuttlefish/host/frontend/webrtc/libdevice:camera_controller", + "//libbase", + "@jsoncpp", + "@libwebrtc", + ], +) + cf_cc_library( name = "libdevice", srcs = [ - "camera_streamer.cpp", "client_handler.cpp", "data_channels.cpp", "gamepad.cpp", @@ -52,7 +64,6 @@ cf_cc_library( "video_track_source_impl.cpp", ], hdrs = [ - "camera_streamer.h", "client_handler.h", "connection_observer.h", "data_channels.h", @@ -82,6 +93,7 @@ cf_cc_library( "//cuttlefish/host/frontend/webrtc/libdevice:audio_sink", "//cuttlefish/host/frontend/webrtc/libdevice:audio_track_source_impl", "//cuttlefish/host/frontend/webrtc/libdevice:camera_controller", + "//cuttlefish/host/frontend/webrtc/libdevice:camera_streamer", "//cuttlefish/host/frontend/webrtc_operator/constants:webrtc_signaling_headers", "//cuttlefish/host/libs/config:custom_actions", "//cuttlefish/host/libs/config:cuttlefish_config", From ce6f5f58a8600d5ba9166e753c91ef4f9f6f3664 Mon Sep 17 00:00:00 2001 From: "A. Cody Schuffelen" Date: Thu, 31 Jul 2025 20:02:47 -0700 Subject: [PATCH 06/17] Extract `//cuttlefish/host/frontend/webrtc/libdevice:connection_observer` Bug: b/438313626 --- base/cvd/cuttlefish/host/frontend/webrtc/BUILD.bazel | 1 + .../host/frontend/webrtc/libdevice/BUILD.bazel | 11 ++++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/base/cvd/cuttlefish/host/frontend/webrtc/BUILD.bazel b/base/cvd/cuttlefish/host/frontend/webrtc/BUILD.bazel index 146f15bf7e8..bb57a3b0953 100644 --- a/base/cvd/cuttlefish/host/frontend/webrtc/BUILD.bazel +++ b/base/cvd/cuttlefish/host/frontend/webrtc/BUILD.bazel @@ -72,6 +72,7 @@ cf_cc_binary( "//cuttlefish/host/frontend/webrtc/libdevice", "//cuttlefish/host/frontend/webrtc/libdevice:audio_sink", "//cuttlefish/host/frontend/webrtc/libdevice:camera_controller", + "//cuttlefish/host/frontend/webrtc/libdevice:connection_observer", "//cuttlefish/host/libs/audio_connector", "//cuttlefish/host/libs/config:config_constants", "//cuttlefish/host/libs/config:config_utils", diff --git a/base/cvd/cuttlefish/host/frontend/webrtc/libdevice/BUILD.bazel b/base/cvd/cuttlefish/host/frontend/webrtc/libdevice/BUILD.bazel index f60f2ead065..92f671bf6a8 100644 --- a/base/cvd/cuttlefish/host/frontend/webrtc/libdevice/BUILD.bazel +++ b/base/cvd/cuttlefish/host/frontend/webrtc/libdevice/BUILD.bazel @@ -49,6 +49,15 @@ cf_cc_library( ], ) +cf_cc_library( + name = "connection_observer", + hdrs = ["connection_observer.h"], + deps = [ + "//cuttlefish/common/libs/utils:result", + "@jsoncpp", + ], +) + cf_cc_library( name = "libdevice", srcs = [ @@ -65,7 +74,6 @@ cf_cc_library( ], hdrs = [ "client_handler.h", - "connection_observer.h", "data_channels.h", "gamepad.h", "keyboard.h", @@ -94,6 +102,7 @@ cf_cc_library( "//cuttlefish/host/frontend/webrtc/libdevice:audio_track_source_impl", "//cuttlefish/host/frontend/webrtc/libdevice:camera_controller", "//cuttlefish/host/frontend/webrtc/libdevice:camera_streamer", + "//cuttlefish/host/frontend/webrtc/libdevice:connection_observer", "//cuttlefish/host/frontend/webrtc_operator/constants:webrtc_signaling_headers", "//cuttlefish/host/libs/config:custom_actions", "//cuttlefish/host/libs/config:cuttlefish_config", From 460ec2abdef7b945c2179815d7a40dd10d520a34 Mon Sep 17 00:00:00 2001 From: "A. Cody Schuffelen" Date: Thu, 31 Jul 2025 20:06:14 -0700 Subject: [PATCH 07/17] Extract `//cuttlefish/host/frontend/webrtc/libdevice:video_sink` Bug: b/438313626 --- base/cvd/cuttlefish/host/frontend/webrtc/BUILD.bazel | 1 + .../host/frontend/webrtc/libdevice/BUILD.bazel | 11 +++++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/base/cvd/cuttlefish/host/frontend/webrtc/BUILD.bazel b/base/cvd/cuttlefish/host/frontend/webrtc/BUILD.bazel index bb57a3b0953..f5fbd240b1e 100644 --- a/base/cvd/cuttlefish/host/frontend/webrtc/BUILD.bazel +++ b/base/cvd/cuttlefish/host/frontend/webrtc/BUILD.bazel @@ -73,6 +73,7 @@ cf_cc_binary( "//cuttlefish/host/frontend/webrtc/libdevice:audio_sink", "//cuttlefish/host/frontend/webrtc/libdevice:camera_controller", "//cuttlefish/host/frontend/webrtc/libdevice:connection_observer", + "//cuttlefish/host/frontend/webrtc/libdevice:video_sink", "//cuttlefish/host/libs/audio_connector", "//cuttlefish/host/libs/config:config_constants", "//cuttlefish/host/libs/config:config_utils", diff --git a/base/cvd/cuttlefish/host/frontend/webrtc/libdevice/BUILD.bazel b/base/cvd/cuttlefish/host/frontend/webrtc/libdevice/BUILD.bazel index 92f671bf6a8..d958acb1ddb 100644 --- a/base/cvd/cuttlefish/host/frontend/webrtc/libdevice/BUILD.bazel +++ b/base/cvd/cuttlefish/host/frontend/webrtc/libdevice/BUILD.bazel @@ -82,7 +82,6 @@ cf_cc_library( "recording_manager.h", "server_connection.h", "streamer.h", - "video_sink.h", "video_track_source_impl.h", ], linkopts = [ @@ -103,10 +102,10 @@ cf_cc_library( "//cuttlefish/host/frontend/webrtc/libdevice:camera_controller", "//cuttlefish/host/frontend/webrtc/libdevice:camera_streamer", "//cuttlefish/host/frontend/webrtc/libdevice:connection_observer", + "//cuttlefish/host/frontend/webrtc/libdevice:video_sink", "//cuttlefish/host/frontend/webrtc_operator/constants:webrtc_signaling_headers", "//cuttlefish/host/libs/config:custom_actions", "//cuttlefish/host/libs/config:cuttlefish_config", - "//cuttlefish/host/libs/screen_connector:video_frame_buffer", "//libbase", "@boringssl//:crypto", "@jsoncpp", @@ -115,3 +114,11 @@ cf_cc_library( "@libwebrtc", ], ) + +cf_cc_library( + name = "video_sink", + hdrs = ["video_sink.h"], + deps = [ + "//cuttlefish/host/libs/screen_connector:video_frame_buffer", + ], +) From 5f2d69f077e76c503068ea36e33c8d013795baff Mon Sep 17 00:00:00 2001 From: "A. Cody Schuffelen" Date: Thu, 31 Jul 2025 20:10:18 -0700 Subject: [PATCH 08/17] Extract `//cuttlefish/host/frontend/webrtc/libdevice:video_track_source_impl` Bug: b/438313626 --- .../host/frontend/webrtc/libdevice/BUILD.bazel | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/base/cvd/cuttlefish/host/frontend/webrtc/libdevice/BUILD.bazel b/base/cvd/cuttlefish/host/frontend/webrtc/libdevice/BUILD.bazel index d958acb1ddb..b1c4b00b41b 100644 --- a/base/cvd/cuttlefish/host/frontend/webrtc/libdevice/BUILD.bazel +++ b/base/cvd/cuttlefish/host/frontend/webrtc/libdevice/BUILD.bazel @@ -70,7 +70,6 @@ cf_cc_library( "recording_manager.cpp", "server_connection.cpp", "streamer.cpp", - "video_track_source_impl.cpp", ], hdrs = [ "client_handler.h", @@ -82,7 +81,6 @@ cf_cc_library( "recording_manager.h", "server_connection.h", "streamer.h", - "video_track_source_impl.h", ], linkopts = [ "-lopus", @@ -103,6 +101,7 @@ cf_cc_library( "//cuttlefish/host/frontend/webrtc/libdevice:camera_streamer", "//cuttlefish/host/frontend/webrtc/libdevice:connection_observer", "//cuttlefish/host/frontend/webrtc/libdevice:video_sink", + "//cuttlefish/host/frontend/webrtc/libdevice:video_track_source_impl", "//cuttlefish/host/frontend/webrtc_operator/constants:webrtc_signaling_headers", "//cuttlefish/host/libs/config:custom_actions", "//cuttlefish/host/libs/config:cuttlefish_config", @@ -122,3 +121,13 @@ cf_cc_library( "//cuttlefish/host/libs/screen_connector:video_frame_buffer", ], ) + +cf_cc_library( + name = "video_track_source_impl", + srcs = ["video_track_source_impl.cpp"], + hdrs = ["video_track_source_impl.h"], + deps = [ + "//cuttlefish/host/frontend/webrtc/libdevice:video_sink", + "@libwebrtc", + ], +) From fbc1da2894eaa72d7068e6f99ad5e913dedc8bcb Mon Sep 17 00:00:00 2001 From: "A. Cody Schuffelen" Date: Thu, 31 Jul 2025 20:13:28 -0700 Subject: [PATCH 09/17] Extract `//cuttlefish/host/frotend/webrtc/libdevice:server_connection` Bug: b/438313626 --- .../host/frontend/webrtc/libdevice/BUILD.bazel | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/base/cvd/cuttlefish/host/frontend/webrtc/libdevice/BUILD.bazel b/base/cvd/cuttlefish/host/frontend/webrtc/libdevice/BUILD.bazel index b1c4b00b41b..7361efcec7c 100644 --- a/base/cvd/cuttlefish/host/frontend/webrtc/libdevice/BUILD.bazel +++ b/base/cvd/cuttlefish/host/frontend/webrtc/libdevice/BUILD.bazel @@ -68,7 +68,6 @@ cf_cc_library( "lights_observer.cpp", "local_recorder.cpp", "recording_manager.cpp", - "server_connection.cpp", "streamer.cpp", ], hdrs = [ @@ -79,14 +78,12 @@ cf_cc_library( "lights_observer.h", "local_recorder.h", "recording_manager.h", - "server_connection.h", "streamer.h", ], linkopts = [ "-lopus", ], deps = [ - "//cuttlefish/common/libs/fs", "//cuttlefish/common/libs/utils:json", "//cuttlefish/common/libs/utils:result", "//cuttlefish/common/libs/utils:vsock_connection", @@ -100,6 +97,7 @@ cf_cc_library( "//cuttlefish/host/frontend/webrtc/libdevice:camera_controller", "//cuttlefish/host/frontend/webrtc/libdevice:camera_streamer", "//cuttlefish/host/frontend/webrtc/libdevice:connection_observer", + "//cuttlefish/host/frontend/webrtc/libdevice:server_connection", "//cuttlefish/host/frontend/webrtc/libdevice:video_sink", "//cuttlefish/host/frontend/webrtc/libdevice:video_track_source_impl", "//cuttlefish/host/frontend/webrtc_operator/constants:webrtc_signaling_headers", @@ -114,6 +112,17 @@ cf_cc_library( ], ) +cf_cc_library( + name = "server_connection", + srcs = ["server_connection.cpp"], + hdrs = ["server_connection.h"], + deps = [ + "//cuttlefish/common/libs/fs", + "//libbase", + "@jsoncpp", + ], +) + cf_cc_library( name = "video_sink", hdrs = ["video_sink.h"], From 04579c083bc061792f39e0c4430b85b9261c5891 Mon Sep 17 00:00:00 2001 From: "A. Cody Schuffelen" Date: Thu, 31 Jul 2025 20:17:12 -0700 Subject: [PATCH 10/17] Extract `//cuttlefish/host/frontend/webrtc/libdevice:local_recorder` Bug: b/438313626 --- .../cvd/cuttlefish/host/frontend/webrtc/BUILD.bazel | 1 + .../host/frontend/webrtc/libdevice/BUILD.bazel | 13 +++++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/base/cvd/cuttlefish/host/frontend/webrtc/BUILD.bazel b/base/cvd/cuttlefish/host/frontend/webrtc/BUILD.bazel index f5fbd240b1e..73da94b54cd 100644 --- a/base/cvd/cuttlefish/host/frontend/webrtc/BUILD.bazel +++ b/base/cvd/cuttlefish/host/frontend/webrtc/BUILD.bazel @@ -73,6 +73,7 @@ cf_cc_binary( "//cuttlefish/host/frontend/webrtc/libdevice:audio_sink", "//cuttlefish/host/frontend/webrtc/libdevice:camera_controller", "//cuttlefish/host/frontend/webrtc/libdevice:connection_observer", + "//cuttlefish/host/frontend/webrtc/libdevice:local_recorder", "//cuttlefish/host/frontend/webrtc/libdevice:video_sink", "//cuttlefish/host/libs/audio_connector", "//cuttlefish/host/libs/config:config_constants", diff --git a/base/cvd/cuttlefish/host/frontend/webrtc/libdevice/BUILD.bazel b/base/cvd/cuttlefish/host/frontend/webrtc/libdevice/BUILD.bazel index 7361efcec7c..b742da2c284 100644 --- a/base/cvd/cuttlefish/host/frontend/webrtc/libdevice/BUILD.bazel +++ b/base/cvd/cuttlefish/host/frontend/webrtc/libdevice/BUILD.bazel @@ -66,7 +66,6 @@ cf_cc_library( "gamepad.cpp", "keyboard.cpp", "lights_observer.cpp", - "local_recorder.cpp", "recording_manager.cpp", "streamer.cpp", ], @@ -76,7 +75,6 @@ cf_cc_library( "gamepad.h", "keyboard.h", "lights_observer.h", - "local_recorder.h", "recording_manager.h", "streamer.h", ], @@ -97,6 +95,7 @@ cf_cc_library( "//cuttlefish/host/frontend/webrtc/libdevice:camera_controller", "//cuttlefish/host/frontend/webrtc/libdevice:camera_streamer", "//cuttlefish/host/frontend/webrtc/libdevice:connection_observer", + "//cuttlefish/host/frontend/webrtc/libdevice:local_recorder", "//cuttlefish/host/frontend/webrtc/libdevice:server_connection", "//cuttlefish/host/frontend/webrtc/libdevice:video_sink", "//cuttlefish/host/frontend/webrtc/libdevice:video_track_source_impl", @@ -107,6 +106,16 @@ cf_cc_library( "@boringssl//:crypto", "@jsoncpp", "@libvpx", + "@libwebrtc", + ], +) + +cf_cc_library( + name = "local_recorder", + srcs = ["local_recorder.cpp"], + hdrs = ["local_recorder.h"], + deps = [ + "//libbase", "@libwebm//:mkvmuxer", "@libwebrtc", ], From 7c2053f3d742d6c301c3adcffadd1b25544b5f9e Mon Sep 17 00:00:00 2001 From: "A. Cody Schuffelen" Date: Thu, 31 Jul 2025 20:19:45 -0700 Subject: [PATCH 11/17] Extract `//cuttlefish/host/frontend/libwebrtc/libdevice:lights_observer` Bug: b/438313626 --- .../cvd/cuttlefish/host/frontend/webrtc/BUILD.bazel | 1 + .../host/frontend/webrtc/libdevice/BUILD.bazel | 13 +++++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/base/cvd/cuttlefish/host/frontend/webrtc/BUILD.bazel b/base/cvd/cuttlefish/host/frontend/webrtc/BUILD.bazel index 73da94b54cd..e4e47933c75 100644 --- a/base/cvd/cuttlefish/host/frontend/webrtc/BUILD.bazel +++ b/base/cvd/cuttlefish/host/frontend/webrtc/BUILD.bazel @@ -73,6 +73,7 @@ cf_cc_binary( "//cuttlefish/host/frontend/webrtc/libdevice:audio_sink", "//cuttlefish/host/frontend/webrtc/libdevice:camera_controller", "//cuttlefish/host/frontend/webrtc/libdevice:connection_observer", + "//cuttlefish/host/frontend/webrtc/libdevice:lights_observer", "//cuttlefish/host/frontend/webrtc/libdevice:local_recorder", "//cuttlefish/host/frontend/webrtc/libdevice:video_sink", "//cuttlefish/host/libs/audio_connector", diff --git a/base/cvd/cuttlefish/host/frontend/webrtc/libdevice/BUILD.bazel b/base/cvd/cuttlefish/host/frontend/webrtc/libdevice/BUILD.bazel index b742da2c284..21493f8216a 100644 --- a/base/cvd/cuttlefish/host/frontend/webrtc/libdevice/BUILD.bazel +++ b/base/cvd/cuttlefish/host/frontend/webrtc/libdevice/BUILD.bazel @@ -65,7 +65,6 @@ cf_cc_library( "data_channels.cpp", "gamepad.cpp", "keyboard.cpp", - "lights_observer.cpp", "recording_manager.cpp", "streamer.cpp", ], @@ -74,7 +73,6 @@ cf_cc_library( "data_channels.h", "gamepad.h", "keyboard.h", - "lights_observer.h", "recording_manager.h", "streamer.h", ], @@ -110,6 +108,17 @@ cf_cc_library( ], ) +cf_cc_library( + name = "lights_observer", + srcs = ["lights_observer.cpp"], + hdrs = ["lights_observer.h"], + deps = [ + "//cuttlefish/common/libs/utils:vsock_connection", + "//libbase", + "@jsoncpp", + ], +) + cf_cc_library( name = "local_recorder", srcs = ["local_recorder.cpp"], From 76336105219c2d30df88e6bd4e36a8aad2c17532 Mon Sep 17 00:00:00 2001 From: "A. Cody Schuffelen" Date: Thu, 31 Jul 2025 20:22:55 -0700 Subject: [PATCH 12/17] Extract `//cuttlefish/host/frontend/webrtc/libdevice:recording_manager` Bug: b/438313626 --- .../host/frontend/webrtc/libdevice/BUILD.bazel | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/base/cvd/cuttlefish/host/frontend/webrtc/libdevice/BUILD.bazel b/base/cvd/cuttlefish/host/frontend/webrtc/libdevice/BUILD.bazel index 21493f8216a..d3f8b6e69bf 100644 --- a/base/cvd/cuttlefish/host/frontend/webrtc/libdevice/BUILD.bazel +++ b/base/cvd/cuttlefish/host/frontend/webrtc/libdevice/BUILD.bazel @@ -65,7 +65,6 @@ cf_cc_library( "data_channels.cpp", "gamepad.cpp", "keyboard.cpp", - "recording_manager.cpp", "streamer.cpp", ], hdrs = [ @@ -73,7 +72,6 @@ cf_cc_library( "data_channels.h", "gamepad.h", "keyboard.h", - "recording_manager.h", "streamer.h", ], linkopts = [ @@ -93,7 +91,7 @@ cf_cc_library( "//cuttlefish/host/frontend/webrtc/libdevice:camera_controller", "//cuttlefish/host/frontend/webrtc/libdevice:camera_streamer", "//cuttlefish/host/frontend/webrtc/libdevice:connection_observer", - "//cuttlefish/host/frontend/webrtc/libdevice:local_recorder", + "//cuttlefish/host/frontend/webrtc/libdevice:recording_manager", "//cuttlefish/host/frontend/webrtc/libdevice:server_connection", "//cuttlefish/host/frontend/webrtc/libdevice:video_sink", "//cuttlefish/host/frontend/webrtc/libdevice:video_track_source_impl", @@ -130,6 +128,18 @@ cf_cc_library( ], ) +cf_cc_library( + name = "recording_manager", + srcs = ["recording_manager.cpp"], + hdrs = ["recording_manager.h"], + deps = [ + "//cuttlefish/host/frontend/webrtc/libdevice:local_recorder", + "//cuttlefish/host/libs/config:cuttlefish_config", + "//libbase", + "@libwebrtc", + ], +) + cf_cc_library( name = "server_connection", srcs = ["server_connection.cpp"], From c1741c46c6d374f26f565c24b6e76f8b20a32c33 Mon Sep 17 00:00:00 2001 From: "A. Cody Schuffelen" Date: Thu, 31 Jul 2025 20:27:28 -0700 Subject: [PATCH 13/17] Extract `//cuttlefish/host/frontend/webrtc/libdevice:keyboard` Bug: b/438313626 --- .../host/frontend/webrtc/libdevice/BUILD.bazel | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/base/cvd/cuttlefish/host/frontend/webrtc/libdevice/BUILD.bazel b/base/cvd/cuttlefish/host/frontend/webrtc/libdevice/BUILD.bazel index d3f8b6e69bf..e732b15e6f3 100644 --- a/base/cvd/cuttlefish/host/frontend/webrtc/libdevice/BUILD.bazel +++ b/base/cvd/cuttlefish/host/frontend/webrtc/libdevice/BUILD.bazel @@ -58,20 +58,24 @@ cf_cc_library( ], ) +cf_cc_library( + name = "keyboard", + srcs = ["keyboard.cpp"], + hdrs = ["keyboard.h"], +) + cf_cc_library( name = "libdevice", srcs = [ "client_handler.cpp", "data_channels.cpp", "gamepad.cpp", - "keyboard.cpp", "streamer.cpp", ], hdrs = [ "client_handler.h", "data_channels.h", "gamepad.h", - "keyboard.h", "streamer.h", ], linkopts = [ @@ -91,6 +95,7 @@ cf_cc_library( "//cuttlefish/host/frontend/webrtc/libdevice:camera_controller", "//cuttlefish/host/frontend/webrtc/libdevice:camera_streamer", "//cuttlefish/host/frontend/webrtc/libdevice:connection_observer", + "//cuttlefish/host/frontend/webrtc/libdevice:keyboard", "//cuttlefish/host/frontend/webrtc/libdevice:recording_manager", "//cuttlefish/host/frontend/webrtc/libdevice:server_connection", "//cuttlefish/host/frontend/webrtc/libdevice:video_sink", From b201582c4d476af8094f4a0449c8419ecb213326 Mon Sep 17 00:00:00 2001 From: "A. Cody Schuffelen" Date: Tue, 12 Aug 2025 17:32:57 -0700 Subject: [PATCH 14/17] Extract `//cuttlefish/host/frontend/webrtc/libdevice:gamepad` Bug: b/438313626 --- .../cuttlefish/host/frontend/webrtc/libdevice/BUILD.bazel | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/base/cvd/cuttlefish/host/frontend/webrtc/libdevice/BUILD.bazel b/base/cvd/cuttlefish/host/frontend/webrtc/libdevice/BUILD.bazel index e732b15e6f3..c9a75d703c3 100644 --- a/base/cvd/cuttlefish/host/frontend/webrtc/libdevice/BUILD.bazel +++ b/base/cvd/cuttlefish/host/frontend/webrtc/libdevice/BUILD.bazel @@ -58,6 +58,12 @@ cf_cc_library( ], ) +cf_cc_library( + name = "gamepad", + srcs = ["gamepad.cpp"], + hdrs = ["gamepad.h"], +) + cf_cc_library( name = "keyboard", srcs = ["keyboard.cpp"], @@ -95,6 +101,7 @@ cf_cc_library( "//cuttlefish/host/frontend/webrtc/libdevice:camera_controller", "//cuttlefish/host/frontend/webrtc/libdevice:camera_streamer", "//cuttlefish/host/frontend/webrtc/libdevice:connection_observer", + "//cuttlefish/host/frontend/webrtc/libdevice:gamepad", "//cuttlefish/host/frontend/webrtc/libdevice:keyboard", "//cuttlefish/host/frontend/webrtc/libdevice:recording_manager", "//cuttlefish/host/frontend/webrtc/libdevice:server_connection", From d23fea2047d7a6a170535231fb83e22cb45ad948 Mon Sep 17 00:00:00 2001 From: "A. Cody Schuffelen" Date: Thu, 31 Jul 2025 20:30:57 -0700 Subject: [PATCH 15/17] Extract `//cuttlefish/host/frontend/webrtc/libdevice:data_channels` Bug: b/438313626 --- .../frontend/webrtc/libdevice/BUILD.bazel | 21 +++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/base/cvd/cuttlefish/host/frontend/webrtc/libdevice/BUILD.bazel b/base/cvd/cuttlefish/host/frontend/webrtc/libdevice/BUILD.bazel index c9a75d703c3..0f264b86a04 100644 --- a/base/cvd/cuttlefish/host/frontend/webrtc/libdevice/BUILD.bazel +++ b/base/cvd/cuttlefish/host/frontend/webrtc/libdevice/BUILD.bazel @@ -58,6 +58,22 @@ cf_cc_library( ], ) +cf_cc_library( + name = "data_channels", + srcs = ["data_channels.cpp"], + hdrs = ["data_channels.h"], + deps = [ + "//cuttlefish/common/libs/utils:json", + "//cuttlefish/host/frontend/webrtc/libcommon:utils", + "//cuttlefish/host/frontend/webrtc/libdevice:connection_observer", + "//cuttlefish/host/frontend/webrtc/libdevice:gamepad", + "//cuttlefish/host/frontend/webrtc/libdevice:keyboard", + "//cuttlefish/host/libs/config:cuttlefish_config", + "//libbase", + "@libwebrtc", + ], +) + cf_cc_library( name = "gamepad", srcs = ["gamepad.cpp"], @@ -74,13 +90,11 @@ cf_cc_library( name = "libdevice", srcs = [ "client_handler.cpp", - "data_channels.cpp", "gamepad.cpp", "streamer.cpp", ], hdrs = [ "client_handler.h", - "data_channels.h", "gamepad.h", "streamer.h", ], @@ -101,8 +115,7 @@ cf_cc_library( "//cuttlefish/host/frontend/webrtc/libdevice:camera_controller", "//cuttlefish/host/frontend/webrtc/libdevice:camera_streamer", "//cuttlefish/host/frontend/webrtc/libdevice:connection_observer", - "//cuttlefish/host/frontend/webrtc/libdevice:gamepad", - "//cuttlefish/host/frontend/webrtc/libdevice:keyboard", + "//cuttlefish/host/frontend/webrtc/libdevice:data_channels", "//cuttlefish/host/frontend/webrtc/libdevice:recording_manager", "//cuttlefish/host/frontend/webrtc/libdevice:server_connection", "//cuttlefish/host/frontend/webrtc/libdevice:video_sink", From f0071a63bb22f0b0b8c1eefa48b5e2245b7d354b Mon Sep 17 00:00:00 2001 From: "A. Cody Schuffelen" Date: Thu, 31 Jul 2025 20:37:16 -0700 Subject: [PATCH 16/17] Extract `//cuttlefish/host/frontend/webrtc/libdevice:client_handler` Bug: b/438313626 --- .../frontend/webrtc/libdevice/BUILD.bazel | 30 ++++++++++++------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/base/cvd/cuttlefish/host/frontend/webrtc/libdevice/BUILD.bazel b/base/cvd/cuttlefish/host/frontend/webrtc/libdevice/BUILD.bazel index 0f264b86a04..fb3142f0000 100644 --- a/base/cvd/cuttlefish/host/frontend/webrtc/libdevice/BUILD.bazel +++ b/base/cvd/cuttlefish/host/frontend/webrtc/libdevice/BUILD.bazel @@ -49,6 +49,23 @@ cf_cc_library( ], ) +cf_cc_library( + name = "client_handler", + srcs = ["client_handler.cpp"], + hdrs = ["client_handler.h"], + deps = [ + "//cuttlefish/common/libs/utils:result", + "//cuttlefish/host/frontend/webrtc/libcommon:connection_controller", + "//cuttlefish/host/frontend/webrtc/libdevice:connection_observer", + "//cuttlefish/host/frontend/webrtc/libdevice:data_channels", + "//cuttlefish/host/libs/config:cuttlefish_config", + "//libbase", + "@boringssl//:crypto", + "@jsoncpp", + "@libwebrtc", + ], +) + cf_cc_library( name = "connection_observer", hdrs = ["connection_observer.h"], @@ -88,16 +105,8 @@ cf_cc_library( cf_cc_library( name = "libdevice", - srcs = [ - "client_handler.cpp", - "gamepad.cpp", - "streamer.cpp", - ], - hdrs = [ - "client_handler.h", - "gamepad.h", - "streamer.h", - ], + srcs = ["streamer.cpp"], + hdrs = ["streamer.h"], linkopts = [ "-lopus", ], @@ -114,6 +123,7 @@ cf_cc_library( "//cuttlefish/host/frontend/webrtc/libdevice:audio_track_source_impl", "//cuttlefish/host/frontend/webrtc/libdevice:camera_controller", "//cuttlefish/host/frontend/webrtc/libdevice:camera_streamer", + "//cuttlefish/host/frontend/webrtc/libdevice:client_handler", "//cuttlefish/host/frontend/webrtc/libdevice:connection_observer", "//cuttlefish/host/frontend/webrtc/libdevice:data_channels", "//cuttlefish/host/frontend/webrtc/libdevice:recording_manager", From d4e9d7b34723d2fd7d38be0c2f16d978d296dca3 Mon Sep 17 00:00:00 2001 From: "A. Cody Schuffelen" Date: Thu, 31 Jul 2025 20:46:42 -0700 Subject: [PATCH 17/17] Extract `//cuttlefish/host/frontend/webrtc/libdevice:streamer` Bug: b/438313626 --- .../cvd/cuttlefish/host/frontend/webrtc/BUILD.bazel | 2 +- .../host/frontend/webrtc/libdevice/BUILD.bazel | 13 +------------ 2 files changed, 2 insertions(+), 13 deletions(-) diff --git a/base/cvd/cuttlefish/host/frontend/webrtc/BUILD.bazel b/base/cvd/cuttlefish/host/frontend/webrtc/BUILD.bazel index e4e47933c75..d9e059862b6 100644 --- a/base/cvd/cuttlefish/host/frontend/webrtc/BUILD.bazel +++ b/base/cvd/cuttlefish/host/frontend/webrtc/BUILD.bazel @@ -69,12 +69,12 @@ cf_cc_binary( "//cuttlefish/common/libs/utils:size_utils", "//cuttlefish/host/commands/kernel_log_monitor:kernel_log_monitor_utils", "//cuttlefish/host/frontend/webrtc/libcommon:audio_source", - "//cuttlefish/host/frontend/webrtc/libdevice", "//cuttlefish/host/frontend/webrtc/libdevice:audio_sink", "//cuttlefish/host/frontend/webrtc/libdevice:camera_controller", "//cuttlefish/host/frontend/webrtc/libdevice:connection_observer", "//cuttlefish/host/frontend/webrtc/libdevice:lights_observer", "//cuttlefish/host/frontend/webrtc/libdevice:local_recorder", + "//cuttlefish/host/frontend/webrtc/libdevice:streamer", "//cuttlefish/host/frontend/webrtc/libdevice:video_sink", "//cuttlefish/host/libs/audio_connector", "//cuttlefish/host/libs/config:config_constants", diff --git a/base/cvd/cuttlefish/host/frontend/webrtc/libdevice/BUILD.bazel b/base/cvd/cuttlefish/host/frontend/webrtc/libdevice/BUILD.bazel index fb3142f0000..a965f60571f 100644 --- a/base/cvd/cuttlefish/host/frontend/webrtc/libdevice/BUILD.bazel +++ b/base/cvd/cuttlefish/host/frontend/webrtc/libdevice/BUILD.bazel @@ -104,19 +104,12 @@ cf_cc_library( ) cf_cc_library( - name = "libdevice", + name = "streamer", srcs = ["streamer.cpp"], hdrs = ["streamer.h"], - linkopts = [ - "-lopus", - ], deps = [ - "//cuttlefish/common/libs/utils:json", - "//cuttlefish/common/libs/utils:result", - "//cuttlefish/common/libs/utils:vsock_connection", "//cuttlefish/host/frontend/webrtc/libcommon:audio_device", "//cuttlefish/host/frontend/webrtc/libcommon:audio_source", - "//cuttlefish/host/frontend/webrtc/libcommon:connection_controller", "//cuttlefish/host/frontend/webrtc/libcommon:peer_connection_utils", "//cuttlefish/host/frontend/webrtc/libcommon:utils", "//cuttlefish/host/frontend/webrtc/libdevice:audio_sink", @@ -125,18 +118,14 @@ cf_cc_library( "//cuttlefish/host/frontend/webrtc/libdevice:camera_streamer", "//cuttlefish/host/frontend/webrtc/libdevice:client_handler", "//cuttlefish/host/frontend/webrtc/libdevice:connection_observer", - "//cuttlefish/host/frontend/webrtc/libdevice:data_channels", "//cuttlefish/host/frontend/webrtc/libdevice:recording_manager", "//cuttlefish/host/frontend/webrtc/libdevice:server_connection", "//cuttlefish/host/frontend/webrtc/libdevice:video_sink", "//cuttlefish/host/frontend/webrtc/libdevice:video_track_source_impl", "//cuttlefish/host/frontend/webrtc_operator/constants:webrtc_signaling_headers", "//cuttlefish/host/libs/config:custom_actions", - "//cuttlefish/host/libs/config:cuttlefish_config", "//libbase", - "@boringssl//:crypto", "@jsoncpp", - "@libvpx", "@libwebrtc", ], )