stopCapture method
Stop camera capture.
Implementation
@override
Future<void> stopCapture() async {
// Don't throw if context is destroyed - just clean up Dart resources
if (_isDestroyed || _context == null) {
await _cleanupCallback();
return;
}
// Don't throw if already stopped - this is idempotent
if (_callbackHandle == null) {
return; // Already stopped
}
final result = bindings.MiniAV_Camera_StopCapture(_context!);
await _cleanupCallback();
// Only warn on unexpected errors, not "already stopped" errors
if (result != bindings.MiniAVResultCode.MINIAV_SUCCESS &&
result != bindings.MiniAVResultCode.MINIAV_ERROR_NOT_RUNNING) {
print('Warning: MiniAV_Camera_StopCapture failed: ${result.name}');
}
}