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/qffmpeg_p.h>
17#include <QtFFmpegMediaPluginImpl/private/qffmpegplaybackengineobject_p.h>
18#include <QtFFmpegMediaPluginImpl/private/qffmpegframe_p.h>
19#include <QtFFmpegMediaPluginImpl/private/qffmpegpacket_p.h>
20#include <QtFFmpegMediaPluginImpl/private/qffmpegplaybackutils_p.h>
21#include <QtMultimedia/private/qplatformmediaplayer_p.h>
22
23#include <QtCore/qqueue.h>
24
25QT_BEGIN_NAMESPACE
26
27namespace QFFmpeg {
28
30{
32public:
35
37
38 void seek(quint64 sessionID, TrackPosition pos, const LoopOffset &offset);
39
41
42 // Maximum number of frames that we are allowed to keep in render queue
43 static qint32 maxQueueSize(QPlatformMediaPlayer::TrackType type);
44
45public slots:
46
47 void decode(Packet);
48
49 void onFinalPacketReceived(PlaybackEngineObjectID sourceID);
50
51 void onFrameProcessed(const Frame &frame);
52
55
57
58protected:
59 bool canDoNextStep() const override;
60
61 void doNextStep() override;
62
63private:
64 void decodeMedia(const Packet &packet);
65
66 void decodeSubtitle(const Packet &packet);
67
68 void onFrameFound(const Frame &frame);
69
70 int sendAVPacket(const Packet &packet);
71
72 void receiveAVFrames(bool flushPacket = false);
73
74private:
75 CodecContext m_codecContext;
76
77 const QPlatformMediaPlayer::TrackType m_trackType;
78
79 struct SessionContext
80 {
81 TrackPosition absSeekPos = TrackPosition(0);
82 qint32 pendingFramesCount = 0;
83 LoopOffset offset = {};
84 QQueue<Packet> packets = {};
85 };
86
87 SessionContext m_sessionCtx;
88};
89
90QString subtitleTextFromAVSubtitle(const AVSubtitle &subtitle);
91
92} // namespace QFFmpeg
93
94QT_END_NAMESPACE
95
96#endif // QFFMPEGSTREAMDECODER_P_H
bool canDoNextStep() const override
static qint32 maxQueueSize(QPlatformMediaPlayer::TrackType type)
void onFrameProcessed(const Frame &frame)
void onFinalPacketReceived(PlaybackEngineObjectID sourceID)
void packetProcessed(Packet)
void seek(quint64 sessionID, TrackPosition pos, const LoopOffset &offset)
QPlatformMediaPlayer::TrackType trackType() const
QT_MANGLE_NAMESPACE(QMacScreenCaptureStreamDelegate) QMacScreenCaptureStreamDelegate
QString subtitleTextFromAVSubtitle(const AVSubtitle &subtitle)
static QString extractSubtitleText(const AVSubtitleRect &r)
Combined button and popup list for selecting options.