1 From 33d928c54f4b35f8877cacd1e2c77b68b4dddc06 Mon Sep 17 00:00:00 2001
2 From: Zane van Iperen <zane@zanevaniperen.com>
3 Date: Sun, 7 Nov 2021 15:46:37 +1000
4 Subject: [PATCH] fix build with ffmpeg 4
7 src/arch/MovieTexture/MovieTexture_FFMpeg.cpp | 5 +----
8 src/arch/MovieTexture/MovieTexture_FFMpeg.h | 22 +++++++++----------
9 2 files changed, 12 insertions(+), 15 deletions(-)
11 diff --git a/src/arch/MovieTexture/MovieTexture_FFMpeg.cpp b/src/arch/MovieTexture/MovieTexture_FFMpeg.cpp
12 index bdf2356..f79fea2 100644
13 --- a/src/arch/MovieTexture/MovieTexture_FFMpeg.cpp
14 +++ b/src/arch/MovieTexture/MovieTexture_FFMpeg.cpp
15 @@ -445,7 +445,7 @@ RString MovieDecoder_FFMpeg::Open( RString sFile )
16 return "Couldn't find any video streams";
17 m_pStream = m_fctx->streams[stream_idx];
19 - if( m_pStream->codec->codec_id == avcodec::CODEC_ID_NONE )
20 + if( m_pStream->codec->codec_id == avcodec::AV_CODEC_ID_NONE )
21 return ssprintf( "Unsupported codec %08x", m_pStream->codec->codec_tag );
23 RString sError = OpenCodec();
24 @@ -474,9 +474,6 @@ RString MovieDecoder_FFMpeg::OpenCodec()
25 m_pStream->codec->idct_algo = FF_IDCT_AUTO;
26 m_pStream->codec->error_concealment = 3;
28 - if( pCodec->capabilities & CODEC_CAP_DR1 )
29 - m_pStream->codec->flags |= CODEC_FLAG_EMU_EDGE;
31 LOG->Trace("Opening codec %s", pCodec->name );
33 int ret = avcodec::avcodec_open2( m_pStream->codec, pCodec, NULL );
34 diff --git a/src/arch/MovieTexture/MovieTexture_FFMpeg.h b/src/arch/MovieTexture/MovieTexture_FFMpeg.h
35 index f4d25ef..32564e5 100644
36 --- a/src/arch/MovieTexture/MovieTexture_FFMpeg.h
37 +++ b/src/arch/MovieTexture/MovieTexture_FFMpeg.h
38 @@ -64,7 +64,7 @@ private:
40 avcodec::AVStream *m_pStream;
41 avcodec::AVFrame *m_Frame;
42 - avcodec::PixelFormat m_AVTexfmt; /* PixelFormat of output surface */
43 + avcodec::AVPixelFormat m_AVTexfmt; /* PixelFormat of output surface */
44 avcodec::SwsContext *m_swsctx;
46 avcodec::AVFormatContext *m_fctx;
47 @@ -90,7 +90,7 @@ static struct AVPixelFormat_t
51 - avcodec::PixelFormat pf;
52 + avcodec::AVPixelFormat pf;
54 bool bByteSwapOnLittleEndian;
55 MovieDecoderPixelFormatYCbCr YUV;
56 @@ -101,7 +101,7 @@ static struct AVPixelFormat_t
60 - avcodec::PIX_FMT_YUYV422,
61 + avcodec::AV_PIX_FMT_YUYV422,
64 PixelFormatYCbCr_YUYV422,
65 @@ -112,7 +112,7 @@ static struct AVPixelFormat_t
69 - avcodec::PIX_FMT_BGRA,
70 + avcodec::AV_PIX_FMT_BGRA,
73 PixelFormatYCbCr_Invalid,
74 @@ -123,7 +123,7 @@ static struct AVPixelFormat_t
78 - avcodec::PIX_FMT_ARGB,
79 + avcodec::AV_PIX_FMT_ARGB,
82 PixelFormatYCbCr_Invalid,
83 @@ -135,7 +135,7 @@ static struct AVPixelFormat_t
87 - avcodec::PIX_FMT_ABGR,
88 + avcodec::AV_PIX_FMT_ABGR,
91 PixelFormatYCbCr_Invalid,
92 @@ -146,7 +146,7 @@ static struct AVPixelFormat_t
96 - avcodec::PIX_FMT_RGBA,
97 + avcodec::AV_PIX_FMT_RGBA,
100 PixelFormatYCbCr_Invalid,
101 @@ -157,7 +157,7 @@ static struct AVPixelFormat_t
105 - avcodec::PIX_FMT_RGB24,
106 + avcodec::AV_PIX_FMT_RGB24,
109 PixelFormatYCbCr_Invalid,
110 @@ -168,7 +168,7 @@ static struct AVPixelFormat_t
114 - avcodec::PIX_FMT_BGR24,
115 + avcodec::AV_PIX_FMT_BGR24,
118 PixelFormatYCbCr_Invalid,
119 @@ -179,12 +179,12 @@ static struct AVPixelFormat_t
123 - avcodec::PIX_FMT_RGB555,
124 + avcodec::AV_PIX_FMT_RGB555,
127 PixelFormatYCbCr_Invalid,
129 - { 0, { 0,0,0,0 }, avcodec::PIX_FMT_NB, true, false, PixelFormatYCbCr_Invalid }
130 + { 0, { 0,0,0,0 }, avcodec::AV_PIX_FMT_NB, true, false, PixelFormatYCbCr_Invalid }