@@ -134,25 +134,7 @@ def run(self):
134134 self .progress .emit ("Probing device defaults…" )
135135 if self ._cancel :
136136 return
137- be = CameraFactory .create (self ._cam )
138- be .open ()
139-
140- actual_res = getattr (be , "actual_resolution" , None )
141- actual_fps = getattr (be , "actual_fps" , None )
142-
143- try :
144- be .close ()
145- except Exception :
146- pass
147-
148- if self ._cancel :
149- return
150-
151- self .success .emit ({
152- "cam" : self ._cam ,
153- "actual_resolution" : actual_res ,
154- "actual_fps" : actual_fps ,
155- })
137+ self .success .emit (self ._cam )
156138 except Exception as exc :
157139 self .error .emit (f"{ type (exc ).__name__ } : { exc } " )
158140 finally :
@@ -1239,20 +1221,27 @@ def _reset_selected_camera(self, *, clear_backend_cache: bool = False) -> None:
12391221 self .apply_settings_btn .setEnabled (True )
12401222
12411223 def _on_probe_success (self , payload ) -> None :
1242- """Apply probe results to working model and refresh UI .
1224+ """Open/close quickly to read actual_resolution/actual_fps and store as detected_* .
12431225
12441226 If self._probe_apply_to_requested is True, also overwrite requested width/height/fps
12451227 for the targeted camera row (Reset behavior).
12461228 """
1247- if not isinstance (payload , dict ):
1248- return
1249- cam_settings = payload .get ("cam" )
1250- if not isinstance (cam_settings , CameraSettings ):
1229+ if not isinstance (payload , CameraSettings ):
12511230 return
1252- actual_res = payload .get ("actual_resolution" )
1253- actual_fps = payload .get ("actual_fps" )
1231+ cam_settings = payload
12541232
12551233 try :
1234+ be = CameraFactory .create (cam_settings )
1235+ be .open ()
1236+
1237+ actual_res = getattr (be , "actual_resolution" , None )
1238+ actual_fps = getattr (be , "actual_fps" , None )
1239+
1240+ try :
1241+ be .close ()
1242+ except Exception :
1243+ pass
1244+
12561245 backend = (cam_settings .backend or "" ).lower ()
12571246
12581247 for i , c in enumerate (self ._working_settings .cameras ):
0 commit comments