]> git.sesse.net Git - vlc/commitdiff
Add fallback to img_resample based plugin if swscale isn't available on the system...
authorAntoine Cellerier <dionoea@videolan.org>
Tue, 3 Jun 2008 09:23:11 +0000 (11:23 +0200)
committerAntoine Cellerier <dionoea@videolan.org>
Tue, 3 Jun 2008 09:23:11 +0000 (11:23 +0200)
configure.ac
modules/codec/ffmpeg/Modules.am
modules/codec/ffmpeg/avcodec.c

index 1b72e1026d6ebb66f27c7b61d68d7f85e681ff45..a3d349c3c6807175802103ad94d37b8d5b797adb 100644 (file)
@@ -192,7 +192,7 @@ case "${host_os}" in
     VLC_ADD_LDFLAGS([mkv mp4], [-Wl,-framework,IOKit,-framework,CoreFoundation])
     VLC_ADD_LDFLAGS([vlc],[-Wl,-undefined,dynamic_lookup])
     VLC_ADD_LDFLAGS([libvlc_control],[-Wl,dynamic_lookup])
-    VLC_ADD_LDFLAGS([avcodec avformat swscale postproc i420_rgb_mmx x264],[-Wl,-read_only_relocs,suppress])
+    VLC_ADD_LDFLAGS([avcodec avformat swscale imgresample postproc i420_rgb_mmx x264],[-Wl,-read_only_relocs,suppress])
     VLC_ADD_CFLAGS([motion],[-fconstant-cfstrings])
     VLC_ADD_LDFLAGS([libvlc],[-Wl,-framework,Cocoa,-framework,CoreFoundation])
     VLC_ADD_LDFLAGS([motion],[-Wl,-framework,IOKit,-framework,CoreFoundation])
@@ -645,7 +645,7 @@ AC_CHECK_LIB(m,cos,[
   VLC_ADD_LIBS([adjust wave ripple psychedelic gradient a52tofloat32 dtstofloat32 x264 goom visual panoramix rotate noise grain],[-lm])
 ])
 AC_CHECK_LIB(m,pow,[
-  VLC_ADD_LIBS([avcodec avformat swscale postproc ffmpegaltivec stream_out_transrate i420_rgb faad twolame equalizer spatializer param_eq libvlc vorbis freetype mod mpc dmo quicktime realaudio realvideo galaktos opengl],[-lm])
+  VLC_ADD_LIBS([avcodec avformat swscale imgresample postproc ffmpegaltivec stream_out_transrate i420_rgb faad twolame equalizer spatializer param_eq libvlc vorbis freetype mod mpc dmo quicktime realaudio realvideo galaktos opengl],[-lm])
 ])
 AC_CHECK_LIB(m,sqrt,[
   VLC_ADD_LIBS([headphone_channel_mixer normvol speex mono colorthres extract],[-lm])
@@ -2937,7 +2937,7 @@ then
       VLC_ADD_CFLAGS([avcodec],[$AVCODEC_CFLAGS])
       VLC_RESTORE_FLAGS
     ],[
-      AC_MSG_ERROR([Could not find libavcodec or libavutil.])
+      AC_MSG_ERROR([Could not find libavcodec or libavutil. Use --disable-avcodec to ignore this error.])
   ])
 fi
 
@@ -2962,7 +2962,7 @@ then
       VLC_ADD_CFLAGS([avformat],[$AVFORMAT_CFLAGS])
       VLC_RESTORE_FLAGS
     ],[
-      AC_MSG_ERROR([Could not find libavformat, libavcodec or libavutil.])
+      AC_MSG_ERROR([Could not find libavformat, libavcodec or libavutil. Use --disable-avformat to ignore this error.])
   ])
 fi
 
@@ -2986,7 +2986,46 @@ then
       VLC_ADD_CFLAGS([swscale],[$SWSCALE_CFLAGS])
       VLC_RESTORE_FLAGS
     ],[
-      AC_MSG_ERROR([Could not find libswscale or libavutil.])
+      AC_MSG_WARN([Could not find libswscale or libavutil. Trying to enable imgresample.])
+      enable_imgresample=yes
+  ])
+fi
+
+dnl
+dnl  avcodec (deprecated API) image scaling and conversion plugin
+dnl
+dnl  This is build as a seperate module than the avcodec one to prevent
+dnl  stupid run time library load errors from disabling most codecs
+dnl  from VLC.
+dnl
+
+AC_ARG_ENABLE(imgresample,
+[  --enable-imgresample deprecated libavcodec image scaling and conversion (default disabled)])
+if test "${enable_imgresample}" = "yes"
+then
+  PKG_CHECK_MODULES(IMGRESAMPLE,[libavcodec, libavutil],
+    [
+      VLC_SAVE_FLAGS
+      CPPFLAGS="${CPPFLAGS} ${IMGRESAMPLE_CFLAGS}"
+      CFLAGS="${CFLAGS} ${IMGRESAMPLE_CFLAGS}"
+      LIBS="${CFLAGS} ${IMGRESAMPLE_LIBS}"
+      AC_CHECK_HEADERS(libavcodec/avcodec.h ffmpeg/avcodec.h)
+      AC_CHECK_HEADERS(libavutil/avutil.h ffmpeg/avutil.h)
+      AC_CHECK_LIB(avcodec,img_resample,
+        [
+          VLC_ADD_PLUGIN([imgresample])
+          VLC_ADD_LIBS([imgresample],[$IMGRESAMPLE_LIBS])
+          VLC_ADD_CFLAGS([imgresample],[$IMGRESAMPLE_CFLAGS])
+        ],[
+          AC_MSG_WARN([Could not find img_resample in libavcodec.])
+          if test "${enable_swscale}" != "no"
+          then
+            AC_MSG_ERROR([swscale (and its fallback module imgresample) support will be missing. Use --disable-swscale to ignore this error. (This basically means that you will be missing any good software scaling module and some video chroma converters.)])
+          fi
+        ])
+      VLC_RESTORE_FLAGS
+    ],[
+      AC_MSG_WARN([Could not find libavcodec or libavutil.])
   ])
 fi
 
index 69ac7032d3e1a3c0e922b3b2a4987e3adf51e0b1..85f7a04ccd671f75177863aed8e72db809dcf103 100644 (file)
@@ -36,6 +36,15 @@ SOURCES_swscale = \
        scale.c \
        $(NULL)
 
+# FIXME
+SOURCES_imgresample = \
+       avcodec.c \
+       avcodec.h \
+       video.c \
+       audio.c \
+       deinterlace.c \
+       $(NULL)
+
 SOURCES_postproc = \
        postprocess.c \
        $(NULL)
index 28e112204bcb750db4db56d83f17482017976b76..bb4100e3926e3da12b4f20181314659e0ccc2464 100644 (file)
@@ -89,11 +89,11 @@ vlc_module_begin();
     /* decoder main module */
 #if defined(MODULE_NAME_is_ffmpegaltivec) \
      || (defined(CAN_COMPILE_ALTIVEC) && !defined(NO_ALTIVEC_IN_FFMPEG))
-    set_description( N_("AltiVec FFmpeg audio/video decoder/encoder ((MS)MPEG4,SVQ1,H263,WMV,WMA)") );
+    set_description( N_("AltiVec FFmpeg audio/video decoder ((MS)MPEG4,SVQ1,H263,WMV,WMA)") );
     /*add_requirement( ALTIVEC );*/
     set_capability( "decoder", 71 );
 #else
-    set_description( N_("FFmpeg audio/video decoders/encoders") );
+    set_description( N_("FFmpeg audio/video decoder") );
     set_help( MODULE_DESCRIPTION );
     set_capability( "decoder", 70 );
 #endif