mirror of
https://github.com/mpv-player/mpv
synced 2024-10-18 10:25:02 +02:00
Support new static libavcodec (depends on libavutil).
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@16166 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
2d14fdcb3a
commit
bd342e463a
12
Makefile
12
Makefile
@ -8,6 +8,14 @@ include config.mak
|
|||||||
|
|
||||||
PRG_CFG = codec-cfg
|
PRG_CFG = codec-cfg
|
||||||
|
|
||||||
|
LIBAV_INC =
|
||||||
|
ifeq ($(CONFIG_LIBAVUTIL),yes)
|
||||||
|
LIBAV_INC += -I./libavutil
|
||||||
|
endif
|
||||||
|
ifeq ($(CONFIG_LIBAVCODEC),yes)
|
||||||
|
LIBAV_INC += -I./libavcodec
|
||||||
|
endif
|
||||||
|
|
||||||
# Do not strip the binaries at installation
|
# Do not strip the binaries at installation
|
||||||
ifeq ($(STRIPBINARIES),yes)
|
ifeq ($(STRIPBINARIES),yes)
|
||||||
INSTALLSTRIP = -s
|
INSTALLSTRIP = -s
|
||||||
@ -129,6 +137,7 @@ CFLAGS = $(OPTFLAGS) -I. \
|
|||||||
$(SDL_INC) \
|
$(SDL_INC) \
|
||||||
$(X11_INC) \
|
$(X11_INC) \
|
||||||
$(XVID_INC) \
|
$(XVID_INC) \
|
||||||
|
$(LIBAV_INC) \
|
||||||
|
|
||||||
#CFLAGS += -Wall
|
#CFLAGS += -Wall
|
||||||
|
|
||||||
@ -292,6 +301,9 @@ loader/dshow/libDS_Filter.a:
|
|||||||
loader/dmo/libDMO_Filter.a:
|
loader/dmo/libDMO_Filter.a:
|
||||||
$(MAKE) -C loader/dmo
|
$(MAKE) -C loader/dmo
|
||||||
|
|
||||||
|
libavutil/libavutil.a:
|
||||||
|
$(MAKE) -C libavutil LIBPREF=lib LIBSUF=.a
|
||||||
|
|
||||||
libavcodec/libavcodec.a:
|
libavcodec/libavcodec.a:
|
||||||
$(MAKE) -C libavcodec LIBPREF=lib LIBSUF=.a
|
$(MAKE) -C libavcodec LIBPREF=lib LIBSUF=.a
|
||||||
|
|
||||||
|
38
configure
vendored
38
configure
vendored
@ -5859,6 +5859,13 @@ else
|
|||||||
_noinputmodules="live.com $_noinputmodules"
|
_noinputmodules="live.com $_noinputmodules"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
echocheck "FFmpeg libavutil (static)"
|
||||||
|
if test -d libavutil ; then
|
||||||
|
_libavutil=yes
|
||||||
|
else
|
||||||
|
_libavutil=no
|
||||||
|
fi
|
||||||
|
echores "$_libavutil"
|
||||||
|
|
||||||
echocheck "FFmpeg libavcodec (static)"
|
echocheck "FFmpeg libavcodec (static)"
|
||||||
if test "$_libavcodec" = auto ; then
|
if test "$_libavcodec" = auto ; then
|
||||||
@ -5866,8 +5873,26 @@ if test "$_libavcodec" = auto ; then
|
|||||||
_libavcodec=no
|
_libavcodec=no
|
||||||
if test -d libavcodec && test -f libavcodec/utils.c ; then
|
if test -d libavcodec && test -f libavcodec/utils.c ; then
|
||||||
if grep avcodec_find_encoder_by_name libavcodec/utils.c > /dev/null 2>&1 ; then
|
if grep avcodec_find_encoder_by_name libavcodec/utils.c > /dev/null 2>&1 ; then
|
||||||
_libavcodec=yes
|
# check if libavutil is a required
|
||||||
echores "yes"
|
cat > $TMPC << EOF
|
||||||
|
#include "libavcodec/avcodec.h"
|
||||||
|
#if LIBAVCODEC_BUILD >= 3211265
|
||||||
|
#error We need libavutil!
|
||||||
|
#endif
|
||||||
|
int main(void) { return 0; }
|
||||||
|
EOF
|
||||||
|
|
||||||
|
if cc_check -I. -I./libavutil; then
|
||||||
|
_libavutil_required="no"
|
||||||
|
else
|
||||||
|
_libavutil_required="yes"
|
||||||
|
fi
|
||||||
|
if test "$_libavutil_required" != "$_libavutil"; then
|
||||||
|
_libavcodec="no (libavutil availability does not fit libavcodec version)"
|
||||||
|
else
|
||||||
|
_libavcodec="yes"
|
||||||
|
fi
|
||||||
|
echores $_libavcodec
|
||||||
else
|
else
|
||||||
echores "no (old ffmpeg version, use CVS !)"
|
echores "no (old ffmpeg version, use CVS !)"
|
||||||
fi
|
fi
|
||||||
@ -5930,6 +5955,10 @@ if test "$_libavcodec" = yes ; then
|
|||||||
_dep_libavcodec='libavcodec/libavcodec.a'
|
_dep_libavcodec='libavcodec/libavcodec.a'
|
||||||
_def_ffpostprocess='#define FF_POSTPROCESS 1'
|
_def_ffpostprocess='#define FF_POSTPROCESS 1'
|
||||||
_codecmodules="libavcodec $_codecmodules"
|
_codecmodules="libavcodec $_codecmodules"
|
||||||
|
if test "$_libavutil" = yes; then
|
||||||
|
_ld_libavutil='libavutil/libavutil.a'
|
||||||
|
_dep_libavutil='libavutil/libavutil.a'
|
||||||
|
fi
|
||||||
elif test "$_libavcodecso" = yes ; then
|
elif test "$_libavcodecso" = yes ; then
|
||||||
_def_libavcodec='#define USE_LIBAVCODEC 1'
|
_def_libavcodec='#define USE_LIBAVCODEC 1'
|
||||||
_def_libavcodecso='#define USE_LIBAVCODEC_SO 1'
|
_def_libavcodecso='#define USE_LIBAVCODEC_SO 1'
|
||||||
@ -7003,8 +7032,9 @@ W32_DEP = $_dep_win32
|
|||||||
W32_LIB = $_ld_win32
|
W32_LIB = $_ld_win32
|
||||||
DS_DEP = $_dep_dshow
|
DS_DEP = $_dep_dshow
|
||||||
DS_LIB = $_ld_dshow
|
DS_LIB = $_ld_dshow
|
||||||
AV_DEP = $_dep_libavcodec $_dep_libavformat
|
AV_DEP = $_dep_libavutil $_dep_libavcodec $_dep_libavformat
|
||||||
AV_LIB = $_ld_libavcodec $_ld_libavformat
|
AV_LIB = $_ld_libavformat $_ld_libavcodec $_ld_libavutil
|
||||||
|
CONFIG_LIBAVUTIL = $_libavutil_required
|
||||||
CONFIG_LIBAVCODEC = $_libavcodec
|
CONFIG_LIBAVCODEC = $_libavcodec
|
||||||
CONFIG_LIBAVFORMAT = $_libavformat
|
CONFIG_LIBAVFORMAT = $_libavformat
|
||||||
ZORAN = $_zr
|
ZORAN = $_zr
|
||||||
|
@ -183,7 +183,12 @@ ifeq ($(CONFIG_MP3LAME),yes)
|
|||||||
ENCODER_SRCS += ae_lame.c
|
ENCODER_SRCS += ae_lame.c
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
LIBAV_INC =
|
||||||
|
ifeq ($(CONFIG_LIBAVUTIL),yes)
|
||||||
|
LIBAV_INC += -I../libavutil
|
||||||
|
endif
|
||||||
ifeq ($(CONFIG_LIBAVCODEC),yes)
|
ifeq ($(CONFIG_LIBAVCODEC),yes)
|
||||||
|
LIBAV_INC += -I../libavcodec
|
||||||
ENCODER_SRCS += ae_lavc.c
|
ENCODER_SRCS += ae_lavc.c
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@ -201,7 +206,7 @@ OBJS=$(SRCS:.c=.o)
|
|||||||
SRCS2=$(ENCODER_SRCS)
|
SRCS2=$(ENCODER_SRCS)
|
||||||
OBJS2=$(SRCS2:.c=.o)
|
OBJS2=$(SRCS2:.c=.o)
|
||||||
|
|
||||||
CFLAGS = $(OPTFLAGS) -I. -Inative -I.. -I../libmpdemux -I../loader $(EXTRA_INC) $(X264_INC) -D_GNU_SOURCE
|
CFLAGS = $(OPTFLAGS) -I. -Inative -I.. -I../libmpdemux -I../loader $(LIBAV_INC) $(EXTRA_INC) $(X264_INC) -D_GNU_SOURCE
|
||||||
|
|
||||||
.SUFFIXES: .c .o
|
.SUFFIXES: .c .o
|
||||||
|
|
||||||
|
@ -28,7 +28,7 @@ LIBAD_EXTERN(ffmpeg)
|
|||||||
#ifdef USE_LIBAVCODEC_SO
|
#ifdef USE_LIBAVCODEC_SO
|
||||||
#include <ffmpeg/avcodec.h>
|
#include <ffmpeg/avcodec.h>
|
||||||
#else
|
#else
|
||||||
#include "libavcodec/avcodec.h"
|
#include "avcodec.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
extern int avcodec_inited;
|
extern int avcodec_inited;
|
||||||
|
@ -106,8 +106,15 @@ SRCS += muxer.c \
|
|||||||
muxer_rawaudio.c \
|
muxer_rawaudio.c \
|
||||||
muxer_rawvideo.c \
|
muxer_rawvideo.c \
|
||||||
|
|
||||||
|
LIBAV_INC =
|
||||||
|
ifeq ($(CONFIG_LIBAVUTIL),yes)
|
||||||
|
LIBAV_INC += -I../libavutil
|
||||||
|
endif
|
||||||
|
ifeq ($(CONFIG_LIBAVCODEC),yes)
|
||||||
|
LIBAV_INC += -I../libavcodec
|
||||||
|
endif
|
||||||
ifeq ($(CONFIG_LIBAVFORMAT),yes)
|
ifeq ($(CONFIG_LIBAVFORMAT),yes)
|
||||||
LIBAV_INC = -I../libavcodec -I../libavformat
|
LIBAV_INC += -I../libavformat
|
||||||
SRCS += muxer_lavf.c
|
SRCS += muxer_lavf.c
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
@ -80,7 +80,7 @@
|
|||||||
#ifdef USE_LIBAVCODEC_SO
|
#ifdef USE_LIBAVCODEC_SO
|
||||||
#include <ffmpeg/avcodec.h>
|
#include <ffmpeg/avcodec.h>
|
||||||
#else
|
#else
|
||||||
#include "libavcodec/avcodec.h"
|
#include "avcodec.h"
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user