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//
8// W A R N I N G
9// -------------
10//
11// This file is part of the QtMM GStreamer API, with limited compatibility guarantees.
12// Usage of this API may make your code source and binary incompatible with future versions of Qt.
13//
14
15#include <QtCore/qobject.h>
16#include <QtCore/qstring.h>
17#include <QtMultimedia/qtmultimediaglobal.h>
18
19// NOLINTBEGIN (bugprone-reserved-identifier)
20typedef struct _GstElement GstElement;
21// NOLINTEND (bugprone-reserved-identifier)
22
23QT_BEGIN_NAMESPACE
24
25class QPlatformCamera;
27class QMediaCaptureSession;
28
29class Q_MULTIMEDIA_EXPORT QGStreamerVideoSource : public QObject
30{
31 Q_OBJECT
32 Q_PROPERTY(bool active READ isActive WRITE setActive NOTIFY activeChanged)
33 Q_PROPERTY(QString gstBinDescription READ gstBinDescription CONSTANT)
34
35public:
36 explicit QGStreamerVideoSource(const QString &gstBinDescription, QObject *parent = nullptr);
37 explicit QGStreamerVideoSource(GstElement *gstElement, QObject *parent = nullptr);
38 ~QGStreamerVideoSource() override;
39
40 bool isActive() const;
41 QString gstBinDescription() const;
42 GstElement *gstElement() const;
43 QMediaCaptureSession *captureSession() const;
44
45public Q_SLOTS:
46 void setActive(bool active);
47 void start() { setActive(true); }
48 void stop() { setActive(false); }
49
50Q_SIGNALS:
51 void activeChanged(bool active);
52
53protected:
54 explicit QGStreamerVideoSource(QObject *parent);
55
56private:
57 QPlatformCamera *platformVideoSource() const;
58
59 void setCaptureSession(QMediaCaptureSession *session);
60
61private:
62 Q_DISABLE_COPY(QGStreamerVideoSource)
63 Q_DECLARE_PRIVATE(QGStreamerVideoSource)
64 friend class QMediaCaptureSession;
65};
66
67QT_END_NAMESPACE
68
69#endif // QGSTREAMERVIDEOSOURCE_H
struct _GstElement GstElement
Combined button and popup list for selecting options.