-
Notifications
You must be signed in to change notification settings - Fork 3.6k
[camerax] Implement video capture for CameraX android camera re-write #3467
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 1 commit
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
f876e73
remaking video capture pr to fix CLA issue
ca2a353
accepting documentation change to createTempFile
22eea7a
making video recording tests into a group, and random typo
77dfba1
Merge branch 'main' into video_capture
gmackall daf385b
Merge branch 'flutter:main' into video_capture
gmackall 167f9c2
documentation changes from review comments
23ec03e
changing test name
034a508
Merge branch 'flutter:main' into video_capture
gmackall d5affdd
changing a use of RuntimeException to a FlutterError
9797067
format
c76d1a4
adding tests for error cases in stopVideoRecording
3141b02
formatting
92a51b8
Making explicit that we do nothing on pressing record twice, and addi…
5e776a5
formatting new tests
0ba0dfc
review comments around documentation and an assert
89d7936
removing use of the word 'we' per the style guide
9eecbed
removing second 'assert' that was copied over from first instance of …
f8eee31
Merge branch 'main' into video_capture
gmackall fb4770b
Merge branch 'main' into video_capture
gmackall 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
accepting documentation change to createTempFile
- Loading branch information
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think from the tests I read prefix is actually the file name and suffix is the extension. That came as a bit of a suprise from reading the documentation I would have expected
prefix<something the caller does not control>suffixfor the file name.For example it means as a caller I think this means I need to ensure that I pass something different each time or risk overwriting the previous file.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll clarify the documentation before merging, the way it actually works is that the file ends up being
prefix<something the caller does not control>.suffix, i.e. 'suffix' is the file extension, and prefix is part of the file name, but more gets added by createTempFile (a random sequence of numbers).So
getTempFile('MOV', '.temp'), is something like<cachedir>/MOV1231242244.temp(notably this means you do not have to pass different things to avoid overwriting).FWIW I chose prefix and suffix because those are the variable names used by the native methods implementation/documentation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK in that case it means the documentation is correct but that is not what the tests are testing for. I think using the same names as the native code is a reasonable choice.
Specifically in packages/camera/camera_android_camerax/test/system_services_test.dart and in packages/camera/camera_android_camerax/android/src/test/java/io/flutter/plugins/camerax/SystemServicesTest.java you are testing for the result to be equal to
testPath + testPrefix + testSuffix(or the file for prefix and suffix). Instead of testing that the output had a path oftestPatha file prefix oftestPrefixand an extension oftestSuffix. Which is fine it is just confusing when trying to understand what to expect from the tests.