@@ -281,6 +281,34 @@ abstract class CameraPlatform extends PlatformInterface {
281281 throw UnimplementedError ('setZoomLevel() is not implemented.' );
282282 }
283283
284+ /// Gets a list of video stabilization modes that are supported for the selected camera.
285+ Future <Iterable <VideoStabilizationMode >> getSupportedVideoStabilizationModes (
286+ int cameraId,
287+ ) => Future <List <VideoStabilizationMode >>.value (< VideoStabilizationMode > []);
288+
289+ /// Sets the video stabilization mode for the selected camera.
290+ Future <void > setVideoStabilizationMode (
291+ int cameraId,
292+ VideoStabilizationMode mode,
293+ ) {
294+ throw UnimplementedError ('setVideoStabilizationMode() is not implemented.' );
295+ }
296+
297+ /// Gets the fallback mode of video stabilization [mode] .
298+ ///
299+ /// This method returns the video stabilization mode that [setVideoStabilizationMode]
300+ /// should set when the device does not support the given [mode] .
301+ static VideoStabilizationMode ? getFallbackVideoStabilizationMode (
302+ VideoStabilizationMode mode,
303+ ) {
304+ return switch (mode) {
305+ VideoStabilizationMode .off => null ,
306+ VideoStabilizationMode .level1 => VideoStabilizationMode .off,
307+ VideoStabilizationMode .level2 => VideoStabilizationMode .level1,
308+ VideoStabilizationMode .level3 => VideoStabilizationMode .level2,
309+ };
310+ }
311+
284312 /// Pause the active preview on the current frame for the selected camera.
285313 Future <void > pausePreview (int cameraId) {
286314 throw UnimplementedError ('pausePreview() is not implemented.' );
0 commit comments