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
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
17#include <QtCore/qatomic.h>
18#include <QtCore/qthread.h>
19#include <QtMultimedia/qmediaplayer.h>
20#include <QtFFmpegMediaPluginImpl/private/qffmpegplaybackenginedefs_p.h>
21
22#include <chrono>
23
24QT_BEGIN_NAMESPACE
25
26class QTimer;
27
28namespace QFFmpeg {
29
31{
33public:
36 using Id = quint64;
37
39
41
42 bool isPaused() const;
43
44 bool isAtEnd() const;
45
46 void kill();
47
48 void setPaused(bool isPaused);
49
50 Id id() const;
51
53 void atEnd();
54
55 void error(QMediaPlayer::Error, const QString &errorString);
56
57protected:
58 QTimer &timer();
59
60 void scheduleNextStep(bool allowDoImmediatelly = true);
61
62 virtual void onPauseChanged();
63
64 virtual bool canDoNextStep() const;
65
66 virtual std::chrono::milliseconds timerInterval() const;
67
68 void setAtEnd(bool isAtEnd);
69
70 virtual void doNextStep() { }
71
72private slots:
73 void onTimeout();
74
75private:
76 std::unique_ptr<QTimer> m_timer;
77
78 QAtomicInteger<bool> m_paused = true;
79 QAtomicInteger<bool> m_atEnd = false;
80 QAtomicInteger<bool> m_deleting = false;
81 const Id m_id;
82};
83} // namespace QFFmpeg
84
85QT_END_NAMESPACE
86
87#endif // QFFMPEGPLAYBACKENGINEOBJECT_P_H
void error(QMediaPlayer::Error, const QString &errorString)
void scheduleNextStep(bool allowDoImmediatelly=true)
virtual std::chrono::milliseconds timerInterval() const
static QAtomicInteger< PlaybackEngineObject::Id > PersistentId
std::conditional_t< QT_FFMPEG_AVIO_WRITE_CONST, const uint8_t *, uint8_t * > AvioWriteBufferType