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:
36
38
39 void seek(quint64 sessionID, TrackPosition pos, const LoopOffset &offset);
40
42
43 // Maximum number of frames that we are allowed to keep in render queue
44 static qint32 maxQueueSize(QPlatformMediaPlayer::TrackType type);
45
46public slots:
47
48 void decode(Packet);
49
50 void onFinalPacketReceived(PlaybackEngineObjectID sourceID);
51
52 void onFrameProcessed(Frame frame);
53
56
58
59protected:
60 bool canDoNextStep() const override;
61
62 void doNextStep() override;
63
64private:
65 void decodeMedia(const Packet &packet);
66
67 void decodeSubtitle(const Packet &packet);
68
69 void onFrameFound(Frame frame);
70
71 int sendAVPacket(const Packet &packet);
72
73 void receiveAVFrames(bool flushPacket = false);
74
75private:
76 CodecContext m_codecContext;
77
78 const QPlatformMediaPlayer::TrackType m_trackType;
79
80 struct SessionContext
81 {
82 TrackPosition absSeekPos = TrackPosition(0);
83 qint32 pendingFramesCount = 0;
84 LoopOffset offset = {};
85 QQueue<Packet> packets = {};
86 };
87
88 SessionContext m_sessionCtx;
89};
90
91} // namespace QFFmpeg
92
93QT_END_NAMESPACE
94
95#endif // QFFMPEGSTREAMDECODER_P_H
bool canDoNextStep() const override
static qint32 maxQueueSize(QPlatformMediaPlayer::TrackType type)
void onFinalPacketReceived(PlaybackEngineObjectID sourceID)
void packetProcessed(Packet)
void seek(quint64 sessionID, TrackPosition pos, const LoopOffset &offset)
QPlatformMediaPlayer::TrackType trackType() const
std::conditional_t< QT_FFMPEG_AVIO_WRITE_CONST, const uint8_t *, uint8_t * > AvioWriteBufferType
Combined button and popup list for selecting options.
#define qCDebug(category,...)
#define Q_STATIC_LOGGING_CATEGORY(name,...)