| 1 | // Copyright (C) 2022 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 | #include "qplatformvideodevices_p.h" |
| 5 | |
| 6 | QT_BEGIN_NAMESPACE |
| 7 | |
| 8 | QPlatformVideoDevices::QPlatformVideoDevices(QPlatformMediaIntegration *integration) |
| 9 | : m_integration(integration) |
| 10 | { |
| 11 | qRegisterMetaType<PrivateTag>(); // for queued connections |
| 12 | } |
| 13 | |
| 14 | QPlatformVideoDevices::~QPlatformVideoDevices() = default; |
| 15 | |
| 16 | void QPlatformVideoDevices::onVideoInputsChanged() { |
| 17 | m_videoInputs.reset(); |
| 18 | emit videoInputsChanged(PrivateTag{}); |
| 19 | } |
| 20 | |
| 21 | void QPlatformVideoDevices::updateVideoInputsCache() |
| 22 | { |
| 23 | if (m_videoInputs.update(value: findVideoInputs())) |
| 24 | emit videoInputsChanged(PrivateTag{}); |
| 25 | } |
| 26 | |
| 27 | QList<QCameraDevice> QPlatformVideoDevices::videoInputs() const { |
| 28 | return m_videoInputs.ensure(creator: [this]() { |
| 29 | return findVideoInputs(); |
| 30 | }); |
| 31 | } |
| 32 | |
| 33 | QT_END_NAMESPACE |
| 34 | |
| 35 | #include "moc_qplatformvideodevices_p.cpp" |
| 36 |
