-
Notifications
You must be signed in to change notification settings - Fork 3.3k
[camera] Change default Android implementation from camera_android
to camera_android_camerax
#6629
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 16 commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
1cf757b
Make base changes
camsim99 9c511bb
Merge remote-tracking branch 'upstream/main' into camx_def
camsim99 f55614a
Bump version
camsim99 23ab00f
Add prepareForVideoRecording empty impl
camsim99 91ab029
Merge remote-tracking branch 'upstream/main' into camx_def
camsim99 17f8d38
Bump version
camsim99 2f75ebd
Debugging video player file issue
camsim99 6ba8099
Test fixes
camsim99 ef62ca8
fxi
camsim99 15d44d8
Use void stream
camsim99 f4fdc8d
Remove prints
camsim99 5e875c8
Merge remote-tracking branch 'upstream/main' into camx_def
camsim99 8575e64
Add video recording integration test
camsim99 a5182be
Prep for landing -- undo test fixes
camsim99 ccb8856
Undo more test changes
camsim99 b5108cc
Address comments from https://github.com/flutter/packages/pull/6697
camsim99 961810d
Address review
camsim99 6849640
Add link
camsim99 7c1d1f8
Merge remote-tracking branch 'upstream/main' into camx_def
camsim99 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,26 @@ | ||
# camera\_android | ||
|
||
The Android implementation of [`camera`][1]. | ||
|
||
*Note*: [`camera_android_camerax`][3] will become the default implementation of | ||
`camera` on Android by May 2024, so **we strongly encourage you to opt into it** | ||
by using [these instructions][4]. If any [limitations][5] of `camera_android_camerax` | ||
prevent you from using it or if you run into any problems, please report these | ||
issues under [`flutter/flutter`][5] with `[camerax]` in the title. | ||
An Android implementation of [`camera`][1] built with the [Camera2 library][4]. | ||
|
||
## Usage | ||
|
||
This package is [endorsed][2], which means you can simply use `camera` | ||
normally. This package will be automatically included in your app when you do, | ||
so you do not need to add it to your `pubspec.yaml`. | ||
As of `camera: ^0.11.0`, to use this plugin instead of [`camera_android_camerax`][3], | ||
run | ||
|
||
```sh | ||
$ flutter pub add camera_android | ||
``` | ||
|
||
If using `camera: <0.11.0` and wish to use this plugin instead of [`camera_android_camerax`][3], | ||
you can simply use `camera` normally because it is [endorsed][2]. This package will automatically | ||
be included in your app when you do so, so you do not need to add it to your `pubspec.yaml`. | ||
camsim99 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
However, if you `import` this package with a version lower than `0.11.0`, to use any of its APIs directly, you should add it to your `pubspec.yaml` as usual. | ||
camsim99 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
However, if you `import` this package to use any of its APIs directly, you | ||
should add it to your `pubspec.yaml` as usual. | ||
## Limitation of testing video recording on emulators | ||
It's important to note that the `MediaRecorder` class is not working properly on emulators, as stated in the documentation: https://developer.android.com/reference/android/media/MediaRecorder. Specifically, when recording a video with sound enabled and trying to play it back, the duration won't be correct and you will only see the first frame. | ||
camsim99 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
[1]: https://pub.dev/packages/camera | ||
[2]: https://flutter.dev/docs/development/packages-and-plugins/developing-packages#endorsed-federated-plugin | ||
[3]: https://pub.dev/packages/camera_android_camerax | ||
[4]: https://pub.dev/packages/camera_android_camerax#usage | ||
[5]: https://pub.dev/packages/camera_android_camerax#limitations | ||
[4]: https://developer.android.com/media/camera/camera2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.