From 5d93f582cc0aafbc66134d46e79d73ab941f6c7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Franti=C5=A1ek=20Dvo=C5=99=C3=A1k?= Date: Sun, 20 Feb 2005 09:36:00 +0000 Subject: **BUGFIX** Updated documentation about M$VC (building external ffmpeg). Added patch necessary for using ffmpeg by M$VC compiler. Updated M$VC build of xine's ff plugin - removed ugly ifdef, used external ffmpeg as whole. CVS patchset: 7419 CVS date: 2005/02/20 09:36:00 --- win32/Makefile.am | 1 + win32/scripts/ffmpeg_win32.patch | 80 ++++++++++++++++++++++++++++++++++++++++ win32/xineplug_decode_ff.dsp | 12 ++++-- 3 files changed, 89 insertions(+), 4 deletions(-) create mode 100644 win32/scripts/ffmpeg_win32.patch (limited to 'win32') diff --git a/win32/Makefile.am b/win32/Makefile.am index a8184a787..b19a9d270 100644 --- a/win32/Makefile.am +++ b/win32/Makefile.am @@ -4,6 +4,7 @@ SUBDIRS = contrib include EXTRA_DIST = \ scripts/move_xine_fonts.bat \ + scripts/ffmpeg_win32.patch \ README \ libdvdnav.def \ libxine.def \ diff --git a/win32/scripts/ffmpeg_win32.patch b/win32/scripts/ffmpeg_win32.patch new file mode 100644 index 000000000..b2f653153 --- /dev/null +++ b/win32/scripts/ffmpeg_win32.patch @@ -0,0 +1,80 @@ +#! /bin/sh + +# +# Fix cross build with SDL. +# Install also dvdata.h. +# Patching script for M$VC clients. +# + +patch -p0 < $0 +cp libavcodec/avcodec.h libavcodec/avcodec.h.dllimports; sed libavcodec/avcodec.h.dllimports -e 's/extern AVCodec/_DL_IMPORT extern AVCodec/' > libavcodec/avcodec.h + +exit 0 +Index: configure +=================================================================== +RCS file: /cvsroot/ffmpeg/ffmpeg/configure,v +retrieving revision 1.159 +diff -u -p -u -p -r1.159 configure +--- configure 21 Jan 2005 22:16:04 -0000 1.159 ++++ configure 19 Feb 2005 16:15:29 -0000 +@@ -942,9 +942,10 @@ EOF + + sdl_too_old=no + sdl=no +-if (sdl-config --version) >/dev/null 2>&1 ; then +-if $cc -o $TMPE `sdl-config --cflags` $TMPC `sdl-config --libs` > /dev/null 2>&1 ; then +-_sdlversion=`sdl-config --version | sed 's/[^0-9]//g'` ++SDL_CONFIG="${cross_prefix}sdl-config" ++if ("${SDL_CONFIG}" --version) >/dev/null 2>&1 ; then ++if $cc -o $TMPE `"${SDL_CONFIG}" --cflags` $TMPC `"${SDL_CONFIG}" --libs` > /dev/null 2>&1 ; then ++_sdlversion=`"${SDL_CONFIG}" --version | sed 's/[^0-9]//g'` + if test "$_sdlversion" -lt 121 ; then + sdl_too_old=yes + else +@@ -1225,8 +1226,8 @@ if test "$pthreads" = "yes" ; then + fi + if test "$sdl" = "yes" ; then + echo "CONFIG_SDL=yes" >> config.mak +- echo "SDL_LIBS=`sdl-config --libs`" >> config.mak +- echo "SDL_CFLAGS=`sdl-config --cflags`" >> config.mak ++ echo "SDL_LIBS=`"${SDL_CONFIG}" --libs`" >> config.mak ++ echo "SDL_CFLAGS=`"${SDL_CONFIG}" --cflags`" >> config.mak + fi + if test "$texi2html" = "yes"; then + echo "BUILD_DOC=yes" >> config.mak +Index: libavcodec/Makefile +=================================================================== +RCS file: /cvsroot/ffmpeg/ffmpeg/libavcodec/Makefile,v +retrieving revision 1.167 +diff -u -p -u -p -r1.167 Makefile +--- libavcodec/Makefile 22 Jan 2005 17:52:00 -0000 1.167 ++++ libavcodec/Makefile 19 Feb 2005 16:15:29 -0000 +@@ -313,6 +313,7 @@ install-headers: + install -m 644 $(SRC_PATH)/libavcodec/avcodec.h \ + $(SRC_PATH)/libavcodec/common.h \ + $(SRC_PATH)/libavcodec/rational.h \ ++ $(SRC_PATH)/libavcodec/dvdata.h \ + "$(prefix)/include/ffmpeg" + + # +Index: libavcodec/common.h +=================================================================== +RCS file: /cvsroot/ffmpeg/ffmpeg/libavcodec/common.h,v +retrieving revision 1.145 +diff -u -p -u -p -r1.145 common.h +--- libavcodec/common.h 12 Jan 2005 01:44:01 -0000 1.145 ++++ libavcodec/common.h 19 Feb 2005 16:15:29 -0000 +@@ -64,6 +64,13 @@ extern const struct AVOption avoptions_w + + #endif /* HAVE_AV_CONFIG_H */ + ++/* for MSVC clients */ ++#if !defined(HAVE_AV_CONFIG_H) && defined(_MSC_VER) ++# define _DL_IMPORT __declspec(dllimport) ++#else ++# define _DL_IMPORT ++#endif ++ + /* Suppress restrict if it was not defined in config.h. */ + #ifndef restrict + # define restrict diff --git a/win32/xineplug_decode_ff.dsp b/win32/xineplug_decode_ff.dsp index 34873bb97..b9fdfef85 100644 --- a/win32/xineplug_decode_ff.dsp +++ b/win32/xineplug_decode_ff.dsp @@ -44,7 +44,7 @@ RSC=rc.exe # PROP Target_Dir "" LIB32=link.exe # ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "XINEPLUG_DECODE_FF_EXPORTS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "../lib" /I "../include" /I "include" /I "include/msvc" /I "contrib/pthreads" /I "../src/xine-engine" /I "../src" /I "../src/xine-utils" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "XINEPLUG_DECODE_FF_EXPORTS" /D "XINE_COMPILE" /D "SIMPLE_IDCT" /D "HAVE_AV_CONFIG_H" /D "RUNTIME_CPUDETECT" /D "USE_FASTMEMCPY" /D "CONFIG_RISKY" /D "CONFIG_DECODERS" /D "XINE_MPEG_ENCODER" /YX /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I "../lib" /I "../include" /I "include" /I "include/msvc" /I "contrib/pthreads" /I "../src/xine-engine" /I "../src" /I "../src/xine-utils" /I "../../ffmpeg/include/ffmpeg" /I "../../ffmpeg/include/postproc" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "HAVE_CONFIG_H" /D "HAVE_FFMPEG" /D "XINEPLUG_DECODE_FF_EXPORTS" /D "XINE_COMPILE" /D "SIMPLE_IDCT" /D "RUNTIME_CPUDETECT" /D "USE_FASTMEMCPY" /D "CONFIG_RISKY" /D "CONFIG_DECODERS" /D "XINE_MPEG_ENCODER" /YX /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x409 /d "NDEBUG" @@ -54,7 +54,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 -# ADD LINK32 avcodec.lib /nologo /dll /machine:I386 /out:"Release/bin/plugins/xineplug_decode_ff.dll" /libpath:"Release" +# ADD LINK32 avcodec.lib /nologo /dll /machine:I386 /out:"Release/bin/plugins/xineplug_decode_ff.dll" /libpath:"Release" /libpath:"../../ffmpeg/" !ELSEIF "$(CFG)" == "xineplug_decode_ff - Win32 Debug" @@ -71,7 +71,7 @@ LINK32=link.exe # PROP Target_Dir "" LIB32=link.exe # ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "XINEPLUG_DECODE_FF_EXPORTS" /YX /FD /GZ /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "../lib" /I "../include" /I "include" /I "include/msvc" /I "contrib/pthreads" /I "../src/xine-engine" /I "../src" /I "../src/xine-utils" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "XINEPLUG_DECODE_FF_EXPORTS" /D "XINE_COMPILE" /D "SIMPLE_IDCT" /D "HAVE_AV_CONFIG_H" /D "RUNTIME_CPUDETECT" /D "USE_FASTMEMCPY" /D "CONFIG_RISKY" /D "CONFIG_DECODERS" /D "XINE_MPEG_ENCODER" /FD /GZ /c +# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "../lib" /I "../include" /I "include" /I "include/msvc" /I "contrib/pthreads" /I "../src/xine-engine" /I "../src" /I "../src/xine-utils" /I "../../ffmpeg/include/ffmpeg" /I "../../ffmpeg/include/postproc" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "HAVE_CONFIG_H" /D "HAVE_FFMPEG" /D "XINEPLUG_DECODE_FF_EXPORTS" /D "XINE_COMPILE" /D "SIMPLE_IDCT" /D "RUNTIME_CPUDETECT" /D "USE_FASTMEMCPY" /D "CONFIG_RISKY" /D "CONFIG_DECODERS" /D "XINE_MPEG_ENCODER" /FD /GZ /c # SUBTRACT CPP /X /YX # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 @@ -82,7 +82,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept -# ADD LINK32 avcodec.lib /nologo /dll /debug /machine:I386 /out:"Debug/bin/plugins/xineplug_decode_ff.dll" /pdbtype:sept /libpath:"Debug" +# ADD LINK32 avcodec.lib /nologo /dll /debug /machine:I386 /out:"Debug/bin/plugins/xineplug_decode_ff.dll" /pdbtype:sept /libpath:"Debug" /libpath:"../../ffmpeg/" !ENDIF @@ -99,6 +99,10 @@ SOURCE=..\src\libffmpeg\audio_decoder.c # End Source File # Begin Source File +SOURCE=..\src\libffmpeg\mpeg_parser.c +# End Source File +# Begin Source File + SOURCE=..\src\libffmpeg\video_decoder.c # End Source File # Begin Source File -- cgit v1.2.3