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 QGSTREAMERMEDIADEVICES_H
5#define QGSTREAMERMEDIADEVICES_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 <private/qplatformvideodevices_p.h>
19#include <gst/gst.h>
20#include <qaudiodevice.h>
21#include <vector>
22
23#include <common/qgst_handle_types_p.h>
24#include <common/qgst_bus_observer_p.h>
25
26QT_BEGIN_NAMESPACE
27
28class QGstreamerVideoDevices final : public QPlatformVideoDevices,
29 private QGstreamerBusMessageFilter
30{
31public:
32 explicit QGstreamerVideoDevices(QPlatformMediaIntegration *integration);
33 ~QGstreamerVideoDevices() override;
34
35 GstDevice *videoDevice(const QByteArray &id) const;
36
37 void addDevice(QGstDeviceHandle);
38 void removeDevice(QGstDeviceHandle);
39
40protected:
41 QList<QCameraDevice> findVideoInputs() const override;
42
43private:
44 bool processBusMessage(const QGstreamerMessage &message) override;
45
46 struct QGstRecordDevice
47 {
48 QGstDeviceHandle gstDevice;
49 QByteArray id;
50 };
51
52 quint64 m_idGenerator = 0;
53 std::vector<QGstRecordDevice> m_videoSources;
54
55 QGstDeviceMonitorHandle m_deviceMonitor;
56 QGstBusObserver m_busObserver;
57};
58
59QT_END_NAMESPACE
60
61#endif
62

Provided by KDAB

Privacy Policy
Start learning QML with our Intro Training
Find out more

source code of qtmultimedia/src/plugins/multimedia/gstreamer/qgstreamervideodevices_p.h