Skip to content

Commit

Permalink
[camera] Fix wrong orientation (#36)
Browse files Browse the repository at this point in the history
* Fixed the bug. See: #6 (comment)

* Also, I changed the camera type from back-camera to external-camera.
  • Loading branch information
Hidenori Matsubayashi authored Aug 20, 2021
1 parent 86271d8 commit fe274a8
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 5 deletions.
4 changes: 4 additions & 0 deletions packages/camera/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
## 0.2.0
* Fix wrong orientation issue.
* Change the camera type from back to external.

## 0.1.0
* First draft version.
2 changes: 1 addition & 1 deletion packages/camera/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ This plugin uses [GStreamer](https://gstreamer.freedesktop.org/) internally.
```Shell
$ sudo apt install libgstreamer1.0-dev
# Install as needed.
$ sudo apt libgstreamer-plugins-base1.0-dev \
$ sudo apt install libgstreamer-plugins-base1.0-dev \
gstreamer1.0-plugins-base gstreamer1.0-plugins-good \
gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-libav
```
Expand Down
2 changes: 1 addition & 1 deletion packages/camera/elinux/camera_elinux_plugin.cc
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ void CameraPlugin::HandleAvailableCamerasCall(
AvailableCamerasMessage camera;
camera.SetName("camera" + std::to_string(i));
camera.SetSensorOrientation(0);
camera.SetLensFacing("back");
camera.SetLensFacing("external");
cameras.push_back(camera.ToMap());
}

Expand Down
4 changes: 2 additions & 2 deletions packages/camera/elinux/channels/method_channel_device.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

namespace {
constexpr char kChannelName[] = "flutter.io/cameraPlugin/device";
constexpr char kChannelMethodInitialized[] = "initialized";
constexpr char kChannelMethodOrientationChanged[] = "orientation_changed";

constexpr char kOrientation[] = "orientation";
}; // namespace
Expand All @@ -27,7 +27,7 @@ void MethodChannelDevice::SendDeviceOrientationChangeEvent(
flutter::EncodableValue(SerializeDeviceOrientation(orientation));
auto value = std::make_unique<flutter::EncodableValue>(mp);

Send(kChannelMethodInitialized, std::move(value));
Send(kChannelMethodOrientationChanged, std::move(value));
}

void MethodChannelDevice::Send(
Expand Down
2 changes: 1 addition & 1 deletion packages/camera/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: camera_elinux
description: A Flutter plugin for getting information about and controlling the
camera on eLinux. Supports previewing the camera feed, capturing images, capturing video,
and streaming image buffers to dart.
version: 0.1.0
version: 0.2.0
homepage: https://github.com/sony/flutter-elinux-plugins
repository: https://github.com/sony/flutter-elinux-plugins/tree/main/packages/camera

Expand Down

0 comments on commit fe274a8

Please sign in to comment.