From 2424f54884289948c8b2cec4e359573b4115d83d Mon Sep 17 00:00:00 2001 From: Ondrej Holy Date: Thu, 11 May 2023 11:18:48 +0200 Subject: [PATCH] Enable recommended FFmpeg support The FFmpeg support is recommended. Let's enable it for Fedora 39+. --- ...c97d60453738323e0ecafe6d357019528227.patch | 42 +++++++++++++++++++ freerdp.spec | 18 +++++--- 2 files changed, 55 insertions(+), 5 deletions(-) create mode 100644 7f55c97d60453738323e0ecafe6d357019528227.patch diff --git a/7f55c97d60453738323e0ecafe6d357019528227.patch b/7f55c97d60453738323e0ecafe6d357019528227.patch new file mode 100644 index 0000000..f33c350 --- /dev/null +++ b/7f55c97d60453738323e0ecafe6d357019528227.patch @@ -0,0 +1,42 @@ +From 7f55c97d60453738323e0ecafe6d357019528227 Mon Sep 17 00:00:00 2001 +From: akallabeth +Date: Tue, 14 Feb 2023 07:48:54 +0100 +Subject: [PATCH] Fixed #8686: Update h264 to use new FFMPEG API + +--- + channels/tsmf/client/ffmpeg/tsmf_ffmpeg.c | 2 ++ + libfreerdp/codec/h264_ffmpeg.c | 2 ++ + 2 files changed, 4 insertions(+) + +diff --git a/channels/tsmf/client/ffmpeg/tsmf_ffmpeg.c b/channels/tsmf/client/ffmpeg/tsmf_ffmpeg.c +index c14877b43ac..21533746438 100644 +--- a/channels/tsmf/client/ffmpeg/tsmf_ffmpeg.c ++++ b/channels/tsmf/client/ffmpeg/tsmf_ffmpeg.c +@@ -235,8 +235,10 @@ static BOOL tsmf_ffmpeg_init_stream(ITSMFDecoder* decoder, const TS_AM_MEDIA_TYP + } + } + ++#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(59, 18, 100) + if (mdecoder->codec->capabilities & AV_CODEC_CAP_TRUNCATED) + mdecoder->codec_context->flags |= AV_CODEC_FLAG_TRUNCATED; ++#endif + + return TRUE; + } +diff --git a/libfreerdp/codec/h264_ffmpeg.c b/libfreerdp/codec/h264_ffmpeg.c +index 4e3ba8f9282..9c445b8253a 100644 +--- a/libfreerdp/codec/h264_ffmpeg.c ++++ b/libfreerdp/codec/h264_ffmpeg.c +@@ -529,10 +529,12 @@ static BOOL libavcodec_init(H264_CONTEXT* h264) + goto EXCEPTION; + } + ++#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(59, 18, 100) + if (sys->codecDecoder->capabilities & AV_CODEC_CAP_TRUNCATED) + { + sys->codecDecoderContext->flags |= AV_CODEC_FLAG_TRUNCATED; + } ++#endif + + #ifdef WITH_VAAPI + diff --git a/freerdp.spec b/freerdp.spec index 16617dc..ff58de5 100644 --- a/freerdp.spec +++ b/freerdp.spec @@ -1,8 +1,6 @@ -# Can be rebuilt with FFmpeg/OpenH264 support enabled by passing -# "--with=ffmpeg", or "--with=openh264" to mock/rpmbuild; or by globally -# setting these variables: +# Can be rebuilt with OpenH264 support enabled by passing # "--with=openh264" +# to mock/rpmbuild; or by globally setting the following variable: -#global _with_ffmpeg 1 #global _with_openh264 1 # Momentarily disable GSS support @@ -20,10 +18,13 @@ %if 0%{?fedora} || 0%{?rhel} >= 8 %global _with_lame 1 %endif +%if 0%{?fedora} >= 39 +%global _with_ffmpeg 1 +%endif Name: freerdp Version: 2.10.0 -Release: 1%{?dist} +Release: 2%{?dist} Epoch: 2 Summary: Free implementation of the Remote Desktop Protocol (RDP) License: ASL 2.0 @@ -31,6 +32,9 @@ URL: http://www.freerdp.com/ Source0: https://github.com/FreeRDP/FreeRDP/archive/%{version}/FreeRDP-%{version}.tar.gz +# https://github.com/FreeRDP/FreeRDP/issues/8686 +Patch0: 7f55c97d60453738323e0ecafe6d357019528227.patch + BuildRequires: gcc BuildRequires: gcc-c++ BuildRequires: alsa-lib-devel @@ -155,6 +159,7 @@ find . -name "*.c" -exec chmod 664 {} \; -DWITH_CHANNELS=ON -DBUILTIN_CHANNELS=OFF \ -DWITH_CLIENT=ON \ -DWITH_DIRECTFB=OFF \ + -DWITH_DSP_FFMPEG=%{?_with_ffmpeg:ON}%{?!_with_ffmpeg:OFF} \ -DWITH_FFMPEG=%{?_with_ffmpeg:ON}%{?!_with_ffmpeg:OFF} \ -DWITH_GSM=ON \ -DWITH_GSSAPI=%{?_with_gss:ON}%{?!_with_gss:OFF} \ @@ -284,6 +289,9 @@ find %{buildroot} -name "*.a" -delete %{_libdir}/pkgconfig/winpr-tools2.pc %changelog +* Thu May 11 2023 Ondrej Holy - 2:2.10.0-2 +- Enable recommended FFmpeg support. + * Tue Feb 21 2023 Ondrej Holy - 2:2.10.0-1 - Update to 2.10.0.