![]() |
Qt 6.x
The Qt SDK
|
Classes | |
class | AudioEncoder |
class | AudioRenderer |
class | AudioSourceIO |
struct | AVDeleter |
struct | AVDictionaryHolder |
struct | AVFormatContextDeleter |
class | Clock |
class | ClockController |
class | Codec |
class | Demuxer |
class | Encoder |
class | EncoderThread |
class | EncodingFinalizer |
struct | Frame |
class | HWAccel |
struct | LoopOffset |
class | MediaCodecTextureConverter |
class | MediaCodecTextureSet |
class | MediaDataHolder |
class | Muxer |
struct | Packet |
class | PlaybackEngine |
class | PlaybackEngineObject |
struct | PositionWithOffset |
class | Renderer |
class | Resampler |
class | StreamDecoder |
class | SubtitleRenderer |
class | TextureConverter |
class | TextureConverterBackend |
class | TextureSet |
class | Thread |
class | TimeController |
class | VAAPITextureSet |
class | VideoEncoder |
class | VideoFrameEncoder |
class | VideoRenderer |
Typedefs | |
using | StreamIndexes = std::array< int, 3 > |
using | AVFrameUPtr = std::unique_ptr< AVFrame, AVDeleter< decltype(&av_frame_free), &av_frame_free > > |
using | AVPacketUPtr = std::unique_ptr< AVPacket, AVDeleter< decltype(&av_packet_free), &av_packet_free > > |
using | AVCodecContextUPtr = std::unique_ptr< AVCodecContext, AVDeleter< decltype(&avcodec_free_context), &avcodec_free_context > > |
using | AVBufferUPtr = std::unique_ptr< AVBufferRef, AVDeleter< decltype(&av_buffer_unref), &av_buffer_unref > > |
using | AVHWFramesConstraintsUPtr = std::unique_ptr< AVHWFramesConstraints, AVDeleter< decltype(&av_hwframe_constraints_free), &av_hwframe_constraints_free > > |
using | PixelOrSampleFormat = int |
using | AVScore = int |
using | ApplyOptions = void(*)(const QMediaEncoderSettings &settings, AVCodecContext *codec, AVDictionary **opts) |
Functions | |
static | Q_LOGGING_CATEGORY (qLcDemuxer, "qt.multimedia.ffmpeg.demuxer") |
static qint64 | streamTimeToUs (const AVStream *stream, qint64 time) |
static | Q_LOGGING_CATEGORY (qLcRenderer, "qt.multimedia.ffmpeg.renderer") |
const AVCodec * | findAVDecoder (AVCodecID codecId, const std::optional< AVHWDeviceType > &deviceType, const std::optional< PixelOrSampleFormat > &format) |
const AVCodec * | findAVEncoder (AVCodecID codecId, const std::optional< AVHWDeviceType > &deviceType, const std::optional< PixelOrSampleFormat > &format) |
const AVCodec * | findAVEncoder (AVCodecID codecId, const std::function< AVScore(const AVCodec *)> &scoresGetter) |
bool | isAVFormatSupported (const AVCodec *codec, PixelOrSampleFormat format) |
bool | isHwPixelFormat (AVPixelFormat format) |
AVPixelFormat | pixelFormatForHwDevice (AVHWDeviceType deviceType) |
std::optional< qint64 > | mul (qint64 a, AVRational b) |
std::optional< qreal > | mul (qreal a, AVRational b) |
std::optional< qint64 > | timeStampMs (qint64 ts, AVRational base) |
std::optional< qint64 > | timeStampUs (qint64 ts, AVRational base) |
std::optional< float > | toFloat (AVRational r) |
QString | err2str (int errnum) |
void | setAVFrameTime (AVFrame &frame, int64_t pts, const AVRational &timeBase) |
void | getAVFrameTime (const AVFrame &frame, int64_t &pts, AVRational &timeBase) |
int64_t | getAVFrameDuration (const AVFrame &frame) |
AVFrameUPtr | makeAVFrame () |
template<typename Format > | |
bool | hasAVFormat (const Format *fmts, Format format) |
template<typename Format , typename Predicate > | |
Format | findAVFormat (const Format *fmts, const Predicate &predicate) |
template<typename Format , typename CalculateScore > | |
std::pair< Format, AVScore > | findBestAVFormat (const Format *fmts, const CalculateScore &calculateScore) |
bool | isSwPixelFormat (AVPixelFormat format) |
void | applyVideoEncoderOptions (const QMediaEncoderSettings &settings, const QByteArray &codecName, AVCodecContext *codec, AVDictionary **opts) |
void | applyAudioEncoderOptions (const QMediaEncoderSettings &settings, const QByteArray &codecName, AVCodecContext *codec, AVDictionary **opts) |
static std::vector< AVHWDeviceType > | deviceTypes (const char *envVarName) |
static AVBufferRef * | loadHWContext (const AVHWDeviceType type) |
template<typename CodecFinder > | |
std::pair< const AVCodec *, std::unique_ptr< HWAccel > > | findCodecWithHwAccel (AVCodecID id, const std::vector< AVHWDeviceType > &deviceTypes, CodecFinder codecFinder, const std::function< bool(const HWAccel &)> &hwAccelPredicate) |
static bool | isNoConversionFormat (AVPixelFormat f) |
AVPixelFormat | getFormat (AVCodecContext *codecContext, const AVPixelFormat *suggestedFormats) |
Q_GLOBAL_STATIC (AndroidSurfaceTexture, androidSurfaceTexture, 0) | |
enum AVPixelFormat | getFormat (struct AVCodecContext *s, const enum AVPixelFormat *fmt) |
static const quint32 * | fourccFromPixelFormat (const QVideoFrameFormat::PixelFormat format) |
static | Q_LOGGING_CATEGORY (qLcPlaybackEngine, "qt.multimedia.ffmpeg.playbackengine") |
template<typename Array > | |
Array | defaultObjectsArray () |
static AVScore | calculateTargetSwFormatScore (const AVPixFmtDescriptor *sourceSwFormatDesc, AVPixelFormat fmt) |
static AVScore | calculateTargetFormatScore (const HWAccel *accel, AVPixelFormat sourceFormat, const AVPixFmtDescriptor *sourceSwFormatDesc, AVPixelFormat fmt) |
static auto | targetFormatScoreCalculator (const HWAccel *accel, AVPixelFormat sourceFormat, AVPixelFormat sourceSWFormat) |
AVPixelFormat | findTargetSWFormat (AVPixelFormat sourceSWFormat, const HWAccel &accel) |
AVPixelFormat | findTargetFormat (AVPixelFormat sourceFormat, AVPixelFormat sourceSWFormat, const AVCodec *codec, const HWAccel *accel) |
std::pair< const AVCodec *, std::unique_ptr< HWAccel > > | findHwEncoder (AVCodecID codecID, const QSize &sourceSize) |
const AVCodec * | findSwEncoder (AVCodecID codecID, AVPixelFormat sourceFormat, AVPixelFormat sourceSWFormat) |
Variables | ||
static std::atomic< PlaybackEngineObject::Id > | PersistentId = 0 | |
constexpr AVScore | BestAVScore = std::numeric_limits<AVScore>::max() | |
constexpr AVScore | DefaultAVScore = 0 | |
constexpr AVScore | NotSuitableAVScore = std::numeric_limits<AVScore>::min() | |
constexpr AVScore | MinAVScore = NotSuitableAVScore + 1 | |
struct { | ||
const char * QFFmpeg::name | ||
ApplyOptions QFFmpeg::apply | ||
} | videoCodecOptionTable [] | |
struct { | ||
const char * QFFmpeg::name | ||
ApplyOptions QFFmpeg::apply | ||
} | audioCodecOptionTable [] | |
static const std::initializer_list< AVHWDeviceType > | preferredHardwareAccelerators | |
static constexpr bool | shouldPauseStreams = false | |
using QFFmpeg::ApplyOptions = typedef void (*)(const QMediaEncoderSettings &settings, AVCodecContext *codec, AVDictionary **opts) |
Definition at line 259 of file qffmpegencoderoptions.cpp.
using QFFmpeg::AVBufferUPtr = typedef std::unique_ptr<AVBufferRef, AVDeleter<decltype(&av_buffer_unref), &av_buffer_unref> > |
Definition at line 131 of file qffmpeg_p.h.
using QFFmpeg::AVCodecContextUPtr = typedef std::unique_ptr<AVCodecContext, AVDeleter<decltype(&avcodec_free_context), &avcodec_free_context> > |
Definition at line 127 of file qffmpeg_p.h.
using QFFmpeg::AVFrameUPtr = typedef std::unique_ptr<AVFrame, AVDeleter<decltype(&av_frame_free), &av_frame_free> > |
Definition at line 117 of file qffmpeg_p.h.
using QFFmpeg::AVHWFramesConstraintsUPtr = typedef std::unique_ptr< AVHWFramesConstraints, AVDeleter<decltype(&av_hwframe_constraints_free), &av_hwframe_constraints_free> > |
Definition at line 134 of file qffmpeg_p.h.
using QFFmpeg::AVPacketUPtr = typedef std::unique_ptr<AVPacket, AVDeleter<decltype(&av_packet_free), &av_packet_free> > |
Definition at line 124 of file qffmpeg_p.h.
using QFFmpeg::AVScore = typedef int |
Definition at line 139 of file qffmpeg_p.h.
using QFFmpeg::PixelOrSampleFormat = typedef int |
Definition at line 138 of file qffmpeg_p.h.
using QFFmpeg::StreamIndexes = typedef std::array<int, 3> |
Definition at line 30 of file qffmpegplaybackenginedefs_p.h.
void QFFmpeg::applyAudioEncoderOptions | ( | const QMediaEncoderSettings & | settings, |
const QByteArray & | codecName, | ||
AVCodecContext * | codec, | ||
AVDictionary ** | opts | ||
) |
Definition at line 316 of file qffmpegencoderoptions.cpp.
References audioCodecOptionTable, QMediaRecorder::AverageBitRateEncoding, codec, QMediaRecorder::ConstantBitRateEncoding, and settings.
Referenced by Q_LOGGING_CATEGORY().
void QFFmpeg::applyVideoEncoderOptions | ( | const QMediaEncoderSettings & | settings, |
const QByteArray & | codecName, | ||
AVCodecContext * | codec, | ||
AVDictionary ** | opts | ||
) |
Definition at line 301 of file qffmpegencoderoptions.cpp.
References codec, settings, and videoCodecOptionTable.
Referenced by Q_LOGGING_CATEGORY().
|
static |
Definition at line 56 of file qffmpegvideoencoderutils.cpp.
References BestAVScore, calculateTargetSwFormatScore(), fmt, QFFmpeg::HWAccel::hwFormat(), isHwPixelFormat(), and NotSuitableAVScore.
Referenced by targetFormatScoreCalculator().
|
static |
Definition at line 14 of file qffmpegvideoencoderutils.cpp.
References DefaultAVScore, desc, fmt, and NotSuitableAVScore.
Referenced by calculateTargetFormatScore().
|
inline |
Definition at line 26 of file qffmpegplaybackengine.cpp.
|
static |
Definition at line 48 of file qffmpeghwaccel.cpp.
References deviceType(), QString::fromUtf8(), preferredHardwareAccelerators, qgetenv(), qWarning, and QString::toLower().
Referenced by QFFmpeg::HWAccel::decodingDeviceTypes(), QFFmpeg::HWAccel::encodingDeviceTypes(), and findCodecWithHwAccel().
|
inline |
Definition at line 56 of file qffmpeg_p.h.
References QString::fromLocal8Bit().
Referenced by QFFmpeg::Codec::create(), QFFmpeg::HWAccel::createFramesContext(), Q_LOGGING_CATEGORY(), and Q_LOGGING_CATEGORY().
const AVCodec * QFFmpeg::findAVDecoder | ( | AVCodecID | codecId, |
const std::optional< AVHWDeviceType > & | deviceType, | ||
const std::optional< PixelOrSampleFormat > & | format | ||
) |
Definition at line 270 of file qffmpeg.cpp.
References codecId(), and deviceType().
Referenced by QFFmpegMediaFormatInfo::QFFmpegMediaFormatInfo(), QFFmpeg::Codec::create(), and QFFmpeg::HWAccel::findDecoderWithHwAccel().
const AVCodec * QFFmpeg::findAVEncoder | ( | AVCodecID | codecId, |
const std::function< AVScore(const AVCodec *)> & | scoresGetter | ||
) |
Definition at line 282 of file qffmpeg.cpp.
References codecId().
const AVCodec * QFFmpeg::findAVEncoder | ( | AVCodecID | codecId, |
const std::optional< AVHWDeviceType > & | deviceType, | ||
const std::optional< PixelOrSampleFormat > & | format | ||
) |
Definition at line 276 of file qffmpeg.cpp.
References codecId(), and deviceType().
Referenced by QFFmpegMediaFormatInfo::QFFmpegMediaFormatInfo(), QFFmpeg::HWAccel::findEncoderWithHwAccel(), findSwEncoder(), and Q_LOGGING_CATEGORY().
Format QFFmpeg::findAVFormat | ( | const Format * | fmts, |
const Predicate & | predicate | ||
) |
Definition at line 165 of file qffmpeg_p.h.
References BestAVScore, findBestAVFormat(), fmt, NotSuitableAVScore, and predicate.
Referenced by getFormat(), and hasAVFormat().
std::pair< Format, AVScore > QFFmpeg::findBestAVFormat | ( | const Format * | fmts, |
const CalculateScore & | calculateScore | ||
) |
Definition at line 174 of file qffmpeg_p.h.
References BestAVScore, and NotSuitableAVScore.
Referenced by findAVFormat(), findSwEncoder(), findTargetFormat(), findTargetSWFormat(), and getFormat().
std::pair< const AVCodec *, std::unique_ptr< HWAccel > > QFFmpeg::findCodecWithHwAccel | ( | AVCodecID | id, |
const std::vector< AVHWDeviceType > & | deviceTypes, | ||
CodecFinder | codecFinder, | ||
const std::function< bool(const HWAccel &)> & | hwAccelPredicate | ||
) |
Definition at line 98 of file qffmpeghwaccel.cpp.
References codec, QFFmpeg::HWAccel::create(), deviceTypes(), and qCDebug.
Referenced by QFFmpeg::HWAccel::findDecoderWithHwAccel(), and QFFmpeg::HWAccel::findEncoderWithHwAccel().
std::pair< const AVCodec *, std::unique_ptr< HWAccel > > QFFmpeg::findHwEncoder | ( | AVCodecID | codecID, |
const QSize & | sourceSize | ||
) |
Definition at line 126 of file qffmpegvideoencoderutils.cpp.
References QFFmpeg::HWAccel::findEncoderWithHwAccel(), QSize::height(), Q_ASSERT, and QSize::width().
const AVCodec * QFFmpeg::findSwEncoder | ( | AVCodecID | codecID, |
AVPixelFormat | sourceFormat, | ||
AVPixelFormat | sourceSWFormat | ||
) |
Definition at line 147 of file qffmpegvideoencoderutils.cpp.
References codec, findAVEncoder(), findBestAVFormat(), MinAVScore, and targetFormatScoreCalculator().
AVPixelFormat QFFmpeg::findTargetFormat | ( | AVPixelFormat | sourceFormat, |
AVPixelFormat | sourceSWFormat, | ||
const AVCodec * | codec, | ||
const HWAccel * | accel | ||
) |
Definition at line 112 of file qffmpegvideoencoderutils.cpp.
References codec, findBestAVFormat(), isHwPixelFormat(), qWarning, and targetFormatScoreCalculator().
AVPixelFormat QFFmpeg::findTargetSWFormat | ( | AVPixelFormat | sourceSWFormat, |
const HWAccel & | accel | ||
) |
Definition at line 93 of file qffmpegvideoencoderutils.cpp.
References QFFmpeg::HWAccel::constraints(), findBestAVFormat(), and fmt.
|
static |
Definition at line 68 of file qffmpeghwaccel_vaapi.cpp.
References DRM_FORMAT_ABGR8888, DRM_FORMAT_GR1616, DRM_FORMAT_GR88, DRM_FORMAT_R16, DRM_FORMAT_R8, DRM_FORMAT_RG1616, DRM_FORMAT_RG88, DRM_FORMAT_RGBA8888, QVideoFrameFormat::Format_ABGR8888, QVideoFrameFormat::Format_ARGB8888, QVideoFrameFormat::Format_ARGB8888_Premultiplied, QVideoFrameFormat::Format_AYUV, QVideoFrameFormat::Format_AYUV_Premultiplied, QVideoFrameFormat::Format_BGRA8888, QVideoFrameFormat::Format_BGRA8888_Premultiplied, QVideoFrameFormat::Format_BGRX8888, QVideoFrameFormat::Format_IMC1, QVideoFrameFormat::Format_IMC2, QVideoFrameFormat::Format_IMC3, QVideoFrameFormat::Format_IMC4, QVideoFrameFormat::Format_Invalid, QVideoFrameFormat::Format_Jpeg, QVideoFrameFormat::Format_NV12, QVideoFrameFormat::Format_NV21, QVideoFrameFormat::Format_P010, QVideoFrameFormat::Format_P016, QVideoFrameFormat::Format_RGBA8888, QVideoFrameFormat::Format_RGBX8888, QVideoFrameFormat::Format_SamplerExternalOES, QVideoFrameFormat::Format_SamplerRect, QVideoFrameFormat::Format_UYVY, QVideoFrameFormat::Format_XBGR8888, QVideoFrameFormat::Format_XRGB8888, QVideoFrameFormat::Format_Y16, QVideoFrameFormat::Format_Y8, QVideoFrameFormat::Format_YUV420P, QVideoFrameFormat::Format_YUV420P10, QVideoFrameFormat::Format_YUV422P, QVideoFrameFormat::Format_YUYV, and QVideoFrameFormat::Format_YV12.
|
inline |
Definition at line 83 of file qffmpeg_p.h.
References frame, and Q_UNUSED.
Referenced by QFFmpeg::Frame::Data::Data().
|
inline |
Definition at line 73 of file qffmpeg_p.h.
References frame.
Referenced by Q_LOGGING_CATEGORY().
AVPixelFormat QFFmpeg::getFormat | ( | AVCodecContext * | codecContext, |
const AVPixelFormat * | suggestedFormats | ||
) |
Definition at line 139 of file qffmpeghwaccel.cpp.
References DefaultAVScore, findAVFormat(), findBestAVFormat(), i, isAVFormatSupported(), isHwPixelFormat(), isNoConversionFormat(), NotSuitableAVScore, qCDebug, and QFFmpeg::MediaCodecTextureConverter::setupDecoderSurface().
Referenced by QFFmpeg::Codec::create().
enum AVPixelFormat QFFmpeg::getFormat | ( | struct AVCodecContext * | s, |
const enum AVPixelFormat * | fmt | ||
) |
Definition at line 159 of file qffmpeg_p.h.
References findAVFormat().
Referenced by isAVFormatSupported().
bool QFFmpeg::isAVFormatSupported | ( | const AVCodec * | codec, |
PixelOrSampleFormat | format | ||
) |
Definition at line 288 of file qffmpeg.cpp.
References codec, and hasAVFormat().
Referenced by getFormat().
bool QFFmpeg::isHwPixelFormat | ( | AVPixelFormat | format | ) |
Definition at line 299 of file qffmpeg.cpp.
References desc.
Referenced by calculateTargetFormatScore(), findTargetFormat(), getFormat(), and isSwPixelFormat().
|
static |
Definition at line 131 of file qffmpeghwaccel.cpp.
References QFFmpegVideoBuffer::toQtPixelFormat().
Referenced by getFormat().
|
inline |
Definition at line 191 of file qffmpeg_p.h.
References isHwPixelFormat().
|
static |
Definition at line 83 of file qffmpeghwaccel.cpp.
Referenced by QFFmpeg::HWAccel::create().
|
inline |
Definition at line 119 of file qffmpeg_p.h.
Referenced by allocHWFrame(), QAVFSampleBufferDelegate::captureOutput:didOutputSampleBuffer:fromConnection:, QFFmpegVideoBuffer::convertSWFrame(), QAndroidCamera::frameAvailable(), QFFmpegVideoBuffer::map(), Q_LOGGING_CATEGORY(), and Q_LOGGING_CATEGORY().
Definition at line 31 of file qffmpeg_p.h.
Referenced by QFFmpeg::Frame::Data::Data(), QFFmpegVideoBuffer::maxNits(), streamTimeToUs(), timeStampMs(), and timeStampUs().
Definition at line 36 of file qffmpeg_p.h.
AVPixelFormat QFFmpeg::pixelFormatForHwDevice | ( | AVHWDeviceType | deviceType | ) |
Definition at line 305 of file qffmpeg.cpp.
References deviceType().
Referenced by QFFmpeg::HWAccel::hwFormat().
QFFmpeg::Q_GLOBAL_STATIC | ( | AndroidSurfaceTexture | , |
androidSurfaceTexture | , | ||
0 | |||
) |
|
static |
|
static |
|
static |
|
inline |
Definition at line 63 of file qffmpeg_p.h.
References frame, and Q_UNUSED.
Referenced by Q_LOGGING_CATEGORY(), and Q_LOGGING_CATEGORY().
Definition at line 19 of file qffmpegdemuxer.cpp.
References mul(), Q_ASSERT, and time.
Referenced by QFFmpeg::Demuxer::doNextStep(), and QFFmpeg::Demuxer::onPacketProcessed().
|
static |
Definition at line 84 of file qffmpegvideoencoderutils.cpp.
References calculateTargetFormatScore(), and fmt.
Referenced by findSwEncoder(), and findTargetFormat().
Definition at line 41 of file qffmpeg_p.h.
Referenced by Q_LOGGING_CATEGORY(), and QFFmpeg::Codec::toMs().
Definition at line 46 of file qffmpeg_p.h.
Referenced by QFFmpeg::Codec::toUs().
|
inline |
Definition at line 51 of file qffmpeg_p.h.
Referenced by Q_LOGGING_CATEGORY().
ApplyOptions QFFmpeg::apply |
Definition at line 263 of file qffmpegencoderoptions.cpp.
const struct { ... } QFFmpeg::audioCodecOptionTable[] |
Referenced by applyAudioEncoderOptions().
Definition at line 140 of file qffmpeg_p.h.
Referenced by calculateTargetFormatScore(), findAVFormat(), and findBestAVFormat().
|
constexpr |
Definition at line 141 of file qffmpeg_p.h.
Referenced by calculateTargetSwFormatScore(), and getFormat().
|
constexpr |
Definition at line 143 of file qffmpeg_p.h.
Referenced by findSwEncoder().
const char* QFFmpeg::name |
Definition at line 262 of file qffmpegencoderoptions.cpp.
Definition at line 142 of file qffmpeg_p.h.
Referenced by calculateTargetFormatScore(), calculateTargetSwFormatScore(), findAVFormat(), findBestAVFormat(), and getFormat().
|
static |
Definition at line 10 of file qffmpegplaybackengineobject.cpp.
|
static |
|
staticconstexpr |
Definition at line 39 of file qffmpegplaybackengine.cpp.
const struct { ... } QFFmpeg::videoCodecOptionTable[] |
Referenced by applyVideoEncoderOptions().