Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qmediaframeinput_p.h
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
4#ifndef QMEDIAFRAMEINPUT_P_H
5#define QMEDIAFRAMEINPUT_P_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
19#include <QtCore/private/qobject_p.h>
20
22
24{
25public:
27
28 QMediaCaptureSession *captureSession() const { return m_captureSession; }
29
30protected:
31 template <typename Sender>
32 bool sendMediaFrame(Sender &&sender)
33 {
34 if (!m_canSendMediaFrame)
35 return false;
36
37 sender();
38 postponeCheckReadyToSend();
39 return true;
40 }
41
42 template <typename Sender, typename Signal>
47
48 template <typename Sender, typename Signal>
53
55
56private:
57 void postponeCheckReadyToSend();
58
59 virtual bool checkIfCanSendMediaFrame() const = 0;
60
61 virtual void emitReadyToSendMediaFrame() = 0;
62
64 QMediaCaptureSession *currentSession) = 0;
65
66private:
67 QMediaCaptureSession *m_captureSession = nullptr;
68 bool m_canSendMediaFrame = false;
69 bool m_postponeReadyToSendCheckRun = false;
70};
71
73
74#endif // QMEDIAFRAMEINPUT_P_H
The QMediaCaptureSession class allows capturing of audio and video content.
void addUpdateSignal(Sender sender, Signal signal)
virtual void updateCaptureSessionConnections(QMediaCaptureSession *prevSession, QMediaCaptureSession *currentSession)=0
virtual bool checkIfCanSendMediaFrame() const =0
virtual void emitReadyToSendMediaFrame()=0
void setCaptureSession(QMediaCaptureSession *session)
void removeUpdateSignal(Sender sender, Signal signal)
bool sendMediaFrame(Sender &&sender)
QMediaCaptureSession * captureSession() const
static QMetaObject::Connection connect(const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const typename QtPrivate::FunctionPointer< Func2 >::Object *receiverPrivate, Func2 slot, Qt::ConnectionType type=Qt::AutoConnection)
Definition qobject_p.h:299
auto signal
Combined button and popup list for selecting options.
myObject disconnect()
[26]