diff options
author | Yoann Lopes <yoann.lopes@digia.com> | 2013-09-27 11:24:10 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-10-01 17:26:21 +0200 |
commit | be7a6241e77f67e4a19c63ac5683dd7fa566e9d2 (patch) | |
tree | ab8b66b5124d4a982d7690cf7893a40650bccc8d /src/plugins/android/src/common/qandroidvideooutput.h | |
parent | 329d9d4563445d785284a02983e237ff1a07f5dd (diff) |
Android: refactor video renderer.
Removed the overhead of having to create a shared OpenGL context in the GUI
thread and pre-render the frame into a FBO.
We now directly render the GL_TEXTURE_EXTERNAL_OES in the QtQuick render
thread, using an Android-specific QSGVideoNode.
We also use a callback from the render thread to create the texture from
there and not have to create a separate shared OpenGL context.
Change-Id: I6c8eb94b47d0a03329c912701b8af3fb5ebd1876
Reviewed-by: Christian Stromme <christian.stromme@digia.com>
Diffstat (limited to 'src/plugins/android/src/common/qandroidvideooutput.h')
-rw-r--r-- | src/plugins/android/src/common/qandroidvideooutput.h | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/src/plugins/android/src/common/qandroidvideooutput.h b/src/plugins/android/src/common/qandroidvideooutput.h index 8110b67b0..1ad64a4b4 100644 --- a/src/plugins/android/src/common/qandroidvideooutput.h +++ b/src/plugins/android/src/common/qandroidvideooutput.h @@ -48,26 +48,28 @@ QT_BEGIN_NAMESPACE -typedef void (*TextureReadyCallback)(void*); - class QAndroidVideoOutput { public: - QAndroidVideoOutput() { } virtual ~QAndroidVideoOutput() { } virtual jobject surfaceHolder() = 0; + virtual jobject surfaceTexture() { return 0; } - virtual bool isTextureReady() = 0; - virtual void setTextureReadyCallback(TextureReadyCallback cb, void *context = 0) = 0; - virtual jobject surfaceTexture() = 0; + virtual bool isReady() { return true; } - virtual void setVideoSize(const QSize &size) = 0; - virtual void stop() = 0; + virtual void setVideoSize(const QSize &) { } + virtual void stop() { } virtual QImage toImage() = 0; + + // signals: + // void readyChanged(bool); }; +#define QAndroidVideoOutput_iid "org.qt-project.qt.qandroidvideooutput/5.0" +Q_DECLARE_INTERFACE(QAndroidVideoOutput, QAndroidVideoOutput_iid) + QT_END_NAMESPACE #endif // QANDROIDVIDEOOUTPUT_H |