Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
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 <QtMultimedia/qvideosink.h>
19#include <QtMultimedia/private/qplatformvideosink_p.h>
20#include <QtMultimedia/private/qthreadlocalrhi_p.h>
21
22#include <common/qgstvideorenderersink_p.h>
23#include <common/qgstpipeline_p.h>
24
26
27using QGstreamerPluggableVideoSink = QRhiVideoSink;
28
30{
32 friend class QRhiVideoSink;
33
34public:
35 explicit QGstreamerRelayVideoSink(QObject *parent = nullptr);
37
38 QRhi *rhi() const { return m_rhi ? m_rhi : qEnsureThreadLocalRhi(); }
39
41
42 GstContext *gstGlDisplayContext() const { return m_gstGlDisplayContext.get(); }
43 GstContext *gstGlLocalContext() const { return m_gstGlLocalContext.get(); }
44
45 void setActive(bool);
46 void setAsync(bool);
47
48 void connectPluggableVideoSink(QGstreamerPluggableVideoSink *pluggableSink);
50 void setVideoFrame(const QVideoFrame &frame);
51 void setSubtitleText(const QString &subtitleText);
52 void setNativeSize(QSize size);
53
56 void videoFrameChanged(const QVideoFrame &frame);
57 void subtitleTextChanged(const QString &subtitleText);
58 void nativeSizeChanged(QSize size);
59
60private:
61 void createQtSink();
62 void updateSinkElement(QGstVideoRendererSinkElement newSink);
63
64 void unrefGstContexts();
65 void updateGstContexts();
66
67 void renderingRhiChanged(QRhi *rhi);
68
69 QGstBin m_sinkBin;
70 QGstElement m_gstPreprocess;
71 QGstElement m_gstCapsFilter;
72 QGstElement m_gstVideoSink;
74
75 QRhi *m_rhi = nullptr;
76 bool m_isActive = true;
77 bool m_sinkIsAsync = true;
78
79 QGstContextHandle m_gstGlLocalContext;
80 QGstContextHandle m_gstGlDisplayContext;
81
82 QVideoFrame m_currentVideoFrame;
83 QString m_currentSubtitleText;
84 QSize m_currentNativeSize;
85
86 QGstreamerPluggableVideoSink *m_pluggableVideoSink = nullptr;
87 QMetaObject::Connection m_rhiConnection;
88};
89
90QT_END_NAMESPACE
91
92#endif
QGstStructureView at(int index) const
Definition qgst.cpp:625
void removeFromParent()
Definition qgst.cpp:1344
bool syncStateWithParent()
Definition qgst.cpp:1161
QGstPad sink() const
Definition qgst.cpp:1113
static QGstElement createFromPipelineDescription(const char *)
Definition qgst.cpp:1061
bool link(const QGstPad &sink) const
Definition qgst.cpp:908
QGstCaps queryCaps() const
Definition qgst.cpp:867
QGString streamId() const
Definition qgst.cpp:879
QGstElement gstElement() const
QUrl media() const override
bool processBusMessage(const QGstreamerMessage &message) override
PitchCompensationAvailability pitchCompensationAvailability() const override
void setPosition(qint64 pos) override
qreal playbackRate() const override
void setMedia(const QUrl &, QIODevice *) override
qint64 duration() const override
bool pitchCompensation() const override
void setPlaybackRate(qreal rate) override
QMediaTimeRange availablePlaybackRanges() const override
void setVideoSink(QVideoSink *sink) override
int trackCount(TrackType) override
const QGstPipeline & pipeline() const
float bufferProgress() const override
QMediaMetaData trackMetaData(TrackType, int) override
void setActiveTrack(TrackType, int) override
void setAudioOutput(QPlatformAudioOutput *output) override
const QIODevice * mediaStream() const override
int activeTrack(TrackType) override
QMediaMetaData metaData() const override
static q23::expected< QPlatformMediaPlayer *, QString > create(QMediaPlayer *parent=nullptr)
bool streamPlaybackSupported() const override
bool canPlayQrc() const override
QGstreamerRelayVideoSink(QObject *parent=nullptr)
void subtitleTextChanged(const QString &subtitleText)
void setVideoFrame(const QVideoFrame &frame)
void videoFrameChanged(const QVideoFrame &frame)
void setSubtitleText(const QString &subtitleText)
void connectPluggableVideoSink(QGstreamerPluggableVideoSink *pluggableSink)
void nativeSizeChanged(QSize size)
GstContext * gstGlDisplayContext() const
GstContext * gstGlLocalContext() const
void setVideoSink(QGstreamerRelayVideoSink *sink)
QGstreamerRelayVideoSink * gstreamerVideoSink() const
Combined button and popup list for selecting options.
std::optional< QGstreamerMediaPlayer::TrackType > toTrackType(const QGstCaps &caps)
void setSeekAccurate(T *config, gboolean accurate)
QT_BEGIN_NAMESPACE Q_STATIC_LOGGING_CATEGORY(lcSynthesizedIterableAccess, "qt.iterable.synthesized", QtWarningMsg)
QGstPlayMessageAdaptor(const QGstreamerMessage &m)