Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.

Commit b1cd904

Browse files
committed
[camera] Android: Improve image streaming by creating a request suitable for video recording instead of still image capture.
1 parent a5b7ba8 commit b1cd904

3 files changed

Lines changed: 6 additions & 2 deletions

File tree

packages/camera/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 0.5.6+3
2+
3+
* Android: Use CameraDevice.TEMPLATE_RECORD to improve image streaming.
4+
15
## 0.5.6+2
26

37
* Include lifecycle dependency as a compileOnly one on Android to resolve

packages/camera/android/src/main/java/io/flutter/plugins/camera/Camera.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,7 @@ public void startPreview() throws CameraAccessException {
426426

427427
public void startPreviewWithImageStream(EventChannel imageStreamChannel)
428428
throws CameraAccessException {
429-
createCaptureSession(CameraDevice.TEMPLATE_STILL_CAPTURE, imageStreamReader.getSurface());
429+
createCaptureSession(CameraDevice.TEMPLATE_RECORD, imageStreamReader.getSurface());
430430

431431
imageStreamChannel.setStreamHandler(
432432
new EventChannel.StreamHandler() {

packages/camera/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: camera
22
description: A Flutter plugin for getting information about and controlling the
33
camera on Android and iOS. Supports previewing the camera feed, capturing images, capturing video,
44
and streaming image buffers to dart.
5-
version: 0.5.6+2
5+
version: 0.5.6+3
66

77
authors:
88
- Flutter Team <flutter-dev@googlegroups.com>

0 commit comments

Comments
 (0)