(
udid: &str,
source: &CameraSource,
mirror: Option<&str>,
)
| 185 | } |
| 186 | |
| 187 | fn native_switch_camera( |
| 188 | udid: &str, |
| 189 | source: &CameraSource, |
| 190 | mirror: Option<&str>, |
| 191 | ) -> Result<Value, AppError> { |
| 192 | let udid = cstring("simulator UDID", udid)?; |
| 193 | let source_name = cstring("camera source", source.kind.as_native_arg())?; |
| 194 | let source_arg = cstring( |
| 195 | "camera source argument", |
| 196 | source.arg.as_deref().unwrap_or(""), |
| 197 | )?; |
| 198 | let mirror = cstring("camera mirror", mirror.unwrap_or(""))?; |
| 199 | let mut error_message = std::ptr::null_mut(); |
| 200 | let raw = unsafe { |
| 201 | ffi::simdeck_camera_switch( |
| 202 | udid.as_ptr(), |
| 203 | source_name.as_ptr(), |
| 204 | source_arg.as_ptr(), |
| 205 | mirror.as_ptr(), |
| 206 | &mut error_message, |
| 207 | ) |
| 208 | }; |
| 209 | native_json(raw, error_message, "Unable to switch camera source.") |
| 210 | } |
| 211 | |
| 212 | fn native_stop_camera(udid: &str) -> Result<(), AppError> { |
| 213 | let udid = cstring("simulator UDID", udid)?; |
no test coverage detected