MCPcopy Create free account
hub / github.com/NativeScript/SimDeck / screen_recording_mp4

Method screen_recording_mp4

packages/server/src/native/bridge.rs:520–539  ·  view source on GitHub ↗
(
        &self,
        udid: &str,
        duration_seconds: f64,
    )

Source from the content-addressed store, hash-verified

518 }
519
520 pub fn screen_recording_mp4(
521 &self,
522 udid: &str,
523 duration_seconds: f64,
524 ) -> Result<Vec<u8>, AppError> {
525 let udid = CString::new(udid).map_err(|e| AppError::bad_request(e.to_string()))?;
526 unsafe {
527 let mut error = ptr::null_mut();
528 let bytes =
529 ffi::xcw_native_screen_recording_mp4(udid.as_ptr(), duration_seconds, &mut error);
530 if bytes.data.is_null() {
531 return Err(
532 take_error(error).unwrap_or_else(|| AppError::native("Unknown native error."))
533 );
534 }
535 let data = std::slice::from_raw_parts(bytes.data, bytes.length).to_vec();
536 ffi::xcw_native_free_bytes(bytes);
537 Ok(data)
538 }
539 }
540
541 pub fn start_screen_recording(&self, udid: &str) -> Result<String, AppError> {
542 let udid = CString::new(udid).map_err(|e| AppError::bad_request(e.to_string()))?;

Callers 1

screen_recordingFunction · 0.80

Calls 3

take_errorFunction · 0.85
xcw_native_free_bytesFunction · 0.85

Tested by

no test coverage detected