mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-06 23:24:01 +02:00
Fix build against FFmpeg v5.0
It has been released on January 17th. This patch keeps source compatibility with older versions.
This commit is contained in:
parent
f4f7b5b99c
commit
436622ad7c
5 changed files with 9 additions and 5 deletions
|
@ -154,7 +154,7 @@ void FormatDeleter::operator()(AVFormatContext *value) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
AVCodec *FindDecoder(not_null<AVCodecContext*> context) {
|
const AVCodec *FindDecoder(not_null<AVCodecContext*> context) {
|
||||||
// Force libvpx-vp9, because we need alpha channel support.
|
// Force libvpx-vp9, because we need alpha channel support.
|
||||||
return (context->codec_id == AV_CODEC_ID_VP9)
|
return (context->codec_id == AV_CODEC_ID_VP9)
|
||||||
? avcodec_find_decoder_by_name("libvpx-vp9")
|
? avcodec_find_decoder_by_name("libvpx-vp9")
|
||||||
|
|
|
@ -158,7 +158,7 @@ using SwscalePointer = std::unique_ptr<SwsContext, SwscaleDeleter>;
|
||||||
void LogError(QLatin1String method);
|
void LogError(QLatin1String method);
|
||||||
void LogError(QLatin1String method, FFmpeg::AvErrorWrap error);
|
void LogError(QLatin1String method, FFmpeg::AvErrorWrap error);
|
||||||
|
|
||||||
[[nodiscard]] AVCodec *FindDecoder(not_null<AVCodecContext*> context);
|
[[nodiscard]] const AVCodec *FindDecoder(not_null<AVCodecContext*> context);
|
||||||
[[nodiscard]] crl::time PtsToTime(int64_t pts, AVRational timeBase);
|
[[nodiscard]] crl::time PtsToTime(int64_t pts, AVRational timeBase);
|
||||||
// Used for full duration conversion.
|
// Used for full duration conversion.
|
||||||
[[nodiscard]] crl::time PtsToTimeCeil(int64_t pts, AVRational timeBase);
|
[[nodiscard]] crl::time PtsToTimeCeil(int64_t pts, AVRational timeBase);
|
||||||
|
|
|
@ -147,7 +147,7 @@ struct Instance::Inner::Private {
|
||||||
AVIOContext *ioContext = nullptr;
|
AVIOContext *ioContext = nullptr;
|
||||||
AVFormatContext *fmtContext = nullptr;
|
AVFormatContext *fmtContext = nullptr;
|
||||||
AVStream *stream = nullptr;
|
AVStream *stream = nullptr;
|
||||||
AVCodec *codec = nullptr;
|
const AVCodec *codec = nullptr;
|
||||||
AVCodecContext *codecContext = nullptr;
|
AVCodecContext *codecContext = nullptr;
|
||||||
bool opened = false;
|
bool opened = false;
|
||||||
bool processing = false;
|
bool processing = false;
|
||||||
|
|
|
@ -60,7 +60,11 @@ protected:
|
||||||
uchar *ioBuffer = nullptr;
|
uchar *ioBuffer = nullptr;
|
||||||
AVIOContext *ioContext = nullptr;
|
AVIOContext *ioContext = nullptr;
|
||||||
AVFormatContext *fmtContext = nullptr;
|
AVFormatContext *fmtContext = nullptr;
|
||||||
|
#if LIBAVFORMAT_VERSION_MAJOR >= 59
|
||||||
|
const AVCodec *codec = nullptr;
|
||||||
|
#else
|
||||||
AVCodec *codec = nullptr;
|
AVCodec *codec = nullptr;
|
||||||
|
#endif
|
||||||
int32 streamId = 0;
|
int32 streamId = 0;
|
||||||
|
|
||||||
bool _opened = false;
|
bool _opened = false;
|
||||||
|
|
|
@ -23,8 +23,8 @@ constexpr auto kMaxQueuedPackets = 1024;
|
||||||
not_null<AVStream*> stream,
|
not_null<AVStream*> stream,
|
||||||
Mode mode) {
|
Mode mode) {
|
||||||
return (mode == Mode::Video || mode == Mode::Inspection)
|
return (mode == Mode::Video || mode == Mode::Inspection)
|
||||||
&& stream->codec
|
&& stream->codecpar
|
||||||
&& (stream->codec->codec_id == AV_CODEC_ID_VP9)
|
&& (stream->codecpar->codec_id == AV_CODEC_ID_VP9)
|
||||||
&& format->iformat
|
&& format->iformat
|
||||||
&& format->iformat->name
|
&& format->iformat->name
|
||||||
&& QString::fromLatin1(
|
&& QString::fromLatin1(
|
||||||
|
|
Loading…
Add table
Reference in a new issue