(options: ServiceLaunchOptions)
| 1301 | } |
| 1302 | |
| 1303 | fn ensure_launch_agent_service(options: ServiceLaunchOptions) -> anyhow::Result<ServiceMetadata> { |
| 1304 | if let Some(metadata) = read_service_metadata().ok().flatten() { |
| 1305 | if service_is_healthy(&metadata) { |
| 1306 | let _ = terminate_service_metadata(&metadata); |
| 1307 | } |
| 1308 | } |
| 1309 | let result = service::pair(ServiceOptions { |
| 1310 | port: options.port, |
| 1311 | bind: options.bind, |
| 1312 | advertise_host: options.advertise_host.clone(), |
| 1313 | client_root: options.client_root.clone(), |
| 1314 | video_codec: options.video_codec, |
| 1315 | android_gpu: options.android_gpu, |
| 1316 | low_latency: options.low_latency, |
| 1317 | stream_quality_profile: options.stream_quality_profile.clone(), |
| 1318 | local_stream_fps: options.local_stream_fps, |
| 1319 | access_token: None, |
| 1320 | pairing_code: None, |
| 1321 | })?; |
| 1322 | let metadata = metadata_from_launch_agent(result)?; |
| 1323 | wait_for_service(&metadata, Duration::from_secs(15))?; |
| 1324 | Ok(metadata) |
| 1325 | } |
| 1326 | |
| 1327 | fn start_project_service(options: ServiceLaunchOptions) -> anyhow::Result<ServiceMetadata> { |
| 1328 | let project_root = project_root()?; |
no test coverage detected