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
qgstreamervideosink_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 QGSTREAMERVIDEOSINK_H
5#define QGSTREAMERVIDEOSINK_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 <private/qtmultimediaglobal_p.h>
19#include <private/qplatformvideosink_p.h>
20
23#include <QtGui/qcolor.h>
24#include <QtMultimedia/qvideosink.h>
25
26#if QT_CONFIG(gstreamer_gl)
27#include <gst/gl/gl.h>
28#endif
29
31class QGstreamerVideoRenderer;
32class QVideoWindow;
33
35{
37
38public:
39 explicit QGstreamerVideoSink(QVideoSink *parent = nullptr);
41
42 void setRhi(QRhi *rhi) override;
43 QRhi *rhi() const { return m_rhi; }
44
46 QGstElement subtitleSink() const { return gstSubtitleSink; }
47
48 void setPipeline(QGstPipeline pipeline);
49 bool inStoppedState() const;
50
51 GstContext *gstGlDisplayContext() const { return m_gstGlDisplayContext.get(); }
52 GstContext *gstGlLocalContext() const { return m_gstGlLocalContext.get(); }
53 Qt::HANDLE eglDisplay() const { return m_eglDisplay; }
54 QFunctionPointer eglImageTargetTexture2D() const { return m_eglImageTargetTexture2D; }
55
58
59private:
60 void createQtSink();
61 void updateSinkElement();
62
63 void unrefGstContexts();
64 void updateGstContexts();
65
66 QGstPipeline gstPipeline;
67 QGstBin sinkBin;
68 QGstElement gstQueue;
69 QGstElement gstPreprocess;
70 QGstElement gstCapsFilter;
71 QGstElement gstVideoSink;
72 QGstElement gstQtSink;
73 QGstElement gstSubtitleSink;
74
75 QRhi *m_rhi = nullptr;
76
77 Qt::HANDLE m_eglDisplay = nullptr;
78 QFunctionPointer m_eglImageTargetTexture2D = nullptr;
79
80 QGstContextHandle m_gstGlLocalContext;
81 QGstContextHandle m_gstGlDisplayContext;
82};
83
85
86#endif
QGstreamerVideoSink(QVideoSink *parent=nullptr)
GstContext * gstGlLocalContext() const
void setPipeline(QGstPipeline pipeline)
GstContext * gstGlDisplayContext() const
void setRhi(QRhi *rhi) override
QGstElement subtitleSink() const
QFunctionPointer eglImageTargetTexture2D() const
Qt::HANDLE eglDisplay() const
QObject * parent() const
Returns a pointer to the parent object.
Definition qobject.h:346
\inmodule QtGuiPrivate \inheaderfile rhi/qrhi.h
Definition qrhi.h:1804
The QVideoSink class represents a generic sink for video data.
Definition qvideosink.h:22
Combined button and popup list for selecting options.
void * HANDLE
QGstImpl::QGstMiniObjectHandleHelper< GstContext >::UniqueHandle QGstContextHandle
#define Q_OBJECT
#define Q_SIGNALS