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
qquickgstreamervideosource.cpp
Go to the documentation of this file.
1// Copyright (C) 2026 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
5
6#include <QtMultimedia/private/qgstreamervideosource_p.h>
7
8#include <QtCore/qdebug.h>
9
11
12QQuickGStreamerVideoSource::QQuickGStreamerVideoSource(QObject *parent)
13 : QGStreamerVideoSource(parent)
14{
15}
16
17bool QQuickGStreamerVideoSource::qmlIsActive() const
18{
19 return m_pendingProperties ? m_pendingProperties->active : isActive();
20}
21
22void QQuickGStreamerVideoSource::qmlSetActive(bool active)
23{
24 if (!m_pendingProperties)
25 QGStreamerVideoSource::setActive(active);
26 else if (std::exchange(m_pendingProperties->active, active) != active)
27 emit activeChanged(active);
28}
29
30void QQuickGStreamerVideoSource::setQmlGstBinDescription(QString gstBinDescription)
31{
32 if (!m_pendingProperties) {
33 // TODO: maybe handle exotic case when the required property is
34 // set more then once during component's initialization.
35 qWarning() << "GstBin's description must be set only once";
36 return;
37 }
38
39 auto properties = std::move(m_pendingProperties);
40
41 auto *sourcePrivate = QGStreamerVideoSourcePrivate::get(this);
42 sourcePrivate->createPlatformCamera(this, std::move(gstBinDescription), properties->active);
43}
44
45QT_END_NAMESPACE
46
47#include "moc_qquickgstreamervideosource_p.cpp"
Combined button and popup list for selecting options.