-
Notifications
You must be signed in to change notification settings - Fork 9.8k
[camera] Fix the orientation of videos recorded in landscape on Android #4946
[camera] Fix the orientation of videos recorded in landscape on Android #4946
Conversation
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.
There's nothing here that explains why this code is right and the previous code was wrong; the documentation of the method doesn't provide any context that allows evaluating it. A PR that reverted this change would look exactly the same as this one, and would be similarly unclear.
Please update the documentation of this method to explain what exactly the values are meant to express in a way that allows clearly evaluating whether 90
or 270
is right. (Ideally that means with links to relevant documentation.)
@stuartmorgan Updated the method's documentation with a link that illustrates the calculation. |
I rebased to fix the changelog and pubspec. Not sure why the PR changes have ballooned like this right now? |
You've rebased incorrectly; I don't know exactly how since I don't know what commands you ran. But a
Either is fine; the issue here isn't that you rebased, it's that the rebase wasn't done correctly. |
(Removing myself as a reviewer, I think I got added as an owner during a bad rebase) |
packages/camera/camera/CHANGELOG.md
Outdated
@@ -1,3 +1,7 @@ | |||
## 0.9.4+17 | |||
|
|||
* Fix an issue with the orientation of video's recorded in landscape on Android. |
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.
Fixes
(See style guide linked from the checklist.)
...main/java/io/flutter/plugins/camera/features/sensororientation/DeviceOrientationManager.java
Show resolved
Hide resolved
.../java/io/flutter/plugins/camera/features/sensororientation/DeviceOrientationManagerTest.java
Outdated
Show resolved
Hide resolved
Any update on this pull request, or anything I can help with? Looking forward to use it 👍 |
...main/java/io/flutter/plugins/camera/features/sensororientation/DeviceOrientationManager.java
Show resolved
Hide resolved
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.
LGTM with nit, sorry for the delay in getting back to this.
- @camsim99 for second review.
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.
LGTM!
Should land shortly. Thanks for the contribution, and for the investigation into the relevant docs! |
This PR fixes a bug with the orientation of the recorded video on Android. In Landscape Left and Landscape Right the video was flipped 180 degrees in the wrong direction. I also added a new test for the fallback-to-sensor-orientation case for portrait. Only testing that case against landscape felt a little odd to me.
Fixes flutter/flutter#27201, flutter/flutter#98486
Pre-launch Checklist
dart format
.)[shared_preferences]
pubspec.yaml
with an appropriate new version according to the [pub versioning philosophy], or this PR is [exempt from version changes].CHANGELOG.md
to add a description of the change, [following repository CHANGELOG style].///
).Before / After samples
Landscape Left Recording (rotated the device 90CCW, then started recording)
Before
rotated-left-90CCW-broken.mp4
After
rotated-left-90CCW-fixed.mp4
LandscapeRight Recording (rotated the device 90CW, then started recording)
Before
rotated-right-90CW-broken.mp4
After
rotated-right-90CW-fixed.mp4