MCPcopy Create free account
hub / github.com/Recordscript/recordscript / preview_screen

Function preview_screen

src-tauri/src/main.rs:111–119  ·  view source on GitHub ↗
(device_name: String)

Source from the content-addressed store, hash-verified

109
110#[tauri::command]
111fn preview_screen(device_name: String) -> String {
112 let screen = recorder::Screen::all().unwrap().into_iter()
113 .find(|screen| screen.name() == &device_name).unwrap();
114
115 let preview = screen.preview().unwrap();
116 let encoded = gst::glib::base64_encode(&preview);
117
118 encoded.to_string()
119}
120
121#[tauri::command]
122async fn start_record(selected_device: State<'_, SelectedDevice>, record_channel: State<'_, RecordChannel>) -> Result<(), ()> {

Callers

nothing calls this directly

Calls 3

previewMethod · 0.80
to_stringMethod · 0.80
nameMethod · 0.45

Tested by

no test coverage detected