diff options
author | VaL Doroshchuk <valentyn.doroshchuk@qt.io> | 2019-10-11 11:51:14 +0200 |
---|---|---|
committer | VaL Doroshchuk <valentyn.doroshchuk@qt.io> | 2019-10-31 09:49:49 +0100 |
commit | 59d0683c999bec5612f6ba91867bde4d02185204 (patch) | |
tree | a8bcd49d8044d2b9a76699137ad763a11a5464bb /src/plugins/android/src/mediacapture/qandroidcamerasession.cpp | |
parent | 71e2096c2b704420cbb0ee836c16565b658b3d0f (diff) |
Introduce QVideoFrame::image()
Since QVideoFrame::pixelFormat's do not 100% match QImage::Format's,
introducing converstion function.
Returns an image based on current frame.
Converts data if needed to supported QImage format.
Change-Id: I3331578c01cf9c999a380efc4a83bf9eddb07901
(cherry picked from commit 93f966335e1ed8ed47b7e8b32452d43c2f8a7bb1)
Reviewed-by: Daniel Smith <Daniel.Smith@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'src/plugins/android/src/mediacapture/qandroidcamerasession.cpp')
-rw-r--r-- | src/plugins/android/src/mediacapture/qandroidcamerasession.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/plugins/android/src/mediacapture/qandroidcamerasession.cpp b/src/plugins/android/src/mediacapture/qandroidcamerasession.cpp index 6a30e5300..5df8241e0 100644 --- a/src/plugins/android/src/mediacapture/qandroidcamerasession.cpp +++ b/src/plugins/android/src/mediacapture/qandroidcamerasession.cpp @@ -53,7 +53,6 @@ #include <qdebug.h> #include <qvideoframe.h> #include <private/qmemoryvideobuffer_p.h> -#include <private/qvideoframe_p.h> #include <QtCore/private/qjnihelpers_p.h> QT_BEGIN_NAMESPACE @@ -748,7 +747,7 @@ void QAndroidCameraSession::processPreviewImage(int id, const QVideoFrame &frame transform.scale(-1, 1); transform.rotate(rotation); - emit imageCaptured(id, qt_imageFromVideoFrame(frame).transformed(transform)); + emit imageCaptured(id, frame.image().transformed(transform)); } void QAndroidCameraSession::onNewPreviewFrame(const QVideoFrame &frame) |