Changeset e00551fba283031fa8e4036eb044c640cfdb64be

Show
Ignore:
Timestamp:
02/29/08 01:46:50 (5 months ago)
Author:
Faustino Osuna <riquedafreak@videolan.org>
git-committer:
Faustino Osuna <riquedafreak@videolan.org> 1204246010 +0000
git-parent:

[1757993049ffe608cd538e2d43aad3cabb68385b]

git-author:
Faustino Osuna <riquedafreak@videolan.org> 1204246010 +0000
Message:

Detect and allow older versions of ffmpeg to be used in conjunction with VLC.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • configure.ac

    r9f3fa00 re00551f  
    30593059     CPPFLAGS="${CPPFLAGS} ${FFMPEG_CFLAGS}" 
    30603060     CFLAGS="${CFLAGS} ${FFMPEG_CFLAGS}" 
    3061      AC_CHECK_HEADERS(libavcodec/avcodec.h, [], [AC_MSG_ERROR([Missing header file libavcodec/avcodec.h.])] ) 
    3062      AC_CHECK_HEADERS(libavformat/avformat.h, [], [AC_MSG_ERROR([Missing header file libavformat/avformat.h.])] ) 
    3063      AC_CHECK_HEADERS(libavutil/avutil.h, [], [AC_MSG_ERROR([Missing header file libavutil/avutil.h.])] ) 
     3061     AC_CHECK_HEADERS(libavcodec/avcodec.h ffmpeg/avcodec.h) 
     3062     AC_CHECK_HEADERS(libavformat/avformat.h ffmpeg/avformat.h) 
     3063     AC_CHECK_HEADERS(libavutil/avutil.h ffmpeg/avformat.h) 
     3064      
    30643065     dnl newer ffmpeg have a separate libpostproc 
    30653066     PKG_CHECK_MODULES(POSTPROC, libpostproc,[ 
     
    30693070     CPPFLAGS="${CPPFLAGS} ${POSTPROC_CFLAGS}" 
    30703071     CFLAGS="${CFLAGS} ${POSTPROC_CFLAGS}" 
    3071      AC_CHECK_HEADERS(libpostproc/postprocess.h, [], [AC_MSG_ERROR([Missing header file libpostproc/postprocess.h.])]
     3072     AC_CHECK_HEADERS(postproc/postprocess.h
    30723073     if test "${SYS}" = "darwin"; then 
    30733074        VLC_ADD_BUILTINS([ffmpeg]) 
     
    30903091       VLC_ADD_LIBS([ffmpeg],[${SWSCALE_LIBS}]) 
    30913092       AC_CHECK_LIB(swscale, sws_getContext, 
    3092          [AC_CHECK_HEADERS([libavutil/avutil.h libswscale/swscale.h])],[],[-lavutil -lm]) 
     3093         [AC_CHECK_HEADERS([ffmpeg/avutil.h libavutil/avutil.h ffmpeg/swscale.h libswscale/swscale.h])],[],[-lavutil -lm]) 
    30933094       ],[ true ]) 
    30943095     VLC_RESTORE_FLAGS 
     
    31003101      CPPFLAGS="${CPPFLAGS_save} ${CPPFLAGS_ffmpeg}" 
    31013102      LDFLAGS="${LDFLAGS_save} ${LDFLAGS_ffmpeg} ${LIBS_ffmpeg}" 
    3102       AC_CHECK_HEADERS(libavcodec/avcodec.h, [], [AC_MSG_ERROR([Missing header file libavcodec/avcodec.h.])]
    3103       AC_CHECK_HEADERS(libavformat/avformat.h
    3104       AC_CHECK_HEADERS(libavutil/avutil.h
    3105       AC_CHECK_HEADERS(libpostproc/postprocess.h, [], [AC_MSG_ERROR([Missing header file libpostproc/postprocess.h.])]
     3103      AC_CHECK_HEADERS(libavcodec/avcodec.h ffmpeg/avcodec.h
     3104      AC_CHECK_HEADERS(libavformat/avformat.h ffmpeg/avformat.h
     3105      AC_CHECK_HEADERS(libavutil/avutil.h ffmpeg/avutil.h
     3106      AC_CHECK_HEADERS(postproc/postprocess.h
    31063107 
    31073108      AC_CHECK_LIB(avutil, av_crc_init, [ 
     
    31283129 
    31293130      AC_CHECK_LIB(swscale, sws_getContext, [ 
    3130         AC_CHECK_HEADERS(libswscale/swscale.h
     3131        AC_CHECK_HEADERS(libswscale/swscale.h ffmpeg/swscale.h
    31313132        VLC_ADD_LIBS([ffmpeg],[-lswscale]) ], [], [-lavcodec $LDAVUTIL]) 
    31323133      LDFLAGS="${LDFLAGS_save}" 
    31333134      CPPFLAGS="${CPPFLAGS_save}" 
    31343135    ]) 
     3136     
     3137    if test "$ac_cv_header_libavcodec_avcodec_h" = "no" && test "$ac_cv_header_ffmpeg_avcodec_h" = "no"; then 
     3138        AC_MSG_ERROR([Missing header file libavcodec/avcodec.h.]) 
     3139    fi 
     3140    if test "$ac_cv_header_libavformat_avformat_h" = "no" && test $"ac_cv_header_ffmpeg_avformat_h" = "no"; then 
     3141        AC_MSG_ERROR([Missing header file libavformat/avformat.h.]) 
     3142    fi 
     3143    if test "$ac_cv_header_libavutil_avutil_h" = "no" && test "$ac_cv_header_ffmpeg_avutil_h" = "no"; then 
     3144        AC_MSG_ERROR([Missing header file libavutil/avutil.h.]) 
     3145    fi 
     3146    if test "$ac_cv_header_libswscale_swscale_h" = "no" && test "$ac_cv_header_ffmpeg_swscale_h" = "no"; then 
     3147        AC_MSG_ERROR([Missing header file libswscale/swscale.h.]) 
     3148    fi 
    31353149  fi 
    31363150fi 
  • extras/buildsystem/cmake/config.h.cmake

    r9f3fa00 re00551f  
    8888#cmakedefine HAVE_FAAD_H 
    8989#cmakedefine HAVE_FCNTL_H 
     90#cmakedefine HAVE_FFMPEG_AVCODEC_H  
     91#cmakedefine HAVE_FFMPEG_AVFORMAT_H  
     92#cmakedefine HAVE_FFMPEG_AVUTIL_H  
     93#cmakedefine HAVE_FFMPEG_SWSCALE_H 
    9094#cmakedefine HAVE_LIBAVCODEC_AVCODEC_H 
    9195#cmakedefine HAVE_LIBAVFORMAT_AVFORMAT_H 
  • extras/buildsystem/cmake/include/config.cmake

    r9f3fa00 re00551f  
    452452  set( CMAKE_REQUIRED_FLAGS ${FFmpeg_CFLAGS} ) 
    453453 
    454   vlc_check_include_files (libavcodec/avcodec.h
    455   vlc_check_include_files (libavutil/avutil.h
    456   vlc_check_include_files (libswscale/swscale.h
     454  vlc_check_include_files (libavcodec/avcodec.h ffmpeg/avcodec.h
     455  vlc_check_include_files (libavutil/avutil.h ffmpeg/avutil.h
     456  vlc_check_include_files (libswscale/swscale.h ffmpeg/swscale.h
    457457   
    458458  check_include_files ("stdint.h;postproc/postprocess.h" HAVE_POSTPROC_POSTPROCESS_H) 
  • modules/codec/ffmpeg/audio.c

    r9f3fa00 re00551f  
    3636 
    3737/* ffmpeg header */ 
    38 #ifdef HAVE_LIBAVCODEC_AVCODEC_H 
     38#if defined(HAVE_LIBAVCODEC_AVCODEC_H) 
    3939#   include <libavcodec/avcodec.h> 
     40#elif defined(HAVE_FFMPEG_AVCODEC_H) 
     41#   include <ffmpeg/avcodec.h> 
    4042#else 
    4143#   include <avcodec.h> 
  • modules/codec/ffmpeg/chroma.c

    r9f3fa00 re00551f  
    3333#include <vlc_vout.h> 
    3434 
    35 #if defined(HAVE_LIBSWSCALE_SWSCALE_H) || defined(HAVE_LIBSWSCALE_TREE) 
     35#if defined(HAVE_LIBSWSCALE_SWSCALE_H) || defined(HAVE_FFMPEG_SWSCALE_H) || defined(HAVE_LIBSWSCALE_TREE) 
    3636#include <vlc_filter.h> 
    3737#endif 
    3838 
    3939/* ffmpeg header */ 
    40 #ifdef HAVE_LIBAVCODEC_AVCODEC_H 
     40#if defined(HAVE_LIBAVCODEC_AVCODEC_H) 
    4141#   include <libavcodec/avcodec.h> 
     42#elif defined(HAVE_FFMPEG_AVCODEC_H) 
     43#   include <ffmpeg/avcodec.h> 
    4244#else 
    4345#   include <avcodec.h> 
     
    4648#include "ffmpeg.h" 
    4749 
    48 #if !defined(HAVE_LIBSWSCALE_SWSCALE_H) && !defined(HAVE_LIBSWSCALE_TREE) 
     50#if !defined(HAVE_LIBSWSCALE_SWSCALE_H) && !defined(HAVE_FFMPEG_SWSCALE_H) && !defined(HAVE_LIBSWSCALE_TREE) 
    4951void E_(InitLibavcodec) ( vlc_object_t *p_object ); 
    5052static void ChromaConversion( vout_thread_t *, picture_t *, picture_t * ); 
     
    362364} 
    363365 
    364 #endif /* !defined(HAVE_LIBSWSCALE_SWSCALE_H) && !defined(HAVE_LIBSWSCALE_TREE) */ 
     366#endif /* !defined(HAVE_LIBSWSCALE_SWSCALE_H) && !defined(HAVE_FFMPEG_SWSCALE_H) && !defined(HAVE_LIBSWSCALE_TREE) */ 
  • modules/codec/ffmpeg/deinterlace.c

    r9f3fa00 re00551f  
    3636 
    3737/* ffmpeg header */ 
    38 #ifdef HAVE_LIBAVCODEC_AVCODEC_H 
     38#if defined(HAVE_LIBAVCODEC_AVCODEC_H) 
    3939#   include <libavcodec/avcodec.h> 
     40#elif defined(HAVE_FFMPEG_AVCODEC_H) 
     41#   include <ffmpeg/avcodec.h> 
    4042#else 
    4143#   include <avcodec.h> 
  • modules/codec/ffmpeg/demux.c

    r9f3fa00 re00551f  
    3737 
    3838/* ffmpeg header */ 
    39 #ifdef HAVE_LIBAVFORMAT_AVFORMAT_H 
     39#if defined(HAVE_LIBAVFORMAT_AVFORMAT_H) 
    4040#   include <libavformat/avformat.h> 
     41#elif defined(HAVE_FFMPEG_AVFORMAT_H) 
     42#   include <ffmpeg/avformat.h> 
    4143#elif defined(HAVE_LIBAVFORMAT_TREE) 
    4244#   include <avformat.h> 
     
    4850 
    4951/* Version checking */ 
    50 #if defined(HAVE_LIBAVFORMAT_AVFORMAT_H) || defined(HAVE_LIBAVFORMAT_TREE) 
     52#if defined(HAVE_LIBSWSCALE_SWSCALE_H) || defined(HAVE_FFMPEG_SWSCALE_H) || defined(HAVE_LIBSWSCALE_TREE) 
    5153 
    5254/***************************************************************************** 
  • modules/codec/ffmpeg/encoder.c

    r9f3fa00 re00551f  
    4242/* ffmpeg header */ 
    4343#define HAVE_MMX 1 
    44 #ifdef HAVE_LIBAVCODEC_AVCODEC_H 
     44#if defined(HAVE_LIBAVCODEC_AVCODEC_H) 
    4545#   include <libavcodec/avcodec.h> 
     46#elif defined(HAVE_FFMPEG_AVCODEC_H) 
     47#   include <ffmpeg/avcodec.h> 
    4648#else 
    4749#   include <avcodec.h> 
  • modules/codec/ffmpeg/ffmpeg.c

    r9f3fa00 re00551f  
    3535/* ffmpeg header */ 
    3636#define HAVE_MMX 1 
    37 #ifdef HAVE_LIBAVCODEC_AVCODEC_H 
     37#if defined(HAVE_LIBAVCODEC_AVCODEC_H) 
    3838#   include <libavcodec/avcodec.h> 
     39#elif defined(HAVE_FFMPEG_AVCODEC_H) 
     40#   include <ffmpeg/avcodec.h> 
    3941#else 
    4042#   include <avcodec.h> 
     
    7577static const char *enc_hq_list_text[] = { N_("rd"), N_("bits"), N_("simple") }; 
    7678 
    77 #if defined(HAVE_LIBSWSCALE_SWSCALE_H) || defined(HAVE_LIBSWSCALE_TREE) 
     79#if defined(HAVE_LIBSWSCALE_SWSCALE_H) || defined(HAVE_FFMPEG_SWSCALE_H) || defined(HAVE_LIBSWSCALE_TREE) 
    7880static int pi_mode_values[] = { 0, 1, 2, 4, 8, 5, 6, 9, 10 }; 
    7981static const char *ppsz_mode_descriptions[] = 
     
    197199                 ENC_CHROMA_ELIM_TEXT, ENC_CHROMA_ELIM_LONGTEXT, VLC_TRUE ); 
    198200 
    199 #if defined(HAVE_LIBAVFORMAT_AVFORMAT_H) || defined(HAVE_LIBAVFORMAT_TREE) 
     201#if defined(HAVE_LIBSWSCALE_SWSCALE_H) || defined(HAVE_FFMPEG_SWSCALE_H) || defined(HAVE_LIBSWSCALE_TREE) 
    200202    /* demux submodule */ 
    201203    add_submodule(); 
     
    213215#endif 
    214216 
    215 #if defined(HAVE_LIBSWSCALE_SWSCALE_H) || defined(HAVE_LIBSWSCALE_TREE) 
     217#if defined(HAVE_LIBSWSCALE_SWSCALE_H) || defined(HAVE_FFMPEG_SWSCALE_H) || defined(HAVE_LIBSWSCALE_TREE) 
    216218    /* video filter submodule */ 
    217219    add_submodule(); 
  • modules/codec/ffmpeg/mux.c

    r9f3fa00 re00551f  
    4646 
    4747/* Version checking */ 
    48 #if defined(HAVE_LIBAVFORMAT_AVFORMAT_H) || defined(HAVE_LIBAVFORMAT_TREE) 
     48#if defined(HAVE_LIBSWSCALE_SWSCALE_H) || defined(HAVE_FFMPEG_SWSCALE_H) || defined(HAVE_LIBSWSCALE_TREE) 
    4949 
    5050static const char *ppsz_mux_options[] = { 
  • modules/codec/ffmpeg/postprocess.c

    r9f3fa00 re00551f  
    3232 
    3333/* ffmpeg header */ 
    34 #ifdef HAVE_LIBAVCODEC_AVCODEC_H 
     34#if defined(HAVE_LIBAVCODEC_AVCODEC_H) 
    3535#   include <libavcodec/avcodec.h> 
     36#elif defined(HAVE_FFMPEG_AVCODEC_H) 
     37#   include <ffmpeg/avcodec.h> 
    3638#else 
    3739#   include <avcodec.h> 
  • modules/codec/ffmpeg/scale.c

    r9f3fa00 re00551f  
    3535 
    3636/* ffmpeg headers */ 
    37 #ifdef HAVE_LIBAVCODEC_AVCODEC_H 
     37#if defined(HAVE_LIBAVCODEC_AVCODEC_H) 
    3838#   include <libavcodec/avcodec.h> 
     39#elif defined(HAVE_FFMPEG_AVCODEC_H) 
     40#   include <ffmpeg/avcodec.h> 
    3941#else 
    4042#   include <avcodec.h> 
    4143#endif 
    4244 
    43 #ifdef HAVE_LIBSWSCALE_SWSCALE_H 
     45#if defined(HAVE_LIBSWSCALE_SWSCALE_H) 
    4446#   include <libswscale/swscale.h> 
     47#elif defined(HAVE_FFMPEG_H) 
     48#   include <ffmpeg/swscale.h> 
    4549#elif defined(HAVE_LIBSWSCALE_TREE) 
    4650#   include <swscale.h> 
     
    5054 
    5155/* Version checking */ 
    52 #if ( (defined(HAVE_LIBSWSCALE_SWSCALE_H) || defined(HAVE_LIBSWSCALE_TREE)) && (LIBSWSCALE_VERSION_INT >= ((0<<16)+(5<<8)+0)) ) 
     56#if ( (defined(HAVE_LIBSWSCALE_SWSCALE_H) || defined(HAVE_FFMPEG_SWSCALE_H) || defined(HAVE_LIBSWSCALE_TREE)) && (LIBSWSCALE_VERSION_INT >= ((0<<16)+(5<<8)+0)) ) 
    5357 
    5458/***************************************************************************** 
  • modules/codec/ffmpeg/video.c

    r9f3fa00 re00551f  
    3636 
    3737/* ffmpeg header */ 
    38 #ifdef HAVE_LIBAVCODEC_AVCODEC_H 
     38#if defined(HAVE_LIBAVCODEC_AVCODEC_H) 
    3939#   include <libavcodec/avcodec.h> 
     40#elif defined(HAVE_FFMPEG_AVCODEC_H) 
     41#   include <ffmpeg/avcodec.h> 
    4042#else 
    4143#   include <avcodec.h> 
     
    844846                dest_pic.linesize[i] = p_pic->p[i].i_pitch; 
    845847            } 
    846 #if !defined(HAVE_LIBSWSCALE_SWSCALE_H) && !defined(HAVE_LIBSWSCALE_TREE) 
     848#if !defined(HAVE_LIBSWSCALE_SWSCALE_H) && !defined(HAVE_FFMPEG_SWSCALE_H) && !defined(HAVE_LIBSWSCALE_TREE) 
    847849            img_convert( &dest_pic, PIX_FMT_YUV420P, 
    848850                         (AVPicture *)p_ff_pic, 
  • modules/codec/ffmpeg/video_filter.c

    r9f3fa00 re00551f  
    3636 
    3737/* ffmpeg header */ 
    38 #ifdef HAVE_LIBAVCODEC_AVCODEC_H 
     38#if defined(HAVE_LIBAVCODEC_AVCODEC_H) 
    3939#   include <libavcodec/avcodec.h> 
     40#elif defined(HAVE_FFMPEG_AVCODEC_H) 
     41#   include <ffmpeg/avcodec.h> 
    4042#else 
    4143#   include <avcodec.h> 
     
    4446#include "ffmpeg.h" 
    4547 
    46 #if !defined(HAVE_LIBSWSCALE_SWSCALE_H) && !defined(HAVE_LIBSWSCALE_TREE) 
     48#if !defined(HAVE_LIBSWSCALE_SWSCALE_H) && !defined(HAVE_FFMPEG_SWSCALE_H) && !defined(HAVE_LIBSWSCALE_TREE) 
    4749void E_(InitLibavcodec) ( vlc_object_t *p_object ); 
    4850static int CheckInit( filter_t *p_filter ); 
     
    567569    return p_pic_dst; 
    568570} 
    569 #endif /* ( (defined(HAVE_LIBSWSCALE_SWSCALE_H) || defined(HAVE_LIBSWSCALE_TREE)) */ 
     571#endif /* ( (defined(HAVE_LIBSWSCALE_SWSCALE_H) || defined(HAVE_FFMPEG_SWSCALE_H) || defined(HAVE_LIBSWSCALE_TREE)) */ 
  • modules/codec/zvbi.c

    r9f3fa00 re00551f  
    137137 
    138138    /* Misc */ 
    139 #ifdef HAVE_LIBSWSCALE_SWSCALE_H 
     139#if defined(HAVE_LIBSWSCALE_SWSCALE_H) || defined(HAVE_FFMPEG_SWSCALE_H) 
    140140    image_handler_t         *p_image; 
    141141#endif 
     
    182182    memset( p_sys, 0, sizeof(decoder_sys_t) ); 
    183183 
    184 #ifdef HAVE_LIBSWSCALE_SWSCALE_H 
     184#if defined(HAVE_LIBSWSCALE_SWSCALE_H) || defined(HAVE_FFMPEG_SWSCALE_H) 
    185185    p_sys->p_image = image_HandlerCreate( VLC_OBJECT(p_dec) ); 
    186186    if( !p_sys->p_image ) 
     
    226226        p_dec->fmt_out.video.i_chroma = VLC_FOURCC('T','E','X','T'); 
    227227    else 
    228 #ifdef HAVE_LIBSWSCALE_SWSCALE_H 
     228#if defined(HAVE_LIBSWSCALE_SWSCALE_H) || defined(HAVE_FFMPEG_SWSCALE_H) 
    229229        p_dec->fmt_out.video.i_chroma = VLC_FOURCC('Y','U','V','A'); 
    230230#else 
     
    247247    var_DelCallback( p_dec, "vbi-opaque", Opaque, p_sys ); 
    248248 
    249 #ifdef HAVE_LIBSWSCALE_SWSCALE_H 
     249#if defined(HAVE_LIBSWSCALE_SWSCALE_H) || defined(HAVE_FFMPEG_SWSCALE_H) 
    250250    if( p_sys->p_image ) image_HandlerDelete( p_sys->p_image ); 
    251251#endif 
     
    324324    memset( &fmt, 0, sizeof(video_format_t) ); 
    325325    fmt.i_chroma = p_sys->b_text ? VLC_FOURCC('T','E','X','T') : 
    326 #ifdef HAVE_LIBSWSCALE_SWSCALE_H 
     326#if defined(HAVE_LIBSWSCALE_SWSCALE_H) || defined(HAVE_FFMPEG_SWSCALE_H) 
    327327                                   VLC_FOURCC('Y','U','V','A'); 
    328328#else 
     
    384384    else 
    385385    { 
    386 #ifdef HAVE_LIBSWSCALE_SWSCALE_H 
     386#if defined(HAVE_LIBSWSCALE_SWSCALE_H) || defined(HAVE_FFMPEG_SWSCALE_H) 
    387387        video_format_t fmt_in; 
    388388        picture_t *p_pic, *p_dest; 
  • modules/stream_out/switcher.c

    r9f3fa00 re00551f  
    3939 
    4040#define HAVE_MMX 
    41 #ifdef HAVE_LIBAVCODEC_AVCODEC_H 
     41#if defined(HAVE_LIBAVCODEC_AVCODEC_H) 
     42#   include <libavcodec/avcodec.h> 
     43#elif defined(HAVE_FFMPEG_AVCODEC_H) 
    4244#   include <ffmpeg/avcodec.h> 
    4345#else