Compare commits

...

No commits in common. 'i10fe' and 'el9' have entirely different histories.
i10fe ... el9

3
.gitignore vendored

@ -1 +1,2 @@
SOURCES/vlc-3.0.21.tar.xz
vlc-*.tar.xz
vlc-*.tar.gz

@ -1 +0,0 @@
be8557fc2f4be58caebe4a8b1d70f03dc6b95792 SOURCES/vlc-3.0.21.tar.xz

@ -0,0 +1,50 @@
From 94845266b705dc9de7921408531b9d7704f4458f Mon Sep 17 00:00:00 2001
From: Dominic Mayers <dominic.mayers@meditationstudies.org>
Date: Sun, 28 Mar 2021 04:37:54 -0400
Subject: [PATCH] Get addr by ref. from getConnectionEndpointAddress.
Fixes issue #25473 in code.videolan.org. The maintainers of live555 changed
connectionEndpointAddresss to getConnectionEndpointAddress, which now provides
the address value by reference. Before, connectionEndpointAddresss returned
the value. So, in modules/access/live555.cpp, we must first get the value and
then pass it to IsMulticastAddress. The code will not compile with the recent
live555 unless we also modify modules/access/Makefile.am - a different patch.
---
modules/access/live555.cpp | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/modules/access/live555.cpp b/modules/access/live555.cpp
index 01c535ca5b..95e15e35d9 100644
--- a/modules/access/live555.cpp
+++ b/modules/access/live555.cpp
@@ -60,6 +60,7 @@
#include <liveMedia.hh>
#include <liveMedia_version.hh>
#include <Base64.hh>
+#include <NetAddress.hh>
extern "C" {
#include "../access/mms/asf.h" /* Who said ugly ? */
@@ -727,7 +728,8 @@ static int SessionsSetup( demux_t *p_demux )
unsigned const thresh = 200000; /* RTP reorder threshold .2 second (default .1) */
const char *p_sess_lang = NULL;
const char *p_lang;
-
+ struct sockaddr_storage addr;
+
b_rtsp_tcp = var_CreateGetBool( p_demux, "rtsp-tcp" ) ||
var_GetBool( p_demux, "rtsp-http" );
i_client_port = var_InheritInteger( p_demux, "rtp-client-port" );
@@ -850,7 +852,8 @@ static int SessionsSetup( demux_t *p_demux )
if( !p_sys->b_multicast )
{
/* We need different rollover behaviour for multicast */
- p_sys->b_multicast = IsMulticastAddress( sub->connectionEndpointAddress() );
+ sub->getConnectionEndpointAddress(addr);
+ p_sys->b_multicast = IsMulticastAddress( addr );
}
tk = (live_track_t*)malloc( sizeof( live_track_t ) );
--
2.25.1

@ -0,0 +1,74 @@
From b107d105f8489edd6deafb340c65f435ab6e1c29 Mon Sep 17 00:00:00 2001
From: Leigh Scott <leigh123linux@gmail.com>
Date: Mon, 14 Jun 2021 12:26:09 +0100
Subject: [PATCH] Revert "access: libdvdread 6.1.2 supports UTF-8 paths in
Windows."
This reverts commit 02b784c0cefe6d0d36bbc3b668a7f238c7f7b3ed.
---
modules/access/dvdnav.c | 9 ---------
modules/access/dvdread.c | 9 ---------
2 files changed, 18 deletions(-)
diff --git a/modules/access/dvdnav.c b/modules/access/dvdnav.c
index 69abe50c8c..89fb66f11e 100644
--- a/modules/access/dvdnav.c
+++ b/modules/access/dvdnav.c
@@ -371,14 +371,7 @@ static int AccessDemuxOpen ( vlc_object_t *p_this )
goto bailout;
/* Open dvdnav */
-#if DVDREAD_VERSION < DVDREAD_VERSION_CODE(6, 1, 2)
- /* In libdvdread prior to 6.1.2, UTF8 is not supported for windows and
- * requires a prior conversion.
- * For non win32/os2 platforms, this is just a no-op */
psz_path = ToLocale( psz_file );
-#else
- psz_path = psz_file;
-#endif
#if DVDNAV_VERSION >= 60100
dvdnav_logger_cb cbs;
cbs.pf_log = DvdNavLog;
@@ -397,10 +390,8 @@ static int AccessDemuxOpen ( vlc_object_t *p_this )
bailout:
free( psz_file );
-#if DVDREAD_VERSION < DVDREAD_VERSION_CODE(6, 1, 2)
if( psz_path )
LocaleFree( psz_path );
-#endif
return i_ret;
}
diff --git a/modules/access/dvdread.c b/modules/access/dvdread.c
index 749cbd47e0..e75bef5986 100644
--- a/modules/access/dvdread.c
+++ b/modules/access/dvdread.c
@@ -212,14 +212,7 @@ static int Open( vlc_object_t *p_this )
}
/* Open dvdread */
-#if DVDREAD_VERSION < DVDREAD_VERSION_CODE(6, 1, 2)
- /* In libdvdread prior to 6.1.2, UTF8 is not supported for windows and
- * requires a prior conversion.
- * For non win32/os2 platforms, this is just a no-op */
const char *psz_path = ToLocale( psz_file );
-#else
- const char *psz_path = psz_file;
-#endif
#if DVDREAD_VERSION >= DVDREAD_VERSION_CODE(6, 1, 0)
dvd_logger_cb cbs;
cbs.pf_log = DvdReadLog;
@@ -227,9 +220,7 @@ static int Open( vlc_object_t *p_this )
#else
dvd_reader_t *p_dvdread = DVDOpen( psz_path );
#endif
-#if DVDREAD_VERSION < DVDREAD_VERSION_CODE(6, 1, 2)
LocaleFree( psz_path );
-#endif
if( p_dvdread == NULL )
{
msg_Err( p_demux, "DVDRead cannot open source: %s", psz_file );
--
2.31.1

@ -0,0 +1,45 @@
From 982f44d09bb61490194baf371d52c12016e0c5c9 Mon Sep 17 00:00:00 2001
From: Nicolas Chauvet <kwizart@gmail.com>
Date: Fri, 28 Jul 2023 12:25:44 +0200
Subject: [PATCH] po: Fixup invalid format string
Will fix the following errors
oc.po:5301: 'msgstr' is not a valid C format string, unlike 'msgid'. Reason: In the directive number 1, the argument size specifier is invalid.
oc.po:5306: 'msgstr' is not a valid C format string, unlike 'msgid'. Reason: In the directive number 1, the argument size specifier is invalid.
oc.po:5312: 'msgstr' is not a valid C format string, unlike 'msgid'. Reason: In the directive number 1, the argument size specifier is invalid.
Signed-off-by: Nicolas Chauvet <kwizart@gmail.com>
---
po/oc.po | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/po/oc.po b/po/oc.po
index 667696cfe785..ddb1677d8a53 100644
--- a/po/oc.po
+++ b/po/oc.po
@@ -5298,18 +5298,18 @@ msgstr "Comanda+"
#: src/misc/update.c:482
#, c-format
msgid "%.1f GiB"
-msgstr "%.lf Gio"
+msgstr "%.1f Gio"
#: src/misc/update.c:484
#, c-format
msgid "%.1f MiB"
-msgstr "%.lf Mio"
+msgstr "%.1f Mio"
#: src/misc/update.c:486 modules/gui/macosx/VLCPlaylistInfo.m:138
#: modules/gui/macosx/VLCPlaylistInfo.m:140
#, c-format
msgid "%.1f KiB"
-msgstr "%.lf Kio"
+msgstr "%.1f Kio"
#: src/misc/update.c:488
#, c-format
--
2.41.0

@ -0,0 +1,44 @@
From fefc0d51b9d3ec6046a73cf317b31870048d1fc2 Mon Sep 17 00:00:00 2001
From: Nicolas Chauvet <kwizart@gmail.com>
Date: Mon, 6 Apr 2020 09:08:08 +0200
Subject: [PATCH] Lower libgcrypt to 1.5.3
Signed-off-by: Nicolas Chauvet <kwizart@gmail.com>
---
configure.ac | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/configure.ac b/configure.ac
index 1dfe2fce9b..cdac533e10 100644
--- a/configure.ac
+++ b/configure.ac
@@ -4038,14 +4038,14 @@ AC_ARG_ENABLE(libgcrypt,
AC_ARG_VAR([GCRYPT_CFLAGS], [C compiler flags for gcrypt])
AC_ARG_VAR([GCRYPT_LIBS], [linker flags flags for gcrypt])
-# require libgcrypt >= 1.6.0
+# require libgcrypt >= 1.5.3
AS_IF([test "${enable_libgcrypt}" != "no"], [
- AC_CACHE_CHECK([for gcrypt 1.6.0 or later], [ac_cv_lib_gcrypt], [
+ AC_CACHE_CHECK([for gcrypt 1.5.3 or later], [ac_cv_lib_gcrypt], [
VLC_SAVE_FLAGS
CFLAGS="${CFLAGS} ${GCRYPT_CFLAGS}"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
[#include <gcrypt.h>
-#if GCRYPT_VERSION_NUMBER < 0x010600
+#if GCRYPT_VERSION_NUMBER < 0x010503
#error
#endif]])], [
ac_cv_lib_gcrypt=yes
@@ -4059,7 +4059,7 @@ AS_IF([test "${enable_libgcrypt}" != "no"], [
AC_DEFINE([HAVE_GCRYPT], 1, [Defined if having gcrypt])
], [
AS_IF([test "${enable_libgcrypt}" = "yes"], [
- AC_MSG_ERROR([libgcrypt version 1.6.0 or higher not found. Install libgcrypt or pass --disable-libgcrypt.])
+ AC_MSG_ERROR([libgcrypt version 1.5.3 or higher not found. Install libgcrypt or pass --disable-libgcrypt.])
])
])
])
--
2.25.1

@ -0,0 +1,98 @@
diff -uNrp a/modules/video_output/caca.c b/modules/video_output/caca.c
--- a/modules/video_output/caca.c 2022-01-14 06:09:28.000000000 +0000
+++ b/modules/video_output/caca.c 2022-01-18 23:09:44.979137301 +0000
@@ -74,9 +74,9 @@ static void Place(vout_display_t *, vout
/* */
struct vout_display_sys_t {
- cucul_canvas_t *cv;
+ caca_canvas_t *cv;
caca_display_t *dp;
- cucul_dither_t *dither;
+ caca_dither_t *dither;
picture_pool_t *pool;
vout_display_event_thread_t *et;
@@ -153,9 +153,9 @@ static int Open(vlc_object_t *object)
if (!sys)
goto error;
- sys->cv = cucul_create_canvas(0, 0);
+ sys->cv = caca_create_canvas(0, 0);
if (!sys->cv) {
- msg_Err(vd, "cannot initialize libcucul");
+ msg_Err(vd, "cannot initialize libcaca");
goto error;
}
@@ -209,11 +209,11 @@ error:
if (sys->pool)
picture_pool_Release(sys->pool);
if (sys->dither)
- cucul_free_dither(sys->dither);
+ caca_free_dither(sys->dither);
if (sys->dp)
caca_free_display(sys->dp);
if (sys->cv)
- cucul_free_canvas(sys->cv);
+ caca_free_canvas(sys->cv);
free(sys);
}
@@ -235,9 +235,9 @@ static void Close(vlc_object_t *object)
if (sys->pool)
picture_pool_Release(sys->pool);
if (sys->dither)
- cucul_free_dither(sys->dither);
+ caca_free_dither(sys->dither);
caca_free_display(sys->dp);
- cucul_free_canvas(sys->cv);
+ caca_free_canvas(sys->cv);
#if defined(_WIN32)
FreeConsole();
@@ -266,7 +266,7 @@ static void Prepare(vout_display_t *vd,
if (!sys->dither) {
/* Create the libcaca dither object */
- sys->dither = cucul_create_dither(32,
+ sys->dither = caca_create_dither(32,
vd->source.i_visible_width,
vd->source.i_visible_height,
picture->p[0].i_pitch,
@@ -284,12 +284,12 @@ static void Prepare(vout_display_t *vd,
vout_display_place_t place;
Place(vd, &place);
- cucul_set_color_ansi(sys->cv, CUCUL_COLOR_DEFAULT, CUCUL_COLOR_BLACK);
- cucul_clear_canvas(sys->cv);
+ caca_set_color_ansi(sys->cv, CACA_DEFAULT, CACA_BLACK);
+ caca_clear_canvas(sys->cv);
const int crop_offset = vd->source.i_y_offset * picture->p->i_pitch +
vd->source.i_x_offset * picture->p->i_pixel_pitch;
- cucul_dither_bitmap(sys->cv, place.x, place.y,
+ caca_dither_bitmap(sys->cv, place.x, place.y,
place.width, place.height,
sys->dither,
&picture->p->p_pixels[crop_offset]);
@@ -328,7 +328,7 @@ static int Control(vout_display_t *vd, i
case VOUT_DISPLAY_CHANGE_SOURCE_CROP:
if (sys->dither)
- cucul_free_dither(sys->dither);
+ caca_free_dither(sys->dither);
sys->dither = NULL;
return VLC_SUCCESS;
@@ -366,8 +366,8 @@ static void Place(vout_display_t *vd, vo
vout_display_PlacePicture(place, &vd->source, vd->cfg, false);
- const int canvas_width = cucul_get_canvas_width(sys->cv);
- const int canvas_height = cucul_get_canvas_height(sys->cv);
+ const int canvas_width = caca_get_canvas_width(sys->cv);
+ const int canvas_height = caca_get_canvas_height(sys->cv);
const int display_width = caca_get_display_width(sys->dp);
const int display_height = caca_get_display_height(sys->dp);

@ -0,0 +1,94 @@
From 43332a4fa12ff79f284749177dc0743a495caea6 Mon Sep 17 00:00:00 2001
From: Nicolas Chauvet <kwizart@gmail.com>
Date: Sat, 18 Jul 2020 15:19:31 +0200
Subject: [PATCH 1/1] Restore support for thread callbacks for older gcrypt
---
include/vlc_gcrypt.h | 64 ++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 64 insertions(+)
diff --git a/include/vlc_gcrypt.h b/include/vlc_gcrypt.h
index a04e1b1d86..4c7f1e86b0 100644
--- a/include/vlc_gcrypt.h
+++ b/include/vlc_gcrypt.h
@@ -25,6 +25,67 @@
#include <errno.h>
+#if GCRYPT_VERSION_NUMBER < 0x010600
+#ifdef LIBVLC_USE_PTHREAD
+/**
+ * If possible, use gcrypt-provided thread implementation. This is so that
+ * other non-VLC components (inside the process) can also use gcrypt safely.
+ */
+GCRY_THREAD_OPTION_PTHREAD_IMPL;
+# define gcry_threads_vlc gcry_threads_pthread
+#else
+
+/**
+ * gcrypt thread option VLC implementation
+ */
+
+static int gcry_vlc_mutex_init( void **p_sys )
+{
+ vlc_mutex_t *p_lock = (vlc_mutex_t *)malloc( sizeof( vlc_mutex_t ) );
+ if( p_lock == NULL)
+ return ENOMEM;
+
+ vlc_mutex_init( p_lock );
+ *p_sys = p_lock;
+ return VLC_SUCCESS;
+}
+
+static int gcry_vlc_mutex_destroy( void **p_sys )
+{
+ vlc_mutex_t *p_lock = (vlc_mutex_t *)*p_sys;
+ vlc_mutex_destroy( p_lock );
+ free( p_lock );
+ return VLC_SUCCESS;
+}
+
+static int gcry_vlc_mutex_lock( void **p_sys )
+{
+ vlc_mutex_lock( (vlc_mutex_t *)*p_sys );
+ return VLC_SUCCESS;
+}
+
+static int gcry_vlc_mutex_unlock( void **lock )
+{
+ vlc_mutex_unlock( (vlc_mutex_t *)*lock );
+ return VLC_SUCCESS;
+}
+
+static const struct gcry_thread_cbs gcry_threads_vlc =
+{
+ GCRY_THREAD_OPTION_USER,
+ NULL,
+ gcry_vlc_mutex_init,
+ gcry_vlc_mutex_destroy,
+ gcry_vlc_mutex_lock,
+ gcry_vlc_mutex_unlock,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL
+};
+#endif
+#endif
+
+/**
+ * Initializes gcrypt with proper locking.
+ */
static inline void vlc_gcrypt_init (void)
{
/* This would need a process-wide static mutex with all libraries linking
@@ -37,6 +98,9 @@ static inline void vlc_gcrypt_init (void)
vlc_global_lock (VLC_GCRYPT_MUTEX);
if (!done)
{
+#if GCRYPT_VERSION_NUMBER < 0x010600
+ gcry_control (GCRYCTL_SET_THREAD_CBS, &gcry_threads_vlc);
+#endif
/* The suggested way for an application to make sure that global_init
* has been called is by using gcry_check_version. (see global_init
* comments in gcrypt sources) */
--
2.25.4

@ -0,0 +1,84 @@
From 81b2bf43c688e081454b6382db8c7cd917232446 Mon Sep 17 00:00:00 2001
From: Nicolas Chauvet <kwizart@gmail.com>
Date: Thu, 12 Oct 2023 16:42:21 +0200
Subject: [PATCH] Revert "taglib: wav: fix RIFF INFO tags parsing"
This reverts commit 85868dfb0319dced501a78dfd2ee6432d6be90f3.
---
modules/meta_engine/taglib.cpp | 38 ++++++----------------------------
1 file changed, 6 insertions(+), 32 deletions(-)
diff --git a/modules/meta_engine/taglib.cpp b/modules/meta_engine/taglib.cpp
index 84b401c795a9..d65607b98dc0 100644
--- a/modules/meta_engine/taglib.cpp
+++ b/modules/meta_engine/taglib.cpp
@@ -845,28 +845,6 @@ static void ReadMetaFromMP4( MP4::Tag* tag, demux_meta_t *p_demux_meta, vlc_meta
}
}
-static int ReadWAVMeta( const RIFF::WAV::File *wav, demux_meta_t *demux_meta )
-{
- if( !wav->hasID3v2Tag() && !wav->hasInfoTag() )
- return VLC_EGENERIC;
-
- demux_meta->p_meta = vlc_meta_New();
- if( !demux_meta->p_meta )
- return VLC_ENOMEM;
-
- TAB_INIT( demux_meta->i_attachments, demux_meta->attachments );
-
- if( wav->hasInfoTag() )
- ReadMetaFromBasicTag( wav->InfoTag(), demux_meta->p_meta );
- if( wav->hasID3v2Tag() )
- {
- // Re-read basic tags from id3 to prioritize it against INFO tags.
- ReadMetaFromBasicTag( wav->ID3v2Tag(), demux_meta->p_meta );
- ReadMetaFromId3v2( wav->ID3v2Tag(), demux_meta, demux_meta->p_meta );
- }
- return VLC_SUCCESS;
-}
-
/**
* Get the tags from the file using TagLib
* @param p_this: the demux object
@@ -942,14 +920,6 @@ static int ReadMeta( vlc_object_t* p_this)
if( f.isNull() )
return VLC_EGENERIC;
-
- // XXX: Workaround a quirk in TagLib that doesn't merge id3 tags and RIFF
- // INFO tags in `Wav::File::tag()`'s return value.
- // This forces us to parse WAV separately for now.
- const auto* riff_wav = dynamic_cast<RIFF::WAV::File*>(f.file());
- if (riff_wav != nullptr)
- return ReadWAVMeta(riff_wav, p_demux_meta);
-
if( !f.tag() || f.tag()->isEmpty() )
return VLC_EGENERIC;
@@ -957,6 +927,7 @@ static int ReadMeta( vlc_object_t* p_this)
if( !p_meta )
return VLC_ENOMEM;
+
// Read the tags from the file
ReadMetaFromBasicTag(f.tag(), p_meta);
@@ -1011,9 +982,12 @@ static int ReadMeta( vlc_object_t* p_this)
ReadMetaFromXiph( ogg_opus->tag(), p_demux_meta, p_meta );
#endif
}
- else if( RIFF::AIFF::File* riff_aiff = dynamic_cast<RIFF::AIFF::File*>(f.file()) )
+ else if( dynamic_cast<RIFF::File*>(f.file()) )
{
- ReadMetaFromId3v2( riff_aiff->tag(), p_demux_meta, p_meta );
+ if( RIFF::AIFF::File* riff_aiff = dynamic_cast<RIFF::AIFF::File*>(f.file()) )
+ ReadMetaFromId3v2( riff_aiff->tag(), p_demux_meta, p_meta );
+ else if( RIFF::WAV::File* riff_wav = dynamic_cast<RIFF::WAV::File*>(f.file()) )
+ ReadMetaFromId3v2( riff_wav->tag(), p_demux_meta, p_meta );
}
else if( TrueAudio::File* trueaudio = dynamic_cast<TrueAudio::File*>(f.file()) )
{
--
2.41.0

@ -1,853 +0,0 @@
From a4645b577c71e58db09ee6888f270fb3d0cfd61e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?R=C3=A9mi=20Denis-Courmont?= <remi@remlab.net>
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 50a76c7a18e1..e5af0ca5f2f8 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 2d51293c3f8e0bfa2b73112acf4dacb62b40ac57 Mon Sep 17 00:00:00 2001
From: Ilkka Ollakka <ileoo@videolan.org>
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 e5af0ca5f2f8..26166c084e51 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 1e5bd8a6f5fbf2c07071cefb1b24aceff058760d Mon Sep 17 00:00:00 2001
From: Ilkka Ollakka <ileoo@videolan.org>
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 26166c084e51..ad8a40ab4ed6 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 1fbf3f028cffed87cb257a45668760370db267cf Mon Sep 17 00:00:00 2001
From: Ilkka Ollakka <ileoo@videolan.org>
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 4919ccf0e0e4..52848de06587 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 a1a3edd4eacc813e5b4c3a6f353b92f4069fbc1a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fran=C3=A7ois=20Cartegnie?= <fcvlcdev@free.fr>
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 33c6cae09abc..97f3188211d3 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 da6f67588dacf60c7563fd720cc75e1912215a45 Mon Sep 17 00:00:00 2001
From: Francois Cartegnie <fcvlcdev@free.fr>
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 52848de06587..6bd58f5071d2 100644
--- a/modules/codec/avcodec/encoder.c
+++ b/modules/codec/avcodec/encoder.c
@@ -43,12 +43,13 @@
#include <vlc_cpu.h>
#include <libavcodec/avcodec.h>
-#include <libavutil/channel_layout.h>
#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 <libavutil/channel_layout.h>
#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 8e2d209d0897138ba13372ab49c0ee7cef7c316c Mon Sep 17 00:00:00 2001
From: Francois Cartegnie <fcvlcdev@free.fr>
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 ad8a40ab4ed6..c74757c76ae5 100644
--- a/modules/codec/avcodec/audio.c
+++ b/modules/codec/avcodec/audio.c
@@ -41,8 +41,11 @@
#include <libavcodec/avcodec.h>
#include <libavutil/mem.h>
-#include <libavutil/channel_layout.h>
+#define API_CHANNEL_LAYOUT (LIBAVUTIL_VERSION_CHECK( 52, 2, 6, 0, 100))
+#if API_CHANNEL_LAYOUT
+# include <libavutil/channel_layout.h>
+#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 cc5306f9b4eaac1b684747d65c04901008423f61 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fran=C3=A7ois=20Cartegnie?= <fcvlcdev@free.fr>
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 3b355bb3faec..830dc0157e2b 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 c708276954ce..8bf8735885f5 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 ad413ab9c0d8522cb79f7df3640249998902b6ca Mon Sep 17 00:00:00 2001
From: Ilkka Ollakka <ileoo@videolan.org>
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 6bd58f5071d2..757f93b46845 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 416eeca68bfb67b244827a45a4392bddb8cc0ce8 Mon Sep 17 00:00:00 2001
From: Ilkka Ollakka <ileoo@videolan.org>
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 757f93b46845..ae746c99fc89 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 c493ec18c5f3d10ba5a967e81b80d03e79f2d8b7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fran=C3=A7ois=20Cartegnie?= <fcvlcdev@free.fr>
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 e1560a9312cc..5260628364f0 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 2e6809a05410..037ad7d44887 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
From: =?utf-8?q?Fran=C3=A7ois_Cartegnie?= <fcvlcdev@free.fr>
Date: Thu, 15 Aug 2024 12:09:56 +0200
Subject: 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...
---
modules/codec/avcodec/avcommon_compat.h | 3 +++
modules/demux/avformat/mux.c | 19 +++++++++++++++++--
2 files changed, 20 insertions(+), 2 deletions(-)
diff --git a/modules/codec/avcodec/avcommon_compat.h b/modules/codec/avcodec/avcommon_compat.h
index 9d16b3d..561ad83 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 8bf8735..4994647 100644
--- a/modules/demux/avformat/mux.c
+++ b/modules/demux/avformat/mux.c
@@ -74,12 +74,18 @@ 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 );
-static int64_t IOSeek( void *opaque, int64_t offset, int whence );
#if LIBAVFORMAT_VERSION_CHECK( 57, 7, 0, 40, 100 )
static int IOWriteTyped(void *opaque, uint8_t *buf, int buf_size,
- enum AVIODataMarkerType type, int64_t time);
+ enum AVIODataMarkerType type, int64_t time);
+#endif
+#else
+static int IOWrite( void *opaque, const uint8_t *buf, int buf_size );
+int IOWriteTyped(void *opaque, const uint8_t *buf, int buf_size,
+ enum AVIODataMarkerType type, int64_t time);
#endif
+static int64_t IOSeek( void *opaque, int64_t offset, int whence );
/*****************************************************************************
* Open
@@ -411,8 +417,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 +523,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;

@ -1,28 +0,0 @@
From a761e1c202b632e7865d18fcf11a2b9e285ea9ae Mon Sep 17 00:00:00 2001
From: Tristan Matthews <tmatth@videolan.org>
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

@ -1,19 +0,0 @@
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 @@
<url type="bugtracker">https://trac.videolan.org/vlc/</url>
<url type="donation">https://www.videolan.org/contribute.html</url>
<releases>
- <release version="@VERSION@" />
+ <release version="@VERSION@" date="@DATE@" />
</releases>
<provides>
<library>libvlc.so.5</library>
@@ -38,4 +38,5 @@
<image>http://images.videolan.org/vlc/screenshots/2.0.0/vlc-2.0-gnome3-debian.jpg</image>
</screenshot>
</screenshots>
+ <content_rating type="oars-1.1" />
</component>

@ -1,84 +0,0 @@
From 6ea9b13fe82fae2b25b7371c6c36d6296db28ccb Mon Sep 17 00:00:00 2001
From: Antonio Larrosa <antonio.larrosa@gmail.com>
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 <jb@videolan.org>
---
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

@ -1,239 +0,0 @@
From 1c27f57498b7e0f52acc7b4520c4172a2462632d Mon Sep 17 00:00:00 2001
From: Juliane de Sartiges <jill@videolabs.io>
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 <freerdp/version.h>
#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 <errno.h>
#ifdef HAVE_POLL
# include <poll.h>
@@ -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

@ -1,49 +0,0 @@
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 <idna.h>
+# include <idn2.h>
#elif defined (_WIN32)
# include <windows.h>
# include <vlc_charset.h>
@@ -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;

@ -1,11 +0,0 @@
--- ./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

@ -1 +0,0 @@
%vlc_plugindir %{_libdir}/vlc/plugins

@ -1,48 +0,0 @@
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 <vlc_picture.h>
#include <vlc_codec.h>
-#include <mfx/mfxvideo.h>
+#include <vpl/mfxvideo.h>
#define SOUT_CFG_PREFIX "sout-qsv-"
--
GitLab

@ -1,18 +0,0 @@
avcodec_vaapi requires ffmpeg-4, but other vaapi modules can be built
diff --git a/configure.ac b/configure.ac
index 69beb77..c7f7142 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2454,9 +2454,9 @@ AS_IF([test "${have_vaapi}" = "yes" -a "${have_avcodec}" = "yes"], [
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])
], [
- AC_MSG_WARN([libva is present but libavcodec/vaapi.h is missing ])
+ AC_MSG_NOTICE([libva is present but libavcodec/vaapi.h is missing ])
])
])
VLC_RESTORE_FLAGS

@ -0,0 +1,36 @@
From 3965d3cf07a62a7ed64c79f44a7cc416b76cb27e Mon Sep 17 00:00:00 2001
From: Leigh Scott <leigh123linux@gmail.com>
Date: Fri, 30 Oct 2020 10:51:52 +0100
Subject: [PATCH] Switch to Fedora lua-5.1
---
configure.ac | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/configure.ac b/configure.ac
index 3aa07a8c715d..9bc7ceafb5ff 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1681,7 +1681,7 @@ then
[
AC_MSG_WARN([${LUA_PKG_ERRORS}, trying lua 5.1 instead])
- PKG_CHECK_MODULES(LUA, lua5.1,
+ PKG_CHECK_MODULES(LUA, lua-5.1,
[ have_lua=yes ],
[
AC_MSG_WARN([${LUA_PKG_ERRORS}, trying lua >= 5.1 instead])
@@ -1695,8 +1695,8 @@ then
[ have_lua=no ] )
AC_CHECK_LIB( lua5.2 , luaL_newstate,
[LUA_LIBS="-llua5.2"],
- AC_CHECK_LIB( lua5.1 , luaL_newstate,
- [LUA_LIBS="-llua5.1"],
+ AC_CHECK_LIB( lua-5.1 , luaL_newstate,
+ [LUA_LIBS="-llua-5.1"],
AC_CHECK_LIB( lua51 , luaL_newstate,
[LUA_LIBS="-llua51"],
AC_CHECK_LIB( lua , luaL_newstate,
--
2.25.4

@ -0,0 +1,149 @@
From 55b24abf7219a0c6a6560187496e41fd60638552 Mon Sep 17 00:00:00 2001
From: Steve Lhomme <robux4@ycbcr.xyz>
Date: Fri, 18 Mar 2022 11:42:49 +0100
Subject: [PATCH 1/2] dav1d: fix compilation with (upcoming) dav1d 1.0
(cherry picked from commit dbf45cea2a8abdfbef897b8a71f3eb782bb1b712) (edited)
edited:
- 3.0 has the 128 pixels padding elsewhere
- 3.0 has an extra parameter for add_integer_with_range()
- 3.0 was setting i_extra_picture_buffers further down in the code
- 3.0 uses 16 threads max
Signed-off-by: Steve Lhomme <robux4@ycbcr.xyz>
---
modules/codec/dav1d.c | 22 +++++++++++++++++++++-
1 file changed, 21 insertions(+), 1 deletion(-)
diff --git a/modules/codec/dav1d.c b/modules/codec/dav1d.c
index 039165f52e..cfabbc27cb 100644
--- a/modules/codec/dav1d.c
+++ b/modules/codec/dav1d.c
@@ -63,10 +63,16 @@ vlc_module_begin ()
set_category(CAT_INPUT)
set_subcategory(SUBCAT_INPUT_VCODEC)
+#if DAV1D_API_VERSION_MAJOR >= 6
+ add_integer_with_range("dav1d-thread-frames", 0, 0, DAV1D_MAX_THREADS,
+ THREAD_FRAMES_TEXT, THREAD_FRAMES_LONGTEXT, false)
+ add_obsolete_string("dav1d-thread-tiles") // unused with dav1d 1.0
+#else
add_integer_with_range("dav1d-thread-frames", 0, 0, DAV1D_MAX_FRAME_THREADS,
THREAD_FRAMES_TEXT, THREAD_FRAMES_LONGTEXT, false)
add_integer_with_range("dav1d-thread-tiles", 0, 0, DAV1D_MAX_TILE_THREADS,
THREAD_TILES_TEXT, THREAD_TILES_LONGTEXT, false)
+#endif
vlc_module_end ()
/*****************************************************************************
@@ -294,6 +300,11 @@ static int OpenDecoder(vlc_object_t *p_this)
return VLC_ENOMEM;
dav1d_default_settings(&p_sys->s);
+#if DAV1D_API_VERSION_MAJOR >= 6
+ p_sys->s.n_threads = var_InheritInteger(p_this, "dav1d-thread-frames");
+ if (p_sys->s.n_threads == 0)
+ p_sys->s.n_threads = (i_core_count < 16) ? i_core_count : 16;
+#else
p_sys->s.n_tile_threads = var_InheritInteger(p_this, "dav1d-thread-tiles");
if (p_sys->s.n_tile_threads == 0)
p_sys->s.n_tile_threads =
@@ -303,6 +314,7 @@ static int OpenDecoder(vlc_object_t *p_this)
p_sys->s.n_frame_threads = var_InheritInteger(p_this, "dav1d-thread-frames");
if (p_sys->s.n_frame_threads == 0)
p_sys->s.n_frame_threads = (i_core_count < 16) ? i_core_count : 16;
+#endif
p_sys->s.allocator.cookie = dec;
p_sys->s.allocator.alloc_picture_callback = NewPicture;
p_sys->s.allocator.release_picture_callback = FreePicture;
@@ -313,12 +325,20 @@ static int OpenDecoder(vlc_object_t *p_this)
return VLC_EGENERIC;
}
+#if DAV1D_API_VERSION_MAJOR >= 6
+ msg_Dbg(p_this, "Using dav1d version %s with %d threads",
+ dav1d_version(), p_sys->s.n_threads);
+
+ dec->i_extra_picture_buffers = (p_sys->s.n_threads - 1);
+#else
msg_Dbg(p_this, "Using dav1d version %s with %d/%d frame/tile threads",
dav1d_version(), p_sys->s.n_frame_threads, p_sys->s.n_tile_threads);
+ dec->i_extra_picture_buffers = (p_sys->s.n_frame_threads - 1);
+#endif
+
dec->pf_decode = Decode;
dec->pf_flush = FlushDecoder;
- dec->i_extra_picture_buffers = (p_sys->s.n_frame_threads - 1);
dec->fmt_out.video.i_width = dec->fmt_in.video.i_width;
dec->fmt_out.video.i_height = dec->fmt_in.video.i_height;
--
2.36.1
From c95e5288ab2d222346b19552a462afe5159d1122 Mon Sep 17 00:00:00 2001
From: Steve Lhomme <robux4@ycbcr.xyz>
Date: Mon, 21 Mar 2022 15:53:52 +0100
Subject: [PATCH 2/2] dav1d: limit the number of extra frames needed by the
decoder
The i_extra_picture_buffers is used to add pictures to the pool that the core
will allocate. dav1d is actually using n_threads frames. And the core is
allocating 10 frames per default for AV1. So we need to add the missing ones.
(cherry picked from commit a32031dc0f5f32083fc54a21397bce732742ccbe) (rebased)
rebased:
- the code dav1d 1.0.0 in 3.0 uses different max versions
Signed-off-by: Steve Lhomme <robux4@ycbcr.xyz>
---
modules/codec/dav1d.c | 25 +++++++++++++++++++++++--
1 file changed, 23 insertions(+), 2 deletions(-)
diff --git a/modules/codec/dav1d.c b/modules/codec/dav1d.c
index cfabbc27cb..8a439ce4ff 100644
--- a/modules/codec/dav1d.c
+++ b/modules/codec/dav1d.c
@@ -304,7 +304,28 @@ static int OpenDecoder(vlc_object_t *p_this)
p_sys->s.n_threads = var_InheritInteger(p_this, "dav1d-thread-frames");
if (p_sys->s.n_threads == 0)
p_sys->s.n_threads = (i_core_count < 16) ? i_core_count : 16;
-#else
+
+#if DAV1D_API_VERSION_MAJOR > 6 || DAV1D_API_VERSION_MINOR >= 7
+ // after dav1d 1.0.0
+ p_sys->s.max_frame_delay = dav1d_get_frame_delay( &p_sys->s );
+#else // 1.0.0
+ // corresponds to c->n_fc when max_frame_delay is 0 in dav1d 1.0.0
+ static const uint8_t fc_lut[49] = {
+ 1, /* 1 */
+ 2, 2, 2, /* 2- 4 */
+ 3, 3, 3, 3, 3, /* 5- 9 */
+ 4, 4, 4, 4, 4, 4, 4, /* 10-16 */
+ 5, 5, 5, 5, 5, 5, 5, 5, 5, /* 17-25 */
+ 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, /* 26-36 */
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, /* 37-49 */
+ };
+ if (p_sys->s.n_threads >= 50)
+ p_sys->s.max_frame_delay = 8;
+ else
+ p_sys->s.max_frame_delay = fc_lut[p_sys->s.n_threads - 1];
+#endif
+
+#else // before dav1d 1.0.0
p_sys->s.n_tile_threads = var_InheritInteger(p_this, "dav1d-thread-tiles");
if (p_sys->s.n_tile_threads == 0)
p_sys->s.n_tile_threads =
@@ -329,7 +350,7 @@ static int OpenDecoder(vlc_object_t *p_this)
msg_Dbg(p_this, "Using dav1d version %s with %d threads",
dav1d_version(), p_sys->s.n_threads);
- dec->i_extra_picture_buffers = (p_sys->s.n_threads - 1);
+ dec->i_extra_picture_buffers = p_sys->s.max_frame_delay;
#else
msg_Dbg(p_this, "Using dav1d version %s with %d/%d frame/tile threads",
dav1d_version(), p_sys->s.n_frame_threads, p_sys->s.n_tile_threads);
--
2.36.1

File diff suppressed because it is too large Load Diff

@ -0,0 +1,14 @@
--- a/modules/video_chroma/chain.c
+++ b/modules/video_chroma/chain.c
@@ -280,8 +280,9 @@ static int BuildTransformChain( filter_t
return VLC_SUCCESS;
/* Lets try resize+chroma first, then transform */
- msg_Dbg( p_filter, "Trying to build chroma+resize" );
- EsFormatMergeSize( &fmt_mid, &p_filter->fmt_out, &p_filter->fmt_in );
+ msg_Dbg( p_filter, "Trying to build chroma+resize, then transform" );
+ es_format_Copy( &fmt_mid, &p_filter->fmt_out );
+ video_format_TransformTo(&fmt_mid.video, p_filter->fmt_in.video.orientation);
i_ret = CreateChain( p_filter, &fmt_mid );
es_format_Clean( &fmt_mid );
if( i_ret == VLC_SUCCESS )

@ -0,0 +1,101 @@
From c25400b146f7a7b3b4a29c0efa4daee9d1c49633 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?R=C3=A9mi=20Denis-Courmont?= <remi@remlab.net>
Date: Tue, 5 May 2020 18:48:06 +0300
Subject: [PATCH] notify: don't depend on any GTK version
If there's one in the process use it. If there's none fallback to
default VLC icon with the old code.
This not only avoids VLC builds depending on GTK, but this should
prevent crashes if GTK 2 is present in the process (e.g. through Qt plugin).
Adapted to vlc-3.x by "Nicolas Chauvet <kwizart@gmail.com>"
---
configure.ac | 2 +-
modules/notify/notify.c | 38 ++++++++++++++++++++++----------------
2 files changed, 23 insertions(+), 17 deletions(-)
diff --git a/configure.ac b/configure.ac
index 09ac250ff483..a3ef64318561 100644
--- a/configure.ac
+++ b/configure.ac
@@ -4206,7 +4206,7 @@ AS_IF([test "${enable_osx_notifications}" != "no"], [
dnl
dnl Libnotify notification plugin
dnl
-PKG_ENABLE_MODULES_VLC([NOTIFY], [], [libnotify gtk+-3.0], [libnotify notification], [auto])
+PKG_ENABLE_MODULES_VLC([NOTIFY], [], [libnotify], [libnotify notification], [auto])
dnl
dnl libplacebo support
diff --git a/modules/notify/notify.c b/modules/notify/notify.c
index bd6bba6c32c8..20b7c4acb761 100644
--- a/modules/notify/notify.c
+++ b/modules/notify/notify.c
@@ -36,10 +36,16 @@
#include <vlc_playlist.h>
#include <vlc_url.h>
-#include <gtk/gtk.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
#include <libnotify/notify.h>
+typedef struct GtkIconTheme GtkIconTheme;
+enum GtkIconLookupFlags { dummy = 0x7fffffff };
+
+__attribute__((weak)) GtkIconTheme *gtk_icon_theme_get_default(void);
+__attribute__((weak)) GdkPixbuf *gtk_icon_theme_load_icon(GtkIconTheme *,
+ const char *icon_name, int size, enum GtkIconLookupFlags, GError **);
+
#ifndef NOTIFY_CHECK_VERSION
# define NOTIFY_CHECK_VERSION(x,y,z) 0
#endif
@@ -222,30 +228,30 @@ static int ItemChange( vlc_object_t *p_this, const char *psz_var,
GError *p_error = NULL;
pix = gdk_pixbuf_new_from_file_at_scale( psz_arturl,
72, 72, TRUE, &p_error );
+ free( psz_arturl );
}
- else /* else we show state-of-the art logo */
+ else
+ /* else we show state-of-the art logo */
+ if( gtk_icon_theme_get_default != NULL
+ && gtk_icon_theme_load_icon != NULL )
{
/* First try to get an icon from the current theme. */
GtkIconTheme* p_theme = gtk_icon_theme_get_default();
pix = gtk_icon_theme_load_icon( p_theme, "vlc", 72, 0, NULL);
-
- if( !pix )
+ }
+ else
+ { /* Load icon from share/ */
+ GError *p_error = NULL;
+ char *psz_pixbuf;
+ char *psz_data = config_GetDataDir();
+ if( asprintf( &psz_pixbuf, "%s/icons/48x48/vlc.png", psz_data ) >= 0 )
{
- /* Load icon from share/ */
- GError *p_error = NULL;
- char *psz_pixbuf;
- char *psz_data = config_GetDataDir();
- if( asprintf( &psz_pixbuf, "%s/icons/48x48/vlc.png", psz_data ) >= 0 )
- {
- pix = gdk_pixbuf_new_from_file( psz_pixbuf, &p_error );
- free( psz_pixbuf );
- }
- free( psz_data );
+ pix = gdk_pixbuf_new_from_file( psz_pixbuf, &p_error );
+ free( psz_pixbuf );
}
+ free( psz_data );
}
- free( psz_arturl );
-
/* we need to replace '&' with '&amp;' because '&' is a keyword of
* notification-daemon parser */
const int i_len = strlen( psz_tmp );
--
2.25.4

@ -0,0 +1 @@
SHA512 (vlc-6f0d0ab.tar.gz) = 5a2529a397c27c97d0a8ac32d483327b3f47f90ce97c86ff7c169e4c349456c95339b755f28320cbc717d52148225402f6fd64009d7543f50a85701d303dbd6a

@ -0,0 +1,131 @@
From efbb1fdbc4420365b3ffd22e55dd27ad520037c7 Mon Sep 17 00:00:00 2001
From: Niklas Haas <git@haasn.dev>
Date: Sat, 16 Jul 2022 14:41:13 +0200
Subject: [PATCH] opengl: port to libplacebo v4 API
These v3.x APIs will be removed in v5.x. Fortunately, the new APIs are a
near drop-in replacement, so the change was minimal. Only the error
handling was cleaned up slightly.
---
modules/video_output/opengl/converter.h | 18 ++++++++++--------
modules/video_output/opengl/fragment_shaders.c | 4 ++--
modules/video_output/opengl/vout_helper.c | 14 +++++++-------
3 files changed, 19 insertions(+), 17 deletions(-)
diff --git a/modules/video_output/opengl/converter.h b/modules/video_output/opengl/converter.h
index 7000e1f38e..cb8e593a9a 100644
--- a/modules/video_output/opengl/converter.h
+++ b/modules/video_output/opengl/converter.h
@@ -52,6 +52,11 @@
# endif
#endif
+#ifdef HAVE_LIBPLACEBO
+# include <libplacebo/log.h>
+# include <libplacebo/shaders.h>
+#endif
+
#define VLCGL_PICTURE_MAX 128
#ifndef GL_TEXTURE_RECTANGLE
@@ -253,10 +258,6 @@ static inline bool HasExtension(const char *apis, const char *api)
return false;
}
-struct pl_context;
-struct pl_shader;
-struct pl_shader_res;
-
/*
* Structure that is filled by "glhw converter" module probe function
* The implementation should initialize every members of the struct that are
@@ -272,8 +273,12 @@ struct opengl_tex_converter_t
/* Pointer to object gl, set by the caller */
vlc_gl_t *gl;
+#ifdef HAVE_LIBPLACEBO
/* libplacebo context, created by the caller (optional) */
- struct pl_context *pl_ctx;
+ pl_log pl_log;
+ pl_shader pl_sh;
+ const struct pl_shader_res *pl_sh_res;
+#endif
/* Function pointers to OpenGL functions, set by the caller */
const opengl_vtable_t *vt;
@@ -337,9 +342,6 @@ struct opengl_tex_converter_t
bool yuv_color;
GLfloat yuv_coefficients[16];
- struct pl_shader *pl_sh;
- const struct pl_shader_res *pl_sh_res;
-
/* Private context */
void *priv;
diff --git a/modules/video_output/opengl/fragment_shaders.c b/modules/video_output/opengl/fragment_shaders.c
index 2246e33afd..16380335cc 100644
--- a/modules/video_output/opengl/fragment_shaders.c
+++ b/modules/video_output/opengl/fragment_shaders.c
@@ -611,7 +611,7 @@ opengl_fragment_shader_init_impl(opengl_tex_converter_t *tc, GLenum tex_target,
#ifdef HAVE_LIBPLACEBO
if (tc->pl_sh) {
- struct pl_shader *sh = tc->pl_sh;
+ pl_shader sh = tc->pl_sh;
struct pl_color_map_params color_params = pl_color_map_default_params;
color_params.intent = var_InheritInteger(tc->gl, "rendering-intent");
color_params.tone_mapping_algo = var_InheritInteger(tc->gl, "tone-mapping");
@@ -634,7 +634,7 @@ opengl_fragment_shader_init_impl(opengl_tex_converter_t *tc, GLenum tex_target,
pl_color_space_from_video_format(&tc->fmt),
dst_space, NULL, false);
- struct pl_shader_obj *dither_state = NULL;
+ pl_shader_obj dither_state = NULL;
int method = var_InheritInteger(tc->gl, "dither-algo");
if (method >= 0) {
diff --git a/modules/video_output/opengl/vout_helper.c b/modules/video_output/opengl/vout_helper.c
index 13d65e04c8..e971f5170b 100644
--- a/modules/video_output/opengl/vout_helper.c
+++ b/modules/video_output/opengl/vout_helper.c
@@ -570,8 +570,8 @@ opengl_deinit_program(vout_display_opengl_t *vgl, struct prgm *prgm)
#ifdef HAVE_LIBPLACEBO
FREENULL(tc->uloc.pl_vars);
- if (tc->pl_ctx)
- pl_context_destroy(&tc->pl_ctx);
+ pl_shader_free(&tc->pl_sh);
+ pl_log_destroy(&tc->pl_log);
#endif
vlc_object_release(tc);
@@ -622,21 +622,21 @@ opengl_init_program(vout_display_opengl_t *vgl, struct prgm *prgm,
// create the main libplacebo context
if (!subpics)
{
- tc->pl_ctx = pl_context_create(PL_API_VER, &(struct pl_context_params) {
+ tc->pl_log = pl_log_create(PL_API_VER, &(struct pl_log_params) {
.log_cb = log_cb,
.log_priv = tc,
.log_level = PL_LOG_INFO,
});
- if (tc->pl_ctx) {
+ if (tc->pl_log) {
# if PL_API_VER >= 20
- tc->pl_sh = pl_shader_alloc(tc->pl_ctx, &(struct pl_shader_params) {
+ tc->pl_sh = pl_shader_alloc(tc->pl_log, &(struct pl_shader_params) {
.glsl.version = tc->glsl_version,
.glsl.gles = tc->is_gles,
});
# elif PL_API_VER >= 6
- tc->pl_sh = pl_shader_alloc(tc->pl_ctx, NULL, 0);
+ tc->pl_sh = pl_shader_alloc(tc->pl_log, NULL, 0);
# else
- tc->pl_sh = pl_shader_alloc(tc->pl_ctx, NULL, 0, 0);
+ tc->pl_sh = pl_shader_alloc(tc->pl_log, NULL, 0, 0);
# endif
}
}
--
2.38.1

@ -0,0 +1,24 @@
diff -up vlc-26fb05e95724bd19f9a144c51bc11f79c609f3bc/configure.ac.vpl vlc-26fb05e95724bd19f9a144c51bc11f79c609f3bc/configure.ac
--- vlc-26fb05e95724bd19f9a144c51bc11f79c609f3bc/configure.ac.vpl 2023-06-17 17:19:28.954540887 +0200
+++ vlc-26fb05e95724bd19f9a144c51bc11f79c609f3bc/configure.ac 2023-06-17 17:19:28.956540899 +0200
@@ -2925,7 +2925,7 @@ fi
dnl
dnl Intel QuickSync (aka MediaSDK) H264/H262 encoder
dnl
-PKG_ENABLE_MODULES_VLC([MFX], [qsv], [libmfx], [Intel QuickSync MPEG4-Part10/MPEG2 (aka H.264/H.262) encoder], [auto])
+PKG_ENABLE_MODULES_VLC([MFX], [qsv], [vpl], [Intel QuickSync MPEG4-Part10/MPEG2 (aka H.264/H.262) encoder], [auto])
dnl
dnl libfluidsynth (MIDI synthetizer) plugin
diff -up vlc-26fb05e95724bd19f9a144c51bc11f79c609f3bc/modules/codec/qsv.c.vpl vlc-26fb05e95724bd19f9a144c51bc11f79c609f3bc/modules/codec/qsv.c
--- vlc-26fb05e95724bd19f9a144c51bc11f79c609f3bc/modules/codec/qsv.c.vpl 2023-06-09 17:29:29.000000000 +0200
+++ vlc-26fb05e95724bd19f9a144c51bc11f79c609f3bc/modules/codec/qsv.c 2023-06-17 17:22:05.468382540 +0200
@@ -33,7 +33,7 @@
#include <vlc_picture.h>
#include <vlc_codec.h>
-#include <mfx/mfxvideo.h>
+#include <vpl/mfxvideo.h>
#define SOUT_CFG_PREFIX "sout-qsv-"

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save