Comments (5)
Thanks for the clarification @Moncader!
Followed up on this issue with CameraX folks and I found out that the logic in the plugin does in fact follow the limitations listed in https://developer.android.com/media/camera/camerax/architecture#combine-use-cases as discussed, but this is apparently out of date. There has been an update to allow concurrent image analysis, preview, and video--something to do with shared streams. This feature was added in an earlier version of CameraX than the one we currently use. Therefore, we should try to remove the logic preventing previously unsupported concurrent use cases from being used.
Closing this issue as there's nothing actionable here and filed #150387 to follow up on these new findings.
from flutter.
I checked this on my Pixel 7 Android 14 and saw the same output result as 0 on the sample app. To reproduce this, I add a new file to the package example project at lib folder:
Complete sample code
import 'package:flutter/material.dart';
import 'camera_controller.dart';
import 'camera_image.dart';
import 'camera_preview.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
useMaterial3: true,
),
home: const MyHomePage(title: 'Flutter Demo Home Page'),
);
}
}
class MyHomePage extends StatefulWidget {
const MyHomePage({super.key, required this.title});
final String title;
@override
State<MyHomePage> createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
CameraController? _controller;
int _counter = 0;
@override
void initState() {
super.initState();
_initializeCamera();
}
Future<void> _initializeCamera() async {
final cameras = await availableCameras();
final firstCamera = cameras.first;
_controller = CameraController(firstCamera);
await _controller!.initialize();
if (mounted) {
setState(() {});
}
_controller!.startVideoRecording(onAvailable: _onImage);
}
void _onImage(CameraImage image) {
setState(() {
_counter++;
});
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
backgroundColor: Theme.of(context).colorScheme.inversePrimary,
title: Text(widget.title),
),
body: Stack(
children: [
Padding(
padding: const EdgeInsets.all(32.0),
child: Center(
child: _controller != null
? CameraPreview(_controller!)
: const CircularProgressIndicator(),
),
),
Positioned(
bottom: 16,
right: 16,
child: Text('images received: $_counter'),
),
],
),
);
}
}
flutter doctor -v
[✓] Flutter (Channel stable, 3.22.2, on macOS 14.1 23B74 darwin-x64, locale en-VN)
• Flutter version 3.22.2 on channel stable at /Users/huynq/Documents/GitHub/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 761747bfc5 (31 hours ago), 2024-06-05 22:15:13 +0200
• Engine revision edd8546116
• Dart version 3.4.3
• DevTools version 2.34.3
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
• Android SDK at /Users/huynq/Library/Android/sdk
• Platform android-34, build-tools 34.0.0
• ANDROID_HOME = /Users/huynq/Library/Android/sdk
• Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 17.0.10+0-17.0.10b1087.21-11572160)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 15.3)
• Xcode at /Applications/Xcode15.3.app/Contents/Developer
• Build 15E204a
• CocoaPods version 1.15.2
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 2023.3)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• android-studio-dir = /Applications/Android Studio.app/
• Java version OpenJDK Runtime Environment (build 17.0.10+0-17.0.10b1087.21-11572160)
[✓] VS Code (version 1.89.1)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.90.0
[✓] Connected device (3 available)
• iPhone (mobile) • d9a94afe2b649fef56ba0bfeb052f0f2a7dae95e • ios • iOS 15.8 19H370
• macOS (desktop) • macos • darwin-x64 • macOS 14.1 23B74 darwin-x64
• Chrome (web) • chrome • web-javascript • Google Chrome 125.0.6422.142
[✓] Network resources
• All expected network resources are available.
• No issues found!
from flutter.
From triage: Our understanding of the levels is that they include Limited, Full, Legacy, Level 3, and External. Can you clarify what you mean by "level 1"?
from flutter.
Thanks for looking in to this yaakovschectman.
I was talking about 'Full' as the value of the constant was 0x1
. I assumed that 0x1 as well as the word 'full' would mean better than 'level 3' as is the case with other media systems like Widevine DRM.
Upon reading the documentation of camerax,
https://developer.android.com/reference/android/hardware/camera2/CameraMetadata#INFO_SUPPORTED_HARDWARE_LEVEL_3
I do see that Level 3 is actually better than full, and therefore logically the current implementation is correct as per this documentation:
https://developer.android.com/media/camera/camerax/architecture#combine-use-cases
So as a camerax issue, this issue could perhaps be closed... But it does beg the question of how is it possible for the recommended android camera library to not support even the most basic of AR features on even a Google phone like Pixel 6 Pro...
from flutter.
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v
and a minimal reproduction of the issue.
from flutter.
Related Issues (20)
- Question About Flutter Semantics with Deque Tool HOT 1
- PopScope doesn't sense the drawer is opened HOT 2
- [google_maps_flutter] Implementing StreetView HOT 1
- [SelectionArea] The height of highlight is different when english/non-english characters are used together HOT 2
- [Android] The Chinese characters'囊' overlap together after upgrading flutter Sdk HOT 3
- [webview_flutter][iOS]: Scrolling of ListTile inside webview gets stuck after closing modalBottomSheet. HOT 5
- [Web] The selected `ListTile` is not clipped by parent `Container` with `Clip.hardEdge` HOT 3
- [tool_crash] RPCError HOT 2
- Linux web_long_running_tests_2_5 is 2.11% flaky
- Linux web_long_running_tests_5_5 is 2.11% flaky
- [tool_crash] StateError: Bad state: StreamSink is closed HOT 2
- [Android] CameraX preview is rotated 90 degrees HOT 22
- TextFields value is animated on rerender for no reason HOT 6
- Crash App HOT 1
- Linux web_long_running_tests_1_5 is 2.11% flaky HOT 3
- Windows tool_integration_tests_2_7 is 2.02% flaky HOT 3
- [interactive_media_ads] Ad freeze when the top notification panel is swiped down on iOS. HOT 2
- [iOS] Clip not working for video on iOS in Flutter 3.24.1 HOT 11
- Windows framework_tests_libraries is 2.11% flaky HOT 2
- Linux customer_testing is 5.00% flaky HOT 9
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flutter.