diff options
author | Yoann Lopes <yoann.lopes@digia.com> | 2014-01-20 17:20:26 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-01-20 17:26:21 +0100 |
commit | a0746fe49c186566fc8c619daf0b8bb82929ac55 (patch) | |
tree | 346af347a087cb2ed738ce84be54e7b997c9b707 /src/plugins/android/videonode/qandroidsgvideonode.h | |
parent | 437db8df51c8ce11f6d856d1c0441572cf218e1f (diff) |
Android: fixed video rendering with multiple media players.
It seems all Android media players share the same video buffers, which
results in textures containing frames for the wrong media player.
When getting a new frame, we now copy it into a FBO in order to avoid
that another media player overwrites the frame being shown on screen.
Task-number: QTBUG-35868
Change-Id: I6701cf7368a3ef9e73d649c3ece1f206cafd5bb3
Reviewed-by: Christian Stromme <christian.stromme@digia.com>
Diffstat (limited to 'src/plugins/android/videonode/qandroidsgvideonode.h')
-rw-r--r-- | src/plugins/android/videonode/qandroidsgvideonode.h | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/plugins/android/videonode/qandroidsgvideonode.h b/src/plugins/android/videonode/qandroidsgvideonode.h index b5b383fb6..5da72dd2d 100644 --- a/src/plugins/android/videonode/qandroidsgvideonode.h +++ b/src/plugins/android/videonode/qandroidsgvideonode.h @@ -43,6 +43,7 @@ #define QANDROIDSGVIDEONODE_H #include <private/qsgvideonode_p.h> +#include <qmutex.h> QT_BEGIN_NAMESPACE @@ -52,14 +53,18 @@ class QAndroidSGVideoNode : public QSGVideoNode { public: QAndroidSGVideoNode(const QVideoSurfaceFormat &format); + ~QAndroidSGVideoNode(); void setCurrentFrame(const QVideoFrame &frame); - QVideoFrame::PixelFormat pixelFormat() const; + QVideoFrame::PixelFormat pixelFormat() const { return m_format.pixelFormat(); } + + void preprocess(); private: - QVideoSurfaceFormat m_format; QAndroidSGVideoNodeMaterial *m_material; + QMutex m_frameMutex; QVideoFrame m_frame; + QVideoSurfaceFormat m_format; }; QT_END_NAMESPACE |