(State(state): State<AppState>)
| 959 | } |
| 960 | |
| 961 | async fn health(State(state): State<AppState>) -> Json<Value> { |
| 962 | let video_codec = active_video_codec(&state.config); |
| 963 | let stream_quality = |
| 964 | stream_quality_state_value(¤t_stream_quality_state(video_codec.clone())); |
| 965 | json(json_value!({ |
| 966 | "ok": true, |
| 967 | "serverId": crate::auth::server_identity(&state.config), |
| 968 | "advertiseHost": state.config.advertise_host, |
| 969 | "hostId": state.config.host_id, |
| 970 | "hostName": state.config.host_name, |
| 971 | "httpPort": state.config.http_port, |
| 972 | "serverKind": state.config.server_kind.as_str(), |
| 973 | "timestamp": SystemTime::now().duration_since(UNIX_EPOCH).unwrap_or(Duration::ZERO).as_secs_f64(), |
| 974 | "videoCodec": video_codec, |
| 975 | "androidGpu": active_android_gpu(), |
| 976 | "lowLatency": state.config.low_latency, |
| 977 | "realtimeStream": crate::transport::webrtc::realtime_stream_enabled(), |
| 978 | "localStreamFps": env_u32("SIMDECK_LOCAL_STREAM_FPS", 60, 15, 240), |
| 979 | "streamQuality": stream_quality, |
| 980 | "webRtc": { |
| 981 | "iceServers": crate::transport::webrtc::client_ice_servers(), |
| 982 | "iceTransportPolicy": crate::transport::webrtc::ice_transport_policy_label() |
| 983 | } |
| 984 | })) |
| 985 | } |
| 986 | |
| 987 | fn active_video_codec(config: &Config) -> String { |
| 988 | std::env::var("SIMDECK_VIDEO_CODEC") |
nothing calls this directly
no test coverage detected