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
qgstreamervideosource.h
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
4#ifndef QGSTREAMERVIDEOSOURCE_H
5#define QGSTREAMERVIDEOSOURCE_H
6
7#include <QtCore/qobject.h>
8#include <QtCore/qstring.h>
9#include <QtMultimedia/qtmultimediaglobal.h>
10
11// NOLINTBEGIN (bugprone-reserved-identifier)
12typedef struct _GstElement GstElement;
13// NOLINTEND (bugprone-reserved-identifier)
14
15QT_BEGIN_NAMESPACE
16
17class QPlatformCamera;
18class QGstreamerVideoSourcePrivate;
19class QMediaCaptureSession;
20
21class Q_MULTIMEDIA_EXPORT QGstreamerVideoSource : public QObject
22{
23 Q_OBJECT
24 Q_PROPERTY(bool active READ isActive WRITE setActive NOTIFY activeChanged)
25 Q_PROPERTY(QString gstBinDescription READ gstBinDescription CONSTANT)
26
27public:
28 explicit QGstreamerVideoSource(const QString &gstBinDescription, QObject *parent = nullptr);
29 explicit QGstreamerVideoSource(GstElement *gstElement, QObject *parent = nullptr);
30 ~QGstreamerVideoSource() override;
31
32 bool isActive() const;
33 QString gstBinDescription() const;
34 GstElement *gstElement() const;
35 QMediaCaptureSession *captureSession() const;
36
37public Q_SLOTS:
38 void setActive(bool active);
39 void start() { setActive(true); }
40 void stop() { setActive(false); }
41
42Q_SIGNALS:
43 void activeChanged(bool active);
44
45protected:
46 explicit QGstreamerVideoSource(QObject *parent);
47
48private:
49 QPlatformCamera *platformVideoSource() const;
50 void setCaptureSession(QMediaCaptureSession *session);
51
52 Q_DISABLE_COPY(QGstreamerVideoSource)
53 Q_DECLARE_PRIVATE(QGstreamerVideoSource)
54 friend class QMediaCaptureSession;
55};
56
57QT_END_NAMESPACE
58
59#endif // QGSTREAMERVIDEOSOURCE_H
struct _GstElement GstElement