Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.

[camera] Fix the orientation of videos recorded in landscape on Android #4946

Merged
merged 17 commits into from
Apr 21, 2022
Merged

[camera] Fix the orientation of videos recorded in landscape on Android #4946

merged 17 commits into from
Apr 21, 2022

Conversation

navaronbracke
Copy link
Contributor

@navaronbracke navaronbracke commented Feb 26, 2022

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

  • I read the [Contributor Guide] and followed the process outlined there for submitting PRs.
  • I read the [Tree Hygiene] wiki page, which explains my responsibilities.
  • I read and followed the [relevant style guides] and ran [the auto-formatter]. (Unlike the flutter/flutter repo, the flutter/plugins repo does use dart format.)
  • I signed the [CLA].
  • The title of the PR starts with the name of the plugin surrounded by square brackets, e.g. [shared_preferences]
  • I listed at least one issue that this PR fixes in the description above.
  • I updated pubspec.yaml with an appropriate new version according to the [pub versioning philosophy], or this PR is [exempt from version changes].
  • I updated CHANGELOG.md to add a description of the change, [following repository CHANGELOG style].
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or this PR is [test-exempt].
  • All existing and new tests are passing.
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

Copy link
Contributor

@stuartmorgan-g stuartmorgan-g left a 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.)

@navaronbracke
Copy link
Contributor Author

@stuartmorgan Updated the method's documentation with a link that illustrates the calculation.

@navaronbracke
Copy link
Contributor Author

navaronbracke commented Mar 9, 2022

I rebased to fix the changelog and pubspec. Not sure why the PR changes have ballooned like this right now? git diff upstream/main shows the correct changes? Should I have merged instead?

@stuartmorgan-g
Copy link
Contributor

Not sure why the PR changes have balloned 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 rebase -i main should let you delete all the commits that are from main rather than from your PR.

Should I have merged instead?

Either is fine; the issue here isn't that you rebased, it's that the rebase wasn't done correctly.

@ditman
Copy link
Member

ditman commented Mar 21, 2022

(Removing myself as a reviewer, I think I got added as an owner during a bad rebase)

@ditman ditman removed their request for review March 21, 2022 18:55
@@ -1,3 +1,7 @@
## 0.9.4+17

* Fix an issue with the orientation of video's recorded in landscape on Android.
Copy link
Contributor

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.)

@Code-Remote
Copy link

Any update on this pull request, or anything I can help with? Looking forward to use it 👍

@stuartmorgan-g stuartmorgan-g self-requested a review April 12, 2022 14:16
Copy link
Contributor

@stuartmorgan-g stuartmorgan-g left a 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.

@stuartmorgan-g stuartmorgan-g requested a review from camsim99 April 20, 2022 18:58
Copy link
Contributor

@camsim99 camsim99 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@stuartmorgan-g stuartmorgan-g changed the title [camera] Fix the orientation of video's recorded in landscape on Android [camera] Fix the orientation of videos recorded in landscape on Android Apr 21, 2022
@stuartmorgan-g stuartmorgan-g added the waiting for tree to go green (Use "autosubmit") This PR is approved and tested, but waiting for the tree to be green to land. label Apr 21, 2022
@stuartmorgan-g
Copy link
Contributor

Should land shortly. Thanks for the contribution, and for the investigation into the relevant docs!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
p: camera platform-android waiting for tree to go green (Use "autosubmit") This PR is approved and tested, but waiting for the tree to be green to land.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Camera Plugin Record Video orientation issue
6 participants