Repository: flutter
Issue: Camera plugin: imageStream has different format after reopening iOS app
Labels: platform-ios,p: camera,package,has reproducible steps,P2,found in release: 2.0,found in release: 2.2,team-ios,triaged-ios

## Steps to Reproduce
Sample app to reproduce the issue:

```
import 'dart:async';
import 'package:flutter/material.dart';
import 'package:camera/camera.dart';

List<CameraDescription> cameras;

Future<void> main() async {
  WidgetsFlutterBinding.ensureInitialized();
  cameras = await availableCameras();
  runApp(CameraApp());
}

class CameraApp extends StatefulWidget {
  @override
  _CameraAppState createState() => _CameraAppState();
}

class _CameraAppState extends State<CameraApp> with WidgetsBindingObserver {
  CameraController controller;

  @override
  void initState() {
    super.initState();
    WidgetsBinding.instance?.addObserver(this);
    onNewCameraSelected();
  }

  Future<void> onNewCameraSelected() async {
    if (controller != null) {
      await controller.dispose();
    }
    controller = CameraController(cameras[0], ResolutionPreset.medium,
        enableAudio: false, imageFormatGroup: ImageFormatGroup.yuv420);
    await controller.initialize();
    await controller.startImageStream((image) async {
      print(
          "format: ${image.format.raw} width: ${image.width} height: ${image.height} planes: ${image.planes.length} plane[0].width: ${image.planes[0].width} plane[0].height: ${image.planes[0].height} plane[0].bytesPerPixel: ${image.planes[0].bytesPerPixel} plane[0].bytesPerRow: ${image.planes[0].bytesPerRow} plane[0].bytes: ${image.planes[0].bytes.length}");
    });
    if (!mounted) {
      return;
    }
    setState(() {});
  }

  @override
  void dispose() {
    controller?.dispose();
    WidgetsBinding.instance?.removeObserver(this);
    super.dispose();
  }

  @override
  void didChangeAppLifecycleState(AppLifecycleState state) {
    final CameraController cameraController = controller;

    // App state changed before we got the chance to initialize.
    if (cameraController == null || !cameraController.value.isInitialized) {
      return;
    }

    if (state == AppLifecycleState.inactive) {
      cameraController.dispose();
    } else if (state == AppLifecycleState.resumed) {
      onNewCameraSelected();
    }
  }

  @override
  Widget build(BuildContext context) {
    if (!controller.value.isInitialized) {
      return Container();
    }
    return MaterialApp(
      home: CameraPreview(controller),
    );
  }
}
```

1. Start the app with camera plugin version 0.8.1 on iOS iPhone 6 12.4.8
2. allow access to camera
3. log shows: `flutter: format: 875704438 width: 480 height: 640 planes: 1 plane[0].width: 480 plane[0].height: 640 plane[0].bytesPerPixel: null plane[0].bytesPerRow: 1920 plane[0].bytes: 1228800`
4. close app or push power button of the iPhone, so app is in background
5. open app again or push power button and unlock iPhone

**Expected results:** <!-- what did you want to see? -->
as nothing has changed I would expect the images from the live stream being in the same format:
like: `flutter: format: 875704438 width: 480 height: 640 planes: 1 plane[0].width: 480 plane[0].height: 640 plane[0].bytesPerPixel: null plane[0].bytesPerRow: 1920 plane[0].bytes: 1228800`
**Actual results:** <!-- what did you see? -->
log shows: `flutter: format: 875704438 width: 480 height: 640 planes: 2 plane[0].width: 480 plane[0].height: 640 plane[0].bytesPerPixel: null plane[0].bytesPerRow: 480 plane[0].bytes: 307200`

<details>
  <summary>Logs</summary>

<!--
      Run your application with `flutter run --verbose` and attach all the
      log output below between the lines with the backticks. If there is an
      exception, please see if the error message includes enough information
      to explain how to solve the issue.
-->

```
will add later if required
```

<!--
     Run `flutter analyze` and attach any output of that command below.
     If there are any analysis errors, try resolving them before filing this issue.
-->

```
flutter analyze
Analyzing flutter_app_camera_test...                                    
No issues found! (ran in 5.7s)
```

<!-- Finally, paste the output of running `flutter doctor -v` here. -->

```
flutter doctor -v
[✓] Flutter (Channel stable, 2.0.4, on macOS 11.2.3 20D91 darwin-x64, locale en-DE)
    • Flutter version 2.0.4 at /Users/iot/sdk-flutter
    • Framework revision b1395592de (2 weeks ago), 2021-04-01 14:25:01 -0700
    • Engine revision 2dce47073a
    • Dart version 2.12.2

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    • Android SDK at /Users/iot/Library/Android/sdk
    • Platform android-30, build-tools 30.0.3
    • ANDROID_HOME = /usr/local/share/android-sdk
    • ANDROID_SDK_ROOT = /usr/local/share/android-sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 12.4, Build version 12D4e
    • CocoaPods version 1.10.1

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 4.1)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)

[✓] IntelliJ IDEA Community Edition (version 2017.2.3)
    • IntelliJ at /Applications/IntelliJ IDEA CE.app
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart

[✓] Connected device (2 available)
    • iPhone von iot(mobile) • ****** • ios            • iOS 12.4.8
    • Chrome (web)                • chrome                                   • web-javascript • Google Chrome
      89.0.4389.128

• No issues found! 
```

</details>