From 25075c5020d8d758498c075ef9fe7eb3a339499a Mon Sep 17 00:00:00 2001 From: hashworks Date: Sat, 25 May 2024 20:26:32 +0200 Subject: [PATCH] ffmpeg Update: Replace deprecated av_get_channel_layout_string with av_get_channel_layout_describe MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ``` [ 17/505| 3%] [static] libapi_server.a: C++ projects/api_server/controllers/v1/vhosts/apps/output_profiles/output_profiles_controller.cpp => intermediates/RELEASE/objs/api_server/controllers/v1/vhosts/apps/output_profiles/output_profiles_controller.o In file included from projects/providers/multiplex/multiplex_stream.h:11, from projects/providers/multiplex/multiplex_application.h:16, from projects/api_server/controllers/v1/vhosts/apps/multiplex_channels/multiplex_channels_controller.cpp:13: projects/modules/ffmpeg/ffmpeg_conv.h: In static member function ‘static ov::String ffmpeg::Conv::CodecInfoToString(const AVCodecContext*, const AVCodecParameters*)’: projects/modules/ffmpeg/ffmpeg_conv.h:678:51: error: ‘::av_get_channel_layout_string’ has not been declared; did you mean ‘av_channel_layout_uninit’? 678 | ::av_get_channel_layout_string(channel_layout, OV_COUNTOF(channel_layout), parameters->channels, parameters->channel_layout); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ | av_channel_layout_uninit ``` ``` /** * Return a description of a channel layout. * If nb_channels is <= 0, it is guessed from the channel_layout. * * @param buf put here the string containing the channel layout * @param buf_size size in bytes of the buffer * @param nb_channels number of channels * @param channel_layout channel layout bitset * @deprecated use av_channel_layout_describe() */ attribute_deprecated void av_get_channel_layout_string(char *buf, int buf_size, int nb_channels, uint64_t channel_layout); ``` --- src/projects/modules/ffmpeg/ffmpeg_conv.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/projects/modules/ffmpeg/ffmpeg_conv.h b/src/projects/modules/ffmpeg/ffmpeg_conv.h index 43cbb1294..4115213e3 100644 --- a/src/projects/modules/ffmpeg/ffmpeg_conv.h +++ b/src/projects/modules/ffmpeg/ffmpeg_conv.h @@ -684,11 +684,12 @@ namespace ffmpeg } else { - char channel_layout[16]{}; - ::av_get_channel_layout_string(channel_layout, OV_COUNTOF(channel_layout), parameters->channels, parameters->channel_layout); + char channel_layout_buf[16]{}; + + ::av_channel_layout_describe(¶meters->ch_layout, channel_layout_buf, OV_COUNTOF(channel_layout_buf)); // 48000 Hz, stereo, fltp, - message.AppendFormat("%d Hz, %s(%d), %s, ", parameters->sample_rate, channel_layout, parameters->channels, ::av_get_sample_fmt_name(static_cast(parameters->format))); + message.AppendFormat("%d Hz, %s(%d), %s, ", parameters->sample_rate, channel_layout_buf, parameters->channels, ::av_get_sample_fmt_name(static_cast(parameters->format))); } message.AppendFormat("%d kbps, ", (parameters->bit_rate / 1024));