Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qandroidvideooutput_p.h
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#ifndef QANDROIDVIDEOOUTPUT_H
5#define QANDROIDVIDEOOUTPUT_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include <qsize.h>
19#include <qmutex.h>
20#include <qreadwritelock.h>
21#include <private/qabstractvideobuffer_p.h>
22#include <qmatrix4x4.h>
23#include <qoffscreensurface.h>
24#include <rhi/qrhi.h>
25
27
30class QVideoSink;
31
33{
35public:
37
38 virtual AndroidSurfaceTexture *surfaceTexture() { return 0; }
39 virtual AndroidSurfaceHolder *surfaceHolder() { return 0; }
40
41 virtual bool isReady() { return true; }
42
43 virtual void setVideoSize(const QSize &) { }
44 virtual void start() { }
45 virtual void stop() { }
46 virtual void reset() { }
47 virtual QSize getVideoSize() const { return QSize(0, 0); }
48
50 void readyChanged(bool);
51
52protected:
54};
55
58{
60public:
63
64 QVideoSink *surface() const { return m_sink; }
65 bool shouldTextureBeUpdated() const;
66
68
69 void setVideoSize(const QSize &) override;
70 void stop() override;
71 void reset() override;
72 QSize getVideoSize() const override { return m_nativeSize; }
73
74 void setSubtitle(const QString &subtitle);
75 std::shared_ptr<AndroidTextureThread> getSurfaceThread() { return m_surfaceThread; }
76private Q_SLOTS:
77 void newFrame(const QVideoFrame &);
78
79private:
80 void startNewSurfaceThread();
81 QVideoSink *m_sink = nullptr;
82 QSize m_nativeSize;
83 bool m_surfaceCreatedWithoutRhi = false;
84
85 std::shared_ptr<AndroidTextureThread> m_surfaceThread;
86};
87
89
90Q_DECLARE_METATYPE(QList<QRhiResource *>)
92
93#endif // QANDROIDVIDEOOUTPUT_H
QSize getVideoSize() const override
void setSubtitle(const QString &subtitle)
QAndroidTextureVideoOutput(QVideoSink *sink, QObject *parent=0)
void setVideoSize(const QSize &) override
std::shared_ptr< AndroidTextureThread > getSurfaceThread()
AndroidSurfaceTexture * surfaceTexture() override
virtual AndroidSurfaceHolder * surfaceHolder()
QAndroidVideoOutput(QObject *parent)
virtual void setVideoSize(const QSize &)
void readyChanged(bool)
virtual QSize getVideoSize() const
virtual AndroidSurfaceTexture * surfaceTexture()
\inmodule QtCore
Definition qobject.h:103
QObject * parent() const
Returns a pointer to the parent object.
Definition qobject.h:346
\inmodule QtGuiPrivate \inheaderfile rhi/qrhi.h
Definition qrhi.h:1804
\inmodule QtCore
Definition qsize.h:25
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
The QVideoFrame class represents a frame of video data.
Definition qvideoframe.h:27
The QVideoSink class represents a generic sink for video data.
Definition qvideosink.h:22
Combined button and popup list for selecting options.
#define Q_DECLARE_METATYPE(TYPE)
Definition qmetatype.h:1525
GLsizei GLenum GLboolean sink
#define Q_OBJECT
#define Q_SLOTS
#define Q_SIGNALS