6#include <QtCore/qloggingcategory.h>
16 setObjectName(QLatin1String(
"Muxer"));
22 QMutexLocker locker = lockLoopData();
23 m_packetQueue.push(std::move(packet));
30AVPacketUPtr
Muxer::takePacket()
32 QMutexLocker locker = lockLoopData();
33 return dequeueIfPossible(m_packetQueue);
38 qCDebug(qLcFFmpegMuxer) <<
"Muxer::init started thread.";
44 while (!m_packetQueue.empty())
47 av_interleaved_write_frame(m_encoder->avFormatContext(),
nullptr);
52 return !m_packetQueue.empty();
57 auto packet = takePacket();
75 av_interleaved_write_frame(m_encoder->avFormatContext(), packet.get());
76 Q_ASSERT(packet->buf ==
nullptr);
bool init() override
Called on this thread when thread starts.
void cleanup() override
Called on this thread before thread exits.
Muxer(RecordingEngine *encoder)
void processOne() override
Process one work item.
void addPacket(AVPacketUPtr packet)
bool hasData() const override
Must return true when data is available for processing.
Q_STATIC_LOGGING_CATEGORY(qLcEncodingFormatContext, "qt.multimedia.ffmpeg.encodingformatcontext")
std::conditional_t< QT_FFMPEG_AVIO_WRITE_CONST, const uint8_t *, uint8_t * > AvioWriteBufferType