Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
qffmpeg_p.h File Reference
#include <private/qtmultimediaglobal_p.h>
#include <qstring.h>
#include <optional>
#include <libavformat/avformat.h>
#include <libavcodec/avcodec.h>
#include <libswresample/swresample.h>
#include <libavutil/avutil.h>
#include <libswscale/swscale.h>
+ Include dependency graph for qffmpeg_p.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  QFFmpeg::AVDictionaryHolder
 
struct  QFFmpeg::AVDeleter< FunctionType, F >
 

Namespaces

namespace  QFFmpeg
 

Macros

#define QT_FFMPEG_OLD_CHANNEL_LAYOUT   (LIBAVCODEC_VERSION_INT < AV_VERSION_INT(59,24,100))
 
#define QT_FFMPEG_HAS_VULKAN    (LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(58, 91, 100))
 
#define QT_FFMPEG_HAS_FRAME_TIME_BASE    (LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(59, 18, 100))
 
#define QT_FFMPEG_HAS_FRAME_DURATION    (LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(60, 3, 100))
 

Typedefs

using QFFmpeg::AVFrameUPtr = std::unique_ptr< AVFrame, AVDeleter< decltype(&av_frame_free), &av_frame_free > >
 
using QFFmpeg::AVPacketUPtr = std::unique_ptr< AVPacket, AVDeleter< decltype(&av_packet_free), &av_packet_free > >
 
using QFFmpeg::AVCodecContextUPtr = std::unique_ptr< AVCodecContext, AVDeleter< decltype(&avcodec_free_context), &avcodec_free_context > >
 
using QFFmpeg::AVBufferUPtr = std::unique_ptr< AVBufferRef, AVDeleter< decltype(&av_buffer_unref), &av_buffer_unref > >
 
using QFFmpeg::AVHWFramesConstraintsUPtr = std::unique_ptr< AVHWFramesConstraints, AVDeleter< decltype(&av_hwframe_constraints_free), &av_hwframe_constraints_free > >
 
using QFFmpeg::PixelOrSampleFormat = int
 
using QFFmpeg::AVScore = int
 

Functions

std::optional< qint64QFFmpeg::mul (qint64 a, AVRational b)
 
std::optional< qrealQFFmpeg::mul (qreal a, AVRational b)
 
std::optional< qint64QFFmpeg::timeStampMs (qint64 ts, AVRational base)
 
std::optional< qint64QFFmpeg::timeStampUs (qint64 ts, AVRational base)
 
std::optional< float > QFFmpeg::toFloat (AVRational r)
 
QString QFFmpeg::err2str (int errnum)
 
void QFFmpeg::setAVFrameTime (AVFrame &frame, int64_t pts, const AVRational &timeBase)
 
void QFFmpeg::getAVFrameTime (const AVFrame &frame, int64_t &pts, AVRational &timeBase)
 
int64_t QFFmpeg::getAVFrameDuration (const AVFrame &frame)
 
AVFrameUPtr QFFmpeg::makeAVFrame ()
 
const AVCodec * QFFmpeg::findAVDecoder (AVCodecID codecId, const std::optional< AVHWDeviceType > &deviceType, const std::optional< PixelOrSampleFormat > &format)
 
const AVCodec * QFFmpeg::findAVEncoder (AVCodecID codecId, const std::optional< AVHWDeviceType > &deviceType, const std::optional< PixelOrSampleFormat > &format)
 
const AVCodec * QFFmpeg::findAVEncoder (AVCodecID codecId, const std::function< AVScore(const AVCodec *)> &scoresGetter)
 
bool QFFmpeg::isAVFormatSupported (const AVCodec *codec, PixelOrSampleFormat format)
 
template<typename Format >
bool QFFmpeg::hasAVFormat (const Format *fmts, Format format)
 
template<typename Format , typename Predicate >
Format QFFmpeg::findAVFormat (const Format *fmts, const Predicate &predicate)
 
template<typename Format , typename CalculateScore >
std::pair< Format, AVScoreQFFmpeg::findBestAVFormat (const Format *fmts, const CalculateScore &calculateScore)
 
bool QFFmpeg::isHwPixelFormat (AVPixelFormat format)
 
bool QFFmpeg::isSwPixelFormat (AVPixelFormat format)
 
AVPixelFormat QFFmpeg::pixelFormatForHwDevice (AVHWDeviceType deviceType)
 

Variables

constexpr AVScore QFFmpeg::BestAVScore = std::numeric_limits<AVScore>::max()
 
constexpr AVScore QFFmpeg::DefaultAVScore = 0
 
constexpr AVScore QFFmpeg::NotSuitableAVScore = std::numeric_limits<AVScore>::min()
 
constexpr AVScore QFFmpeg::MinAVScore = NotSuitableAVScore + 1
 

Macro Definition Documentation

◆ QT_FFMPEG_HAS_FRAME_DURATION

#define QT_FFMPEG_HAS_FRAME_DURATION    (LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(60, 3, 100))

Definition at line 23 of file qffmpeg_p.h.

◆ QT_FFMPEG_HAS_FRAME_TIME_BASE

#define QT_FFMPEG_HAS_FRAME_TIME_BASE    (LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(59, 18, 100))

Definition at line 21 of file qffmpeg_p.h.

◆ QT_FFMPEG_HAS_VULKAN

#define QT_FFMPEG_HAS_VULKAN    (LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(58, 91, 100))

Definition at line 19 of file qffmpeg_p.h.

◆ QT_FFMPEG_OLD_CHANNEL_LAYOUT

#define QT_FFMPEG_OLD_CHANNEL_LAYOUT   (LIBAVCODEC_VERSION_INT < AV_VERSION_INT(59,24,100))

Definition at line 18 of file qffmpeg_p.h.