4#ifndef QANDROIDVIDEOOUTPUT_H
5#define QANDROIDVIDEOOUTPUT_H
20#include <qreadwritelock.h>
21#include <qabstractvideobuffer.h>
22#include <qmatrix4x4.h>
23#include <qoffscreensurface.h>
53 QAndroidVideoOutput(QObject *parent) : QObject(parent) { }
64 QVideoSink *
surface()
const {
return m_sink; }
80 void startNewSurfaceThread();
81 QVideoSink *m_sink =
nullptr;
83 bool m_surfaceCreatedWithoutRhi =
false;
85 std::shared_ptr<AndroidTextureThread> m_surfaceThread;
90Q_DECLARE_METATYPE(QList<QRhiResource *>)
91Q_DECLARE_METATYPE(QRhi*)
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)
Combined button and popup list for selecting options.
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[]