| 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 | #include <QtMultimedia/qaudiodevice.h> | 
| 5 | #include <QtMultimedia/qaudioinput.h> | 
| 6 | #include <QtMultimedia/qmediacapturesession.h> | 
| 7 | #include <QtMultimedia/private/qplatformcamera_p.h> | 
| 8 | #include <QtMultimedia/private/qplatformmediacapture_p.h> | 
| 9 | #include <QtMultimedia/private/qmediacapturesession_p.h> | 
| 10 | #include <QtMultimedia/private/qplatformsurfacecapture_p.h> | 
| 11 | #include <QtMultimedia/private/qplatformvideoframeinput_p.h> | 
| 12 | #include <QtMultimedia/private/qtmultimediaglobal_p.h> | 
| 13 | |
| 14 | QT_BEGIN_NAMESPACE | 
| 15 | |
| 16 | QPlatformMediaCaptureSession::~QPlatformMediaCaptureSession() = default; | 
| 17 | |
| 18 | std::vector<QPlatformVideoSource *> QPlatformMediaCaptureSession::activeVideoSources() | 
| 19 | { | 
| 20 | std::vector<QPlatformVideoSource *> result; | 
| 21 | |
| 22 | auto checkSource = [&result](QPlatformVideoSource *source) { | 
| 23 | if (source && source->isActive()) | 
| 24 | result.push_back(x: source); | 
| 25 | }; | 
| 26 | |
| 27 | checkSource(videoFrameInput()); | 
| 28 | checkSource(camera()); | 
| 29 | checkSource(screenCapture()); | 
| 30 | checkSource(windowCapture()); | 
| 31 | |
| 32 | return result; | 
| 33 | } | 
| 34 | |
| 35 | QT_END_NAMESPACE | 
| 36 | |
| 37 | #include "moc_qplatformmediacapture_p.cpp" | 
| 38 | 
