4#ifndef ANDROIDSURFACETEXTURE_H
5#define ANDROIDSURFACETEXTURE_H
19#include <QtCore/qjniobject.h>
35 inline bool isValid()
const {
return m_surfaceTexture.isValid(); }
51 void setOnFrameAvailableListener(
const QJniObject &listener);
53 QJniObject m_surfaceTexture;
55 QJniObject m_surfaceHolder;
56 const quint64 m_index = 0;
void attachToGLContext(quint32 texName)
static bool registerNativeMethods()
QMatrix4x4 getTransformMatrix()
void detachFromGLContext()
MapData map(QVideoFrame::MapMode mode) override
Maps the planes of a video buffer to memory.
void unmap() override
Releases the memory mapped by the map() function.
AndroidTextureVideoBuffer(std::shared_ptr< QRhi > rhi, std::shared_ptr< AndroidTextureThread > thread, std::unique_ptr< QRhiTexture > tex, const QSize &size)
QVideoFrameTexturesUPtr mapTextures(QRhi &rhi, QVideoFrameTexturesUPtr &) override
void unmap() override
Releases the memory mapped by the map() function.
QVideoFrameTexturesUPtr mapTextures(QRhi &rhi, QVideoFrameTexturesUPtr &oldTextures) override
ImageFromVideoFrameHelper(AndroidTextureVideoBuffer &atvb)
MapData map(QVideoFrame::MapMode) override
Maps the planes of a video buffer to memory.
QSize getVideoSize() const override
void setSubtitle(const QString &subtitle)
void setVideoSize(const QSize &) override
std::shared_ptr< AndroidTextureThread > getSurfaceThread()
AndroidSurfaceTexture * surfaceTexture() override
QVideoSink * surface() const
bool shouldTextureBeUpdated() const
~QAndroidTextureVideoOutput() override
QAndroidVideoFrameTextures(QRhi *rhi, QSize size, quint64 handle)
QRhiTexture * texture(uint plane) const override
std::shared_ptr< QRhi > m_guardRhi
TextureCopy(QRhi *rhi, QRhiTexture *externalTex)
std::unique_ptr< QRhiTexture > copyExternalTexture(QSize size, const QMatrix4x4 &externalTexMatrix)
static QMatrix4x4 extTransformMatrix(AndroidSurfaceTexture *surfaceTexture)
static std::unique_ptr< QRhiGraphicsPipeline > newGraphicsPipeline(QRhi *rhi, QRhiShaderResourceBindings *shaderResourceBindings, QRhiRenderPassDescriptor *renderPassDescriptor, QShader vertexShader, QShader fragmentShader)
static const float g_quad[]