Qt 6.x
The Qt SDK
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 "qtimer.h"
20
21#include <atomic>
22
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
37 bool isPaused() const;
38
39 bool isAtEnd() const;
40
41 void kill();
42
43 void setPaused(bool isPaused);
44
45 Id id() const;
46
48 void atEnd();
49
50 void error(int code, const QString &errorString);
51
52protected:
53 QTimer &timer();
54
55 void scheduleNextStep(bool allowDoImmediatelly = true);
56
57 virtual void onPauseChanged();
58
59 virtual bool canDoNextStep() const;
60
61 virtual int timerInterval() const;
62
63 void setAtEnd(bool isAtEnd);
64
65 virtual void doNextStep() { }
66
67private:
68 QTimer *m_timer = nullptr;
69
70 std::atomic_bool m_paused = true;
71 std::atomic_bool m_atEnd = false;
72 std::atomic_bool m_deleting = false;
73 const Id m_id;
74};
75} // namespace QFFmpeg
76
78
79#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:90
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:127
\inmodule QtCore
Definition qtimer.h:20
Combined button and popup list for selecting options.
#define Q_OBJECT
#define signals
unsigned long long quint64
Definition qtypes.h:56