diff options
Diffstat (limited to 'sci-electronics/gazebo/files/ffmpeg5.patch')
-rw-r--r-- | sci-electronics/gazebo/files/ffmpeg5.patch | 137 |
1 files changed, 0 insertions, 137 deletions
diff --git a/sci-electronics/gazebo/files/ffmpeg5.patch b/sci-electronics/gazebo/files/ffmpeg5.patch deleted file mode 100644 index e55bab3c311f..000000000000 --- a/sci-electronics/gazebo/files/ffmpeg5.patch +++ /dev/null @@ -1,137 +0,0 @@ -Index: gazebo-11.10.1/gazebo/common/AudioDecoder.cc -=================================================================== ---- gazebo-11.10.1.orig/gazebo/common/AudioDecoder.cc -+++ gazebo-11.10.1/gazebo/common/AudioDecoder.cc -@@ -113,8 +113,13 @@ bool AudioDecoder::Decode(uint8_t **_out - # pragma GCC diagnostic push - # pragma GCC diagnostic ignored "-Wdeprecated-declarations" - #endif -- bytesDecoded = avcodec_decode_audio4(this->codecCtx, decodedFrame, -- &gotFrame, &packet1); -+ bytesDecoded = avcodec_send_packet(this->codecCtx, &packet1); -+ if (bytesDecoded >= 0 || bytesDecoded == AVERROR_EOF) { -+ bytesDecoded = avcodec_receive_frame(this->codecCtx, decodedFrame); -+ gotFrame = bytesDecoded >= 0; -+ if (bytesDecoded == AVERROR(EAGAIN) || bytesDecoded == AVERROR_EOF) bytesDecoded = 0; -+ } -+ - #ifndef _WIN32 - # pragma GCC diagnostic pop - #endif -@@ -214,7 +219,7 @@ bool AudioDecoder::SetFile(const std::st - # pragma GCC diagnostic push - # pragma GCC diagnostic ignored "-Wdeprecated-declarations" - #endif -- if (this->formatCtx->streams[i]->codec->codec_type == AVMEDIA_TYPE_AUDIO) -+ if (this->formatCtx->streams[i]->codecpar->codec_type == AVMEDIA_TYPE_AUDIO) - #ifndef _WIN32 - # pragma GCC diagnostic pop - #endif -@@ -238,7 +243,9 @@ bool AudioDecoder::SetFile(const std::st - # pragma GCC diagnostic push - # pragma GCC diagnostic ignored "-Wdeprecated-declarations" - #endif -- this->codecCtx = this->formatCtx->streams[audioStream]->codec; -+ this->codecCtx = avcodec_alloc_context3(nullptr); -+ avcodec_parameters_to_context(this->codecCtx, this->formatCtx->streams[audioStream]->codecpar); -+ - #ifndef _WIN32 - # pragma GCC diagnostic pop - #endif -Index: gazebo-11.10.1/gazebo/common/AudioDecoder.hh -=================================================================== ---- gazebo-11.10.1.orig/gazebo/common/AudioDecoder.hh -+++ gazebo-11.10.1/gazebo/common/AudioDecoder.hh -@@ -75,7 +75,7 @@ namespace gazebo - private: AVCodecContext *codecCtx; - - /// \brief libavcodec audio codec. -- private: AVCodec *codec; -+ private: const AVCodec *codec; - - /// \brief Index of the audio stream. - private: int audioStream; -Index: gazebo-11.10.1/gazebo/common/Video.cc -=================================================================== ---- gazebo-11.10.1.orig/gazebo/common/Video.cc -+++ gazebo-11.10.1/gazebo/common/Video.cc -@@ -77,7 +77,7 @@ void Video::Cleanup() - #ifdef HAVE_FFMPEG - bool Video::Load(const std::string &_filename) - { -- AVCodec *codec = nullptr; -+ const AVCodec *codec = nullptr; - this->videoStream = -1; - - if (this->formatCtx || this->avFrame || this->codecCtx) -@@ -107,7 +107,7 @@ bool Video::Load(const std::string &_fil - # pragma GCC diagnostic push - # pragma GCC diagnostic ignored "-Wdeprecated-declarations" - #endif -- if (this->formatCtx->streams[i]->codec->codec_type == AVMEDIA_TYPE_VIDEO) -+ if (this->formatCtx->streams[i]->codecpar->codec_type == AVMEDIA_TYPE_VIDEO) - #ifndef _WIN32 - # pragma GCC diagnostic pop - #endif -@@ -128,13 +128,14 @@ bool Video::Load(const std::string &_fil - # pragma GCC diagnostic push - # pragma GCC diagnostic ignored "-Wdeprecated-declarations" - #endif -- this->codecCtx = this->formatCtx->streams[this->videoStream]->codec; -+ this->codecCtx = avcodec_alloc_context3(nullptr); -+ avcodec_parameters_to_context(this->codecCtx, this->formatCtx->streams[this->videoStream]->codecpar); - #ifndef _WIN32 - # pragma GCC diagnostic pop - #endif - - // Find the decoder for the video stream -- codec = avcodec_find_decoder(this->codecCtx->codec_id); -+ codec = avcodec_find_decoder(this->formatCtx->streams[this->videoStream]->codecpar->codec_id); - if (codec == nullptr) - { - gzerr << "Codec not found\n"; -@@ -231,15 +232,19 @@ bool Video::GetNextFrame(unsigned char * - # pragma GCC diagnostic push - # pragma GCC diagnostic ignored "-Wdeprecated-declarations" - #endif -- int processedLength = avcodec_decode_video2(this->codecCtx, this->avFrame, -- &frameAvailable, &tmpPacket); -+ int processedLength = avcodec_send_packet(this->codecCtx, !tmpPacket.data && !tmpPacket.size ? nullptr : &tmpPacket); - #ifndef _WIN32 - # pragma GCC diagnostic pop - #endif -+ if (processedLength >= 0 || processedLength == AVERROR_EOF) { -+ processedLength = avcodec_receive_frame(this->codecCtx, this->avFrame); -+ frameAvailable = processedLength >= 0; -+ if (processedLength == AVERROR(EAGAIN) || processedLength == AVERROR_EOF) processedLength = 0; -+ } - if (processedLength < 0) - { - gzerr << "Error while processing the data\n"; -- break; -+ break; - } - - tmpPacket.data = tmpPacket.data + processedLength; -Index: gazebo-11.10.1/gazebo/common/VideoEncoder.cc -=================================================================== ---- gazebo-11.10.1.orig/gazebo/common/VideoEncoder.cc -+++ gazebo-11.10.1/gazebo/common/VideoEncoder.cc -@@ -224,7 +224,7 @@ bool VideoEncoder::Start(const std::stri - - // The remainder of this function handles FFMPEG initialization of a video - // stream -- AVOutputFormat *outputFormat = nullptr; -+ const AVOutputFormat *outputFormat = nullptr; - - // This 'if' and 'free' are just for safety. We chech the value of formatCtx - // below. -@@ -294,7 +294,7 @@ bool VideoEncoder::Start(const std::stri - } - - // find the video encoder -- AVCodec *encoder = avcodec_find_encoder( -+ const AVCodec *encoder = avcodec_find_encoder( - this->dataPtr->formatCtx->oformat->video_codec); - if (!encoder) - { |