diff options
author | CoprDistGit <infra@openeuler.org> | 2025-01-30 16:44:22 +0000 |
---|---|---|
committer | CoprDistGit <infra@openeuler.org> | 2025-01-30 16:44:22 +0000 |
commit | 4232f9996f1d47ba168254e50601b54041899d08 (patch) | |
tree | d162fd2a6ef318d8927f5065e4a7c2865a713321 | |
parent | 651ba008d9e5b2844835552ead82d9734b1e0037 (diff) |
automatic import of ffmpegopeneuler24.03_LTS
-rw-r--r-- | avformat-get_first_dts.patch | 46 | ||||
-rw-r--r-- | backport-CVE-2025-0518.patch | 26 | ||||
-rw-r--r-- | ffmpeg-7.1-build-with-texinfo-7.2.patch | 274 | ||||
-rw-r--r-- | ffmpeg-7.1.tar.xz | 3 | ||||
-rw-r--r-- | ffmpeg.spec | 489 | ||||
-rw-r--r-- | fix_libsvgdec_compile_error.patch | 27 | ||||
-rw-r--r-- | sources | 0 |
7 files changed, 865 insertions, 0 deletions
diff --git a/avformat-get_first_dts.patch b/avformat-get_first_dts.patch new file mode 100644 index 0000000..35f2b72 --- /dev/null +++ b/avformat-get_first_dts.patch @@ -0,0 +1,46 @@ +commit 95aab0fd83619408995720ce53d7a74790580220 +author liberato@chromium.org <liberato@chromium.org> Thu Jul 08 02:01:22 2021 +committer liberato@chromium.org <liberato@chromium.org> Thu Jul 08 02:01:22 2021 +tree ac725b5e2c548c8142aa7096d8184d87d3876a49 +parent e073b7a22e4993e0a7cab80a42a21524e5349f95 + +Add av_stream_get_first_dts for Chromium + +--- + libavformat/avformat.h | 4 ++++ + libavformat/utils.c | 7 +++++++ + 2 files changed, 11 insertions(+) + +Index: ffmpeg-7.1/libavformat/avformat.h +=================================================================== +--- ffmpeg-7.1.orig/libavformat/avformat.h ++++ ffmpeg-7.1/libavformat/avformat.h +@@ -1170,6 +1170,10 @@ + + struct AVCodecParserContext *av_stream_get_parser(const AVStream *s); + ++// Chromium: We use the internal field first_dts vvv ++int64_t av_stream_get_first_dts(const AVStream *st); ++// Chromium: We use the internal field first_dts ^^^ ++ + #define AV_PROGRAM_RUNNING 1 + + /** +Index: ffmpeg-7.1/libavformat/utils.c +========================================================== +--- ffmpeg-7.1/libavformat/utils.c ++++ ffmpeg-7.1/libavformat/utils.c +@@ -44,6 +44,13 @@ + * various utility functions for use within FFmpeg + */ + ++// Chromium: We use the internal field first_dts vvv ++int64_t av_stream_get_first_dts(const AVStream *st) ++{ ++ return cffstream(st)->first_dts; ++} ++// Chromium: We use the internal field first_dts ^^^ ++ + /* an arbitrarily chosen "sane" max packet size -- 50M */ + #define SANE_CHUNK_SIZE (50000000) + diff --git a/backport-CVE-2025-0518.patch b/backport-CVE-2025-0518.patch new file mode 100644 index 0000000..6300c1c --- /dev/null +++ b/backport-CVE-2025-0518.patch @@ -0,0 +1,26 @@ +From b5b6391d64807578ab872dc58fb8aa621dcfc38a Mon Sep 17 00:00:00 2001 +From: Michael Niedermayer <michael@niedermayer.cc> +Date: Mon, 6 Jan 2025 22:01:39 +0100 +Subject: [PATCH] avfilter/af_pan: Fix sscanf() use + +Fixes: Memory Data Leak + +Found-by: Simcha Kosman <simcha.kosman@cyberark.com> +Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> +--- + libavfilter/af_pan.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/libavfilter/af_pan.c b/libavfilter/af_pan.c +index 0d20b0307b3bf..5feb2439c72e2 100644 +--- a/libavfilter/af_pan.c ++++ b/libavfilter/af_pan.c +@@ -196,7 +196,7 @@ static av_cold int init(AVFilterContext *ctx) + sign = 1; + while (1) { + gain = 1; +- if (sscanf(arg, "%lf%n *%n", &gain, &len, &len)) ++ if (sscanf(arg, "%lf%n *%n", &gain, &len, &len) >= 1) + arg += len; + if (parse_channel_name(&arg, &in_ch_id, &named)){ + av_log(ctx, AV_LOG_ERROR, diff --git a/ffmpeg-7.1-build-with-texinfo-7.2.patch b/ffmpeg-7.1-build-with-texinfo-7.2.patch new file mode 100644 index 0000000..e910b29 --- /dev/null +++ b/ffmpeg-7.1-build-with-texinfo-7.2.patch @@ -0,0 +1,274 @@ +--- + doc/t2h.pm | 169 ++++++++++++++++++++++++++++++++++++++++------------- + 1 file changed, 129 insertions(+), 40 deletions(-) + +diff --git a/doc/t2h.pm b/doc/t2h.pm +index b7485e1f1e..1359960f27 100644 +--- a/doc/t2h.pm ++++ b/doc/t2h.pm +@@ -54,12 +54,24 @@ sub get_formatting_function($$) { + } + + # determine texinfo version +-my $program_version_num = version->declare(ff_get_conf('PACKAGE_VERSION'))->numify; ++my $package_version = ff_get_conf('PACKAGE_VERSION'); ++$package_version =~ s/\+dev$//; ++my $program_version_num = version->declare($package_version)->numify; + my $program_version_6_8 = $program_version_num >= 6.008000; + + # no navigation elements + ff_set_from_init_file('HEADERS', 0); + ++my %sectioning_commands = %Texinfo::Common::sectioning_commands; ++if (scalar(keys(%sectioning_commands)) == 0) { ++ %sectioning_commands = %Texinfo::Commands::sectioning_heading_commands; ++} ++ ++my %root_commands = %Texinfo::Common::root_commands; ++if (scalar(keys(%root_commands)) == 0) { ++ %root_commands = %Texinfo::Commands::root_commands; ++} ++ + sub ffmpeg_heading_command($$$$$) + { + my $self = shift; +@@ -77,6 +89,9 @@ sub ffmpeg_heading_command($$$$$) + return $result; + } + ++ # no need to set it as the $element_id is output unconditionally ++ my $heading_id; ++ + my $element_id = $self->command_id($command); + $result .= "<a name=\"$element_id\"></a>\n" + if (defined($element_id) and $element_id ne ''); +@@ -84,24 +99,40 @@ sub ffmpeg_heading_command($$$$$) + print STDERR "Process $command " + .Texinfo::Structuring::_print_root_command_texi($command)."\n" + if ($self->get_conf('DEBUG')); +- my $element; +- if ($Texinfo::Common::root_commands{$command->{'cmdname'}} +- and $command->{'parent'} +- and $command->{'parent'}->{'type'} +- and $command->{'parent'}->{'type'} eq 'element') { +- $element = $command->{'parent'}; ++ my $output_unit; ++ if ($root_commands{$command->{'cmdname'}}) { ++ if ($command->{'associated_unit'}) { ++ $output_unit = $command->{'associated_unit'}; ++ } elsif ($command->{'structure'} ++ and $command->{'structure'}->{'associated_unit'}) { ++ $output_unit = $command->{'structure'}->{'associated_unit'}; ++ } elsif ($command->{'parent'} ++ and $command->{'parent'}->{'type'} ++ and $command->{'parent'}->{'type'} eq 'element') { ++ $output_unit = $command->{'parent'}; ++ } + } +- if ($element) { ++ ++ if ($output_unit) { + $result .= &{get_formatting_function($self, 'format_element_header')}($self, $cmdname, +- $command, $element); ++ $command, $output_unit); + } + + my $heading_level; + # node is used as heading if there is nothing else. + if ($cmdname eq 'node') { +- if (!$element or (!$element->{'extra'}->{'section'} +- and $element->{'extra'}->{'node'} +- and $element->{'extra'}->{'node'} eq $command ++ if (!$output_unit or ++ (((!$output_unit->{'extra'}->{'section'} ++ and $output_unit->{'extra'}->{'node'} ++ and $output_unit->{'extra'}->{'node'} eq $command) ++ or ++ ((($output_unit->{'extra'}->{'unit_command'} ++ and $output_unit->{'extra'}->{'unit_command'} eq $command) ++ or ++ ($output_unit->{'unit_command'} ++ and $output_unit->{'unit_command'} eq $command)) ++ and $command->{'extra'} ++ and not $command->{'extra'}->{'associated_section'})) + # bogus node may not have been normalized + and defined($command->{'extra'}->{'normalized'}))) { + if ($command->{'extra'}->{'normalized'} eq 'Top') { +@@ -111,7 +142,15 @@ sub ffmpeg_heading_command($$$$$) + } + } + } else { +- $heading_level = $command->{'level'}; ++ if (defined($command->{'extra'}) ++ and defined($command->{'extra'}->{'section_level'})) { ++ $heading_level = $command->{'extra'}->{'section_level'}; ++ } elsif ($command->{'structure'} ++ and defined($command->{'structure'}->{'section_level'})) { ++ $heading_level = $command->{'structure'}->{'section_level'}; ++ } else { ++ $heading_level = $command->{'level'}; ++ } + } + + my $heading = $self->command_text($command); +@@ -119,8 +158,8 @@ sub ffmpeg_heading_command($$$$$) + # if there is an error in the node. + if (defined($heading) and $heading ne '' and defined($heading_level)) { + +- if ($Texinfo::Common::root_commands{$cmdname} +- and $Texinfo::Common::sectioning_commands{$cmdname}) { ++ if ($root_commands{$cmdname} ++ and $sectioning_commands{$cmdname}) { + my $content_href = $self->command_contents_href($command, 'contents', + $self->{'current_filename'}); + if ($content_href) { +@@ -140,7 +179,13 @@ sub ffmpeg_heading_command($$$$$) + } + } + +- if ($self->in_preformatted()) { ++ my $in_preformatted; ++ if ($program_version_num >= 7.001090) { ++ $in_preformatted = $self->in_preformatted_context(); ++ } else { ++ $in_preformatted = $self->in_preformatted(); ++ } ++ if ($in_preformatted) { + $result .= $heading."\n"; + } else { + # if the level was changed, set the command name right +@@ -149,21 +194,25 @@ sub ffmpeg_heading_command($$$$$) + $cmdname + = $Texinfo::Common::level_to_structuring_command{$cmdname}->[$heading_level]; + } +- # format_heading_text expects an array of headings for texinfo >= 7.0 + if ($program_version_num >= 7.000000) { +- $heading = [$heading]; +- } +- $result .= &{get_formatting_function($self,'format_heading_text')}( ++ $result .= &{get_formatting_function($self,'format_heading_text')}($self, ++ $cmdname, [$cmdname], $heading, ++ $heading_level +$self->get_conf('CHAPTER_HEADER_LEVEL') -1, ++ $heading_id, $command); ++ ++ } else { ++ $result .= &{get_formatting_function($self,'format_heading_text')}( + $self, $cmdname, $heading, + $heading_level + + $self->get_conf('CHAPTER_HEADER_LEVEL') - 1, $command); ++ } + } + } + $result .= $content if (defined($content)); + return $result; + } + +-foreach my $command (keys(%Texinfo::Common::sectioning_commands), 'node') { ++foreach my $command (keys(%sectioning_commands), 'node') { + texinfo_register_command_formatting($command, \&ffmpeg_heading_command); + } + +@@ -188,28 +237,56 @@ sub ffmpeg_begin_file($$$) + my $filename = shift; + my $element = shift; + +- my $command; +- if ($element and $self->get_conf('SPLIT')) { +- $command = $self->element_command($element); ++ my ($element_command, $node_command, $command_for_title); ++ if ($element) { ++ if ($element->{'unit_command'}) { ++ $element_command = $element->{'unit_command'}; ++ } elsif ($self->can('tree_unit_element_command')) { ++ $element_command = $self->tree_unit_element_command($element); ++ } elsif ($self->can('tree_unit_element_command')) { ++ $element_command = $self->element_command($element); ++ } ++ ++ $node_command = $element_command; ++ if ($element_command and $element_command->{'cmdname'} ++ and $element_command->{'cmdname'} ne 'node' ++ and $element_command->{'extra'} ++ and $element_command->{'extra'}->{'associated_node'}) { ++ $node_command = $element_command->{'extra'}->{'associated_node'}; ++ } ++ ++ $command_for_title = $element_command if ($self->get_conf('SPLIT')); + } + +- my ($title, $description, $encoding, $date, $css_lines, +- $doctype, $bodytext, $copying_comment, $after_body_open, +- $extra_head, $program_and_version, $program_homepage, ++ my ($title, $description, $keywords, $encoding, $date, $css_lines, $doctype, ++ $root_html_element_attributes, $body_attributes, $copying_comment, ++ $after_body_open, $extra_head, $program_and_version, $program_homepage, + $program, $generator); +- if ($program_version_num >= 7.000000) { +- ($title, $description, $encoding, $date, $css_lines, +- $doctype, $bodytext, $copying_comment, $after_body_open, ++ if ($program_version_num >= 7.001090) { ++ ($title, $description, $keywords, $encoding, $date, $css_lines, $doctype, ++ $root_html_element_attributes, $body_attributes, $copying_comment, ++ $after_body_open, $extra_head, $program_and_version, $program_homepage, ++ $program, $generator) = $self->_file_header_information($command_for_title, ++ $filename); ++ } elsif ($program_version_num >= 7.000000) { ++ ($title, $description, $encoding, $date, $css_lines, $doctype, ++ $root_html_element_attributes, $copying_comment, $after_body_open, + $extra_head, $program_and_version, $program_homepage, +- $program, $generator) = $self->_file_header_information($command); ++ $program, $generator) = $self->_file_header_information($command_for_title, ++ $filename); + } else { + ($title, $description, $encoding, $date, $css_lines, +- $doctype, $bodytext, $copying_comment, $after_body_open, +- $extra_head, $program_and_version, $program_homepage, +- $program, $generator) = $self->_file_header_informations($command); ++ $doctype, $root_html_element_attributes, $copying_comment, ++ $after_body_open, $extra_head, $program_and_version, $program_homepage, ++ $program, $generator) = $self->_file_header_informations($command_for_title); + } + +- my $links = $self->_get_links ($filename, $element); ++ my $links; ++ if ($program_version_num >= 7.000000) { ++ $links = $self->_get_links($filename, $element, $node_command); ++ } else { ++ $links = $self->_get_links ($filename, $element); ++ } + + my $head1 = $ENV{"FFMPEG_HEADER1"} || <<EOT; + <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +@@ -252,13 +329,25 @@ sub ffmpeg_program_string($) + if (defined($self->get_conf('PROGRAM')) + and $self->get_conf('PROGRAM') ne '' + and defined($self->get_conf('PACKAGE_URL'))) { +- return $self->convert_tree( ++ if ($program_version_num >= 7.001090) { ++ return $self->convert_tree( ++ $self->cdt('This document was generated using @uref{{program_homepage}, @emph{{program}}}.', ++ { 'program_homepage' => {'text' => $self->get_conf('PACKAGE_URL')}, ++ 'program' => {'text' => $self->get_conf('PROGRAM') }})); ++ } else { ++ return $self->convert_tree( + $self->gdt('This document was generated using @uref{{program_homepage}, @emph{{program}}}.', +- { 'program_homepage' => $self->get_conf('PACKAGE_URL'), +- 'program' => $self->get_conf('PROGRAM') })); ++ { 'program_homepage' => {'text' => $self->get_conf('PACKAGE_URL')}, ++ 'program' => {'text' => $self->get_conf('PROGRAM') }})); ++ } + } else { +- return $self->convert_tree( +- $self->gdt('This document was generated automatically.')); ++ if ($program_version_num >= 7.001090) { ++ return $self->convert_tree( ++ $self->cdt('This document was generated automatically.')); ++ } else { ++ return $self->convert_tree( ++ $self->gdt('This document was generated automatically.')); ++ } + } + } + if ($program_version_6_8) { +-- +2.45.2 diff --git a/ffmpeg-7.1.tar.xz b/ffmpeg-7.1.tar.xz new file mode 100644 index 0000000..ff3d112 --- /dev/null +++ b/ffmpeg-7.1.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:40973d44970dbc83ef302b0609f2e74982be2d85916dd2ee7472d30678a7abe6 +size 11011364 diff --git a/ffmpeg.spec b/ffmpeg.spec new file mode 100644 index 0000000..55ef158 --- /dev/null +++ b/ffmpeg.spec @@ -0,0 +1,489 @@ +# Cuda and others are only available on some arches +%global cuda_arches x86_64 +# flavor nonfree +%if 0%{?_with_cuda:1} +%global debug_package %{nil} +%global flavor -cuda +%global progs_suffix -cuda +#global build_suffix -lgpl +%ifarch %{cuda_arches} +%global _with_cuvid 1 +%global _with_libnpp 1 +%endif +%global _with_fdk_aac 1 +%global _without_cdio 1 +%global _without_frei0r 1 +%global _without_gpl 1 +%global _without_vidstab 1 +%global _without_x264 1 +%global _without_x265 1 +%global _without_xvid 1 +%endif + +# Disable nvenc +%global _without_nvenc 0 + +# extras flags +%if 0%{!?_cuda_version:1} +%global _cuda_version 10.2 +%endif +%global _cuda_version_rpm %(echo %{_cuda_version} | sed -e 's/\\./-/') +%global _cuda_bindir %{_cuda_prefix}/bin +%if 0%{?_with_cuda:1} +%global cuda_cflags $(pkg-config --cflags cuda-%{_cuda_version}) +%global cuda_ldflags $(pkg-config --libs cuda-%{_cuda_version}) +%endif + +%if 0%{?_with_libnpp:1} +%global libnpp_cflags $(pkg-config --cflags nppi-%{_cuda_version} nppc-%{_cuda_version}) +%global libnpp_ldlags $(pkg-config --libs-only-L nppi-%{_cuda_version} nppc-%{_cuda_version}) +%endif + +%if 0%{?_with_rpi:1} +%global _with_omx 1 +%global _with_omx_rpi 1 +%global _with_mmal 1 +%endif + +%if 0%{?_without_gpl} +%global lesser L +%endif + +%if 0%{!?_without_amr} || 0%{?_with_gmp} || 0%{?_with_smb} +%global ffmpeg_license %{?lesser}GPLv3+ +%else +%global ffmpeg_license %{?lesser}GPLv2+ +%endif + +%if "%{?toolchain}" == "clang" +%bcond_without compiler_clang +%endif + +# Fails due to asm issue +%ifarch %{ix86} +%bcond_with lto +%else +%bcond_without lto +%endif + +%if %{without lto} +%global _lto_cflags %{nil} +%endif + +Summary: Digital VCR and streaming server +Name: ffmpeg%{?flavor} +Version: 7.1 +Release: 4 +License: GPL-3.0-or-later +URL: https://ffmpeg.org/ +Source0: https://ffmpeg.org/releases/ffmpeg-%{version}.tar.xz +# Special patch for building chromium +Patch0: avformat-get_first_dts.patch +Patch5: fix_libsvgdec_compile_error.patch +# https://ffmpeg.org//pipermail/ffmpeg-devel/2024-November/335575.html +Patch6: ffmpeg-7.1-build-with-texinfo-7.2.patch +Patch7: backport-CVE-2025-0518.patch +Requires: %{name}-libs%{?_isa} = %{version}-%{release} +%{?_with_cuda:BuildRequires: cuda-minimal-build-%{_cuda_version_rpm} cuda-drivers-devel} +%{?_with_libnpp:BuildRequires: pkgconfig(nppc-%{_cuda_version})} +BuildRequires: alsa-lib-devel +BuildRequires: bzip2-devel +%{?_with_faac:BuildRequires: faac-devel} +%{?_with_fdk_aac:BuildRequires: fdk-aac-devel} +%{?_with_flite:BuildRequires: flite-devel} +BuildRequires: fontconfig-devel +BuildRequires: freetype-devel +BuildRequires: fribidi-devel +%{!?_without_frei0r:BuildRequires: frei0r-devel} +%{?_with_gme:BuildRequires: game-music-emu-devel} +BuildRequires: gnutls-devel +BuildRequires: gsm-devel +%{?_with_ilbc:BuildRequires: ilbc-devel} +BuildRequires: lame-devel >= 3.98.3 +%{!?_without_jack:BuildRequires: jack-audio-connection-kit-devel} +%{!?_without_ladspa:BuildRequires: ladspa-devel} +%{!?_without_aom:BuildRequires: libaom-devel} +%{!?_without_dav1d:BuildRequires: libdav1d-devel >= 0.2.1} +%{!?_without_ass:BuildRequires: libass-devel} +%{!?_without_bluray:BuildRequires: libbluray-devel} +%{?_with_bs2b:BuildRequires: libbs2b-devel} +%{?_with_caca:BuildRequires: libcaca-devel} +%{!?_without_cdio:BuildRequires: libcdio-paranoia-devel} +%{?_with_chromaprint:BuildRequires: libchromaprint-devel} +%if 0%{?_with_ieee1394} +BuildRequires: libavc1394-devel +BuildRequires: libdc1394-devel +BuildRequires: libiec61883-devel +%endif +BuildRequires: libdrm-devel +BuildRequires: libgcrypt-devel +BuildRequires: libGL-devel +BuildRequires: libmodplug-devel +BuildRequires: librsvg2-devel +%{?_with_rtmp:BuildRequires: librtmp-devel} +%{?_with_smb:BuildRequires: libsmbclient-devel} +%{!?_without_srt:BuildRequires: srt-devel > 1.3.0} +BuildRequires: libssh-devel +BuildRequires: libtheora-devel +BuildRequires: libv4l-devel +%{?!_without_vaapi:BuildRequires: libva-devel >= 0.31.0} +BuildRequires: libvdpau-devel +BuildRequires: libvorbis-devel +%{?!_without_vpx:BuildRequires: libvpx-devel >= 1.4.0} +%ifarch %{ix86} x86_64 +BuildRequires: nasm +%endif +%{?_with_webp:BuildRequires: libwebp-devel} +%{?_with_netcdf:BuildRequires: netcdf-devel} +%{?_with_rpi:BuildRequires: raspberrypi-vc-devel} +%{!?_without_nvenc:BuildRequires: nv-codec-headers} +%{!?_without_amr:BuildRequires: opencore-amr-devel vo-amrwbenc-devel} +%{?_with_omx:BuildRequires: libomxil-bellagio-devel} +BuildRequires: libxcb-devel +%{!?_without_openal:BuildRequires: openal-soft-devel} +%if 0%{!?_without_opencl:1} +BuildRequires: opencl-headers ocl-icd-devel +Recommends: opencl-icd +%endif +%{?_with_opencv:BuildRequires: opencv-devel} +BuildRequires: openjpeg2-devel +%{!?_without_opus:BuildRequires: opus-devel >= 1.1.3} +%{!?_without_pulse:BuildRequires: pulseaudio-libs-devel} +BuildRequires: perl(Pod::Man) +%{?_with_rubberband:BuildRequires: rubberband-devel} +%{!?_without_tools:BuildRequires: SDL2-devel} +%{?_with_snappy:BuildRequires: snappy-devel} +BuildRequires: soxr-devel +BuildRequires: speex-devel +%{?_with_tesseract:BuildRequires: tesseract-devel} +#BuildRequires: texi2html +BuildRequires: texinfo +%{?_with_twolame:BuildRequires: twolame-devel} +%{?_with_wavpack:BuildRequires: wavpack-devel} +%{!?_without_vidstab:BuildRequires: vid.stab-devel} +%{!?_without_x264:BuildRequires: x264-devel >= 0.0.0-0.31} +%{!?_without_x265:BuildRequires: x265-devel} +%{!?_without_xvid:BuildRequires: xvidcore-devel} +BuildRequires: zimg-devel >= 2.7.0 +BuildRequires: zlib-devel +%{?_with_zmq:BuildRequires: zeromq-devel} +%{!?_without_zvbi:BuildRequires: zvbi-devel} + +%description +FFmpeg is a complete and free Internet live audio and video +broadcasting solution for Linux/Unix. It also includes a digital +VCR. It can encode in real time in many formats including MPEG1 audio +and video, MPEG4, h263, ac3, asf, avi, real, mjpeg, and flash. + +%package libs +Summary: Libraries for %{name} + +%description libs +FFmpeg is a complete and free Internet live audio and video +broadcasting solution for Linux/Unix. It also includes a digital +VCR. It can encode in real time in many formats including MPEG1 audio +and video, MPEG4, h263, ac3, asf, avi, real, mjpeg, and flash. +This package contains the libraries for %{name} + +%package -n libavdevice%{?flavor} +Summary: Special devices muxing/demuxing library +Requires: %{name}-libs%{_isa} = %{version}-%{release} +Requires: jack-audio-connection-kit + +%description -n libavdevice%{?flavor} +Libavdevice is a complementary library to libavf "libavformat". It provides +various "special" platform-specific muxers and demuxers, e.g. for grabbing +devices, audio capture and playback etc. + +%package devel +Summary: Development package for %{name} +Requires: %{name}-libs%{_isa} = %{version}-%{release} +Requires: libavdevice%{?flavor}%{_isa} = %{version}-%{release} + +%description devel +FFmpeg is a complete and free Internet live audio and video +broadcasting solution for Linux/Unix. It also includes a digital +VCR. It can encode in real time in many formats including MPEG1 audio +and video, MPEG4, h263, ac3, asf, avi, real, mjpeg, and flash. +This package contains development files for %{name} + +# Don't use the %%configure macro as this is not an autotool script +%global ff_configure \ +./configure \\\ + --prefix=%{_prefix} \\\ + --bindir=%{_bindir} \\\ + --datadir=%{_datadir}/%{name} \\\ + --docdir=%{_docdir}/%{name} \\\ + --incdir=%{_includedir}/%{name} \\\ + --libdir=%{_libdir} \\\ + --mandir=%{_mandir} \\\ + --arch=%{_target_cpu} \\\ + --optflags="%{optflags}" \\\ + --extra-ldflags="%{?__global_ldflags} %{?cuda_ldflags} %{?libnpp_ldlags}" \\\ + --extra-cflags="%{?cuda_cflags} %{?libnpp_cflags}" \\\ + %{?flavor:--disable-manpages} \\\ + %{?progs_suffix:--progs-suffix=%{progs_suffix}} \\\ + %{?build_suffix:--build-suffix=%{build_suffix}} \\\ + %{!?_without_amr:--enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libvo-amrwbenc --enable-version3} \\\ + --enable-bzlib \\\ + %{?_with_chromaprint:--enable-chromaprint} \\\ + --enable-fontconfig \\\ + %{!?_without_frei0r:--enable-frei0r} \\\ + --enable-gcrypt \\\ + %{?_with_gmp:--enable-gmp --enable-version3} \\\ + --enable-gnutls \\\ + %{!?_without_ladspa:--enable-ladspa} \\\ + %{!?_without_aom:--enable-libaom} \\\ + %{!?_without_dav1d:--enable-libdav1d} \\\ + %{!?_without_ass:--enable-libass} \\\ + %{!?_without_bluray:--enable-libbluray} \\\ + %{?_with_bs2b:--enable-libbs2b} \\\ + %{?_with_caca:--enable-libcaca} \\\ + %{?_with_cuda:--enable-cuda-sdk --enable-nonfree} \\\ + %{?_with_cuvid:--enable-cuvid --enable-nonfree} \\\ + %{!?_without_cdio:--enable-libcdio} \\\ + %{?_with_ieee1394:--enable-libdc1394 --enable-libiec61883} \\\ + --enable-libdrm \\\ + %{?_with_faac:--enable-libfaac --enable-nonfree} \\\ + %{?_with_fdk_aac:--enable-libfdk-aac --enable-nonfree} \\\ + %{?_with_flite:--enable-libflite} \\\ + %{!?_without_jack:--enable-libjack} \\\ + --enable-libfreetype \\\ + %{!?_without_fribidi:--enable-libfribidi} \\\ + %{?_with_gme:--enable-libgme} \\\ + --enable-libgsm \\\ + %{?_with_ilbc:--enable-libilbc} \\\ + %{?_with_libnpp:--enable-libnpp --enable-nonfree} \\\ + --enable-libmp3lame \\\ + %{?_with_netcdf:--enable-netcdf} \\\ + %{?_with_mmal:--enable-mmal} \\\ + %{!?_without_nvenc:--enable-nvenc} \\\ + %{?_with_omx:--enable-omx} \\\ + %{?_with_omx_rpi:--enable-omx-rpi} \\\ + %{!?_without_openal:--enable-openal} \\\ + %{!?_without_opencl:--enable-opencl} \\\ + %{?_with_opencv:--enable-libopencv} \\\ + %{!?_without_opengl:--enable-opengl} \\\ + --enable-libopenjpeg \\\ + %{!?_without_opus:--enable-libopus} \\\ + %{!?_without_pulse:--enable-libpulse} \\\ + --enable-librsvg \\\ + %{?_with_rtmp:--enable-librtmp} \\\ + %{?_with_rubberband:--enable-librubberband} \\\ + %{?_with_smb:--enable-libsmbclient} \\\ + %{?_with_snappy:--enable-libsnappy} \\\ + %{!?_without_srt:--enable-libsrt} \\\ + --enable-libsoxr \\\ + --enable-libspeex \\\ + --enable-libssh \\\ + %{?_with_tesseract:--enable-libtesseract} \\\ + --enable-libtheora \\\ + %{?_with_twolame:--enable-libtwolame} \\\ + --enable-libvorbis \\\ + --enable-libv4l2 \\\ + %{!?_without_vidstab:--enable-libvidstab} \\\ + %{!?_without_vpx:--enable-libvpx} \\\ + %{?_with_webp:--enable-libwebp} \\\ + %{!?_without_x264:--enable-libx264} \\\ + %{!?_without_x265:--enable-libx265} \\\ + %{!?_without_xvid:--enable-libxvid} \\\ + --enable-libzimg \\\ + %{?_with_zmq:--enable-libzmq} \\\ + %{!?_without_zvbi:--enable-libzvbi} \\\ + %{!?_without_lto:--enable-lto} \\\ + --enable-avfilter \\\ + --enable-libmodplug \\\ + --enable-postproc \\\ + --enable-pthreads \\\ + --disable-static \\\ + --enable-shared \\\ + %{!?_without_gpl:--enable-gpl} \\\ + --disable-debug \\\ + --disable-stripping \\\ + %{?with_compiler_clang:--cc=clang --cxx=clang --host-cc=clang} + + +%prep +%autosetup -p1 -n ffmpeg-%{version} +# fix -O3 -g in host_cflags +sed -i "s|check_host_cflags -O3|check_host_cflags %{optflags}|" configure +mkdir -p _doc/examples +cp -pr doc/examples/{*.c,Makefile,README} _doc/examples/ + +%build +%{?_with_cuda:export PATH=${PATH}:%{_cuda_bindir}} +%{ff_configure}\ + --shlibdir=%{_libdir} \ +%if 0%{?_without_tools:1} + --disable-doc \ + --disable-ffmpeg --disable-ffplay --disable-ffprobe \ +%endif +%ifarch %{ix86} + --cpu=%{_target_cpu} \ +%endif +%ifarch %{ix86} x86_64 %{power64} + --enable-runtime-cpudetect \ +%endif +%ifarch %{power64} +%ifarch ppc64 + --cpu=g5 \ +%endif +%ifarch ppc64p7 + --cpu=power7 \ +%endif +%ifarch ppc64le + --cpu=power8 \ +%endif + --enable-pic \ +%endif +%ifarch %{arm} + --disable-runtime-cpudetect --arch=arm \ +%ifarch armv6hl + --cpu=armv6 \ +%endif +%ifarch armv7hl armv7hnl + --cpu=armv7-a \ + --enable-vfpv3 \ + --enable-thumb \ +%endif +%ifarch armv7hl + --disable-neon \ +%endif +%ifarch armv7hnl + --enable-neon \ +%endif +%endif + || cat ffbuild/config.log + +%make_build V=1 +%make_build documentation V=1 +%make_build alltools V=1 + +%install +%make_install V=1 +%if 0%{!?flavor:1} +rm -r %{buildroot}%{_datadir}/%{name}/examples +%endif +%if 0%{!?progs_suffix:1} +install -pm755 tools/qt-faststart %{buildroot}%{_bindir} +%endif + +%if 0%{!?_without_tools:1} +%files +%{_bindir}/ffmpeg%{?progs_suffix} +%{_bindir}/ffplay%{?progs_suffix} +%{_bindir}/ffprobe%{?progs_suffix} +%{!?progs_suffix:%{_bindir}/qt-faststart} +%{!?flavor: +%{_mandir}/man1/ffmpeg*.1* +%{_mandir}/man1/ffplay*.1* +%{_mandir}/man1/ffprobe*.1* +} +%{_datadir}/%{name} +%endif + +%files libs +%doc CREDITS README.md +%license COPYING.* +%{_libdir}/lib*.so.* +%exclude %{_libdir}/libavdevice%{?build_suffix}.so.* +%{!?flavor:%{_mandir}/man3/lib*.3.* +%exclude %{_mandir}/man3/libavdevice.3* +} + +%files -n libavdevice%{?flavor} +%{_libdir}/libavdevice%{?build_suffix}.so.* +%{!?flavor:%{_mandir}/man3/libavdevice.3*} + +%files devel +%doc MAINTAINERS doc/APIchanges doc/*.txt +%doc _doc/examples +%doc %{_docdir}/%{name}/*.html +%doc %{_docdir}/%{name}/*.css +%{_includedir}/%{name} +%{_libdir}/pkgconfig/lib*.pc +%{_libdir}/lib*.so + +%changelog +* Mon Jan 27 2025 Funda Wang <fundawang@yeah.net> - 7.1-4 +- fix CVE-2025-0518 + +* Thu Jan 09 2025 Funda Wang <fundawang@yeah.net> - 7.1-3 +- fix build with texinfo 7.2 + +* Tue Dec 03 2024 Funda Wang <fundawang@yeah.net> - 7.1-2 +- deal with rpm 4.17 + +* Tue Oct 01 2024 Funda Wang <fundawang@yeah.net> - 7.1-1 +- update to 7.1 + +* Wed Sep 18 2024 happyworker <208suo@208suo.com> - 6.1.1-14 +- CVE-2023-49501.patch + +* Tue Aug 27 2024 happyworker <208suo@208suo.com> - 6.1.1-13 +- CVE-2024-7055.patch + +* Mon Aug 26 2024 jchzhou <zhoujiacheng@iscas.ac.cn> - 6.1.1-12 +- add options during configure for supporting building with clang + +* Fri Jul 5 2024 happyworker <208suo@208suo.com> - 6.1.1-11 +- remove fix-CVE-2024-32228.patch + +* Thu Jul 04 2024 wangziliang <wangziliang@kylinos.cn> - 6.1.1-10 +- fix-CVE-2024-32228.patch + +* Tue Jul 02 2024 wangziliang <wangziliang@kylinos.cn> - 6.1.1-9 +- fix-CVE-2024-32230.patch + +* Mon Jun 24 2024 happyworker <208suo@208suo.com> - 6.1.1-8 +- fix-CVE-2023-49502.patch + +* Fri Jun 21 2024 misaka00251 <liuxin@iscas.ac.cn> - 6.1.1-7 +- Remove riscv64 exclusive arch for chromium patch + +* Tue Jun 18 2024 happyworker <208suo@208suo.com> - 6.1.1-6 +- fix CVE-2023-49528.patch + +* Wed Jun 12 2024 technology208 <technology@208suo.com> - 6.1.1-5 +- Add patch to fix libsvdec compile error + +* Fri Jun 07 2024 xuchenchen <xuchenchen@kylinos.cn> - 6.1.1-4 +- fix CVE-2024-31578.patch +- fix CVE-2024-31582.patch + +* Fri May 31 2024 xuchenchen <xuchenchen@kylinos.cn> - 6.1.1-3 +- fix CVE-2023-50007.patch +- fix CVE-2023-50008.patch + +* Wed Apr 03 2024 misaka00251 <liuxin@iscas.ac.cn> - 6.1.1-2 +- Add patch to fix chromium build on riscv64 & Cleanup patches + +* Thu Feb 22 2024 Dongxing Wang <dongxing.wang_a@thundersoft.com> - 6.1.1-1 +- Upgrade to 6.1.1 to fix Eulermaker failure + +* Wed Feb 21 2024 Dongxing Wang <dongxing.wang_a@thundersoft.com> - 4.4.4-2 +- Fix obs failure + +* Wed Dec 27 2023 Jingwiw <wangjingwei@iscas.ac.cn> - 4.4.4-1 +- Upgrade to 4.4.4 + +* Tue Nov 14 2023 ouuleilei <wangliu@iscas.ac.cn> - 4.2.9-1 +- Upgrade to 4.2.9 + +* Tue Aug 15 2023 peijiankang <peijiankang@kylinos.cn> - 4.2.4-6 +- add ix-build-error-about-srt.patch + +* Wed Jul 27 2022 Chenyx <chenyixiong3@huawei.com> - 4.2.4-5 +- License compliance rectification + +* Thu Jun 2 2022 yangweidong <yangweidong9@huawei.com> - 4.2.4-4 +- Fix CVE-2021-38114 and CVE-2020-35964 + +* Sat Sep 04 2021 guoxiaoqi <guoxiaoqi2@huawei.com> - 4.2.4-3 +- Fix CVE-2021-3566 and CVE-2021-38291 + +* Tue Jul 20 2021 weidong <weidong@uniontech.com> - 4.2.4-2 +- Fix requires conflict + +* Fri May 07 2021 weidong <weidong@uniontech.com> - 4.2.4-1 +- Initial package. diff --git a/fix_libsvgdec_compile_error.patch b/fix_libsvgdec_compile_error.patch new file mode 100644 index 0000000..1560668 --- /dev/null +++ b/fix_libsvgdec_compile_error.patch @@ -0,0 +1,27 @@ +From a414e25b60b8d11e30479d4f33fb9a94719dae8e Mon Sep 17 00:00:00 2001 +From: technology208 <technology@208suo.com> +Date: Tue, 4 Jun 2024 10:44:30 +0800 +Subject: [PATCH] fix_libsvgdec_compile_error.patch + +--- + libavcodec/librsvgdec.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/libavcodec/librsvgdec.c b/libavcodec/librsvgdec.c +index c328fbc..756c26d 100644 +--- a/libavcodec/librsvgdec.c ++++ b/libavcodec/librsvgdec.c +@@ -90,8 +90,10 @@ static int librsvg_decode_frame(AVCodecContext *avctx, AVFrame *frame, + goto end; + + avctx->pix_fmt = AV_PIX_FMT_RGB32; ++#if LIBRSVG_MAJOR_VERSION > 2 || LIBRSVG_MAJOR_VERSION == 2 && LIBRSVG_MINOR_VERSION >= 52 + viewport.width = dimensions.width; + viewport.height = dimensions.height; ++#endif + + ret = ff_get_buffer(avctx, frame, 0); + if (ret < 0) +-- +2.33.0 + |