| 83 | DEFINE_string(appkey, "", "appkey"); |
| 84 | |
| 85 | void UpdateSettings(RdSettings* settings) { |
| 86 | if (FLAGS_steam_app_id > 0) { |
| 87 | settings->app_.steam_app_.app_id_ = FLAGS_steam_app_id; |
| 88 | settings->app_.steam_app_.steam_url_ = std::format("steam://rungameid/{}", FLAGS_steam_app_id); |
| 89 | } |
| 90 | |
| 91 | if (FLAGS_encoder_format == "h264") { |
| 92 | settings->encoder_.encoder_format_ = Encoder::EncoderFormat::kH264; |
| 93 | } |
| 94 | else { |
| 95 | settings->encoder_.encoder_format_ = Encoder::EncoderFormat::kHEVC; |
| 96 | } |
| 97 | |
| 98 | settings->encoder_.bitrate_ = FLAGS_encoder_bitrate; |
| 99 | settings->encoder_.fps_ = FLAGS_encoder_fps; |
| 100 | |
| 101 | if (FLAGS_encoder_resolution_type == "origin") { |
| 102 | settings->encoder_.encode_res_type_ = Encoder::EncodeResolutionType::kOrigin; |
| 103 | } |
| 104 | else { |
| 105 | settings->encoder_.encode_res_type_ = Encoder::EncodeResolutionType::kSpecify; |
| 106 | } |
| 107 | settings->encoder_.encode_width_ = FLAGS_encoder_width; |
| 108 | settings->encoder_.encode_height_ = FLAGS_encoder_height; |
| 109 | |
| 110 | // capture |
| 111 | settings->capture_.enable_audio_ = FLAGS_capture_audio; |
| 112 | if (FLAGS_capture_audio_type == "global") { |
| 113 | settings->capture_.capture_audio_type_ = Capture::CaptureAudioType::kAudioGlobal; |
| 114 | } |
| 115 | else { |
| 116 | settings->capture_.capture_audio_type_ = Capture::CaptureAudioType::kAudioInner; |
| 117 | } |
| 118 | |
| 119 | settings->capture_.enable_video_ = FLAGS_capture_video; |
| 120 | if (FLAGS_capture_video_type == "global") { |
| 121 | settings->capture_.capture_video_type_ = Capture::CaptureVideoType::kCaptureScreen; |
| 122 | } |
| 123 | else { |
| 124 | settings->capture_.capture_video_type_ = Capture::CaptureVideoType::kVideoInner; |
| 125 | } |
| 126 | settings->capture_.capture_audio_device_ = Base64::Base64Decode(FLAGS_capture_audio_device); |
| 127 | settings->transmission_.listening_port_ = FLAGS_network_listen_port; |
| 128 | settings->transmission_.udp_listen_port_ = FLAGS_udp_listen_port; |
| 129 | |
| 130 | // app |
| 131 | if (!FLAGS_app_game_path.empty()) { |
| 132 | settings->app_.game_path_ = FLAGS_app_game_path; |
| 133 | } |
| 134 | if (!FLAGS_app_game_args.empty()) { |
| 135 | settings->app_.game_arguments_ = FLAGS_app_game_args; |
| 136 | } |
| 137 | |
| 138 | settings->block_debug_ = FLAGS_debug_block; |
| 139 | settings->capture_.mock_video_ = FLAGS_mock_video; |
| 140 | |
| 141 | settings->device_id_ = FLAGS_device_id; |
| 142 | settings->device_random_pwd_ = FLAGS_device_random_pwd; |