3#ifndef QFFMPEGVIDEOENCODER_P_H
4#define QFFMPEGVIDEOENCODER_P_H
17#include <QtFFmpegMediaPluginImpl/private/qffmpegencoderthread_p.h>
18#include <QtFFmpegMediaPluginImpl/private/qffmpeg_p.h>
19#include <QtFFmpegMediaPluginImpl/private/qffmpegvideoframeencoder_p.h>
20#include <qvideoframe.h>
25class QVideoFrameFormat;
26class QMediaEncoderSettings;
34 VideoEncoder(
RecordingEngine &recordingEngine,
const QMediaEncoderSettings &settings,
35 const QVideoFrameFormat &format, std::optional<AVPixelFormat> hwFormat);
38 void addFrame(
const QVideoFrame &frame);
47 bool shouldAdjustTimeBase =
false;
50 FrameInfo takeFrame();
51 void retrievePackets();
58 std::pair<qint64, qint64> frameTimeStamps(
const QVideoFrame &frame)
const;
61 QMediaEncoderSettings m_settings;
62 VideoFrameEncoder::SourceParams m_sourceParams;
63 std::queue<FrameInfo> m_videoFrameQueue;
64 const size_t m_maxQueueSize = 10;
66 VideoFrameEncoderUPtr m_frameEncoder;
67 qint64 m_baseTime = 0;
68 bool m_shouldAdjustTimeBaseForNextFrame =
true;
69 qint64 m_lastFrameTime = 0;
bool isEndOfSourceStreams() const
bool initialize(const std::vector< QAudioBufferSource * > &audioSources, const std::vector< QPlatformVideoSource * > &videoSources)
~RecordingEngine() override
void setAutoStop(bool autoStop)
bool init() override
Called on this thread when thread starts.
bool checkIfCanPushFrame() const override
void processOne() override
Process one work item.
void cleanup() override
Called on this thread before thread exits.
bool hasData() const override
Must return true when data is available for processing.
std::conditional_t< QT_FFMPEG_AVIO_WRITE_CONST, const uint8_t *, uint8_t * > AvioWriteBufferType
void disconnectEncoderFromSource(EncoderThread *encoder)
#define qCWarning(category,...)
#define qCDebug(category,...)
#define Q_STATIC_LOGGING_CATEGORY(name,...)