1// Copyright (C) 2021 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 QGSTREAMERVIDEOOUTPUT_P_H
5#define QGSTREAMERVIDEOOUTPUT_P_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 <QtCore/qobject.h>
19#include <private/qtmultimediaglobal_p.h>
20#include <private/qmultimediautils_p.h>
21#include <qgst_p.h>
22#include <qgstpipeline_p.h>
23#include <qwaitcondition.h>
24#include <qmutex.h>
25#include <qpointer.h>
26#include <qgstreamervideosink_p.h>
27
28QT_BEGIN_NAMESPACE
29
30class QVideoSink;
31
32class Q_MULTIMEDIA_EXPORT QGstreamerVideoOutput : public QObject
33{
34 Q_OBJECT
35
36public:
37 static QMaybe<QGstreamerVideoOutput *> create(QObject *parent = nullptr);
38 ~QGstreamerVideoOutput();
39
40 void setVideoSink(QVideoSink *sink);
41 QGstreamerVideoSink *gstreamerVideoSink() const { return m_videoSink; }
42
43 void setPipeline(const QGstPipeline &pipeline);
44
45 QGstElement gstElement() const { return gstVideoOutput; }
46 void linkSubtitleStream(QGstElement subtitleSrc);
47 void unlinkSubtitleStream();
48
49 void setIsPreview();
50 void flushSubtitles();
51
52private:
53 QGstreamerVideoOutput(QGstElement videoConvert, QGstElement videoSink, QObject *parent);
54
55 void doLinkSubtitleStream();
56
57 QPointer<QGstreamerVideoSink> m_videoSink;
58 bool isFakeSink = true;
59
60 // Gst elements
61 QGstPipeline gstPipeline;
62
63 QGstBin gstVideoOutput;
64 QGstElement videoQueue;
65 QGstElement videoConvert;
66 QGstElement videoSink;
67
68 QGstElement subtitleSrc;
69 QGstElement subtitleSink;
70};
71
72QT_END_NAMESPACE
73
74#endif
75

source code of qtmultimedia/src/plugins/multimedia/gstreamer/common/qgstreamervideooutput_p.h