aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Beich <jbeich@FreeBSD.org>2023-03-15 09:21:00 +0000
committerJan Beich <jbeich@FreeBSD.org>2023-03-15 10:12:34 +0000
commitdeb6e280f48bdf51bb253488e61d390ee88929ec (patch)
treeb2201601abd5a6776754c009289668b4f3a448a7
parentd6ed3ffd47ec8c92174254ba7ef9fbc1707ce89f (diff)
downloadports-deb6e280f48bdf51bb253488e61d390ee88929ec.tar.gz
ports-deb6e280f48bdf51bb253488e61d390ee88929ec.zip
emulators/ppsspp: unbreak with ffmpeg 5.0
Core/HW/MediaEngine.cpp:437:12: error: no member named 'need_parsing' in 'AVStream' stream->need_parsing = AVSTREAM_PARSE_FULL; ~~~~~~ ^ Core/HW/MediaEngine.cpp:524:12: error: cannot initialize a variable of type 'AVCodec *' with an rvalue of type 'const AVCodec *' AVCodec *pCodec = avcodec_find_decoder(stream->codecpar->codec_id); ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Core/HW/SimpleAudioDec.cpp:83:11: error: assigning to 'AVCodec *' from 'const AVCodec *' discards qualifiers codec_ = avcodec_find_decoder((AVCodecID)audioCodecId); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Core/HW/SimpleAudioDec.cpp:90:14: error: use of undeclared identifier 'avcodec_alloc_context3' codecCtx_ = avcodec_alloc_context3(codec_); ^ Core/HW/SimpleAudioDec.cpp:95:11: error: member access into incomplete type 'AVCodecContext' codecCtx_->channels = channels_; ^ Core/HW/MediaEngine.h:41:8: note: forward declaration of 'AVCodecContext' struct AVCodecContext; ^ Core/HW/SimpleAudioDec.cpp:96:11: error: member access into incomplete type 'AVCodecContext' codecCtx_->channel_layout = channels_ == 2 ? AV_CH_LAYOUT_STEREO : AV_CH_LAYOUT_MONO; ^ Core/HW/MediaEngine.h:41:8: note: forward declaration of 'AVCodecContext' struct AVCodecContext; ^ Core/HW/SimpleAudioDec.cpp:97:11: error: member access into incomplete type 'AVCodecContext' codecCtx_->sample_rate = sample_rate_; ^ Core/HW/MediaEngine.h:41:8: note: forward declaration of 'AVCodecContext' struct AVCodecContext; ^ Core/HW/SimpleAudioDec.cpp:106:15: error: member access into incomplete type 'AVCodecContext' if (codecCtx_->block_align == 0) { ^ Core/HW/MediaEngine.h:41:8: note: forward declaration of 'AVCodecContext' struct AVCodecContext; ^ Core/HW/SimpleAudioDec.cpp:107:12: error: member access into incomplete type 'AVCodecContext' codecCtx_->block_align = block_align; ^ Core/HW/MediaEngine.h:41:8: note: forward declaration of 'AVCodecContext' struct AVCodecContext; ^ Core/HW/SimpleAudioDec.cpp:111:15: error: use of undeclared identifier 'avcodec_open2' int retval = avcodec_open2(codecCtx_, codec_, &opts); ^ Core/HW/SimpleAudioDec.cpp:126:12: error: member access into incomplete type 'AVCodecContext' codecCtx_->extradata = (uint8_t *)av_mallocz(size); ^ Core/HW/MediaEngine.h:41:8: note: forward declaration of 'AVCodecContext' struct AVCodecContext; ^ Core/HW/SimpleAudioDec.cpp:127:12: error: member access into incomplete type 'AVCodecContext' codecCtx_->extradata_size = size; ^ Core/HW/MediaEngine.h:41:8: note: forward declaration of 'AVCodecContext' struct AVCodecContext; ^ Core/HW/SimpleAudioDec.cpp:128:12: error: member access into incomplete type 'AVCodecContext' codecCtx_->block_align = wav_bytes_per_packet; ^ Core/HW/MediaEngine.h:41:8: note: forward declaration of 'AVCodecContext' struct AVCodecContext; ^ Core/HW/SimpleAudioDec.cpp:132:20: error: member access into incomplete type 'AVCodecContext' memcpy(codecCtx_->extradata, data, size); ^ Core/HW/MediaEngine.h:41:8: note: forward declaration of 'AVCodecContext' struct AVCodecContext; ^ Core/HW/SimpleAudioDec.cpp:149:12: error: member access into incomplete type 'AVCodecContext' codecCtx_->channels = channels_; ^ Core/HW/MediaEngine.h:41:8: note: forward declaration of 'AVCodecContext' struct AVCodecContext; ^ Core/HW/SimpleAudioDec.cpp:150:12: error: member access into incomplete type 'AVCodecContext' codecCtx_->channel_layout = channels_ == 2 ? AV_CH_LAYOUT_STEREO : AV_CH_LAYOUT_MONO; ^ Core/HW/MediaEngine.h:41:8: note: forward declaration of 'AVCodecContext' struct AVCodecContext; ^ Core/HW/SimpleAudioDec.cpp:163:2: error: use of undeclared identifier 'avcodec_close'; did you mean 'avio_close'? avcodec_close(codecCtx_); ^~~~~~~~~~~~~ avio_close /usr/local/include/libavformat/avio.h:704:5: note: 'avio_close' declared here int avio_close(AVIOContext *s); ^ Core/HW/SimpleAudioDec.cpp:163:16: error: cannot initialize a parameter of type 'AVIOContext *' with an lvalue of type 'AVCodecContext *' avcodec_close(codecCtx_); ^~~~~~~~~ Core/HW/MediaEngine.h:41:8: note: 'AVCodecContext' is not defined, but forward declared here; conversion would be valid if it was derived from 'AVIOContext' struct AVCodecContext; ^ /usr/local/include/libavformat/avio.h:704:29: note: passing argument to parameter 's' here int avio_close(AVIOContext *s); ^ Core/HW/SimpleAudioDec.cpp:164:21: error: member access into incomplete type 'AVCodecContext' av_freep(&codecCtx_->extradata); ^ Core/HW/MediaEngine.h:41:8: note: forward declaration of 'AVCodecContext' struct AVCodecContext; ^ Core/HW/SimpleAudioDec.cpp:165:21: error: member access into incomplete type 'AVCodecContext' av_freep(&codecCtx_->subtitle_header); ^ Core/HW/MediaEngine.h:41:8: note: forward declaration of 'AVCodecContext' struct AVCodecContext; ^ Core/HW/SimpleAudioDec.cpp:213:12: error: use of undeclared identifier 'avcodec_decode_audio4' int len = avcodec_decode_audio4(codecCtx_, frame_, &got_frame, &packet); ^ Core/HLE/sceAtrac.cpp:462:3: error: use of undeclared identifier 'avcodec_close'; did you mean 'avio_close'? avcodec_close(codecCtx_); ^~~~~~~~~~~~~ avio_close /usr/local/include/libavformat/avio.h:704:5: note: 'avio_close' declared here int avio_close(AVIOContext *s); ^ Core/HLE/sceAtrac.cpp:462:17: error: cannot initialize a parameter of type 'AVIOContext *' with an lvalue of type 'AVCodecContext *' avcodec_close(codecCtx_); ^~~~~~~~~ Core/HW/SimpleAudioDec.h:27:8: note: 'AVCodecContext' is not defined, but forward declared here; conversion would be valid if it was derived from 'AVIOContext' struct AVCodecContext; ^ /usr/local/include/libavformat/avio.h:704:29: note: passing argument to parameter 's' here int avio_close(AVIOContext *s); ^ Core/HLE/sceAtrac.cpp:468:3: error: use of undeclared identifier 'av_free_packet'; did you mean 'av_init_packet'? av_free_packet(packet_); ^~~~~~~~~~~~~~ av_init_packet /usr/local/include/libavcodec/packet.h:512:6: note: 'av_init_packet' declared here void av_init_packet(AVPacket *pkt); ^ Core/HLE/sceAtrac.cpp:477:3: error: use of undeclared identifier 'avcodec_flush_buffers' avcodec_flush_buffers(codecCtx_); ^ Core/HLE/sceAtrac.cpp:502:4: error: use of undeclared identifier 'avcodec_flush_buffers' avcodec_flush_buffers(codecCtx_); ^ Core/HLE/sceAtrac.cpp:591:20: error: use of undeclared identifier 'avcodec_decode_audio4' int bytes_read = avcodec_decode_audio4(codecCtx_, frame_, &got_frame, packet_); ^ Core/HLE/sceAtrac.cpp:596:3: error: use of undeclared identifier 'av_free_packet'; did you mean 'av_init_packet'? av_free_packet(packet_); ^~~~~~~~~~~~~~ av_init_packet /usr/local/include/libavcodec/packet.h:512:6: note: 'av_init_packet' declared here void av_init_packet(AVPacket *pkt); ^ Core/HLE/sceAtrac.cpp:1823:20: error: member access into incomplete type 'AVCodecContext' atrac->codecCtx_->sample_rate, ^ Core/HW/SimpleAudioDec.h:27:8: note: forward declaration of 'AVCodecContext' struct AVCodecContext; ^ Core/HLE/sceAtrac.cpp:1825:20: error: member access into incomplete type 'AVCodecContext' atrac->codecCtx_->sample_fmt, ^ Core/HW/SimpleAudioDec.h:27:8: note: forward declaration of 'AVCodecContext' struct AVCodecContext; ^ Core/HLE/sceAtrac.cpp:1826:20: error: member access into incomplete type 'AVCodecContext' atrac->codecCtx_->sample_rate, ^ Core/HW/SimpleAudioDec.h:27:8: note: forward declaration of 'AVCodecContext' struct AVCodecContext; ^ Core/HLE/sceAtrac.cpp:1856:21: error: use of undeclared identifier 'avcodec_alloc_context3' atrac->codecCtx_ = avcodec_alloc_context3(codec); ^ Core/HLE/sceAtrac.cpp:1860:19: error: member access into incomplete type 'AVCodecContext' atrac->codecCtx_->extradata = (uint8_t *)av_mallocz(14); ^ Core/HW/SimpleAudioDec.h:27:8: note: forward declaration of 'AVCodecContext' struct AVCodecContext; ^ Core/HLE/sceAtrac.cpp:1861:19: error: member access into incomplete type 'AVCodecContext' atrac->codecCtx_->extradata_size = 14; ^ Core/HW/SimpleAudioDec.h:27:8: note: forward declaration of 'AVCodecContext' struct AVCodecContext; ^ Core/HLE/sceAtrac.cpp:1865:19: error: member access into incomplete type 'AVCodecContext' atrac->codecCtx_->extradata[0] = 1; ^ Core/HW/SimpleAudioDec.h:27:8: note: forward declaration of 'AVCodecContext' struct AVCodecContext; ^ Core/HLE/sceAtrac.cpp:1866:19: error: member access into incomplete type 'AVCodecContext' atrac->codecCtx_->extradata[3] = atrac->channels_ << 3; ^ Core/HW/SimpleAudioDec.h:27:8: note: forward declaration of 'AVCodecContext' struct AVCodecContext; ^ Core/HLE/sceAtrac.cpp:1867:19: error: member access into incomplete type 'AVCodecContext' atrac->codecCtx_->extradata[6] = atrac->jointStereo_; ^ Core/HW/SimpleAudioDec.h:27:8: note: forward declaration of 'AVCodecContext' struct AVCodecContext; ^ Core/HLE/sceAtrac.cpp:1868:19: error: member access into incomplete type 'AVCodecContext' atrac->codecCtx_->extradata[8] = atrac->jointStereo_; ^ Core/HW/SimpleAudioDec.h:27:8: note: forward declaration of 'AVCodecContext' struct AVCodecContext; ^ Core/HLE/sceAtrac.cpp:1869:19: error: member access into incomplete type 'AVCodecContext' atrac->codecCtx_->extradata[10] = 1; ^ Core/HW/SimpleAudioDec.h:27:8: note: forward declaration of 'AVCodecContext' struct AVCodecContext; ^ Core/HLE/sceAtrac.cpp:1874:19: error: member access into incomplete type 'AVCodecContext' atrac->codecCtx_->channels = 1; ^ Core/HW/SimpleAudioDec.h:27:8: note: forward declaration of 'AVCodecContext' struct AVCodecContext; ^ Core/HLE/sceMpeg.cpp:804:12: error: cannot initialize a variable of type 'AVCodec *' with an rvalue of type 'const AVCodec *' AVCodec * pmp_Codec = avcodec_find_decoder(AV_CODEC_ID_H264); ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Core/HLE/sceMpeg.cpp:811:34: error: use of undeclared identifier 'avcodec_alloc_context3' AVCodecContext * pmp_CodecCtx = avcodec_alloc_context3(pmp_Codec); ^ Core/HLE/sceMpeg.cpp:817:14: error: member access into incomplete type 'AVCodecContext' pmp_CodecCtx->flags |= AV_CODEC_FLAG_OUTPUT_CORRUPT | AV_CODEC_FLAG_LOW_DELAY; ^ Core/HW/SimpleAudioDec.h:27:8: note: forward declaration of 'AVCodecContext' struct AVCodecContext; ^ Core/HLE/sceMpeg.cpp:824:14: error: member access into incomplete type 'AVCodecContext' pmp_CodecCtx->width = 480; ^ Core/HW/SimpleAudioDec.h:27:8: note: forward declaration of 'AVCodecContext' struct AVCodecContext; ^ Core/HLE/sceMpeg.cpp:825:14: error: member access into incomplete type 'AVCodecContext' pmp_CodecCtx->height = 272; ^ Core/HW/SimpleAudioDec.h:27:8: note: forward declaration of 'AVCodecContext' struct AVCodecContext; ^ Core/HLE/sceMpeg.cpp:826:41: error: member access into incomplete type 'AVCodecContext' mediaengine->m_desHeight = pmp_CodecCtx->height; ^ Core/HW/SimpleAudioDec.h:27:8: note: forward declaration of 'AVCodecContext' struct AVCodecContext; ^ Core/HLE/sceMpeg.cpp:827:40: error: member access into incomplete type 'AVCodecContext' mediaengine->m_desWidth = pmp_CodecCtx->width; ^ Core/HW/SimpleAudioDec.h:27:8: note: forward declaration of 'AVCodecContext' struct AVCodecContext; ^ Core/HLE/sceMpeg.cpp:830:6: error: use of undeclared identifier 'avcodec_open2' if (avcodec_open2(pmp_CodecCtx, pmp_Codec, NULL) < 0){ ^ Core/HLE/sceMpeg.cpp:847:76: error: member access into incomplete type 'AVCodecContext' mediaengine->m_bufSize = avpicture_get_size(pmp_want_pix_fmt, pmp_CodecCtx->width, pmp_CodecCtx->height); ^ Core/HW/SimpleAudioDec.h:27:8: note: forward declaration of 'AVCodecContext' struct AVCodecContext; ^ Core/HLE/sceMpeg.cpp:847:97: error: member access into incomplete type 'AVCodecContext' mediaengine->m_bufSize = avpicture_get_size(pmp_want_pix_fmt, pmp_CodecCtx->width, pmp_CodecCtx->height); ^ Core/HW/SimpleAudioDec.h:27:8: note: forward declaration of 'AVCodecContext' struct AVCodecContext; ^ Core/HLE/sceMpeg.cpp:986:35: error: member access into incomplete type 'AVCodecContext' av_new_packet(&packet, pCodecCtx->width*pCodecCtx->height); ^ Core/HW/SimpleAudioDec.h:27:8: note: forward declaration of 'AVCodecContext' struct AVCodecContext; ^ Core/HLE/sceMpeg.cpp:1001:19: error: use of undeclared identifier 'AVPicture' avpicture_fill((AVPicture *)pFrameRGB, mediaengine->m_buffer, pmp_want_pix_fmt, pCodecCtx->width, pCodecCtx->height); ^ Core/HLE/sceMpeg.cpp:1001:30: error: expected expression avpicture_fill((AVPicture *)pFrameRGB, mediaengine->m_buffer, pmp_want_pix_fmt, pCodecCtx->width, pCodecCtx->height); ^ Core/HLE/sceMpeg.cpp:1001:92: error: member access into incomplete type 'AVCodecContext' avpicture_fill((AVPicture *)pFrameRGB, mediaengine->m_buffer, pmp_want_pix_fmt, pCodecCtx->width, pCodecCtx->height); ^ Core/HW/SimpleAudioDec.h:27:8: note: forward declaration of 'AVCodecContext' struct AVCodecContext; ^ Core/HLE/sceMpeg.cpp:1001:110: error: member access into incomplete type 'AVCodecContext' avpicture_fill((AVPicture *)pFrameRGB, mediaengine->m_buffer, pmp_want_pix_fmt, pCodecCtx->width, pCodecCtx->height); ^ Core/HW/SimpleAudioDec.h:27:8: note: forward declaration of 'AVCodecContext' struct AVCodecContext; ^ Core/HLE/sceMpeg.cpp:1020:13: error: use of undeclared identifier 'avcodec_decode_video2' int len = avcodec_decode_video2(pCodecCtx, pFrame, &got_picture, &packet); ^ Core/HLE/sceMpeg.cpp:1026:14: error: member access into incomplete type 'AVCodecContext' pCodecCtx->width, ^ Core/HW/SimpleAudioDec.h:27:8: note: forward declaration of 'AVCodecContext' struct AVCodecContext; ^ Core/HLE/sceMpeg.cpp:1027:14: error: member access into incomplete type 'AVCodecContext' pCodecCtx->height, ^ Core/HW/SimpleAudioDec.h:27:8: note: forward declaration of 'AVCodecContext' struct AVCodecContext; ^ Core/HLE/sceMpeg.cpp:1028:14: error: member access into incomplete type 'AVCodecContext' pCodecCtx->pix_fmt, ^ Core/HW/SimpleAudioDec.h:27:8: note: forward declaration of 'AVCodecContext' struct AVCodecContext; ^ Core/AVIDump.cpp:148:10: error: assigning to 'AVCodec *' from 'const AVCodec *' discards qualifiers codec = avcodec_find_encoder(s_codec_context->codec_id); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PR: 270201 Obtained from: upstream
-rw-r--r--emulators/ppsspp/files/patch-ffmpeg5106
1 files changed, 106 insertions, 0 deletions
diff --git a/emulators/ppsspp/files/patch-ffmpeg5 b/emulators/ppsspp/files/patch-ffmpeg5
new file mode 100644
index 000000000000..051628becfe7
--- /dev/null
+++ b/emulators/ppsspp/files/patch-ffmpeg5
@@ -0,0 +1,106 @@
+https://github.com/hrydgard/ppsspp/issues/15308
+
+--- Core/AVIDump.cpp.orig 2023-01-03 10:14:31 UTC
++++ Core/AVIDump.cpp
+@@ -91,7 +91,7 @@ bool AVIDump::CreateAVI() {
+
+ bool AVIDump::CreateAVI() {
+ #ifdef USE_FFMPEG
+- AVCodec *codec = nullptr;
++ const AVCodec *codec = nullptr;
+
+ // Use gameID_EmulatedTimestamp for filename
+ std::string discID = g_paramSFO.GetDiscID();
+--- Core/HLE/sceAtrac.cpp.orig 2023-01-03 10:14:31 UTC
++++ Core/HLE/sceAtrac.cpp
+@@ -123,6 +123,7 @@ extern "C" {
+ #ifdef USE_FFMPEG
+
+ extern "C" {
++#include "libavcodec/avcodec.h"
+ #include "libavformat/avformat.h"
+ #include "libswresample/swresample.h"
+ #include "libavutil/samplefmt.h"
+--- Core/HLE/sceMpeg.cpp.orig 2023-01-03 10:14:31 UTC
++++ Core/HLE/sceMpeg.cpp
+@@ -108,6 +108,7 @@ extern "C" {
+ #ifdef USE_FFMPEG
+
+ extern "C" {
++#include "libavcodec/avcodec.h"
+ #include "libavformat/avformat.h"
+ #include "libavutil/imgutils.h"
+ #include "libswscale/swscale.h"
+@@ -801,7 +802,7 @@ static bool InitPmp(MpegContext * ctx){
+ pmp_want_pix_fmt = AV_PIX_FMT_RGBA;
+
+ // Create H264 video codec
+- AVCodec * pmp_Codec = avcodec_find_decoder(AV_CODEC_ID_H264);
++ const AVCodec * pmp_Codec = avcodec_find_decoder(AV_CODEC_ID_H264);
+ if (pmp_Codec == NULL){
+ ERROR_LOG(ME, "Can not find H264 codec, please update ffmpeg");
+ return false;
+--- Core/HW/MediaEngine.cpp.orig 2023-01-03 10:14:31 UTC
++++ Core/HW/MediaEngine.cpp
+@@ -38,6 +38,10 @@ extern "C" {
+ #include "libavutil/imgutils.h"
+ #include "libswscale/swscale.h"
+
++#if LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT(59, 23, 100)
++ // private libavformat api (see demux.h in ffmpeg src tree)
++ void avpriv_stream_set_need_parsing(AVStream *st, enum AVStreamParseType type);
++#endif
+ }
+ #endif // USE_FFMPEG
+
+@@ -434,7 +438,11 @@ bool MediaEngine::addVideoStream(int streamNum, int st
+ #else
+ stream->request_probe = 0;
+ #endif
++#if LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT(59, 23, 100)
++ avpriv_stream_set_need_parsing(stream, AVSTREAM_PARSE_FULL);
++#else
+ stream->need_parsing = AVSTREAM_PARSE_FULL;
++#endif
+ // We could set the width here, but we don't need to.
+ if (streamNum >= m_expectedVideoStreams) {
+ ++m_expectedVideoStreams;
+@@ -521,7 +529,7 @@ bool MediaEngine::setVideoStream(int streamNum, bool f
+
+ AVStream *stream = m_pFormatCtx->streams[streamNum];
+ #if LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT(57, 33, 100)
+- AVCodec *pCodec = avcodec_find_decoder(stream->codecpar->codec_id);
++ const AVCodec *pCodec = avcodec_find_decoder(stream->codecpar->codec_id);
+ if (!pCodec) {
+ WARN_LOG_REPORT(ME, "Could not find decoder for %d", (int)stream->codecpar->codec_id);
+ return false;
+--- Core/HW/SimpleAudioDec.cpp.orig 2023-01-03 10:14:31 UTC
++++ Core/HW/SimpleAudioDec.cpp
+@@ -28,6 +28,7 @@ extern "C" {
+ #ifdef USE_FFMPEG
+
+ extern "C" {
++#include "libavcodec/avcodec.h"
+ #include "libavformat/avformat.h"
+ #include "libswresample/swresample.h"
+ #include "libavutil/samplefmt.h"
+--- Core/HW/SimpleAudioDec.h.orig 2023-01-03 10:14:31 UTC
++++ Core/HW/SimpleAudioDec.h
+@@ -23,7 +23,7 @@ struct AVFrame;
+ #include "Core/HLE/sceAudio.h"
+
+ struct AVFrame;
+-struct AVCodec;
++const struct AVCodec;
+ struct AVCodecContext;
+ struct SwrContext;
+
+@@ -78,7 +78,7 @@ class SimpleAudio { (private)
+ int wanted_resample_freq; // wanted resampling rate/frequency
+
+ AVFrame *frame_;
+- AVCodec *codec_;
++ const AVCodec *codec_;
+ AVCodecContext *codecCtx_;
+ SwrContext *swrCtx_;
+