Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
b915f7d
Locked hacking
camsim99 Feb 20, 2024
0b33c78
This works but may need to swap in/out af points. I will see
camsim99 Feb 21, 2024
03b2095
Merge remote-tracking branch 'upstream/main' into camx_fmode
camsim99 Feb 21, 2024
f1bdb1f
Formatting
camsim99 Feb 21, 2024
bd1f1ba
Undo incorrect test changes
camsim99 Feb 21, 2024
24dd03b
Undo more changes
camsim99 Feb 21, 2024
f73c2fb
Add disableAutoCancel param + leave todos for case handling
camsim99 Feb 21, 2024
d4d1588
Formatting
camsim99 Feb 21, 2024
dd4f6b3
Add case logic
camsim99 Feb 22, 2024
b902c04
Add todo for AWB
camsim99 Feb 22, 2024
81a5170
Merge remote-tracking branch 'upstream/main' into camx_fmode
camsim99 Feb 22, 2024
72d2d5f
Manual testing
camsim99 Feb 26, 2024
32118bc
Self review
camsim99 Feb 26, 2024
da114ab
Start adding tests
camsim99 Feb 27, 2024
2965929
Add more tests
camsim99 Feb 27, 2024
861ae64
Adding more tests
camsim99 Feb 27, 2024
211962d
Merge remote-tracking branch 'upstream/main' into camx_fmode
camsim99 Feb 27, 2024
23d23ed
Finish adding tests
camsim99 Feb 27, 2024
49392ae
Self review 2
camsim99 Feb 27, 2024
faa61c5
Java fixes
camsim99 Feb 27, 2024
d025a79
Nits
camsim99 Feb 27, 2024
f8d1a6d
Add scott warning
camsim99 Feb 27, 2024
d4b4998
Merge remote-tracking branch 'upstream/main' into camx_fmode
camsim99 Feb 27, 2024
7b2fb39
Address part of review + bump version to 0.6.0
camsim99 Mar 6, 2024
7ff3bc6
Use results
camsim99 Mar 8, 2024
81d0453
Add todo fix resetting mode
camsim99 Mar 11, 2024
1ec2045
Final fixes
camsim99 Mar 11, 2024
92123c3
Fix tests
camsim99 Mar 11, 2024
94622d0
Merge remote-tracking branch 'upstream/main' into camx_fmode
camsim99 Mar 11, 2024
b3d72cb
Add additional tests
camsim99 Mar 11, 2024
54e8fd3
Avoid breaking readme
camsim99 Mar 18, 2024
9568190
Update packages/camera/camera_android_camerax/CHANGELOG.md
camsim99 Mar 19, 2024
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
Next Next commit
Locked hacking
  • Loading branch information
camsim99 committed Feb 20, 2024
commit b915f7def1a4352485078e434bdfa0a6c8ccfbb4
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
import io.flutter.plugins.camerax.GeneratedCameraXLibrary.Camera2CameraControlHostApi;
import java.util.Objects;

import android.hardware.camera2.CaptureRequest;
import android.hardware.camera2.CameraMetadata;

/**
* Host API implementation for {@link Camera2CameraControl}.
*
Expand Down Expand Up @@ -55,8 +58,10 @@ public void addCaptureRequestOptions(
throw new IllegalStateException("Context must be set to add capture request options.");
}

ListenableFuture<Void> addCaptureRequestOptionsFuture =
camera2CameraControl.addCaptureRequestOptions(bundle);
// ListenableFuture<Void> addCaptureRequestOptionsFuture =
// camera2CameraControl.addCaptureRequestOptions(bundle);
CaptureRequestOptions options = new CaptureRequestOptions.Builder().setCaptureRequestOption(CaptureRequest.CONTROL_AF_MODE, CaptureRequest.CONTROL_AF_MODE_AUTO).setCaptureRequestOption(CaptureRequest.CONTROL_AF_TRIGGER, CameraMetadata.CONTROL_AF_TRIGGER_IDLE).build();
ListenableFuture<Void> addCaptureRequestOptionsFuture = camera2CameraControl.setCaptureRequestOptions(options);

Futures.addCallback(
addCaptureRequestOptionsFuture,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ public final class CameraAndroidCameraxPlugin implements FlutterPlugin, Activity

@VisibleForTesting public @Nullable LiveDataHostApiImpl liveDataHostApiImpl;

@VisibleForTesting @Nullable
public Camera2CameraControlHostApiImpl camera2CameraControlHostApiImpl;

/**
* Initialize this within the {@code #configureFlutterEngine} of a Flutter activity or fragment.
*
Expand Down Expand Up @@ -119,6 +122,11 @@ public void setUp(
cameraControlHostApiImpl =
new CameraControlHostApiImpl(binaryMessenger, instanceManager, context);
GeneratedCameraXLibrary.CameraControlHostApi.setup(binaryMessenger, cameraControlHostApiImpl);
camera2CameraControlHostApiImpl = new Camera2CameraControlHostApiImpl(instanceManager, context);
GeneratedCameraXLibrary.Camera2CameraControlHostApi.setup(
binaryMessenger, camera2CameraControlHostApiImpl);
GeneratedCameraXLibrary.CaptureRequestOptionsHostApi.setup(
binaryMessenger, new CaptureRequestOptionsHostApiImpl(instanceManager));
}

@Override
Expand Down Expand Up @@ -209,6 +217,9 @@ public void updateContext(@NonNull Context context) {
}
if (cameraControlHostApiImpl != null) {
cameraControlHostApiImpl.setContext(context);
}
if (camera2CameraControlHostApiImpl != null) {
camera2CameraControlHostApiImpl.setContext(context);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
package io.flutter.plugins.camerax;

import android.hardware.camera2.CaptureRequest;
import android.hardware.camera2.CameraMetadata;
import androidx.annotation.NonNull;
import androidx.annotation.OptIn;
import androidx.annotation.VisibleForTesting;
Expand Down Expand Up @@ -51,6 +52,9 @@ public static class CaptureRequestOptionsProxy {
builder.setCaptureRequestOption(
(CaptureRequest.Key<Boolean>) optionKey, (Boolean) optionValue);
break;
case CONTROL_AF_TRIGGER:
builder.setCaptureRequestOption( (CaptureRequest.Key<Integer>) optionKey, CameraMetadata.CONTROL_AF_TRIGGER_IDLE); //(Integer) optionValue);
break;
default:
throw new IllegalArgumentException(
"The capture request key "
Expand All @@ -69,6 +73,9 @@ private CaptureRequest.Key<? extends Object> getCaptureRequestKey(
case CONTROL_AE_LOCK:
key = CaptureRequest.CONTROL_AE_LOCK;
break;
case CONTROL_AF_TRIGGER:
key = CaptureRequest.CONTROL_AF_TRIGGER;
break;
default:
throw new IllegalArgumentException(
"The capture request key is not currently supported by the plugin.");
Expand Down Expand Up @@ -110,8 +117,8 @@ public void create(@NonNull Long identifier, @NonNull Map<Long, Object> options)
Map<CaptureRequestKeySupportedType, Object> decodedOptions =
new HashMap<CaptureRequestKeySupportedType, Object>();
for (Map.Entry<Long, Object> option : options.entrySet()) {
decodedOptions.put(
CaptureRequestKeySupportedType.values()[option.getKey().intValue()], option.getValue());
Integer index = ((Number) option.getKey()).intValue();
decodedOptions.put(CaptureRequestKeySupportedType.values()[index], option.getValue());
}
instanceManager.addDartCreatedInstance(proxy.create(decodedOptions), identifier);
}
Expand Down
Loading