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
QFFmpeg Namespace Reference

Classes

struct  AbstractAudioFrameConverter
 
class  AudioDecoder
 
class  AudioEncoder
 
class  AudioRenderer
 
class  AudioSourceIO
 
struct  AVAudioFormat
 
struct  AVDeleter
 
struct  AVDictionaryHolder
 
class  CancelToken
 
class  Codec
 
class  CodecContext
 
class  CodecIterator
 
class  ConsumerThread
 FFmpeg thread that is used to implement a consumer pattern. More...
 
class  Demuxer
 
class  EncoderThread
 
class  EncodingFormatContext
 
class  EncodingInitializer
 
struct  Frame
 
class  HWAccel
 
struct  HwFrameContextData
 The HwFrameContextData class contains custom belongings of hw frames context. More...
 
struct  ICancelToken
 
struct  LoopOffset
 
class  MediaCodecTextureConverter
 
class  MediaDataHolder
 
class  Muxer
 
struct  Packet
 
class  PlaybackEngine
 
class  PlaybackEngineObject
 
struct  QVideoFrameHolder
 
class  RecordingEngine
 
class  Renderer
 
class  SteppingAudioRenderer
 
class  StreamDecoder
 
class  SubtitleRenderer
 
class  TextureConverter
 The TextureConverter class implements conversion of AVFrame hw textures to textures for rendering by the specified QRhi. Any instance of TextureConverter matches the pair of FFmpeg hw frames context + QRhi. More...
 
class  TextureConverterBackend
 The base class for platform-specific implementations of TextureConverter One of two virtual methods, createTextures and createTextureHandles, must be overridden. If the implementation operates with QRhiTexture under the hood, overriding of createTextures is prefferable, otherwise expose texture handles of native textures by createTextureHandles. More...
 
class  TimeController
 
struct  ValueAndScore
 
class  VideoEncoder
 
class  VideoFrameEncoder
 
class  VideoRenderer
 

Typedefs

using AvioWriteBufferType
 
using AVFormatContextUPtr = std::unique_ptr<AVFormatContext, AVDeleter<decltype(&avformat_close_input), &avformat_close_input>>
 
using HWAccelUPtr = std::unique_ptr<HWAccel>
 
using AVFrameUPtr = std::unique_ptr<AVFrame, AVDeleter<decltype(&av_frame_free), &av_frame_free>>
 
using AVPacketUPtr
 
using AVCodecContextUPtr
 
using AVBufferUPtr
 
using AVHWFramesConstraintsUPtr
 
using SwrContextUPtr = std::unique_ptr<SwrContext, AVDeleter<decltype(&swr_free), &swr_free>>
 
using SwsContextUPtr
 
using CodecEnumerator = CodecIterator
 
using ChannelLayoutT = AVChannelLayout
 
using TextureConverterBackendPtr = std::shared_ptr<TextureConverterBackend>
 
template<typename T>
using ConsumerThreadUPtr = std::unique_ptr<T, ConsumerThread::Deleter>
 
using ApplyOptions = void (*)(const QMediaEncoderSettings &settings, AVCodecContext *codec, AVDictionary **opts)
 
using VideoFrameEncoderUPtr = std::unique_ptr<VideoFrameEncoder>
 
using StreamIndexes = std::array<int, 3>
 
using TrackPosition = QTaggedTimePoint<qint64, TrackTimeTag>
 
using TrackDuration = QTaggedDuration<qint64, TrackTimeTag>
 
using UserTrackPosition = QTaggedTimePoint<qint64, UserTrackTimeTag>
 
using UserTrackDuration = QTaggedDuration<qint64, UserTrackTimeTag>
 
using AVStreamPosition = QTaggedTimePoint<qint64, AVStreamTimeTag>
 
using AVStreamDuration = QTaggedDuration<qint64, AVStreamTimeTag>
 
using AVContextPosition = QTaggedTimePoint<qint64, AVContextTimeTag>
 
using AVContextDuration = QTaggedDuration<qint64, AVContextTimeTag>
 
using SteadyClock = std::chrono::steady_clock
 

Functions

std::unique_ptr< QFFmpegResamplercreateResampler (const Frame &frame, const QAudioFormat &outputFormat)
 
std::unique_ptr< AbstractAudioFrameConvertermakeTrivialAudioFrameConverter (const Frame &frame, QAudioFormat outputFormat, float playbackRate)
 
std::unique_ptr< AbstractAudioFrameConvertermakePitchShiftingAudioFrameConverter (const Frame &frame, QAudioFormat outputFormat, float playbackRate)
 
bool findAndOpenAVDecoder (AVCodecID codecId, const std::function< AVScore(const Codec &)> &scoresGetter, const std::function< bool(const Codec &)> &codecOpener)
 
bool findAndOpenAVEncoder (AVCodecID codecId, const std::function< AVScore(const Codec &)> &scoresGetter, const std::function< bool(const Codec &)> &codecOpener)
 
std::optional< CodecfindAVDecoder (AVCodecID codecId, const std::optional< PixelOrSampleFormat > &format={})
 
std::optional< CodecfindAVEncoder (AVCodecID codecId, const std::optional< PixelOrSampleFormat > &format={})
 
 Q_STATIC_LOGGING_CATEGORY (qLcDemuxer, "qt.multimedia.ffmpeg.demuxer")
 
static TrackPosition packetEndPos (const Packet &packet, const AVStream *stream, const AVFormatContext *context)
 
static bool isPacketWithinStreamDuration (const AVFormatContext *context, const Packet &packet)
 
static std::optional< TrackDurationstreamDuration (const AVStream &stream)
 
static QTransform displayMatrixToTransform (const int32_t *displayMatrix)
 
static VideoTransformation streamTransformation (const AVStream *stream)
 
static bool colorTransferSupportsHdr (const AVStream *stream)
 
static void insertMediaData (QMediaMetaData &metaData, QPlatformMediaPlayer::TrackType trackType, const AVStream *stream)
 
int readQIODevice (void *opaque, uint8_t *buf, int buf_size)
 
int writeQIODevice (void *opaque, AvioWriteBufferType buf, int buf_size)
 
int64_t seekQIODevice (void *opaque, int64_t offset, int whence)
 
 Q_STATIC_LOGGING_CATEGORY (qLcRenderer, "qt.multimedia.ffmpeg.renderer")
 
AVPixelFormat getFormat (AVCodecContext *s, const AVPixelFormat *fmt)
 
AVFrameUPtr copyFromHwPool (AVFrameUPtr frame)
 
bool isAVFormatSupported (const Codec &codec, PixelOrSampleFormat format)
 
bool isHwPixelFormat (AVPixelFormat format)
 
void applyExperimentalCodecOptions (const Codec &codec, AVDictionary **opts)
 
AVPixelFormat pixelFormatForHwDevice (AVHWDeviceType deviceType)
 
AVPacketSideData * addStreamSideData (AVStream *stream, AVPacketSideData sideData)
 
const AVPacketSideData * streamSideData (const AVStream *stream, AVPacketSideDataType type)
 
SwrContextUPtr createResampleContext (const AVAudioFormat &inputFormat, const AVAudioFormat &outputFormat)
 
QVideoFrameFormat::ColorTransfer fromAvColorTransfer (AVColorTransferCharacteristic colorTrc)
 
AVColorTransferCharacteristic toAvColorTransfer (QVideoFrameFormat::ColorTransfer colorTrc)
 
QVideoFrameFormat::ColorSpace fromAvColorSpace (AVColorSpace colorSpace)
 
AVColorSpace toAvColorSpace (QVideoFrameFormat::ColorSpace colorSpace)
 
QVideoFrameFormat::ColorRange fromAvColorRange (AVColorRange colorRange)
 
AVColorRange toAvColorRange (QVideoFrameFormat::ColorRange colorRange)
 
AVHWDeviceContext * avFrameDeviceContext (const AVFrame *frame)
 
SwsContextUPtr createSwsContext (const QSize &srcSize, AVPixelFormat srcPixFmt, const QSize &dstSize, AVPixelFormat dstPixFmt, int conversionType)
 
std::optional< qint64mul (qint64 a, AVRational b)
 
std::optional< qrealmul (qreal a, AVRational b)
 
std::optional< qint64timeStampMs (qint64 ts, AVRational base)
 
std::optional< qint64timeStampUs (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 Value>
bool hasValue (QSpan< const Value > range, Value value)
 
template<typename Value, typename Predicate>
std::optional< Value > findIf (QSpan< const Value > range, const Predicate &predicate)
 
template<typename Predicate>
std::optional< AVPixelFormat > findAVPixelFormat (const Codec &codec, const Predicate &predicate)
 
template<typename Function>
void forEachAVPixelFormat (const Codec &codec, const Function &function)
 
template<typename Value, typename CalculateScore, typename ScoreType = std::invoke_result_t<CalculateScore, Value>>
ValueAndScore< Value, ScoreType > findBestAVValueWithScore (QSpan< const Value > values, const CalculateScore &calculateScore)
 
template<typename Value, typename CalculateScore>
std::optional< Value > findBestAVValue (QSpan< const Value > values, const CalculateScore &calculateScore)
 
bool isSwPixelFormat (AVPixelFormat format)
 
bool operator== (const AVAudioFormat &lhs, const AVAudioFormat &rhs)
 
QDebug operator<< (QDebug dbg, const AVAudioFormat &format)
 
bool operator!= (const AVAudioFormat &lhs, const AVAudioFormat &rhs)
 
QSpan< const AVPixelFormat > makeSpan (const AVPixelFormat *values)
 
 Q_STATIC_LOGGING_CATEGORY (qLcEncodingFormatContext, "qt.multimedia.ffmpeg.encodingformatcontext")
 
static AVBufferUPtr loadHWContext (AVHWDeviceType type)
 
static bool precheckDriver (AVHWDeviceType type)
 
static bool checkHwType (AVHWDeviceType type)
 
static const std::vector< AVHWDeviceType > & deviceTypes ()
 
static std::vector< AVHWDeviceType > deviceTypes (const char *envVarName)
 
static bool isNoConversionFormat (AVPixelFormat f)
 
static void deleteHwFrameContextData (AVHWFramesContext *context)
 
AVFrameUPtr copyFromHwPoolD3D11 (AVFrameUPtr src)
 
static const quint32fourccFromPixelFormat (const QVideoFrameFormat::PixelFormat format)
 
static MTLPixelFormat rhiTextureFormatToMetalFormat (QRhiTexture::Format f)
 
 Q_STATIC_LOGGING_CATEGORY (qLcPlaybackEngine, "qt.multimedia.ffmpeg.playbackengine")
 
template<typename Array>
static Array defaultObjectsArray ()
 
 Q_STATIC_LOGGING_CATEGORY (qLcFFmpegAudioEncoder, "qt.multimedia.ffmpeg.audioencoder")
 
template<typename T>
dequeueIfPossible (std::queue< T > &queue)
 
void setEncoderInterface (QObject *source, QMediaInputEncoderInterface *)
 
void setEncoderUpdateConnection (QObject *source, EncoderThread *encoder)
 
template<typename Encoder, typename Source>
void connectEncoderToSource (Encoder *encoder, Source *source)
 
void disconnectEncoderFromSource (EncoderThread *encoder)
 
void applyVideoEncoderOptions (const QMediaEncoderSettings &settings, const QByteArray &codecName, AVCodecContext *codec, AVDictionary **opts)
 
void applyAudioEncoderOptions (const QMediaEncoderSettings &settings, const QByteArray &codecName, AVCodecContext *codec, AVDictionary **opts)
 
AVSampleFormat adjustSampleFormat (QSpan< const AVSampleFormat > supportedFormats, AVSampleFormat requested)
 
int adjustSampleRate (QSpan< const int > supportedRates, int requested)
 
static AVScore calculateScoreByChannelsCount (int supportedChannelsNumber, int requestedChannelsNumber)
 
static AVScore calculateScoreByChannelsMask (int supportedChannelsNumber, uint64_t supportedMask, int requestedChannelsNumber, uint64_t requestedMask)
 
ChannelLayoutT adjustChannelLayout (QSpan< const ChannelLayoutT > supportedLayouts, const ChannelLayoutT &requested)
 
 Q_STATIC_LOGGING_CATEGORY (qLcFFmpegMuxer, "qt.multimedia.ffmpeg.muxer")
 
template<typename F>
static void doWithMediaFrameInput (QObject *source, F &&f)
 
 Q_STATIC_LOGGING_CATEGORY (qLcFFmpegVideoEncoder, "qt.multimedia.ffmpeg.videoencoder")
 
static void freeQVideoFrame (void *opaque, uint8_t *)
 
static AVScore calculateTargetSwFormatScore (const AVPixFmtDescriptor *sourceSwFormatDesc, AVPixelFormat fmt, const AVPixelFormatSet &prohibitedFormats)
 
static auto targetSwFormatScoreCalculator (AVPixelFormat sourceFormat, std::reference_wrapper< const AVPixelFormatSet > prohibitedFormats)
 
static bool isHwFormatAcceptedByCodec (AVPixelFormat pixFormat)
 
std::optional< AVPixelFormat > findTargetSWFormat (AVPixelFormat sourceSWFormat, const Codec &codec, const HWAccel &accel, const AVPixelFormatSet &prohibitedFormats)
 
std::optional< AVPixelFormat > findTargetFormat (AVPixelFormat sourceFormat, AVPixelFormat sourceSWFormat, const Codec &codec, const HWAccel *accel, const AVPixelFormatSet &prohibitedFormats)
 
AVScore findSWFormatScores (const Codec &codec, AVPixelFormat sourceSWFormat)
 
AVRational adjustFrameRate (QSpan< const AVRational > supportedRates, qreal requestedRate)
 adjustFrameRate get a rational frame rate be requested qreal rate. If the codec supports fixed frame rate (non-null supportedRates), the function selects the most suitable one, otherwise just makes AVRational from qreal.
 
AVRational adjustFrameTimeBase (QSpan< const AVRational > supportedRates, AVRational frameRate)
 adjustFrameTimeBase gets adjusted timebase by a list of supported frame rates and an already adjusted frame rate.
 
QSize adjustVideoResolution (const Codec &codec, QSize requestedResolution)
 
int getScaleConversionType (const QSize &sourceSize, const QSize &targetSize)
 
AVContextDuration contextStartOffset (const AVFormatContext *formatContext)
 
UserTrackPosition toUserPosition (TrackPosition trackPosition)
 
UserTrackDuration toUserDuration (TrackDuration trackDuration)
 
TrackDuration toTrackDuration (AVContextDuration contextDuration)
 
TrackPosition toTrackPosition (UserTrackPosition userTrackPosition)
 
TrackDuration toTrackDuration (UserTrackDuration userTrackDuration)
 
TrackDuration toTrackDuration (AVStreamDuration streamDuration, const AVStream *avStream)
 
TrackPosition toTrackPosition (AVStreamPosition streamPosition, const AVStream *avStream, const AVFormatContext *formatContext)
 
AVContextPosition toContextPosition (TrackPosition trackPosition, const AVFormatContext *formatContext)
 

Variables

static constexpr TrackDuration MaxBufferedDurationUs { 4'000'000 }
 
static constexpr qint64 MaxBufferedSize = 32 * 1024 * 1024
 
static QAtomicInteger< PlaybackEngineObject::IdPersistentId = 0
 
static const std::initializer_list< AVHWDeviceType > preferredHardwareAccelerators
 
static constexpr bool shouldPauseStreams = false
 
constexpr qint64 VideoFrameTimeBase = 1000000
 
struct { 
 
   const char *   QFFmpeg::name 
 
   ApplyOptions   QFFmpeg::apply 
 
videoCodecOptionTable [] 
 
struct { 
 
   const char *   QFFmpeg::name 
 
   ApplyOptions   QFFmpeg::apply 
 
audioCodecOptionTable [] 
 

Typedef Documentation

◆ ApplyOptions

typedef void(* QFFmpeg::ApplyOptions)(const QMediaEncoderSettings &settings, AVCodecContext *codec, AVDictionary **opts) = void (*)(const QMediaEncoderSettings &settings, AVCodecContext *codec, AVDictionary **opts)

Definition at line 304 of file qffmpegencoderoptions.cpp.

◆ AVBufferUPtr

Initial value:
std::unique_ptr<AVBufferRef, AVDeleter<decltype(&av_buffer_unref), &av_buffer_unref>>

Definition at line 164 of file qffmpeg_p.h.

◆ AVCodecContextUPtr

Initial value:
std::unique_ptr<AVCodecContext,
AVDeleter<decltype(&avcodec_free_context), &avcodec_free_context>>

Definition at line 160 of file qffmpeg_p.h.

◆ AVContextDuration

Definition at line 51 of file qffmpegtime_p.h.

◆ AVContextPosition

Definition at line 50 of file qffmpegtime_p.h.

◆ AVFormatContextUPtr

using QFFmpeg::AVFormatContextUPtr = std::unique_ptr<AVFormatContext, AVDeleter<decltype(&avformat_close_input), &avformat_close_input>>

Definition at line 38 of file qffmpegmediadataholder_p.h.

◆ AVFrameUPtr

using QFFmpeg::AVFrameUPtr = std::unique_ptr<AVFrame, AVDeleter<decltype(&av_frame_free), &av_frame_free>>

Definition at line 150 of file qffmpeg_p.h.

◆ AVHWFramesConstraintsUPtr

Initial value:
std::unique_ptr<
AVHWFramesConstraints,
AVDeleter<decltype(&av_hwframe_constraints_free), &av_hwframe_constraints_free>>

Definition at line 167 of file qffmpeg_p.h.

◆ AvioWriteBufferType

Initial value:
std::conditional_t<QT_FFMPEG_AVIO_WRITE_CONST, const uint8_t *, uint8_t *>

Definition at line 29 of file qffmpegioutils_p.h.

◆ AVPacketUPtr

Initial value:
std::unique_ptr<AVPacket, AVDeleter<decltype(&av_packet_free), &av_packet_free>>

Definition at line 157 of file qffmpeg_p.h.

◆ AVStreamDuration

Definition at line 45 of file qffmpegtime_p.h.

◆ AVStreamPosition

Definition at line 44 of file qffmpegtime_p.h.

◆ ChannelLayoutT

using QFFmpeg::ChannelLayoutT = AVChannelLayout

Definition at line 57 of file qffmpegdefs_p.h.

◆ CodecEnumerator

Definition at line 74 of file qffmpegcodec_p.h.

◆ ConsumerThreadUPtr

template<typename T>
using QFFmpeg::ConsumerThreadUPtr = std::unique_ptr<T, ConsumerThread::Deleter>

Definition at line 97 of file qffmpegthread_p.h.

◆ HWAccelUPtr

using QFFmpeg::HWAccelUPtr = std::unique_ptr<HWAccel>

Definition at line 42 of file qffmpeghwaccel_p.h.

◆ SteadyClock

using QFFmpeg::SteadyClock = std::chrono::steady_clock

Definition at line 53 of file qffmpegtime_p.h.

◆ StreamIndexes

using QFFmpeg::StreamIndexes = std::array<int, 3>

Definition at line 31 of file qffmpegplaybackenginedefs_p.h.

◆ SwrContextUPtr

using QFFmpeg::SwrContextUPtr = std::unique_ptr<SwrContext, AVDeleter<decltype(&swr_free), &swr_free>>

Definition at line 171 of file qffmpeg_p.h.

◆ SwsContextUPtr

Initial value:
std::unique_ptr<SwsContext, AVDeleter<decltype(&sws_freeContext), &sws_freeContext>>

Definition at line 173 of file qffmpeg_p.h.

◆ TextureConverterBackendPtr

Definition at line 63 of file qffmpegtextureconverter_p.h.

◆ TrackDuration

Definition at line 35 of file qffmpegtime_p.h.

◆ TrackPosition

Definition at line 34 of file qffmpegtime_p.h.

◆ UserTrackDuration

Definition at line 40 of file qffmpegtime_p.h.

◆ UserTrackPosition

Definition at line 39 of file qffmpegtime_p.h.

◆ VideoFrameEncoderUPtr

Definition at line 29 of file qffmpegvideoframeencoder_p.h.

Function Documentation

◆ addStreamSideData()

AVPacketSideData * QFFmpeg::addStreamSideData ( AVStream * stream,
AVPacketSideData sideData )

Definition at line 90 of file qffmpeg.cpp.

◆ adjustChannelLayout()

ChannelLayoutT QFFmpeg::adjustChannelLayout ( QSpan< const ChannelLayoutT > supportedLayouts,
const ChannelLayoutT & requested )

Definition at line 71 of file qffmpegaudioencoderutils.cpp.

◆ adjustFrameRate()

AVRational QFFmpeg::adjustFrameRate ( QSpan< const AVRational > supportedRates,
qreal requestedRate )

adjustFrameRate get a rational frame rate be requested qreal rate. If the codec supports fixed frame rate (non-null supportedRates), the function selects the most suitable one, otherwise just makes AVRational from qreal.

Definition at line 167 of file qffmpegvideoencoderutils.cpp.

◆ adjustFrameTimeBase()

AVRational QFFmpeg::adjustFrameTimeBase ( QSpan< const AVRational > supportedRates,
AVRational frameRate )

adjustFrameTimeBase gets adjusted timebase by a list of supported frame rates and an already adjusted frame rate.

Timebase is the fundamental unit of time (in seconds) in terms of which frame timestamps are represented. For fixed-fps content (non-null supportedRates), timebase should be 1/framerate.

For more information, see AVStream::time_base and AVCodecContext::time_base.

The adjusted time base is supposed to be set to stream and codec context.

Definition at line 183 of file qffmpegvideoencoderutils.cpp.

◆ adjustSampleFormat()

AVSampleFormat QFFmpeg::adjustSampleFormat ( QSpan< const AVSampleFormat > supportedFormats,
AVSampleFormat requested )

Definition at line 11 of file qffmpegaudioencoderutils.cpp.

◆ adjustSampleRate()

int QFFmpeg::adjustSampleRate ( QSpan< const int > supportedRates,
int requested )

Definition at line 33 of file qffmpegaudioencoderutils.cpp.

◆ adjustVideoResolution()

QSize QFFmpeg::adjustVideoResolution ( const Codec & codec,
QSize requestedResolution )

Definition at line 204 of file qffmpegvideoencoderutils.cpp.

◆ applyAudioEncoderOptions()

void QFFmpeg::applyAudioEncoderOptions ( const QMediaEncoderSettings & settings,
const QByteArray & codecName,
AVCodecContext * codec,
AVDictionary ** opts )

Definition at line 363 of file qffmpegencoderoptions.cpp.

◆ applyExperimentalCodecOptions()

void QFFmpeg::applyExperimentalCodecOptions ( const Codec & codec,
AVDictionary ** opts )

Definition at line 45 of file qffmpeg.cpp.

◆ applyVideoEncoderOptions()

void QFFmpeg::applyVideoEncoderOptions ( const QMediaEncoderSettings & settings,
const QByteArray & codecName,
AVCodecContext * codec,
AVDictionary ** opts )

Definition at line 348 of file qffmpegencoderoptions.cpp.

◆ avFrameDeviceContext()

AVHWDeviceContext * QFFmpeg::avFrameDeviceContext ( const AVFrame * frame)

Definition at line 290 of file qffmpeg.cpp.

◆ calculateScoreByChannelsCount()

static AVScore QFFmpeg::calculateScoreByChannelsCount ( int supportedChannelsNumber,
int requestedChannelsNumber )
static

Definition at line 51 of file qffmpegaudioencoderutils.cpp.

◆ calculateScoreByChannelsMask()

static AVScore QFFmpeg::calculateScoreByChannelsMask ( int supportedChannelsNumber,
uint64_t supportedMask,
int requestedChannelsNumber,
uint64_t requestedMask )
static

Definition at line 62 of file qffmpegaudioencoderutils.cpp.

◆ calculateTargetSwFormatScore()

static AVScore QFFmpeg::calculateTargetSwFormatScore ( const AVPixFmtDescriptor * sourceSwFormatDesc,
AVPixelFormat fmt,
const AVPixelFormatSet & prohibitedFormats )
static

Definition at line 16 of file qffmpegvideoencoderutils.cpp.

◆ checkHwType()

static bool QFFmpeg::checkHwType ( AVHWDeviceType type)
static

Definition at line 112 of file qffmpeghwaccel.cpp.

References FFmpegLogsEnabledInThread.

◆ colorTransferSupportsHdr()

static bool QFFmpeg::colorTransferSupportsHdr ( const AVStream * stream)
static

Definition at line 100 of file qffmpegmediadataholder.cpp.

◆ connectEncoderToSource()

template<typename Encoder, typename Source>
void QFFmpeg::connectEncoderToSource ( Encoder * encoder,
Source * source )

Definition at line 48 of file qffmpegrecordingengineutils_p.h.

◆ contextStartOffset()

AVContextDuration QFFmpeg::contextStartOffset ( const AVFormatContext * formatContext)
inline

Definition at line 55 of file qffmpegtime_p.h.

◆ copyFromHwPool()

AVFrameUPtr QFFmpeg::copyFromHwPool ( AVFrameUPtr frame)

Definition at line 427 of file qffmpeghwaccel.cpp.

◆ copyFromHwPoolD3D11()

AVFrameUPtr QFFmpeg::copyFromHwPoolD3D11 ( AVFrameUPtr src)

Definition at line 355 of file qffmpeghwaccel_d3d11.cpp.

◆ createResampleContext()

SwrContextUPtr QFFmpeg::createResampleContext ( const AVAudioFormat & inputFormat,
const AVAudioFormat & outputFormat )

Definition at line 131 of file qffmpeg.cpp.

◆ createResampler()

std::unique_ptr< QFFmpegResampler > QFFmpeg::createResampler ( const Frame & frame,
const QAudioFormat & outputFormat )

Definition at line 145 of file qffmpegaudioframeconverter.cpp.

◆ createSwsContext()

SwsContextUPtr QFFmpeg::createSwsContext ( const QSize & srcSize,
AVPixelFormat srcPixFmt,
const QSize & dstSize,
AVPixelFormat dstPixFmt,
int conversionType = SWS_BICUBIC )

Definition at line 303 of file qffmpeg.cpp.

◆ defaultObjectsArray()

template<typename Array>
static Array QFFmpeg::defaultObjectsArray ( )
inlinestatic

Definition at line 28 of file qffmpegplaybackengine.cpp.

◆ deleteHwFrameContextData()

static void QFFmpeg::deleteHwFrameContextData ( AVHWFramesContext * context)
static

Definition at line 406 of file qffmpeghwaccel.cpp.

◆ dequeueIfPossible()

template<typename T>
T QFFmpeg::dequeueIfPossible ( std::queue< T > & queue)

Definition at line 33 of file qffmpegrecordingengineutils_p.h.

◆ deviceTypes() [1/2]

static const std::vector< AVHWDeviceType > & QFFmpeg::deviceTypes ( )
static

Definition at line 141 of file qffmpeghwaccel.cpp.

◆ deviceTypes() [2/2]

static std::vector< AVHWDeviceType > QFFmpeg::deviceTypes ( const char * envVarName)
static

Definition at line 182 of file qffmpeghwaccel.cpp.

◆ disconnectEncoderFromSource()

void QFFmpeg::disconnectEncoderFromSource ( EncoderThread * encoder)

Definition at line 47 of file qffmpegrecordingengineutils.cpp.

References setEncoderInterface(), and QFFmpeg::EncoderThread::source().

Referenced by QFFmpeg::RecordingEngine::finalize().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ displayMatrixToTransform()

static QTransform QFFmpeg::displayMatrixToTransform ( const int32_t * displayMatrix)
static

Definition at line 49 of file qffmpegmediadataholder.cpp.

◆ doWithMediaFrameInput()

template<typename F>
static void QFFmpeg::doWithMediaFrameInput ( QObject * source,
F && f )
static

Definition at line 14 of file qffmpegrecordingengineutils.cpp.

◆ err2str()

QString QFFmpeg::err2str ( int errnum)
inline

Definition at line 75 of file qffmpeg_p.h.

◆ findAndOpenAVDecoder()

bool QFFmpeg::findAndOpenAVDecoder ( AVCodecID codecId,
const std::function< AVScore(const Codec &)> & scoresGetter,
const std::function< bool(const Codec &)> & codecOpener )

Definition at line 395 of file qffmpegcodecstorage.cpp.

◆ findAndOpenAVEncoder()

bool QFFmpeg::findAndOpenAVEncoder ( AVCodecID codecId,
const std::function< AVScore(const Codec &)> & scoresGetter,
const std::function< bool(const Codec &)> & codecOpener )

Definition at line 402 of file qffmpegcodecstorage.cpp.

◆ findAVDecoder()

std::optional< Codec > QFFmpeg::findAVDecoder ( AVCodecID codecId,
const std::optional< PixelOrSampleFormat > & format = {} )

Definition at line 384 of file qffmpegcodecstorage.cpp.

◆ findAVEncoder()

std::optional< Codec > QFFmpeg::findAVEncoder ( AVCodecID codecId,
const std::optional< PixelOrSampleFormat > & format = {} )

Definition at line 390 of file qffmpegcodecstorage.cpp.

◆ findAVPixelFormat()

template<typename Predicate>
std::optional< AVPixelFormat > QFFmpeg::findAVPixelFormat ( const Codec & codec,
const Predicate & predicate )

Definition at line 204 of file qffmpeg_p.h.

◆ findBestAVValue()

template<typename Value, typename CalculateScore>
std::optional< Value > QFFmpeg::findBestAVValue ( QSpan< const Value > values,
const CalculateScore & calculateScore )

Definition at line 267 of file qffmpeg_p.h.

◆ findBestAVValueWithScore()

template<typename Value, typename CalculateScore, typename ScoreType = std::invoke_result_t<CalculateScore, Value>>
ValueAndScore< Value, ScoreType > QFFmpeg::findBestAVValueWithScore ( QSpan< const Value > values,
const CalculateScore & calculateScore )

Definition at line 248 of file qffmpeg_p.h.

◆ findIf()

template<typename Value, typename Predicate>
std::optional< Value > QFFmpeg::findIf ( QSpan< const Value > range,
const Predicate & predicate )

Definition at line 190 of file qffmpeg_p.h.

◆ findSWFormatScores()

AVScore QFFmpeg::findSWFormatScores ( const Codec & codec,
AVPixelFormat sourceSWFormat )

Definition at line 155 of file qffmpegvideoencoderutils.cpp.

◆ findTargetFormat()

std::optional< AVPixelFormat > QFFmpeg::findTargetFormat ( AVPixelFormat sourceFormat,
AVPixelFormat sourceSWFormat,
const Codec & codec,
const HWAccel * accel,
const AVPixelFormatSet & prohibitedFormats = {} )

Definition at line 119 of file qffmpegvideoencoderutils.cpp.

◆ findTargetSWFormat()

std::optional< AVPixelFormat > QFFmpeg::findTargetSWFormat ( AVPixelFormat sourceSWFormat,
const Codec & codec,
const HWAccel & accel,
const AVPixelFormatSet & prohibitedFormats = {} )

Definition at line 101 of file qffmpegvideoencoderutils.cpp.

◆ forEachAVPixelFormat()

template<typename Function>
void QFFmpeg::forEachAVPixelFormat ( const Codec & codec,
const Function & function )

Definition at line 231 of file qffmpeg_p.h.

◆ fourccFromPixelFormat()

static const quint32 * QFFmpeg::fourccFromPixelFormat ( const QVideoFrameFormat::PixelFormat format)
static

Definition at line 68 of file qffmpeghwaccel_vaapi.cpp.

◆ freeQVideoFrame()

static void QFFmpeg::freeQVideoFrame ( void * opaque,
uint8_t *  )
static

Definition at line 141 of file qffmpegvideoencoder.cpp.

Referenced by QFFmpeg::VideoEncoder::processOne().

+ Here is the caller graph for this function:

◆ fromAvColorRange()

QVideoFrameFormat::ColorRange QFFmpeg::fromAvColorRange ( AVColorRange colorRange)

Definition at line 266 of file qffmpeg.cpp.

◆ fromAvColorSpace()

QVideoFrameFormat::ColorSpace QFFmpeg::fromAvColorSpace ( AVColorSpace colorSpace)

Definition at line 223 of file qffmpeg.cpp.

◆ fromAvColorTransfer()

QVideoFrameFormat::ColorTransfer QFFmpeg::fromAvColorTransfer ( AVColorTransferCharacteristic colorTrc)

Definition at line 171 of file qffmpeg.cpp.

◆ getAVFrameDuration()

int64_t QFFmpeg::getAVFrameDuration ( const AVFrame & frame)
inline

Definition at line 102 of file qffmpeg_p.h.

◆ getAVFrameTime()

void QFFmpeg::getAVFrameTime ( const AVFrame & frame,
int64_t & pts,
AVRational & timeBase )
inline

Definition at line 92 of file qffmpeg_p.h.

◆ getFormat()

AVPixelFormat QFFmpeg::getFormat ( AVCodecContext * s,
const AVPixelFormat * fmt )

Definition at line 239 of file qffmpeghwaccel.cpp.

◆ getScaleConversionType()

int QFFmpeg::getScaleConversionType ( const QSize & sourceSize,
const QSize & targetSize )

Definition at line 218 of file qffmpegvideoencoderutils.cpp.

◆ hasValue()

template<typename Value>
bool QFFmpeg::hasValue ( QSpan< const Value > range,
Value value )

Definition at line 180 of file qffmpeg_p.h.

◆ insertMediaData()

static void QFFmpeg::insertMediaData ( QMediaMetaData & metaData,
QPlatformMediaPlayer::TrackType trackType,
const AVStream * stream )
static

Definition at line 141 of file qffmpegmediadataholder.cpp.

◆ isAVFormatSupported()

bool QFFmpeg::isAVFormatSupported ( const Codec & codec,
PixelOrSampleFormat format )

Definition at line 24 of file qffmpeg.cpp.

◆ isHwFormatAcceptedByCodec()

static bool QFFmpeg::isHwFormatAcceptedByCodec ( AVPixelFormat pixFormat)
static

Definition at line 90 of file qffmpegvideoencoderutils.cpp.

◆ isHwPixelFormat()

bool QFFmpeg::isHwPixelFormat ( AVPixelFormat format)

Definition at line 39 of file qffmpeg.cpp.

◆ isNoConversionFormat()

static bool QFFmpeg::isNoConversionFormat ( AVPixelFormat f)
static

Definition at line 231 of file qffmpeghwaccel.cpp.

◆ isPacketWithinStreamDuration()

static bool QFFmpeg::isPacketWithinStreamDuration ( const AVFormatContext * context,
const Packet & packet )
static

Definition at line 28 of file qffmpegdemuxer.cpp.

◆ isSwPixelFormat()

bool QFFmpeg::isSwPixelFormat ( AVPixelFormat format)
inline

Definition at line 275 of file qffmpeg_p.h.

◆ loadHWContext()

static AVBufferUPtr QFFmpeg::loadHWContext ( AVHWDeviceType type)
static

Definition at line 58 of file qffmpeghwaccel.cpp.

◆ makeAVFrame()

AVFrameUPtr QFFmpeg::makeAVFrame ( )
inline

Definition at line 152 of file qffmpeg_p.h.

◆ makePitchShiftingAudioFrameConverter()

std::unique_ptr< AbstractAudioFrameConverter > QFFmpeg::makePitchShiftingAudioFrameConverter ( const Frame & frame,
QAudioFormat outputFormat,
float playbackRate )

Definition at line 159 of file qffmpegaudioframeconverter.cpp.

◆ makeSpan()

QSpan< const AVPixelFormat > QFFmpeg::makeSpan ( const AVPixelFormat * values)

Definition at line 299 of file qffmpegcodec.cpp.

◆ makeTrivialAudioFrameConverter()

std::unique_ptr< AbstractAudioFrameConverter > QFFmpeg::makeTrivialAudioFrameConverter ( const Frame & frame,
QAudioFormat outputFormat,
float playbackRate )

Definition at line 153 of file qffmpegaudioframeconverter.cpp.

◆ mul() [1/2]

std::optional< qint64 > QFFmpeg::mul ( qint64 a,
AVRational b )
inline

Definition at line 40 of file qffmpeg_p.h.

◆ mul() [2/2]

std::optional< qreal > QFFmpeg::mul ( qreal a,
AVRational b )
inline

Definition at line 55 of file qffmpeg_p.h.

◆ operator!=()

bool QFFmpeg::operator!= ( const AVAudioFormat & lhs,
const AVAudioFormat & rhs )
inline

Definition at line 59 of file qffmpegavaudioformat_p.h.

References operator==().

+ Here is the call graph for this function:

◆ operator<<()

QDebug QFFmpeg::operator<< ( QDebug dbg,
const AVAudioFormat & format )

Definition at line 78 of file qffmpegavaudioformat.cpp.

References QFFmpeg::AVAudioFormat::sampleRate.

◆ operator==()

bool QFFmpeg::operator== ( const AVAudioFormat & lhs,
const AVAudioFormat & rhs )

Definition at line 67 of file qffmpegavaudioformat.cpp.

References QFFmpeg::AVAudioFormat::sampleRate.

Referenced by operator!=().

+ Here is the caller graph for this function:

◆ packetEndPos()

static TrackPosition QFFmpeg::packetEndPos ( const Packet & packet,
const AVStream * stream,
const AVFormatContext * context )
static

Definition at line 20 of file qffmpegdemuxer.cpp.

◆ pixelFormatForHwDevice()

AVPixelFormat QFFmpeg::pixelFormatForHwDevice ( AVHWDeviceType deviceType)

Definition at line 54 of file qffmpeg.cpp.

◆ precheckDriver()

static bool QFFmpeg::precheckDriver ( AVHWDeviceType type)
static

Definition at line 74 of file qffmpeghwaccel.cpp.

◆ Q_STATIC_LOGGING_CATEGORY() [1/7]

QFFmpeg::Q_STATIC_LOGGING_CATEGORY ( qLcDemuxer ,
"qt.multimedia.ffmpeg.demuxer"  )

◆ Q_STATIC_LOGGING_CATEGORY() [2/7]

QFFmpeg::Q_STATIC_LOGGING_CATEGORY ( qLcEncodingFormatContext ,
"qt.multimedia.ffmpeg.encodingformatcontext"  )

◆ Q_STATIC_LOGGING_CATEGORY() [3/7]

QFFmpeg::Q_STATIC_LOGGING_CATEGORY ( qLcFFmpegAudioEncoder ,
"qt.multimedia.ffmpeg.audioencoder"  )

◆ Q_STATIC_LOGGING_CATEGORY() [4/7]

QFFmpeg::Q_STATIC_LOGGING_CATEGORY ( qLcFFmpegMuxer ,
"qt.multimedia.ffmpeg.muxer"  )

◆ Q_STATIC_LOGGING_CATEGORY() [5/7]

QFFmpeg::Q_STATIC_LOGGING_CATEGORY ( qLcFFmpegVideoEncoder ,
"qt.multimedia.ffmpeg.videoencoder"  )

◆ Q_STATIC_LOGGING_CATEGORY() [6/7]

QFFmpeg::Q_STATIC_LOGGING_CATEGORY ( qLcPlaybackEngine ,
"qt.multimedia.ffmpeg.playbackengine"  )

◆ Q_STATIC_LOGGING_CATEGORY() [7/7]

QFFmpeg::Q_STATIC_LOGGING_CATEGORY ( qLcRenderer ,
"qt.multimedia.ffmpeg.renderer"  )

◆ readQIODevice()

int QFFmpeg::readQIODevice ( void * opaque,
uint8_t * buf,
int buf_size )

Definition at line 12 of file qffmpegioutils.cpp.

◆ rhiTextureFormatToMetalFormat()

static MTLPixelFormat QFFmpeg::rhiTextureFormatToMetalFormat ( QRhiTexture::Format f)
static

Definition at line 139 of file qffmpeghwaccel_videotoolbox.mm.

◆ seekQIODevice()

int64_t QFFmpeg::seekQIODevice ( void * opaque,
int64_t offset,
int whence )

Definition at line 30 of file qffmpegioutils.cpp.

◆ setAVFrameTime()

void QFFmpeg::setAVFrameTime ( AVFrame & frame,
int64_t pts,
const AVRational & timeBase )
inline

Definition at line 82 of file qffmpeg_p.h.

◆ setEncoderInterface()

void QFFmpeg::setEncoderInterface ( QObject * source,
QMediaInputEncoderInterface * encoderInterface )

Definition at line 22 of file qffmpegrecordingengineutils.cpp.

Referenced by disconnectEncoderFromSource().

+ Here is the caller graph for this function:

◆ setEncoderUpdateConnection()

void QFFmpeg::setEncoderUpdateConnection ( QObject * source,
EncoderThread * encoder )

Definition at line 38 of file qffmpegrecordingengineutils.cpp.

◆ streamDuration()

static std::optional< TrackDuration > QFFmpeg::streamDuration ( const AVStream & stream)
static

Definition at line 28 of file qffmpegmediadataholder.cpp.

◆ streamSideData()

const AVPacketSideData * QFFmpeg::streamSideData ( const AVStream * stream,
AVPacketSideDataType type )

Definition at line 116 of file qffmpeg.cpp.

◆ streamTransformation()

static VideoTransformation QFFmpeg::streamTransformation ( const AVStream * stream)
static

Definition at line 79 of file qffmpegmediadataholder.cpp.

◆ targetSwFormatScoreCalculator()

static auto QFFmpeg::targetSwFormatScoreCalculator ( AVPixelFormat sourceFormat,
std::reference_wrapper< const AVPixelFormatSet > prohibitedFormats )
static

Definition at line 81 of file qffmpegvideoencoderutils.cpp.

◆ timeStampMs()

std::optional< qint64 > QFFmpeg::timeStampMs ( qint64 ts,
AVRational base )
inline

Definition at line 60 of file qffmpeg_p.h.

◆ timeStampUs()

std::optional< qint64 > QFFmpeg::timeStampUs ( qint64 ts,
AVRational base )
inline

Definition at line 65 of file qffmpeg_p.h.

◆ toAvColorRange()

AVColorRange QFFmpeg::toAvColorRange ( QVideoFrameFormat::ColorRange colorRange)

Definition at line 278 of file qffmpeg.cpp.

◆ toAvColorSpace()

AVColorSpace QFFmpeg::toAvColorSpace ( QVideoFrameFormat::ColorSpace colorSpace)

Definition at line 250 of file qffmpeg.cpp.

◆ toAvColorTransfer()

AVColorTransferCharacteristic QFFmpeg::toAvColorTransfer ( QVideoFrameFormat::ColorTransfer colorTrc)

Definition at line 201 of file qffmpeg.cpp.

◆ toContextPosition()

AVContextPosition QFFmpeg::toContextPosition ( TrackPosition trackPosition,
const AVFormatContext * formatContext )
inline

Definition at line 100 of file qffmpegtime_p.h.

◆ toFloat()

std::optional< float > QFFmpeg::toFloat ( AVRational r)
inline

Definition at line 70 of file qffmpeg_p.h.

◆ toTrackDuration() [1/3]

TrackDuration QFFmpeg::toTrackDuration ( AVContextDuration contextDuration)
inline

Definition at line 72 of file qffmpegtime_p.h.

◆ toTrackDuration() [2/3]

TrackDuration QFFmpeg::toTrackDuration ( AVStreamDuration streamDuration,
const AVStream * avStream )
inline

Definition at line 87 of file qffmpegtime_p.h.

◆ toTrackDuration() [3/3]

TrackDuration QFFmpeg::toTrackDuration ( UserTrackDuration userTrackDuration)
inline

Definition at line 82 of file qffmpegtime_p.h.

◆ toTrackPosition() [1/2]

TrackPosition QFFmpeg::toTrackPosition ( AVStreamPosition streamPosition,
const AVStream * avStream,
const AVFormatContext * formatContext )
inline

Definition at line 92 of file qffmpegtime_p.h.

◆ toTrackPosition() [2/2]

TrackPosition QFFmpeg::toTrackPosition ( UserTrackPosition userTrackPosition)
inline

Definition at line 77 of file qffmpegtime_p.h.

◆ toUserDuration()

UserTrackDuration QFFmpeg::toUserDuration ( TrackDuration trackDuration)
inline

Definition at line 67 of file qffmpegtime_p.h.

◆ toUserPosition()

UserTrackPosition QFFmpeg::toUserPosition ( TrackPosition trackPosition)
inline

Definition at line 62 of file qffmpegtime_p.h.

◆ writeQIODevice()

int QFFmpeg::writeQIODevice ( void * opaque,
AvioWriteBufferType buf,
int buf_size )

Definition at line 22 of file qffmpegioutils.cpp.

Variable Documentation

◆ apply

ApplyOptions QFFmpeg::apply

Definition at line 308 of file qffmpegencoderoptions.cpp.

◆ [struct]

const struct { ... } QFFmpeg::audioCodecOptionTable
Initial value:
= {
{ nullptr, nullptr }
}

◆ MaxBufferedDurationUs

static constexpr TrackDuration QFFmpeg::MaxBufferedDurationUs { 4'000'000 }
staticconstexpr

Definition at line 13 of file qffmpegdemuxer.cpp.

◆ MaxBufferedSize

static constexpr qint64 QFFmpeg::MaxBufferedSize = 32 * 1024 * 1024
staticconstexpr

Definition at line 16 of file qffmpegdemuxer.cpp.

◆ name

const char* QFFmpeg::name

Definition at line 307 of file qffmpegencoderoptions.cpp.

◆ PersistentId

static QAtomicInteger< PlaybackEngineObject::Id > QFFmpeg::PersistentId = 0
static

Definition at line 13 of file qffmpegplaybackengineobject.cpp.

◆ preferredHardwareAccelerators

static const std::initializer_list< AVHWDeviceType > QFFmpeg::preferredHardwareAccelerators
static
Initial value:
= {
}

Definition at line 40 of file qffmpeghwaccel.cpp.

◆ shouldPauseStreams

static constexpr bool QFFmpeg::shouldPauseStreams = false
staticconstexpr

Definition at line 41 of file qffmpegplaybackengine.cpp.

◆ [struct]

const struct { ... } QFFmpeg::videoCodecOptionTable

◆ VideoFrameTimeBase

qint64 QFFmpeg::VideoFrameTimeBase = 1000000
constexpr

Definition at line 28 of file qffmpegrecordingengineutils_p.h.