@@ -329,8 +329,6 @@ impl cosmic::Application for AppModel {
329329 privacy_cover_closed : false ,
330330 // Kinect state (device, motor, calibration, native backend)
331331 kinect : crate :: app:: state:: KinectState :: default ( ) ,
332- // Motor/PTZ controls
333- motor_picker_visible : false ,
334332 // Depth visualization settings
335333 depth_viz : crate :: app:: state:: DepthVisualizationState :: default ( ) ,
336334 // 3D preview state (rotation, zoom, rendering)
@@ -653,7 +651,9 @@ impl cosmic::Application for AppModel {
653651 // Create camera pipeline using PipeWire backend
654652 // For Y10B depth formats, use V4L2 direct capture with GPU unpacking
655653 use crate :: backends:: camera:: pipewire:: PipeWirePipeline ;
656- use crate :: backends:: camera:: types:: { CameraDevice , CameraFormat , SensorType } ;
654+ use crate :: backends:: camera:: types:: {
655+ CameraDevice , CameraFormat , SensorType ,
656+ } ;
657657 #[ cfg( all( target_arch = "x86_64" , feature = "freedepth" ) ) ]
658658 use crate :: backends:: camera:: types:: { CameraFrame , PixelFormat } ;
659659
@@ -697,8 +697,8 @@ impl cosmic::Application for AppModel {
697697 #[ cfg( all( target_arch = "x86_64" , feature = "freedepth" ) ) ]
698698 use crate :: backends:: camera:: v4l2_depth:: V4l2DepthPipeline ;
699699 use crate :: backends:: camera:: {
700- NativeDepthBackend , is_depth_native_device,
701- V4l2KernelDepthBackend , is_kernel_depth_device,
700+ NativeDepthBackend , V4l2KernelDepthBackend , is_depth_native_device,
701+ is_kernel_depth_device,
702702 } ;
703703
704704 // Enum to hold active pipeline - fields are used for ownership semantics
@@ -715,7 +715,8 @@ impl cosmic::Application for AppModel {
715715 // Check if this is a kernel depth device first (highest priority)
716716 let is_kernel_depth = is_kernel_depth_device ( & device. path ) ;
717717 // Then check for freedepth device (only when kernel driver not present)
718- let is_depth_cam = !is_kernel_depth && is_depth_native_device ( & device. path ) ;
718+ let is_depth_cam =
719+ !is_kernel_depth && is_depth_native_device ( & device. path ) ;
719720 if is_kernel_depth {
720721 info ! ( device = %device. name, path = %device. path, "Using V4L2 kernel depth backend" ) ;
721722 } else if is_depth_cam {
@@ -764,7 +765,8 @@ impl cosmic::Application for AppModel {
764765 if is_depth_format {
765766 info ! ( "Creating V4L2 depth pipeline for Y10B format" ) ;
766767 use crate :: shaders:: depth:: {
767- is_depth_colormap_enabled, is_depth_only_mode, unpack_y10b_gpu,
768+ is_depth_colormap_enabled, is_depth_only_mode,
769+ unpack_y10b_gpu,
768770 } ;
769771
770772 // Create depth frame channel
@@ -813,10 +815,15 @@ impl cosmic::Application for AppModel {
813815 ) ,
814816 format : PixelFormat :: Depth16 ,
815817 stride : result. width * 4 ,
816- captured_at : depth_frame. captured_at ,
817- depth_data : Some ( std:: sync:: Arc :: from (
818- result. depth_u16 . into_boxed_slice ( ) ,
819- ) ) ,
818+ captured_at : depth_frame
819+ . captured_at ,
820+ depth_data : Some (
821+ std:: sync:: Arc :: from (
822+ result
823+ . depth_u16
824+ . into_boxed_slice ( ) ,
825+ ) ,
826+ ) ,
820827 depth_width : result. width ,
821828 depth_height : result. height ,
822829 video_timestamp : None ,
@@ -885,18 +892,21 @@ impl cosmic::Application for AppModel {
885892
886893 // For kernel depth devices, poll frames directly via V4L2
887894 if let ActivePipeline :: KernelDepth ( ref kernel_backend) = pipeline {
888-
889895 info ! ( "Starting kernel depth frame polling loop" ) ;
890896 loop {
891897 // Check cancel flag
892898 if cancel_flag. load ( std:: sync:: atomic:: Ordering :: Acquire ) {
893- info ! ( "Cancel flag set - kernel depth subscription being cancelled" ) ;
899+ info ! (
900+ "Cancel flag set - kernel depth subscription being cancelled"
901+ ) ;
894902 break ;
895903 }
896904
897905 // Check if output is closed
898906 if output. is_closed ( ) {
899- info ! ( "Output channel closed - kernel depth subscription being cancelled" ) ;
907+ info ! (
908+ "Output channel closed - kernel depth subscription being cancelled"
909+ ) ;
900910 break ;
901911 }
902912
@@ -914,11 +924,13 @@ impl cosmic::Application for AppModel {
914924 }
915925
916926 // Send frame to UI
917- let _ = output. try_send ( Message :: CameraFrame ( Arc :: new ( frame) ) ) ;
927+ let _ = output
928+ . try_send ( Message :: CameraFrame ( Arc :: new ( frame) ) ) ;
918929 }
919930
920931 // Small sleep to avoid busy-waiting (~30fps)
921- tokio:: time:: sleep ( tokio:: time:: Duration :: from_millis ( 16 ) ) . await ;
932+ tokio:: time:: sleep ( tokio:: time:: Duration :: from_millis ( 16 ) )
933+ . await ;
922934 }
923935 }
924936
@@ -1145,7 +1157,9 @@ impl cosmic::Application for AppModel {
11451157 }
11461158
11471159 if output. is_closed ( ) {
1148- info ! ( "Output channel closed - subscription being cancelled" ) ;
1160+ info ! (
1161+ "Output channel closed - subscription being cancelled"
1162+ ) ;
11491163 break ;
11501164 }
11511165
@@ -1157,7 +1171,8 @@ impl cosmic::Application for AppModel {
11571171 {
11581172 Ok ( Some ( frame) ) => {
11591173 frame_count += 1 ;
1160- let latency_us = frame. captured_at . elapsed ( ) . as_micros ( ) ;
1174+ let latency_us =
1175+ frame. captured_at . elapsed ( ) . as_micros ( ) ;
11611176
11621177 if frame_count % 30 == 0 {
11631178 info ! (
@@ -1169,10 +1184,15 @@ impl cosmic::Application for AppModel {
11691184 ) ;
11701185 }
11711186
1172- match output. try_send ( Message :: CameraFrame ( Arc :: new ( frame) ) ) {
1187+ match output
1188+ . try_send ( Message :: CameraFrame ( Arc :: new ( frame) ) )
1189+ {
11731190 Ok ( ( ) ) => {
11741191 if frame_count % 30 == 0 {
1175- tracing:: debug!( frame = frame_count, "Frame forwarded to UI" ) ;
1192+ tracing:: debug!(
1193+ frame = frame_count,
1194+ "Frame forwarded to UI"
1195+ ) ;
11761196 }
11771197 }
11781198 Err ( e) => {
0 commit comments