From 4f6280a3af3fd79ff83f572e58415c0c2a62896e Mon Sep 17 00:00:00 2001 From: Raboneko <119771935+raboneko@users.noreply.github.com> Date: Fri, 19 Dec 2025 22:10:57 -0800 Subject: [PATCH] [f43] add: VLC (#8519) (#8522) * add: VLC * cleanup: New macros and bump release down * fix: NO * Cleanup and check if VLC is where it thinks it is? * cat the log to see what's wrong * cat the log to see what's wrong * Try to get errors from this thing * Empty commit because GitHub is testing my patience * Try this? * shdfshdfhj * Cleanup spec and see if this works * What now * This will have to do. --------- (cherry picked from commit a35314d3fc0e0725c117d286b15148653134b8c3) Signed-off-by: Gilver Co-authored-by: Gilver --- ...1-Use-SYSTEM-wide-ciphers-for-gnutls.patch | 38 + anda/apps/vlc/5574.patch | 775 +++++++++ anda/apps/vlc/5590.patch | 28 + anda/apps/vlc/6168.patch | 82 + anda/apps/vlc/6273.patch | 1430 +++++++++++++++++ anda/apps/vlc/6527.patch | 46 + anda/apps/vlc/6606.patch | 149 ++ anda/apps/vlc/anda.hcl | 11 + anda/apps/vlc/appdata.patch | 19 + anda/apps/vlc/fdk-aac2.patch | 84 + anda/apps/vlc/freerdp2.patch | 239 +++ anda/apps/vlc/libidn2.patch | 49 + anda/apps/vlc/live555.patch | 17 + anda/apps/vlc/lua-math.patch | 11 + anda/apps/vlc/macros.vlc | 1 + anda/apps/vlc/oneVPL.patch | 48 + anda/apps/vlc/update.rhai | 1 + anda/apps/vlc/vlc.spec | 1309 +++++++++++++++ 18 files changed, 4337 insertions(+) create mode 100644 anda/apps/vlc/0001-Use-SYSTEM-wide-ciphers-for-gnutls.patch create mode 100644 anda/apps/vlc/5574.patch create mode 100644 anda/apps/vlc/5590.patch create mode 100644 anda/apps/vlc/6168.patch create mode 100644 anda/apps/vlc/6273.patch create mode 100644 anda/apps/vlc/6527.patch create mode 100644 anda/apps/vlc/6606.patch create mode 100644 anda/apps/vlc/anda.hcl create mode 100644 anda/apps/vlc/appdata.patch create mode 100644 anda/apps/vlc/fdk-aac2.patch create mode 100644 anda/apps/vlc/freerdp2.patch create mode 100644 anda/apps/vlc/libidn2.patch create mode 100644 anda/apps/vlc/live555.patch create mode 100644 anda/apps/vlc/lua-math.patch create mode 100644 anda/apps/vlc/macros.vlc create mode 100644 anda/apps/vlc/oneVPL.patch create mode 100644 anda/apps/vlc/update.rhai create mode 100644 anda/apps/vlc/vlc.spec diff --git a/anda/apps/vlc/0001-Use-SYSTEM-wide-ciphers-for-gnutls.patch b/anda/apps/vlc/0001-Use-SYSTEM-wide-ciphers-for-gnutls.patch new file mode 100644 index 0000000000..da5d8c4d6e --- /dev/null +++ b/anda/apps/vlc/0001-Use-SYSTEM-wide-ciphers-for-gnutls.patch @@ -0,0 +1,38 @@ +From 3039aec58203513f29edb03f84471ea941a0c226 Mon Sep 17 00:00:00 2001 +From: Nicolas Chauvet +Date: Mon, 24 Sep 2018 18:28:26 +0200 +Subject: [PATCH] Use @SYSTEM wide ciphers for gnutls + +Gnutls upstream has support for system defined ciphers list +This is decribed at +https://fedoraproject.org/wiki/Packaging:CryptoPolicies +Also found on the debian wiki +https://wiki.debian.org/CryptoPolicy + +Signed-off-by: Nicolas Chauvet +--- + modules/misc/gnutls.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/modules/misc/gnutls.c b/modules/misc/gnutls.c +index 7b63cc34c4..3ca665f3d3 100644 +--- a/modules/misc/gnutls.c ++++ b/modules/misc/gnutls.c +@@ -768,12 +768,14 @@ static void CloseServer (vlc_tls_creds_t *crd) + "hash functions and compression methods can be selected. " \ + "Refer to GNU TLS documentation for detailed syntax.") + static const char *const priorities_values[] = { ++ "@SYSTEM", + "PERFORMANCE", + "NORMAL", + "SECURE128", + "SECURE256", + }; + static const char *const priorities_text[] = { ++ N_("System (default to system crypto ciphers policy)"), + N_("Performance (prioritize faster ciphers)"), + N_("Normal"), + N_("Secure 128-bits (exclude 256-bits ciphers)"), +-- +2.25.4 + diff --git a/anda/apps/vlc/5574.patch b/anda/apps/vlc/5574.patch new file mode 100644 index 0000000000..7dac74a942 --- /dev/null +++ b/anda/apps/vlc/5574.patch @@ -0,0 +1,775 @@ +From 81d6d56df6e5a66ed99970e2c559539858f4a0b7 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?R=C3=A9mi=20Denis-Courmont?= +Date: Sat, 5 May 2018 15:28:15 +0300 +Subject: [PATCH 01/11] avcodec: avoid signedness mismatch warning + +Bitmask should be unsigned, but ffmpeg seems confused with itself. + +(cherry picked from commit 8544233e7fde2965435e32a445494898440ecc30) +--- + modules/codec/avcodec/audio.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/modules/codec/avcodec/audio.c b/modules/codec/avcodec/audio.c +index 50a76c7a18e..e5af0ca5f2f 100644 +--- a/modules/codec/avcodec/audio.c ++++ b/modules/codec/avcodec/audio.c +@@ -593,9 +593,9 @@ static void SetupOutputFormat( decoder_t *p_dec, bool b_trust ) + uint32_t pi_order_src[i_order_max]; + + int i_channels_src = 0; +- int64_t channel_layout = ++ uint64_t channel_layout = + p_sys->p_context->channel_layout ? p_sys->p_context->channel_layout : +- av_get_default_channel_layout( p_sys->p_context->channels ); ++ (uint64_t)av_get_default_channel_layout( p_sys->p_context->channels ); + + if( channel_layout ) + { +-- +GitLab + + +From c7709e7a048eb69b656d7f9663debbc1dde1f591 Mon Sep 17 00:00:00 2001 +From: Ilkka Ollakka +Date: Wed, 5 Jul 2023 12:51:34 +0300 +Subject: [PATCH 02/11] avcodec: use p_dec->fmt_out instead of context channels + on audio channel-count + +reduces the need of ifdefs when adding ch_layout support + +(cherry picked from commit bddf5ba19111d1cc4463d9876c4bc4ba75f82d7f) +--- + modules/codec/avcodec/audio.c | 14 +++++++------- + 1 file changed, 7 insertions(+), 7 deletions(-) + +diff --git a/modules/codec/avcodec/audio.c b/modules/codec/avcodec/audio.c +index e5af0ca5f2f..26166c084e5 100644 +--- a/modules/codec/avcodec/audio.c ++++ b/modules/codec/avcodec/audio.c +@@ -484,15 +484,15 @@ static block_t * ConvertAVFrame( decoder_t *p_dec, AVFrame *frame ) + /* Interleave audio if required */ + if( av_sample_fmt_is_planar( ctx->sample_fmt ) ) + { +- p_block = block_Alloc(frame->linesize[0] * ctx->channels); ++ p_block = block_Alloc(frame->linesize[0] * p_dec->fmt_out.audio.i_channels ); + if ( likely(p_block) ) + { +- const void *planes[ctx->channels]; +- for (int i = 0; i < ctx->channels; i++) ++ const void *planes[p_dec->fmt_out.audio.i_channels]; ++ for (int i = 0; i < p_dec->fmt_out.audio.i_channels; i++) + planes[i] = frame->extended_data[i]; + + aout_Interleave(p_block->p_buffer, planes, frame->nb_samples, +- ctx->channels, p_dec->fmt_out.audio.i_format); ++ p_dec->fmt_out.audio.i_channels, p_dec->fmt_out.audio.i_format); + p_block->i_nb_samples = frame->nb_samples; + } + av_frame_free(&frame); +@@ -511,7 +511,7 @@ static block_t * ConvertAVFrame( decoder_t *p_dec, AVFrame *frame ) + { + aout_ChannelExtract( p_buffer->p_buffer, + p_dec->fmt_out.audio.i_channels, +- p_block->p_buffer, ctx->channels, ++ p_block->p_buffer, p_dec->fmt_out.audio.i_channels, + p_block->i_nb_samples, p_sys->pi_extraction, + p_dec->fmt_out.audio.i_bitspersample ); + p_buffer->i_nb_samples = p_block->i_nb_samples; +@@ -600,13 +600,13 @@ static void SetupOutputFormat( decoder_t *p_dec, bool b_trust ) + if( channel_layout ) + { + for( unsigned i = 0; i < i_order_max +- && i_channels_src < p_sys->p_context->channels; i++ ) ++ && i_channels_src < p_dec->fmt_out.audio.i_channels; i++ ) + { + if( channel_layout & pi_channels_map[i][0] ) + pi_order_src[i_channels_src++] = pi_channels_map[i][1]; + } + +- if( i_channels_src != p_sys->p_context->channels && b_trust ) ++ if( i_channels_src != p_dec->fmt_out.audio.i_channels && b_trust ) + msg_Err( p_dec, "Channel layout not understood" ); + + /* Detect special dual mono case */ +-- +GitLab + + +From 99b14966182995314f5b29fd972d6a9000ea3e00 Mon Sep 17 00:00:00 2001 +From: Ilkka Ollakka +Date: Wed, 5 Jul 2023 13:33:09 +0300 +Subject: [PATCH 03/11] avcodec: audio decoder to use ch_layout + +(cherry picked from commit 496f0f2a659c1339d1e37330d446e9b6ce96e76b) +--- + modules/codec/avcodec/audio.c | 42 ++++++++++++++++++++++++++++------- + 1 file changed, 34 insertions(+), 8 deletions(-) + +diff --git a/modules/codec/avcodec/audio.c b/modules/codec/avcodec/audio.c +index 26166c084e5..ad8a40ab4ed 100644 +--- a/modules/codec/avcodec/audio.c ++++ b/modules/codec/avcodec/audio.c +@@ -139,7 +139,11 @@ static int OpenAudioCodec( decoder_t *p_dec ) + } + + ctx->sample_rate = p_dec->fmt_in.audio.i_rate; ++#if LIBAVCODEC_VERSION_CHECK(59, 999, 999, 24, 100) ++ av_channel_layout_default( &ctx->ch_layout, p_dec->fmt_in.audio.i_channels ); ++#else + ctx->channels = p_dec->fmt_in.audio.i_channels; ++#endif + ctx->block_align = p_dec->fmt_in.audio.i_blockalign; + ctx->bit_rate = p_dec->fmt_in.i_bitrate; + ctx->bits_per_coded_sample = p_dec->fmt_in.audio.i_bitspersample; +@@ -395,12 +399,17 @@ static int DecodeBlock( decoder_t *p_dec, block_t **pp_block ) + ret = avcodec_receive_frame( ctx, frame ); + if( ret == 0 ) + { ++#if LIBAVCODEC_VERSION_CHECK(59, 999, 999, 24, 100) ++ int channels = frame->ch_layout.nb_channels; ++#else ++ int channels = ctx->channels; ++#endif + /* checks and init from first decoded frame */ +- if( ctx->channels <= 0 || ctx->channels > INPUT_CHAN_MAX ++ if( channels <= 0 || channels > INPUT_CHAN_MAX + || ctx->sample_rate <= 0 ) + { + msg_Warn( p_dec, "invalid audio properties channels count %d, sample rate %d", +- ctx->channels, ctx->sample_rate ); ++ channels, ctx->sample_rate ); + goto drop; + } + else if( p_dec->fmt_out.audio.i_rate != (unsigned int)ctx->sample_rate ) +@@ -580,6 +589,16 @@ static void SetupOutputFormat( decoder_t *p_dec, bool b_trust ) + p_dec->fmt_out.audio.i_rate = p_sys->p_context->sample_rate; + + /* */ ++#if LIBAVCODEC_VERSION_CHECK(59, 999, 999, 24, 100) ++ if( p_sys->i_previous_channels == p_sys->p_context->ch_layout.nb_channels && ++ p_sys->i_previous_layout == p_sys->p_context->ch_layout.u.mask ) ++ return; ++ if( b_trust ) ++ { ++ p_sys->i_previous_channels = p_sys->p_context->ch_layout.nb_channels; ++ p_sys->i_previous_layout = p_sys->p_context->ch_layout.u.mask; ++ } ++#else + if( p_sys->i_previous_channels == p_sys->p_context->channels && + p_sys->i_previous_layout == p_sys->p_context->channel_layout ) + return; +@@ -588,25 +607,32 @@ static void SetupOutputFormat( decoder_t *p_dec, bool b_trust ) + p_sys->i_previous_channels = p_sys->p_context->channels; + p_sys->i_previous_layout = p_sys->p_context->channel_layout; + } ++#endif + + const unsigned i_order_max = sizeof(pi_channels_map)/sizeof(*pi_channels_map); + uint32_t pi_order_src[i_order_max]; + + int i_channels_src = 0; +- uint64_t channel_layout = ++#if LIBAVCODEC_VERSION_CHECK(59, 999, 999, 24, 100) ++ uint64_t channel_layout_mask = p_sys->p_context->ch_layout.u.mask; ++ int channel_count = p_sys->p_context->ch_layout.nb_channels; ++#else ++ uint64_t channel_layout_mask = + p_sys->p_context->channel_layout ? p_sys->p_context->channel_layout : + (uint64_t)av_get_default_channel_layout( p_sys->p_context->channels ); ++ int channel_count = p_sys->p_context->channels; ++#endif + +- if( channel_layout ) ++ if( channel_layout_mask ) + { + for( unsigned i = 0; i < i_order_max +- && i_channels_src < p_dec->fmt_out.audio.i_channels; i++ ) ++ && i_channels_src < channel_count; i++ ) + { +- if( channel_layout & pi_channels_map[i][0] ) ++ if( channel_layout_mask & pi_channels_map[i][0] ) + pi_order_src[i_channels_src++] = pi_channels_map[i][1]; + } + +- if( i_channels_src != p_dec->fmt_out.audio.i_channels && b_trust ) ++ if( i_channels_src != channel_count && b_trust ) + msg_Err( p_dec, "Channel layout not understood" ); + + /* Detect special dual mono case */ +@@ -638,7 +664,7 @@ static void SetupOutputFormat( decoder_t *p_dec, bool b_trust ) + { + msg_Warn( p_dec, "no channel layout found"); + p_dec->fmt_out.audio.i_physical_channels = 0; +- p_dec->fmt_out.audio.i_channels = p_sys->p_context->channels; ++ p_dec->fmt_out.audio.i_channels = channel_count; + } + + aout_FormatPrepare( &p_dec->fmt_out.audio ); +-- +GitLab + + +From c44edb85e4f25cbc7a848211d2d3ca9f03bd46e6 Mon Sep 17 00:00:00 2001 +From: Ilkka Ollakka +Date: Tue, 4 Jul 2023 16:52:38 +0300 +Subject: [PATCH 04/11] avcodec: use p_enc audio channels instead of context + channels in encoder + +Allows to have less conditions in code when adding new ch_layout use + +(cherry-picked from commit 29747a8abb98ba53a64aa6761983891eeed2e0e4) +--- + modules/codec/avcodec/encoder.c | 24 ++++++++++++------------ + 1 file changed, 12 insertions(+), 12 deletions(-) + +diff --git a/modules/codec/avcodec/encoder.c b/modules/codec/avcodec/encoder.c +index 4919ccf0e0e..52848de0658 100644 +--- a/modules/codec/avcodec/encoder.c ++++ b/modules/codec/avcodec/encoder.c +@@ -790,7 +790,7 @@ int InitVideoEnc( vlc_object_t *p_this ) + } + } + } +- if( i_channels_src != p_context->channels ) ++ if( i_channels_src != p_enc->fmt_out.audio.i_channels ) + msg_Err( p_enc, "Channel layout not understood" ); + + p_sys->i_channels_to_reorder = +@@ -897,7 +897,7 @@ int InitVideoEnc( vlc_object_t *p_this ) + if( ret ) + { + if( p_enc->fmt_in.i_cat != AUDIO_ES || +- (p_context->channels <= 2 && i_codec_id != AV_CODEC_ID_MP2 ++ (p_enc->fmt_out.audio.i_channels <= 2 && i_codec_id != AV_CODEC_ID_MP2 + && i_codec_id != AV_CODEC_ID_MP3) ) + errmsg: + { +@@ -922,7 +922,7 @@ errmsg: + goto error; + } + +- if( p_context->channels > 2 ) ++ if( p_enc->fmt_out.audio.i_channels > 2 ) + { + p_context->channels = 2; + p_context->channel_layout = channel_mask[p_context->channels][1]; +@@ -1028,7 +1028,7 @@ errmsg: + p_context->frame_size : + AV_INPUT_BUFFER_MIN_SIZE; + p_sys->i_buffer_out = av_samples_get_buffer_size(NULL, +- p_sys->p_context->channels, p_sys->i_frame_size, ++ p_enc->fmt_out.audio.i_channels, p_sys->i_frame_size, + p_sys->p_context->sample_fmt, DEFAULT_ALIGN); + p_sys->p_buffer = av_malloc( p_sys->i_buffer_out ); + if ( unlikely( p_sys->p_buffer == NULL ) ) +@@ -1278,7 +1278,7 @@ static block_t *handle_delay_buffer( encoder_t *p_enc, encoder_sys_t *p_sys, uns + { + block_t *p_block = NULL; + //How much we need to copy from new packet +- const size_t leftover = leftover_samples * p_sys->p_context->channels * p_sys->i_sample_bytes; ++ const size_t leftover = leftover_samples * p_enc->fmt_out.audio.i_channels * p_sys->i_sample_bytes; + + av_frame_unref( p_sys->frame ); + p_sys->frame->format = p_sys->p_context->sample_fmt; +@@ -1301,7 +1301,7 @@ static block_t *handle_delay_buffer( encoder_t *p_enc, encoder_sys_t *p_sys, uns + // We need to deinterleave from p_aout_buf to p_buffer the leftover bytes + if( p_sys->b_planar ) + aout_Deinterleave( p_sys->p_interleave_buf, p_sys->p_buffer, +- p_sys->i_frame_size, p_sys->p_context->channels, p_enc->fmt_in.i_codec ); ++ p_sys->i_frame_size, p_enc->fmt_out.audio.i_channels, p_enc->fmt_in.i_codec ); + else + memcpy( p_sys->p_buffer + buffer_delay, p_aout_buf->p_buffer, leftover); + +@@ -1319,7 +1319,7 @@ static block_t *handle_delay_buffer( encoder_t *p_enc, encoder_sys_t *p_sys, uns + memset( p_sys->p_buffer + (leftover+buffer_delay), 0, padding_size ); + buffer_delay += padding_size; + } +- if( avcodec_fill_audio_frame( p_sys->frame, p_sys->p_context->channels, ++ if( avcodec_fill_audio_frame( p_sys->frame, p_enc->fmt_out.audio.i_channels, + p_sys->p_context->sample_fmt, p_sys->b_planar ? p_sys->p_interleave_buf : p_sys->p_buffer, + p_sys->i_buffer_out, + DEFAULT_ALIGN) < 0 ) +@@ -1349,7 +1349,7 @@ static block_t *EncodeAudio( encoder_t *p_enc, block_t *p_aout_buf ) + + //i_bytes_left is amount of bytes we get + i_samples_left = p_aout_buf ? p_aout_buf->i_nb_samples : 0; +- buffer_delay = p_sys->i_samples_delay * p_sys->i_sample_bytes * p_sys->p_context->channels; ++ buffer_delay = p_sys->i_samples_delay * p_sys->i_sample_bytes * p_enc->fmt_out.audio.i_channels; + + //p_sys->i_buffer_out = p_sys->i_frame_size * chan * p_sys->i_sample_bytes + //Calculate how many bytes we would need from current buffer to fill frame +@@ -1418,12 +1418,12 @@ static block_t *EncodeAudio( encoder_t *p_enc, block_t *p_aout_buf ) + p_sys->frame->channels = p_sys->p_context->channels; + + const int in_bytes = p_sys->frame->nb_samples * +- p_sys->p_context->channels * p_sys->i_sample_bytes; ++ p_enc->fmt_out.audio.i_channels* p_sys->i_sample_bytes; + + if( p_sys->b_planar ) + { + aout_Deinterleave( p_sys->p_buffer, p_aout_buf->p_buffer, +- p_sys->frame->nb_samples, p_sys->p_context->channels, p_enc->fmt_in.i_codec ); ++ p_sys->frame->nb_samples, p_enc->fmt_out.audio.i_channels, p_enc->fmt_in.i_codec ); + + } + else +@@ -1431,7 +1431,7 @@ static block_t *EncodeAudio( encoder_t *p_enc, block_t *p_aout_buf ) + memcpy(p_sys->p_buffer, p_aout_buf->p_buffer, in_bytes); + } + +- if( avcodec_fill_audio_frame( p_sys->frame, p_sys->p_context->channels, ++ if( avcodec_fill_audio_frame( p_sys->frame, p_enc->fmt_out.audio.i_channels, + p_sys->p_context->sample_fmt, + p_sys->p_buffer, + p_sys->i_buffer_out, +@@ -1457,7 +1457,7 @@ static block_t *EncodeAudio( encoder_t *p_enc, block_t *p_aout_buf ) + if( p_aout_buf->i_nb_samples > 0 ) + { + memcpy( p_sys->p_buffer + buffer_delay, p_aout_buf->p_buffer, +- p_aout_buf->i_nb_samples * p_sys->i_sample_bytes * p_sys->p_context->channels); ++ p_aout_buf->i_nb_samples * p_sys->i_sample_bytes * p_enc->fmt_out.audio.i_channels); + p_sys->i_samples_delay += p_aout_buf->i_nb_samples; + } + +-- +GitLab + + +From b8ad80a20e9e84082dac2848070d251fa68412c7 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Fran=C3=A7ois=20Cartegnie?= +Date: Tue, 23 Apr 2024 13:13:30 +0700 +Subject: [PATCH 05/11] codec: avcodec: map AYUV as RAWVIDEO with ffmpeg 6.0 + +(cherry picked from commit 955ef939467a628eb8da08e0d5eaefc9a3484cba) +--- + modules/codec/avcodec/fourcc.c | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/modules/codec/avcodec/fourcc.c b/modules/codec/avcodec/fourcc.c +index 33c6cae09ab..97f3188211d 100644 +--- a/modules/codec/avcodec/fourcc.c ++++ b/modules/codec/avcodec/fourcc.c +@@ -182,8 +182,12 @@ static const struct vlc_avcodec_fourcc video_codecs[] = + /* AV_CODEC_ID_V210X */ + { VLC_CODEC_TMV, AV_CODEC_ID_TMV }, + { VLC_CODEC_V210, AV_CODEC_ID_V210 }, +-#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT( 54, 50, 100 ) && LIBAVCODEC_VERSION_MICRO >= 100 ++#if LIBAVCODEC_VERSION_MICRO >= 100 ++# if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT( 59, 42, 102 ) ++ { VLC_CODEC_VUYA, AV_CODEC_ID_RAWVIDEO }, ++# elif LIBAVCODEC_VERSION_INT >= AV_VERSION_INT( 54, 50, 100 ) + { VLC_CODEC_VUYA, AV_CODEC_ID_AYUV }, ++# endif + #endif + /* AV_CODEC_ID_DPX */ + { VLC_CODEC_MAD, AV_CODEC_ID_MAD }, +-- +GitLab + + +From 58c05240c26b6eef56e7c5ab35b14ccd8377667f Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Fran=C3=A7ois=20Cartegnie?= +Date: Thu, 13 Jun 2024 12:21:58 +0700 +Subject: [PATCH 06/11] avcodec: encoder: fix channel_layout conditionals + +--- + modules/codec/avcodec/encoder.c | 11 ++++++++--- + 1 file changed, 8 insertions(+), 3 deletions(-) + +diff --git a/modules/codec/avcodec/encoder.c b/modules/codec/avcodec/encoder.c +index 52848de0658..6bd58f5071d 100644 +--- a/modules/codec/avcodec/encoder.c ++++ b/modules/codec/avcodec/encoder.c +@@ -43,12 +43,13 @@ + #include + + #include +-#include + + #include "avcodec.h" + #include "avcommon.h" + +-#if LIBAVUTIL_VERSION_CHECK( 52,2,6,0,0 ) ++#define API_CHANNEL_LAYOUT (LIBAVUTIL_VERSION_CHECK( 52, 2, 6, 0, 100)) ++ ++#if API_CHANNEL_LAYOUT + # include + #endif + +@@ -157,6 +158,7 @@ struct encoder_sys_t + + + /* Taken from audio.c*/ ++#if API_CHANNEL_LAYOUT + static const uint64_t pi_channels_map[][2] = + { + { AV_CH_FRONT_LEFT, AOUT_CHAN_LEFT }, +@@ -193,6 +195,7 @@ static const uint32_t channel_mask[][2] = { + {AOUT_CHANS_7_1, AV_CH_LAYOUT_7POINT1}, + {AOUT_CHANS_8_1, AV_CH_LAYOUT_OCTAGONAL}, + }; ++#endif + + static const char *const ppsz_enc_options[] = { + "keyint", "bframes", "vt", "qmin", "qmax", "codec", "hq", +@@ -746,7 +749,7 @@ int InitVideoEnc( vlc_object_t *p_this ) + p_context->time_base.num = 1; + p_context->time_base.den = p_context->sample_rate; + p_context->channels = p_enc->fmt_out.audio.i_channels; +-#if LIBAVUTIL_VERSION_CHECK( 52, 2, 6, 0, 0) ++#if API_CHANNEL_LAYOUT + p_context->channel_layout = channel_mask[p_context->channels][1]; + + /* Setup Channel ordering for multichannel audio +@@ -925,7 +928,9 @@ errmsg: + if( p_enc->fmt_out.audio.i_channels > 2 ) + { + p_context->channels = 2; ++#if API_CHANNEL_LAYOUT + p_context->channel_layout = channel_mask[p_context->channels][1]; ++#endif + + /* Change fmt_in in order to ask for a channels conversion */ + p_enc->fmt_in.audio.i_channels = +-- +GitLab + + +From 3db6e677680a1a94e473fe9d9fc121af34cdcf2b Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Fran=C3=A7ois=20Cartegnie?= +Date: Sat, 17 Aug 2024 11:22:33 +0700 +Subject: [PATCH 07/11] codec: avcodec: fix audio channel_layout conditionals + +--- + modules/codec/avcodec/audio.c | 23 +++++++++++++++-------- + 1 file changed, 15 insertions(+), 8 deletions(-) + +diff --git a/modules/codec/avcodec/audio.c b/modules/codec/avcodec/audio.c +index ad8a40ab4ed..c74757c76ae 100644 +--- a/modules/codec/avcodec/audio.c ++++ b/modules/codec/avcodec/audio.c +@@ -41,8 +41,11 @@ + #include + #include + +-#include ++#define API_CHANNEL_LAYOUT (LIBAVUTIL_VERSION_CHECK( 52, 2, 6, 0, 100)) + ++#if API_CHANNEL_LAYOUT ++# include ++#endif + + /***************************************************************************** + * decoder_sys_t : decoder descriptor +@@ -598,7 +601,7 @@ static void SetupOutputFormat( decoder_t *p_dec, bool b_trust ) + p_sys->i_previous_channels = p_sys->p_context->ch_layout.nb_channels; + p_sys->i_previous_layout = p_sys->p_context->ch_layout.u.mask; + } +-#else ++#elif API_CHANNEL_LAYOUT + if( p_sys->i_previous_channels == p_sys->p_context->channels && + p_sys->i_previous_layout == p_sys->p_context->channel_layout ) + return; +@@ -612,15 +615,19 @@ static void SetupOutputFormat( decoder_t *p_dec, bool b_trust ) + const unsigned i_order_max = sizeof(pi_channels_map)/sizeof(*pi_channels_map); + uint32_t pi_order_src[i_order_max]; + +- int i_channels_src = 0; ++ int i_channels_src = 0, channel_count; ++ uint64_t channel_layout_mask; + #if LIBAVCODEC_VERSION_CHECK(59, 999, 999, 24, 100) +- uint64_t channel_layout_mask = p_sys->p_context->ch_layout.u.mask; +- int channel_count = p_sys->p_context->ch_layout.nb_channels; +-#else +- uint64_t channel_layout_mask = ++ channel_layout_mask = p_sys->p_context->ch_layout.u.mask; ++ channel_count = p_sys->p_context->ch_layout.nb_channels; ++#elif API_CHANNEL_LAYOUT ++ channel_layout_mask = + p_sys->p_context->channel_layout ? p_sys->p_context->channel_layout : + (uint64_t)av_get_default_channel_layout( p_sys->p_context->channels ); +- int channel_count = p_sys->p_context->channels; ++ channel_count = p_sys->p_context->channels; ++#else ++ channel_layout_mask = NULL; ++ channel_count = p_sys->p_context->channels; + #endif + + if( channel_layout_mask ) +-- +GitLab + + +From b5bb9bda03a06fc1cfd682dacb571b688b5558d9 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Fran=C3=A7ois=20Cartegnie?= +Date: Tue, 23 Apr 2024 13:14:53 +0700 +Subject: [PATCH 08/11] demux/mux: avformat: use ch_layout from ffmpeg 5.1 + +merger pick from commit a55ec32ab3760d9edb6f05481cd3a981aa42878d +and fixup 195f0c98599b55950c49a62f98d9d3495be310df +--- + modules/demux/avformat/demux.c | 4 ++++ + modules/demux/avformat/mux.c | 4 ++++ + 2 files changed, 8 insertions(+) + +diff --git a/modules/demux/avformat/demux.c b/modules/demux/avformat/demux.c +index 3b355bb3fae..830dc0157e2 100644 +--- a/modules/demux/avformat/demux.c ++++ b/modules/demux/avformat/demux.c +@@ -401,7 +401,11 @@ int avformat_OpenDemux( vlc_object_t *p_this ) + es_format_Init( &es_fmt, AUDIO_ES, fcc ); + es_fmt.i_original_fourcc = CodecTagToFourcc( cp->codec_tag ); + es_fmt.i_bitrate = cp->bit_rate; ++#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT( 59, 24, 100 ) && LIBAVCODEC_VERSION_MICRO >= 100 ++ es_fmt.audio.i_channels = cp->ch_layout.nb_channels; ++#else + es_fmt.audio.i_channels = cp->channels; ++#endif + es_fmt.audio.i_rate = cp->sample_rate; + es_fmt.audio.i_bitspersample = cp->bits_per_coded_sample; + es_fmt.audio.i_blockalign = cp->block_align; +diff --git a/modules/demux/avformat/mux.c b/modules/demux/avformat/mux.c +index c708276954c..8bf8735885f 100644 +--- a/modules/demux/avformat/mux.c ++++ b/modules/demux/avformat/mux.c +@@ -267,7 +267,11 @@ static int AddStream( sout_mux_t *p_mux, sout_input_t *p_input ) + { + case AUDIO_ES: + codecpar->codec_type = AVMEDIA_TYPE_AUDIO; ++#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT( 59, 24, 100 ) && LIBAVCODEC_VERSION_MICRO >= 100 ++ av_channel_layout_default( &codecpar->ch_layout, fmt->audio.i_channels ); ++#else + codecpar->channels = fmt->audio.i_channels; ++#endif + codecpar->sample_rate = fmt->audio.i_rate; + stream->time_base = (AVRational){1, codecpar->sample_rate}; + if (fmt->i_bitrate == 0) { +-- +GitLab + + +From fa001cda7f6b22843438c39dfc078050bb54c72a Mon Sep 17 00:00:00 2001 +From: Ilkka Ollakka +Date: Tue, 4 Jul 2023 16:53:43 +0300 +Subject: [PATCH 09/11] avcodec: add handling of new ch_layout in audio encoder + +conditioned to avcodec version where is it added + +(cherry picked from commit c4302ca59dd79efd7208a45a3fcdc44388fd03a8) +--- + modules/codec/avcodec/encoder.c | 15 +++++++++++++-- + 1 file changed, 13 insertions(+), 2 deletions(-) + +diff --git a/modules/codec/avcodec/encoder.c b/modules/codec/avcodec/encoder.c +index 6bd58f5071d..757f93b4684 100644 +--- a/modules/codec/avcodec/encoder.c ++++ b/modules/codec/avcodec/encoder.c +@@ -927,11 +927,14 @@ errmsg: + + if( p_enc->fmt_out.audio.i_channels > 2 ) + { ++#if LIBAVCODEC_VERSION_CHECK(59, 999, 999, 24, 100) ++ av_channel_layout_default( &p_context->ch_layout, 2 ); ++#else + p_context->channels = 2; +-#if API_CHANNEL_LAYOUT ++# if API_CHANNEL_LAYOUT + p_context->channel_layout = channel_mask[p_context->channels][1]; ++# endif + #endif +- + /* Change fmt_in in order to ask for a channels conversion */ + p_enc->fmt_in.audio.i_channels = + p_enc->fmt_out.audio.i_channels = 2; +@@ -1288,8 +1291,12 @@ static block_t *handle_delay_buffer( encoder_t *p_enc, encoder_sys_t *p_sys, uns + av_frame_unref( p_sys->frame ); + p_sys->frame->format = p_sys->p_context->sample_fmt; + p_sys->frame->nb_samples = leftover_samples + p_sys->i_samples_delay; ++#if LIBAVCODEC_VERSION_CHECK(59, 999, 999, 24, 100) ++ av_channel_layout_copy(&p_sys->frame->ch_layout, &p_sys->p_context->ch_layout); ++#else + p_sys->frame->channel_layout = p_sys->p_context->channel_layout; + p_sys->frame->channels = p_sys->p_context->channels; ++#endif + + p_sys->frame->pts = date_Get( &p_sys->buffer_date ) * p_sys->p_context->time_base.den / + CLOCK_FREQ / p_sys->p_context->time_base.num; +@@ -1419,8 +1426,12 @@ static block_t *EncodeAudio( encoder_t *p_enc, block_t *p_aout_buf ) + p_sys->frame->pts = date_Get( &p_sys->buffer_date ) * p_sys->p_context->time_base.den / + CLOCK_FREQ / p_sys->p_context->time_base.num; + ++#if LIBAVCODEC_VERSION_CHECK(59, 999, 999, 24, 100) ++ av_channel_layout_copy(&p_sys->frame->ch_layout, &p_sys->p_context->ch_layout); ++#else + p_sys->frame->channel_layout = p_sys->p_context->channel_layout; + p_sys->frame->channels = p_sys->p_context->channels; ++#endif + + const int in_bytes = p_sys->frame->nb_samples * + p_enc->fmt_out.audio.i_channels* p_sys->i_sample_bytes; +-- +GitLab + + +From bb62989ccc12866d308e6f38dc1513de9cb1c6da Mon Sep 17 00:00:00 2001 +From: Ilkka Ollakka +Date: Tue, 4 Jul 2023 16:55:28 +0300 +Subject: [PATCH 10/11] avcodec: use ch_layout for channel layout in audio + encoder + +channels and channel_layout has been deprecated in FFMPEG 5.1 and will be removed eventually + +also always create the mapping, as ch_layout is always there + +(cherry picked from commit b73dc8841d999c6be9de718cd2cd3aeb13279792) +--- + modules/codec/avcodec/encoder.c | 53 ++++++++++++++------------------- + 1 file changed, 22 insertions(+), 31 deletions(-) + +diff --git a/modules/codec/avcodec/encoder.c b/modules/codec/avcodec/encoder.c +index 757f93b4684..ae746c99fc8 100644 +--- a/modules/codec/avcodec/encoder.c ++++ b/modules/codec/avcodec/encoder.c +@@ -183,6 +183,7 @@ static const uint64_t pi_channels_map[][2] = + { AV_CH_STEREO_RIGHT, 0 }, + }; + ++# if !LIBAVCODEC_VERSION_CHECK(59, 999, 999, 24, 100) + static const uint32_t channel_mask[][2] = { + {0,0}, + {AOUT_CHAN_CENTER, AV_CH_LAYOUT_MONO}, +@@ -195,6 +196,7 @@ static const uint32_t channel_mask[][2] = { + {AOUT_CHANS_7_1, AV_CH_LAYOUT_7POINT1}, + {AOUT_CHANS_8_1, AV_CH_LAYOUT_OCTAGONAL}, + }; ++# endif + #endif + + static const char *const ppsz_enc_options[] = { +@@ -748,49 +750,36 @@ int InitVideoEnc( vlc_object_t *p_this ) + date_Set( &p_sys->buffer_date, AV_NOPTS_VALUE ); + p_context->time_base.num = 1; + p_context->time_base.den = p_context->sample_rate; +- p_context->channels = p_enc->fmt_out.audio.i_channels; +-#if API_CHANNEL_LAYOUT +- p_context->channel_layout = channel_mask[p_context->channels][1]; + +- /* Setup Channel ordering for multichannel audio ++ /* Setup Channel ordering for audio + * as VLC channel order isn't same as libavcodec expects + */ + + p_sys->i_channels_to_reorder = 0; + +- /* Specified order ++ /* Create channel layout for avcodec + * Copied from audio.c + */ +- const unsigned i_order_max = 8 * sizeof(p_context->channel_layout); +- uint32_t pi_order_dst[AOUT_CHAN_MAX] = { }; ++#if API_CHANNEL_LAYOUT ++ uint32_t pi_order_dst[AOUT_CHAN_MAX] = { 0 }; + uint32_t order_mask = 0; + int i_channels_src = 0; +- +- if( p_context->channel_layout ) +- { +- msg_Dbg( p_enc, "Creating channel order for reordering"); +- for( unsigned i = 0; i < sizeof(pi_channels_map)/sizeof(*pi_channels_map); i++ ) +- { +- if( p_context->channel_layout & pi_channels_map[i][0] ) +- { +- msg_Dbg( p_enc, "%d %"PRIx64" mapped to %"PRIx64"", i_channels_src, pi_channels_map[i][0], pi_channels_map[i][1]); +- pi_order_dst[i_channels_src++] = pi_channels_map[i][1]; +- order_mask |= pi_channels_map[i][1]; +- } +- } +- } +- else ++ msg_Dbg( p_enc, "Creating channel order for reordering"); ++# if LIBAVCODEC_VERSION_CHECK(59, 999, 999, 24, 100) ++ av_channel_layout_default( &p_context->ch_layout, p_enc->fmt_out.audio.i_channels ); ++ uint64_t channel_mask = p_context->ch_layout.u.mask; ++# else ++ p_context->channels = p_enc->fmt_out.audio.i_channels; ++ p_context->channel_layout = channel_mask[p_context->channels][1]; ++ uint64_t channel_mask = p_context->channel_layout; ++# endif ++ for( unsigned i = 0; i < sizeof(pi_channels_map)/sizeof(*pi_channels_map); i++ ) + { +- msg_Dbg( p_enc, "Creating default channel order for reordering"); +- /* Create default order */ +- for( unsigned int i = 0; i < __MIN( i_order_max, (unsigned)p_sys->p_context->channels ); i++ ) ++ if( channel_mask & pi_channels_map[i][0] ) + { +- if( i < sizeof(pi_channels_map)/sizeof(*pi_channels_map) ) +- { +- msg_Dbg( p_enc, "%d channel is %"PRIx64"", i_channels_src, pi_channels_map[i][1]); +- pi_order_dst[i_channels_src++] = pi_channels_map[i][1]; +- order_mask |= pi_channels_map[i][1]; +- } ++ msg_Dbg( p_enc, "%d %"PRIx64" mapped to %"PRIx64"", i_channels_src, pi_channels_map[i][0], pi_channels_map[i][1]); ++ pi_order_dst[i_channels_src++] = pi_channels_map[i][1]; ++ order_mask |= pi_channels_map[i][1]; + } + } + if( i_channels_src != p_enc->fmt_out.audio.i_channels ) +@@ -799,6 +788,8 @@ int InitVideoEnc( vlc_object_t *p_this ) + p_sys->i_channels_to_reorder = + aout_CheckChannelReorder( NULL, pi_order_dst, order_mask, + p_sys->pi_reorder_layout ); ++#else ++ p_context->channels = p_enc->fmt_out.audio.i_channels; + #endif + + if ( p_enc->fmt_out.i_codec == VLC_CODEC_MP4A ) +-- +GitLab + + +From e020f9abb31809584e33d740593d6ae5a190771d Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Fran=C3=A7ois=20Cartegnie?= +Date: Mon, 12 Aug 2024 19:32:42 +0700 +Subject: [PATCH 11/11] codec: avcodec: bypass removed define for Intel + workarounds + +adapted from cherry picked commit 1280728ad305f00ceba3491ce11bf66107017a6c +--- + modules/codec/avcodec/d3d11va.c | 4 ++++ + modules/codec/avcodec/dxva2.c | 4 ++++ + 2 files changed, 8 insertions(+) + +diff --git a/modules/codec/avcodec/d3d11va.c b/modules/codec/avcodec/d3d11va.c +index e1560a9312c..5260628364f 100644 +--- a/modules/codec/avcodec/d3d11va.c ++++ b/modules/codec/avcodec/d3d11va.c +@@ -55,6 +55,10 @@ + #define D3D_DecoderSurface ID3D11VideoDecoderOutputView + #include "directx_va.h" + ++#ifndef FF_DXVA2_WORKAROUND_INTEL_CLEARVIDEO ++# define FF_DXVA2_WORKAROUND_INTEL_CLEARVIDEO 2 // moved to libavcodec/dxva2_internal.h :/ ++#endif ++ + static int Open(vlc_va_t *, AVCodecContext *, const AVPixFmtDescriptor *, enum PixelFormat, + const es_format_t *, picture_sys_t *p_sys); + static void Close(vlc_va_t *, void **); +diff --git a/modules/codec/avcodec/dxva2.c b/modules/codec/avcodec/dxva2.c +index 2e6809a0541..037ad7d4488 100644 +--- a/modules/codec/avcodec/dxva2.c ++++ b/modules/codec/avcodec/dxva2.c +@@ -43,6 +43,10 @@ + #define D3D_DecoderSurface IDirect3DSurface9 + #include "directx_va.h" + ++#ifndef FF_DXVA2_WORKAROUND_INTEL_CLEARVIDEO ++# define FF_DXVA2_WORKAROUND_INTEL_CLEARVIDEO 2 // moved to libavcodec/dxva2_internal.h :/ ++#endif ++ + static int Open(vlc_va_t *, AVCodecContext *, const AVPixFmtDescriptor *, enum PixelFormat, + const es_format_t *, picture_sys_t *p_sys); + static void Close(vlc_va_t *, void **); +-- +GitLab + diff --git a/anda/apps/vlc/5590.patch b/anda/apps/vlc/5590.patch new file mode 100644 index 0000000000..38ec3cc9b6 --- /dev/null +++ b/anda/apps/vlc/5590.patch @@ -0,0 +1,28 @@ +From a761e1c202b632e7865d18fcf11a2b9e285ea9ae Mon Sep 17 00:00:00 2001 +From: Tristan Matthews +Date: Wed, 1 Feb 2023 23:39:36 -0500 +Subject: [PATCH] opus_header: fix channel mapping family 1 parsing + +Fixes #27808 + +(cherry picked from commit 79fa6af0a98921f9d34933761f4fe20ef6c35309) +--- + modules/codec/opus_header.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/modules/codec/opus_header.c b/modules/codec/opus_header.c +index 4069a5cf4613..b134b20b625b 100644 +--- a/modules/codec/opus_header.c ++++ b/modules/codec/opus_header.c +@@ -205,7 +205,7 @@ int opus_header_parse(const unsigned char *packet, int len, OpusHeader *h) + h->nb_coupled = ch; + + /* Multi-stream support */ +- if(h->channel_mapping == 2) ++ if(h->channel_mapping <= 2) + { + if (h->nb_coupled + h->nb_streams > 255) + return 0; +-- +GitLab + diff --git a/anda/apps/vlc/6168.patch b/anda/apps/vlc/6168.patch new file mode 100644 index 0000000000..fdcc8c18fa --- /dev/null +++ b/anda/apps/vlc/6168.patch @@ -0,0 +1,82 @@ +From a618e31cf209168ae420e95750734a37359969e1 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Fran=C3=A7ois=20Cartegnie?= +Date: Sun, 7 Jul 2024 11:14:05 +0200 +Subject: [PATCH] mux: avformat: fix avio callbacks signature with ffmpeg 6.1 + +API signature changes introduced depending on a positive define, +then removed later, making it break prior or post removal... + +(adapted from commit 503c04fad9239420be26d67aab4d5f63c53eb4f7) +--- + modules/codec/avcodec/avcommon_compat.h | 3 +++ + modules/demux/avformat/mux.c | 18 ++++++++++++++++++ + 2 files changed, 21 insertions(+) + +diff --git a/modules/codec/avcodec/avcommon_compat.h b/modules/codec/avcodec/avcommon_compat.h +index 9d16b3dc47d9..561ad83f99f9 100644 +--- a/modules/codec/avcodec/avcommon_compat.h ++++ b/modules/codec/avcodec/avcommon_compat.h +@@ -77,6 +77,9 @@ + #ifndef FF_MAX_B_FRAMES + # define FF_MAX_B_FRAMES 16 // FIXME: remove this + #endif ++#ifndef FF_API_AVIO_WRITE_NONCONST // removed in ffmpeg 7 ++# define FF_API_AVIO_WRITE_NONCONST (LIBAVFORMAT_VERSION_MAJOR < 61) ++#endif + + #endif /* HAVE_LIBAVCODEC_AVCODEC_H */ + +diff --git a/modules/demux/avformat/mux.c b/modules/demux/avformat/mux.c +index 8bf8735885f5..033a87bdaaad 100644 +--- a/modules/demux/avformat/mux.c ++++ b/modules/demux/avformat/mux.c +@@ -74,11 +74,20 @@ static int AddStream( sout_mux_t *, sout_input_t * ); + static void DelStream( sout_mux_t *, sout_input_t * ); + static int Mux ( sout_mux_t * ); + ++#if FF_API_AVIO_WRITE_NONCONST + static int IOWrite( void *opaque, uint8_t *buf, int buf_size ); ++#else ++static int IOWrite( void *opaque, const uint8_t *buf, int buf_size ); ++#endif + static int64_t IOSeek( void *opaque, int64_t offset, int whence ); + #if LIBAVFORMAT_VERSION_CHECK( 57, 7, 0, 40, 100 ) ++# if FF_API_AVIO_WRITE_NONCONST + static int IOWriteTyped(void *opaque, uint8_t *buf, int buf_size, + enum AVIODataMarkerType type, int64_t time); ++# else ++int IOWriteTyped(void *opaque, const uint8_t *buf, int buf_size, ++ enum AVIODataMarkerType type, int64_t time); ++# endif + #endif + + /***************************************************************************** +@@ -411,8 +420,13 @@ static int MuxBlock( sout_mux_t *p_mux, sout_input_t *p_input ) + } + + #if LIBAVFORMAT_VERSION_CHECK( 57, 7, 0, 40, 100 ) ++# if FF_API_AVIO_WRITE_NONCONST + int IOWriteTyped(void *opaque, uint8_t *buf, int buf_size, + enum AVIODataMarkerType type, int64_t time) ++# else ++int IOWriteTyped(void *opaque, const uint8_t *buf, int buf_size, ++ enum AVIODataMarkerType type, int64_t time) ++# endif + { + VLC_UNUSED(time); + +@@ -512,7 +526,11 @@ static int Control( sout_mux_t *p_mux, int i_query, va_list args ) + /***************************************************************************** + * I/O wrappers for libavformat + *****************************************************************************/ ++#if FF_API_AVIO_WRITE_NONCONST + static int IOWrite( void *opaque, uint8_t *buf, int buf_size ) ++#else ++static int IOWrite( void *opaque, const uint8_t *buf, int buf_size ) ++#endif + { + sout_mux_t *p_mux = opaque; + sout_mux_sys_t *p_sys = p_mux->p_sys; +-- +GitLab + diff --git a/anda/apps/vlc/6273.patch b/anda/apps/vlc/6273.patch new file mode 100644 index 0000000000..049ee507f9 --- /dev/null +++ b/anda/apps/vlc/6273.patch @@ -0,0 +1,1430 @@ +From 8fef83731a6b7324ffd03933272fcfd9b08a2cb0 Mon Sep 17 00:00:00 2001 +From: Steve Lhomme +Date: Thu, 7 Nov 2024 07:20:57 +0100 +Subject: [PATCH 01/15] avcommon: rename LIBAVUTIL_VERSION_CHECK to + LIBAV_UTIL_VERSION_CHECK + +The LIBAVUTIL_VERSION_CHECK form will be for checks also done in 4.0. + +No functional changes. +--- + modules/codec/avcodec/audio.c | 2 +- + modules/codec/avcodec/avcommon_compat.h | 6 +++--- + modules/codec/avcodec/chroma.c | 2 +- + modules/codec/avcodec/encoder.c | 2 +- + modules/codec/avcodec/va.c | 2 +- + modules/codec/avcodec/video.c | 6 +++--- + 6 files changed, 10 insertions(+), 10 deletions(-) + +diff --git a/modules/codec/avcodec/audio.c b/modules/codec/avcodec/audio.c +index c74757c76ae..44335ec3cce 100644 +--- a/modules/codec/avcodec/audio.c ++++ b/modules/codec/avcodec/audio.c +@@ -41,7 +41,7 @@ + #include + #include + +-#define API_CHANNEL_LAYOUT (LIBAVUTIL_VERSION_CHECK( 52, 2, 6, 0, 100)) ++#define API_CHANNEL_LAYOUT (LIBAV_UTIL_VERSION_CHECK( 52, 2, 6, 0, 100)) + + #if API_CHANNEL_LAYOUT + # include +diff --git a/modules/codec/avcodec/avcommon_compat.h b/modules/codec/avcodec/avcommon_compat.h +index 561ad83f99f..bb2b9ae03e5 100644 +--- a/modules/codec/avcodec/avcommon_compat.h ++++ b/modules/codec/avcodec/avcommon_compat.h +@@ -86,15 +86,15 @@ + #ifdef HAVE_LIBAVUTIL_AVUTIL_H + # include + +-/* LIBAVUTIL_VERSION_CHECK checks for the right version of libav and FFmpeg ++/* LIBAV_UTIL_VERSION_CHECK checks for the right version of libav and FFmpeg + * a is the major version + * b and c the minor and micro versions of libav + * d and e the minor and micro versions of FFmpeg */ +-#define LIBAVUTIL_VERSION_CHECK( a, b, c, d, e ) \ ++#define LIBAV_UTIL_VERSION_CHECK( a, b, c, d, e ) \ + ( (LIBAVUTIL_VERSION_MICRO < 100 && LIBAVUTIL_VERSION_INT >= AV_VERSION_INT( a, b, c ) ) || \ + (LIBAVUTIL_VERSION_MICRO >= 100 && LIBAVUTIL_VERSION_INT >= AV_VERSION_INT( a, d, e ) ) ) + +-#if !LIBAVUTIL_VERSION_CHECK( 52, 11, 0, 32, 100 ) ++#if !LIBAV_UTIL_VERSION_CHECK( 52, 11, 0, 32, 100 ) + # define AV_PIX_FMT_FLAG_HWACCEL PIX_FMT_HWACCEL + #endif + +diff --git a/modules/codec/avcodec/chroma.c b/modules/codec/avcodec/chroma.c +index cb9634db597..da20bcb10b3 100644 +--- a/modules/codec/avcodec/chroma.c ++++ b/modules/codec/avcodec/chroma.c +@@ -180,7 +180,7 @@ static const struct + {VLC_CODEC_GBR_PLANAR_16B, AV_PIX_FMT_GBRP16BE, 0, 0, 0 }, + + /* XYZ */ +-#if LIBAVUTIL_VERSION_CHECK(52, 10, 0, 25, 100) ++#if LIBAV_UTIL_VERSION_CHECK(52, 10, 0, 25, 100) + {VLC_CODEC_XYZ12, AV_PIX_FMT_XYZ12, 0xfff0, 0xfff0, 0xfff0}, + #endif + { 0, 0, 0, 0, 0 } +diff --git a/modules/codec/avcodec/encoder.c b/modules/codec/avcodec/encoder.c +index ae746c99fc8..c9a34d8f0da 100644 +--- a/modules/codec/avcodec/encoder.c ++++ b/modules/codec/avcodec/encoder.c +@@ -47,7 +47,7 @@ + #include "avcodec.h" + #include "avcommon.h" + +-#define API_CHANNEL_LAYOUT (LIBAVUTIL_VERSION_CHECK( 52, 2, 6, 0, 100)) ++#define API_CHANNEL_LAYOUT (LIBAV_UTIL_VERSION_CHECK( 52, 2, 6, 0, 100)) + + #if API_CHANNEL_LAYOUT + # include +diff --git a/modules/codec/avcodec/va.c b/modules/codec/avcodec/va.c +index 0feb03b974f..06de54ddcf0 100644 +--- a/modules/codec/avcodec/va.c ++++ b/modules/codec/avcodec/va.c +@@ -58,7 +58,7 @@ vlc_fourcc_t vlc_va_GetChroma(enum PixelFormat hwfmt, enum PixelFormat swfmt) + } + break; + +-#if LIBAVUTIL_VERSION_CHECK(54, 13, 1, 24, 100) ++#if LIBAV_UTIL_VERSION_CHECK(54, 13, 1, 24, 100) + case AV_PIX_FMT_D3D11VA_VLD: + switch (swfmt) + { +diff --git a/modules/codec/avcodec/video.c b/modules/codec/avcodec/video.c +index 8c892dd3f48..deefd3076a9 100644 +--- a/modules/codec/avcodec/video.c ++++ b/modules/codec/avcodec/video.c +@@ -257,12 +257,12 @@ static int lavc_GetVideoFormat(decoder_t *dec, video_format_t *restrict fmt, + case AVCOL_TRC_BT2020_12: + fmt->transfer = TRANSFER_FUNC_BT2020; + break; +-#if LIBAVUTIL_VERSION_CHECK( 55, 14, 0, 31, 100) ++#if LIBAV_UTIL_VERSION_CHECK( 55, 14, 0, 31, 100) + case AVCOL_TRC_ARIB_STD_B67: + fmt->transfer = TRANSFER_FUNC_ARIB_B67; + break; + #endif +-#if LIBAVUTIL_VERSION_CHECK( 55, 17, 0, 37, 100) ++#if LIBAV_UTIL_VERSION_CHECK( 55, 17, 0, 37, 100) + case AVCOL_TRC_SMPTE2084: + fmt->transfer = TRANSFER_FUNC_SMPTE_ST2084; + break; +@@ -687,7 +687,7 @@ static int ffmpeg_OpenVa(decoder_t *p_dec, AVCodecContext *p_context, + static const enum PixelFormat hwfmts[] = + { + #ifdef _WIN32 +-#if LIBAVUTIL_VERSION_CHECK(54, 13, 1, 24, 100) ++#if LIBAV_UTIL_VERSION_CHECK(54, 13, 1, 24, 100) + AV_PIX_FMT_D3D11VA_VLD, + #endif + AV_PIX_FMT_DXVA2_VLD, +-- +GitLab + + +From 5efaca393b7388d629bba920127eb5465325c436 Mon Sep 17 00:00:00 2001 +From: Steve Lhomme +Date: Wed, 19 Jun 2024 13:56:31 +0200 +Subject: [PATCH 02/15] avcommon: use a specific macro to check the FFmpeg + libavutil version + +This macro doesn't check for libav which is assumed to not have to relevant +code. This is the same macro name used in VLC 4.0. +--- + modules/codec/avcodec/avcommon_compat.h | 6 +++++- + modules/codec/avcodec/chroma.c | 8 ++++---- + modules/codec/avcodec/video.c | 7 ++++--- + 3 files changed, 13 insertions(+), 8 deletions(-) + +diff --git a/modules/codec/avcodec/avcommon_compat.h b/modules/codec/avcodec/avcommon_compat.h +index bb2b9ae03e5..5bade93b3c5 100644 +--- a/modules/codec/avcodec/avcommon_compat.h ++++ b/modules/codec/avcodec/avcommon_compat.h +@@ -86,7 +86,11 @@ + #ifdef HAVE_LIBAVUTIL_AVUTIL_H + # include + +-/* LIBAV_UTIL_VERSION_CHECK checks for the right version of libav and FFmpeg ++/* check the FFmpeg libavutil version */ ++#define LIBAVUTIL_VERSION_CHECK( a, d, e ) \ ++ (LIBAVUTIL_VERSION_MICRO >= 100 && LIBAVUTIL_VERSION_INT >= AV_VERSION_INT( a, d, e ) ) ++ ++/* LIBAV_UTIL_VERSION_CHECK checks for the right libavutil version of libav and FFmpeg + * a is the major version + * b and c the minor and micro versions of libav + * d and e the minor and micro versions of FFmpeg */ +diff --git a/modules/codec/avcodec/chroma.c b/modules/codec/avcodec/chroma.c +index da20bcb10b3..156fb0beec8 100644 +--- a/modules/codec/avcodec/chroma.c ++++ b/modules/codec/avcodec/chroma.c +@@ -86,7 +86,7 @@ static const struct + {VLC_CODEC_I420_9B, AV_PIX_FMT_YUV420P9BE, 0, 0, 0 }, + {VLC_CODEC_I420_10L, AV_PIX_FMT_YUV420P10LE, 0, 0, 0 }, + {VLC_CODEC_I420_10B, AV_PIX_FMT_YUV420P10BE, 0, 0, 0 }, +-#if (LIBAVUTIL_VERSION_MICRO >= 100 && LIBAVUTIL_VERSION_INT >= AV_VERSION_INT( 54, 17, 100 ) ) ++#if LIBAVUTIL_VERSION_CHECK( 54, 17, 100 ) + {VLC_CODEC_I420_12L, AV_PIX_FMT_YUV420P12LE, 0, 0, 0 }, + {VLC_CODEC_I420_12B, AV_PIX_FMT_YUV420P12BE, 0, 0, 0 }, + #endif +@@ -100,7 +100,7 @@ static const struct + {VLC_CODEC_I422_9B, AV_PIX_FMT_YUV422P9BE, 0, 0, 0 }, + {VLC_CODEC_I422_10L, AV_PIX_FMT_YUV422P10LE, 0, 0, 0 }, + {VLC_CODEC_I422_10B, AV_PIX_FMT_YUV422P10BE, 0, 0, 0 }, +-#if (LIBAVUTIL_VERSION_MICRO >= 100 && LIBAVUTIL_VERSION_INT >= AV_VERSION_INT( 54, 17, 100 ) ) ++#if LIBAVUTIL_VERSION_CHECK( 54, 17, 100 ) + {VLC_CODEC_I422_12L, AV_PIX_FMT_YUV422P12LE, 0, 0, 0 }, + {VLC_CODEC_I422_12B, AV_PIX_FMT_YUV422P12BE, 0, 0, 0 }, + #endif +@@ -116,7 +116,7 @@ static const struct + {VLC_CODEC_I444_9B, AV_PIX_FMT_YUV444P9BE, 0, 0, 0 }, + {VLC_CODEC_I444_10L, AV_PIX_FMT_YUV444P10LE, 0, 0, 0 }, + {VLC_CODEC_I444_10B, AV_PIX_FMT_YUV444P10BE, 0, 0, 0 }, +-#if (LIBAVUTIL_VERSION_MICRO >= 100 && LIBAVUTIL_VERSION_INT >= AV_VERSION_INT( 54, 17, 100 ) ) ++#if LIBAVUTIL_VERSION_CHECK( 54, 17, 100 ) + {VLC_CODEC_I444_12L, AV_PIX_FMT_YUV444P12LE, 0, 0, 0 }, + {VLC_CODEC_I444_12B, AV_PIX_FMT_YUV444P12BE, 0, 0, 0 }, + #endif +@@ -145,7 +145,7 @@ static const struct + VLC_RGB( VLC_CODEC_RGB32, AV_PIX_FMT_0BGR32, AV_PIX_FMT_0RGB32, 0x000000ff, 0x0000ff00, 0x00ff0000 ) + #endif + +-#if (LIBAVUTIL_VERSION_MICRO == 0 || LIBAVUTIL_VERSION_INT >= AV_VERSION_INT( 55, 0, 100 ) ) ++#if (LIBAVUTIL_VERSION_MICRO == 0 || LIBAVUTIL_VERSION_CHECK( 55, 0, 100 ) ) + #ifdef WORDS_BIGENDIAN + {VLC_CODEC_RGBA64, AV_PIX_FMT_RGBA64BE, 0, 0, 0 }, + #else /* !WORDS_BIGENDIAN */ +diff --git a/modules/codec/avcodec/video.c b/modules/codec/avcodec/video.c +index deefd3076a9..d3284da8aed 100644 +--- a/modules/codec/avcodec/video.c ++++ b/modules/codec/avcodec/video.c +@@ -39,7 +39,8 @@ + #include + #include + #include +-#if (LIBAVUTIL_VERSION_MICRO >= 100 && LIBAVUTIL_VERSION_INT >= AV_VERSION_INT( 55, 16, 101 ) ) ++#include "avcommon_compat.h" ++#if LIBAVUTIL_VERSION_CHECK( 55, 16, 101 ) + #include + #endif + +@@ -995,7 +996,7 @@ static int DecodeSidedata( decoder_t *p_dec, const AVFrame *frame, picture_t *p_ + decoder_sys_t *p_sys = p_dec->p_sys; + bool format_changed = false; + +-#if (LIBAVUTIL_VERSION_MICRO >= 100 && LIBAVUTIL_VERSION_INT >= AV_VERSION_INT( 55, 16, 101 ) ) ++#if LIBAVUTIL_VERSION_CHECK( 55, 16, 101 ) + #define FROM_AVRAT(default_factor, avrat) \ + (uint64_t)(default_factor) * (avrat).num / (avrat).den + const AVFrameSideData *metadata = +@@ -1050,7 +1051,7 @@ static int DecodeSidedata( decoder_t *p_dec, const AVFrame *frame, picture_t *p_ + #undef FROM_AVRAT + } + #endif +-#if (LIBAVUTIL_VERSION_MICRO >= 100 && LIBAVUTIL_VERSION_INT >= AV_VERSION_INT( 55, 60, 100 ) ) ++#if LIBAVUTIL_VERSION_CHECK( 55, 60, 100 ) + const AVFrameSideData *metadata_lt = + av_frame_get_side_data( frame, + AV_FRAME_DATA_CONTENT_LIGHT_LEVEL ); +-- +GitLab + + +From 554a97ab33cd680b60731ec85fd9122329291725 Mon Sep 17 00:00:00 2001 +From: Steve Lhomme +Date: Thu, 7 Nov 2024 07:22:26 +0100 +Subject: [PATCH 03/15] avcommon: rename LIBAVFORMAT_VERSION_CHECK to + LIBAV_FORMAT_VERSION_CHECK + +The LIBAVFORMAT_VERSION_CHECK form will be for checks also done in 4.0. + +No functional changes. +--- + modules/codec/avcodec/avcommon_compat.h | 2 +- + modules/demux/avformat/mux.c | 10 +++++----- + 2 files changed, 6 insertions(+), 6 deletions(-) + +diff --git a/modules/codec/avcodec/avcommon_compat.h b/modules/codec/avcodec/avcommon_compat.h +index 5bade93b3c5..d0096bc1bbb 100644 +--- a/modules/codec/avcodec/avcommon_compat.h ++++ b/modules/codec/avcodec/avcommon_compat.h +@@ -126,7 +126,7 @@ + #ifdef HAVE_LIBAVFORMAT_AVFORMAT_H + # include + +-#define LIBAVFORMAT_VERSION_CHECK( a, b, c, d, e ) \ ++#define LIBAV_FORMAT_VERSION_CHECK( a, b, c, d, e ) \ + ( (LIBAVFORMAT_VERSION_MICRO < 100 && LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT( a, b, c ) ) || \ + (LIBAVFORMAT_VERSION_MICRO >= 100 && LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT( a, d, e ) ) ) + +diff --git a/modules/demux/avformat/mux.c b/modules/demux/avformat/mux.c +index 033a87bdaaa..182e94587ad 100644 +--- a/modules/demux/avformat/mux.c ++++ b/modules/demux/avformat/mux.c +@@ -61,7 +61,7 @@ struct sout_mux_sys_t + bool b_write_header; + bool b_write_keyframe; + bool b_error; +-#if LIBAVFORMAT_VERSION_CHECK( 57, 7, 0, 40, 100 ) ++#if LIBAV_FORMAT_VERSION_CHECK( 57, 7, 0, 40, 100 ) + bool b_header_done; + #endif + }; +@@ -80,7 +80,7 @@ static int IOWrite( void *opaque, uint8_t *buf, int buf_size ); + static int IOWrite( void *opaque, const uint8_t *buf, int buf_size ); + #endif + static int64_t IOSeek( void *opaque, int64_t offset, int whence ); +-#if LIBAVFORMAT_VERSION_CHECK( 57, 7, 0, 40, 100 ) ++#if LIBAV_FORMAT_VERSION_CHECK( 57, 7, 0, 40, 100 ) + # if FF_API_AVIO_WRITE_NONCONST + static int IOWriteTyped(void *opaque, uint8_t *buf, int buf_size, + enum AVIODataMarkerType type, int64_t time); +@@ -168,7 +168,7 @@ int avformat_OpenMux( vlc_object_t *p_this ) + p_sys->b_write_header = true; + p_sys->b_write_keyframe = false; + p_sys->b_error = false; +-#if LIBAVFORMAT_VERSION_CHECK( 57, 7, 0, 40, 100 ) ++#if LIBAV_FORMAT_VERSION_CHECK( 57, 7, 0, 40, 100 ) + p_sys->io->write_data_type = IOWriteTyped; + p_sys->b_header_done = false; + #endif +@@ -419,7 +419,7 @@ static int MuxBlock( sout_mux_t *p_mux, sout_input_t *p_input ) + return VLC_SUCCESS; + } + +-#if LIBAVFORMAT_VERSION_CHECK( 57, 7, 0, 40, 100 ) ++#if LIBAV_FORMAT_VERSION_CHECK( 57, 7, 0, 40, 100 ) + # if FF_API_AVIO_WRITE_NONCONST + int IOWriteTyped(void *opaque, uint8_t *buf, int buf_size, + enum AVIODataMarkerType type, int64_t time) +@@ -545,7 +545,7 @@ static int IOWrite( void *opaque, const uint8_t *buf, int buf_size ) + + if( p_sys->b_write_header ) + p_buf->i_flags |= BLOCK_FLAG_HEADER; +-#if LIBAVFORMAT_VERSION_CHECK( 57, 7, 0, 40, 100 ) ++#if LIBAV_FORMAT_VERSION_CHECK( 57, 7, 0, 40, 100 ) + if( !p_sys->b_header_done ) + p_buf->i_flags |= BLOCK_FLAG_HEADER; + #endif +-- +GitLab + + +From d406a3127635afcba2436cbc9cbb3efbdc826331 Mon Sep 17 00:00:00 2001 +From: Steve Lhomme +Date: Wed, 19 Jun 2024 13:57:24 +0200 +Subject: [PATCH 04/15] avcommon: use a specific macro to check the FFmpeg + libavformat version + +This macro doesn't check for libav which is assumed to not have to relevant +code. This is the same macro name used in VLC 4.0. +--- + modules/codec/avcodec/avcommon.h | 2 +- + modules/codec/avcodec/avcommon_compat.h | 8 ++++++++ + modules/demux/avformat/demux.c | 3 +-- + modules/demux/avformat/mux.c | 11 ++++------- + 4 files changed, 14 insertions(+), 10 deletions(-) + +diff --git a/modules/codec/avcodec/avcommon.h b/modules/codec/avcodec/avcommon.h +index ff5dba06c92..aa0c0b88b85 100644 +--- a/modules/codec/avcodec/avcommon.h ++++ b/modules/codec/avcodec/avcommon.h +@@ -106,7 +106,7 @@ static inline void vlc_init_avformat(vlc_object_t *obj) + + avformat_network_init(); + +-#if (LIBAVFORMAT_VERSION_MICRO < 100) || (LIBAVFORMAT_VERSION_INT < AV_VERSION_INT(58, 9, 100)) ++#if (LIBAVFORMAT_VERSION_MICRO < 100) || !(LIBAVFORMAT_VERSION_CHECK(58, 9, 100)) + av_register_all(); + #endif + +diff --git a/modules/codec/avcodec/avcommon_compat.h b/modules/codec/avcodec/avcommon_compat.h +index d0096bc1bbb..3feab3a657e 100644 +--- a/modules/codec/avcodec/avcommon_compat.h ++++ b/modules/codec/avcodec/avcommon_compat.h +@@ -126,6 +126,14 @@ + #ifdef HAVE_LIBAVFORMAT_AVFORMAT_H + # include + ++/* check the FFmpeg libavformat version */ ++#define LIBAVFORMAT_VERSION_CHECK( a, d, e ) \ ++ (LIBAVFORMAT_VERSION_MICRO >= 100 && LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT( a, d, e ) ) ++ ++/* LIBAV_FORMAT_VERSION_CHECK checks for the right libavformat version of libav and FFmpeg ++ * a is the major version ++ * b and c the minor and micro versions of libav ++ * d and e the minor and micro versions of FFmpeg */ + #define LIBAV_FORMAT_VERSION_CHECK( a, b, c, d, e ) \ + ( (LIBAVFORMAT_VERSION_MICRO < 100 && LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT( a, b, c ) ) || \ + (LIBAVFORMAT_VERSION_MICRO >= 100 && LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT( a, d, e ) ) ) +diff --git a/modules/demux/avformat/demux.c b/modules/demux/avformat/demux.c +index 830dc0157e2..39d2366cef2 100644 +--- a/modules/demux/avformat/demux.c ++++ b/modules/demux/avformat/demux.c +@@ -52,8 +52,7 @@ + + # define HAVE_AVUTIL_CODEC_ATTACHMENT 1 + +-#if LIBAVFORMAT_VERSION_MICRO >= 100 && \ +- LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT(59, 0, 100) ++#if LIBAVFORMAT_VERSION_CHECK(59, 0, 100) + # define AVF_MAYBE_CONST const + #else + # define AVF_MAYBE_CONST +diff --git a/modules/demux/avformat/mux.c b/modules/demux/avformat/mux.c +index 182e94587ad..664a646734c 100644 +--- a/modules/demux/avformat/mux.c ++++ b/modules/demux/avformat/mux.c +@@ -95,8 +95,7 @@ int IOWriteTyped(void *opaque, const uint8_t *buf, int buf_size, + *****************************************************************************/ + int avformat_OpenMux( vlc_object_t *p_this ) + { +-#if LIBAVFORMAT_VERSION_MICRO >= 100 && \ +- LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT(59, 0, 100) ++#if LIBAVFORMAT_VERSION_CHECK(59, 0, 100) + const AVOutputFormat *file_oformat; + #else + AVOutputFormat *file_oformat; +@@ -104,8 +103,7 @@ int avformat_OpenMux( vlc_object_t *p_this ) + sout_mux_t *p_mux = (sout_mux_t*)p_this; + bool dummy = !strcmp( p_mux->p_access->psz_access, "dummy"); + +-#if ( (LIBAVFORMAT_VERSION_MICRO >= 100) \ +- && (LIBAVFORMAT_VERSION_INT < AV_VERSION_INT(58, 7, 100)) ) ++#if LIBAVFORMAT_VERSION_MICRO >= 100 && !(LIBAVFORMAT_VERSION_CHECK(58, 7, 100)) + if( dummy && strlen(p_mux->p_access->psz_path) + >= sizeof (((AVFormatContext *)NULL)->filename) ) + return VLC_EGENERIC; +@@ -144,8 +142,7 @@ int avformat_OpenMux( vlc_object_t *p_this ) + p_sys->oc->oformat = file_oformat; + /* If we use dummy access, let avformat write output */ + if( dummy ) +-#if ( (LIBAVFORMAT_VERSION_MICRO >= 100) \ +- && (LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT(58, 7, 100)) ) ++#if LIBAVFORMAT_VERSION_CHECK(58, 7, 100) + p_sys->oc->url = av_strdup(p_mux->p_access->psz_path); + #else + strcpy( p_sys->oc->filename, p_mux->p_access->psz_path ); +@@ -397,7 +394,7 @@ static int MuxBlock( sout_mux_t *p_mux, sout_input_t *p_input ) + pkt->dts = p_data->i_dts * p_stream->time_base.den / + CLOCK_FREQ / p_stream->time_base.num; + +-#if LIBAVFORMAT_VERSION_MICRO >= 100 && LIBAVFORMAT_VERSION_INT < AV_VERSION_INT(59, 2, 103) ++#if LIBAVFORMAT_VERSION_MICRO >= 100 && !(LIBAVFORMAT_VERSION_CHECK(59, 2, 103)) + /* this is another hack to prevent libavformat from triggering the "non monotone timestamps" check in avformat/utils.c */ + p_stream->cur_dts = ( p_data->i_dts * p_stream->time_base.den / + CLOCK_FREQ / p_stream->time_base.num ) - 1; +-- +GitLab + + +From 930ddc0d0fec55fff6c2ed0ffcc904773bae6622 Mon Sep 17 00:00:00 2001 +From: Steve Lhomme +Date: Thu, 7 Nov 2024 07:23:27 +0100 +Subject: [PATCH 05/15] avcommon: rename LIBAVCODEC_VERSION_CHECK to + LIBAV_CODEC_VERSION_CHECK + +The LIBAVCODEC_VERSION_CHECK form will be for checks also done in 4.0. + +No functional changes. +--- + modules/codec/avcodec/audio.c | 8 ++++---- + modules/codec/avcodec/avcommon_compat.h | 4 ++-- + modules/codec/avcodec/d3d11va.c | 4 ++-- + modules/codec/avcodec/encoder.c | 10 +++++----- + modules/codec/avcodec/fourcc.c | 14 +++++++------- + modules/codec/avcodec/video.c | 2 +- + 6 files changed, 21 insertions(+), 21 deletions(-) + +diff --git a/modules/codec/avcodec/audio.c b/modules/codec/avcodec/audio.c +index 44335ec3cce..7a979e96e19 100644 +--- a/modules/codec/avcodec/audio.c ++++ b/modules/codec/avcodec/audio.c +@@ -142,7 +142,7 @@ static int OpenAudioCodec( decoder_t *p_dec ) + } + + ctx->sample_rate = p_dec->fmt_in.audio.i_rate; +-#if LIBAVCODEC_VERSION_CHECK(59, 999, 999, 24, 100) ++#if LIBAV_CODEC_VERSION_CHECK(59, 999, 999, 24, 100) + av_channel_layout_default( &ctx->ch_layout, p_dec->fmt_in.audio.i_channels ); + #else + ctx->channels = p_dec->fmt_in.audio.i_channels; +@@ -402,7 +402,7 @@ static int DecodeBlock( decoder_t *p_dec, block_t **pp_block ) + ret = avcodec_receive_frame( ctx, frame ); + if( ret == 0 ) + { +-#if LIBAVCODEC_VERSION_CHECK(59, 999, 999, 24, 100) ++#if LIBAV_CODEC_VERSION_CHECK(59, 999, 999, 24, 100) + int channels = frame->ch_layout.nb_channels; + #else + int channels = ctx->channels; +@@ -592,7 +592,7 @@ static void SetupOutputFormat( decoder_t *p_dec, bool b_trust ) + p_dec->fmt_out.audio.i_rate = p_sys->p_context->sample_rate; + + /* */ +-#if LIBAVCODEC_VERSION_CHECK(59, 999, 999, 24, 100) ++#if LIBAV_CODEC_VERSION_CHECK(59, 999, 999, 24, 100) + if( p_sys->i_previous_channels == p_sys->p_context->ch_layout.nb_channels && + p_sys->i_previous_layout == p_sys->p_context->ch_layout.u.mask ) + return; +@@ -617,7 +617,7 @@ static void SetupOutputFormat( decoder_t *p_dec, bool b_trust ) + + int i_channels_src = 0, channel_count; + uint64_t channel_layout_mask; +-#if LIBAVCODEC_VERSION_CHECK(59, 999, 999, 24, 100) ++#if LIBAV_CODEC_VERSION_CHECK(59, 999, 999, 24, 100) + channel_layout_mask = p_sys->p_context->ch_layout.u.mask; + channel_count = p_sys->p_context->ch_layout.nb_channels; + #elif API_CHANNEL_LAYOUT +diff --git a/modules/codec/avcodec/avcommon_compat.h b/modules/codec/avcodec/avcommon_compat.h +index 3feab3a657e..b504fcd8218 100644 +--- a/modules/codec/avcodec/avcommon_compat.h ++++ b/modules/codec/avcodec/avcommon_compat.h +@@ -30,11 +30,11 @@ + #ifdef HAVE_LIBAVCODEC_AVCODEC_H + #include + +-/* LIBAVCODEC_VERSION_CHECK checks for the right version of libav and FFmpeg ++/* LIBAV_CODEC_VERSION_CHECK checks for the right version of libav and FFmpeg + * a is the major version + * b and c the minor and micro versions of libav + * d and e the minor and micro versions of FFmpeg */ +-#define LIBAVCODEC_VERSION_CHECK( a, b, c, d, e ) \ ++#define LIBAV_CODEC_VERSION_CHECK( a, b, c, d, e ) \ + ( (LIBAVCODEC_VERSION_MICRO < 100 && LIBAVCODEC_VERSION_INT >= AV_VERSION_INT( a, b, c ) ) || \ + (LIBAVCODEC_VERSION_MICRO >= 100 && LIBAVCODEC_VERSION_INT >= AV_VERSION_INT( a, d, e ) ) ) + +diff --git a/modules/codec/avcodec/d3d11va.c b/modules/codec/avcodec/d3d11va.c +index 5260628364f..e1c10d31188 100644 +--- a/modules/codec/avcodec/d3d11va.c ++++ b/modules/codec/avcodec/d3d11va.c +@@ -76,7 +76,7 @@ vlc_module_end() + * So we get the surfaces from the decoder pool when needed. We don't need to + * extract the decoded surface into the decoder picture anymore. + */ +-#define D3D11_DIRECT_DECODE LIBAVCODEC_VERSION_CHECK( 57, 30, 3, 72, 101 ) ++#define D3D11_DIRECT_DECODE LIBAV_CODEC_VERSION_CHECK( 57, 30, 3, 72, 101 ) + + #include /* must be last included to not redefine existing GUIDs */ + +@@ -764,7 +764,7 @@ static int DxCreateDecoderSurfaces(vlc_va_t *va, int codec_id, + assert(texDesc.Format == sys->render); + assert(texDesc.BindFlags & D3D11_BIND_DECODER); + +-#if !LIBAVCODEC_VERSION_CHECK( 57, 27, 2, 61, 102 ) ++#if !LIBAV_CODEC_VERSION_CHECK( 57, 27, 2, 61, 102 ) + if (pic->p_sys->slice_index != surface_idx) + { + msg_Warn(va, "d3d11va requires decoding slices to be the first in the texture (%d/%d)", +diff --git a/modules/codec/avcodec/encoder.c b/modules/codec/avcodec/encoder.c +index c9a34d8f0da..9cf9a7d0607 100644 +--- a/modules/codec/avcodec/encoder.c ++++ b/modules/codec/avcodec/encoder.c +@@ -183,7 +183,7 @@ static const uint64_t pi_channels_map[][2] = + { AV_CH_STEREO_RIGHT, 0 }, + }; + +-# if !LIBAVCODEC_VERSION_CHECK(59, 999, 999, 24, 100) ++# if !LIBAV_CODEC_VERSION_CHECK(59, 999, 999, 24, 100) + static const uint32_t channel_mask[][2] = { + {0,0}, + {AOUT_CHAN_CENTER, AV_CH_LAYOUT_MONO}, +@@ -765,7 +765,7 @@ int InitVideoEnc( vlc_object_t *p_this ) + uint32_t order_mask = 0; + int i_channels_src = 0; + msg_Dbg( p_enc, "Creating channel order for reordering"); +-# if LIBAVCODEC_VERSION_CHECK(59, 999, 999, 24, 100) ++# if LIBAV_CODEC_VERSION_CHECK(59, 999, 999, 24, 100) + av_channel_layout_default( &p_context->ch_layout, p_enc->fmt_out.audio.i_channels ); + uint64_t channel_mask = p_context->ch_layout.u.mask; + # else +@@ -918,7 +918,7 @@ errmsg: + + if( p_enc->fmt_out.audio.i_channels > 2 ) + { +-#if LIBAVCODEC_VERSION_CHECK(59, 999, 999, 24, 100) ++#if LIBAV_CODEC_VERSION_CHECK(59, 999, 999, 24, 100) + av_channel_layout_default( &p_context->ch_layout, 2 ); + #else + p_context->channels = 2; +@@ -1282,7 +1282,7 @@ static block_t *handle_delay_buffer( encoder_t *p_enc, encoder_sys_t *p_sys, uns + av_frame_unref( p_sys->frame ); + p_sys->frame->format = p_sys->p_context->sample_fmt; + p_sys->frame->nb_samples = leftover_samples + p_sys->i_samples_delay; +-#if LIBAVCODEC_VERSION_CHECK(59, 999, 999, 24, 100) ++#if LIBAV_CODEC_VERSION_CHECK(59, 999, 999, 24, 100) + av_channel_layout_copy(&p_sys->frame->ch_layout, &p_sys->p_context->ch_layout); + #else + p_sys->frame->channel_layout = p_sys->p_context->channel_layout; +@@ -1417,7 +1417,7 @@ static block_t *EncodeAudio( encoder_t *p_enc, block_t *p_aout_buf ) + p_sys->frame->pts = date_Get( &p_sys->buffer_date ) * p_sys->p_context->time_base.den / + CLOCK_FREQ / p_sys->p_context->time_base.num; + +-#if LIBAVCODEC_VERSION_CHECK(59, 999, 999, 24, 100) ++#if LIBAV_CODEC_VERSION_CHECK(59, 999, 999, 24, 100) + av_channel_layout_copy(&p_sys->frame->ch_layout, &p_sys->p_context->ch_layout); + #else + p_sys->frame->channel_layout = p_sys->p_context->channel_layout; +diff --git a/modules/codec/avcodec/fourcc.c b/modules/codec/avcodec/fourcc.c +index 97f3188211d..3aea6b58ff0 100644 +--- a/modules/codec/avcodec/fourcc.c ++++ b/modules/codec/avcodec/fourcc.c +@@ -230,7 +230,7 @@ static const struct vlc_avcodec_fourcc video_codecs[] = + { VLC_CODEC_CLLC, AV_CODEC_ID_CLLC }, + { VLC_CODEC_MSS2, AV_CODEC_ID_MSS2 }, + { VLC_CODEC_VP9, AV_CODEC_ID_VP9 }, +-#if LIBAVCODEC_VERSION_CHECK( 57, 26, 0, 83, 101 ) ++#if LIBAV_CODEC_VERSION_CHECK( 57, 26, 0, 83, 101 ) + { VLC_CODEC_AV1, AV_CODEC_ID_AV1 }, + #endif + { VLC_CODEC_ICOD, AV_CODEC_ID_AIC }, +@@ -285,19 +285,19 @@ static const struct vlc_avcodec_fourcc video_codecs[] = + /* ffmpeg only: AV_CODEC_ID_SNOW */ + /* ffmpeg only: AV_CODEC_ID_SMVJPEG */ + +-#if LIBAVCODEC_VERSION_CHECK( 57, 999, 999, 24, 102 ) ++#if LIBAV_CODEC_VERSION_CHECK( 57, 999, 999, 24, 102 ) + { VLC_CODEC_CINEFORM, AV_CODEC_ID_CFHD }, + #endif + +-#if LIBAVCODEC_VERSION_CHECK( 57, 999, 999, 70, 100 ) ++#if LIBAV_CODEC_VERSION_CHECK( 57, 999, 999, 70, 100 ) + { VLC_CODEC_PIXLET, AV_CODEC_ID_PIXLET }, + #endif + +-#if LIBAVCODEC_VERSION_CHECK( 57, 999, 999, 71, 101 ) ++#if LIBAV_CODEC_VERSION_CHECK( 57, 999, 999, 71, 101 ) + { VLC_CODEC_SPEEDHQ, AV_CODEC_ID_SPEEDHQ }, + #endif + +-#if LIBAVCODEC_VERSION_CHECK( 57, 999, 999, 79, 100 ) ++#if LIBAV_CODEC_VERSION_CHECK( 57, 999, 999, 79, 100 ) + { VLC_CODEC_FMVC, AV_CODEC_ID_FMVC }, + #endif + }; +@@ -414,7 +414,7 @@ static const struct vlc_avcodec_fourcc audio_codecs[] = + /* AV_CODEC_ID_WESTWOOD_SND1 */ + { VLC_CODEC_GSM, AV_CODEC_ID_GSM }, + { VLC_CODEC_QDM2, AV_CODEC_ID_QDM2 }, +-#if LIBAVCODEC_VERSION_CHECK( 57, 999, 999, 71, 100 ) ++#if LIBAV_CODEC_VERSION_CHECK( 57, 999, 999, 71, 100 ) + { VLC_CODEC_QDMC, AV_CODEC_ID_QDMC }, + #endif + { VLC_CODEC_COOK, AV_CODEC_ID_COOK }, +@@ -482,7 +482,7 @@ static const struct vlc_avcodec_fourcc spu_codecs[] = + { VLC_CODEC_SSA, AV_CODEC_ID_SSA }, + /* AV_CODEC_ID_MOV_TEXT */ + { VLC_CODEC_BD_PG, AV_CODEC_ID_HDMV_PGS_SUBTITLE }, +-#if LIBAVCODEC_VERSION_CHECK( 57, 999, 999, 71, 100 ) ++#if LIBAV_CODEC_VERSION_CHECK( 57, 999, 999, 71, 100 ) + { VLC_CODEC_BD_TEXT, AV_CODEC_ID_HDMV_TEXT_SUBTITLE }, + #endif + { VLC_CODEC_TELETEXT, AV_CODEC_ID_DVB_TELETEXT }, +diff --git a/modules/codec/avcodec/video.c b/modules/codec/avcodec/video.c +index d3284da8aed..552c602edf6 100644 +--- a/modules/codec/avcodec/video.c ++++ b/modules/codec/avcodec/video.c +@@ -1307,7 +1307,7 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block, bool *error + } + + /* Compute the PTS */ +-#if LIBAVCODEC_VERSION_CHECK(57, 24, 0, 61, 100) ++#if LIBAV_CODEC_VERSION_CHECK(57, 24, 0, 61, 100) + # if LIBAVCODEC_VERSION_MICRO >= 100 + vlc_tick_t i_pts = frame->best_effort_timestamp; + # else +-- +GitLab + + +From ce084152c9bade041ca18e19c3b264e4e134c6c3 Mon Sep 17 00:00:00 2001 +From: Steve Lhomme +Date: Wed, 19 Jun 2024 13:59:15 +0200 +Subject: [PATCH 06/15] avcommon: use a specific macro to check the FFmpeg + libavcodec version + +This macro doesn't check for libav which is assumed to not have to relevant +code. This is the same macro name used in VLC 4.0. +--- + modules/codec/avcodec/audio.c | 8 ++++---- + modules/codec/avcodec/avcommon.h | 2 +- + modules/codec/avcodec/avcommon_compat.h | 4 ++++ + modules/codec/avcodec/directx_va.c | 4 ++-- + modules/codec/avcodec/encoder.c | 13 ++++++------- + modules/codec/avcodec/fourcc.c | 18 ++++++++---------- + modules/codec/avcodec/video.c | 3 +-- + modules/demux/avformat/demux.c | 2 +- + modules/demux/avformat/mux.c | 2 +- + 9 files changed, 28 insertions(+), 28 deletions(-) + +diff --git a/modules/codec/avcodec/audio.c b/modules/codec/avcodec/audio.c +index 7a979e96e19..a3f67f7bd93 100644 +--- a/modules/codec/avcodec/audio.c ++++ b/modules/codec/avcodec/audio.c +@@ -142,7 +142,7 @@ static int OpenAudioCodec( decoder_t *p_dec ) + } + + ctx->sample_rate = p_dec->fmt_in.audio.i_rate; +-#if LIBAV_CODEC_VERSION_CHECK(59, 999, 999, 24, 100) ++#if LIBAVCODEC_VERSION_CHECK(59, 24, 100) + av_channel_layout_default( &ctx->ch_layout, p_dec->fmt_in.audio.i_channels ); + #else + ctx->channels = p_dec->fmt_in.audio.i_channels; +@@ -402,7 +402,7 @@ static int DecodeBlock( decoder_t *p_dec, block_t **pp_block ) + ret = avcodec_receive_frame( ctx, frame ); + if( ret == 0 ) + { +-#if LIBAV_CODEC_VERSION_CHECK(59, 999, 999, 24, 100) ++#if LIBAVCODEC_VERSION_CHECK(59, 24, 100) + int channels = frame->ch_layout.nb_channels; + #else + int channels = ctx->channels; +@@ -592,7 +592,7 @@ static void SetupOutputFormat( decoder_t *p_dec, bool b_trust ) + p_dec->fmt_out.audio.i_rate = p_sys->p_context->sample_rate; + + /* */ +-#if LIBAV_CODEC_VERSION_CHECK(59, 999, 999, 24, 100) ++#if LIBAVCODEC_VERSION_CHECK(59, 24, 100) + if( p_sys->i_previous_channels == p_sys->p_context->ch_layout.nb_channels && + p_sys->i_previous_layout == p_sys->p_context->ch_layout.u.mask ) + return; +@@ -617,7 +617,7 @@ static void SetupOutputFormat( decoder_t *p_dec, bool b_trust ) + + int i_channels_src = 0, channel_count; + uint64_t channel_layout_mask; +-#if LIBAV_CODEC_VERSION_CHECK(59, 999, 999, 24, 100) ++#if LIBAVCODEC_VERSION_CHECK(59, 24, 100) + channel_layout_mask = p_sys->p_context->ch_layout.u.mask; + channel_count = p_sys->p_context->ch_layout.nb_channels; + #elif API_CHANNEL_LAYOUT +diff --git a/modules/codec/avcodec/avcommon.h b/modules/codec/avcodec/avcommon.h +index aa0c0b88b85..10ad13dc5f8 100644 +--- a/modules/codec/avcodec/avcommon.h ++++ b/modules/codec/avcodec/avcommon.h +@@ -123,7 +123,7 @@ static inline void vlc_init_avcodec(vlc_object_t *obj) + + vlc_init_avutil(obj); + +-#if (LIBAVFORMAT_VERSION_MICRO < 100) || (LIBAVCODEC_VERSION_INT < AV_VERSION_INT(58, 10, 100)) ++#if (LIBAVFORMAT_VERSION_MICRO < 100) || !(LIBAVCODEC_VERSION_CHECK(58, 10, 100)) + avcodec_register_all(); + #endif + +diff --git a/modules/codec/avcodec/avcommon_compat.h b/modules/codec/avcodec/avcommon_compat.h +index b504fcd8218..ac02c06d233 100644 +--- a/modules/codec/avcodec/avcommon_compat.h ++++ b/modules/codec/avcodec/avcommon_compat.h +@@ -30,6 +30,10 @@ + #ifdef HAVE_LIBAVCODEC_AVCODEC_H + #include + ++/* check the FFmpeg libavutil version */ ++#define LIBAVCODEC_VERSION_CHECK( a, d, e ) \ ++ (LIBAVCODEC_VERSION_MICRO >= 100 && LIBAVCODEC_VERSION_INT >= AV_VERSION_INT( a, d, e ) ) ++ + /* LIBAV_CODEC_VERSION_CHECK checks for the right version of libav and FFmpeg + * a is the major version + * b and c the minor and micro versions of libav +diff --git a/modules/codec/avcodec/directx_va.c b/modules/codec/avcodec/directx_va.c +index 5b7980fd97d..36a5d61a559 100644 +--- a/modules/codec/avcodec/directx_va.c ++++ b/modules/codec/avcodec/directx_va.c +@@ -284,7 +284,7 @@ static const directx_va_mode_t DXVA_MODES[] = { + + /* VPx */ + { "VP8", &DXVA_ModeVP8_VLD, 8, 0, NULL }, +-#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT( 57, 17, 100 ) && LIBAVCODEC_VERSION_MICRO >= 100 ++#if LIBAVCODEC_VERSION_CHECK( 57, 17, 100 ) + { "VP9 profile 0", &DXVA_ModeVP9_VLD_Profile0, 8, AV_CODEC_ID_VP9, PROF_VP9_MAIN }, + { "VP9 profile 2", &DXVA_ModeVP9_VLD_10bit_Profile2, 10, AV_CODEC_ID_VP9, PROF_VP9_10 }, + #else +@@ -294,7 +294,7 @@ static const directx_va_mode_t DXVA_MODES[] = { + { "VP9 profile Intel", &DXVA_ModeVP9_VLD_Intel, 8, 0, NULL }, + + /* AV1 */ +-#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT( 58, 112, 103 ) && LIBAVCODEC_VERSION_MICRO >= 100 ++#if LIBAVCODEC_VERSION_CHECK( 58, 112, 103 ) + { "AV1 Main profile 8", &DXVA_ModeAV1_VLD_Profile0, 8, AV_CODEC_ID_AV1, PROF_AV1_MAIN }, + { "AV1 Main profile 10", &DXVA_ModeAV1_VLD_Profile0, 10, AV_CODEC_ID_AV1, PROF_AV1_MAIN }, + { "AV1 High profile 8", &DXVA_ModeAV1_VLD_Profile1, 8, AV_CODEC_ID_AV1, PROF_AV1_HIGH }, +diff --git a/modules/codec/avcodec/encoder.c b/modules/codec/avcodec/encoder.c +index 9cf9a7d0607..2014b8afaf5 100644 +--- a/modules/codec/avcodec/encoder.c ++++ b/modules/codec/avcodec/encoder.c +@@ -61,8 +61,7 @@ + + #define RAW_AUDIO_FRAME_SIZE (2048) + +-#if LIBAVCODEC_VERSION_MICRO >= 100 && \ +- LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(59, 0, 100) ++#if LIBAVCODEC_VERSION_CHECK(59, 0, 100) + # define AVC_MAYBE_CONST const + #else + # define AVC_MAYBE_CONST +@@ -183,7 +182,7 @@ static const uint64_t pi_channels_map[][2] = + { AV_CH_STEREO_RIGHT, 0 }, + }; + +-# if !LIBAV_CODEC_VERSION_CHECK(59, 999, 999, 24, 100) ++# if !LIBAVCODEC_VERSION_CHECK(59, 24, 100) + static const uint32_t channel_mask[][2] = { + {0,0}, + {AOUT_CHAN_CENTER, AV_CH_LAYOUT_MONO}, +@@ -765,7 +764,7 @@ int InitVideoEnc( vlc_object_t *p_this ) + uint32_t order_mask = 0; + int i_channels_src = 0; + msg_Dbg( p_enc, "Creating channel order for reordering"); +-# if LIBAV_CODEC_VERSION_CHECK(59, 999, 999, 24, 100) ++# if LIBAVCODEC_VERSION_CHECK(59, 24, 100) + av_channel_layout_default( &p_context->ch_layout, p_enc->fmt_out.audio.i_channels ); + uint64_t channel_mask = p_context->ch_layout.u.mask; + # else +@@ -918,7 +917,7 @@ errmsg: + + if( p_enc->fmt_out.audio.i_channels > 2 ) + { +-#if LIBAV_CODEC_VERSION_CHECK(59, 999, 999, 24, 100) ++#if LIBAVCODEC_VERSION_CHECK(59, 24, 100) + av_channel_layout_default( &p_context->ch_layout, 2 ); + #else + p_context->channels = 2; +@@ -1282,7 +1281,7 @@ static block_t *handle_delay_buffer( encoder_t *p_enc, encoder_sys_t *p_sys, uns + av_frame_unref( p_sys->frame ); + p_sys->frame->format = p_sys->p_context->sample_fmt; + p_sys->frame->nb_samples = leftover_samples + p_sys->i_samples_delay; +-#if LIBAV_CODEC_VERSION_CHECK(59, 999, 999, 24, 100) ++#if LIBAVCODEC_VERSION_CHECK(59, 24, 100) + av_channel_layout_copy(&p_sys->frame->ch_layout, &p_sys->p_context->ch_layout); + #else + p_sys->frame->channel_layout = p_sys->p_context->channel_layout; +@@ -1417,7 +1416,7 @@ static block_t *EncodeAudio( encoder_t *p_enc, block_t *p_aout_buf ) + p_sys->frame->pts = date_Get( &p_sys->buffer_date ) * p_sys->p_context->time_base.den / + CLOCK_FREQ / p_sys->p_context->time_base.num; + +-#if LIBAV_CODEC_VERSION_CHECK(59, 999, 999, 24, 100) ++#if LIBAVCODEC_VERSION_CHECK(59, 24, 100) + av_channel_layout_copy(&p_sys->frame->ch_layout, &p_sys->p_context->ch_layout); + #else + p_sys->frame->channel_layout = p_sys->p_context->channel_layout; +diff --git a/modules/codec/avcodec/fourcc.c b/modules/codec/avcodec/fourcc.c +index 3aea6b58ff0..d75c21ffa49 100644 +--- a/modules/codec/avcodec/fourcc.c ++++ b/modules/codec/avcodec/fourcc.c +@@ -182,12 +182,10 @@ static const struct vlc_avcodec_fourcc video_codecs[] = + /* AV_CODEC_ID_V210X */ + { VLC_CODEC_TMV, AV_CODEC_ID_TMV }, + { VLC_CODEC_V210, AV_CODEC_ID_V210 }, +-#if LIBAVCODEC_VERSION_MICRO >= 100 +-# if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT( 59, 42, 102 ) ++#if LIBAVCODEC_VERSION_CHECK( 59, 42, 102 ) + { VLC_CODEC_VUYA, AV_CODEC_ID_RAWVIDEO }, +-# elif LIBAVCODEC_VERSION_INT >= AV_VERSION_INT( 54, 50, 100 ) ++#elif LIBAVCODEC_VERSION_CHECK( 54, 50, 100 ) + { VLC_CODEC_VUYA, AV_CODEC_ID_AYUV }, +-# endif + #endif + /* AV_CODEC_ID_DPX */ + { VLC_CODEC_MAD, AV_CODEC_ID_MAD }, +@@ -285,19 +283,19 @@ static const struct vlc_avcodec_fourcc video_codecs[] = + /* ffmpeg only: AV_CODEC_ID_SNOW */ + /* ffmpeg only: AV_CODEC_ID_SMVJPEG */ + +-#if LIBAV_CODEC_VERSION_CHECK( 57, 999, 999, 24, 102 ) ++#if LIBAVCODEC_VERSION_CHECK( 57, 24, 102 ) + { VLC_CODEC_CINEFORM, AV_CODEC_ID_CFHD }, + #endif + +-#if LIBAV_CODEC_VERSION_CHECK( 57, 999, 999, 70, 100 ) ++#if LIBAVCODEC_VERSION_CHECK( 57, 70, 100 ) + { VLC_CODEC_PIXLET, AV_CODEC_ID_PIXLET }, + #endif + +-#if LIBAV_CODEC_VERSION_CHECK( 57, 999, 999, 71, 101 ) ++#if LIBAVCODEC_VERSION_CHECK( 57, 71, 101 ) + { VLC_CODEC_SPEEDHQ, AV_CODEC_ID_SPEEDHQ }, + #endif + +-#if LIBAV_CODEC_VERSION_CHECK( 57, 999, 999, 79, 100 ) ++#if LIBAVCODEC_VERSION_CHECK( 57, 79, 100 ) + { VLC_CODEC_FMVC, AV_CODEC_ID_FMVC }, + #endif + }; +@@ -414,7 +412,7 @@ static const struct vlc_avcodec_fourcc audio_codecs[] = + /* AV_CODEC_ID_WESTWOOD_SND1 */ + { VLC_CODEC_GSM, AV_CODEC_ID_GSM }, + { VLC_CODEC_QDM2, AV_CODEC_ID_QDM2 }, +-#if LIBAV_CODEC_VERSION_CHECK( 57, 999, 999, 71, 100 ) ++#if LIBAVCODEC_VERSION_CHECK( 57, 71, 100 ) + { VLC_CODEC_QDMC, AV_CODEC_ID_QDMC }, + #endif + { VLC_CODEC_COOK, AV_CODEC_ID_COOK }, +@@ -482,7 +480,7 @@ static const struct vlc_avcodec_fourcc spu_codecs[] = + { VLC_CODEC_SSA, AV_CODEC_ID_SSA }, + /* AV_CODEC_ID_MOV_TEXT */ + { VLC_CODEC_BD_PG, AV_CODEC_ID_HDMV_PGS_SUBTITLE }, +-#if LIBAV_CODEC_VERSION_CHECK( 57, 999, 999, 71, 100 ) ++#if LIBAVCODEC_VERSION_CHECK( 57, 71, 100 ) + { VLC_CODEC_BD_TEXT, AV_CODEC_ID_HDMV_TEXT_SUBTITLE }, + #endif + { VLC_CODEC_TELETEXT, AV_CODEC_ID_DVB_TELETEXT }, +diff --git a/modules/codec/avcodec/video.c b/modules/codec/avcodec/video.c +index 552c602edf6..c306e916c7d 100644 +--- a/modules/codec/avcodec/video.c ++++ b/modules/codec/avcodec/video.c +@@ -1824,8 +1824,7 @@ no_reuse: + if (!can_hwaccel) + return swfmt; + +-#if (LIBAVCODEC_VERSION_MICRO >= 100) \ +- && (LIBAVCODEC_VERSION_INT < AV_VERSION_INT(57, 83, 101)) ++#if (LIBAVCODEC_VERSION_MICRO >= 100) && !(LIBAVCODEC_VERSION_CHECK(57, 83, 101)) + if (p_context->active_thread_type) + { + msg_Warn(p_dec, "thread type %d: disabling hardware acceleration", +diff --git a/modules/demux/avformat/demux.c b/modules/demux/avformat/demux.c +index 39d2366cef2..9975b0f47b6 100644 +--- a/modules/demux/avformat/demux.c ++++ b/modules/demux/avformat/demux.c +@@ -400,7 +400,7 @@ int avformat_OpenDemux( vlc_object_t *p_this ) + es_format_Init( &es_fmt, AUDIO_ES, fcc ); + es_fmt.i_original_fourcc = CodecTagToFourcc( cp->codec_tag ); + es_fmt.i_bitrate = cp->bit_rate; +-#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT( 59, 24, 100 ) && LIBAVCODEC_VERSION_MICRO >= 100 ++#if LIBAVCODEC_VERSION_CHECK( 59, 24, 100 ) + es_fmt.audio.i_channels = cp->ch_layout.nb_channels; + #else + es_fmt.audio.i_channels = cp->channels; +diff --git a/modules/demux/avformat/mux.c b/modules/demux/avformat/mux.c +index 664a646734c..a48190c93ca 100644 +--- a/modules/demux/avformat/mux.c ++++ b/modules/demux/avformat/mux.c +@@ -273,7 +273,7 @@ static int AddStream( sout_mux_t *p_mux, sout_input_t *p_input ) + { + case AUDIO_ES: + codecpar->codec_type = AVMEDIA_TYPE_AUDIO; +-#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT( 59, 24, 100 ) && LIBAVCODEC_VERSION_MICRO >= 100 ++#if LIBAVCODEC_VERSION_CHECK( 59, 24, 100 ) + av_channel_layout_default( &codecpar->ch_layout, fmt->audio.i_channels ); + #else + codecpar->channels = fmt->audio.i_channels; +-- +GitLab + + +From 534564b289db7ee966abf888207258c3e6828c98 Mon Sep 17 00:00:00 2001 +From: Zhao Zhili +Date: Fri, 11 Jun 2021 18:02:34 +0800 +Subject: [PATCH 07/15] codec: avcodec: check open codec return value + +(cherry picked from commit 21ab6be22e7c1831cebf023fd53bd7ffbfad22f6) (edited) +edited: +- on 3.0 DecodeBlock returns a picture_t, not an error code +--- + modules/codec/avcodec/audio.c | 7 ++++++- + modules/codec/avcodec/video.c | 11 +++++++---- + 2 files changed, 13 insertions(+), 5 deletions(-) + +diff --git a/modules/codec/avcodec/audio.c b/modules/codec/avcodec/audio.c +index a3f67f7bd93..e8436754f4a 100644 +--- a/modules/codec/avcodec/audio.c ++++ b/modules/codec/avcodec/audio.c +@@ -309,7 +309,12 @@ static int DecodeBlock( decoder_t *p_dec, block_t **pp_block ) + && !avcodec_is_open( ctx ) ) + { + InitDecoderConfig( p_dec, ctx ); +- OpenAudioCodec( p_dec ); ++ if( OpenAudioCodec( p_dec ) < 0 ) ++ { ++ if( pp_block != NULL && *pp_block != NULL ) ++ block_Release( *pp_block ); ++ return VLCDEC_ECRITICAL; ++ } + } + + if( !avcodec_is_open( ctx ) ) +diff --git a/modules/codec/avcodec/video.c b/modules/codec/avcodec/video.c +index c306e916c7d..096a0b7940e 100644 +--- a/modules/codec/avcodec/video.c ++++ b/modules/codec/avcodec/video.c +@@ -1114,17 +1114,20 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block, bool *error + bool eos_spotted = false; + + +- block_t *p_block; ++ block_t *p_block = pp_block ? *pp_block : NULL; + vlc_tick_t current_time; + + if( !p_context->extradata_size && p_dec->fmt_in.i_extra ) + { + ffmpeg_InitCodec( p_dec ); +- if( !avcodec_is_open( p_context ) ) +- OpenVideoCodec( p_dec ); ++ if( !avcodec_is_open( p_context ) && OpenVideoCodec(p_dec) < 0 ) ++ { ++ if( p_block != NULL ) ++ block_Release( p_block ); ++ return NULL; ++ } + } + +- p_block = pp_block ? *pp_block : NULL; + if(!p_block && !(p_sys->p_codec->capabilities & AV_CODEC_CAP_DELAY) ) + return NULL; + +-- +GitLab + + +From b2b54eb1efa3ecc72a4a64d0d962cab0676fbce1 Mon Sep 17 00:00:00 2001 +From: Steve Lhomme +Date: Fri, 6 Jan 2023 10:16:09 +0100 +Subject: [PATCH 08/15] avcodec: use ARRAY_SIZE instead of custom code + +(cherry picked from commit 28c80ee47e6cdf961f501eed9d4837956b38afd1) +--- + modules/codec/avcodec/audio.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/modules/codec/avcodec/audio.c b/modules/codec/avcodec/audio.c +index e8436754f4a..20744010433 100644 +--- a/modules/codec/avcodec/audio.c ++++ b/modules/codec/avcodec/audio.c +@@ -558,7 +558,7 @@ vlc_fourcc_t GetVlcAudioFormat( int fmt ) + [AV_SAMPLE_FMT_FLTP] = VLC_CODEC_FL32, + [AV_SAMPLE_FMT_DBLP] = VLC_CODEC_FL64, + }; +- if( (sizeof(fcc) / sizeof(fcc[0])) > (unsigned)fmt ) ++ if( ARRAY_SIZE(fcc) > (unsigned)fmt ) + return fcc[fmt]; + return VLC_CODEC_S16N; + } +-- +GitLab + + +From 763dc3eba52cb7633a84f44dcde19602fca5eac7 Mon Sep 17 00:00:00 2001 +From: Ilkka Ollakka +Date: Wed, 5 Jul 2023 15:09:57 +0300 +Subject: [PATCH 09/15] avcodec/audio: make channel mapping array 0 terminated + +Also change pi_channels_src to be only AOUT_CHAN_MAX instead of same +size as mapping array. + +(cherry picked from commit 0ff86bf8a28a080340f600cb8561815fc43e3b4a) (rebased) +rebased: +- the code around is slightly different +--- + modules/codec/avcodec/audio.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/modules/codec/avcodec/audio.c b/modules/codec/avcodec/audio.c +index 20744010433..04c540173bf 100644 +--- a/modules/codec/avcodec/audio.c ++++ b/modules/codec/avcodec/audio.c +@@ -585,6 +585,7 @@ static const uint64_t pi_channels_map[][2] = + { AV_CH_TOP_BACK_RIGHT, 0 }, + { AV_CH_STEREO_LEFT, 0 }, + { AV_CH_STEREO_RIGHT, 0 }, ++ { 0, 0 }, + }; + + static void SetupOutputFormat( decoder_t *p_dec, bool b_trust ) +@@ -617,8 +618,7 @@ static void SetupOutputFormat( decoder_t *p_dec, bool b_trust ) + } + #endif + +- const unsigned i_order_max = sizeof(pi_channels_map)/sizeof(*pi_channels_map); +- uint32_t pi_order_src[i_order_max]; ++ uint32_t pi_order_src[AOUT_CHAN_MAX] = { 0 }; + + int i_channels_src = 0, channel_count; + uint64_t channel_layout_mask; +@@ -637,7 +637,7 @@ static void SetupOutputFormat( decoder_t *p_dec, bool b_trust ) + + if( channel_layout_mask ) + { +- for( unsigned i = 0; i < i_order_max ++ for( unsigned i = 0; pi_channels_map[i][0] + && i_channels_src < channel_count; i++ ) + { + if( channel_layout_mask & pi_channels_map[i][0] ) +-- +GitLab + + +From d1fb5c6cb372d2233046064db174daf1987c1211 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Fran=C3=A7ois=20Cartegnie?= +Date: Mon, 10 Jun 2024 11:10:37 +0700 +Subject: [PATCH 10/15] codec: avcodec: fix ch_layout requirement + +refs #28667 + +(cherry picked from commit 41778535dcae8b145ebfaa0392de281e470a91bf) (edited) +edited: +- on 3.0 the audio check was still using a LIBAVCODEC_VERSION_CHECK check +- the mux/demux checks were already there with different spaces +--- + modules/codec/avcodec/audio.c | 2 +- + modules/demux/avformat/demux.c | 2 +- + modules/demux/avformat/mux.c | 2 +- + 3 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/modules/codec/avcodec/audio.c b/modules/codec/avcodec/audio.c +index 04c540173bf..979256c400a 100644 +--- a/modules/codec/avcodec/audio.c ++++ b/modules/codec/avcodec/audio.c +@@ -142,7 +142,7 @@ static int OpenAudioCodec( decoder_t *p_dec ) + } + + ctx->sample_rate = p_dec->fmt_in.audio.i_rate; +-#if LIBAVCODEC_VERSION_CHECK(59, 24, 100) ++#if LIBAVUTIL_VERSION_CHECK(57, 24, 100) + av_channel_layout_default( &ctx->ch_layout, p_dec->fmt_in.audio.i_channels ); + #else + ctx->channels = p_dec->fmt_in.audio.i_channels; +diff --git a/modules/demux/avformat/demux.c b/modules/demux/avformat/demux.c +index 9975b0f47b6..c49f7eb4fc0 100644 +--- a/modules/demux/avformat/demux.c ++++ b/modules/demux/avformat/demux.c +@@ -400,7 +400,7 @@ int avformat_OpenDemux( vlc_object_t *p_this ) + es_format_Init( &es_fmt, AUDIO_ES, fcc ); + es_fmt.i_original_fourcc = CodecTagToFourcc( cp->codec_tag ); + es_fmt.i_bitrate = cp->bit_rate; +-#if LIBAVCODEC_VERSION_CHECK( 59, 24, 100 ) ++#if LIBAVCODEC_VERSION_CHECK(59, 24, 100) + es_fmt.audio.i_channels = cp->ch_layout.nb_channels; + #else + es_fmt.audio.i_channels = cp->channels; +diff --git a/modules/demux/avformat/mux.c b/modules/demux/avformat/mux.c +index a48190c93ca..090ed9f5bfa 100644 +--- a/modules/demux/avformat/mux.c ++++ b/modules/demux/avformat/mux.c +@@ -273,7 +273,7 @@ static int AddStream( sout_mux_t *p_mux, sout_input_t *p_input ) + { + case AUDIO_ES: + codecpar->codec_type = AVMEDIA_TYPE_AUDIO; +-#if LIBAVCODEC_VERSION_CHECK( 59, 24, 100 ) ++#if LIBAVCODEC_VERSION_CHECK(59, 24, 100) + av_channel_layout_default( &codecpar->ch_layout, fmt->audio.i_channels ); + #else + codecpar->channels = fmt->audio.i_channels; +-- +GitLab + + +From 0bcb306b7c05549a795b901ae33d6c7204456716 Mon Sep 17 00:00:00 2001 +From: Steve Lhomme +Date: Tue, 18 Jun 2024 15:34:10 +0200 +Subject: [PATCH 11/15] ffmpeg: fix libavutil version check for + av_channel_layout_default() + +It was added in c41899a3770cb4510e15b223fa34d129305b1589 which +was libavutil 57.23.100 at the time but the minor version was not updated in +that commit so we check 57.24.100. + +The same check applies for av_channel_layout_copy() added in the same commit. + +This is part of FFmpeg 5.1. + +https://github.com/FFmpeg/FFmpeg/commit/086a8048061bf9fb4c63943f6962db48175f655c +(cherry picked from commit 195f0c98599b55950c49a62f98d9d3495be310df) (rebased) +rebased: +- the code around is slightly different +--- + modules/codec/avcodec/encoder.c | 8 ++++---- + modules/demux/avformat/mux.c | 2 +- + 2 files changed, 5 insertions(+), 5 deletions(-) + +diff --git a/modules/codec/avcodec/encoder.c b/modules/codec/avcodec/encoder.c +index 2014b8afaf5..ec63c9c5439 100644 +--- a/modules/codec/avcodec/encoder.c ++++ b/modules/codec/avcodec/encoder.c +@@ -764,7 +764,7 @@ int InitVideoEnc( vlc_object_t *p_this ) + uint32_t order_mask = 0; + int i_channels_src = 0; + msg_Dbg( p_enc, "Creating channel order for reordering"); +-# if LIBAVCODEC_VERSION_CHECK(59, 24, 100) ++# if LIBAVCODEC_VERSION_CHECK(59, 24, 100) && LIBAVUTIL_VERSION_CHECK(57, 24, 100) + av_channel_layout_default( &p_context->ch_layout, p_enc->fmt_out.audio.i_channels ); + uint64_t channel_mask = p_context->ch_layout.u.mask; + # else +@@ -917,7 +917,7 @@ errmsg: + + if( p_enc->fmt_out.audio.i_channels > 2 ) + { +-#if LIBAVCODEC_VERSION_CHECK(59, 24, 100) ++#if LIBAVCODEC_VERSION_CHECK(59, 24, 100) && LIBAVUTIL_VERSION_CHECK(57, 24, 100) + av_channel_layout_default( &p_context->ch_layout, 2 ); + #else + p_context->channels = 2; +@@ -1281,7 +1281,7 @@ static block_t *handle_delay_buffer( encoder_t *p_enc, encoder_sys_t *p_sys, uns + av_frame_unref( p_sys->frame ); + p_sys->frame->format = p_sys->p_context->sample_fmt; + p_sys->frame->nb_samples = leftover_samples + p_sys->i_samples_delay; +-#if LIBAVCODEC_VERSION_CHECK(59, 24, 100) ++#if LIBAVCODEC_VERSION_CHECK(59, 24, 100) && LIBAVUTIL_VERSION_CHECK(57, 24, 100) + av_channel_layout_copy(&p_sys->frame->ch_layout, &p_sys->p_context->ch_layout); + #else + p_sys->frame->channel_layout = p_sys->p_context->channel_layout; +@@ -1416,7 +1416,7 @@ static block_t *EncodeAudio( encoder_t *p_enc, block_t *p_aout_buf ) + p_sys->frame->pts = date_Get( &p_sys->buffer_date ) * p_sys->p_context->time_base.den / + CLOCK_FREQ / p_sys->p_context->time_base.num; + +-#if LIBAVCODEC_VERSION_CHECK(59, 24, 100) ++#if LIBAVCODEC_VERSION_CHECK(59, 24, 100) && LIBAVUTIL_VERSION_CHECK(57, 24, 100) + av_channel_layout_copy(&p_sys->frame->ch_layout, &p_sys->p_context->ch_layout); + #else + p_sys->frame->channel_layout = p_sys->p_context->channel_layout; +diff --git a/modules/demux/avformat/mux.c b/modules/demux/avformat/mux.c +index 090ed9f5bfa..bf65ca36716 100644 +--- a/modules/demux/avformat/mux.c ++++ b/modules/demux/avformat/mux.c +@@ -273,7 +273,7 @@ static int AddStream( sout_mux_t *p_mux, sout_input_t *p_input ) + { + case AUDIO_ES: + codecpar->codec_type = AVMEDIA_TYPE_AUDIO; +-#if LIBAVCODEC_VERSION_CHECK(59, 24, 100) ++#if LIBAVUTIL_VERSION_CHECK(57, 24, 100) + av_channel_layout_default( &codecpar->ch_layout, fmt->audio.i_channels ); + #else + codecpar->channels = fmt->audio.i_channels; +-- +GitLab + + +From 38f9638ec71c2fe917dfd99ac2e1795b3357cfc3 Mon Sep 17 00:00:00 2001 +From: Steve Lhomme +Date: Tue, 18 Jun 2024 16:04:41 +0200 +Subject: [PATCH 12/15] ffmpeg: fix libavcodec version check for + AVCodecParameters.ch_layout +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +It was added in 276c06726fbd2f784d51189870bd834e9284812f which +was libavcodec 59.23.100 at the time but the minor version was not updated in +that commit so we check 59.24.100. + +This is part of FFmpeg 5.1. + +It was erroneously removed in a55ec32ab3760d9edb6f05481cd3a981aa42878d. + +https://github.com/FFmpeg/FFmpeg/commit/276c06726fbd2f784d51189870bd834e9284812f + +Co-authored-by: François Cartegnie +(cherry picked from commit 597bdb8e0784101b5f412feba3309558ad5b8862) +--- + modules/demux/avformat/mux.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/modules/demux/avformat/mux.c b/modules/demux/avformat/mux.c +index bf65ca36716..d8be5d1d9f5 100644 +--- a/modules/demux/avformat/mux.c ++++ b/modules/demux/avformat/mux.c +@@ -273,7 +273,7 @@ static int AddStream( sout_mux_t *p_mux, sout_input_t *p_input ) + { + case AUDIO_ES: + codecpar->codec_type = AVMEDIA_TYPE_AUDIO; +-#if LIBAVUTIL_VERSION_CHECK(57, 24, 100) ++#if LIBAVCODEC_VERSION_CHECK(59, 24, 100) && LIBAVUTIL_VERSION_CHECK(57, 24, 100) + av_channel_layout_default( &codecpar->ch_layout, fmt->audio.i_channels ); + #else + codecpar->channels = fmt->audio.i_channels; +-- +GitLab + + +From 0939d55b81e916ff303f92f301257c2e0885fdb9 Mon Sep 17 00:00:00 2001 +From: Steve Lhomme +Date: Wed, 19 Jun 2024 13:41:04 +0200 +Subject: [PATCH 13/15] avcodec: fix libavcodec version check for + AVCodecContext.ch_layout +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +It was added in 548aeb93834b8425c86d1ce60fddc1d41805724d which +was libavcodec 59.23.100 at the time but the minor version was not updated in +that commit so we check 59.24.100. + +This is part of FFmpeg 5.1. + +https://github.com/FFmpeg/FFmpeg/commit/548aeb93834b8425c86d1ce60fddc1d41805724d + +Co-authored-by: François Cartegnie +(cherry picked from commit 8fd918b8787b8d077decf1a2b955ab0c7b964bf3) (rebased) +rebased: +- on 3.0 fmt_in is not a pointer +--- + modules/codec/avcodec/audio.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/modules/codec/avcodec/audio.c b/modules/codec/avcodec/audio.c +index 979256c400a..fb22f033005 100644 +--- a/modules/codec/avcodec/audio.c ++++ b/modules/codec/avcodec/audio.c +@@ -142,7 +142,7 @@ static int OpenAudioCodec( decoder_t *p_dec ) + } + + ctx->sample_rate = p_dec->fmt_in.audio.i_rate; +-#if LIBAVUTIL_VERSION_CHECK(57, 24, 100) ++#if LIBAVCODEC_VERSION_CHECK(59, 24, 100) && LIBAVUTIL_VERSION_CHECK(57, 24, 100) + av_channel_layout_default( &ctx->ch_layout, p_dec->fmt_in.audio.i_channels ); + #else + ctx->channels = p_dec->fmt_in.audio.i_channels; +-- +GitLab + + +From e5072b340425e786b9e376cdf4bff4962c6e32f2 Mon Sep 17 00:00:00 2001 +From: Steve Lhomme +Date: Wed, 19 Jun 2024 08:36:40 +0200 +Subject: [PATCH 14/15] ffmpeg: fix libavutil version check for + AVFrame.ch_layout + +It was added in db6efa1815e217ed76f39aee8b15ee5c64698537 which +was libavutil 57.23.100 at the time but the minor version was not updated in +that commit so we check 57.24.100. + +This is part of FFmpeg 5.1. + +https://github.com/FFmpeg/FFmpeg/commit/db6efa1815e217ed76f39aee8b15ee5c64698537 +(cherry picked from commit f237155887f049f8befef2fdfadae7b60f697b0d) +--- + modules/codec/avcodec/audio.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/modules/codec/avcodec/audio.c b/modules/codec/avcodec/audio.c +index fb22f033005..c27771aeb2e 100644 +--- a/modules/codec/avcodec/audio.c ++++ b/modules/codec/avcodec/audio.c +@@ -407,7 +407,7 @@ static int DecodeBlock( decoder_t *p_dec, block_t **pp_block ) + ret = avcodec_receive_frame( ctx, frame ); + if( ret == 0 ) + { +-#if LIBAVCODEC_VERSION_CHECK(59, 24, 100) ++#if LIBAVUTIL_VERSION_CHECK(57, 24, 100) + int channels = frame->ch_layout.nb_channels; + #else + int channels = ctx->channels; +-- +GitLab + + +From 1713be552f9e26260a3ac33ce04ab89f660780cc Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Fran=C3=A7ois=20Cartegnie?= +Date: Thu, 20 Jun 2024 13:12:37 +0200 +Subject: [PATCH 15/15] avcodec: add a define to test for + AVCodecContext.ch_layout availability + +Co-authored-by: Steve Lhomme +(cherry picked from commit 3abf93735df97cc2c96e11028b76067547c27eb7) (rebased) +rebased: +- on 3.0 the fmt_in is not a pointer +- the code around is slightly different due to the use of API_CHANNEL_LAYOUT +--- + modules/codec/avcodec/audio.c | 8 +++++--- + modules/codec/avcodec/encoder.c | 12 +++++++----- + 2 files changed, 12 insertions(+), 8 deletions(-) + +diff --git a/modules/codec/avcodec/audio.c b/modules/codec/avcodec/audio.c +index c27771aeb2e..b6186d6ec56 100644 +--- a/modules/codec/avcodec/audio.c ++++ b/modules/codec/avcodec/audio.c +@@ -41,6 +41,8 @@ + #include + #include + ++#define API_CHANNEL_LAYOUT_STRUCT (LIBAVCODEC_VERSION_CHECK(59, 24, 100)) // AVCodecContext.ch_layout ++ + #define API_CHANNEL_LAYOUT (LIBAV_UTIL_VERSION_CHECK( 52, 2, 6, 0, 100)) + + #if API_CHANNEL_LAYOUT +@@ -142,7 +144,7 @@ static int OpenAudioCodec( decoder_t *p_dec ) + } + + ctx->sample_rate = p_dec->fmt_in.audio.i_rate; +-#if LIBAVCODEC_VERSION_CHECK(59, 24, 100) && LIBAVUTIL_VERSION_CHECK(57, 24, 100) ++#if API_CHANNEL_LAYOUT_STRUCT && LIBAVUTIL_VERSION_CHECK(57, 24, 100) + av_channel_layout_default( &ctx->ch_layout, p_dec->fmt_in.audio.i_channels ); + #else + ctx->channels = p_dec->fmt_in.audio.i_channels; +@@ -598,7 +600,7 @@ static void SetupOutputFormat( decoder_t *p_dec, bool b_trust ) + p_dec->fmt_out.audio.i_rate = p_sys->p_context->sample_rate; + + /* */ +-#if LIBAVCODEC_VERSION_CHECK(59, 24, 100) ++#if API_CHANNEL_LAYOUT_STRUCT + if( p_sys->i_previous_channels == p_sys->p_context->ch_layout.nb_channels && + p_sys->i_previous_layout == p_sys->p_context->ch_layout.u.mask ) + return; +@@ -622,7 +624,7 @@ static void SetupOutputFormat( decoder_t *p_dec, bool b_trust ) + + int i_channels_src = 0, channel_count; + uint64_t channel_layout_mask; +-#if LIBAVCODEC_VERSION_CHECK(59, 24, 100) ++#if API_CHANNEL_LAYOUT_STRUCT + channel_layout_mask = p_sys->p_context->ch_layout.u.mask; + channel_count = p_sys->p_context->ch_layout.nb_channels; + #elif API_CHANNEL_LAYOUT +diff --git a/modules/codec/avcodec/encoder.c b/modules/codec/avcodec/encoder.c +index ec63c9c5439..b0d31269244 100644 +--- a/modules/codec/avcodec/encoder.c ++++ b/modules/codec/avcodec/encoder.c +@@ -47,6 +47,8 @@ + #include "avcodec.h" + #include "avcommon.h" + ++#define API_CHANNEL_LAYOUT_STRUCT (LIBAVCODEC_VERSION_CHECK(59, 24, 100)) // AVCodecContext.ch_layout ++ + #define API_CHANNEL_LAYOUT (LIBAV_UTIL_VERSION_CHECK( 52, 2, 6, 0, 100)) + + #if API_CHANNEL_LAYOUT +@@ -182,7 +184,7 @@ static const uint64_t pi_channels_map[][2] = + { AV_CH_STEREO_RIGHT, 0 }, + }; + +-# if !LIBAVCODEC_VERSION_CHECK(59, 24, 100) ++# if !API_CHANNEL_LAYOUT_STRUCT + static const uint32_t channel_mask[][2] = { + {0,0}, + {AOUT_CHAN_CENTER, AV_CH_LAYOUT_MONO}, +@@ -764,7 +766,7 @@ int InitVideoEnc( vlc_object_t *p_this ) + uint32_t order_mask = 0; + int i_channels_src = 0; + msg_Dbg( p_enc, "Creating channel order for reordering"); +-# if LIBAVCODEC_VERSION_CHECK(59, 24, 100) && LIBAVUTIL_VERSION_CHECK(57, 24, 100) ++# if API_CHANNEL_LAYOUT_STRUCT && LIBAVUTIL_VERSION_CHECK(57, 24, 100) + av_channel_layout_default( &p_context->ch_layout, p_enc->fmt_out.audio.i_channels ); + uint64_t channel_mask = p_context->ch_layout.u.mask; + # else +@@ -917,7 +919,7 @@ errmsg: + + if( p_enc->fmt_out.audio.i_channels > 2 ) + { +-#if LIBAVCODEC_VERSION_CHECK(59, 24, 100) && LIBAVUTIL_VERSION_CHECK(57, 24, 100) ++#if API_CHANNEL_LAYOUT_STRUCT && LIBAVUTIL_VERSION_CHECK(57, 24, 100) + av_channel_layout_default( &p_context->ch_layout, 2 ); + #else + p_context->channels = 2; +@@ -1281,7 +1283,7 @@ static block_t *handle_delay_buffer( encoder_t *p_enc, encoder_sys_t *p_sys, uns + av_frame_unref( p_sys->frame ); + p_sys->frame->format = p_sys->p_context->sample_fmt; + p_sys->frame->nb_samples = leftover_samples + p_sys->i_samples_delay; +-#if LIBAVCODEC_VERSION_CHECK(59, 24, 100) && LIBAVUTIL_VERSION_CHECK(57, 24, 100) ++#if API_CHANNEL_LAYOUT_STRUCT && LIBAVUTIL_VERSION_CHECK(57, 24, 100) + av_channel_layout_copy(&p_sys->frame->ch_layout, &p_sys->p_context->ch_layout); + #else + p_sys->frame->channel_layout = p_sys->p_context->channel_layout; +@@ -1416,7 +1418,7 @@ static block_t *EncodeAudio( encoder_t *p_enc, block_t *p_aout_buf ) + p_sys->frame->pts = date_Get( &p_sys->buffer_date ) * p_sys->p_context->time_base.den / + CLOCK_FREQ / p_sys->p_context->time_base.num; + +-#if LIBAVCODEC_VERSION_CHECK(59, 24, 100) && LIBAVUTIL_VERSION_CHECK(57, 24, 100) ++#if API_CHANNEL_LAYOUT_STRUCT && LIBAVUTIL_VERSION_CHECK(57, 24, 100) + av_channel_layout_copy(&p_sys->frame->ch_layout, &p_sys->p_context->ch_layout); + #else + p_sys->frame->channel_layout = p_sys->p_context->channel_layout; +-- +GitLab + diff --git a/anda/apps/vlc/6527.patch b/anda/apps/vlc/6527.patch new file mode 100644 index 0000000000..1c386faeb6 --- /dev/null +++ b/anda/apps/vlc/6527.patch @@ -0,0 +1,46 @@ +From a945944c2d50cacfacdd5b16d4ea5e7b4766a9fc Mon Sep 17 00:00:00 2001 +From: Steve Lhomme +Date: Mon, 16 Dec 2024 09:28:55 +0100 +Subject: [PATCH] nfs: fix libnfs API v2 support + +Introduced in libnfs 6.0.0. + +Co-authored-by: ronnie sahlberg +Co-authored-by: Thomas Guillem +--- + modules/access/nfs.c | 9 ++++++++- + 1 file changed, 8 insertions(+), 1 deletion(-) + +diff --git a/modules/access/nfs.c b/modules/access/nfs.c +index f164cda86499..3510c3fe1f14 100644 +--- a/modules/access/nfs.c ++++ b/modules/access/nfs.c +@@ -188,7 +188,8 @@ nfs_read_cb(int i_status, struct nfs_context *p_nfs, void *p_data, + else + { + p_sys->res.read.i_len = i_status; +- memcpy(p_sys->res.read.p_buf, p_data, i_status); ++ if (p_sys->res.read.p_buf != NULL && p_data != NULL) ++ memcpy(p_sys->res.read.p_buf, p_data, i_status); + } + } + +@@ -208,9 +209,15 @@ FileRead(stream_t *p_access, void *p_buf, size_t i_len) + return 0; + + p_sys->res.read.i_len = 0; ++#ifdef LIBNFS_API_V2 ++ p_sys->res.read.p_buf = NULL; ++ if (nfs_read_async(p_sys->p_nfs, p_sys->p_nfsfh, p_buf, i_len, nfs_read_cb, ++ p_access) < 0) ++#else + p_sys->res.read.p_buf = p_buf; + if (nfs_read_async(p_sys->p_nfs, p_sys->p_nfsfh, i_len, nfs_read_cb, + p_access) < 0) ++#endif + { + msg_Err(p_access, "nfs_read_async failed"); + return 0; +-- +GitLab + diff --git a/anda/apps/vlc/6606.patch b/anda/apps/vlc/6606.patch new file mode 100644 index 0000000000..322818b348 --- /dev/null +++ b/anda/apps/vlc/6606.patch @@ -0,0 +1,149 @@ +From ba5dc03aecc1d96f81b76838f845ebde7348cf62 Mon Sep 17 00:00:00 2001 +From: David Rosca +Date: Fri, 20 Dec 2024 20:24:36 +0100 +Subject: [PATCH] avcodec: vaapi: Support VAAPI with latest FFmpeg + +--- + configure.ac | 20 +------------ + modules/codec/Makefile.am | 2 +- + modules/codec/avcodec/avcommon_compat.h | 3 ++ + modules/codec/avcodec/vaapi.c | 38 +++++++++++++++++++++++-- + 4 files changed, 41 insertions(+), 22 deletions(-) + +diff --git a/configure.ac b/configure.ac +index 00afb063c455..089339e10e0b 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -2550,25 +2550,7 @@ AM_CONDITIONAL([HAVE_VAAPI], [test "${have_vaapi}" = "yes"]) + AM_CONDITIONAL([HAVE_VAAPI_DRM], [test "${have_vaapi_drm}" = "yes"]) + AM_CONDITIONAL([HAVE_VAAPI_X11], [test "${have_vaapi_x11}" = "yes"]) + AM_CONDITIONAL([HAVE_VAAPI_WL], [test "${have_vaapi_wl}" = "yes"]) +- +-have_avcodec_vaapi="no" +-AS_IF([test "${have_vaapi}" = "yes" -a "${have_avcodec}" = "yes"], [ +- VLC_SAVE_FLAGS +- CPPFLAGS="${CPPFLAGS} ${AVCODEC_CFLAGS}" +- CFLAGS="${CFLAGS} ${AVCODEC_CFLAGS}" +- AC_CHECK_HEADERS([libavcodec/vaapi.h], [ +- AC_MSG_NOTICE([VA API acceleration activated]) +- have_avcodec_vaapi="yes" +- ],[ +- AS_IF([test -n "${enable_libva}"], [ +- AC_MSG_ERROR([libva is present but libavcodec/vaapi.h is missing]) +- ], [ +- AC_MSG_WARN([libva is present but libavcodec/vaapi.h is missing ]) +- ]) +- ]) +- VLC_RESTORE_FLAGS +-]) +-AM_CONDITIONAL([HAVE_AVCODEC_VAAPI], [test "${have_avcodec_vaapi}" = "yes"]) ++AM_CONDITIONAL([HAVE_AVCODEC_VAAPI], [test "${have_vaapi}" = "yes" -a "${have_avcodec}" = "yes"]) + + dnl + dnl dxva2 needs avcodec +diff --git a/modules/codec/Makefile.am b/modules/codec/Makefile.am +index 6d9465fdaef9..dd04391c1bf7 100644 +--- a/modules/codec/Makefile.am ++++ b/modules/codec/Makefile.am +@@ -416,7 +416,7 @@ libvaapi_plugin_la_SOURCES = \ + codec/avcodec/vaapi.c hw/vaapi/vlc_vaapi.c hw/vaapi/vlc_vaapi.h + libvaapi_plugin_la_CPPFLAGS = $(AM_CPPFLAGS) + libvaapi_plugin_la_CFLAGS = $(AM_CFLAGS) $(AVCODEC_CFLAGS) +-libvaapi_plugin_la_LIBADD = $(LIBVA_LIBS) ++libvaapi_plugin_la_LIBADD = $(LIBVA_LIBS) $(AVCODEC_LIBS) + if HAVE_AVCODEC_VAAPI + if HAVE_VAAPI_DRM + codec_LTLIBRARIES += libvaapi_drm_plugin.la +diff --git a/modules/codec/avcodec/avcommon_compat.h b/modules/codec/avcodec/avcommon_compat.h +index ac02c06d2339..8ab6910f3250 100644 +--- a/modules/codec/avcodec/avcommon_compat.h ++++ b/modules/codec/avcodec/avcommon_compat.h +@@ -84,6 +84,9 @@ + #ifndef FF_API_AVIO_WRITE_NONCONST // removed in ffmpeg 7 + # define FF_API_AVIO_WRITE_NONCONST (LIBAVFORMAT_VERSION_MAJOR < 61) + #endif ++#ifndef FF_API_STRUCT_VAAPI_CONTEXT ++# define FF_API_STRUCT_VAAPI_CONTEXT (LIBAVCODEC_VERSION_MAJOR < 59) ++#endif + + #endif /* HAVE_LIBAVCODEC_AVCODEC_H */ + +diff --git a/modules/codec/avcodec/vaapi.c b/modules/codec/avcodec/vaapi.c +index c83269e43f30..e203baaf9ee2 100644 +--- a/modules/codec/avcodec/vaapi.c ++++ b/modules/codec/avcodec/vaapi.c +@@ -42,12 +42,25 @@ + # include + #endif + #include ++#if FF_API_STRUCT_VAAPI_CONTEXT + #include ++#else ++#include ++#endif + + #include "avcodec.h" + #include "va.h" + #include "../../hw/vaapi/vlc_vaapi.h" + ++#if !FF_API_STRUCT_VAAPI_CONTEXT ++struct vaapi_context ++{ ++ VADisplay display; ++ VAConfigID config_id; ++ VAContextID context_id; ++}; ++#endif ++ + struct vlc_va_sys_t + { + struct vlc_vaapi_instance *va_inst; +@@ -145,8 +158,10 @@ static void Delete(vlc_va_t *va, void **hwctx) + + (void) hwctx; + +- vlc_vaapi_DestroyContext(o, sys->hw_ctx.display, sys->hw_ctx.context_id); +- vlc_vaapi_DestroyConfig(o, sys->hw_ctx.display, sys->hw_ctx.config_id); ++ if (sys->hw_ctx.context_id != VA_INVALID_ID) ++ vlc_vaapi_DestroyContext(o, sys->hw_ctx.display, sys->hw_ctx.context_id); ++ if (sys->hw_ctx.config_id != VA_INVALID_ID) ++ vlc_vaapi_DestroyConfig(o, sys->hw_ctx.display, sys->hw_ctx.config_id); + vlc_vaapi_ReleaseInstance(sys->va_inst); + free(sys); + } +@@ -196,6 +211,7 @@ static int Create(vlc_va_t *va, AVCodecContext *ctx, const AVPixFmtDescriptor *d + sys->hw_ctx.config_id = VA_INVALID_ID; + sys->hw_ctx.context_id = VA_INVALID_ID; + ++#if FF_API_STRUCT_VAAPI_CONTEXT + sys->hw_ctx.config_id = + vlc_vaapi_CreateConfigChecked(o, sys->hw_ctx.display, i_profile, + VAEntrypointVLD, i_vlc_chroma); +@@ -211,6 +227,24 @@ static int Create(vlc_va_t *va, AVCodecContext *ctx, const AVPixFmtDescriptor *d + goto error; + + ctx->hwaccel_context = &sys->hw_ctx; ++#else ++ AVBufferRef *hwdev_ref = av_hwdevice_ctx_alloc(AV_HWDEVICE_TYPE_VAAPI); ++ if (hwdev_ref == NULL) ++ goto error; ++ ++ AVHWDeviceContext *hwdev_ctx = (void *) hwdev_ref->data; ++ AVVAAPIDeviceContext *vadev_ctx = hwdev_ctx->hwctx; ++ vadev_ctx->display = va_dpy; ++ ++ if (av_hwdevice_ctx_init(hwdev_ref) < 0) ++ { ++ av_buffer_unref(&hwdev_ref); ++ goto error; ++ } ++ ++ ctx->hw_device_ctx = hwdev_ref; ++#endif ++ + va->sys = sys; + va->description = vaQueryVendorString(sys->hw_ctx.display); + va->get = Get; +-- +GitLab + diff --git a/anda/apps/vlc/anda.hcl b/anda/apps/vlc/anda.hcl new file mode 100644 index 0000000000..8fcf0b825b --- /dev/null +++ b/anda/apps/vlc/anda.hcl @@ -0,0 +1,11 @@ +project pkg { + arches = ["x86_64", "aarch64", "i386"] + rpm { + spec = "vlc.spec" + extra_repos = ["https://repos.fyralabs.com/terra\\$releasever-multimedia"] + } + labels { + mock = 1 + subrepo = "multimedia" + } +} diff --git a/anda/apps/vlc/appdata.patch b/anda/apps/vlc/appdata.patch new file mode 100644 index 0000000000..2002a1386e --- /dev/null +++ b/anda/apps/vlc/appdata.patch @@ -0,0 +1,19 @@ +diff --git a/share/vlc.appdata.xml.in.in b/share/vlc.appdata.xml.in.in +index cc9c39a..3c55620 100644 +--- a/share/vlc.appdata.xml.in.in ++++ b/share/vlc.appdata.xml.in.in +@@ -18,7 +18,7 @@ + https://trac.videolan.org/vlc/ + https://www.videolan.org/contribute.html + +- ++ + + + libvlc.so.5 +@@ -38,4 +38,5 @@ + http://images.videolan.org/vlc/screenshots/2.0.0/vlc-2.0-gnome3-debian.jpg + + ++ + diff --git a/anda/apps/vlc/fdk-aac2.patch b/anda/apps/vlc/fdk-aac2.patch new file mode 100644 index 0000000000..a5104d1df6 --- /dev/null +++ b/anda/apps/vlc/fdk-aac2.patch @@ -0,0 +1,84 @@ +From 6ea9b13fe82fae2b25b7371c6c36d6296db28ccb Mon Sep 17 00:00:00 2001 +From: Antonio Larrosa +Date: Thu, 14 Feb 2019 10:09:30 +0100 +Subject: [PATCH] Fix building vlc with libfdk-aac v2 + +When flushing the encoder, we now need to provide non-null buffer +parameters for everything, even if they are unused. + +The encoderDelay parameter has been replaced by two, nDelay and +nDelayCore. + +This is based on: +https://git.libav.org/?p=libav.git;a=commitdiff_plain;h=141c960e21d2860e354f9b90df136184dd00a9a8;hp=c8bca9fe466f810fd484e2c6db7ef7bc83b5a943 + +Signed-off-by: Jean-Baptiste Kempf +--- + modules/codec/fdkaac.c | 27 +++++++++++++++++++++------ + 1 file changed, 21 insertions(+), 6 deletions(-) + +diff --git a/modules/codec/fdkaac.c b/modules/codec/fdkaac.c +index e0b3088c4a..3ac7b756a3 100644 +--- a/modules/codec/fdkaac.c ++++ b/modules/codec/fdkaac.c +@@ -92,6 +92,11 @@ static void CloseEncoder(vlc_object_t *); + #define SIGNALING_COMPATIBLE 1 + #define SIGNALING_HIERARCHICAL 2 + ++#define FDKENC_VER_AT_LEAST(vl0, vl1) \ ++ (defined(AACENCODER_LIB_VL0) && \ ++ ((AACENCODER_LIB_VL0 > vl0) || \ ++ (AACENCODER_LIB_VL0 == vl0 && AACENCODER_LIB_VL1 >= vl1))) ++ + static const int pi_aot_values[] = { PROFILE_AAC_LC, PROFILE_AAC_HE, PROFILE_AAC_HE_v2, PROFILE_AAC_LD, PROFILE_AAC_ELD }; + static const char *const ppsz_aot_descriptions[] = + { N_("AAC-LC"), N_("HE-AAC"), N_("HE-AAC-v2"), N_("AAC-LD"), N_("AAC-ELD") }; +@@ -288,7 +293,11 @@ static int OpenEncoder(vlc_object_t *p_this) + p_sys->i_maxoutputsize = 768*p_enc->fmt_in.audio.i_channels; + p_enc->fmt_in.audio.i_bitspersample = 16; + p_sys->i_frame_size = info.frameLength; ++#if FDKENC_VER_AT_LEAST(4, 0) ++ p_sys->i_encoderdelay = info.nDelay; ++#else + p_sys->i_encoderdelay = info.encoderDelay; ++#endif + + p_enc->fmt_out.i_extra = info.confSize; + if (p_enc->fmt_out.i_extra) { +@@ -351,21 +360,27 @@ static block_t *EncodeAudio(encoder_t *p_enc, block_t *p_aout_buf) + int out_identifier = OUT_BITSTREAM_DATA; + int out_size, out_elem_size; + void *in_ptr, *out_ptr; ++ uint8_t dummy_buf[1]; + + if (unlikely(i_samples == 0)) { + // this forces the encoder to purge whatever is left in the internal buffer ++ /* Must be a non-null pointer, even if it's a dummy. We could use ++ * the address of anything else on the stack as well. */ ++ in_ptr = dummy_buf; ++ in_size = 0; ++ + in_args.numInSamples = -1; + } else { + in_ptr = p_buffer + (i_samples - i_samples_left)*p_enc->fmt_in.audio.i_channels; + in_size = 2*p_enc->fmt_in.audio.i_channels*i_samples_left; +- in_elem_size = 2; + in_args.numInSamples = p_enc->fmt_in.audio.i_channels*i_samples_left; +- in_buf.numBufs = 1; +- in_buf.bufs = &in_ptr; +- in_buf.bufferIdentifiers = &in_identifier; +- in_buf.bufSizes = &in_size; +- in_buf.bufElSizes = &in_elem_size; + } ++ in_elem_size = 2; ++ in_buf.numBufs = 1; ++ in_buf.bufs = &in_ptr; ++ in_buf.bufferIdentifiers = &in_identifier; ++ in_buf.bufSizes = &in_size; ++ in_buf.bufElSizes = &in_elem_size; + block_t *p_block; + p_block = block_Alloc(p_sys->i_maxoutputsize); + p_block->i_buffer = p_sys->i_maxoutputsize; +-- +2.11.0 + diff --git a/anda/apps/vlc/freerdp2.patch b/anda/apps/vlc/freerdp2.patch new file mode 100644 index 0000000000..0aa29424ac --- /dev/null +++ b/anda/apps/vlc/freerdp2.patch @@ -0,0 +1,239 @@ +From 1c27f57498b7e0f52acc7b4520c4172a2462632d Mon Sep 17 00:00:00 2001 +From: Juliane de Sartiges +Date: Wed, 27 Jul 2022 09:32:25 +0200 +Subject: [PATCH] freerdp: update to freerdp2 api + +--- + configure.ac | 2 +- + modules/access/rdp.c | 85 ++++++++++++++++++++------------------------ + 2 files changed, 40 insertions(+), 47 deletions(-) + +diff --git a/configure.ac b/configure.ac +index b454198157..cb23a9b2ab 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -2094,7 +2094,7 @@ PKG_ENABLE_MODULES_VLC([VNC], [vnc], [libvncclient >= 0.9.9], (VNC/rfb client su + + dnl RDP/Remote Desktop access module + dnl +-PKG_ENABLE_MODULES_VLC([FREERDP], [rdp], [freerdp >= 1.0.1], (RDP/Remote Desktop client support) ) ++PKG_ENABLE_MODULES_VLC([FREERDP], [rdp], [freerdp2 >= 2.0.0], (RDP/Remote Desktop client support) ) + + dnl + dnl Real RTSP plugin +diff --git a/modules/access/rdp.c b/modules/access/rdp.c +index 0c39663c64..04ae005938 100644 +--- a/modules/access/rdp.c ++++ b/modules/access/rdp.c +@@ -45,18 +45,6 @@ + # include + #endif + +-#if !defined(FREERDP_VERSION_MAJOR) || \ +- (defined(FREERDP_VERSION_MAJOR) && !(FREERDP_VERSION_MAJOR > 1 || (FREERDP_VERSION_MAJOR == 1 && FREERDP_VERSION_MINOR >= 1))) +-# define SoftwareGdi sw_gdi +-# define Fullscreen fullscreen +-# define ServerHostname hostname +-# define Username username +-# define Password password +-# define ServerPort port +-# define EncryptionMethods encryption +-# define ContextSize context_size +-#endif +- + #include + #ifdef HAVE_POLL + # include +@@ -75,6 +63,8 @@ + + #define CFG_PREFIX "rdp-" + ++#define FREERDP_PIXEL_BPP(_format) (_format >> 24) ++ + /***************************************************************************** + * Module descriptor + *****************************************************************************/ +@@ -139,11 +129,12 @@ typedef struct vlcrdp_context_t vlcrdp_context_t; + + /* updates handlers */ + +-static void desktopResizeHandler( rdpContext *p_context ) ++static BOOL desktopResizeHandler( rdpContext *p_context ) + { + vlcrdp_context_t * p_vlccontext = (vlcrdp_context_t *) p_context; + demux_sys_t *p_sys = p_vlccontext->p_demux->p_sys; + rdpGdi *p_gdi = p_context->gdi; ++ int i_colordepth = FREERDP_PIXEL_BPP( p_gdi->dstFormat ); + + if ( p_sys->es ) + { +@@ -151,11 +142,13 @@ static void desktopResizeHandler( rdpContext *p_context ) + p_sys->es = NULL; + } + +- /* Now init and fill es format */ + vlc_fourcc_t i_chroma; +- switch( p_gdi->bytesPerPixel ) ++ /* Now init and fill es format */ ++ switch ( i_colordepth ) + { + default: ++ msg_Dbg( p_vlccontext->p_demux, "invalid color depth %d", i_colordepth); ++ /* fallthrough */ + case 16: + i_chroma = VLC_CODEC_RGB16; + break; +@@ -163,7 +156,7 @@ static void desktopResizeHandler( rdpContext *p_context ) + i_chroma = VLC_CODEC_RGB24; + break; + case 32: +- i_chroma = VLC_CODEC_RGB32; ++ i_chroma = VLC_CODEC_ARGB; + break; + } + es_format_t fmt; +@@ -176,7 +169,7 @@ static void desktopResizeHandler( rdpContext *p_context ) + fmt.video.i_height = p_gdi->height; + fmt.video.i_frame_rate_base = 1000; + fmt.video.i_frame_rate = 1000 * p_sys->f_fps; +- p_sys->i_framebuffersize = p_gdi->width * p_gdi->height * p_gdi->bytesPerPixel; ++ p_sys->i_framebuffersize = p_gdi->width * p_gdi->height * (i_colordepth >> 3); + + if ( p_sys->p_block ) + p_sys->p_block = block_Realloc( p_sys->p_block, 0, p_sys->i_framebuffersize ); +@@ -184,20 +177,21 @@ static void desktopResizeHandler( rdpContext *p_context ) + p_sys->p_block = block_Alloc( p_sys->i_framebuffersize ); + + p_sys->es = es_out_Add( p_vlccontext->p_demux->out, &fmt ); ++ return TRUE; + } + +-static void beginPaintHandler( rdpContext *p_context ) ++static BOOL beginPaintHandler( rdpContext *p_context ) + { + vlcrdp_context_t * p_vlccontext = (vlcrdp_context_t *) p_context; + demux_sys_t *p_sys = p_vlccontext->p_demux->p_sys; + rdpGdi *p_gdi = p_context->gdi; +- p_gdi->primary->hdc->hwnd->invalid->null = 1; +- p_gdi->primary->hdc->hwnd->ninvalid = 0; ++ p_gdi->primary->hdc->hwnd->invalid->null = TRUE; + if ( ! p_sys->p_block && p_sys->i_framebuffersize ) + p_sys->p_block = block_Alloc( p_sys->i_framebuffersize ); ++ return TRUE; + } + +-static void endPaintHandler( rdpContext *p_context ) ++static BOOL endPaintHandler( rdpContext *p_context ) + { + vlcrdp_context_t * p_vlccontext = (vlcrdp_context_t *) p_context; + demux_sys_t *p_sys = p_vlccontext->p_demux->p_sys; +@@ -208,11 +202,12 @@ static void endPaintHandler( rdpContext *p_context ) + p_sys->p_block->i_buffer = p_sys->i_framebuffersize; + memcpy( p_sys->p_block->p_buffer, p_gdi->primary_buffer, p_sys->p_block->i_buffer ); + } ++ return TRUE; + } + + /* instance handlers */ + +-static bool preConnectHandler( freerdp *p_instance ) ++static BOOL preConnectHandler( freerdp *p_instance ) + { + vlcrdp_context_t * p_vlccontext = (vlcrdp_context_t *) p_instance->context; + demux_sys_t *p_sys = p_vlccontext->p_demux->p_sys; +@@ -229,49 +224,54 @@ static bool preConnectHandler( freerdp *p_instance ) + p_instance->settings->EncryptionMethods = + var_InheritBool( p_vlccontext->p_demux, CFG_PREFIX "encrypt" ); + +- return true; ++ return TRUE; + } + +-static bool postConnectHandler( freerdp *p_instance ) ++static BOOL postConnectHandler( freerdp *p_instance ) + { + vlcrdp_context_t * p_vlccontext = (vlcrdp_context_t *) p_instance->context; + + msg_Dbg( p_vlccontext->p_demux, "connected to desktop %dx%d (%d bpp)", +-#if defined(FREERDP_VERSION_MAJOR) && (FREERDP_VERSION_MAJOR > 1 || (FREERDP_VERSION_MAJOR == 1 && FREERDP_VERSION_MINOR >= 1)) + p_instance->settings->DesktopWidth, + p_instance->settings->DesktopHeight, + p_instance->settings->ColorDepth +-#else +- p_instance->settings->width, +- p_instance->settings->height, +- p_instance->settings->color_depth +-#endif + ); + + p_instance->update->DesktopResize = desktopResizeHandler; + p_instance->update->BeginPaint = beginPaintHandler; + p_instance->update->EndPaint = endPaintHandler; ++ UINT32 format; ++ switch ( p_instance->settings->ColorDepth ) ++ { ++ default: ++ msg_Dbg( p_vlccontext->p_demux, "no valid pixel format found for color depth %d bpp", p_instance->settings->ColorDepth); ++ /* fallthrough */ ++ case 16: ++ format = PIXEL_FORMAT_RGB16; ++ break; ++ case 24: ++ format = PIXEL_FORMAT_RGB24; ++ break; ++ case 32: ++ format = PIXEL_FORMAT_ARGB32; ++ break; ++ } + + gdi_init( p_instance, +- CLRBUF_16BPP | +-#if defined(FREERDP_VERSION_MAJOR) && defined(FREERDP_VERSION_MINOR) && \ +- !(FREERDP_VERSION_MAJOR > 1 || (FREERDP_VERSION_MAJOR == 1 && FREERDP_VERSION_MINOR >= 2)) +- CLRBUF_24BPP | +-#endif +- CLRBUF_32BPP, NULL ); ++ format ); + + desktopResizeHandler( p_instance->context ); +- return true; ++ return TRUE; + } + +-static bool authenticateHandler( freerdp *p_instance, char** ppsz_username, ++static BOOL authenticateHandler( freerdp *p_instance, char** ppsz_username, + char** ppsz_password, char** ppsz_domain ) + { + VLC_UNUSED(ppsz_domain); + vlcrdp_context_t * p_vlccontext = (vlcrdp_context_t *) p_instance->context; + *ppsz_username = var_InheritString( p_vlccontext->p_demux, CFG_PREFIX "user" ); + *ppsz_password = var_InheritString( p_vlccontext->p_demux, CFG_PREFIX "password" ); +- return true; ++ return TRUE; + } + + /***************************************************************************** +@@ -432,10 +432,6 @@ static int Open( vlc_object_t *p_this ) + if ( p_sys->f_fps <= 0 ) p_sys->f_fps = 1.0; + p_sys->i_frame_interval = 1000000 / p_sys->f_fps; + +-#if FREERDP_VERSION_MAJOR == 1 && FREERDP_VERSION_MINOR < 2 +- freerdp_channels_global_init(); +-#endif +- + p_sys->p_instance = freerdp_new(); + if ( !p_sys->p_instance ) + { +@@ -512,9 +508,6 @@ static void Close( vlc_object_t *p_this ) + + freerdp_disconnect( p_sys->p_instance ); + freerdp_free( p_sys->p_instance ); +-#if FREERDP_VERSION_MAJOR == 1 && FREERDP_VERSION_MINOR < 2 +- freerdp_channels_global_uninit(); +-#endif + + if ( p_sys->p_block ) + block_Release( p_sys->p_block ); +-- +2.45.2 + diff --git a/anda/apps/vlc/libidn2.patch b/anda/apps/vlc/libidn2.patch new file mode 100644 index 0000000000..0a984978f7 --- /dev/null +++ b/anda/apps/vlc/libidn2.patch @@ -0,0 +1,49 @@ +diff --git a/configure.ac b/configure.ac +index 78b9ce2..b9c1563 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -910,9 +910,9 @@ AM_CONDITIONAL(HAVE_MINIZIP, [ test "${have_minizip}" = "yes" ]) + + + dnl +-dnl Domain name i18n support via GNU libidn ++dnl Domain name i18n support via GNU libidn2 + dnl +-PKG_CHECK_MODULES([IDN], [libidn], [ ++PKG_CHECK_MODULES([IDN], [libidn2], [ + have_libidn="yes" + AC_DEFINE([HAVE_IDN], 1, [Define to 1 if you have GNU libidn.]) + ], [ +diff --git a/src/text/url.c b/src/text/url.c +index 2eb4b8d..467b7f3 100644 +--- a/src/text/url.c ++++ b/src/text/url.c +@@ -873,7 +873,7 @@ char *vlc_uri_fixup(const char *str) + } + + #if defined (HAVE_IDN) +-# include ++# include + #elif defined (_WIN32) + # include + # include +@@ -914,16 +914,13 @@ static char *vlc_idna_to_ascii (const char *idn) + #if defined (HAVE_IDN) + char *adn; + +- switch (idna_to_ascii_8z(idn, &adn, IDNA_ALLOW_UNASSIGNED)) ++ switch (idn2_to_ascii_8z(idn, &adn, IDN2_ALLOW_UNASSIGNED|IDN2_NFC_INPUT|IDN2_NONTRANSITIONAL)) + { +- case IDNA_SUCCESS: ++ case IDN2_OK: + return adn; +- case IDNA_MALLOC_ERROR: ++ case IDN2_MALLOC: + errno = ENOMEM; + return NULL; +- case IDNA_DLOPEN_ERROR: +- errno = ENOSYS; +- return NULL; + default: + errno = EINVAL; + return NULL; diff --git a/anda/apps/vlc/live555.patch b/anda/apps/vlc/live555.patch new file mode 100644 index 0000000000..b2f35db3b2 --- /dev/null +++ b/anda/apps/vlc/live555.patch @@ -0,0 +1,17 @@ +diff -up vlc-3.0.21/modules/access/live555.cpp.orig vlc-3.0.21/modules/access/live555.cpp +--- vlc-3.0.21/modules/access/live555.cpp.orig 2024-06-05 17:56:07.000000000 +0200 ++++ vlc-3.0.21/modules/access/live555.cpp 2024-12-06 11:41:08.633053039 +0100 +@@ -236,8 +236,13 @@ struct demux_sys_t + bool b_no_data; /* if we never received any data */ + int i_no_data_ti; /* consecutive number of TaskInterrupt */ + ++#if LIVEMEDIA_LIBRARY_VERSION_INT >= 1732752000 ++ std::atomic_char event_rtsp; ++ std::atomic_char event_data; ++#else + char event_rtsp; + char event_data; ++#endif + + bool b_get_param; /* Does the server support GET_PARAMETER */ + bool b_paused; /* Are we paused? */ diff --git a/anda/apps/vlc/lua-math.patch b/anda/apps/vlc/lua-math.patch new file mode 100644 index 0000000000..3972717aee --- /dev/null +++ b/anda/apps/vlc/lua-math.patch @@ -0,0 +1,11 @@ +--- ./share/lua/intf/modules/httprequests.lua.Orig 2023-08-05 06:03:51.000000000 -0400 ++++ ./share/lua/intf/modules/httprequests.lua 2024-05-28 14:02:41.569002601 -0400 +@@ -34,7 +34,7 @@ + what = common.us_tonumber(what) + end + if type(what) == "number" then +- return math.floor(what*math.pow(10,precision)+0.5) / math.pow(10,precision) ++ return math.floor(what*(10^precision)+0.5) / (10^precision) + end + return nil + end diff --git a/anda/apps/vlc/macros.vlc b/anda/apps/vlc/macros.vlc new file mode 100644 index 0000000000..6444560e6b --- /dev/null +++ b/anda/apps/vlc/macros.vlc @@ -0,0 +1 @@ +%vlc_plugindir %{_libdir}/vlc/plugins diff --git a/anda/apps/vlc/oneVPL.patch b/anda/apps/vlc/oneVPL.patch new file mode 100644 index 0000000000..849a565adb --- /dev/null +++ b/anda/apps/vlc/oneVPL.patch @@ -0,0 +1,48 @@ +Backport of https://code.videolan.org/videolan/vlc/-/merge_requests/3843 +"Switch from deprecated MFX to VPL" for 3.0, as direct use of intel-mediasdk +is deprecated in favour of oneVPL. + +diff --git a/configure.ac b/configure.ac +--- a/configure.ac ++++ b/configure.ac +@@ -2923,9 +2923,9 @@ fi + + + dnl +-dnl Intel QuickSync (aka MediaSDK) H264/H262 encoder ++dnl Intel oneAPI Video Processing Library + dnl +-PKG_ENABLE_MODULES_VLC([MFX], [qsv], [libmfx], [Intel QuickSync MPEG4-Part10/MPEG2 (aka H.264/H.262) encoder], [auto]) ++PKG_ENABLE_MODULES_VLC([VPL], [qsv], [vpl], [Intel oneAPI Video Processing Library encoder], [auto]) + + dnl + dnl libfluidsynth (MIDI synthetizer) plugin +diff --git a/modules/codec/Makefile.am b/modules/codec/Makefile.am +--- a/modules/codec/Makefile.am ++++ b/modules/codec/Makefile.am +@@ -610,9 +610,9 @@ codec_LTLIBRARIES += $(LTLIBdav1d) + codec_LTLIBRARIES += $(LTLIBcrystalhd) + + libqsv_plugin_la_SOURCES = codec/qsv.c +-libqsv_plugin_la_CFLAGS = $(AM_CFLAGS) $(MFX_CFLAGS) ++libqsv_plugin_la_CFLAGS = $(AM_CFLAGS) $(VPL_CFLAGS) + libqsv_plugin_la_LDFLAGS = $(AM_LDFLAGS) -rpath '$(codecdir)' +-libqsv_plugin_la_LIBADD = $(MFX_LIBS) ++libqsv_plugin_la_LIBADD = $(VPL_LIBS) + EXTRA_LTLIBRARIES += libqsv_plugin.la + codec_LTLIBRARIES += $(LTLIBqsv) + +diff --git a/modules/codec/qsv.c b/modules/codec/qsv.c +--- a/modules/codec/qsv.c ++++ b/modules/codec/qsv.c +@@ -33,7 +33,7 @@ + #include + #include + +-#include ++#include + + #define SOUT_CFG_PREFIX "sout-qsv-" + +-- +GitLab diff --git a/anda/apps/vlc/update.rhai b/anda/apps/vlc/update.rhai new file mode 100644 index 0000000000..6d92e66337 --- /dev/null +++ b/anda/apps/vlc/update.rhai @@ -0,0 +1 @@ +rpm.version(find(`\"name\":\"Linux\",\"latestVersion\":\"([\d.]+)\"`, get(`https://www.videolan.org/vlc/`), 1)); diff --git a/anda/apps/vlc/vlc.spec b/anda/apps/vlc/vlc.spec new file mode 100644 index 0000000000..d6ba82df51 --- /dev/null +++ b/anda/apps/vlc/vlc.spec @@ -0,0 +1,1309 @@ +# codecs which cannot be shipped in Fedora proper +%bcond freeworld 1 +%bcond x264 %{with freeworld} +%bcond x265 %{with freeworld} + +# not compatible with asdcplib-2.12 +%bcond asdcp %[!(0%{?fedora} >= 38 || 0%{?rhel} >= 10)] +# not compatible with opencv 3.4 or 4.0 +# https://code.videolan.org/videolan/vlc/-/issues/22016 +%bcond opencv 0 +# not compatible with libplacebo-6 +# https://code.videolan.org/videolan/vlc/-/merge_requests/3950 +%bcond placebo %[!(0%{?fedora} >= 39 || 0%{?rhel} >= 10)] +# disabled due to various issues +%bcond projectm 0 + +# some dependencies are not yet in EPEL 10 +%bcond daala %{undefined el10} +%bcond lirc 1 +%bcond schro %[!(0%{?rhel} >= 10)] +%bcond sdl %[!(0%{?rhel} >= 10)] + +%ifnarch s390x +# retired from F43, was never in EPEL 9+ +%bcond crystalhd 0 +%bcond ieee1394 1 +%endif + +%ifarch x86_64 +%bcond vpl 1 +%endif + +Name: vlc +Epoch: 2 +Version: 3.0.21 +Release: 1%{?dist} +Summary: The cross-platform open-source multimedia framework, player and server +License: GPL-2.0-or-later AND LGPL-2.1-or-later AND BSD-2-Clause AND BSD-3-Clause +URL: https://www.videolan.org +Source0: https://get.videolan.org/vlc/%{version}/vlc-%{version}.tar.xz +Source1: macros.vlc + +## upstream patches +# opus_header: fix channel mapping family 1 parsing (rhbz#2307919) +Patch0: https://code.videolan.org/videolan/vlc/-/merge_requests/5590.patch +# add support for ffmpeg 7.0 (without VAAPI) +Patch1: https://code.videolan.org/videolan/vlc/-/merge_requests/5574.patch +# mux: avformat: fix avio callbacks signature with ffmpeg 6.1 +Patch2: https://code.videolan.org/videolan/vlc/-/merge_requests/6168.patch +# ffmpeg: backport more channel checks +Patch3: https://code.videolan.org/videolan/vlc/-/merge_requests/6273.patch +# avcodec: vaapi: support VAAPI with latest FFmpeg +Patch4: https://code.videolan.org/videolan/vlc/-/merge_requests/6606.patch +# nfs: fix libnfs API v2 support (rhbz#2341791) +Patch5: https://code.videolan.org/videolan/vlc/-/merge_requests/6527.patch + +## upstreamable patches + +## downstream patches +# https://fedoraproject.org/wiki/Changes/CryptoPolicy +Patch: 0001-Use-SYSTEM-wide-ciphers-for-gnutls.patch +# Fix building with fdk-aac-2.0; backport for 3.0 from flathub +Patch: fdk-aac2.patch +# port from intel-mediasdk to oneVPL +Patch: oneVPL.patch +# fix appstreamcli validate to show in Software (rhbz#2258611) +Patch: appdata.patch +# port from libidn to libidn2 +Patch: libidn2.patch +# fix deprecated lua math functions (rhbz#2280091) +Patch: lua-math.patch +# update to freerdp2 api; backport from master +Patch: freerdp2.patch +# fix build with live555-2024.11.28 +Patch: live555.patch + +%{load:%{S:1}} +%global __provides_exclude_from ^%{vlc_plugindir}/.*$ + +BuildRequires: bison +BuildRequires: flex +BuildRequires: gettext-devel +BuildRequires: libtool +BuildRequires: gcc-c++ +BuildRequires: desktop-file-utils +BuildRequires: libappstream-glib + +BuildRequires: a52dec-devel +BuildRequires: aalib-devel +BuildRequires: faad2-devel +BuildRequires: hostname +BuildRequires: kernel-headers +%if %{with crystalhd} +BuildRequires: libcrystalhd-devel +%endif +BuildRequires: libgcrypt-devel +BuildRequires: libjpeg-devel +BuildRequires: libmad-devel +BuildRequires: libmpcdec-devel +BuildRequires: libpng-devel +%if %{with lirc} +BuildRequires: lirc-devel +%endif +BuildRequires: live555-devel +BuildRequires: lua-devel +BuildRequires: pkgconfig(alsa) >= 1.0.24 +BuildRequires: pkgconfig(aom) +BuildRequires: pkgconfig(aribb24) +BuildRequires: pkgconfig(aribb25) +%if %{with asdcp} +BuildRequires: pkgconfig(asdcplib) +%endif +BuildRequires: pkgconfig(avahi-client) >= 0.6 +#BuildRequires: pkgconfig(breakpad-client) +BuildRequires: pkgconfig(caca) >= 0.99.beta14 +%if %{with daala} +BuildRequires: pkgconfig(daaladec) +BuildRequires: pkgconfig(daalaenc) +%endif +BuildRequires: pkgconfig(dav1d) +BuildRequires: pkgconfig(dbus-1) +BuildRequires: pkgconfig(dvdnav) > 4.9.0 +BuildRequires: pkgconfig(dvdread) > 4.9.0 +BuildRequires: pkgconfig(egl) +#BuildRequires: pkgconfig(evas) +BuildRequires: pkgconfig(fdk-aac) +BuildRequires: pkgconfig(flac) +#BuildRequires: pkgconfig(fluidlite) +BuildRequires: pkgconfig(fluidsynth) >= 1.1.2 +BuildRequires: pkgconfig(fontconfig) >= 2.11 +BuildRequires: pkgconfig(freerdp2) +BuildRequires: pkgconfig(freetype2) +BuildRequires: pkgconfig(fribidi) +BuildRequires: pkgconfig(gl) +BuildRequires: pkgconfig(glesv2) +BuildRequires: pkgconfig(gnutls) >= 3.3.6 +BuildRequires: pkgconfig(gstreamer-app-1.0) +BuildRequires: pkgconfig(gstreamer-video-1.0) +BuildRequires: pkgconfig(harfbuzz) +BuildRequires: pkgconfig(jack) >= 1.9.7 +BuildRequires: pkgconfig(kate) >= 0.3.0 +BuildRequires: pkgconfig(libarchive) >= 3.1.0 +BuildRequires: pkgconfig(libass) >= 0.9.8 +BuildRequires: pkgconfig(libavcodec) >= 57.37.100 +BuildRequires: pkgconfig(libavformat) >= 53.21.0 +BuildRequires: pkgconfig(libavutil) >= 52.0.0 +BuildRequires: pkgconfig(libbluray) >= 0.6.2 +BuildRequires: pkgconfig(libcddb) >= 0.9.5 +BuildRequires: pkgconfig(libchromaprint) +%if %{with ieee1394} +BuildRequires: pkgconfig(libdc1394-2) >= 2.1.0 +%endif +BuildRequires: pkgconfig(libdca) >= 0.0.5 +#BuildRequires: pkgconfig(libdsm) >= 0.2.0 +BuildRequires: pkgconfig(libdvbpsi) +BuildRequires: pkgconfig(libebml) >= 1.3.6 +BuildRequires: pkgconfig(libgme) +#BuildRequires: pkgconfig(libgoom2) +BuildRequires: pkgconfig(libidn2) +BuildRequires: pkgconfig(libmatroska) +BuildRequires: pkgconfig(libmodplug) >= 0.8.9.0 +BuildRequires: pkgconfig(libmpeg2) >= 0.3.2 +BuildRequires: pkgconfig(libmpg123) +BuildRequires: pkgconfig(libmtp) >= 1.0.0 +BuildRequires: pkgconfig(libnfs) >= 1.10.0 +BuildRequires: pkgconfig(libnotify) pkgconfig(gtk+-3.0) +%if %{with placebo} +BuildRequires: pkgconfig(libplacebo) < 6 +%endif +BuildRequires: pkgconfig(libpostproc) +%if %{with projectm} +BuildRequires: pkgconfig(libprojectM) +%endif +BuildRequires: pkgconfig(libpulse) >= 1.0 +%if %{with ieee1394} +BuildRequires: pkgconfig(libraw1394) >= 2.0.1 pkgconfig(libavc1394) >= 0.5.3 +%endif +BuildRequires: pkgconfig(librsvg-2.0) >= 2.9.0 +BuildRequires: pkgconfig(libsecret-1) >= 0.18 +#BuildRequires: pkgconfig(libsidplay2) +#BuildRequires: pkgconfig(libsmb2) >= 3.0.0 +BuildRequires: pkgconfig(libssh2) +BuildRequires: pkgconfig(libswscale) +BuildRequires: pkgconfig(libsystemd) +BuildRequires: pkgconfig(libudev) >= 142 +BuildRequires: pkgconfig(libupnp) +BuildRequires: pkgconfig(libva) >= 0.38 +BuildRequires: pkgconfig(libva-drm) +BuildRequires: pkgconfig(libva-wayland) +BuildRequires: pkgconfig(libva-x11) +BuildRequires: pkgconfig(libvncclient) >= 0.9.9 +#BuildRequires: pkgconfig(libvsxu) +BuildRequires: pkgconfig(libxml-2.0) >= 2.5 +BuildRequires: pkgconfig(microdns) >= 0.1.2 +BuildRequires: pkgconfig(minizip) +BuildRequires: pkgconfig(ncursesw) +BuildRequires: pkgconfig(ogg) >= 1.0 +%if %{with opencv} +BuildRequires: pkgconfig(opencv) +%endif +BuildRequires: pkgconfig(opus) >= 1.0.3 +BuildRequires: pkgconfig(protobuf-lite) >= 2.5 +BuildRequires: pkgconfig(Qt5Core) >= 5.5 +BuildRequires: pkgconfig(Qt5Gui) >= 5.5 +BuildRequires: pkgconfig(Qt5Svg) >= 5.5 +BuildRequires: pkgconfig(Qt5Widgets) >= 5.5 +BuildRequires: pkgconfig(Qt5X11Extras) >= 5.5 +BuildRequires: pkgconfig(samplerate) +%if %{with schro} +BuildRequires: pkgconfig(schroedinger-1.0) >= 1.0.10 +%endif +%if %{with sdl} +BuildRequires: pkgconfig(SDL_image) >= 1.2.10 +%endif +#BuildRequires: pkgconfig(shine) >= 3.0.0 +BuildRequires: pkgconfig(shout) >= 2.1 +BuildRequires: pkgconfig(smbclient) +BuildRequires: pkgconfig(soxr) >= 0.1.2 +BuildRequires: pkgconfig(sqlite3) +BuildRequires: pkgconfig(spatialaudio) +BuildRequires: pkgconfig(speex) >= 1.0.5 +BuildRequires: pkgconfig(speexdsp) +BuildRequires: pkgconfig(srt) >= 1.3.0 +BuildRequires: pkgconfig(taglib) >= 1.9 +BuildRequires: pkgconfig(theoradec) +BuildRequires: pkgconfig(theoraenc) +BuildRequires: pkgconfig(tiger) >= 0.3.1 +BuildRequires: pkgconfig(twolame) +BuildRequires: pkgconfig(vdpau) >= 0.6 +BuildRequires: pkgconfig(vorbis) >= 1.1 +BuildRequires: pkgconfig(vorbisenc) >= 1.1 +%if %{with vpl} +BuildRequires: pkgconfig(vpl) +%endif +BuildRequires: pkgconfig(vpx) >= 1.5.0 +BuildRequires: pkgconfig(wayland-client) >= 1.5.91 +BuildRequires: pkgconfig(wayland-egl) +BuildRequires: pkgconfig(wayland-protocols) +#BuildRequires: pkgconfig(x262) +%if %{with x264} +BuildRequires: pkgconfig(x264) >= 0.153 +%endif +%if %{with x265} +BuildRequires: pkgconfig(x265) +%endif +BuildRequires: pkgconfig(xcb) >= 1.6 +BuildRequires: pkgconfig(xcb-composite) +BuildRequires: pkgconfig(xcb-keysyms) >= 0.3.4 +BuildRequires: pkgconfig(xcb-randr) >= 1.3 +BuildRequires: pkgconfig(xcb-shm) +BuildRequires: pkgconfig(xcb-xv) >= 1.1.90.1 +BuildRequires: pkgconfig(xext) +BuildRequires: pkgconfig(xinerama) +BuildRequires: pkgconfig(xpm) +BuildRequires: pkgconfig(xproto) +BuildRequires: pkgconfig(zvbi-0.2) >= 0.2.28 +BuildRequires: qt5-qtbase-private-devel +BuildRequires: zlib-devel +Requires: hicolor-icon-theme +%if 0%{?fedora} >= 40 || 0%{?rhel} >= 10 +Requires: kde-filesystem +%else +Requires: kf5-filesystem +%endif +Requires: %{name}-gui-qt%{?_isa} = %{epoch}:%{version}-%{release} +Recommends: %{name}-gui-skins2%{?_isa} = %{epoch}:%{version}-%{release} +Recommends: %{name}-plugin-ffmpeg%{?_isa} = %{epoch}:%{version}-%{release} +# For xdg-screensaver (libxdg_screensaver_plugin) +Recommends: xdg-utils +Recommends: xset +Provides: %{name}-xorg%{?_isa} = %{epoch}:%{version}-%{release} + + +%description +VLC media player is a highly portable multimedia player and multimedia framework +capable of reading most audio and video formats as well as DVDs, Audio CDs VCDs, +and various streaming protocols. +It can also be used as a media converter or a server to stream in uni-cast or +multi-cast in IPv4 or IPv6 on networks. + +%package libs +Summary: VLC media player runtime libraries +Recommends: libproxy-bin%{?_isa} +Conflicts: %{name}-core < %{epoch}:%{version}-%{release} +%description libs +VLC media player runtime libraries + +%package cli +Summary: VLC media player command line interface +Requires: %{name}-libs%{?_isa} = %{epoch}:%{version}-%{release} +Requires: %{name}-plugins-base%{?_isa} = %{epoch}:%{version}-%{release} +Recommends: %{name}-plugin-lua%{?_isa} = %{epoch}:%{version}-%{release} +Obsoletes: %{name}-core < %{epoch}:%{version}-%{release} +Provides: %{name}-core = %{epoch}:%{version}-%{release} +Provides: %{name}-nox = %{epoch}:%{version}-%{release} +%description cli +VLC media player command line interfaces + +%package gui-ncurses +Summary: VLC media player TUI +Requires: %{name}-cli%{?_isa} = %{epoch}:%{version}-%{release} +Requires: %{name}-libs%{?_isa} = %{epoch}:%{version}-%{release} +Requires: %{name}-plugins-base%{?_isa} = %{epoch}:%{version}-%{release} +%description gui-ncurses +VLC media player ncurses-based terminal interface + +%package gui-qt +Summary: VLC media player Qt GUI +Requires: %{name}-cli%{?_isa} = %{epoch}:%{version}-%{release} +Requires: %{name}-libs%{?_isa} = %{epoch}:%{version}-%{release} +Requires: %{name}-plugins-base%{?_isa} = %{epoch}:%{version}-%{release} +Requires: %{name}-plugins-video-out%{?_isa} = %{epoch}:%{version}-%{release} +Requires: %{name}-plugin-lua%{?_isa} = %{epoch}:%{version}-%{release} +Requires: (%{name}-plugin-pipewire%{?_isa} if pipewire) +Requires: (%{name}-plugin-pulseaudio%{?_isa} = %{epoch}:%{version}-%{release} if (pipewire-pulseaudio or pulseaudio)) +Requires: (qt5-qtwayland%{?_isa} if libwayland-client%{?_isa}) +Recommends: %{name}-plugins-extra%{?_isa} = %{epoch}:%{version}-%{release} +Recommends: %{name}-plugin-ffmpeg%{?_isa} = %{epoch}:%{version}-%{release} +Recommends: %{name}-plugin-visualization%{?_isa} = %{epoch}:%{version}-%{release} +Recommends: (%{name}-plugin-gnome%{?_isa} = %{epoch}:%{version}-%{release} if gnome-keyring) +Recommends: (%{name}-plugin-kde%{?_isa} = %{epoch}:%{version}-%{release} if (kf6-kwallet or kf5-wallet)) +Recommends: (%{name}-plugin-notify%{?_isa} = %{epoch}:%{version}-%{release} if gtk3) +%description gui-qt +VLC media player Qt graphical interface + +%package gui-skins2 +Summary: VLC media player Skins2 GUI +Requires: %{name}-cli%{?_isa} = %{epoch}:%{version}-%{release} +Requires: %{name}-libs%{?_isa} = %{epoch}:%{version}-%{release} +Requires: %{name}-gui-qt%{?_isa} = %{epoch}:%{version}-%{release} +Requires: gnu-free-sans-fonts + +%description gui-skins2 +VLC media player skinnable graphical interface + +%package plugins-all +Summary: VLC media player - all plugins +Requires: %{name}-plugins-base%{?_isa} = %{epoch}:%{version}-%{release} +Requires: %{name}-plugins-extra%{?_isa} = %{epoch}:%{version}-%{release} +Requires: %{name}-plugins-video-out%{?_isa} = %{epoch}:%{version}-%{release} +%if %{with crystalhd} +Requires: %{name}-plugin-crystalhd%{?_isa} = %{epoch}:%{version}-%{release} +%endif +Requires: %{name}-plugin-ffmpeg%{?_isa} = %{epoch}:%{version}-%{release} +Requires: %{name}-plugin-fluidsynth%{?_isa} = %{epoch}:%{version}-%{release} +Requires: (%{name}-plugin-gnome%{?_isa} = %{epoch}:%{version}-%{release} if gnome-keyring) +Requires: %{name}-plugin-gstreamer%{?_isa} = %{epoch}:%{version}-%{release} +%if %{with ieee1394} +Requires: %{name}-plugin-ieee1394%{?_isa} = %{epoch}:%{version}-%{release} +%endif +Requires: (%{name}-plugin-jack%{?_isa} = %{epoch}:%{version}-%{release} if (jack-audio-connection-kit or pipewire-jack-audio-connection-kit)) +Requires: (%{name}-plugin-kde%{?_isa} = %{epoch}:%{version}-%{release} if (kf6-kwallet or kf5-wallet)) +Requires: %{name}-plugin-lua%{?_isa} = %{epoch}:%{version}-%{release} +Requires: (%{name}-plugin-notify%{?_isa} = %{epoch}:%{version}-%{release} if gtk3) +%if %{with opencv} +Requires: %{name}-plugin-opencv%{?_isa} = %{epoch}:%{version}-%{release} +%endif +Requires: (%{name}-plugin-pulseaudio%{?_isa} = %{epoch}:%{version}-%{release} if (pipewire-pulseaudio or pulseaudio)) +Requires: %{name}-plugin-rdp%{?_isa} = %{epoch}:%{version}-%{release} +Requires: %{name}-plugin-samba%{?_isa} = %{epoch}:%{version}-%{release} +Requires: %{name}-plugin-svg%{?_isa} = %{epoch}:%{version}-%{release} +Requires: %{name}-plugin-visualization%{?_isa} = %{epoch}:%{version}-%{release} +Requires: %{name}-plugin-vnc%{?_isa} = %{epoch}:%{version}-%{release} +# separate plugins +Requires: %{name}-plugin-bittorrent%{?_isa} +Requires: %{name}-plugin-pause-click%{?_isa} +Requires: (%{name}-plugin-pipewire%{?_isa} if pipewire) + +%description plugins-all +Installs all available plugins for VLC media player + +%package plugins-base +Summary: VLC media player core +Requires: %{name}-libs%{?_isa} = %{epoch}:%{version}-%{release} +%if 0%{?rhel} && 0%{?rhel} < 10 +Requires: google-noto-sans-mono-fonts +Requires: google-noto-serif-fonts +%else +Requires: google-noto-sans-mono-vf-fonts +Requires: google-noto-serif-vf-fonts +%endif +Recommends: libv4l%{?_isa} +Conflicts: %{name}-core < %{epoch}:%{version}-%{release} +%if %{without crystalhd} +Obsoletes: %{name}-plugin-crystalhd < %{epoch}:%{version}-%{release} +%endif +%if %{without ieee1394} +Obsoletes: %{name}-plugin-ieee1394 < %{epoch}:%{version}-%{release} +%endif +%if %{without opencv} +Obsoletes: %{name}-plugin-opencv < %{epoch}:%{version}-%{release} +%endif +# Handle Freeworld transition +%if %{with freeworld} +Provides: %{name}-plugins-freeworld = %{epoch}:%{version}-%{release} +Obsoletes: %{name}-plugins-freeworld < %{epoch}:%{version}-%{release} +%endif + +%description plugins-base +VLC media player core components + +%package plugins-extra +Summary: VLC media player extra plugins +Requires: %{name}-libs%{?_isa} = %{epoch}:%{version}-%{release} +Conflicts: %{name}-plugins-base < %{epoch}:%{version}-%{release} + +%description plugins-extra +VLC media player additional components + +# libcrystalhd requires crystalhd-firmware, is for specific hardware +%if %{with crystalhd} +%package plugin-crystalhd +Summary: VLC media player Crystal HD plugin +Requires: %{name}-libs%{?_isa} = %{epoch}:%{version}-%{release} +Requires: %{name}-plugins-base%{?_isa} = %{epoch}:%{version}-%{release} +Obsoletes: %{name}-extras < %{epoch}:%{version}-%{release} +Provides: %{name}-extras = %{epoch}:%{version}-%{release} + +%description plugin-crystalhd +Crystal HD plugin for VLC media player. +%endif + +# libavcodec/libavformat etc. have many dependencies +%package plugin-ffmpeg +Summary: VLC media player FFmpeg plugins +Requires: %{name}-libs%{?_isa} = %{epoch}:%{version}-%{release} +Requires: %{name}-plugins-base%{?_isa} = %{epoch}:%{version}-%{release} +Requires: %{name}-plugins-video-out%{?_isa} = %{epoch}:%{version}-%{release} + +%description plugin-ffmpeg +FFmpeg support plugins for VLC media player. + +# for MIDI playback, requires a soundfont (usually quite large) +%package plugin-fluidsynth +Summary: VLC media player MIDI playback plugin +Requires: %{name}-libs%{?_isa} = %{epoch}:%{version}-%{release} +Requires: %{name}-plugins-base%{?_isa} = %{epoch}:%{version}-%{release} +Recommends: fluid-soundfont-gm + +%description plugin-fluidsynth +MIDI playback support plugin for VLC media player. + +# requires libsecret, for gnome-keyring secrets storage on GNOME +%package plugin-gnome +Summary: VLC media player Gnome Keyring plugin +Requires: %{name}-libs%{?_isa} = %{epoch}:%{version}-%{release} +Requires: %{name}-plugins-base%{?_isa} = %{epoch}:%{version}-%{release} + +%description plugin-gnome +Gnome Keyring integration for VLC media player. + +# alternative codecs for specific formats, requires many of its own plugins +%package plugin-gstreamer +Summary: VLC media player GStreamer codec plugin +Requires: %{name}-libs%{?_isa} = %{epoch}:%{version}-%{release} +Requires: %{name}-plugins-base%{?_isa} = %{epoch}:%{version}-%{release} +Requires: gstreamer1-plugins-good%{?_isa} +Requires: gstreamer1-plugins-bad-free%{?_isa} +Recommends: gstreamer1-plugin-libav%{?_isa} +Recommends: gstreamer1-plugin-openh264%{?_isa} + +%description plugin-gstreamer +GStreamer decoder plugins for VLC media player. + +# requires libdc1394/libavc1394/libraw1394, is for specific hardware +%if %{with ieee1394} +%package plugin-ieee1394 +Summary: VLC media player IEEE 1394 plugins +Requires: %{name}-libs%{?_isa} = %{epoch}:%{version}-%{release} +Requires: %{name}-plugins-base%{?_isa} = %{epoch}:%{version}-%{release} + +%description plugin-ieee1394 +IEEE 1394 (FireWire) plugins for VLC media player. +%endif + +# depends on j-a-c-k or pipewire-j-a-c-k, for low-latency audio +%package plugin-jack +Summary: VLC media player JACK plugins +Requires: %{name}-libs%{?_isa} = %{epoch}:%{version}-%{release} +Requires: %{name}-plugins-base%{?_isa} = %{epoch}:%{version}-%{release} + +Suggests: pipewire-jack-audio-connection-kit +%description plugin-jack +PulseAudio plugins for VLC media player. + +# for KWallet secrets storage on KDE Plasma +%package plugin-kde +Summary: VLC media player KWallet plugin +Requires: %{name}-libs%{?_isa} = %{epoch}:%{version}-%{release} +Requires: %{name}-plugins-base%{?_isa} = %{epoch}:%{version}-%{release} + +%description plugin-kde +KDE KWallet integration for VLC media player. + +# requires lua, used by CLI and GUI +%package plugin-lua +Summary: VLC media player lua scripting plugins +Requires: %{name}-libs%{?_isa} = %{epoch}:%{version}-%{release} +Requires: %{name}-plugins-base%{?_isa} = %{epoch}:%{version}-%{release} + +%{?lua_version:Requires: lua(abi) = %{lua_version}} +%description plugin-lua +Lua scripting support for VLC media player. + +# requires gtk3 to render the notification icon +%package plugin-notify +Summary: VLC media player notification plugin +Requires: %{name}-libs%{?_isa} = %{epoch}:%{version}-%{release} +Requires: %{name}-plugins-base%{?_isa} = %{epoch}:%{version}-%{release} + +%description plugin-notify +Desktop notification plugin for VLC media player. + +# opencv has many dependencies +%if %{with opencv} +%package plugin-opencv +Summary: VLC media player OpenCV plugins +Requires: %{name}-libs%{?_isa} = %{epoch}:%{version}-%{release} +Requires: %{name}-plugins-base%{?_isa} = %{epoch}:%{version}-%{release} + +%description plugin-opencv +OpenCV plugins for VLC media player. +%endif + +# uses libpulse to connect to pipewire-pulseaudio +# vlc-plugin-pipewire plugin is an alternative +%package plugin-pulseaudio +Summary: VLC media player PulseAudio plugins +Requires: %{name}-libs%{?_isa} = %{epoch}:%{version}-%{release} +Requires: %{name}-plugins-base%{?_isa} = %{epoch}:%{version}-%{release} + +%description plugin-pulseaudio +PulseAudio plugins for VLC media player. + +# requires freerdp2, for RDP remote desktop support +%package plugin-rdp +Summary: VLC media player RDP plugin +Requires: %{name}-libs%{?_isa} = %{epoch}:%{version}-%{release} +Requires: %{name}-plugins-base%{?_isa} = %{epoch}:%{version}-%{release} + +%description plugin-rdp +RDP access plugin for VLC media player. + +# requires libsmbclient, for SMB protocol support +%package plugin-samba +Summary: VLC media player SMB plugin +Requires: %{name}-libs%{?_isa} = %{epoch}:%{version}-%{release} +Requires: %{name}-plugins-base%{?_isa} = %{epoch}:%{version}-%{release} + +%description plugin-samba +Samba access plugin for VLC media player. + +# requires librsvg2, for SVG decoding and screen overlay +%package plugin-svg +Summary: VLC media player SVG plugins +Requires: %{name}-libs%{?_isa} = %{epoch}:%{version}-%{release} +Requires: %{name}-plugins-base%{?_isa} = %{epoch}:%{version}-%{release} + +%description plugin-svg +SVG plugins for VLC media player. + +# requires libv4l, libva, OpenGL, X11/xcb, etc. +%package plugins-video-out +Summary: VLC media player vout plugins +Requires: %{name}-libs%{?_isa} = %{epoch}:%{version}-%{release} +Requires: %{name}-plugins-base%{?_isa} = %{epoch}:%{version}-%{release} + +%description plugins-video-out +Video output plugins for VLC media player. + +%package plugin-visualization +Summary: VLC media player visualization plugins +Requires: %{name}-libs%{?_isa} = %{epoch}:%{version}-%{release} +Requires: %{name}-plugins-base%{?_isa} = %{epoch}:%{version}-%{release} + +%description plugin-visualization +Visualization plugins for VLC media player. + +%package plugin-vnc +Summary: VLC media player VNC plugin +Requires: %{name}-libs%{?_isa} = %{epoch}:%{version}-%{release} +Requires: %{name}-plugins-base%{?_isa} = %{epoch}:%{version}-%{release} + +%description plugin-vnc +VNC access plugin for VLC media player. + +%package devel +Summary: Development files for %{name} +Requires: %{name}-libs%{?_isa} = %{epoch}:%{version}-%{release} + +%description devel +The %{name}-devel package contains libraries and header files for +developing applications and plugins that use %{name}. + + +%prep +%autosetup -p1 + +rm -f aclocal.m4 m4/lib*.m4 m4/lt*.m4 +./bootstrap + +# switch "Allow automatic icon change" to opt-in +sed -i -e 's|\("qt-icon-change",\) true|\1 false|' modules/gui/qt/qt.cpp + +# sync appstream app-id with Flathub +# fill in release date from appstream.patch +# https: https://code.videolan.org/videolan/vlc/-/merge_requests/1555 (4.0) +sed -e 's|org\.videolan\.vlc|org.videolan.VLC|' \ + -e 's|@DATE@|%(date +%F -r %{S:0})|' \ + -e 's|http:|https:|g' \ + -i share/vlc.appdata.xml.in.in + +# Fix an issue with our CI technically being run as root since VLC cannot be run as root. We should still run the other tests, so the workaround is to make the script not fail. +echo "%{_bindir}/true" > test/run_vlc.sh + +touch src/revision.txt + + +%build +export LIVE555_PREFIX=%{_prefix} +%configure \ + --disable-silent-rules \ + --disable-dependency-tracking \ + --with-binary-version=%{version} \ + --disable-static \ + --with-pic \ + --disable-rpath \ + --enable-dbus \ + --disable-optimizations \ + --enable-lua \ + --enable-archive \ + --enable-live555 \ + --enable-dc1394%{!?with_ieee1394:=no} \ + --enable-dv1394%{!?with_ieee1394:=no} \ + --enable-linsys \ + --enable-dvdread \ + --enable-dvdnav \ + --enable-bluray \ + --enable-opencv%{!?with_opencv:=no} \ + --enable-smbclient \ + --disable-dsm \ + --enable-sftp \ + --enable-nfs \ + --disable-smb2 \ + --enable-v4l2 \ + --disable-decklink \ + --enable-vcd \ + --enable-libcddb \ + --enable-screen \ + --enable-vnc \ + --enable-freerdp \ + --enable-realrtsp \ + --enable-asdcp%{!?with_asdcp:=no} \ + --enable-dvbpsi \ + --enable-gme \ + --disable-sid \ + --enable-ogg \ + --enable-shout \ + --enable-matroska \ + --enable-mod \ + --enable-mpc \ + --disable-shine \ + --disable-omxil \ + --enable-crystalhd%{!?with_crystalhd:=no} \ + --enable-mad \ + --enable-mpg123 \ + --enable-gst-decode \ + --enable-avcodec \ + --enable-libva \ + --enable-avformat \ + --enable-swscale \ + --enable-postproc \ + --enable-faad \ + --enable-aom \ + --enable-dav1d \ + --enable-vpx \ + --enable-twolame \ + --enable-fdkaac \ + --enable-a52 \ + --enable-dca \ + --enable-flac \ + --enable-libmpeg2 \ + --enable-vorbis \ + --enable-tremor \ + --enable-speex \ + --enable-opus \ + --enable-spatialaudio \ + --enable-theora \ + --enable-oggspots \ + --enable-daala%{!?with_daala:=no} \ + --enable-schroedinger%{!?with_schro:=no} \ + --enable-png \ + --enable-jpeg \ + --disable-bpg \ + --disable-x262 \ + --enable-x265%{!?with_x265:=no} \ + --enable-x264%{!?with_x264:=no} \ + --enable-x26410b%{!?with_x264:=no} \ + --enable-vpl%{!?with_vpl:=no} \ + --enable-fluidsynth \ + --disable-fluidlite \ + --enable-zvbi \ + --disable-telx \ + --enable-libass \ + --enable-aribsub \ + --enable-aribb25 \ + --enable-kate \ + --enable-tiger \ + --enable-css \ + --enable-gles2 \ + --enable-xcb \ + --enable-xvideo \ + --enable-vdpau \ + --enable-wayland \ + --enable-sdl-image%{!?with_sdl:=no} \ + --enable-freetype \ + --enable-fribidi \ + --enable-harfbuzz \ + --enable-fontconfig \ + --with-default-font-family=NotoSerif \ + --with-default-monospace-font-family=NotoSansMono \ + --enable-svg \ + --enable-svgdec \ + --enable-aa \ + --enable-caca \ + --disable-mmal \ + --disable-evas \ + --enable-pulse \ + --enable-alsa \ + --enable-jack \ + --enable-samplerate \ + --enable-soxr \ + --enable-chromaprint \ + --enable-chromecast \ + --enable-qt \ + --enable-skins2 \ + --disable-libtar \ + --enable-lirc%{!?with_lirc:=no} \ + --enable-srt \ + --disable-goom \ + --enable-projectm%{!?with_projectm:=no} \ + --disable-vsxu \ + --enable-avahi \ + --enable-udev \ + --enable-mtp \ + --enable-upnp \ + --enable-microdns \ + --enable-libxml2 \ + --enable-libgcrypt \ + --enable-gnutls \ + --enable-taglib \ + --enable-secret \ + --enable-kwallet \ + --disable-update-check \ + --enable-notify \ + --enable-libplacebo%{!?with_placebo:=no} \ + --with-kde-solid=%{_datadir}/solid/actions \ + %{nil} + +# clean unused-direct-shlib-dependencies +sed -i -e 's! -shared ! -Wl,--as-needed\0!g' libtool +# avoid redefinition warnings +sed -i -e '/^#define _FORTIFY_SOURCE/d' config.h + +%make_build + +%install +%make_install CPPROG="cp -p" + +# RPM macros for other vlc-plugin-* packages +install -Dm644 %{S:1} -t %{buildroot}%{_rpmmacrodir} + +# Ghost the plugins cache +touch %{buildroot}%{vlc_plugindir}/plugins.dat + +# Use installed fonts for skins2; gnu-free is part of flatpak runtime +rm -f %{buildroot}%{_datadir}/vlc/skins2/fonts/FreeSans{,Bold}.ttf +ln -s %{_usr}/share/fonts/gnu-free/FreeSans{,Bold}.ttf %{buildroot}%{_datadir}/vlc/skins2/fonts/ + +# Remove libtool libraries (for RHEL 9 and older) +find %{buildroot}%{_libdir} -name '*.la' -delete + +# unpackaged static library +rm -f %{buildroot}%{_libdir}/vlc/libcompat.* + +# GNOME 2 script, not compatible with GNOME 3+ +rm -f %{buildroot}%{_datadir}/vlc/utils/gnome-vlc-default.sh + +# The default PNG icons are used for desktop menu, notifications, and SNI; +# all other icons are compiled in as resources +find %{buildroot}%{_hicolordir} -type f ! -name 'vlc.png' -delete +rm -f %{buildroot}%{_datadir}/vlc/vlc.ico + +# docs will be installed in %%files +rm -rf %{buildroot}%{_docdir}/vlc + +%find_lang %{name} + +%check +desktop-file-validate %{buildroot}%{_appsdir}/vlc.desktop +appstream-util validate-relax --nonet %{buildroot}%{_metainfodir}/vlc.appdata.xml + +# chroma_copy_test fails on s390x (big endian?) +%ifnarch s390x +%{__make} check +%endif + +%transfiletriggerin libs -- %{vlc_plugindir} +%{_libdir}/vlc/vlc-cache-gen %{vlc_plugindir} &>/dev/null || : + +%transfiletriggerpostun libs -- %{vlc_plugindir} +%{_libdir}/vlc/vlc-cache-gen %{vlc_plugindir} &>/dev/null || : + +%files +%doc AUTHORS NEWS README THANKS +%license COPYING COPYING.LIB +%{_appsdir}/%{name}.desktop +%{_hicolordir}/*/apps/%{name}.png +%{_datadir}/solid/actions/%{name}-*.desktop +%{_datadir}/vlc/utils/ +%{_metainfodir}/%{name}.appdata.xml + +%files libs -f %{name}.lang +%license COPYING.LIB +# client library, used by e.g. kaffeine, phonon-backend-vlc, etc. +%{_libdir}/libvlc.so.5{,.*} +# plugin API, used by vlc-plugin(s)-* +%{_libdir}/libvlccore.so.9{,.*} +%dir %{_libdir}/vlc/ +%{_libdir}/vlc/vlc-cache-gen +%dir %{vlc_plugindir} +%ghost %{vlc_plugindir}/plugins.dat + +%files cli +%{_bindir}/vlc +%{_bindir}/cvlc +%{_bindir}/rvlc +%{_bindir}/vlc-wrapper +%{_mandir}/man1/vlc*.1* + +%files gui-ncurses +%{_bindir}/nvlc +%{vlc_plugindir}/gui/libncurses_plugin.so + +%files gui-qt +%{_bindir}/qvlc +%{vlc_plugindir}/gui/libqt_plugin.so + +%files gui-skins2 +%{_bindir}/svlc +%{vlc_plugindir}/gui/libskins2_plugin.so +%{_datadir}/vlc/skins2/ + +%files plugins-all + +%files plugins-base +%license COPYING COPYING.LIB +%dir %{vlc_plugindir}/access/ +%dir %{vlc_plugindir}/access_output/ +%dir %{vlc_plugindir}/audio_filter/ +%dir %{vlc_plugindir}/audio_mixer/ +%dir %{vlc_plugindir}/audio_output/ +%dir %{vlc_plugindir}/codec/ +%dir %{vlc_plugindir}/control/ +%dir %{vlc_plugindir}/demux/ +%dir %{vlc_plugindir}/gui/ +%dir %{vlc_plugindir}/keystore/ +%dir %{vlc_plugindir}/logger/ +%dir %{vlc_plugindir}/meta_engine/ +%dir %{vlc_plugindir}/misc/ +%dir %{vlc_plugindir}/mux/ +%dir %{vlc_plugindir}/notify/ +%dir %{vlc_plugindir}/packetizer/ +%dir %{vlc_plugindir}/services_discovery/ +%dir %{vlc_plugindir}/spu/ +%dir %{vlc_plugindir}/stream_extractor/ +%dir %{vlc_plugindir}/stream_filter/ +%dir %{vlc_plugindir}/stream_out/ +%dir %{vlc_plugindir}/text_renderer/ +%dir %{vlc_plugindir}/vaapi/ +%dir %{vlc_plugindir}/vdpau/ +%dir %{vlc_plugindir}/video_chroma/ +%dir %{vlc_plugindir}/video_filter/ +%dir %{vlc_plugindir}/video_output/ +%dir %{vlc_plugindir}/video_splitter/ +%dir %{vlc_plugindir}/visualization/ +%dir %{_datadir}/vlc/ +%{vlc_plugindir}/access/libaccess_alsa_plugin.so +%{vlc_plugindir}/access/libaccess_concat_plugin.so +%{vlc_plugindir}/access/libaccess_imem_plugin.so +%{vlc_plugindir}/access/libaccess_mms_plugin.so +%{vlc_plugindir}/access/libaccess_realrtsp_plugin.so +%{vlc_plugindir}/access/libattachment_plugin.so +%{vlc_plugindir}/access/libdtv_plugin.so +%{vlc_plugindir}/access/libfilesystem_plugin.so +%{vlc_plugindir}/access/libftp_plugin.so +%{vlc_plugindir}/access/libhttp_plugin.so +%{vlc_plugindir}/access/libhttps_plugin.so +%{vlc_plugindir}/access/libidummy_plugin.so +%{vlc_plugindir}/access/libimem_plugin.so +%{vlc_plugindir}/access/librist_plugin.so +%{vlc_plugindir}/access/librtp_plugin.so +%{vlc_plugindir}/access/libsatip_plugin.so +%{vlc_plugindir}/access/libsdp_plugin.so +%{vlc_plugindir}/access/libshm_plugin.so +%{vlc_plugindir}/access/libtcp_plugin.so +%{vlc_plugindir}/access/libtimecode_plugin.so +%{vlc_plugindir}/access/libudp_plugin.so +%{vlc_plugindir}/access/libvcd_plugin.so +%{vlc_plugindir}/access/libvdr_plugin.so +%{vlc_plugindir}/access_output/libaccess_output_dummy_plugin.so +%{vlc_plugindir}/access_output/libaccess_output_file_plugin.so +%{vlc_plugindir}/access_output/libaccess_output_http_plugin.so +%{vlc_plugindir}/access_output/libaccess_output_livehttp_plugin.so +%{vlc_plugindir}/access_output/libaccess_output_rist_plugin.so +%{vlc_plugindir}/access_output/libaccess_output_shout_plugin.so +%{vlc_plugindir}/access_output/libaccess_output_udp_plugin.so +%{vlc_plugindir}/audio_filter/libaudio_format_plugin.so +%{vlc_plugindir}/audio_filter/libaudiobargraph_a_plugin.so +%{vlc_plugindir}/audio_filter/libchorus_flanger_plugin.so +%{vlc_plugindir}/audio_filter/libcompressor_plugin.so +%{vlc_plugindir}/audio_filter/libdolby_surround_decoder_plugin.so +%{vlc_plugindir}/audio_filter/libequalizer_plugin.so +%{vlc_plugindir}/audio_filter/libgain_plugin.so +%{vlc_plugindir}/audio_filter/libheadphone_channel_mixer_plugin.so +%{vlc_plugindir}/audio_filter/libkaraoke_plugin.so +%{vlc_plugindir}/audio_filter/libmono_plugin.so +%{vlc_plugindir}/audio_filter/libnormvol_plugin.so +%{vlc_plugindir}/audio_filter/libparam_eq_plugin.so +%{vlc_plugindir}/audio_filter/libremap_plugin.so +%{vlc_plugindir}/audio_filter/libscaletempo_pitch_plugin.so +%{vlc_plugindir}/audio_filter/libscaletempo_plugin.so +%{vlc_plugindir}/audio_filter/libsimple_channel_mixer_plugin.so +%{vlc_plugindir}/audio_filter/libspatializer_plugin.so +%{vlc_plugindir}/audio_filter/libstereo_widen_plugin.so +%{vlc_plugindir}/audio_filter/libtospdif_plugin.so +%{vlc_plugindir}/audio_filter/libtrivial_channel_mixer_plugin.so +%{vlc_plugindir}/audio_filter/libugly_resampler_plugin.so +%{vlc_plugindir}/audio_mixer/libfloat_mixer_plugin.so +%{vlc_plugindir}/audio_mixer/libinteger_mixer_plugin.so +%{vlc_plugindir}/audio_output/libadummy_plugin.so +%{vlc_plugindir}/audio_output/libafile_plugin.so +%{vlc_plugindir}/audio_output/libalsa_plugin.so +%{vlc_plugindir}/audio_output/libamem_plugin.so +%{vlc_plugindir}/codec/liba52_plugin.so +%{vlc_plugindir}/codec/libadpcm_plugin.so +%{vlc_plugindir}/codec/libaes3_plugin.so +%{vlc_plugindir}/codec/libaraw_plugin.so +%{vlc_plugindir}/codec/libcc_plugin.so +%{vlc_plugindir}/codec/libcdg_plugin.so +%{vlc_plugindir}/codec/libcvdsub_plugin.so +%{vlc_plugindir}/codec/libdav1d_plugin.so +%{vlc_plugindir}/codec/libddummy_plugin.so +%{vlc_plugindir}/codec/libdvbsub_plugin.so +%{vlc_plugindir}/codec/libedummy_plugin.so +%{vlc_plugindir}/codec/libfaad_plugin.so +%{vlc_plugindir}/codec/libfdkaac_plugin.so +%{vlc_plugindir}/codec/libflac_plugin.so +%{vlc_plugindir}/codec/libg711_plugin.so +%{vlc_plugindir}/codec/libjpeg_plugin.so +%{vlc_plugindir}/codec/liblpcm_plugin.so +%{vlc_plugindir}/codec/libmpg123_plugin.so +%{vlc_plugindir}/codec/liboggspots_plugin.so +%{vlc_plugindir}/codec/libopus_plugin.so +%{vlc_plugindir}/codec/libpng_plugin.so +%{vlc_plugindir}/codec/librawvideo_plugin.so +%{vlc_plugindir}/codec/librtpvideo_plugin.so +%{vlc_plugindir}/codec/libscte18_plugin.so +%{vlc_plugindir}/codec/libscte27_plugin.so +%{vlc_plugindir}/codec/libspdif_plugin.so +%{vlc_plugindir}/codec/libspeex_plugin.so +%{vlc_plugindir}/codec/libspudec_plugin.so +%{vlc_plugindir}/codec/libstl_plugin.so +%{vlc_plugindir}/codec/libsubsdec_plugin.so +%{vlc_plugindir}/codec/libsubstx3g_plugin.so +%{vlc_plugindir}/codec/libsubsusf_plugin.so +%{vlc_plugindir}/codec/libsvcdsub_plugin.so +%{vlc_plugindir}/codec/libt140_plugin.so +%{vlc_plugindir}/codec/libtextst_plugin.so +%{vlc_plugindir}/codec/libtheora_plugin.so +%{vlc_plugindir}/codec/libttml_plugin.so +%{vlc_plugindir}/codec/libtwolame_plugin.so +%{vlc_plugindir}/codec/libuleaddvaudio_plugin.so +%{vlc_plugindir}/codec/libvorbis_plugin.so +%{vlc_plugindir}/codec/libvpx_plugin.so +%{vlc_plugindir}/codec/libwebvtt_plugin.so +%if %{with x264} +%{vlc_plugindir}/codec/libx26410b_plugin.so +%{vlc_plugindir}/codec/libx264_plugin.so +%endif +%if %{with x265} +%{vlc_plugindir}/codec/libx265_plugin.so +%endif +%{vlc_plugindir}/codec/libxwd_plugin.so +%{vlc_plugindir}/control/libdbus_plugin.so +%{vlc_plugindir}/control/libdummy_plugin.so +%{vlc_plugindir}/control/libgestures_plugin.so +%{vlc_plugindir}/control/libhotkeys_plugin.so +%{vlc_plugindir}/control/libmotion_plugin.so +%{vlc_plugindir}/control/libnetsync_plugin.so +%{vlc_plugindir}/control/liboldrc_plugin.so +%{vlc_plugindir}/demux/libadaptive_plugin.so +%{vlc_plugindir}/demux/libaiff_plugin.so +%{vlc_plugindir}/demux/libasf_plugin.so +%{vlc_plugindir}/demux/libau_plugin.so +%{vlc_plugindir}/demux/libavi_plugin.so +%{vlc_plugindir}/demux/libcaf_plugin.so +%{vlc_plugindir}/demux/libdemux_cdg_plugin.so +%{vlc_plugindir}/demux/libdemux_chromecast_plugin.so +%{vlc_plugindir}/demux/libdemux_stl_plugin.so +%{vlc_plugindir}/demux/libdemuxdump_plugin.so +%{vlc_plugindir}/demux/libdiracsys_plugin.so +%{vlc_plugindir}/demux/libdirectory_demux_plugin.so +%{vlc_plugindir}/demux/libes_plugin.so +%{vlc_plugindir}/demux/libflacsys_plugin.so +%{vlc_plugindir}/demux/libh26x_plugin.so +%{vlc_plugindir}/demux/libimage_plugin.so +%{vlc_plugindir}/demux/libmjpeg_plugin.so +%{vlc_plugindir}/demux/libmp4_plugin.so +%{vlc_plugindir}/demux/libmpgv_plugin.so +%{vlc_plugindir}/demux/libnoseek_plugin.so +%{vlc_plugindir}/demux/libnsc_plugin.so +%{vlc_plugindir}/demux/libnsv_plugin.so +%{vlc_plugindir}/demux/libnuv_plugin.so +%{vlc_plugindir}/demux/libogg_plugin.so +%{vlc_plugindir}/demux/libplaylist_plugin.so +%{vlc_plugindir}/demux/libps_plugin.so +%{vlc_plugindir}/demux/libpva_plugin.so +%{vlc_plugindir}/demux/librawaud_plugin.so +%{vlc_plugindir}/demux/librawdv_plugin.so +%{vlc_plugindir}/demux/librawvid_plugin.so +%{vlc_plugindir}/demux/libreal_plugin.so +%{vlc_plugindir}/demux/libsmf_plugin.so +%{vlc_plugindir}/demux/libsubtitle_plugin.so +%{vlc_plugindir}/demux/libtta_plugin.so +%{vlc_plugindir}/demux/libty_plugin.so +%{vlc_plugindir}/demux/libvc1_plugin.so +%{vlc_plugindir}/demux/libvobsub_plugin.so +%{vlc_plugindir}/demux/libvoc_plugin.so +%{vlc_plugindir}/demux/libwav_plugin.so +%{vlc_plugindir}/demux/libxa_plugin.so +%{vlc_plugindir}/keystore/libfile_keystore_plugin.so +%{vlc_plugindir}/keystore/libmemory_keystore_plugin.so +%{vlc_plugindir}/logger/libconsole_logger_plugin.so +%{vlc_plugindir}/logger/libfile_logger_plugin.so +%{vlc_plugindir}/logger/libsd_journal_plugin.so +%{vlc_plugindir}/logger/libsyslog_plugin.so +%{vlc_plugindir}/meta_engine/libfolder_plugin.so +%{vlc_plugindir}/meta_engine/libtaglib_plugin.so +%{vlc_plugindir}/misc/libaddonsfsstorage_plugin.so +%{vlc_plugindir}/misc/libaddonsvorepository_plugin.so +%{vlc_plugindir}/misc/libaudioscrobbler_plugin.so +%{vlc_plugindir}/misc/libdbus_screensaver_plugin.so +%{vlc_plugindir}/misc/libexport_plugin.so +%{vlc_plugindir}/misc/libfingerprinter_plugin.so +%{vlc_plugindir}/misc/libgnutls_plugin.so +%{vlc_plugindir}/misc/liblogger_plugin.so +%{vlc_plugindir}/misc/libstats_plugin.so +%{vlc_plugindir}/misc/libvod_rtsp_plugin.so +%{vlc_plugindir}/misc/libxdg_screensaver_plugin.so +%{vlc_plugindir}/misc/libxml_plugin.so +%{vlc_plugindir}/mux/libmux_asf_plugin.so +%{vlc_plugindir}/mux/libmux_avi_plugin.so +%{vlc_plugindir}/mux/libmux_dummy_plugin.so +%{vlc_plugindir}/mux/libmux_mp4_plugin.so +%{vlc_plugindir}/mux/libmux_mpjpeg_plugin.so +%{vlc_plugindir}/mux/libmux_ogg_plugin.so +%{vlc_plugindir}/mux/libmux_ps_plugin.so +%{vlc_plugindir}/mux/libmux_wav_plugin.so +%{vlc_plugindir}/packetizer/libpacketizer_a52_plugin.so +%{vlc_plugindir}/packetizer/libpacketizer_av1_plugin.so +%{vlc_plugindir}/packetizer/libpacketizer_copy_plugin.so +%{vlc_plugindir}/packetizer/libpacketizer_dirac_plugin.so +%{vlc_plugindir}/packetizer/libpacketizer_dts_plugin.so +%{vlc_plugindir}/packetizer/libpacketizer_flac_plugin.so +%{vlc_plugindir}/packetizer/libpacketizer_h264_plugin.so +%{vlc_plugindir}/packetizer/libpacketizer_hevc_plugin.so +%{vlc_plugindir}/packetizer/libpacketizer_mlp_plugin.so +%{vlc_plugindir}/packetizer/libpacketizer_mpeg4audio_plugin.so +%{vlc_plugindir}/packetizer/libpacketizer_mpeg4video_plugin.so +%{vlc_plugindir}/packetizer/libpacketizer_mpegaudio_plugin.so +%{vlc_plugindir}/packetizer/libpacketizer_mpegvideo_plugin.so +%{vlc_plugindir}/packetizer/libpacketizer_vc1_plugin.so +%{vlc_plugindir}/services_discovery/libmediadirs_plugin.so +%{vlc_plugindir}/services_discovery/libpodcast_plugin.so +%{vlc_plugindir}/services_discovery/libsap_plugin.so +%{vlc_plugindir}/spu/libaudiobargraph_v_plugin.so +%{vlc_plugindir}/spu/libdynamicoverlay_plugin.so +%{vlc_plugindir}/spu/liblogo_plugin.so +%{vlc_plugindir}/spu/libmarq_plugin.so +%{vlc_plugindir}/spu/libmosaic_plugin.so +%{vlc_plugindir}/spu/libremoteosd_plugin.so +%{vlc_plugindir}/spu/librss_plugin.so +%{vlc_plugindir}/spu/libsubsdelay_plugin.so +%{vlc_plugindir}/stream_filter/libadf_plugin.so +%{vlc_plugindir}/stream_filter/libcache_block_plugin.so +%{vlc_plugindir}/stream_filter/libcache_read_plugin.so +%{vlc_plugindir}/stream_filter/libdecomp_plugin.so +%{vlc_plugindir}/stream_filter/libhds_plugin.so +%{vlc_plugindir}/stream_filter/libinflate_plugin.so +%{vlc_plugindir}/stream_filter/libprefetch_plugin.so +%{vlc_plugindir}/stream_filter/librecord_plugin.so +%{vlc_plugindir}/stream_filter/libskiptags_plugin.so +%{vlc_plugindir}/stream_out/libstream_out_autodel_plugin.so +%{vlc_plugindir}/stream_out/libstream_out_bridge_plugin.so +%{vlc_plugindir}/stream_out/libstream_out_cycle_plugin.so +%{vlc_plugindir}/stream_out/libstream_out_delay_plugin.so +%{vlc_plugindir}/stream_out/libstream_out_description_plugin.so +%{vlc_plugindir}/stream_out/libstream_out_display_plugin.so +%{vlc_plugindir}/stream_out/libstream_out_dummy_plugin.so +%{vlc_plugindir}/stream_out/libstream_out_duplicate_plugin.so +%{vlc_plugindir}/stream_out/libstream_out_es_plugin.so +%{vlc_plugindir}/stream_out/libstream_out_gather_plugin.so +%{vlc_plugindir}/stream_out/libstream_out_mosaic_bridge_plugin.so +%{vlc_plugindir}/stream_out/libstream_out_record_plugin.so +%{vlc_plugindir}/stream_out/libstream_out_rtp_plugin.so +%{vlc_plugindir}/stream_out/libstream_out_setid_plugin.so +%{vlc_plugindir}/stream_out/libstream_out_smem_plugin.so +%{vlc_plugindir}/stream_out/libstream_out_standard_plugin.so +%{vlc_plugindir}/stream_out/libstream_out_stats_plugin.so +%{vlc_plugindir}/stream_out/libstream_out_transcode_plugin.so +%{vlc_plugindir}/text_renderer/libtdummy_plugin.so +%exclude %{vlc_plugindir}/video_chroma/libswscale_plugin.so +%{vlc_plugindir}/video_chroma/*.so +%exclude %{vlc_plugindir}/video_filter/libpostproc_plugin.so +%{vlc_plugindir}/video_filter/*.so +%{vlc_plugindir}/video_output/libfb_plugin.so +%{vlc_plugindir}/video_output/libvdummy_plugin.so +%{vlc_plugindir}/video_output/libvmem_plugin.so +%{vlc_plugindir}/video_output/libyuv_plugin.so + +%files plugins-extra +%{vlc_plugindir}/access/libaccess_mtp_plugin.so +%{vlc_plugindir}/access/libaccess_srt_plugin.so +%{vlc_plugindir}/access/libcdda_plugin.so +%if %{with asdcp} +%{vlc_plugindir}/access/libdcp_plugin.so +%endif +%{vlc_plugindir}/access/libdvb_plugin.so +%{vlc_plugindir}/access/libdvdnav_plugin.so +%{vlc_plugindir}/access/libdvdread_plugin.so +%{vlc_plugindir}/access/liblibbluray_plugin.so +%{vlc_plugindir}/access/liblive555_plugin.so +%{vlc_plugindir}/access/libnfs_plugin.so +%{vlc_plugindir}/access/libsftp_plugin.so +%{vlc_plugindir}/access/liblinsys_hdsdi_plugin.so +%{vlc_plugindir}/access/liblinsys_sdi_plugin.so +%{vlc_plugindir}/access/libv4l2_plugin.so +%{vlc_plugindir}/access/libxcb_screen_plugin.so +%{vlc_plugindir}/access_output/libaccess_output_srt_plugin.so +%{vlc_plugindir}/audio_filter/libmad_plugin.so +%{vlc_plugindir}/audio_filter/libsamplerate_plugin.so +%{vlc_plugindir}/audio_filter/libsoxr_plugin.so +%{vlc_plugindir}/audio_filter/libspatialaudio_plugin.so +%{vlc_plugindir}/audio_filter/libspeex_resampler_plugin.so +%{vlc_plugindir}/codec/libaom_plugin.so +%{vlc_plugindir}/codec/libaribsub_plugin.so +%if %{with daala} +%{vlc_plugindir}/codec/libdaala_plugin.so +%endif +%{vlc_plugindir}/codec/libdca_plugin.so +%{vlc_plugindir}/codec/libkate_plugin.so +%{vlc_plugindir}/codec/liblibass_plugin.so +%{vlc_plugindir}/codec/liblibmpeg2_plugin.so +%if %{with vpl} +%{vlc_plugindir}/codec/libqsv_plugin.so +%endif +%if %{with schro} +%{vlc_plugindir}/codec/libschroedinger_plugin.so +%endif +%if %{with sdl} +%{vlc_plugindir}/codec/libsdl_image_plugin.so +%endif +%{vlc_plugindir}/codec/libzvbi_plugin.so +%if %{with lirc} +%{vlc_plugindir}/control/liblirc_plugin.so +%endif +%{vlc_plugindir}/demux/libgme_plugin.so +%{vlc_plugindir}/demux/libmpc_plugin.so +%{vlc_plugindir}/demux/libmkv_plugin.so +%{vlc_plugindir}/demux/libmod_plugin.so +%{vlc_plugindir}/demux/libts_plugin.so +%{vlc_plugindir}/mux/libmux_ts_plugin.so +%{vlc_plugindir}/services_discovery/libavahi_plugin.so +%{vlc_plugindir}/services_discovery/libmicrodns_plugin.so +%{vlc_plugindir}/services_discovery/libmtp_plugin.so +%{vlc_plugindir}/services_discovery/libupnp_plugin.so +%{vlc_plugindir}/services_discovery/libudev_plugin.so +%{vlc_plugindir}/stream_extractor/libarchive_plugin.so +%{vlc_plugindir}/stream_filter/libaribcam_plugin.so +%{vlc_plugindir}/stream_out/libstream_out_chromecast_plugin.so +%{vlc_plugindir}/text_renderer/libfreetype_plugin.so +%{vlc_plugindir}/video_output/libaa_plugin.so +%{vlc_plugindir}/video_output/libcaca_plugin.so + +%if %{with crystalhd} +%files plugin-crystalhd +%{vlc_plugindir}/codec/libcrystalhd_plugin.so +%endif + +%files plugin-ffmpeg +%{vlc_plugindir}/access/libavio_plugin.so +%{vlc_plugindir}/codec/libavcodec_plugin.so +%{vlc_plugindir}/codec/libvaapi_drm_plugin.so +%{vlc_plugindir}/codec/libvaapi_plugin.so +%{vlc_plugindir}/demux/libavformat_plugin.so +%{vlc_plugindir}/packetizer/libpacketizer_avparser_plugin.so +%{vlc_plugindir}/stream_out/libstream_out_chromaprint_plugin.so +%{vlc_plugindir}/vdpau/libvdpau_avcodec_plugin.so +%{vlc_plugindir}/video_chroma/libswscale_plugin.so +%{vlc_plugindir}/video_filter/libpostproc_plugin.so + +%files plugin-fluidsynth +%{vlc_plugindir}/codec/libfluidsynth_plugin.so + +%files plugin-gnome +%{vlc_plugindir}/keystore/libsecret_plugin.so + +%files plugin-gstreamer +%{vlc_plugindir}/codec/libgstdecode_plugin.so + +%if %{with ieee1394} +%files plugin-ieee1394 +%{vlc_plugindir}/access/libdc1394_plugin.so +%{vlc_plugindir}/access/libdv1394_plugin.so +%endif + +%files plugin-jack +%{vlc_plugindir}/access/libaccess_jack_plugin.so +%{vlc_plugindir}/audio_output/libjack_plugin.so + +%files plugin-kde +%{vlc_plugindir}/keystore/libkwallet_plugin.so + +%files plugin-lua +%{_libdir}/vlc/lua/ +%{vlc_plugindir}/lua/ +%{_datadir}/vlc/lua/ + +%files plugin-notify +%{vlc_plugindir}/notify/libnotify_plugin.so + +%if %{with opencv} +%files plugin-opencv +%{vlc_plugindir}/video_filter/libopencv_example_plugin.so +%{vlc_plugindir}/video_filter/libopencv_wrapper_plugin.so +%endif + +%files plugin-pulseaudio +%{_libdir}/vlc/libvlc_pulse.so* +%{vlc_plugindir}/access/libpulsesrc_plugin.so +%{vlc_plugindir}/audio_output/libpulse_plugin.so +%{vlc_plugindir}/services_discovery/libpulselist_plugin.so + +%files plugin-rdp +%{vlc_plugindir}/access/librdp_plugin.so + +%files plugin-samba +%{vlc_plugindir}/access/libsmb_plugin.so + +%files plugin-svg +%{vlc_plugindir}/codec/libsvgdec_plugin.so +%{vlc_plugindir}/text_renderer/libsvg_plugin.so + +%files plugins-video-out +%{_libdir}/vlc/libvlc_vdpau.so* +%{_libdir}/vlc/libvlc_xcb_events.so* +%{vlc_plugindir}/control/libxcb_hotkeys_plugin.so +%{vlc_plugindir}/services_discovery/libxcb_apps_plugin.so +%{vlc_plugindir}/vaapi/*.so +%exclude %{vlc_plugindir}/vdpau/libvdpau_avcodec_plugin.so +%{vlc_plugindir}/vdpau/*.so +%{vlc_plugindir}/video_output/libegl_wl_plugin.so +%{vlc_plugindir}/video_output/libegl_x11_plugin.so +%{vlc_plugindir}/video_output/libflaschen_plugin.so +%{vlc_plugindir}/video_output/libgl_plugin.so +%{vlc_plugindir}/video_output/libglconv_vaapi_drm_plugin.so +%{vlc_plugindir}/video_output/libglconv_vaapi_wl_plugin.so +%{vlc_plugindir}/video_output/libglconv_vaapi_x11_plugin.so +%{vlc_plugindir}/video_output/libglconv_vdpau_plugin.so +%{vlc_plugindir}/video_output/libgles2_plugin.so +%{vlc_plugindir}/video_output/libglx_plugin.so +%{vlc_plugindir}/video_output/libwl_shell_plugin.so +%{vlc_plugindir}/video_output/libwl_shm_plugin.so +%{vlc_plugindir}/video_output/libxcb_window_plugin.so +%{vlc_plugindir}/video_output/libxcb_x11_plugin.so +%{vlc_plugindir}/video_output/libxcb_xv_plugin.so +%{vlc_plugindir}/video_output/libxdg_shell_plugin.so +%{vlc_plugindir}/video_splitter/*.so + +%files plugin-visualization +%{vlc_plugindir}/visualization/*.so + +%files plugin-vnc +%{vlc_plugindir}/access/libvnc_plugin.so + +%files devel +%dir %{_includedir}/vlc +%{_includedir}/vlc/*.h +%{_includedir}/vlc/plugins/ +%{_libdir}/libvlc.so +%{_libdir}/libvlccore.so +%{_libdir}/pkgconfig/libvlc.pc +%{_libdir}/pkgconfig/vlc-plugin.pc +%{_rpmmacrodir}/macros.vlc + +%changelog +* Fri Dec 19 2025 - 2:3.0.21-1 +- Initial package