| 2996 | | dnl ffmpeg decoder/demuxer plugin |
|---|
| 2997 | | dnl |
|---|
| 2998 | | dnl we try to find ffmpeg using : 1- given tree, 2- pkg-config |
|---|
| 2999 | | dnl 3- default place, |
|---|
| 3000 | | |
|---|
| 3001 | | AC_ARG_ENABLE(ffmpeg, |
|---|
| 3002 | | [ --enable-ffmpeg ffmpeg codec (default enabled)]) |
|---|
| 3003 | | if test "${enable_ffmpeg}" != "no" |
|---|
| 3004 | | then |
|---|
| 3005 | | |
|---|
| 3006 | | dnl Trying with pkg-config |
|---|
| 3007 | | PKG_CHECK_MODULES(FFMPEG,[libavcodec, libavformat, libavutil], |
|---|
| | 2996 | dnl avcodec decoder/encoder plugin |
|---|
| | 2997 | dnl |
|---|
| | 2998 | |
|---|
| | 2999 | AC_ARG_ENABLE(avcodec, |
|---|
| | 3000 | [ --enable-avcodec libavcodec codec (default enabled)]) |
|---|
| | 3001 | if test "${enable_avcodec}" != "no" |
|---|
| | 3002 | then |
|---|
| | 3003 | PKG_CHECK_MODULES(AVCODEC,[libavcodec, libavutil], |
|---|
| 3009 | | VLC_SAVE_FLAGS |
|---|
| 3010 | | CPPFLAGS="${CPPFLAGS} ${FFMPEG_CFLAGS}" |
|---|
| 3011 | | CFLAGS="${CFLAGS} ${FFMPEG_CFLAGS}" |
|---|
| 3012 | | AC_CHECK_HEADERS(ffmpeg/avcodec.h libavcodec/avcodec.h) |
|---|
| 3013 | | AC_CHECK_HEADERS(ffmpeg/avformat.h libavformat/avformat.h) |
|---|
| 3014 | | AC_CHECK_HEADERS(ffmpeg/avutil.h libavutil/avutil.h) |
|---|
| 3015 | | dnl newer ffmpeg have a separate libpostproc |
|---|
| 3016 | | PKG_CHECK_MODULES(POSTPROC, libpostproc,[ |
|---|
| 3017 | | VLC_ADD_CFLAGS([ffmpeg],[${POSTPROC_CFLAGS}]) |
|---|
| 3018 | | VLC_ADD_LIBS([ffmpeg],[${POSTPROC_LIBS}]) |
|---|
| 3019 | | ]) |
|---|
| 3020 | | CPPFLAGS="${CPPFLAGS} ${POSTPROC_CFLAGS}" |
|---|
| 3021 | | CFLAGS="${CFLAGS} ${POSTPROC_CFLAGS}" |
|---|
| 3022 | | AC_CHECK_HEADERS(postproc/postprocess.h) |
|---|
| 3023 | | VLC_ADD_PLUGIN([ffmpeg]) |
|---|
| 3024 | | if test "${enable_sout}" != "no" -a "${enable_switcher}" = "yes"; then |
|---|
| 3025 | | VLC_ADD_PLUGIN([stream_out_switcher]) |
|---|
| 3026 | | fi |
|---|
| 3027 | | VLC_ADD_CFLAGS([ffmpeg stream_out_switcher],[${FFMPEG_CFLAGS}]) |
|---|
| 3028 | | VLC_ADD_LIBS([ffmpeg stream_out_switcher],[${FFMPEG_LIBS}]) |
|---|
| 3029 | | |
|---|
| 3030 | | dnl even newer ffmpeg has a libswscale |
|---|
| 3031 | | PKG_CHECK_MODULES(SWSCALE,[libswscale],[ |
|---|
| 3032 | | VLC_ADD_CFLAGS([ffmpeg],[${SWSCALE_CFLAGS}]) |
|---|
| 3033 | | VLC_ADD_LIBS([ffmpeg],[${SWSCALE_LIBS}]) |
|---|
| 3034 | | AC_CHECK_LIB(swscale, sws_getContext, |
|---|
| 3035 | | [AC_CHECK_HEADERS([ffmpeg/swscale.h libswscale/swscale.h])], |
|---|
| 3036 | | [AC_CHECK_LIB(avcodec,img_resample,[], |
|---|
| 3037 | | [AC_MSG_ERROR([Your FFmpeg library doesn't have the needed img_resample() function. You should rebuild it with software scaler disabled, or install the swscale headers.])], |
|---|
| 3038 | | [${FFMPEG_LIBS}]) |
|---|
| 3039 | | ], |
|---|
| 3040 | | [${SWSCALE_LIBS}]) |
|---|
| 3041 | | ],[AC_CHECK_LIB(avcodec,img_resample,[], |
|---|
| 3042 | | [AC_MSG_ERROR([Your FFmpeg library doesn't have the needed img_resample() function. You should rebuild it with software scaler disabled, or install the swscale headers.])], |
|---|
| 3043 | | [${FFMPEG_LIBS}]) |
|---|
| 3044 | | ] |
|---|
| 3045 | | ) |
|---|
| 3046 | | VLC_RESTORE_FLAGS |
|---|
| 3047 | | |
|---|
| 3048 | | ],[ |
|---|
| 3049 | | |
|---|
| 3050 | | dnl |
|---|
| 3051 | | dnl last chance: at the default place |
|---|
| 3052 | | dnl |
|---|
| 3054 | | CPPFLAGS="${CPPFLAGS_save} ${CPPFLAGS_ffmpeg}" |
|---|
| 3055 | | LDFLAGS="${LDFLAGS_save} ${LDFLAGS_ffmpeg} ${LIBS_ffmpeg}" |
|---|
| 3056 | | AC_CHECK_HEADERS(ffmpeg/avcodec.h libavcodec/avcodec.h) |
|---|
| 3057 | | AC_CHECK_HEADERS(ffmpeg/avformat.h libavformat/avformat.h) |
|---|
| 3058 | | AC_CHECK_HEADERS(ffmpeg/avutil.h libavutil/avutil.h) |
|---|
| 3059 | | AC_CHECK_HEADERS(postproc/postprocess.h) |
|---|
| 3060 | | |
|---|
| 3061 | | AC_CHECK_LIB(avutil, av_crc_init, [ |
|---|
| 3062 | | VLC_ADD_LIBS([ffmpeg],[-lavutil]) |
|---|
| 3063 | | LDAVUTIL="-lavutil"]) |
|---|
| 3064 | | |
|---|
| 3065 | | AC_CHECK_LIB(avcodec, avcodec_init, [ |
|---|
| 3066 | | VLC_ADD_BUILTINS([ffmpeg]) |
|---|
| 3067 | | VLC_ADD_LIBS([ffmpeg],[-lavcodec]) |
|---|
| 3068 | | if test "${enable_sout}" != "no" -a "${enable_switcher}" = "yes"; then |
|---|
| 3069 | | VLC_ADD_BUILTINS([stream_out_switcher]) |
|---|
| 3070 | | fi], |
|---|
| 3071 | | [ AC_MSG_ERROR([Could not find ffmpeg on your system: you may get it from http://ffmpeg.sf.net/ (svn version is recommended). Alternatively you can use --disable-ffmpeg to disable the ffmpeg plugins.]) ], [$LDAVUTIL]) |
|---|
| 3072 | | |
|---|
| 3073 | | AC_CHECK_LIB(postproc, pp_postprocess, [ |
|---|
| 3074 | | VLC_ADD_LIBS([ffmpeg],[-lpostproc])], |
|---|
| 3075 | | AC_MSG_ERROR([Could not find libpostproc inside FFmpeg. You should configure FFmpeg with --enable-gpl --enable-postproc.]), |
|---|
| 3076 | | [$LDAVUTIL]) |
|---|
| 3077 | | |
|---|
| 3078 | | AC_CHECK_LIB(avformat, av_open_input_stream, [ |
|---|
| 3079 | | VLC_ADD_LIBS([ffmpeg],[-lavformat -lz]) ], [], [-lavcodec -lz $LDAVUTIL]) |
|---|
| | 3006 | CPPFLAGS="${CPPFLAGS} ${AVCODEC_CFLAGS}" |
|---|
| | 3007 | CFLAGS="${CFLAGS} ${AVCODEC_CFLAGS}" |
|---|
| | 3008 | AC_CHECK_HEADERS(libavcodec/avcodec.h ffmpeg/avcodec.h) |
|---|
| | 3009 | AC_CHECK_HEADERS(libavutil/avutil.h ffmpeg/avutil.h) |
|---|
| | 3010 | VLC_ADD_PLUGIN([avcodec]) |
|---|
| | 3011 | VLC_ADD_LIBS([avcodec],[$AVCODEC_LIBS]) |
|---|
| | 3012 | VLC_ADD_CFLAGS([avcodec],[$AVCODEC_CFLAGS]) |
|---|
| 3081 | | |
|---|
| 3082 | | AC_CHECK_LIB(swscale, sws_getContext, [ |
|---|
| 3083 | | AC_CHECK_HEADERS(ffmpeg/swscale.h libswscale/swscale.h) |
|---|
| 3084 | | VLC_ADD_LIBS([ffmpeg],[-lswscale]) ], |
|---|
| 3085 | | [AC_CHECK_LIB(avcodec,img_resample,[], |
|---|
| 3086 | | [AC_MSG_ERROR([Your FFmpeg library doesn't have the needed img_resample() function. You should rebuild it with software scaler disabled, or install the swscale headers.])], |
|---|
| 3087 | | [-lavcodec $LDAVUTIL]) |
|---|
| 3088 | | ], |
|---|
| 3089 | | [${SWSCALE_LIBS}]) |
|---|
| 3090 | | |
|---|
| | 3014 | ],[ |
|---|
| | 3015 | AC_MSG_ERROR([Could not find libavcodec or libavutil.]) |
|---|
| | 3016 | ]) |
|---|
| | 3017 | fi |
|---|
| | 3018 | |
|---|
| | 3019 | dnl |
|---|
| | 3020 | dnl avformat demuxer/muxer plugin |
|---|
| | 3021 | dnl |
|---|
| | 3022 | |
|---|
| | 3023 | AC_ARG_ENABLE(avformat, |
|---|
| | 3024 | [ --enable-avformat libavformat containers (default enabled)]) |
|---|
| | 3025 | if test "${enable_avformat}" != "no" |
|---|
| | 3026 | then |
|---|
| | 3027 | PKG_CHECK_MODULES(AVFORMAT,[libavformat, libavcodec, libavutil], |
|---|
| | 3028 | [ |
|---|
| | 3029 | VLC_SAVE_FLAGS |
|---|
| | 3030 | CPPFLAGS="${CPPFLAGS} ${AVFORMAT_CFLAGS}" |
|---|
| | 3031 | CFLAGS="${CFLAGS} ${AVFORMAT_CFLAGS}" |
|---|
| | 3032 | AC_CHECK_HEADERS(libavformat/avformat.h ffmpeg/avformat.h) |
|---|
| | 3033 | AC_CHECK_HEADERS(libavcodec/avcodec.h ffmpeg/avcodec.h) |
|---|
| | 3034 | AC_CHECK_HEADERS(libavutil/avutil.h ffmpeg/avutil.h) |
|---|
| | 3035 | VLC_ADD_PLUGIN([avformat]) |
|---|
| | 3036 | VLC_ADD_LIBS([avformat],[$AVFORMAT_LIBS]) |
|---|
| | 3037 | VLC_ADD_CFLAGS([avformat],[$AVFORMAT_CFLAGS]) |
|---|
| | 3039 | ],[ |
|---|
| | 3040 | AC_MSG_ERROR([Could not find libavformat, libavcodec or libavutil.]) |
|---|
| | 3041 | ]) |
|---|
| | 3042 | fi |
|---|
| | 3043 | |
|---|
| | 3044 | dnl |
|---|
| | 3045 | dnl swscale image scaling and conversion plugin |
|---|
| | 3046 | dnl |
|---|
| | 3047 | |
|---|
| | 3048 | AC_ARG_ENABLE(swscale, |
|---|
| | 3049 | [ --enable-swscale libswscale image scaling and conversion (default enabled)]) |
|---|
| | 3050 | if test "${enable_swscale}" != "no" |
|---|
| | 3051 | then |
|---|
| | 3052 | PKG_CHECK_MODULES(SWSCALE,[libswscale, libavutil], |
|---|
| | 3053 | [ |
|---|
| | 3054 | VLC_SAVE_FLAGS |
|---|
| | 3055 | CPPFLAGS="${CPPFLAGS} ${SWSCALE_CFLAGS}" |
|---|
| | 3056 | CFLAGS="${CFLAGS} ${SWSCALE_CFLAGS}" |
|---|
| | 3057 | AC_CHECK_HEADERS(libswscale/swscale.h ffmpeg/swscale.h) |
|---|
| | 3058 | AC_CHECK_HEADERS(libavutil/avutil.h ffmpeg/avutil.h) |
|---|
| | 3059 | VLC_ADD_PLUGIN([swscale]) |
|---|
| | 3060 | VLC_ADD_LIBS([swscale],[$SWSCALE_LIBS]) |
|---|
| | 3061 | VLC_ADD_CFLAGS([swscale],[$SWSCALE_CFLAGS]) |
|---|
| | 3062 | VLC_RESTORE_FLAGS |
|---|
| | 3063 | ],[ |
|---|
| | 3064 | AC_MSG_ERROR([Could not find libswscale or libavutil.]) |
|---|
| | 3065 | ]) |
|---|
| | 3066 | fi |
|---|
| | 3067 | |
|---|
| | 3068 | dnl |
|---|
| | 3069 | dnl postproc plugin |
|---|
| | 3070 | dnl |
|---|
| | 3071 | |
|---|
| | 3072 | AC_ARG_ENABLE(postproc, |
|---|
| | 3073 | [ --enable-postproc libpostproc image post-processing (default enabled)]) |
|---|
| | 3074 | if test "${enable_postproc}" != "no" |
|---|
| | 3075 | then |
|---|
| | 3076 | PKG_CHECK_MODULES(POSTPROC,[libpostproc], |
|---|
| | 3077 | [ |
|---|
| | 3078 | VLC_SAVE_FLAGS |
|---|
| | 3079 | CPPFLAGS="${CPPFLAGS} ${POSTPROC_CFLAGS}" |
|---|
| | 3080 | CFLAGS="${CFLAGS} ${POSTPROC_CFLAGS}" |
|---|
| | 3081 | AC_CHECK_HEADERS(libpostproc/postproc.h ffmpeg/postproc.h) |
|---|
| | 3082 | VLC_ADD_PLUGIN([postproc]) |
|---|
| | 3083 | VLC_ADD_LIBS([postproc],[$POSTPROC_LIBS]) |
|---|
| | 3084 | VLC_ADD_CFLAGS([postproc],[$POSTPROC_CFLAGS]) |
|---|
| | 3085 | VLC_RESTORE_FLAGS |
|---|
| | 3086 | ],[ |
|---|
| | 3087 | AC_MSG_ERROR([Could not find libpostproc.]) |
|---|