Skip to content
Closed
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ platform_properties:
targets:
- name: Linux repo_checks
recipe: packages/packages
timeout: 30
timeout: 60
properties:
add_recipes_cq: "true"
target_file: repo_checks.yaml
Expand Down
2 changes: 1 addition & 1 deletion .ci/flutter_master.version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
02f13c37841f7426d8c493af16bc037176eb641b
30e53b0d9caadce80eff6d09f6975046b9a93033
4 changes: 4 additions & 0 deletions packages/camera/camera_android_camerax/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.6.15

* Updates internal API wrapper to use ProxyApis.

## 0.6.14+1

* Updates compileSdk 34 to flutter.compileSdkVersion.
Expand Down
11 changes: 10 additions & 1 deletion packages/camera/camera_android_camerax/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@ group 'io.flutter.plugins.camerax'
version '1.0'

buildscript {
ext.kotlin_version = '1.9.10'
repositories {
google()
mavenCentral()
}

dependencies {
classpath 'com.android.tools.build:gradle:8.5.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}

Expand All @@ -20,6 +22,7 @@ rootProject.allprojects {
}

apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'

android {
namespace 'io.flutter.plugins.camerax'
Expand All @@ -31,6 +34,11 @@ android {
targetCompatibility JavaVersion.VERSION_11
}

kotlinOptions {
// This must match the Java version provided in compileOptions.
jvmTarget = '11'
}

defaultConfig {
// Many of the CameraX APIs require API 21.
minSdkVersion 21
Expand Down Expand Up @@ -65,7 +73,8 @@ dependencies {
implementation "androidx.camera:camera-video:${camerax_version}"
implementation 'com.google.guava:guava:33.4.0-android'
testImplementation 'junit:junit:4.13.2'
testImplementation 'org.mockito:mockito-inline:5.0.0'
testImplementation "org.mockito:mockito-core:5.15.2"
testImplementation 'org.mockito:mockito-inline:5.1.0'
testImplementation 'androidx.test:core:1.4.0'
testImplementation 'org.robolectric:robolectric:4.10.3'
}

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

package io.flutter.plugins.camerax;

import androidx.annotation.NonNull;
import androidx.camera.core.ImageAnalysis.Analyzer;
import java.util.Objects;

/**
* ProxyApi implementation for {@link Analyzer}. This class may handle instantiating native object
* instances that are attached to a Dart instance or handle method calls on the associated native
* class or an instance of that class.
*/
class AnalyzerProxyApi extends PigeonApiAnalyzer {
AnalyzerProxyApi(@NonNull ProxyApiRegistrar pigeonRegistrar) {
super(pigeonRegistrar);
}

@NonNull
@Override
public ProxyApiRegistrar getPigeonRegistrar() {
return (ProxyApiRegistrar) super.getPigeonRegistrar();
}

/** Implementation of {@link Analyzer} that passes arguments of callback methods to Dart. */
static class AnalyzerImpl implements Analyzer {
final AnalyzerProxyApi api;

AnalyzerImpl(@NonNull AnalyzerProxyApi api) {
this.api = api;
}

@Override
public void analyze(@NonNull androidx.camera.core.ImageProxy image) {
api.getPigeonRegistrar()
.runOnMainThread(
new ProxyApiRegistrar.FlutterMethodRunnable() {
@Override
public void run() {
api.analyze(
AnalyzerImpl.this,
image,
ResultCompat.asCompatCallback(
result -> {
if (result.isFailure()) {
onFailure(
"Analyzer.analyze",
Objects.requireNonNull(result.exceptionOrNull()));
}
return null;
}));
}
});
}
}

@NonNull
@Override
public Analyzer pigeon_defaultConstructor() {
return new AnalyzerImpl(this);
}
}

This file was deleted.

Loading