Skip to content

[camera] [Android] Stale images are being emitted after restarting an image stream #54837

@topnax

Description

@topnax

Steps to Reproduce

  1. Update the camera plugin example with the following files so you can actually "see" the bug https://gist.github.com/topnax/20e88a9afec8dbf64a8674257c4db837#file-main-dart-L228
  2. Launch the example and select the rear facing camera (might happen for front facing camera as well, but I haven tried this out)
  3. Start an image stream using the new button that I added in the updated file (an IconButton with an image icon). First 5 images from the image stream are saved into local storage of the device, the CameraPreview might be lagging a little bit as some conversion is happening on the UI thread but it has no effect on this issue. After processing 5 images the stream is stopped.
  4. Have a look at the first 5 images received from the stream which are stored in the folder /storage/emulated/0/Android/data/io.flutter.plugins.cameraexample/files/
  5. Point the camera towards a different scene and start another an image stream using the button with the image icon
  6. Have a look at another first 5 images received from the second stream which are stored in the folder /storage/emulated/0/Android/data/io.flutter.plugins.cameraexample/files/. You can see that the first image that was saved is actually from the first stream capturing the previous scene.

Expected results:

After subscribing to the image stream for the second time I expected to see images from the second scene.

Actual results:

Images from the first scene.

Running "flutter pub get" in camera...                              0.4s
Analyzing camera...                                                     
No issues found! (ran in 2.1s)
[✓] Flutter (Channel stable, v1.12.13+hotfix.8, on Linux, locale en_US.UTF-8)
    • Flutter version 1.12.13+hotfix.8 at /home/topnax/Android/flutter
    • Framework revision 0b8abb4724 (9 weeks ago), 2020-02-11 11:44:36 -0800
    • Engine revision e1e6ced81d
    • Dart version 2.7.0

 
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.1)
    • Android SDK at /home/topnax/Android/Sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-29, build-tools 29.0.1
    • Java binary at: /home/topnax/.local/share/JetBrains/Toolbox/apps/AndroidStudio/ch-0/192.6241897/jre/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b4-5784211)
    • All Android licenses accepted.

[✓] Android Studio (version 3.3)
    • Android Studio at /home/topnax/Applications/android-studio
    • Flutter plugin version 33.4.1
    • Dart plugin version 182.5215
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1248-b01)

[✓] Android Studio (version 3.5)
    • Android Studio at /home/topnax/.local/share/JetBrains/Toolbox/apps/AndroidStudio/ch-0/191.6010548
    • Flutter plugin version 39.0.1
    • Dart plugin version 191.8423
    • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)

[✓] Android Studio (version 3.6)
    • Android Studio at /home/topnax/.local/share/JetBrains/Toolbox/apps/AndroidStudio/ch-0/192.6241897
    • Flutter plugin version 39.0.1
    • Dart plugin version 191.8423
    • Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b4-5784211)

[!] IntelliJ IDEA Ultimate Edition (version 2019.2)
    • IntelliJ at /home/topnax/.local/share/JetBrains/Toolbox/apps/IDEA-U/ch-0/192.6603.28
    ✗ Flutter plugin not installed; this adds Flutter specific functionality.
    ✗ Dart plugin not installed; this adds Dart specific functionality.
    • For information about installing plugins, see
      https://flutter.dev/intellij-setup/#installing-the-plugins

[!] VS Code (version 1.37.1)
    • VS Code at /usr/share/code
    ✗ Flutter extension not installed; install from
      https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter

[✓] Connected device (1 available)
    • ONEPLUS A6003 • 89e7d117 • android-arm64 • Android 10 (API 29)

! Doctor found issues in 2 categories.


Metadata

Metadata

Assignees

No one assigned

    Labels

    found in release: 1.21Found to occur in 1.21has reproducible stepsThe issue has been confirmed reproducible and is ready to work onp: cameraThe camera pluginpackageflutter/packages repository. See also p: labels.platform-androidAndroid applications specifically

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions