文件最后提交记录最后更新时间
[camera_android_camerax] Updates pigeon generation to prevent crash when objects call to Dart after a hot restart (#10571) Fixes https://github.com/flutter/flutter/issues/176451 ## Pre-Review Checklist **Note**: The Flutter team is currently trialing the use of [Gemini Code Assist for GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code). Comments from the gemini-code-assist bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed. [^1]: Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling.5 个月前
[all] Omit obvious local types (#10511) Makes the analysis options changes described in https://github.com/flutter/flutter/issues/178827: - Adding [omit_obvious_local_variable_types](https://dart.dev/tools/linter-rules/omit_obvious_local_variable_types) - Adding [specify_nonobvious_local_variable_types](https://dart.dev/tools/linter-rules/specify_nonobvious_local_variable_types) - Adding [specify_nonobvious_property_types](https://dart.dev/tools/linter-rules/specify_nonobvious_property_types) - Adding [type_annotate_public_apis](https://dart.dev/tools/linter-rules/type_annotate_public_apis) - Removing [always_specify_types](https://dart.dev/tools/linter-rules/always_specify_types) After those changes, makes the following repo-wide changes: - dart fix --apply in all packages and in script/tool/ - dart format in all packages and in script/tool/ - update-excerpts repo tooling command to update excerpts based on the changes to their sources Also updates the min Flutter/Dart SDK version to 3.35/3.9 for the following packages, to avoid analyze failures in the N-2 legacy analysis run due to what appears to be a 3.9 change in what the Dart analyzer continues to be an obvious local type in loop iterations: - go_router - google_fonts - google_identity_services_web - google_maps_flutter_web - local_auth_platform_interface - metrics_center - multicast_dns - pigeon - rfw - shared_preferences - two_dimensional_scrollables - vector_graphics_compiler - mustache_template - path_parsing Because this is causing a significant amount of format churn already, I took this opportunity to update the repository tooling to a min Dart SDK of 3.8 (the N-2 stable version, so the earliest version we need the tooling to support) to pick up the new format style, so the amount of automated formatter change is higher in script/tool/ than in the packages. This does contain two manual changes (other than the repo tooling min version): - https://github.com/flutter/packages/commit/d700b45c7df3a79f66dc119ad36dd2bc1e042acf changes dynamic to Object? in a few places where dynamic caused analyzer warnings under the new rule set. - Updates the repo tooling to ignore .dart_tool/ when looking for unexpected local analysis_options.yaml files, to fix issues running the repo tool's analyze command locally based on recent changes in dart behavior. This does not include any CHANGELOG or version updates; even though we normally version any changes to production code, mass automated changes like this aren't worth the churn of releasing. This includes changes to lib/example/main.dart and to README.md excerpts; while the style changes will be user-visible on pub.dev, it's fine for those changes to wait for the next release of each package. Part of https://github.com/flutter/flutter/issues/1788276 个月前
[camera_android_camerax] Updates pigeon generation to prevent crash when objects call to Dart after a hot restart (#10571) Fixes https://github.com/flutter/flutter/issues/176451 ## Pre-Review Checklist **Note**: The Flutter team is currently trialing the use of [Gemini Code Assist for GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code). Comments from the gemini-code-assist bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed. [^1]: Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling.5 个月前
[camera_android_camerax] use MediaSettings::fps for image preview, streaming, and video recording (#10301) Implements MediaSettings::fps in camera_android_camerax for image preview, image streaming, and video recording. - Resolves [#167719](https://github.com/flutter/flutter/issues/167719): implements the feature instead of adding documentation that it does not work. - Partially resolves [#176148](https://github.com/flutter/flutter/issues/176148): only implements for camera_android_camerax, and uses the existing MediaSettings::fps instead of adding parameters to CameraImageStreamOptions ## Pre-Review Checklist **Note**: The Flutter team is currently trialing the use of [Gemini Code Assist for GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code). Comments from the gemini-code-assist bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed. [^1]: Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling.5 个月前
[camera_android_camerax] Removes internal native library Dart proxy (#10536) ProxyApis now * Generate a Dart PigeonOverrides class that can override constructors and static methods. * Use a test PigeonInstanceManager that doesn't make any message calls. This removes the manually written proxy and replaces its use in tests with PigeonOverrides. ## Pre-Review Checklist **Note**: The Flutter team is currently trialing the use of [Gemini Code Assist for GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code). Comments from the gemini-code-assist bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed. [^1]: Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling.5 个月前
[camera] Add CameraX plugin for development (#6178) 3 年前
[camera] Add CameraInfo class and clean CameraX plugin (#6345) 3 年前
[camera_android_camerax] Updates pigeon generation to prevent crash when objects call to Dart after a hot restart (#10571) Fixes https://github.com/flutter/flutter/issues/176451 ## Pre-Review Checklist **Note**: The Flutter team is currently trialing the use of [Gemini Code Assist for GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code). Comments from the gemini-code-assist bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed. [^1]: Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling.5 个月前
[various] Clean up contributing guides (#8032) Several packages had documentation about how to use Pigeon or Mockito generation; this made sense when those were rare, but they are both now extremely common in our packages. Instead, https://github.com/flutter/flutter/pull/158326 adds this information to the general documentation for contribuing to flutter/packages, so it no longer needs to be in (a random subset of) specific packages. This also removes Contributing sections from several READMEs, as READMEs should be client-focused rather than developer-focused, and puts content in CONTRIBUTING.md where needed.1 年前
Remove "All right reserved" from all files (#10066) Per guidance from legal on current preferred practice, remove "All rights reserved" from all LICENSE files and header blocks, and update the repo tool check accordingly.7 个月前
[camera_android_camerax] Implement setDescriptionWhileRecording (#10030) setDescriptionWhileRecording allows switching camera while a video recording is in progress Fixes [#148013](https://github.com/flutter/flutter/issues/148013) ## Pre-Review Checklist **Note**: The Flutter team is currently trialing the use of [Gemini Code Assist for GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code). Comments from the gemini-code-assist bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed. [^1]: Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling.7 个月前
[camera_android_camerax] Updates pigeon generation to prevent crash when objects call to Dart after a hot restart (#10571) Fixes https://github.com/flutter/flutter/issues/176451 ## Pre-Review Checklist **Note**: The Flutter team is currently trialing the use of [Gemini Code Assist for GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code). Comments from the gemini-code-assist bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed. [^1]: Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling.5 个月前
README.md

camera_android_camerax

The Android implementation of camera built with the CameraX library.

Note: If any of the limitations prevent you from using using camera_android_camerax or if you run into any problems, please report these issues under flutter/flutter with [camerax] in the title. You may also opt back into the camera_android implementation if you need.

Usage

As of camera: ^0.11.0, this package is endorsed, which means you can simply use camera normally. This package will be automatically be included in your app when you do, so you do not need to add it to your pubspec.yaml.

However, if you import this package to use any of its APIs directly, you should add it to your pubspec.yaml as usual.

Limitations

Concurrent preview display, video recording, image capture, and image streaming

The CameraX plugin only supports the concurrent camera use cases supported by Camerax; see their documentation for more information. To avoid the usage of unsupported concurrent use cases, the plugin behaves according to the following:

  • If the preview is paused (via pausePreview), concurrent video recording and image capture and/or image streaming (via startVideoCapturing(cameraId, VideoCaptureOptions(streamCallback:...))) is supported.
  • If the preview is not paused
    • and the camera device is at least supported hardware LIMITED, then concurrent image capture and video recording is supported.
    • and the camera device is at least supported hardware LEVEL_3, then concurrent video recording and image streaming is supported, but concurrent video recording, image streaming, and image capture is not supported.

240p resolution configuration for video recording

240p resolution configuration for video recording is unsupported by CameraX, and thus, the plugin will fall back to target 480p (ResolutionPreset.medium) if configured with ResolutionPreset.low.

Setting stream options for video capture

Calling startVideoCapturing with VideoCaptureOptions configured with streamOptions is currently unsupported do to limitations of the platform interface, and thus that parameter will silently be ignored.

What requires Android permissions

Writing to external storage to save image files

In order to save captured images and videos to files on Android 10 and below, CameraX requires specifying the WRITE_EXTERNAL_STORAGE permission (see the CameraX documentation). This is already done in the plugin, so no further action is required on your end.

To understand the privacy impact of specifying the WRITE_EXTERNAL_STORAGE permission, see the WRITE_EXTERNAL_STORAGE documentation. We have seen apps also have the READ_EXTERNAL_STORAGE permission automatically added to the merged Android manifest; it appears to be implied from WRITE_EXTERNAL_STORAGE. If you do not want the READ_EXTERNAL_STORAGE permission to be included in the merged Android manifest of your app, then take the following steps to remove it:

  1. Ensure that your app nor any of the plugins that it depends on require the READ_EXTERNAL_STORAGE permission.
  2. Add the following to your app's your_app/android/app/src/main/AndroidManifest.xml:
  <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"
    tools:node="remove" />

Notes on video capture

Setting description while recording

To avoid cancelling any active recording when calling setDescriptionWhileRecording, you must start the recording with startVideoCapturing with enablePersistentRecording set to true.

Notes on image streaming

Allowing image streaming in the background

As of Android 14, to allow for background image streaming, you will need to specify the foreground TYPE_CAMERA foreground service permission in your app's manifest. Specifically, in your_app/android/app/src/main/AndroidManifest.xml add the following:

<manifest ...>
  <uses-permission android:name="android.permission.FOREGROUND_SERVICE_CAMERA" />
  ...
</manifest>

Configuring NV21 image format

If you initialize a CameraController with ImageFormatGroup.nv21, then streamed images will still have the ImageFormatGroup.yuv420 format, but their image data will be formatted in NV21. See https://developer.android.com/reference/kotlin/androidx/camera/core/ImageAnalysis#OUTPUT_IMAGE_FORMAT_NV21().

Contributing

For more information on contributing to this plugin, see CONTRIBUTING.md.