diff options
Diffstat (limited to 'src/plugins/android/src/common/qandroidvideorendercontrol.cpp')
-rw-r--r-- | src/plugins/android/src/common/qandroidvideorendercontrol.cpp | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/plugins/android/src/common/qandroidvideorendercontrol.cpp b/src/plugins/android/src/common/qandroidvideorendercontrol.cpp index b737e8a42..5f14a4691 100644 --- a/src/plugins/android/src/common/qandroidvideorendercontrol.cpp +++ b/src/plugins/android/src/common/qandroidvideorendercontrol.cpp @@ -42,7 +42,6 @@ #include "qandroidvideorendercontrol.h" #include <QtCore/private/qjni_p.h> -#include "jsurfacetextureholder.h" #include <QAbstractVideoSurface> #include <QVideoSurfaceFormat> #include <qevent.h> @@ -51,6 +50,7 @@ #include <qopenglfunctions.h> #include <qopenglshaderprogram.h> #include <qopenglframebufferobject.h> +#include <QtCore/private/qjnihelpers_p.h> QT_BEGIN_NAMESPACE @@ -177,7 +177,7 @@ bool QAndroidVideoRendererControl::initSurfaceTexture() m_surfaceTexture = new JSurfaceTexture(m_externalTex); - if (m_surfaceTexture->isValid()) { + if (m_surfaceTexture->object()) { connect(m_surfaceTexture, SIGNAL(frameAvailable()), this, SLOT(onFrameAvailable())); } else { delete m_surfaceTexture; @@ -193,12 +193,12 @@ bool QAndroidVideoRendererControl::initSurfaceTexture() void QAndroidVideoRendererControl::clearSurfaceTexture() { if (m_surfaceTexture) { - m_surfaceTexture->callMethod<void>("release"); delete m_surfaceTexture; m_surfaceTexture = 0; } if (m_androidSurface) { - m_androidSurface->callMethod<void>("release"); + if (QtAndroidPrivate::androidSdkVersion() > 13) + m_androidSurface->callMethod<void>("release"); delete m_androidSurface; m_androidSurface = 0; } @@ -215,10 +215,12 @@ jobject QAndroidVideoRendererControl::surfaceHolder() if (!m_surfaceHolder) { m_androidSurface = new QJNIObjectPrivate("android/view/Surface", - "(Landroid/graphics/SurfaceTexture;)V", - m_surfaceTexture->object()); + "(Landroid/graphics/SurfaceTexture;)V", + m_surfaceTexture->object()); - m_surfaceHolder = new JSurfaceTextureHolder(m_androidSurface->object()); + m_surfaceHolder = new QJNIObjectPrivate("org/qtproject/qt5/android/multimedia/QtSurfaceTextureHolder", + "(Landroid/view/Surface;)V", + m_androidSurface->object()); } return m_surfaceHolder->object(); |