Skip to content

Commit

Permalink
ffmpeg Update: Replace deprecated av_get_channel_layout_string with a…
Browse files Browse the repository at this point in the history
…v_get_channel_layout_describe

```
[ 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);
```
  • Loading branch information
hashworks committed May 25, 2024
1 parent 0c8b44d commit 25075c5
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/projects/modules/ffmpeg/ffmpeg_conv.h
Original file line number Diff line number Diff line change
Expand Up @@ -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(&parameters->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<AVSampleFormat>(parameters->format)));
message.AppendFormat("%d Hz, %s(%d), %s, ", parameters->sample_rate, channel_layout_buf, parameters->channels, ::av_get_sample_fmt_name(static_cast<AVSampleFormat>(parameters->format)));
}

message.AppendFormat("%d kbps, ", (parameters->bit_rate / 1024));
Expand Down

0 comments on commit 25075c5

Please sign in to comment.