Opened 11 years ago

Closed 11 years ago

#40581 closed defect (fixed)

gpac build error

Reported by: mf2k (Frank Schima) Owned by: macports-tickets@…
Priority: Normal Milestone:
Component: ports Version: 2.2.0
Keywords: Cc: dbevans (David B. Evans), jeremyhu (Jeremy Huddleston Sequoia)
Port: gpac

Description

I'm seeing an error trying to build gpac. I'm not sure if it's due to ffmpeg or my recent update of Xcode to version 5.0. I'm Cc'ing the maintainers of ffmpeg for possible comment.

Error is:

:info:build cc -I/opt/local/include -O3  -arch x86_64 -Wall -fno-strict-aliasing -Wno-pointer-sign -fPIC -DPIC -fvisibility="hidden" -DGPAC_HAVE_CONFIG_H -I"/opt/local/var/macports/build/_opt_mports_trunk_dports_multimedia_gpac/gpac/work/gpac" -Wno-deprecated-declarations -I"/opt/local/var/macports/build/_opt_mports_trunk_dports_multimedia_gpac/gpac/work/gpac/include" -I/opt/local/include -c -o ffmpeg_decode.o ffmpeg_decode.c 
:info:build In file included from ffmpeg_decode.c:25:
:info:build ./ffmpeg_in.h:120:17: error: use of undeclared identifier 'AVCODEC_MAX_AUDIO_FRAME_SIZE'
:info:build         char audio_buf[AVCODEC_MAX_AUDIO_FRAME_SIZE];
:info:build                        ^
:info:build ffmpeg_decode.c:172:11: warning: implicit declaration of function 'avcodec_alloc_context' is invalid in C99 [-Wimplicit-function-declaration]
:info:build           *ctx = avcodec_alloc_context();
:info:build                  ^
:info:build ffmpeg_decode.c:172:9: warning: incompatible integer to pointer conversion assigning to 'AVCodecContext *' (aka 'struct AVCodecContext *') from 'int' [-Wint-conversion]
:info:build           *ctx = avcodec_alloc_context();
:info:build                ^ ~~~~~~~~~~~~~~~~~~~~~~~
:info:build ffmpeg_decode.c:278:14: warning: equality comparison with extraneous parentheses [-Wparentheses-equality]
:info:build         if ((ffd->st==GF_STREAM_VISUAL)) {
:info:build              ~~~~~~~^~~~~~~~~~~~~~~~~~
:info:build ffmpeg_decode.c:278:14: note: remove extraneous parentheses around the comparison to silence this warning
:info:build         if ((ffd->st==GF_STREAM_VISUAL)) {
:info:build             ~       ^                 ~
:info:build ffmpeg_decode.c:278:14: note: use '=' to turn this equality comparison into an assignment
:info:build         if ((ffd->st==GF_STREAM_VISUAL)) {
:info:build                     ^~
:info:build                     =
:info:build ffmpeg_decode.c:320:7: warning: implicit declaration of function 'avcodec_open' is invalid in C99 [-Wimplicit-function-declaration]
:info:build                 if (avcodec_open((*ctx), (*codec) )<0) return GF_NON_COMPLIANT_BITSTREAM;
:info:build                     ^
:info:build ffmpeg_decode.c:614:12: error: use of undeclared identifier 'AVCODEC_MAX_AUDIO_FRAME_SIZE'
:info:build                 gotpic = AVCODEC_MAX_AUDIO_FRAME_SIZE;
:info:build                          ^
:info:build 4 warnings and 2 errors generated.
:info:build make[2]: *** [ffmpeg_decode.o] Error 1

Attachments (1)

main.log (387.5 KB) - added by mf2k (Frank Schima) 11 years ago.

Download all attachments as: .zip

Change History (7)

Changed 11 years ago by mf2k (Frank Schima)

Attachment: main.log added

comment:1 Changed 11 years ago by dbevans (David B. Evans)

This is due to the removal of long deprecated API features in the ffmpeg 2.0 series: AVCODEC_MAX_AUDIO_FRAME_SIZE has been removed. Looks like there are fixes for this in upstream svn or possibly you could configure gpac to use the embedded ffmpeg copy.

comment:2 Changed 11 years ago by mf2k (Frank Schima)

I attempted to use the embedded ffmpeg copy and it failed at the same place. Indeed, I still see AVCODEC_MAX_AUDIO_FRAME_SIZE is in the included ffmpeg.h.

Last edited 11 years ago by mf2k (Frank Schima) (previous) (diff)

comment:3 Changed 11 years ago by dbevans (David B. Evans)

I got the same result when I tried it just now.

I then deactivated ffmpeg and tried again. This got rid of the AVCODEC_MAX_AUDIO_FRAME_SIZE error. However, it then failed as follows:

cc -I/opt/local/include -O3  -arch x86_64 -Wall -fno-strict-aliasing -Wno-pointer-sign -fPIC -DPIC -fvisibility="hidden" -DGPAC_HAVE_CONFIG_H -I"/opt/local/var/macports/build/_opt_macports_trunk_dports_multimedia_gpac/gpac/work/gpac" -Wno-deprecated-declarations -I"/opt/local/var/macports/build/_opt_macports_trunk_dports_multimedia_gpac/gpac/work/gpac/include"  -DFFMPEG_OLD_HEADERS -I/usr/include -I"/opt/local/var/macports/build/_opt_macports_trunk_dports_multimedia_gpac/gpac/work/gpac/extra_lib/include" -c -o ffmpeg_decode.o ffmpeg_decode.c 
In file included from ffmpeg_decode.c:25:
./ffmpeg_in.h:74:10: fatal error: 'ffmpeg/avformat.h' file not found
#include <ffmpeg/avformat.h>

Conclusions:

  • even though it's configured for the local ffmpeg copy it's using include files from the external one if it's installed due to the -I/opt/local/include at the beginning of the compile command
  • if external ffmpeg is deactivated it still isn't including the local .h files correctly (or worse they're not available)
  • note that the compile command is using 'cc' for the compiler. This is one of Ryan's UseTheRightCompiler problems (not related to ffmpeg).
Last edited 11 years ago by dbevans (David B. Evans) (previous) (diff)

comment:4 Changed 11 years ago by dbevans (David B. Evans)

Missing avformat.h is here:

extra_lib/include/libavformat/avformat.h

referenced here:

modules/ffmpeg_in/ffmpeg_in.h:#include <libavformat/avformat.h>
modules/redirect_av/ffmpeg_ts_muxer.c:#include <libavformat/avformat.h>

comment:5 Changed 11 years ago by mf2k (Frank Schima)

See also #40605 for mpd.

comment:6 Changed 11 years ago by dbevans (David B. Evans)

Resolution: fixed
Status: newclosed

Embedded libs seem hopeless so backported upstream ffmpeg fixes in r111823 plus some dependency and configuration issues.

Note: See TracTickets for help on using tickets.