@@ -59,6 +59,11 @@ void Parser::ParseArgs(int argc, char *argv[], Args &args) {
5959 (" mqtt_password" , bpo::value<std::string>()->default_value (args.mqtt_password ),
6060 " Mqtt server password" )
6161 (" http_port" , bpo::value<uint16_t >()->default_value (args.http_port ), " Http server port" )
62+ (" ws_host" , bpo::value<std::string>()->default_value (args.ws_host ),
63+ " Websocket server host" )
64+ (" ws_port" , bpo::value<int >()->default_value (args.ws_port ), " Websocket server port" )
65+ (" ws_token" , bpo::value<std::string>()->default_value (args.ws_token ),
66+ " Websocket server token" )
6267 (" record_path" , bpo::value<std::string>()->default_value (args.record_path ),
6368 " The path to save the recording video files. The recorder won't start if it's empty" )
6469 (" hw_accel" , bpo::bool_switch ()->default_value (args.hw_accel ),
@@ -67,6 +72,8 @@ void Parser::ParseArgs(int argc, char *argv[], Args &args) {
6772 " Use mqtt to exchange sdp and ice candidates" )
6873 (" use_whep" , bpo::bool_switch ()->default_value (args.use_whep ),
6974 " Use whep to exchange sdp and ice candidates" )
75+ (" use_websocket" , bpo::bool_switch ()->default_value (args.use_websocket ),
76+ " Use websocket to exchange sdp and ice candidates" )
7077 (" v4l2_format" , bpo::value<std::string>()->default_value (args.v4l2_format ),
7178 " Set v4l2 camera capture format to `i420`, `mjpeg`, `h264`. The `h264` can pass "
7279 " packets into mp4 without encoding to reduce cpu usage."
@@ -106,13 +113,17 @@ void Parser::ParseArgs(int argc, char *argv[], Args &args) {
106113 SetIfExists (vm, " mqtt_username" , args.mqtt_username );
107114 SetIfExists (vm, " mqtt_password" , args.mqtt_password );
108115 SetIfExists (vm, " http_port" , args.http_port );
116+ SetIfExists (vm, " ws_host" , args.ws_host );
117+ SetIfExists (vm, " ws_port" , args.ws_port );
118+ SetIfExists (vm, " ws_token" , args.ws_token );
109119 SetIfExists (vm, " record_path" , args.record_path );
110120
111121 args.fixed_resolution = vm[" fixed_resolution" ].as <bool >();
112122 args.no_audio = vm[" no_audio" ].as <bool >();
113123 args.hw_accel = vm[" hw_accel" ].as <bool >();
114124 args.use_mqtt = vm[" use_mqtt" ].as <bool >();
115125 args.use_whep = vm[" use_whep" ].as <bool >();
126+ args.use_websocket = vm[" use_websocket" ].as <bool >();
116127
117128 if (!args.stun_url .empty () && args.stun_url .substr (0 , 4 ) != " stun" ) {
118129 std::cout << " Stun url should not be empty and start with \" stun:\" " << std::endl;
0 commit comments