Repository: flutter
Issue: CameraPreview becomes sluggish and drops frames when startImageStream is set on Pixel 3
Labels: c: performance,p: camera,package,team-ecosystem,P2,triaged-ecosystem

# Issue
When startImageStream is set, not only does CameraPreview appear to become sluggish, i encounter dropped frames on my Pixel 3 running API 28. This occurs even if ResolutionPreset.low is used, and if the function fed to startImageStream is an empty one. The black-out occurences appear to be random, and get worse as i switch to medium and then to high resolution. Note that the sluggishness also occurs on my XiaoMi A1 running API 27, but the frames are not getting dropped. GIF of the issue on my Pixel 3:

![issue](https://user-images.githubusercontent.com/17830688/52489297-dc57b800-2bfc-11e9-82e5-8958f0721944.gif)

# Steps to reproduce
To reproduce the issue, we can add the required lines to the simple example provided in the camera plugin's readme section:

```dart
import 'dart:async';
import 'package:flutter/material.dart';
import 'package:camera/camera.dart';

List<CameraDescription> cameras;

Future<void> main() async {
  cameras = await availableCameras();
  runApp(CameraApp());
}

class CameraApp extends StatefulWidget {
  @override
  _CameraAppState createState() => _CameraAppState();
}

class _CameraAppState extends State<CameraApp> {
  CameraController controller;

  @override
  void initState() {
    super.initState();
    controller = CameraController(cameras[0], ResolutionPreset.low);
    controller.initialize().then((_) {
      if (!mounted) {
        return;
      }
      controller.startImageStream(streamStuffHere);
      setState(() {});
    });
  }

  void streamStuffHere(CameraImage img) { }

  @override
  void dispose() {
    controller?.dispose();
    super.dispose();
  }

  @override
  Widget build(BuildContext context) {
    if (!controller.value.isInitialized) {
      return Container();
    }
    return AspectRatio(
        aspectRatio:
        controller.value.aspectRatio,
        child: CameraPreview(controller));
  }
}
```
# Flutter Doctor
```
[✓] Flutter (Channel stable, v1.0.0, on Linux, locale en_SG.UTF-8)
    • Flutter version 1.0.0 at /home/bl2ead/Desktop/software/flutter
    • Framework revision 5391447fae (2 months ago), 2018-11-29 19:41:26 -0800
    • Engine revision 7375a0f414
    • Dart version 2.1.0 (build 2.1.0-dev.9.4 f9ebf21297)

[✓] Android toolchain - develop for Android devices (Android SDK 28.0.3)
    • Android SDK at /home/bl2ead/Android/Sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-28, build-tools 28.0.3
    • Java binary at: /home/bl2ead/.local/share/JetBrains/Toolbox/apps/AndroidStudio/ch-0/182.5199772/jre/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1248-b01)
    • All Android licenses accepted.

[✓] Android Studio (version 3.3)
    • Android Studio at /home/bl2ead/.local/share/JetBrains/Toolbox/apps/AndroidStudio/ch-0/182.5199772
    • Flutter plugin version 32.0.1
    • Dart plugin version 182.5215
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1248-b01)

[✓] IntelliJ IDEA Ultimate Edition (version 2018.2)
    • IntelliJ at /home/bl2ead/.local/share/JetBrains/Toolbox/apps/IDEA-U/ch-0/182.4892.20
    • Flutter plugin version 31.3.3
    • Dart plugin version 182.5124

[✓] Connected device (1 available)
    • Pixel 3 • 8AHX0TE7U • android-arm64 • Android 9 (API 28)

• No issues found!

```