automatic version update by autodist [release 4.4.0-1mamba;Tue Mar 25 2025]
This commit is contained in:
@@ -1,67 +0,0 @@
|
||||
From c72dbeafffa5b3262e90023e092bb1f9928d7079 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Robert-Andr=C3=A9=20Mauchin?= <zebob.m@gmail.com>
|
||||
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
|
||||
|
||||
@@ -1,184 +0,0 @@
|
||||
From fc8955ebbbb5d0afde2722b836dec8b4e07f2232 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Robert-Andr=C3=A9=20Mauchin?= <zebob.m@gmail.com>
|
||||
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<StreamInfo> 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_t*>(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
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index 97596dbee8d..d1ad6ac5de0 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -1237,13 +1237,6 @@ set_and_warn_dependency(WITH_PYTHON WITH_CYCLES OFF)
|
||||
set_and_warn_dependency(WITH_PYTHON WITH_DRACO OFF)
|
||||
set_and_warn_dependency(WITH_PYTHON WITH_MOD_FLUID OFF)
|
||||
|
||||
-if(NOT WITH_PYTHON_MODULE)
|
||||
- if(WITH_DRACO AND NOT WITH_PYTHON_INSTALL)
|
||||
- message(STATUS "WITH_DRACO requires WITH_PYTHON_INSTALL to be ON, disabling WITH_DRACO for now")
|
||||
- set(WITH_DRACO OFF)
|
||||
- endif()
|
||||
-endif()
|
||||
-
|
||||
# enable boost for cycles, audaspace or i18n
|
||||
# otherwise if the user disabled
|
||||
|
||||
27
blender.spec
27
blender.spec
@@ -1,6 +1,6 @@
|
||||
%define majver %(echo %version | sed "s|[a-z]*$||")
|
||||
Name: blender
|
||||
Version: 4.3.2
|
||||
Version: 4.4.0
|
||||
Release: 1mamba
|
||||
Summary: 3D modeling, animation, rendering and post-production
|
||||
Group: Applications/Multimedia
|
||||
@@ -10,9 +10,6 @@ Packager: Silvan Calarco <silvan.calarco@mambasoft.it>
|
||||
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
|
||||
Patch0: blender-4.3.0-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
|
||||
@@ -21,13 +18,13 @@ BuildRequires: libXfixes-devel
|
||||
BuildRequires: libXi-devel
|
||||
BuildRequires: libXrender-devel
|
||||
BuildRequires: libXxf86vm-devel
|
||||
BuildRequires: libalembic-devel
|
||||
BuildRequires: libatomic-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
|
||||
BuildRequires: libexpat-devel
|
||||
@@ -51,12 +48,12 @@ BuildRequires: libopenimageio-devel
|
||||
BuildRequires: libopenjpeg-devel
|
||||
BuildRequires: libopenvdb-devel
|
||||
BuildRequires: libopenxr-devel
|
||||
BuildRequires: libpipewire-devel
|
||||
BuildRequires: libpng-devel
|
||||
BuildRequires: libpotrace-devel
|
||||
BuildRequires: libpulseaudio-devel
|
||||
BuildRequires: libpystring-devel
|
||||
BuildRequires: libpython3-devel
|
||||
BuildRequires: libpython311-devel
|
||||
BuildRequires: libshaderc-devel
|
||||
BuildRequires: libsndfile-devel
|
||||
BuildRequires: libspnav-devel
|
||||
@@ -101,12 +98,8 @@ BuildRequires: python-numpy-py3
|
||||
Blender is the essential software solution you need for 3D, from modeling, animation, rendering and post-production to interactive creation and playback.
|
||||
Professionals and novices can easily and inexpensively publish stand-alone, secure, multi-platform content to the web, CD-ROMs, and other media, whether they are users of Windows, Linux, Irix, Sun Solaris, FreeBSD or OSX.
|
||||
|
||||
%debug_package
|
||||
|
||||
%prep
|
||||
%setup -q -a1
|
||||
#% setup -q -D -T
|
||||
#:<< _EOF
|
||||
|
||||
%ifarch aarch64
|
||||
sed -i "s|make_update.py|make_update.py --architecture arm64|" GNUmakefile
|
||||
@@ -114,10 +107,6 @@ sed -i "s|make_update.py|make_update.py --architecture arm64|" GNUmakefile
|
||||
|
||||
make update
|
||||
|
||||
%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 \
|
||||
@@ -154,8 +143,8 @@ cat > %{buildroot}%{_sysconfdir}/ld.so.conf.d/blender.conf << _EOF
|
||||
_EOF
|
||||
|
||||
# Manually install draco bindings
|
||||
mv %{buildroot}%{_datadir}/blender/4*/python/lib/python%{python3_version} %{buildroot}%{_libdir}/
|
||||
rm -rf %{buildroot}%{_datadir}/blender/4*/python
|
||||
#mv %{buildroot}%{_datadir}/blender/4*/python/lib/python%{python3_version} %{buildroot}%{_libdir}/
|
||||
#rm -rf %{buildroot}%{_datadir}/blender/4*/python
|
||||
|
||||
install -D -m644 release/freedesktop/org.blender.Blender.metainfo.xml \
|
||||
%{buildroot}%{_datadir}/metainfo/org.blender.Blender.metainfo.xml
|
||||
@@ -163,7 +152,6 @@ install -D -m644 release/freedesktop/org.blender.Blender.metainfo.xml \
|
||||
%clean
|
||||
[ "%{buildroot}" != "/" ] && rm -rf "%{buildroot}"
|
||||
|
||||
|
||||
%files
|
||||
%defattr(-, root, root)
|
||||
%{_sysconfdir}/ld.so.conf.d/blender.conf
|
||||
@@ -173,7 +161,7 @@ install -D -m644 release/freedesktop/org.blender.Blender.metainfo.xml \
|
||||
%dir %{_libdir}/blender
|
||||
%{_libdir}/blender/*.so
|
||||
%{_libdir}/blender/lib*.a
|
||||
%{python3_sitearch}/libextern_draco.so
|
||||
#%{python3_sitearch}/libextern_draco.so
|
||||
%{_datadir}/applications/blender.desktop
|
||||
%{_datadir}/metainfo/org.blender.Blender.metainfo.xml
|
||||
%dir %{_datadir}/blender
|
||||
@@ -185,6 +173,9 @@ install -D -m644 release/freedesktop/org.blender.Blender.metainfo.xml \
|
||||
#%{_mandir}/man1/blender.1.gz
|
||||
|
||||
%changelog
|
||||
* Tue Mar 25 2025 Automatic Build System <autodist@openmamba.org> 4.4.0-1mamba
|
||||
- automatic version update by autodist
|
||||
|
||||
* Tue Dec 17 2024 Automatic Build System <autodist@openmamba.org> 4.3.2-1mamba
|
||||
- automatic version update by autodist
|
||||
|
||||
|
||||
Reference in New Issue
Block a user