Android-cuttlefish cvd tool
Classes | Namespaces | Functions | Variables
main.cpp File Reference
#include <libyuv.h>
#include <memory>
#include <string_view>
#include "absl/log/check.h"
#include "absl/log/log.h"
#include "absl/strings/numbers.h"
#include "absl/strings/str_split.h"
#include "fruit/fruit.h"
#include "gflags/gflags.h"
#include "google/protobuf/text_format.h"
#include "google/rpc/code.pb.h"
#include "google/rpc/status.pb.h"
#include "rtc_base/logging.h"
#include "cuttlefish/common/libs/fs/shared_fd.h"
#include "cuttlefish/common/libs/utils/files.h"
#include "cuttlefish/host/commands/assemble_cvd/proto/guest_config.pb.h"
#include "cuttlefish/host/frontend/webrtc/audio_handler.h"
#include "cuttlefish/host/frontend/webrtc/client_server.h"
#include "cuttlefish/host/frontend/webrtc/connection_observer.h"
#include "cuttlefish/host/frontend/webrtc/display_handler.h"
#include "cuttlefish/host/frontend/webrtc/kernel_log_events_handler.h"
#include "cuttlefish/host/frontend/webrtc/libdevice/camera_controller.h"
#include "cuttlefish/host/frontend/webrtc/libdevice/lights_observer.h"
#include "cuttlefish/host/frontend/webrtc/libdevice/local_recorder.h"
#include "cuttlefish/host/frontend/webrtc/libdevice/streamer.h"
#include "cuttlefish/host/frontend/webrtc/libdevice/video_sink.h"
#include "cuttlefish/host/frontend/webrtc/screenshot_handler.h"
#include "cuttlefish/host/frontend/webrtc/webrtc_command_channel.h"
#include "cuttlefish/host/frontend/webrtc/webrtc_commands.pb.h"
#include "cuttlefish/host/libs/audio_connector/server.h"
#include "cuttlefish/host/libs/config/cuttlefish_config.h"
#include "cuttlefish/host/libs/config/logging.h"
#include "cuttlefish/host/libs/config/openwrt_args.h"
#include "cuttlefish/host/libs/confui/host_mode_ctrl.h"
#include "cuttlefish/host/libs/confui/host_server.h"
#include "cuttlefish/host/libs/input_connector/input_connector.h"
#include "cuttlefish/host/libs/screen_connector/composition_manager.h"
#include "cuttlefish/host/libs/screen_connector/screen_connector.h"
Include dependency graph for main.cpp:

Classes

class  cuttlefish::CfOperatorObserver
 

Namespaces

namespace  cuttlefish
 

Functions

 DEFINE_bool (multitouch, true, "Whether to send multi-touch or single-touch events")
 
 DEFINE_string (touch_fds, "", "DEPRECATED: Use --touch_server_paths instead.")
 
 DEFINE_string (touch_server_paths, "", "A list of input server paths to connect to for touchscreen events.")
 
 DEFINE_int32 (mouse_fd, -1, "DEPRECATED: Use --mouse_server_path instead.")
 
 DEFINE_string (mouse_server_path, "", "Mouse input server path.")
 
 DEFINE_int32 (gamepad_fd, -1, "DEPRECATED: Use --gamepad_server_path instead.")
 
 DEFINE_string (gamepad_server_path, "", "Gamepad input server path.")
 
 DEFINE_int32 (rotary_fd, -1, "DEPRECATED: Use --rotary_server_path instead.")
 
 DEFINE_string (rotary_server_path, "", "Rotary input server path.")
 
 DEFINE_int32 (keyboard_fd, -1, "DEPRECATED: Use --rotary_server_path instead.")
 
 DEFINE_string (keyboard_server_path, "", "Keyboard input server path.")
 
 DEFINE_int32 (switches_fd, -1, "DEPRECATED: Use --rotary_server_path instead.")
 
 DEFINE_string (switches_server_path, "", "Switches input server path.")
 
 DEFINE_int32 (frame_server_fd, -1, "An fd to listen on for frame updates")
 
 DEFINE_int32 (kernel_log_events_fd, -1, "An fd to listen on for kernel log events.")
 
 DEFINE_int32 (command_fd, -1, "An fd to listen to for control messages")
 
 DEFINE_int32 (confui_in_fd, -1, "Confirmation UI virtio-console from host to guest")
 
 DEFINE_int32 (confui_out_fd, -1, "Confirmation UI virtio-console from guest to host")
 
 DEFINE_string (action_servers, "", "A comma-separated list of server_name:fd pairs, " "where each entry corresponds to one custom action server.")
 
 DEFINE_int32 (audio_server_fd, -1, "An fd to listen on for audio frames")
 
 DEFINE_int32 (camera_streamer_fd, -1, "An fd to send client camera frames")
 
 DEFINE_int32 (sensors_fd, -1, "An fd to communicate with sensors_simulator.")
 
 DEFINE_string (client_dir, "webrtc", "Location of the client files")
 
 DEFINE_string (group_id, "", "UNUSED - Kept to support webRTC and run_cvd with different " "versions during the migration")
 
std::unique_ptr< AudioServer > cuttlefish::CreateAudioServer ()
 
fruit::Component< CustomActionConfigProvider > cuttlefish::WebRtcComponent ()
 
fruit::Component< ScreenConnector< DisplayHandler::WebRtcScProcessedFrame >, confui::HostServer, confui::HostVirtualInput > cuttlefish::CreateConfirmationUIComponent (int *frames_fd, bool *frames_are_rgba, confui::PipeConnectionPair *pipe_io_pair, InputConnector *input_connector)
 
Result< void > cuttlefish::ControlLoop (SharedFD control_socket, DisplayHandler &display_handler, RecordingManager &recording_manager, ScreenshotHandler &screenshot_handler)
 
AudioChannelsLayout cuttlefish::ConvertChannelLayout (::cuttlefish::config::Audio_ChannelLayout layout)
 
uint32_t cuttlefish::ConvertSampleRate (::cuttlefish::config::Audio_SampleRate rate)
 
cuttlefish::AudioStreamSettings cuttlefish::ParseAudioStreamSettings (const ::cuttlefish::config::Audio_PCMDevice_Stream &stream, AudioStreamSettings::Direction direction)
 
std::shared_ptr< AudioHandler > cuttlefish::SetupAudio (const cuttlefish::CuttlefishConfig::InstanceSpecific &instance, cuttlefish::webrtc_streaming::Streamer &streamer)
 
int cuttlefish::CuttlefishMain ()
 
int main (int argc, char **argv)
 

Variables

constexpr auto cuttlefish::kOpewnrtWanIpAddressName = "wan_ipaddr"
 
constexpr auto cuttlefish::kTouchscreenPrefix = "display_"
 
constexpr auto cuttlefish::kTouchpadPrefix = "touch_"
 

Function Documentation

◆ DEFINE_bool()

DEFINE_bool ( multitouch  ,
true  ,
"Whether to send multi-touch or single-touch events"   
)

◆ DEFINE_int32() [1/13]

DEFINE_int32 ( audio_server_fd  ,
1,
"An fd to listen on for audio frames"   
)

◆ DEFINE_int32() [2/13]

DEFINE_int32 ( camera_streamer_fd  ,
1,
"An fd to send client camera frames"   
)

◆ DEFINE_int32() [3/13]

DEFINE_int32 ( command_fd  ,
1,
"An fd to listen to for control messages"   
)

◆ DEFINE_int32() [4/13]

DEFINE_int32 ( confui_in_fd  ,
1,
"Confirmation UI virtio-console from host to guest"   
)

◆ DEFINE_int32() [5/13]

DEFINE_int32 ( confui_out_fd  ,
1,
"Confirmation UI virtio-console from guest to host"   
)

◆ DEFINE_int32() [6/13]

DEFINE_int32 ( frame_server_fd  ,
1,
"An fd to listen on for frame updates"   
)

◆ DEFINE_int32() [7/13]

DEFINE_int32 ( gamepad_fd  ,
1,
"DEPRECATED: Use --gamepad_server_path instead."   
)

◆ DEFINE_int32() [8/13]

DEFINE_int32 ( kernel_log_events_fd  ,
1,
"An fd to listen on for kernel log events."   
)

◆ DEFINE_int32() [9/13]

DEFINE_int32 ( keyboard_fd  ,
1,
"DEPRECATED: Use --rotary_server_path instead."   
)

◆ DEFINE_int32() [10/13]

DEFINE_int32 ( mouse_fd  ,
1,
"DEPRECATED: Use --mouse_server_path instead."   
)

◆ DEFINE_int32() [11/13]

DEFINE_int32 ( rotary_fd  ,
1,
"DEPRECATED: Use --rotary_server_path instead."   
)

◆ DEFINE_int32() [12/13]

DEFINE_int32 ( sensors_fd  ,
1,
"An fd to communicate with sensors_simulator."   
)

◆ DEFINE_int32() [13/13]

DEFINE_int32 ( switches_fd  ,
1,
"DEPRECATED: Use --rotary_server_path instead."   
)

◆ DEFINE_string() [1/10]

DEFINE_string ( action_servers  ,
""  ,
"A comma-separated list of server_name:fd  pairs,
" "where each entry corresponds to one custom action server."   
)

◆ DEFINE_string() [2/10]

DEFINE_string ( client_dir  ,
"webrtc"  ,
"Location of the client files"   
)

◆ DEFINE_string() [3/10]

DEFINE_string ( gamepad_server_path  ,
""  ,
"Gamepad input server path."   
)

◆ DEFINE_string() [4/10]

DEFINE_string ( group_id  ,
""  ,
"UNUSED - Kept to support webRTC and run_cvd with different " "versions during the migration"   
)

◆ DEFINE_string() [5/10]

DEFINE_string ( keyboard_server_path  ,
""  ,
"Keyboard input server path."   
)

◆ DEFINE_string() [6/10]

DEFINE_string ( mouse_server_path  ,
""  ,
"Mouse input server path."   
)

◆ DEFINE_string() [7/10]

DEFINE_string ( rotary_server_path  ,
""  ,
"Rotary input server path."   
)

◆ DEFINE_string() [8/10]

DEFINE_string ( switches_server_path  ,
""  ,
"Switches input server path."   
)

◆ DEFINE_string() [9/10]

DEFINE_string ( touch_fds  ,
""  ,
"DEPRECATED: Use --touch_server_paths instead."   
)

◆ DEFINE_string() [10/10]

DEFINE_string ( touch_server_paths  ,
""  ,
"A list of input server paths to connect to for touchscreen events."   
)

◆ main()

int main ( int  argc,
char **  argv 
)