diff --git a/blender-3.6.2-force-draco2.patch b/blender-3.6.2-force-draco2.patch deleted file mode 100644 index 2c6c5e7..0000000 --- a/blender-3.6.2-force-draco2.patch +++ /dev/null @@ -1,21 +0,0 @@ -diff --git a/io_scene_gltf2/io/com/gltf2_io_draco_compression_extension.py b/io_scene_gltf2/io/com/gltf2_io_draco_compression_extension.py -index e7518ac4..c0d78564 100644 ---- a/io_scene_gltf2/io/com/gltf2_io_draco_compression_extension.py -+++ b/io_scene_gltf2/io/com/gltf2_io_draco_compression_extension.py -@@ -13,6 +13,7 @@ - # limitations under the License. - - import os -+import site - import sys - from pathlib import Path - import bpy -@@ -30,7 +31,7 @@ def dll_path() -> Path: - python_lib = Path('{v[0]}.{v[1]}/python/lib'.format(v=bpy.app.version)) - python_version = 'python{v[0]}.{v[1]}'.format(v=sys.version_info) - -- path = os.environ.get('BLENDER_EXTERN_DRACO_LIBRARY_PATH') -+ path = f"{site.getsitepackages()[0]}/libextern_draco.so" - if path is None: - path = { - 'win32': blender_root / python_lib / 'site-packages', diff --git a/blender-4.2.3-ffmpeg-7.1-1.patch b/blender-4.2.3-ffmpeg-7.1-1.patch new file mode 100644 index 0000000..8a04487 --- /dev/null +++ b/blender-4.2.3-ffmpeg-7.1-1.patch @@ -0,0 +1,67 @@ +From c72dbeafffa5b3262e90023e092bb1f9928d7079 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Robert-Andr=C3=A9=20Mauchin?= +Date: Tue, 14 May 2024 11:03:49 +0200 +Subject: [PATCH] Add compatibility with FFMPEG 7.0 + +key_frame was deprecated then remove, we should use AV_FRAME_FLAG_KEY +instead. + +read_seek2 and read_seek were internalized and can't be used anymore, so +we check directly the return of av_seek_frame. +--- + intern/ffmpeg/ffmpeg_compat.h | 9 +++++++++ + source/blender/imbuf/intern/anim_movie.cc | 11 +++++------ + 2 files changed, 14 insertions(+), 6 deletions(-) + +diff --git a/intern/ffmpeg/ffmpeg_compat.h b/intern/ffmpeg/ffmpeg_compat.h +index 91ea1701db6..78778482e8d 100644 +--- a/intern/ffmpeg/ffmpeg_compat.h ++++ b/intern/ffmpeg/ffmpeg_compat.h +@@ -141,6 +141,15 @@ int64_t av_get_frame_duration_in_pts_units(const AVFrame *picture) + #endif + } + ++FFMPEG_INLINE ++bool av_get_cur_key_frame_pts(const AVFrame *picture) { ++#if LIBAVUTIL_VERSION_INT >= AV_VERSION_INT(58, 29, 100) ++ return (picture->flags & AV_FRAME_FLAG_KEY); ++#else ++ return (picture->key_frame); ++#endif ++} ++ + /* -------------------------------------------------------------------- */ + /** \name Deinterlace code block + * +diff --git a/source/blender/imbuf/intern/anim_movie.cc b/source/blender/imbuf/intern/anim_movie.cc +index 3d51969dd46..bb07a8bb14c 100644 +--- a/source/blender/imbuf/intern/anim_movie.cc ++++ b/source/blender/imbuf/intern/anim_movie.cc +@@ -653,7 +653,7 @@ static void ffmpeg_decode_store_frame_pts(ImBufAnim *anim) + { + anim->cur_pts = av_get_pts_from_frame(anim->pFrame); + +- if (anim->pFrame->key_frame) { ++ if (av_get_cur_key_frame_pts(anim->pFrame)) { + anim->cur_key_frame_pts = anim->cur_pts; + } + +@@ -1032,11 +1032,10 @@ static int ffmpeg_seek_to_key_frame(ImBufAnim *anim, + + AVFormatContext *format_ctx = anim->pFormatCtx; + +- if (format_ctx->iformat->read_seek2 || format_ctx->iformat->read_seek) { +- ret = av_seek_frame(anim->pFormatCtx, anim->videoStream, seek_pos, AVSEEK_FLAG_BACKWARD); +- } +- else { +- ret = ffmpeg_generic_seek_workaround(anim, &seek_pos, pts_to_search); ++ int ret = av_seek_frame(anim->pFormatCtx, anim->videoStream, seek_pos, AVSEEK_FLAG_BACKWARD); ++ ++ if (ret < 0) { ++ ret = ffmpeg_generic_seek_workaround(anim, &seek_pos, pts_to_search);\ + av_log(anim->pFormatCtx, + AV_LOG_DEBUG, + "Adjusted final seek seek_pos = %" PRId64 "\n", +-- +2.30.2 + diff --git a/blender-4.2.3-ffmpeg-7.1-2.patch b/blender-4.2.3-ffmpeg-7.1-2.patch new file mode 100644 index 0000000..cd89a97 --- /dev/null +++ b/blender-4.2.3-ffmpeg-7.1-2.patch @@ -0,0 +1,184 @@ +From fc8955ebbbb5d0afde2722b836dec8b4e07f2232 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Robert-Andr=C3=A9=20Mauchin?= +Date: Sat, 18 May 2024 22:08:34 +0200 +Subject: [PATCH] Add compatibility with FFmpeg 7.0 within audaspace plugin + +We backport changes specific to FFmpeg 7.0 in audaspace, behind +HAVE_CH_LAYOUT, ensuring compatibility with previous versions. +--- + .../audaspace/plugins/ffmpeg/FFMPEGReader.cpp | 27 +++++++++-- + .../audaspace/plugins/ffmpeg/FFMPEGWriter.cpp | 46 +++++++++++++++++++ + 2 files changed, 69 insertions(+), 4 deletions(-) + +diff --git a/extern/audaspace/plugins/ffmpeg/FFMPEGReader.cpp b/extern/audaspace/plugins/ffmpeg/FFMPEGReader.cpp +index c0e16d6a887..3257daab442 100644 +--- a/extern/audaspace/plugins/ffmpeg/FFMPEGReader.cpp ++++ b/extern/audaspace/plugins/ffmpeg/FFMPEGReader.cpp +@@ -31,6 +31,10 @@ AUD_NAMESPACE_BEGIN + #define FFMPEG_OLD_CODE + #endif + ++#if LIBAVUTIL_VERSION_INT >= AV_VERSION_INT(57, 28, 100) ++#define HAVE_CH_LAYOUT ++#endif ++ + SampleFormat FFMPEGReader::convertSampleFormat(AVSampleFormat format) + { + switch(av_get_packed_sample_fmt(format)) +@@ -104,15 +108,22 @@ int FFMPEGReader::decode(AVPacket& packet, Buffer& buffer) + packet.size = orig_size; + #else + avcodec_send_packet(m_codecCtx, &packet); ++ + + while(true) + { + auto ret = avcodec_receive_frame(m_codecCtx, m_frame); + ++#ifdef HAVE_CH_LAYOUT ++ int nb_channels = m_codecCtx->ch_layout.nb_channels; ++#else ++ int nb_channels = m_codecCtx->channels; ++#endif ++ + if(ret != 0) + break; + +- int data_size = av_samples_get_buffer_size(nullptr, m_codecCtx->channels, m_frame->nb_samples, m_codecCtx->sample_fmt, 1); ++ int data_size = av_samples_get_buffer_size(nullptr, nb_channels, m_frame->nb_samples, m_codecCtx->sample_fmt, 1); + + if(buf_size - buf_pos < data_size) + { +@@ -122,12 +133,12 @@ int FFMPEGReader::decode(AVPacket& packet, Buffer& buffer) + + if(m_tointerleave) + { +- int single_size = data_size / m_codecCtx->channels / m_frame->nb_samples; +- for(int channel = 0; channel < m_codecCtx->channels; channel++) ++ int single_size = data_size / nb_channels / m_frame->nb_samples; ++ for(int channel = 0; channel < nb_channels; channel++) + { + for(int i = 0; i < m_frame->nb_samples; i++) + { +- std::memcpy(((data_t*)buffer.getBuffer()) + buf_pos + ((m_codecCtx->channels * i) + channel) * single_size, ++ std::memcpy(((data_t*)buffer.getBuffer()) + buf_pos + ((nb_channels * i) + channel) * single_size, + m_frame->data[channel] + i * single_size, single_size); + } + } +@@ -207,7 +218,11 @@ void FFMPEGReader::init(int stream) + if(avcodec_open2(m_codecCtx, aCodec, nullptr) < 0) + AUD_THROW(FileException, "File couldn't be read, ffmpeg codec couldn't be opened."); + ++#ifdef HAVE_CH_LAYOUT ++ m_specs.channels = (Channels) m_codecCtx->ch_layout.nb_channels; ++#else + m_specs.channels = (Channels) m_codecCtx->channels; ++#endif + m_tointerleave = av_sample_fmt_is_planar(m_codecCtx->sample_fmt); + + switch(av_get_packed_sample_fmt(m_codecCtx->sample_fmt)) +@@ -344,8 +359,12 @@ std::vector FFMPEGReader::queryStreams() + info.specs.channels = Channels(m_formatCtx->streams[i]->codec->channels); + info.specs.rate = m_formatCtx->streams[i]->codec->sample_rate; + info.specs.format = convertSampleFormat(m_formatCtx->streams[i]->codec->sample_fmt); ++#else ++#ifdef HAVE_CH_LAYOUT ++ info.specs.channels = Channels(m_formatCtx->streams[i]->codecpar->ch_layout.nb_channels); + #else + info.specs.channels = Channels(m_formatCtx->streams[i]->codecpar->channels); ++#endif + info.specs.rate = m_formatCtx->streams[i]->codecpar->sample_rate; + info.specs.format = convertSampleFormat(AVSampleFormat(m_formatCtx->streams[i]->codecpar->format)); + #endif +diff --git a/extern/audaspace/plugins/ffmpeg/FFMPEGWriter.cpp b/extern/audaspace/plugins/ffmpeg/FFMPEGWriter.cpp +index 9cadfe9c092..2f435c14b56 100644 +--- a/extern/audaspace/plugins/ffmpeg/FFMPEGWriter.cpp ++++ b/extern/audaspace/plugins/ffmpeg/FFMPEGWriter.cpp +@@ -34,6 +34,10 @@ AUD_NAMESPACE_BEGIN + #define FFMPEG_OLD_CODE + #endif + ++#if LIBAVUTIL_VERSION_INT >= AV_VERSION_INT(57, 28, 100) ++#define HAVE_CH_LAYOUT ++#endif ++ + void FFMPEGWriter::encode() + { + sample_t* data = m_input_buffer.getBuffer(); +@@ -77,8 +81,12 @@ void FFMPEGWriter::encode() + + m_frame->nb_samples = m_input_samples; + m_frame->format = m_codecCtx->sample_fmt; ++#ifdef HAVE_CH_LAYOUT ++ av_channel_layout_copy(&m_frame->ch_layout, &m_codecCtx->ch_layout); ++#else + m_frame->channel_layout = m_codecCtx->channel_layout; + m_frame->channels = m_specs.channels; ++#endif + + if(avcodec_fill_audio_frame(m_frame, m_specs.channels, m_codecCtx->sample_fmt, reinterpret_cast(data), m_input_buffer.getSize(), 0) < 0) + AUD_THROW(FileException, "File couldn't be written, filling the audio frame failed with ffmpeg."); +@@ -237,6 +245,39 @@ FFMPEGWriter::FFMPEGWriter(const std::string &filename, DeviceSpecs specs, Conta + break; + } + ++#ifdef HAVE_CH_LAYOUT ++ AVChannelLayout channel_layout{}; ++ ++ switch(m_specs.channels) ++ { ++ case CHANNELS_MONO: ++ channel_layout = AV_CHANNEL_LAYOUT_MONO; ++ break; ++ case CHANNELS_STEREO: ++ channel_layout = AV_CHANNEL_LAYOUT_STEREO; ++ break; ++ case CHANNELS_STEREO_LFE: ++ channel_layout = AV_CHANNEL_LAYOUT_2POINT1; ++ break; ++ case CHANNELS_SURROUND4: ++ channel_layout = AV_CHANNEL_LAYOUT_QUAD; ++ break; ++ case CHANNELS_SURROUND5: ++ channel_layout = AV_CHANNEL_LAYOUT_5POINT0_BACK; ++ break; ++ case CHANNELS_SURROUND51: ++ channel_layout = AV_CHANNEL_LAYOUT_5POINT1_BACK; ++ break; ++ case CHANNELS_SURROUND61: ++ channel_layout = AV_CHANNEL_LAYOUT_6POINT1_BACK; ++ break; ++ case CHANNELS_SURROUND71: ++ channel_layout = AV_CHANNEL_LAYOUT_7POINT1; ++ break; ++ default: ++ AUD_THROW(FileException, "File couldn't be written, channel layout not supported."); ++ } ++#else + uint64_t channel_layout = 0; + + switch(m_specs.channels) +@@ -268,6 +309,7 @@ FFMPEGWriter::FFMPEGWriter(const std::string &filename, DeviceSpecs specs, Conta + default: + AUD_THROW(FileException, "File couldn't be written, channel layout not supported."); + } ++#endif + + try + { +@@ -405,8 +447,12 @@ FFMPEGWriter::FFMPEGWriter(const std::string &filename, DeviceSpecs specs, Conta + + m_codecCtx->codec_type = AVMEDIA_TYPE_AUDIO; + m_codecCtx->bit_rate = bitrate; ++#ifdef HAVE_CH_LAYOUT ++ av_channel_layout_copy(&m_codecCtx->ch_layout, &channel_layout); ++#else + m_codecCtx->channel_layout = channel_layout; + m_codecCtx->channels = m_specs.channels; ++#endif + m_stream->time_base.num = m_codecCtx->time_base.num = 1; + m_stream->time_base.den = m_codecCtx->time_base.den = m_codecCtx->sample_rate; + +-- +2.30.2 + diff --git a/blender.spec b/blender.spec index 2af8fe1..ee583cd 100644 --- a/blender.spec +++ b/blender.spec @@ -1,6 +1,6 @@ %define majver %(echo %version | sed "s|[a-z]*$||") Name: blender -Version: 4.1.1 +Version: 4.2.3 Release: 1mamba Summary: 3D modeling, animation, rendering and post-production Group: Applications/Multimedia @@ -10,8 +10,9 @@ Packager: Silvan Calarco URL: https://www.blender.org Source0: https+git://projects.blender.org/blender/blender.git/v%{version}/blender-%{version}.tar.bz2 Source1: https://developer.download.nvidia.com/redist/optix/v7.7/OptiX-7.7-Include.zip -Patch5: blender-3.6.2-force-draco1.patch -Patch6: blender-3.6.2-force-draco2.patch +Patch0: blender-3.6.2-force-draco1.patch +Patch1: blender-4.2.3-ffmpeg-7.1-1.patch +Patch2: blender-4.2.3-ffmpeg-7.1-2.patch License: GPL ## AUTOBUILDREQ-BEGIN BuildRequires: glibc-devel @@ -22,11 +23,11 @@ BuildRequires: libXi-devel BuildRequires: libXrender-devel BuildRequires: libXxf86vm-devel BuildRequires: libatomic-devel -BuildRequires: libavcodec-ffmpeg-devel -BuildRequires: libavdevice-ffmpeg-devel -BuildRequires: libavfilter-ffmpeg-devel -BuildRequires: libavformat-ffmpeg-devel -BuildRequires: libavutil-ffmpeg-devel +BuildRequires: libavcodec-devel +BuildRequires: libavdevice-devel +BuildRequires: libavfilter-devel +BuildRequires: libavformat-devel +BuildRequires: libavutil-devel BuildRequires: libboost-devel BuildRequires: libembree-devel BuildRequires: libepoxy-devel @@ -37,16 +38,20 @@ BuildRequires: libgcc BuildRequires: libgmp-cxx-devel BuildRequires: libgmp-devel BuildRequires: libgomp-devel +BuildRequires: libharu-devel BuildRequires: libimath-devel BuildRequires: libjack-devel BuildRequires: libjemalloc-devel -BuildRequires: libjpeg-devel +BuildRequires: libjpeg-turbo BuildRequires: libminizip1-devel +BuildRequires: liboidn-devel BuildRequires: libopenal-devel BuildRequires: libopencolorio-devel BuildRequires: libopenexr-devel BuildRequires: libopenimageio-devel BuildRequires: libopenjpeg-devel +BuildRequires: libopenvdb-devel +BuildRequires: libopenxr-devel BuildRequires: libpng-devel BuildRequires: libpotrace-devel BuildRequires: libpulseaudio-devel @@ -56,9 +61,10 @@ BuildRequires: libpython311-devel BuildRequires: libsndfile-devel BuildRequires: libspnav-devel BuildRequires: libstdc++6-devel -BuildRequires: libswresample-ffmpeg-devel -BuildRequires: libswscale-ffmpeg-devel +BuildRequires: libswresample-devel +BuildRequires: libswscale-devel BuildRequires: libtbb-devel +BuildRequires: libtiff-devel BuildRequires: libwebp-devel BuildRequires: libxkbcommon-devel BuildRequires: libyaml-cpp-devel @@ -68,6 +74,7 @@ BuildRequires: pugixml-devel ## AUTOBUILDREQ-END BuildRequires: bash BuildRequires: gcc-c++ +BuildRequires: git-lfs BuildRequires: ldconfig BuildRequires: libtool BuildRequires: nasm @@ -103,18 +110,15 @@ sed -i "s|make_update.py|make_update.py --architecture arm64|" GNUmakefile make update -%define _default_patch_fuzz 2 -%patch 5 -p1 -b .force-draco1 -cd scripts/addons -%patch 6 -p1 -b .force-draco2 -cd ../.. +%patch 0 -p1 -F2 -b .force-draco1 +%patch 1 -p1 -b .ffmpeg-7.1-1 +%patch 2 -p1 -b .ffmpeg-7.1-2 %build #:<< _EOF %cmake -d build \ -DBUILD_SHARED_LIBS:BOOL=OFF \ -DCUDA_HOST_COMPILER=/usr/bin/gcc \ - -DLLVM_VERSION=16 \ -DPYTHON_VERSION=%{python3_version} \ -DHIP_ROOT_DIR=/opt/rocm \ -DOPTIX_ROOT_DIR="${PWD}" \ @@ -153,8 +157,6 @@ install -D -m644 release/freedesktop/org.blender.Blender.metainfo.xml \ %clean [ "%{buildroot}" != "/" ] && rm -rf "%{buildroot}" -%post -p /sbin/ldconfig -%postun -p /sbin/ldconfig %files %defattr(-, root, root) @@ -177,6 +179,9 @@ install -D -m644 release/freedesktop/org.blender.Blender.metainfo.xml \ #%{_mandir}/man1/blender.1.gz %changelog +* Tue Oct 22 2024 Automatic Build System 4.2.3-1mamba +- automatic version update by autodist + * Tue Apr 16 2024 Automatic Build System 4.1.1-1mamba - automatic version update by autodist