Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
qffmpegthread_p.h
Go to the documentation of this file.
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#ifndef QFFMPEGTHREAD_P_H
4#define QFFMPEGTHREAD_P_H
5
6//
7// W A R N I N G
8// -------------
9//
10// This file is not part of the Qt API. It exists purely as an
11// implementation detail. This header file may change from version to
12// version without notice, or even be removed.
13//
14// We mean it.
15//
16
17#include <private/qtmultimediaglobal_p.h>
18
19#include <qmutex.h>
20#include <qwaitcondition.h>
21#include <qthread.h>
22
24
25class QAudioSink;
26
27namespace QFFmpeg
28{
29
30class Thread : public QThread
31{
32public:
33 mutable QMutex mutex;
35private:
37
38protected:
40
41public:
42 // public API is thread-safe
43
44 void kill();
45 virtual void killHelper() {}
46
47 void wake() {
48 condition.wakeAll();
49 }
50
51protected:
52 virtual void init() {}
53 virtual void cleanup() {}
54 // loop() should never block, all blocking has to happen in shouldWait()
55 virtual void loop() = 0;
56 virtual bool shouldWait() const { return false; }
57
58private:
59 void maybePause();
60
61 void run() override;
62};
63
64}
65
67
68#endif
\inmodule QtCore
Definition qatomic.h:18
The QAudioSink class provides an interface for sending audio data to an audio output device.
Definition qaudiosink.h:24
virtual void cleanup()
virtual void init()
void run() override
virtual void loop()=0
virtual void killHelper()
virtual bool shouldWait() const
QAtomicInteger< bool > exit
\inmodule QtCore
Definition qmutex.h:285
Combined button and popup list for selecting options.
GLenum condition
long long qint64
Definition qtypes.h:55