savonet / ocaml-ffmpeg

OCaml bindings to the FFmpeg library.
http://www.liquidsoap.info/ocaml-ffmpeg/
GNU Lesser General Public License v2.1
48 stars 12 forks source link

Compilation fails #56

Closed smimram closed 4 months ago

smimram commented 1 year ago

Since the latest git pull, the compilation fails here:

File "avcodec/dune", line 7, characters 9-22:
7 |   (names avcodec_stubs)
             ^^^^^^^^^^^^^
(cd _build/default/avcodec && /usr/bin/gcc -O2 -fno-strict-aliasing -fwrapv -pthread -fPIC -D_FILE_OFFSET_BITS=64 -I/usr/include/x86_64-linux-gnu -g -I /home/smimram/.opam/5.0.0/lib/ocaml -I /home/smimram/.opam/5.0.0/lib/ffmpeg-avutil -I /home/smimram/.opam/5.0.0/lib/ocaml/threads -I /home/smimram/.opam/5.0.0/lib/ocaml/unix -o avcodec_stubs.o -c avcodec_stubs.c)
avcodec_stubs.c: In function ‘ocaml_avcodec_packet_add_side_data’:
avcodec_stubs.c:172:8: error: ‘PVV_Metadata_update’ undeclared (first use in this function)
  172 |   case PVV_Metadata_update:
      |        ^~~~~~~~~~~~~~~~~~~
avcodec_stubs.c:172:8: note: each undeclared identifier is reported only once for each function it appears in
avcodec_stubs.c:175:8: error: ‘PVV_Strings_metadata’ undeclared (first use in this function)
  175 |   case PVV_Strings_metadata:
      |        ^~~~~~~~~~~~~~~~~~~~
avcodec_stubs.c:178:8: error: ‘PVV_Replaygain’ undeclared (first use in this function); did you mean ‘AVReplayGain’?
  178 |   case PVV_Replaygain:
      |        ^~~~~~~~~~~~~~
      |        AVReplayGain
avcodec_stubs.c: In function ‘ocaml_avcodec_packet_side_data’:
avcodec_stubs.c:241:20: error: ‘PVV_Metadata_update’ undeclared (first use in this function)
  241 |                  ? PVV_Metadata_update
      |                    ^~~~~~~~~~~~~~~~~~~
avcodec_stubs.c:242:20: error: ‘PVV_Strings_metadata’ undeclared (first use in this function)
  242 |                  : PVV_Strings_metadata;
      |                    ^~~~~~~~~~~~~~~~~~~~
In file included from /home/smimram/.opam/5.0.0/lib/ocaml/caml/callback.h:22,
                 from avcodec_stubs.c:5:
avcodec_stubs.c:266:28: error: ‘PVV_Replaygain’ undeclared (first use in this function); did you mean ‘AVReplayGain’?
  266 |       Store_field(tmp2, 0, PVV_Replaygain);
      |                            ^~~~~~~~~~~~~~
/home/smimram/.opam/5.0.0/lib/ocaml/caml/memory.h:436:27: note: in definition of macro ‘Store_field’
  436 |   value caml__temp_val = (val); \
      |                           ^~~
avcodec_stubs.c: In function ‘ocaml_avcodec_create_audio_encoder’:
avcodec_stubs.c:677:3: warning: ‘channels’ is deprecated [-Wdeprecated-declarations]
  677 |   ctx->codec_context->channels = Int_val(_channels);
      |   ^~~
In file included from avcodec_stubs.h:5,
                 from avcodec_stubs.c:12:
/usr/include/x86_64-linux-gnu/libavcodec/avcodec.h:1006:9: note: declared here
 1006 |     int channels;
      |         ^~~~~~~~
avcodec_stubs.c: In function ‘ocaml_avcodec_get_supported_channel_layouts’:
avcodec_stubs.c:1267:3: warning: ‘channel_layouts’ is deprecated [-Wdeprecated-declarations]
 1267 |   if (codec->channel_layouts) {
      |   ^~
In file included from /usr/include/x86_64-linux-gnu/libavcodec/avcodec.h:40:
/usr/include/x86_64-linux-gnu/libavcodec/codec.h:226:21: note: declared here
  226 |     const uint64_t *channel_layouts;         ///< array of support channel layouts, or NULL if unknown. array is terminated by 0
      |                     ^~~~~~~~~~~~~~~
avcodec_stubs.c:1268:5: warning: ‘channel_layouts’ is deprecated [-Wdeprecated-declarations]
 1268 |     for (i = 0; codec->channel_layouts[i] != 0; i++)
      |     ^~~
/usr/include/x86_64-linux-gnu/libavcodec/codec.h:226:21: note: declared here
  226 |     const uint64_t *channel_layouts;         ///< array of support channel layouts, or NULL if unknown. array is terminated by 0
      |                     ^~~~~~~~~~~~~~~
avcodec_stubs.c:1269:7: warning: ‘channel_layouts’ is deprecated [-Wdeprecated-declarations]
 1269 |       List_add(list, cons, Val_ChannelLayout(codec->channel_layouts[i]));
      |       ^~~~~~~~
/usr/include/x86_64-linux-gnu/libavcodec/codec.h:226:21: note: declared here
  226 |     const uint64_t *channel_layouts;         ///< array of support channel layouts, or NULL if unknown. array is terminated by 0
      |                     ^~~~~~~~~~~~~~~
avcodec_stubs.c: In function ‘ocaml_avcodec_parameters_get_channel_layout’:
avcodec_stubs.c:1315:3: warning: ‘channel_layout’ is deprecated [-Wdeprecated-declarations]
 1315 |   if (cp->channel_layout == 0) {
      |   ^~
In file included from /usr/include/x86_64-linux-gnu/libavcodec/avcodec.h:42:
/usr/include/x86_64-linux-gnu/libavcodec/codec_par.h:166:14: note: declared here
  166 |     uint64_t channel_layout;
      |              ^~~~~~~~~~~~~~
avcodec_stubs.c:1316:5: warning: ‘channel_layout’ is deprecated [-Wdeprecated-declarations]
 1316 |     cp->channel_layout = av_get_default_channel_layout(cp->channels);
      |     ^~
/usr/include/x86_64-linux-gnu/libavcodec/codec_par.h:166:14: note: declared here
  166 |     uint64_t channel_layout;
      |              ^~~~~~~~~~~~~~
avcodec_stubs.c:1316:5: warning: ‘av_get_default_channel_layout’ is deprecated [-Wdeprecated-declarations]
 1316 |     cp->channel_layout = av_get_default_channel_layout(cp->channels);
      |     ^~
In file included from /usr/include/x86_64-linux-gnu/libavutil/frame.h:33,
                 from /usr/include/x86_64-linux-gnu/libavcodec/avcodec.h:35:
/usr/include/x86_64-linux-gnu/libavutil/channel_layout.h:457:9: note: declared here
  457 | int64_t av_get_default_channel_layout(int nb_channels);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
avcodec_stubs.c:1316:5: warning: ‘channels’ is deprecated [-Wdeprecated-declarations]
 1316 |     cp->channel_layout = av_get_default_channel_layout(cp->channels);
      |     ^~
/usr/include/x86_64-linux-gnu/libavcodec/codec_par.h:172:14: note: declared here
  172 |     int      channels;
      |              ^~~~~~~~
avcodec_stubs.c:1319:3: warning: ‘channel_layout’ is deprecated [-Wdeprecated-declarations]
 1319 |   CAMLreturn(Val_ChannelLayout(cp->channel_layout));
      |   ^~~~~~~~~~
/usr/include/x86_64-linux-gnu/libavcodec/codec_par.h:166:14: note: declared here
  166 |     uint64_t channel_layout;
      |              ^~~~~~~~~~~~~~
avcodec_stubs.c: In function ‘ocaml_avcodec_parameters_get_nb_channels’:
avcodec_stubs.h:19:42: warning: ‘channels’ is deprecated [-Wdeprecated-declarations]
   19 | #define CodecParameters_val(v) (*(struct AVCodecParameters**)Data_custom_val(v))
      |                                          ^~~~~~~~~~~~~~~~~
/home/smimram/.opam/5.0.0/lib/ocaml/caml/memory.h:423:29: note: in definition of macro ‘CAMLreturnT’
  423 |   type caml__temp_result = (result); \
      |                             ^~~~~~
avcodec_stubs.c:1324:3: note: in expansion of macro ‘CAMLreturn’
 1324 |   CAMLreturn(Val_int(CodecParameters_val(_cp)->channels));
      |   ^~~~~~~~~~
/home/smimram/.opam/5.0.0/lib/ocaml/caml/mlvalues.h:79:20: note: in expansion of macro ‘Val_long’
   79 | #define Val_int(x) Val_long(x)
      |                    ^~~~~~~~
avcodec_stubs.c:1324:14: note: in expansion of macro ‘Val_int’
 1324 |   CAMLreturn(Val_int(CodecParameters_val(_cp)->channels));
      |              ^~~~~~~
avcodec_stubs.c:1324:22: note: in expansion of macro ‘CodecParameters_val’
 1324 |   CAMLreturn(Val_int(CodecParameters_val(_cp)->channels));
      |                      ^~~~~~~~~~~~~~~~~~~
/usr/include/x86_64-linux-gnu/libavcodec/codec_par.h:172:14: note: declared here
  172 |     int      channels;
      |              ^~~~~~~~
avcodec_stubs.c: In function ‘ocaml_avcodec_parameters_audio_copy’:
avcodec_stubs.c:1351:3: warning: ‘channel_layout’ is deprecated [-Wdeprecated-declarations]
 1351 |   dst->channel_layout = ChannelLayout_val(_channel_layout);
      |   ^~~
/usr/include/x86_64-linux-gnu/libavcodec/codec_par.h:166:14: note: declared here
  166 |     uint64_t channel_layout;
      |              ^~~~~~~~~~~~~~
avcodec_stubs.c:1352:3: warning: ‘channels’ is deprecated [-Wdeprecated-declarations]
 1352 |   dst->channels = av_get_channel_layout_nb_channels(dst->channel_layout);
      |   ^~~
/usr/include/x86_64-linux-gnu/libavcodec/codec_par.h:172:14: note: declared here
  172 |     int      channels;
      |              ^~~~~~~~
avcodec_stubs.c:1352:3: warning: ‘av_get_channel_layout_nb_channels’ is deprecated [-Wdeprecated-declarations]
 1352 |   dst->channels = av_get_channel_layout_nb_channels(dst->channel_layout);
      |   ^~~
/usr/include/x86_64-linux-gnu/libavutil/channel_layout.h:449:5: note: declared here
  449 | int av_get_channel_layout_nb_channels(uint64_t channel_layout);
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
avcodec_stubs.c:1352:3: warning: ‘channel_layout’ is deprecated [-Wdeprecated-declarations]
 1352 |   dst->channels = av_get_channel_layout_nb_channels(dst->channel_layout);
      |   ^~~
/usr/include/x86_64-linux-gnu/libavcodec/codec_par.h:166:14: note: declared here
  166 |     uint64_t channel_layout;
      |              ^~~~~~~~~~~~~~

My libavcodec-dev package version (Debian) is 7:5.1.2-3 (the standard testing version).

toots commented 1 year ago

Hmm this is weird, it builds on the debian CI. What build command are you running?

smimram commented 1 year ago

I get the same with dune build.

toots commented 1 year ago

Compilation works on a clear debian testing docker image. Are you sure that everything is clean on your end?