pjsip / pjproject

PJSIP project
http://www.pjsip.org
GNU General Public License v2.0
2.05k stars 780 forks source link

AVPixelFormat not Found #4046

Closed khaledJanky closed 2 months ago

khaledJanky commented 2 months ago

Describe the bug

when I try to build with pjsip with ffmpeg static library config shows no AVPixelFormat

configure commend:

 ./configure-iphone \
 --with-ssl=/Users/imac16m21/Desktop/buildContainer/OpenSSL\
 --with-opus=/Users/imac16m21/Desktop/buildContainer/opus \
--with-ffmpeg=/Users/imac16m21/Desktop/buildContainer/ffmpeg_output

output:

checking for pkg-config... pkg-config
checking ffmpeg packages...  libavdevice libavformat libavcodec libswscale libavutil
checking for enum AVPixelFormat... no

and build fails with this error

../src/pjmedia/converter_libswscale.c:80:24: error: variable has incomplete type 'enum PixelFormat'
    enum AVPixelFormat srcFormat, dstFormat;
                       ^
../src/pjmedia/converter_libswscale.c:80:10: note: forward declaration of 'enum PixelFormat'
    enum AVPixelFormat srcFormat, dstFormat;
         ^
../src/pjmedia/ffmpeg_util.h:41:33: note: expanded from macro 'AVPixelFormat'
#   define AVPixelFormat        PixelFormat
                                ^
../src/pjmedia/converter_libswscale.c:80:35: error: variable has incomplete type 'enum PixelFormat'
    enum AVPixelFormat srcFormat, dstFormat;

this maybe related to an issue ffmpeg: 7.0.2 pjsip 2.14.1

Steps to reproduce

 ./configure-iphone \
 --with-ssl=/Users/imac16m21/Desktop/buildContainer/OpenSSL\
 --with-opus=/Users/imac16m21/Desktop/buildContainer/opus \
--with-ffmpeg=/Users/imac16m21/Desktop/buildContainer/ffmpeg_output

make dep make clean make

PJSIP version

2.14.1

Context

build on MacOS Mac mini M2 iOS 17.4

config_site Contains:

#define PJ_CONFIG_IPHONE 1
#define PJ_HAS_SSL_SOCK 1
#define PJSIP_HAS_TLS_TRANSPORT 1
#define PJMEDIA_HAS_VIDEO 1
#define PJMEDIA_HAS_FFMPEG_VID_CODEC 1
#define PJMEDIA_VIDEO_DEV_HAS_OPENGL 1
#define PJMEDIA_VIDEO_DEV_HAS_OPENGL_ES 1
#define PJMEDIA_VIDEO_DEV_HAS_IOS_OPENGL 1
#include <pj/config_site_sample.h>

ffmpeg_output contains: ├── include │   ├── libavcodec │   │   ├── ac3_parser.h │   │   ├── adts_parser.h │   │   ├── avcodec.h │   │   ├── avdct.h │   │   ├── avfft.h │   │   ├── bsf.h │   │   ├── codec.h │   │   ├── codec_desc.h │   │   ├── codec_id.h │   │   ├── codec_par.h │   │   ├── d3d11va.h │   │   ├── defs.h │   │   ├── dirac.h │   │   ├── dv_profile.h │   │   ├── dxva2.h │   │   ├── jni.h │   │   ├── mediacodec.h │   │   ├── packet.h │   │   ├── qsv.h │   │   ├── vdpau.h │   │   ├── version.h │   │   ├── version_major.h │   │   ├── videotoolbox.h │   │   └── vorbis_parser.h │   ├── libavdevice │   │   ├── avdevice.h │   │   ├── version.h │   │   └── version_major.h │   ├── libavfilter │   │   ├── avfilter.h │   │   ├── buffersink.h │   │   ├── buffersrc.h │   │   ├── version.h │   │   └── version_major.h │   ├── libavformat │   │   ├── avformat.h │   │   ├── avio.h │   │   ├── version.h │   │   └── version_major.h │   ├── libavutil │   │   ├── adler32.h │   │   ├── aes.h │   │   ├── aes_ctr.h │   │   ├── ambient_viewing_environment.h │   │   ├── attributes.h │   │   ├── audio_fifo.h │   │   ├── avassert.h │   │   ├── avconfig.h │   │   ├── avstring.h │   │   ├── avutil.h │   │   ├── base64.h │   │   ├── blowfish.h │   │   ├── bprint.h │   │   ├── bswap.h │   │   ├── buffer.h │   │   ├── camellia.h │   │   ├── cast5.h │   │   ├── channel_layout.h │   │   ├── common.h │   │   ├── cpu.h │   │   ├── crc.h │   │   ├── csp.h │   │   ├── des.h │   │   ├── detection_bbox.h │   │   ├── dict.h │   │   ├── display.h │   │   ├── dovi_meta.h │   │   ├── downmix_info.h │   │   ├── encryption_info.h │   │   ├── error.h │   │   ├── eval.h │   │   ├── executor.h │   │   ├── ffversion.h │   │   ├── fifo.h │   │   ├── file.h │   │   ├── film_grain_params.h │   │   ├── frame.h │   │   ├── hash.h │   │   ├── hdr_dynamic_metadata.h │   │   ├── hdr_dynamic_vivid_metadata.h │   │   ├── hmac.h │   │   ├── hwcontext.h │   │   ├── hwcontext_cuda.h │   │   ├── hwcontext_d3d11va.h │   │   ├── hwcontext_d3d12va.h │   │   ├── hwcontext_drm.h │   │   ├── hwcontext_dxva2.h │   │   ├── hwcontext_mediacodec.h │   │   ├── hwcontext_opencl.h │   │   ├── hwcontext_qsv.h │   │   ├── hwcontext_vaapi.h │   │   ├── hwcontext_vdpau.h │   │   ├── hwcontext_videotoolbox.h │   │   ├── hwcontext_vulkan.h │   │   ├── iamf.h │   │   ├── imgutils.h │   │   ├── intfloat.h │   │   ├── intreadwrite.h │   │   ├── lfg.h │   │   ├── log.h │   │   ├── lzo.h │   │   ├── macros.h │   │   ├── mastering_display_metadata.h │   │   ├── mathematics.h │   │   ├── md5.h │   │   ├── mem.h │   │   ├── motion_vector.h │   │   ├── murmur3.h │   │   ├── opt.h │   │   ├── parseutils.h │   │   ├── pixdesc.h │   │   ├── pixelutils.h │   │   ├── pixfmt.h │   │   ├── random_seed.h │   │   ├── rational.h │   │   ├── rc4.h │   │   ├── replaygain.h │   │   ├── ripemd.h │   │   ├── samplefmt.h │   │   ├── sha.h │   │   ├── sha512.h │   │   ├── spherical.h │   │   ├── stereo3d.h │   │   ├── tea.h │   │   ├── threadmessage.h │   │   ├── time.h │   │   ├── timecode.h │   │   ├── timestamp.h │   │   ├── tree.h │   │   ├── twofish.h │   │   ├── tx.h │   │   ├── uuid.h │   │   ├── version.h │   │   ├── video_enc_params.h │   │   ├── video_hint.h │   │   └── xtea.h │   ├── libpostproc │   │   ├── postprocess.h │   │   ├── version.h │   │   └── version_major.h │   ├── libswresample │   │   ├── swresample.h │   │   ├── version.h │   │   └── version_major.h │   ├── libswscale │   │   ├── swscale.h │   │   ├── version.h │   │   └── version_major.h │   └── libx264 │   ├── x264.h │   └── x264_config.h ├── lib │   ├── libavcodec.a │   ├── libavdevice.a │   ├── libavfilter.a │   ├── libavformat.a │   ├── libavutil.a │   ├── libpostproc.a │   ├── libswresample.a │   ├── libswscale.a │   ├── libx264.a │   └── pkgconfig │   ├── libavcodec.pc │   ├── libavdevice.pc │   ├── libavfilter.pc │   ├── libavformat.pc │   ├── libavutil.pc │   ├── libpostproc.pc │   ├── libswresample.pc │   └── libswscale.pc └── share └── ffmpeg └── examples ├── Makefile ├── README ├── avio_http_serve_files.c ├── avio_list_dir.c ├── avio_read_callback.c ├── decode_audio.c ├── decode_filter_audio.c ├── decode_filter_video.c ├── decode_video.c ├── demux_decode.c ├── encode_audio.c ├── encode_video.c ├── extract_mvs.c ├── filter_audio.c ├── hw_decode.c ├── mux.c ├── qsv_decode.c ├── qsv_transcode.c ├── remux.c ├── resample_audio.c ├── scale_video.c ├── show_metadata.c ├── transcode.c ├── transcode_aac.c ├── vaapi_encode.c └── vaapi_transcode.c

Log, call stack, etc

../src/pjmedia/converter_libswscale.c:80:24: error: variable has incomplete type 'enum PixelFormat'
    enum AVPixelFormat srcFormat, dstFormat;
                       ^
../src/pjmedia/converter_libswscale.c:80:10: note: forward declaration of 'enum PixelFormat'
    enum AVPixelFormat srcFormat, dstFormat;
         ^
../src/pjmedia/ffmpeg_util.h:41:33: note: expanded from macro 'AVPixelFormat'
#   define AVPixelFormat        PixelFormat
                                ^
../src/pjmedia/converter_libswscale.c:80:35: error: variable has incomplete type 'enum PixelFormat'
    enum AVPixelFormat srcFormat, dstFormat;
sauwming commented 2 months ago

Try with the supported version https://github.com/pjsip/pjproject/pull/3242

khaledJanky commented 2 months ago

tried it but have the same output in both configure and make can the issue related to my latest iOS SDK iPhoneOS17.4.sdk not supported?

this is some another log related to issue:

/Users/imac16m21/Desktop/buildContainer/ffmpeg_output/include/libswscale/swscale.h:129:31: warning: declaration of 'enum PixelFormat' will not be visible outside of this function [-Wvisibility]
int sws_isSupportedInput(enum AVPixelFormat pix_fmt);
                              ^
../src/pjmedia/ffmpeg_util.h:41:33: note: expanded from macro 'AVPixelFormat'
#   define AVPixelFormat        PixelFormat
                                ^
In file included from ../src/pjmedia/converter_libswscale.c:25:
/Users/imac16m21/Desktop/buildContainer/ffmpeg_output/include/libswscale/swscale.h:135:32: warning: declaration of 'enum PixelFormat' will not be visible outside of this function [-Wvisibility]
int sws_isSupportedOutput(enum AVPixelFormat pix_fmt);
                               ^
../src/pjmedia/ffmpeg_util.h:41:33: note: expanded from macro 'AVPixelFormat'
#   define AVPixelFormat        PixelFormat
                                ^
In file included from ../src/pjmedia/converter_libswscale.c:25:
/Users/imac16m21/Desktop/buildContainer/ffmpeg_output/include/libswscale/swscale.h:142:46: warning: declaration of 'enum PixelFormat' will not be visible outside of this function [-Wvisibility]
int sws_isSupportedEndiannessConversion(enum AVPixelFormat pix_fmt);
                                             ^
../src/pjmedia/ffmpeg_util.h:41:33: note: expanded from macro 'AVPixelFormat'
#   define AVPixelFormat        PixelFormat
                                ^
In file included from ../src/pjmedia/converter_libswscale.c:25:
/Users/imac16m21/Desktop/buildContainer/ffmpeg_output/include/libswscale/swscale.h:187:60: warning: declaration of 'enum PixelFormat' will not be visible outside of this function [-Wvisibility]
struct SwsContext *sws_getContext(int srcW, int srcH, enum AVPixelFormat srcFormat,
                                                           ^
../src/pjmedia/ffmpeg_util.h:41:33: note: expanded from macro 'AVPixelFormat'
#   define AVPixelFormat        PixelFormat
                                ^
In file included from ../src/pjmedia/converter_libswscale.c:25:
/Users/imac16m21/Desktop/buildContainer/ffmpeg_output/include/libswscale/swscale.h:384:66: warning: declaration of 'enum PixelFormat' will not be visible outside of this function [-Wvisibility]
                                        int srcW, int srcH, enum AVPixelFormat srcFormat,
                                                                 ^
../src/pjmedia/ffmpeg_util.h:41:33: note: expanded from macro 'AVPixelFormat'
#   define AVPixelFormat        PixelFormat
                                ^
../src/pjmedia/converter_libswscale.c:80:24: error: variable has incomplete type 'enum PixelFormat'
    enum AVPixelFormat srcFormat, dstFormat;
                       ^
../src/pjmedia/converter_libswscale.c:80:10: note: forward declaration of 'enum PixelFormat'
    enum AVPixelFormat srcFormat, dstFormat;
         ^
../src/pjmedia/ffmpeg_util.h:41:33: note: expanded from macro 'AVPixelFormat'
#   define AVPixelFormat        PixelFormat
                                ^
../src/pjmedia/converter_libswscale.c:80:35: error: variable has incomplete type 'enum PixelFormat'
    enum AVPixelFormat srcFormat, dstFormat;
                                  ^
../src/pjmedia/converter_libswscale.c:80:10: note: forward declaration of 'enum PixelFormat'
    enum AVPixelFormat srcFormat, dstFormat;
         ^
../src/pjmedia/ffmpeg_util.h:41:33: note: expanded from macro 'AVPixelFormat'
#   define AVPixelFormat        PixelFormat
sauwming commented 2 months ago

It has nothing to do with iOS SDK. You can try the suggested solution in issue #2605 that you referred.

Alternatively, iOS doesn't need ffmpeg, so not sure why you want that. https://docs.pjsip.org/en/latest/get-started/ios/index.html