File tree Expand file tree Collapse file tree 3 files changed +2
-14
lines changed
Expand file tree Collapse file tree 3 files changed +2
-14
lines changed Original file line number Diff line number Diff line change @@ -106,12 +106,7 @@ public partial void UpdateZoom(float zoomLevel)
106106
107107 public partial ValueTask UpdateCaptureResolution ( Size resolution , CancellationToken token )
108108 {
109- if ( cameraView . SelectedCamera is null )
110- {
111- throw new CameraException ( $ "Unable to update Capture Resolution because { nameof ( ICameraView ) } .{ nameof ( ICameraView . SelectedCamera ) } is null.") ;
112- }
113-
114- if ( captureDevice is null )
109+ if ( cameraView . SelectedCamera is null || captureDevice is null )
115110 {
116111 return ValueTask . CompletedTask ;
117112 }
Original file line number Diff line number Diff line change @@ -157,16 +157,11 @@ private partial void PlatformStopCameraPreview()
157157
158158 async Task PlatformUpdateResolution ( Size resolution , CancellationToken token )
159159 {
160- if ( ! IsInitialized || mediaCapture is null )
160+ if ( cameraView . SelectedCamera is null || ! IsInitialized || mediaCapture is null )
161161 {
162162 return ;
163163 }
164164
165- if ( cameraView . SelectedCamera is null )
166- {
167- throw new CameraException ( $ "Unable to update Capture Resolution because { nameof ( ICameraView ) } .{ nameof ( ICameraView . SelectedCamera ) } is null.") ;
168- }
169-
170165 var filteredPropertiesList = cameraView . SelectedCamera . ImageEncodingProperties . Where ( p => p . Width <= resolution . Width && p . Height <= resolution . Height ) . ToList ( ) ;
171166
172167 if ( filteredPropertiesList . Count is 0 )
Original file line number Diff line number Diff line change @@ -107,8 +107,6 @@ protected virtual void Dispose(bool disposing)
107107 {
108108 cameraManager ? . Dispose ( ) ;
109109 cameraManager = null ;
110-
111- cameraProvider . Dispose ( ) ;
112110 }
113111 }
114112
You can’t perform that action at this time.
0 commit comments