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
qffmpegplaybackengineobject_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 QFFMPEGPLAYBACKENGINEOBJECT_P_H
4#define QFFMPEGPLAYBACKENGINEOBJECT_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
18#include "qthread.h"
19#include "qatomic.h"
20
22
23class QTimer;
24
25namespace QFFmpeg {
26
28{
30public:
31 using TimePoint = std::chrono::steady_clock::time_point;
32 using TimePointOpt = std::optional<TimePoint>;
33 using Id = quint64;
34
36
38
39 bool isPaused() const;
40
41 bool isAtEnd() const;
42
43 void kill();
44
45 void setPaused(bool isPaused);
46
47 Id id() const;
48
50 void atEnd();
51
52 void error(int code, const QString &errorString);
53
54protected:
55 QTimer &timer();
56
57 void scheduleNextStep(bool allowDoImmediatelly = true);
58
59 virtual void onPauseChanged();
60
61 virtual bool canDoNextStep() const;
62
63 virtual int timerInterval() const;
64
65 void setAtEnd(bool isAtEnd);
66
67 virtual void doNextStep() { }
68
69private slots:
70 void onTimeout();
71
72private:
73 std::unique_ptr<QTimer> m_timer;
74
75 QAtomicInteger<bool> m_paused = true;
76 QAtomicInteger<bool> m_atEnd = false;
77 QAtomicInteger<bool> m_deleting = false;
78 const Id m_id;
79};
80} // namespace QFFmpeg
81
83
84#endif // QFFMPEGPLAYBACKENGINEOBJECT_P_H
void error(int code, const QString &errorString)
void scheduleNextStep(bool allowDoImmediatelly=true)
std::chrono::steady_clock::time_point TimePoint
\inmodule QtCore
Definition qobject.h:103
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
\inmodule QtCore
Definition qtimer.h:20
Combined button and popup list for selecting options.
#define Q_OBJECT
#define slots
#define signals
unsigned long long quint64
Definition qtypes.h:61