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
qmediaframeinput.cpp
Go to the documentation of this file.
1// Copyright (C) 2024 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
5
7
8void QMediaFrameInputPrivate::setCaptureSession(QMediaCaptureSession *session)
9{
10 if (session == m_captureSession)
11 return;
12
13 auto prevSession = std::exchange(m_captureSession, session);
14 updateCaptureSessionConnections(prevSession, session);
16}
17
19{
20 const bool canSendMediaFrame = m_captureSession && checkIfCanSendMediaFrame();
21 if (m_canSendMediaFrame != canSendMediaFrame) {
22 m_canSendMediaFrame = canSendMediaFrame;
23 if (m_canSendMediaFrame)
25 }
26}
27
28void QMediaFrameInputPrivate::postponeCheckReadyToSend()
29{
30 if (m_canSendMediaFrame && !m_postponeReadyToSendCheckRun) {
31 m_postponeReadyToSendCheckRun = true;
32 QMetaObject::invokeMethod(
33 q_ptr,
34 [this]() {
35 m_postponeReadyToSendCheckRun = false;
36 if (m_canSendMediaFrame)
37 emitReadyToSendMediaFrame();
38 },
39 Qt::QueuedConnection);
40 }
41}
42
43QT_END_NAMESPACE
virtual void emitReadyToSendMediaFrame()=0