Final set of changes for a working ffmpeg.
[sxemacs] / m4 / sxe-mm.m4
index 0caa1aa..92e873d 100644 (file)
@@ -332,33 +332,58 @@ AC_DEFUN([SXE_MM_CHECK_FFMPEG], [
        if test "$ac_cv_header_avformat_h" = "yes" -o \
                "$ac_cv_header_ffmpeg_avformat_h" = "yes" -o \
                "$ac_cv_header_libavformat_avformat_h" = "yes"; then
-               if test "$ac_cv_header_avcodec_h" = "yes" -o \
+               sxe_cv_feat_ffmpeg_headers="yes"
+       else
+               sxe_cv_feat_ffmpeg_headers="no"
+       fi
+
+       if test "$sxe_cv_feat_ffmpeg_headers" = "yes"; then
+               if test "$ac_cv_header_avcodec_h" = "yes" -o \
                         "$ac_cv_header_ffmpeg_avcodec_h" = "yes" -o \
                        "$ac_cv_header_libavcodec_avcodec_h" = "yes"; then
-                       if test "$ac_cv_header_ffmpeg_dict_h" = "yes" -o \
-                               "$ac_cv_header_libavutil_dict_h" = "yes"; then
-                               sxe_cv_feat_ffmpeg_headers="yes"
-                       fi
+                       sxe_cv_feat_ffmpeg_headers="yes"
+               else
+                       sxe_cv_feat_ffmpeg_headers="no"
                fi
        fi
 
-       ## make sure either decode_audio is there
-       if test "$ac_cv_lib_avcodec_avcodec_decode_audio4" = "yes"; then
-               sxe_cv_feat_ffmpeg_decoders="yes"
+       if test "$sxe_cv_feat_ffmpeg_headers" = "yes"; then
+               if test "$ac_cv_header_ffmpeg_dict_h" = "yes" -o \
+                       "$ac_cv_header_libavutil_dict_h" = "yes"; then
+                       sxe_cv_feat_ffmpeg_headers="yes"
+               else
+                       sxe_cv_feat_ffmpeg_headers="no"
+               fi
        fi
-       ## make sure this bloody av context allocator is there
-       if test "$ac_cv_lib_avformat_avformat_alloc_context" = "yes"; then
-               sxe_cv_feat_ffmpeg_avformat_alloc="yes"
+
+       if test "$sxe_cv_feat_ffmpeg_headers" = "yes"; then
+               if test "$ac_cv_header_ffmpeg_time_h" = "yes" -o \
+                       "$ac_cv_header_libavutil_time_h" = "yes"; then
+                       sxe_cv_feat_ffmpeg_headers="yes"
+               else
+                       sxe_cv_feat_ffmpeg_headers="no"
+               fi
        fi
+
+        ## make sure either decode_audio is there
+       if test "$ac_cv_lib_avcodec_avcodec_decode_audio" = "yes" -o \
+               "$ac_cv_lib_avcodec_avcodec_decode_audio2" = "yes" -o \
+               "$ac_cv_lib_avcodec_avcodec_decode_audio3" = "yes"; then
+               sxe_cv_feat_ffmpeg_decoders="yes"
+       fi
+
        if test "$sxe_cv_feat_ffmpeg_headers" = "yes" -a \
                "$sxe_cv_feat_ffmpeg_decoders" = "yes" -a \
-               "$sxe_cv_feat_ffmpeg_avformat_alloc" = "yes" -a \
+               "$ac_cv_lib_avformat_avformat_alloc_context" = "yes" -a \
+               "$ac_cv_lib_avformat_avformat_free_context" = "yes" -a \
                "$ac_cv_lib_avformat_avio_alloc_context" = "yes" -a \
                "$ac_cv_lib_avformat_avio_size" = "yes" -a \
+               "$ac_cv_lib_avformat_avio_feof" = "yes" -a \
                "$ac_cv_lib_avformat_avformat_open_input" = "yes" -a \
                "$ac_cv_lib_avformat_avformat_close_input" = "yes" -a \
                "$ac_cv_lib_avformat_avformat_find_stream_info" = "yes" -a \
                "$ac_cv_lib_avformat_av_probe_input_format" = "yes" -a \
+               "$ac_cv_lib_avformat_av_iformat_next" = "yes" -a \
                "$ac_cv_lib_avformat_av_read_frame" = "yes" -a \
                "$ac_cv_lib_avformat_av_seek_frame" = "yes" -a \
                "$ac_cv_lib_avformat_av_register_all" = "yes" -a \
@@ -390,8 +415,10 @@ AC_DEFUN([SXE_CHECK_FFMPEG_HEADERS], [dnl
        SXE_DUMP_LIBS
        CPPFLAGS="${CPPFLAGS} ${FFMPEG_CPPFLAGS}"
        AC_CHECK_HEADERS([avformat.h avcodec.h])
-       AC_CHECK_HEADERS([ffmpeg/avformat.h ffmpeg/avcodec.h ffmpeg/dict.h])
-       AC_CHECK_HEADERS([libavformat/avformat.h libavcodec/avcodec.h libavutil/dict.h])
+       AC_CHECK_HEADERS([ffmpeg/avformat.h ffmpeg/avcodec.h])
+       AC_CHECK_HEADERS([ffmpeg/dict.h ffmpeg/time.h])
+       AC_CHECK_HEADERS([libavformat/avformat.h libavcodec/avcodec.h])
+       AC_CHECK_HEADERS([libavutil/dict.h libavutil/time.h])
 
        ## restore configuration
        SXE_RESTORE_LIBS
@@ -408,22 +435,44 @@ AC_DEFUN([SXE_CHECK_FFMPEG_LIBS], [dnl
 
        AC_CHECK_LIB([avcodec], [avcodec_find_decoder], [:], [:], [${FFMPEG_LIBS}])
        AC_CHECK_LIB([avcodec], [avcodec_open2], [:], [:], [${FFMPEG_LIBS}])
+       AC_CHECK_LIB([avcodec], [avcodec_decode_audio], [:], [:], [${FFMPEG_LIBS}])
+       AC_CHECK_LIB([avcodec], [avcodec_decode_audio2], [:], [:], [${FFMPEG_LIBS}])
+       AC_CHECK_LIB([avcodec], [avcodec_decode_audio3], [:], [:], [${FFMPEG_LIBS}])
        AC_CHECK_LIB([avcodec], [avcodec_decode_audio4], [:], [:], [${FFMPEG_LIBS}])
 
        AC_CHECK_LIB([avformat], [avformat_open_input], [:], [:], [${FFMPEG_LIBS}])
        AC_CHECK_LIB([avformat], [avformat_close_input], [:], [:], [${FFMPEG_LIBS}])
        AC_CHECK_LIB([avformat], [avformat_find_stream_info], [:], [:], [${FFMPEG_LIBS}])
+       AC_CHECK_LIB([avformat], [av_iformat_next], [:], [:], [${FFMPEG_LIBS}])
        AC_CHECK_LIB([avformat], [av_probe_input_format], [:], [:], [${FFMPEG_LIBS}])
        AC_CHECK_LIB([avformat], [av_read_frame], [:], [:], [${FFMPEG_LIBS}])
        AC_CHECK_LIB([avformat], [av_seek_frame], [:], [:], [${FFMPEG_LIBS}])
        AC_CHECK_LIB([avformat], [av_register_all], [:], [:], [${FFMPEG_LIBS}])
        AC_CHECK_LIB([avformat], [av_dump_format], [:], [:], [${FFMPEG_LIBS}])
        AC_CHECK_LIB([avformat], [avformat_alloc_context], [:], [:], [${FFMPEG_LIBS}])
+       AC_CHECK_LIB([avformat], [avformat_free_context], [:], [:], [${FFMPEG_LIBS}])
        AC_CHECK_LIB([avformat], [avio_alloc_context], [:], [:], [${FFMPEG_LIBS}])
        AC_CHECK_LIB([avformat], [avio_size], [:], [:], [${FFMPEG_LIBS}])
+       AC_CHECK_LIB([avformat], [avio_feof], [:], [:], [${FFMPEG_LIBS}])
 
        AC_CHECK_LIB([avutil], [av_dict_get], [:], [:], [${FFMPEG_LIBS}])
 
+       if test "$ac_cv_lib_avcodec_avcodec_decode_audio" = "yes"; then
+               AC_DEFINE([HAVE_AVCODEC_DECODE_AUDIO], [1],
+                         [Define to 1 if avcodec_decode_audio is usable.])
+       fi
+       if test "$ac_cv_lib_avcodec_avcodec_decode_audio2" = "yes"; then
+               AC_DEFINE([HAVE_AVCODEC_DECODE_AUDIO2], [1],
+                         [Define to 1 if avcodec_decode_audio2 is usable.])
+       fi
+       if test "$ac_cv_lib_avcodec_avcodec_decode_audio3" = "yes"; then
+               AC_DEFINE([HAVE_AVCODEC_DECODE_AUDIO3], [1],
+                         [Define to 1 if avcodec_decode_audio is usable.])
+       fi
+       if test "$ac_cv_lib_avcodec_avcodec_decode_audio4" = "yes"; then
+               AC_DEFINE([HAVE_AVCODEC_DECODE_AUDIO4], [1],
+                         [Define to 1 if avcodec_decode_audio is usable.])
+       fi
 
        ## restore configuration
        SXE_RESTORE_LIBS