mirror of
https://github.com/qTox/qTox.git
synced 2024-03-22 14:00:36 +08:00
Added ffmpeg support to windows/bootstrap.sh
This commit is contained in:
parent
53b078182b
commit
4984450925
|
@ -32,7 +32,7 @@ fi
|
||||||
## filter_audio
|
## filter_audio
|
||||||
if [ ! -d $QTOX_DIR/libs/filter_audio ]; then
|
if [ ! -d $QTOX_DIR/libs/filter_audio ]; then
|
||||||
git clone https://github.com/irungentoo/filter_audio.git $QTOX_DIR/libs/filter_audio
|
git clone https://github.com/irungentoo/filter_audio.git $QTOX_DIR/libs/filter_audio
|
||||||
rm bin/libfilteraudio.dll
|
rm bin/libfilteraudio.dll
|
||||||
else
|
else
|
||||||
pushd $QTOX_DIR/libs/filter_audio
|
pushd $QTOX_DIR/libs/filter_audio
|
||||||
git pull
|
git pull
|
||||||
|
@ -42,31 +42,31 @@ fi
|
||||||
if [ ! -f "bin/libfilteraudio.dll" ]; then
|
if [ ! -f "bin/libfilteraudio.dll" ]; then
|
||||||
pushd $QTOX_DIR/libs/filter_audio
|
pushd $QTOX_DIR/libs/filter_audio
|
||||||
PREFIX="$QTOX_DIR/libs" CC="gcc.exe" make install
|
PREFIX="$QTOX_DIR/libs" CC="gcc.exe" make install
|
||||||
mv libfilteraudio.dll.a $QTOX_DIR/libs/lib
|
mv libfilteraudio.dll.a $QTOX_DIR/libs/lib
|
||||||
popd
|
popd
|
||||||
if [ -f "lib/libfilteraudio.dll" ]; then
|
if [ -f "lib/libfilteraudio.dll" ]; then
|
||||||
mv lib/libfilteraudio.dll bin/
|
mv lib/libfilteraudio.dll bin/
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
## qrencode
|
## qrencode
|
||||||
if [ ! -f "qrencode-3.4.4.tar.gz" ]; then
|
if [ ! -f "qrencode-3.4.4.tar.gz" ]; then
|
||||||
wget http://fukuchi.org/works/qrencode/qrencode-3.4.4.tar.gz
|
wget http://fukuchi.org/works/qrencode/qrencode-3.4.4.tar.gz
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ! -d "$QTOX_DIR/libs/qrencode-3.4.4" ]; then
|
if [ ! -d "$QTOX_DIR/libs/qrencode-3.4.4" ]; then
|
||||||
tar -xvf qrencode-3.4.4.tar.gz
|
tar -xvf qrencode-3.4.4.tar.gz
|
||||||
rm -rf lib/qrcodelib.dll
|
rm -rf lib/qrcodelib.dll
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ! -f "lib/libqrencode.a" ]; then
|
if [ ! -f "lib/libqrencode.a" ]; then
|
||||||
pushd $QTOX_DIR/libs/qrencode-3.4.4
|
pushd $QTOX_DIR/libs/qrencode-3.4.4
|
||||||
./autogen.sh
|
./autogen.sh
|
||||||
./configure --prefix=$QTOX_DIR/libs --without-tests --without-libiconv-prefix --without-tools
|
./configure --prefix=$QTOX_DIR/libs --without-tests --without-libiconv-prefix --without-tools
|
||||||
make
|
make
|
||||||
make install
|
make install
|
||||||
popd
|
popd
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
@ -142,4 +142,30 @@ if [ ! -f "bin/libopencv_core249.dll" ]; then
|
||||||
popd
|
popd
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
## ffmpeg
|
||||||
|
if [ ! -f "ffmpeg-2.7.tar.bz2" ]; then
|
||||||
|
wget http://ffmpeg.org/releases/ffmpeg-2.7.tar.bz2 -O ffmpeg-2.7.tar.bz2
|
||||||
|
rm -rf ffmpeg-2.7
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ ! -d "ffmpeg-2.7" ]; then
|
||||||
|
tar -xvf ffmpeg-2.7.tar.bz2
|
||||||
|
rm bin/avcodec-56.dll
|
||||||
|
pushd ffmpeg-2.7
|
||||||
|
patch -p1 < $QTOX_DIR/windows/ffmpeg-2.7-mingw.diff
|
||||||
|
popd
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ ! -f "bin/avcodec-56.dll" ]; then
|
||||||
|
pushd ffmpeg-2.7
|
||||||
|
./configure --target-os=mingw32 --prefix=$QTOX_DIR/libs \
|
||||||
|
--enable-memalign-hack --disable-swscale-alpha --disable-programs --disable-doc --disable-postproc \
|
||||||
|
--disable-avfilter --disable-avresample --disable-swresample --disable-protocols --disable-filters \
|
||||||
|
--disable-network --disable-muxers --disable-sdl --disable-iconv --disable-bzlib --disable-lzma \
|
||||||
|
--disable-zlib --disable-xlib --disable-encoders --enable-shared --disable-static --disable-yasm
|
||||||
|
make
|
||||||
|
make install
|
||||||
|
popd
|
||||||
|
fi
|
||||||
|
|
||||||
echo **Done**
|
echo **Done**
|
||||||
|
|
121
windows/ffmpeg-2.7-mingw.diff
Normal file
121
windows/ffmpeg-2.7-mingw.diff
Normal file
|
@ -0,0 +1,121 @@
|
||||||
|
diff -rupN ffmpeg-2.7/libavutil/file.c ffmpeg-2.7-patched/libavutil/file.c
|
||||||
|
--- ffmpeg-2.7/libavutil/file.c 2015-06-10 02:27:53 +0300
|
||||||
|
+++ ffmpeg-2.7-patched/libavutil/file.c 2015-06-25 19:25:32 +0300
|
||||||
|
@@ -23,17 +23,17 @@
|
||||||
|
#include "mem.h"
|
||||||
|
#include <fcntl.h>
|
||||||
|
#include <sys/stat.h>
|
||||||
|
+#if HAVE_MMAP
|
||||||
|
+#include <sys/mman.h>
|
||||||
|
+#elif HAVE_MAPVIEWOFFILE
|
||||||
|
+#include <windows.h>
|
||||||
|
+#endif
|
||||||
|
#if HAVE_UNISTD_H
|
||||||
|
#include <unistd.h>
|
||||||
|
#endif
|
||||||
|
#if HAVE_IO_H
|
||||||
|
#include <io.h>
|
||||||
|
#endif
|
||||||
|
-#if HAVE_MMAP
|
||||||
|
-#include <sys/mman.h>
|
||||||
|
-#elif HAVE_MAPVIEWOFFILE
|
||||||
|
-#include <windows.h>
|
||||||
|
-#endif
|
||||||
|
|
||||||
|
typedef struct FileLogContext {
|
||||||
|
const AVClass *class;
|
||||||
|
diff -rupN ffmpeg-2.7/libavutil/file_open.c ffmpeg-2.7-patched/libavutil/file_open.c
|
||||||
|
--- ffmpeg-2.7/libavutil/file_open.c 2015-06-10 02:27:53 +0300
|
||||||
|
+++ ffmpeg-2.7-patched/libavutil/file_open.c 2015-06-25 19:26:52 +0300
|
||||||
|
@@ -22,12 +22,6 @@
|
||||||
|
#include <stdarg.h>
|
||||||
|
#include <fcntl.h>
|
||||||
|
#include <sys/stat.h>
|
||||||
|
-#if HAVE_UNISTD_H
|
||||||
|
-#include <unistd.h>
|
||||||
|
-#endif
|
||||||
|
-#if HAVE_IO_H
|
||||||
|
-#include <io.h>
|
||||||
|
-#endif
|
||||||
|
|
||||||
|
#if defined(_WIN32) && !defined(__MINGW32CE__)
|
||||||
|
#undef open
|
||||||
|
@@ -63,6 +57,13 @@ fallback:
|
||||||
|
#define open win32_open
|
||||||
|
#endif
|
||||||
|
|
||||||
|
+#if HAVE_UNISTD_H
|
||||||
|
+#include <unistd.h>
|
||||||
|
+#endif
|
||||||
|
+#if HAVE_IO_H
|
||||||
|
+#include <io.h>
|
||||||
|
+#endif
|
||||||
|
+
|
||||||
|
int avpriv_open(const char *filename, int flags, ...)
|
||||||
|
{
|
||||||
|
int fd;
|
||||||
|
diff -rupN ffmpeg-2.7/libavutil/log.c ffmpeg-2.7-patched/libavutil/log.c
|
||||||
|
--- ffmpeg-2.7/libavutil/log.c 2015-06-10 02:27:53 +0300
|
||||||
|
+++ ffmpeg-2.7-patched/libavutil/log.c 2015-06-25 19:28:20 +0300
|
||||||
|
@@ -26,9 +26,6 @@
|
||||||
|
|
||||||
|
#include "config.h"
|
||||||
|
|
||||||
|
-#if HAVE_UNISTD_H
|
||||||
|
-#include <unistd.h>
|
||||||
|
-#endif
|
||||||
|
#if HAVE_IO_H
|
||||||
|
#include <io.h>
|
||||||
|
#endif
|
||||||
|
@@ -120,6 +117,9 @@ static const uint32_t color[16 + AV_CLAS
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
|
+#if HAVE_UNISTD_H
|
||||||
|
+#include <unistd.h>
|
||||||
|
+#endif
|
||||||
|
static int use_color = -1;
|
||||||
|
|
||||||
|
static void check_color_terminal(void)
|
||||||
|
diff -rupN ffmpeg-2.7/libavutil/random_seed.c ffmpeg-2.7-patched/libavutil/random_seed.c
|
||||||
|
--- ffmpeg-2.7/libavutil/random_seed.c 2015-05-17 04:26:38 +0300
|
||||||
|
+++ ffmpeg-2.7-patched/libavutil/random_seed.c 2015-06-25 19:28:30 +0300
|
||||||
|
@@ -20,9 +20,6 @@
|
||||||
|
|
||||||
|
#include "config.h"
|
||||||
|
|
||||||
|
-#if HAVE_UNISTD_H
|
||||||
|
-#include <unistd.h>
|
||||||
|
-#endif
|
||||||
|
#if HAVE_IO_H
|
||||||
|
#include <io.h>
|
||||||
|
#endif
|
||||||
|
@@ -30,6 +27,9 @@
|
||||||
|
#include <windows.h>
|
||||||
|
#include <wincrypt.h>
|
||||||
|
#endif
|
||||||
|
+#if HAVE_UNISTD_H
|
||||||
|
+#include <unistd.h>
|
||||||
|
+#endif
|
||||||
|
#include <fcntl.h>
|
||||||
|
#include <math.h>
|
||||||
|
#include <time.h>
|
||||||
|
diff -rupN ffmpeg-2.7/libavutil/time.c ffmpeg-2.7-patched/libavutil/time.c
|
||||||
|
--- ffmpeg-2.7/libavutil/time.c 2015-06-10 02:27:53 +0300
|
||||||
|
+++ ffmpeg-2.7-patched/libavutil/time.c 2015-06-25 19:28:37 +0300
|
||||||
|
@@ -26,12 +26,12 @@
|
||||||
|
#if HAVE_GETTIMEOFDAY
|
||||||
|
#include <sys/time.h>
|
||||||
|
#endif
|
||||||
|
-#if HAVE_UNISTD_H
|
||||||
|
-#include <unistd.h>
|
||||||
|
-#endif
|
||||||
|
#if HAVE_WINDOWS_H
|
||||||
|
#include <windows.h>
|
||||||
|
#endif
|
||||||
|
+#if HAVE_UNISTD_H
|
||||||
|
+#include <unistd.h>
|
||||||
|
+#endif
|
||||||
|
|
||||||
|
#include "time.h"
|
||||||
|
#include "error.h"
|
Loading…
Reference in New Issue
Block a user