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
40
41 // Maximum number of frames that we are allowed to keep in render queue
42 static qint32 maxQueueSize(QPlatformMediaPlayer::TrackType type);
43
44public slots:
45
46 void decode(Packet);
47
48 void onFinalPacketReceived(PlaybackEngineObjectID sourceID);
49
50 void onFrameProcessed(Frame frame);
51
54
56
57protected:
58 bool canDoNextStep() const override;
59
60 void doNextStep() override;
61
62private:
63 void decodeMedia(const Packet &packet);
64
65 void decodeSubtitle(const Packet &packet);
66
67 void onFrameFound(Frame frame);
68
69 int sendAVPacket(const Packet &packet);
70
71 void receiveAVFrames(bool flushPacket = false);
72
73private:
74 CodecContext m_codecContext;
75 TrackPosition m_absSeekPos = TrackPosition(0);
76 const QPlatformMediaPlayer::TrackType m_trackType;
77
78 qint32 m_pendingFramesCount = 0;
79
80 LoopOffset m_offset;
81
82 QQueue<Packet> m_packets;
83};
84
85} // namespace QFFmpeg
86
87QT_END_NAMESPACE
88
89#endif // QFFMPEGSTREAMDECODER_P_H
bool canDoNextStep() const override
static qint32 maxQueueSize(QPlatformMediaPlayer::TrackType type)
void onFinalPacketReceived(PlaybackEngineObjectID sourceID)
void packetProcessed(Packet)
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,...)