1 | // Copyright (C) 2024 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 QFFMPEGMUXER_P_H |
4 | #define QFFMPEGMUXER_P_H |
5 | |
6 | #include "qffmpegthread_p.h" |
7 | #include "qffmpeg_p.h" |
8 | #include <queue> |
9 | |
10 | QT_BEGIN_NAMESPACE |
11 | |
12 | namespace QFFmpeg { |
13 | |
14 | class RecordingEngine; |
15 | |
16 | class Muxer : public ConsumerThread |
17 | { |
18 | public: |
19 | Muxer(RecordingEngine *encoder); |
20 | |
21 | void addPacket(AVPacketUPtr packet); |
22 | |
23 | private: |
24 | AVPacketUPtr takePacket(); |
25 | |
26 | bool init() override; |
27 | void cleanup() override; |
28 | bool hasData() const override; |
29 | void processOne() override; |
30 | |
31 | private: |
32 | std::queue<AVPacketUPtr> m_packetQueue; |
33 | |
34 | RecordingEngine *m_encoder; |
35 | }; |
36 | |
37 | } // namespace QFFmpeg |
38 | |
39 | QT_END_NAMESPACE |
40 | |
41 | #endif |
42 |