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
qffmpegstreamdecoder_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 QFFMPEGSTREAMDECODER_P_H
4#define QFFMPEGSTREAMDECODER_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#include <QtFFmpegMediaPluginImpl/private/qffmpegplaybackengineobject_p.h>
17#include <QtFFmpegMediaPluginImpl/private/qffmpegframe_p.h>
18#include <QtFFmpegMediaPluginImpl/private/qffmpegpacket_p.h>
19#include <QtFFmpegMediaPluginImpl/private/qffmpegplaybackutils_p.h>
20#include <QtMultimedia/private/qplatformmediaplayer_p.h>
21
22#include <QtCore/qqueue.h>
23
24#include <optional>
25
26QT_BEGIN_NAMESPACE
27
28namespace QFFmpeg {
29
31{
33public:
35
37
39
40 // Maximum number of frames that we are allowed to keep in render queue
41 static qint32 maxQueueSize(QPlatformMediaPlayer::TrackType type);
42
43public slots:
44
45 void decode(Packet);
46
48
49 void onFrameProcessed(Frame frame);
50
53
55
56protected:
57 bool canDoNextStep() const override;
58
59 void doNextStep() override;
60
61private:
62 void decodeMedia(Packet);
63
64 void decodeSubtitle(Packet);
65
66 void onFrameFound(Frame frame);
67
68 int sendAVPacket(Packet);
69
70 void receiveAVFrames(bool flushPacket = false);
71
72private:
73 CodecContext m_codecContext;
74 TrackPosition m_absSeekPos = TrackPosition(0);
75 const QPlatformMediaPlayer::TrackType m_trackType;
76
77 qint32 m_pendingFramesCount = 0;
78
79 LoopOffset m_offset;
80
81 QQueue<Packet> m_packets;
82};
83
84} // namespace QFFmpeg
85
86QT_END_NAMESPACE
87
88#endif // QFFMPEGSTREAMDECODER_P_H
bool canDoNextStep() const override
static qint32 maxQueueSize(QPlatformMediaPlayer::TrackType type)
void onFrameProcessed(Frame frame)
void packetProcessed(Packet)
QPlatformMediaPlayer::TrackType trackType() const
std::conditional_t< QT_FFMPEG_AVIO_WRITE_CONST, const uint8_t *, uint8_t * > AvioWriteBufferType
#define qCDebug(category,...)
#define Q_STATIC_LOGGING_CATEGORY(name,...)