Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -81,3 +81,4 @@ Hashir Shoaib <hashirshoaeb@gmail.com>
Ricardo Dalarme <ricardodalarme@outlook.com>
Andrei Kabylin <sys.int64@gmail.com>
Ernesto Ramirez <neartox@outlook.com>
Rui Craveiro <ruicraveiro@squarealfa.com>
1 change: 1 addition & 0 deletions packages/camera/camera_android_camerax/AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@
# Name/Organization <email address>

Google Inc.
Rui Craveiro <ruicraveiro@squarealfa.com>
67 changes: 46 additions & 21 deletions packages/camera/camera_android_camerax/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.7.0

* Adds video stabilization.

## 0.6.30

* Bump camerax_version from 1.5.2 to 1.5.3.
Expand Down Expand Up @@ -52,7 +56,8 @@

## 0.6.24+1

* Fixes crash in `DeviceOrientationManager` caused by `UnsupportedOperationException` when `getDisplay()` is called on a null or destroyed Activity during rotation.
* Fixes crash in `DeviceOrientationManager` caused by `UnsupportedOperationException` when
`getDisplay()` is called on a null or destroyed Activity during rotation.

## 0.6.24

Expand All @@ -72,7 +77,8 @@

## 0.6.23+2

* Updates Java compatibility version to 17 and minimum supported SDK version to Flutter 3.35/Dart 3.9.
* Updates Java compatibility version to 17 and minimum supported SDK version to Flutter 3.35/Dart
3.9.

## 0.6.23+1

Expand All @@ -81,7 +87,8 @@
## 0.6.23

* Converts NV21-compatible streamed images to NV21 when requested. In doing so,
this plugin should now be compatible with [google_ml_kit_flutter](https://github.com/flutter-ml/google_ml_kit_flutter/tree/master).
this plugin should now be compatible
with [google_ml_kit_flutter](https://github.com/flutter-ml/google_ml_kit_flutter/tree/master).

## 0.6.22

Expand Down Expand Up @@ -258,8 +265,10 @@ this plugin should now be compatible with [google_ml_kit_flutter](https://github

## 0.6.6

* Adds logic to support building a camera preview with Android `Surface`s not backed by a `SurfaceTexture`
to which CameraX cannot not automatically apply the transformation required to achieve the correct rotation.
* Adds logic to support building a camera preview with Android `Surface`s not backed by a
`SurfaceTexture`
to which CameraX cannot not automatically apply the transformation required to achieve the correct
rotation.
* Adds fix for incorrect camera preview rotation on naturally landscape-oriented devices.
* Updates example app's minimum supported SDK version to Flutter 3.22/Dart 3.4.

Expand Down Expand Up @@ -290,7 +299,8 @@ this plugin should now be compatible with [google_ml_kit_flutter](https://github

## 0.6.5+1

* Updates `README.md` to reflect the fact that the `camera_android_camerax` camera plugin implementation
* Updates `README.md` to reflect the fact that the `camera_android_camerax` camera plugin
implementation
is the endorsed Android implementation for `camera: ^0.11.0`.

## 0.6.5
Expand All @@ -299,22 +309,28 @@ this plugin should now be compatible with [google_ml_kit_flutter](https://github
recorded video finishes saving to a file.
* Modifies `startVideoCapturing` to ensure that the method only returns when CameraX reports that
video recording has started.
* Adds empty implementation for `setDescriptionWhileRecording` and leaves a todo to add this feature.
* Adds empty implementation for `setDescriptionWhileRecording` and leaves a todo to add this
feature.

## 0.6.4+1

* Adds empty implementation for `prepareForVideoRecording` since this optimization is not used on Android.
* Adds empty implementation for `prepareForVideoRecording` since this optimization is not used on
Android.

## 0.6.4

* Prevents usage of unsupported concurrent `UseCase`s based on the capabiliites of the camera device.
* Prevents usage of unsupported concurrent `UseCase`s based on the capabiliites of the camera
device.

## 0.6.3

* Shortens default interval that internal Java `InstanceManager` uses to release garbage collected weak references to
* Shortens default interval that internal Java `InstanceManager` uses to release garbage collected
weak references to
native objects.
* Dynamically shortens interval that internal Java `InstanceManager` uses to release garbage collected weak references to
native objects when an `ImageAnalysis.Analyzer` is set/removed to account for increased memory usage of analyzing
* Dynamically shortens interval that internal Java `InstanceManager` uses to release garbage
collected weak references to
native objects when an `ImageAnalysis.Analyzer` is set/removed to account for increased memory
usage of analyzing
images that may cause a crash.

## 0.6.2
Expand All @@ -327,7 +343,8 @@ this plugin should now be compatible with [google_ml_kit_flutter](https://github

## 0.6.1

* Modifies resolution selection logic to use an `AspectRatioStrategy` for all aspect ratios supported by CameraX.
* Modifies resolution selection logic to use an `AspectRatioStrategy` for all aspect ratios
supported by CameraX.
* Adds `ResolutionFilter` to resolution selection logic to prioritize resolutions that match
the defined `ResolutionPreset`s.

Expand All @@ -346,7 +363,8 @@ this plugin should now be compatible with [google_ml_kit_flutter](https://github

## 0.5.0+35

* Modifies `CameraInitializedEvent` that is sent when the camera is initialized to indicate that the initial focus
* Modifies `CameraInitializedEvent` that is sent when the camera is initialized to indicate that the
initial focus
and exposure modes are auto and that developers may set focus and exposure points.

## 0.5.0+34
Expand All @@ -365,15 +383,18 @@ this plugin should now be compatible with [google_ml_kit_flutter](https://github

## 0.5.0+31

* Wraps CameraX classes needed to set capture request options, which is needed to implement setting the exposure mode.
* Wraps CameraX classes needed to set capture request options, which is needed to implement setting
the exposure mode.

## 0.5.0+30

* Adds documentation to clarify how the plugin uses resolution presets as target resolutions for CameraX.
* Adds documentation to clarify how the plugin uses resolution presets as target resolutions for
CameraX.

## 0.5.0+29

* Modifies `buildPreview` to return `Texture` that maps to camera preview, building in the assumption
* Modifies `buildPreview` to return `Texture` that maps to camera preview, building in the
assumption
that `createCamera` should have been called before building the preview. Fixes
https://github.com/flutter/flutter/issues/140567.

Expand Down Expand Up @@ -410,7 +431,8 @@ this plugin should now be compatible with [google_ml_kit_flutter](https://github

## 0.5.0+21

* Changes fallback resolution strategies for camera use cases to look for a higher resolution if neither the desired
* Changes fallback resolution strategies for camera use cases to look for a higher resolution if
neither the desired
resolution nor any lower resolutions are available.

## 0.5.0+20
Expand All @@ -436,7 +458,8 @@ this plugin should now be compatible with [google_ml_kit_flutter](https://github

## 0.5.0+15

* Explicitly removes `READ_EXTERNAL_STORAGE` permission that may otherwise be implied from `WRITE_EXTERNAL_STORAGE`.
* Explicitly removes `READ_EXTERNAL_STORAGE` permission that may otherwise be implied from
`WRITE_EXTERNAL_STORAGE`.

## 0.5.0+14

Expand All @@ -448,13 +471,15 @@ this plugin should now be compatible with [google_ml_kit_flutter](https://github

## 0.5.0+12

* Wraps classes needed to implement resolution configuration for image capture, image analysis, and preview.
* Wraps classes needed to implement resolution configuration for image capture, image analysis, and
preview.
* Removes usages of deprecated APIs for resolution configuration.
* Bumps CameraX version to 1.3.0-beta01.

## 0.5.0+11

* Fixes issue with image data not being emitted after relistening to stream returned by `onStreamedFrameAvailable`.
* Fixes issue with image data not being emitted after relistening to stream returned by
`onStreamedFrameAvailable`.

## 0.5.0+10

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,10 @@ public CameraCharacteristics.Key<?> infoSupportedHardwareLevel() {
public CameraCharacteristics.Key<?> sensorOrientation() {
return CameraCharacteristics.SENSOR_ORIENTATION;
}

@NonNull
@Override
public CameraCharacteristics.Key<?> controlAvailableVideoStabilizationModes() {
return CameraCharacteristics.CONTROL_AVAILABLE_VIDEO_STABILIZATION_MODES;
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright 2013 The Flutter Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Autogenerated from Pigeon (v26.1.5), do not edit directly.
// Autogenerated from Pigeon (v26.1.7), do not edit directly.
// See also: https://pub.dev/packages/pigeon
@file:Suppress("UNCHECKED_CAST", "ArrayInDataClass")

Expand Down Expand Up @@ -2181,7 +2181,7 @@ abstract class PigeonApiCameraInfo(
*/
abstract fun sensorRotationDegrees(pigeon_instance: androidx.camera.core.CameraInfo): Long

/** Returns the lens facing of this camera. */
/** Returns the lens direction of this camera. */
abstract fun lensFacing(pigeon_instance: androidx.camera.core.CameraInfo): LensFacing

/** Returns a ExposureState. */
Expand Down Expand Up @@ -6728,6 +6728,15 @@ abstract class PigeonApiCaptureRequest(
*/
abstract fun controlAELock(): android.hardware.camera2.CaptureRequest.Key<*>

/**
* Whether video stabilization is active.
*
* Value is int.
*
* This key is available on all devices.
*/
abstract fun controlVideoStabilizationMode(): android.hardware.camera2.CaptureRequest.Key<*>

companion object {
@Suppress("LocalVariableName")
fun setUpMessageHandlers(binaryMessenger: BinaryMessenger, api: PigeonApiCaptureRequest?) {
Expand Down Expand Up @@ -6756,6 +6765,30 @@ abstract class PigeonApiCaptureRequest(
channel.setMessageHandler(null)
}
}
run {
val channel =
BasicMessageChannel<Any?>(
binaryMessenger,
"dev.flutter.pigeon.camera_android_camerax.CaptureRequest.controlVideoStabilizationMode",
codec)
if (api != null) {
channel.setMessageHandler { message, reply ->
val args = message as List<Any?>
val pigeon_identifierArg = args[0] as Long
val wrapped: List<Any?> =
try {
api.pigeonRegistrar.instanceManager.addDartCreatedInstance(
api.controlVideoStabilizationMode(), pigeon_identifierArg)
listOf(null)
} catch (exception: Throwable) {
CameraXLibraryPigeonUtils.wrapError(exception)
}
reply.reply(wrapped)
}
} else {
channel.setMessageHandler(null)
}
}
}
}

Expand Down Expand Up @@ -7226,6 +7259,17 @@ abstract class PigeonApiCameraCharacteristics(
*/
abstract fun sensorOrientation(): android.hardware.camera2.CameraCharacteristics.Key<*>

/**
* List of video stabilization modes for android.control.videoStabilizationMode that are supported
* by this camera device.
*
* Value is `ControlAvailableVideoStabilizationMode`.
*
* This key is available on all devices.
*/
abstract fun controlAvailableVideoStabilizationModes():
android.hardware.camera2.CameraCharacteristics.Key<*>

companion object {
@Suppress("LocalVariableName")
fun setUpMessageHandlers(
Expand Down Expand Up @@ -7281,6 +7325,30 @@ abstract class PigeonApiCameraCharacteristics(
channel.setMessageHandler(null)
}
}
run {
val channel =
BasicMessageChannel<Any?>(
binaryMessenger,
"dev.flutter.pigeon.camera_android_camerax.CameraCharacteristics.controlAvailableVideoStabilizationModes",
codec)
if (api != null) {
channel.setMessageHandler { message, reply ->
val args = message as List<Any?>
val pigeon_identifierArg = args[0] as Long
val wrapped: List<Any?> =
try {
api.pigeonRegistrar.instanceManager.addDartCreatedInstance(
api.controlAvailableVideoStabilizationModes(), pigeon_identifierArg)
listOf(null)
} catch (exception: Throwable) {
CameraXLibraryPigeonUtils.wrapError(exception)
}
reply.reply(wrapped)
}
} else {
channel.setMessageHandler(null)
}
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,15 @@ public CaptureRequestOptions pigeon_defaultConstructor(
continue;
}

builder.setCaptureRequestOption(
(CaptureRequest.Key<Object>) option.getKey(), option.getValue());
// Because Pigeon isn't down-casting from Dart num to Java Int,
// it needs to be done below.
var key = option.getKey();
var value = option.getValue();
if (CaptureRequest.CONTROL_VIDEO_STABILIZATION_MODE == key) {
value = ((Long) value).intValue();
}

builder.setCaptureRequestOption((CaptureRequest.Key<Object>) key, value);
}

return builder.build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,10 @@ class CaptureRequestProxyApi extends PigeonApiCaptureRequest {
public CaptureRequest.Key<?> controlAELock() {
return CaptureRequest.CONTROL_AE_LOCK;
}

@NonNull
@Override
public CaptureRequest.Key<?> controlVideoStabilizationMode() {
return CaptureRequest.CONTROL_VIDEO_STABILIZATION_MODE;
}
}
Loading