[camera] Fix wrong orientation (#36)

* Fixed the bug. See: #6 (comment)

* Also, I changed the camera type from back-camera to external-camera.
This commit is contained in:
Hidenori Matsubayashi
2021-08-20 10:45:18 +09:00
committed by GitHub
parent 86271d86b8
commit fe274a8038
5 changed files with 9 additions and 5 deletions
@@ -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());
}
@@ -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
@@ -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(