[FFmpeg-cvslog] Merge commit '11a9320de54759340531177c9f2b1e31e6112cc2'

Clément Bœsch git at videolan.org
Wed May 3 17:54:58 EEST 2017


ffmpeg | branch: master | Clément Bœsch <u at pkh.me> | Wed May  3 12:51:48 2017 +0200| [3f17751eeb7e3348576e2597884d5e5155aadcfb] | committer: Clément Bœsch

Merge commit '11a9320de54759340531177c9f2b1e31e6112cc2'

* commit '11a9320de54759340531177c9f2b1e31e6112cc2':
  build: Move build-system-related helper files to a separate subdirectory

"ffbuild" directory name is used instead of "avbuild".

Merged-by: Clément Bœsch <u at pkh.me>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=3f17751eeb7e3348576e2597884d5e5155aadcfb
---

 .gitignore                         |  3 ++-
 Makefile                           | 19 +++++++++++--------
 configure                          | 25 +++++++++++++------------
 doc/Makefile                       |  2 +-
 doc/writing_filters.txt            |  8 ++++----
 ffbuild/.gitignore                 |  4 ++++
 arch.mak => ffbuild/arch.mak       |  0
 common.mak => ffbuild/common.mak   |  2 +-
 library.mak => ffbuild/library.mak |  2 +-
 version.sh => ffbuild/version.sh   |  0
 libavcodec/Makefile                |  2 +-
 libavdevice/Makefile               |  2 +-
 libavfilter/Makefile               |  2 +-
 libavformat/Makefile               |  2 +-
 libavutil/Makefile                 |  2 +-
 libpostproc/Makefile               |  2 +-
 libswresample/Makefile             |  2 +-
 libswscale/Makefile                |  2 +-
 tests/fate.sh                      |  4 ++--
 19 files changed, 47 insertions(+), 38 deletions(-)

diff --git a/.gitignore b/.gitignore
index 524fb73c16..177c0f6b0b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -27,7 +27,8 @@
 /ffplay
 /ffprobe
 /ffserver
-/config.*
+/config.asm
+/config.h
 /coverage.info
 /avversion.h
 /lcov/
diff --git a/Makefile b/Makefile
index fcee739405..8731d3b6ba 100644
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,5 @@
 MAIN_MAKEFILE=1
-include config.mak
+include ffbuild/config.mak
 
 vpath %.c    $(SRC_PATH)
 vpath %.cpp  $(SRC_PATH)
@@ -66,7 +66,7 @@ SKIPHEADERS = cmdutils_common_opts.h                                    \
 all: all-yes
 
 include $(SRC_PATH)/tools/Makefile
-include $(SRC_PATH)/common.mak
+include $(SRC_PATH)/ffbuild/common.mak
 
 FF_EXTRALIBS := $(FFEXTRALIBS)
 FF_DEP_LIBS  := $(DEP_LIBS)
@@ -91,8 +91,8 @@ CONFIGURABLE_COMPONENTS =                                           \
     $(SRC_PATH)/libavcodec/bitstream_filters.c                      \
     $(SRC_PATH)/libavformat/protocols.c                             \
 
-config.h: .config
-.config: $(CONFIGURABLE_COMPONENTS)
+config.h: ffbuild/.config
+ffbuild/.config: $(CONFIGURABLE_COMPONENTS)
 	@-tput bold 2>/dev/null
 	@-printf '\nWARNING: $(?) newer than config.h, rerun configure\n\n'
 	@-tput sgr0 2>/dev/null
@@ -115,7 +115,7 @@ SUBDIR := $(1)/
 include $(SRC_PATH)/$(1)/Makefile
 -include $(SRC_PATH)/$(1)/$(ARCH)/Makefile
 -include $(SRC_PATH)/$(1)/$(INTRINSICS)/Makefile
-include $(SRC_PATH)/library.mak
+include $(SRC_PATH)/ffbuild/library.mak
 endef
 
 $(foreach D,$(FFLIBS),$(eval $(call DOSUBDIR,lib$(D))))
@@ -142,10 +142,10 @@ $(PROGS): %$(PROGSSUF)$(EXESUF): %$(PROGSSUF)_g$(EXESUF)
 %$(PROGSSUF)_g$(EXESUF): %.o $(FF_DEP_LIBS)
 	$(LD) $(LDFLAGS) $(LDEXEFLAGS) $(LD_O) $(OBJS-$*) $(FF_EXTRALIBS)
 
-VERSION_SH  = $(SRC_PATH)/version.sh
+VERSION_SH  = $(SRC_PATH)/ffbuild/version.sh
 GIT_LOG     = $(SRC_PATH)/.git/logs/HEAD
 
-.version: $(wildcard $(GIT_LOG)) $(VERSION_SH) config.mak
+.version: $(wildcard $(GIT_LOG)) $(VERSION_SH) ffbuild/config.mak
 .version: M=@
 
 libavutil/ffversion.h .version:
@@ -194,7 +194,10 @@ clean::
 
 distclean::
 	$(RM) $(DISTCLEANSUFFIXES)
-	$(RM) config.* .config libavutil/avconfig.h .version mapfile avversion.h version.h libavutil/ffversion.h libavcodec/codec_names.h libavcodec/bsf_list.c libavformat/protocol_list.c
+	$(RM) .version avversion.h config.asm config.h mapfile  \
+		ffbuild/.config ffbuild/config.* libavutil/avconfig.h \
+		version.h libavutil/ffversion.h libavcodec/codec_names.h \
+		libavcodec/bsf_list.c libavformat/protocol_list.c
 ifeq ($(SRC_LINK),src)
 	$(RM) src
 endif
diff --git a/configure b/configure
index b3cb5b0c1e..c3fa9d858f 100755
--- a/configure
+++ b/configure
@@ -77,7 +77,7 @@ Help options:
   --list-filters           show all available filters
 
 Standard options:
-  --logfile=FILE           log tests and output to FILE [config.log]
+  --logfile=FILE           log tests and output to FILE [ffbuild/config.log]
   --disable-logging        do not log configure debug information
   --fatal-warnings         fail if any configure warning is generated
   --prefix=PREFIX          install in PREFIX [$prefix_default]
@@ -3224,7 +3224,7 @@ doc_deps_any="manpages htmlpages podpages txtpages"
 
 # default parameters
 
-logfile="config.log"
+logfile="ffbuild/config.log"
 
 # installation paths
 prefix_default="/usr/local"
@@ -3581,6 +3581,7 @@ disable_components(){
 
 map 'disable_components $v' $LIBRARY_LIST
 
+mkdir -p ffbuild
 echo "# $0 $FFMPEG_CONFIGURATION" > $logfile
 set >> $logfile
 
@@ -5152,7 +5153,7 @@ esc(){
     echo "$*" | sed 's/%/%25/g;s/:/%3a/g'
 }
 
-echo "config:$arch:$subarch:$cpu:$target_os:$(esc $cc_ident):$(esc $FFMPEG_CONFIGURATION)" >config.fate
+echo "config:$arch:$subarch:$cpu:$target_os:$(esc $cc_ident):$(esc $FFMPEG_CONFIGURATION)" > ffbuild/config.fate
 
 check_cpp_condition stdlib.h "defined(__PIC__) || defined(__pic__) || defined(PIC)" && enable_weak pic
 
@@ -6619,9 +6620,9 @@ test -e Makefile || echo "include $source_path/Makefile" > Makefile
 
 enabled stripping || strip="echo skipping strip"
 
-config_files="$TMPH config.mak doc/config.texi"
+config_files="$TMPH ffbuild/config.mak doc/config.texi"
 
-cat > config.mak <<EOF
+cat > ffbuild/config.mak <<EOF
 # Automatically generated by configure - do not modify!
 ifndef FFMPEG_CONFIG_MAK
 FFMPEG_CONFIG_MAK=1
@@ -6755,18 +6756,18 @@ get_version(){
     eval $(awk "/#define ${name}_VERSION_M/ { print \$2 \"=\" \$3 }" "$file")
     enabled raise_major && eval ${name}_VERSION_MAJOR=$((${name}_VERSION_MAJOR+100))
     eval ${name}_VERSION=\$${name}_VERSION_MAJOR.\$${name}_VERSION_MINOR.\$${name}_VERSION_MICRO
-    eval echo "${lcname}_VERSION=\$${name}_VERSION" >> config.mak
-    eval echo "${lcname}_VERSION_MAJOR=\$${name}_VERSION_MAJOR" >> config.mak
-    eval echo "${lcname}_VERSION_MINOR=\$${name}_VERSION_MINOR" >> config.mak
+    eval echo "${lcname}_VERSION=\$${name}_VERSION"             >> ffbuild/config.mak
+    eval echo "${lcname}_VERSION_MAJOR=\$${name}_VERSION_MAJOR" >> ffbuild/config.mak
+    eval echo "${lcname}_VERSION_MINOR=\$${name}_VERSION_MINOR" >> ffbuild/config.mak
 }
 
 map 'get_version $v' $LIBRARY_LIST
 
-map 'eval echo "${v}_FFLIBS=\$${v}_deps" >> config.mak' $LIBRARY_LIST
+map 'eval echo "${v}_FFLIBS=\$${v}_deps" >> ffbuild/config.mak' $LIBRARY_LIST
 
 print_program_extralibs(){
     eval "program_extralibs=\$${1}_extralibs"
-    eval echo "EXTRALIBS-${1}=${program_extralibs}" >> config.mak
+    eval echo "EXTRALIBS-${1}=${program_extralibs}" >> ffbuild/config.mak
 }
 
 map 'print_program_extralibs $v' $PROGRAM_LIST
@@ -6816,11 +6817,11 @@ print_config CONFIG_ "$config_files" $CONFIG_LIST       \
                                      $ALL_COMPONENTS    \
 
 echo "#endif /* FFMPEG_CONFIG_H */" >> $TMPH
-echo "endif # FFMPEG_CONFIG_MAK" >> config.mak
+echo "endif # FFMPEG_CONFIG_MAK" >> ffbuild/config.mak
 
 # Do not overwrite an unchanged config.h to avoid superfluous rebuilds.
 cp_if_changed $TMPH config.h
-touch .config
+touch ffbuild/.config
 
 enabled yasm && cp_if_changed $TMPASM config.asm
 
diff --git a/doc/Makefile b/doc/Makefile
index c193fc3a66..4cc9eedd12 100644
--- a/doc/Makefile
+++ b/doc/Makefile
@@ -128,7 +128,7 @@ $(DOC_EXAMPLES:%$(EXESUF)=%.o): | doc/examples
 OBJDIRS += doc/examples
 
 DOXY_INPUT      = $(INSTHEADERS) $(DOC_EXAMPLES:%$(EXESUF)=%.c) $(LIB_EXAMPLES:%$(EXESUF)=%.c)
-DOXY_INPUT_DEPS = $(addprefix $(SRC_PATH)/, $(DOXY_INPUT)) config.mak
+DOXY_INPUT_DEPS = $(addprefix $(SRC_PATH)/, $(DOXY_INPUT)) ffbuild/config.mak
 
 doc/doxy/html: TAG = DOXY
 doc/doxy/html: $(SRC_PATH)/doc/Doxyfile $(SRC_PATH)/doc/doxy-wrapper.sh $(DOXY_INPUT_DEPS)
diff --git a/doc/writing_filters.txt b/doc/writing_filters.txt
index 66ebb53243..5cd4ecd6a4 100644
--- a/doc/writing_filters.txt
+++ b/doc/writing_filters.txt
@@ -38,14 +38,14 @@ the build system and the C:
 
     --- after running configure ---
 
-    $ grep FOOBAR config.mak
+    $ grep FOOBAR ffbuild/config.mak
     CONFIG_FOOBAR_FILTER=yes
     $ grep FOOBAR config.h
     #define CONFIG_FOOBAR_FILTER 1
 
-CONFIG_FOOBAR_FILTER=yes from the config.mak is later used to enable the filter in
-libavfilter/Makefile and CONFIG_FOOBAR_FILTER=1 from the config.h will be used
-for registering the filter in libavfilter/allfilters.c.
+CONFIG_FOOBAR_FILTER=yes from the ffbuild/config.mak is later used to enable
+the filter in libavfilter/Makefile and CONFIG_FOOBAR_FILTER=1 from the config.h
+will be used for registering the filter in libavfilter/allfilters.c.
 
 Filter code layout
 ==================
diff --git a/ffbuild/.gitignore b/ffbuild/.gitignore
new file mode 100644
index 0000000000..693b7aa0d3
--- /dev/null
+++ b/ffbuild/.gitignore
@@ -0,0 +1,4 @@
+/.config
+/config.fate
+/config.log
+/config.mak
diff --git a/arch.mak b/ffbuild/arch.mak
similarity index 100%
rename from arch.mak
rename to ffbuild/arch.mak
diff --git a/common.mak b/ffbuild/common.mak
similarity index 99%
rename from common.mak
rename to ffbuild/common.mak
index 909dfc1bb6..195737028a 100644
--- a/common.mak
+++ b/ffbuild/common.mak
@@ -103,7 +103,7 @@ COMPILE_HOSTC = $(call COMPILE,HOSTCC)
 $(OBJS):
 endif
 
-include $(SRC_PATH)/arch.mak
+include $(SRC_PATH)/ffbuild/arch.mak
 
 OBJS      += $(OBJS-yes)
 SLIBOBJS  += $(SLIBOBJS-yes)
diff --git a/library.mak b/ffbuild/library.mak
similarity index 98%
rename from library.mak
rename to ffbuild/library.mak
index 266176f1ae..5e576d18cd 100644
--- a/library.mak
+++ b/ffbuild/library.mak
@@ -1,4 +1,4 @@
-include $(SRC_PATH)/common.mak
+include $(SRC_PATH)/ffbuild/common.mak
 
 LIBVERSION := $(lib$(NAME)_VERSION)
 LIBMAJOR   := $(lib$(NAME)_VERSION_MAJOR)
diff --git a/version.sh b/ffbuild/version.sh
similarity index 100%
rename from version.sh
rename to ffbuild/version.sh
diff --git a/libavcodec/Makefile b/libavcodec/Makefile
index 21cd81c6b2..66d7587fb0 100644
--- a/libavcodec/Makefile
+++ b/libavcodec/Makefile
@@ -1,4 +1,4 @@
-include $(SUBDIR)../config.mak
+include $(SUBDIR)../ffbuild/config.mak
 
 NAME = avcodec
 
diff --git a/libavdevice/Makefile b/libavdevice/Makefile
index 6139f1944d..fb7623f713 100644
--- a/libavdevice/Makefile
+++ b/libavdevice/Makefile
@@ -1,4 +1,4 @@
-include $(SUBDIR)../config.mak
+include $(SUBDIR)../ffbuild/config.mak
 
 NAME    = avdevice
 
diff --git a/libavfilter/Makefile b/libavfilter/Makefile
index 66c36e4d1d..d19c555c91 100644
--- a/libavfilter/Makefile
+++ b/libavfilter/Makefile
@@ -1,4 +1,4 @@
-include $(SUBDIR)../config.mak
+include $(SUBDIR)../ffbuild/config.mak
 
 NAME = avfilter
 
diff --git a/libavformat/Makefile b/libavformat/Makefile
index 6bdfbe6789..d82639d123 100644
--- a/libavformat/Makefile
+++ b/libavformat/Makefile
@@ -1,4 +1,4 @@
-include $(SUBDIR)../config.mak
+include $(SUBDIR)../ffbuild/config.mak
 
 NAME = avformat
 
diff --git a/libavutil/Makefile b/libavutil/Makefile
index d669a924b0..0239c499f3 100644
--- a/libavutil/Makefile
+++ b/libavutil/Makefile
@@ -1,4 +1,4 @@
-include $(SUBDIR)../config.mak
+include $(SUBDIR)../ffbuild/config.mak
 
 NAME = avutil
 
diff --git a/libpostproc/Makefile b/libpostproc/Makefile
index b9bb4beb8a..3c21f00a21 100644
--- a/libpostproc/Makefile
+++ b/libpostproc/Makefile
@@ -1,4 +1,4 @@
-include $(SUBDIR)../config.mak
+include $(SUBDIR)../ffbuild/config.mak
 
 NAME = postproc
 FFLIBS = avutil
diff --git a/libswresample/Makefile b/libswresample/Makefile
index 120ee3385d..f50ee0d5a0 100644
--- a/libswresample/Makefile
+++ b/libswresample/Makefile
@@ -1,4 +1,4 @@
-include $(SUBDIR)../config.mak
+include $(SUBDIR)../ffbuild/config.mak
 
 NAME = swresample
 FFLIBS = avutil
diff --git a/libswscale/Makefile b/libswscale/Makefile
index 183167cced..19182b370e 100644
--- a/libswscale/Makefile
+++ b/libswscale/Makefile
@@ -1,4 +1,4 @@
-include $(SUBDIR)../config.mak
+include $(SUBDIR)../ffbuild/config.mak
 
 NAME = swscale
 
diff --git a/tests/fate.sh b/tests/fate.sh
index 6fa631ea00..3e106b7181 100755
--- a/tests/fate.sh
+++ b/tests/fate.sh
@@ -85,7 +85,7 @@ clean(){
 report(){
     date=$(date -u +%Y%m%d%H%M%S)
     echo "fate:1:${date}:${slot}:${version}:$1:$2:${branch}:${comment}" >report
-    cat ${build}/config.fate >>report
+    cat ${build}/ffbuild/config.fate >>report
     cat ${build}/tests/data/fate/*.rep >>report 2>/dev/null || for i in ${build}/tests/data/fate/*.rep ; do cat "$i" >>report 2>/dev/null; done
     test -n "$fate_recv" && $tar report *.log | gzip | $fate_recv
 }
@@ -108,7 +108,7 @@ test -d "$src" && update || checkout || die "Error fetching source"
 
 cd ${workdir}
 
-version=$(${src}/version.sh ${src})
+version=$(${src}/ffbuild/version.sh ${src})
 test "$version" = "$(cat version-$slot 2>/dev/null)" && exit 0
 echo ${version} >version-$slot
 


======================================================================

diff --cc .gitignore
index 524fb73c16,f6d97b05f5..177c0f6b0b
--- a/.gitignore
+++ b/.gitignore
@@@ -18,18 -17,14 +18,19 @@@
  *.so.*
  *.swp
  *.ver
 +*_g
 +\#*
 +.\#*
  /.config
  /.version
 -/avconv
 -/avplay
 -/avprobe
 -/avversion.h
 +/ffmpeg
 +/ffplay
 +/ffprobe
 +/ffserver
- /config.*
+ /config.asm
+ /config.h
  /coverage.info
 +/avversion.h
  /lcov/
 +/src
  /mapfile
diff --cc Makefile
index fcee739405,c9fa162d8d..8731d3b6ba
--- a/Makefile
+++ b/Makefile
@@@ -1,47 -1,94 +1,47 @@@
 -include avbuild/config.mak
 +MAIN_MAKEFILE=1
- include config.mak
++include ffbuild/config.mak
  
  vpath %.c    $(SRC_PATH)
 -vpath %.m    $(SRC_PATH)
 +vpath %.cpp  $(SRC_PATH)
  vpath %.h    $(SRC_PATH)
 +vpath %.inc  $(SRC_PATH)
 +vpath %.m    $(SRC_PATH)
  vpath %.S    $(SRC_PATH)
  vpath %.asm  $(SRC_PATH)
 +vpath %.rc   $(SRC_PATH)
  vpath %.v    $(SRC_PATH)
  vpath %.texi $(SRC_PATH)
 +vpath %/fate_config.sh.template $(SRC_PATH)
  
 -ifndef V
 -Q      = @
 -ECHO   = printf "$(1)\t%s\n" $(2)
 -BRIEF  = CC HOSTCC HOSTLD AS YASM AR LD
 -SILENT = DEPCC DEPHOSTCC DEPAS DEPYASM RANLIB RM STRIP
 -MSG    = $@
 -M      = @$(call ECHO,$(TAG),$@);
 -$(foreach VAR,$(BRIEF), \
 -    $(eval override $(VAR) = @$$(call ECHO,$(VAR),$$(MSG)); $($(VAR))))
 -$(foreach VAR,$(SILENT),$(eval override $(VAR) = @$($(VAR))))
 -$(eval INSTALL = @$(call ECHO,INSTALL,$$(^:$(SRC_PATH)/%=%)); $(INSTALL))
 -endif
 -
 -ALLFFLIBS = avcodec avdevice avfilter avformat avresample avutil swscale
 -
 -IFLAGS     := -I. -I$(SRC_PATH)
 -CPPFLAGS   := $(IFLAGS) $(CPPFLAGS)
 -CFLAGS     += $(ECFLAGS)
 -CCFLAGS     = $(CPPFLAGS) $(CFLAGS)
 -OBJCFLAGS  += $(EOBJCFLAGS)
 -OBJCCFLAGS  = $(CPPFLAGS) $(CFLAGS) $(OBJCFLAGS)
 -ASFLAGS    := $(CPPFLAGS) $(ASFLAGS)
 -YASMFLAGS  += $(IFLAGS:%=%/) -Pconfig.asm
 -HOSTCCFLAGS = $(IFLAGS) $(HOSTCPPFLAGS) $(HOSTCFLAGS)
 -LDFLAGS    := $(ALLFFLIBS:%=$(LD_PATH)lib%) $(LDFLAGS)
 -
 -define COMPILE
 -	$(call $(1)DEP,$(1))
 -	$($(1)) $($(1)FLAGS) $($(1)_DEPFLAGS) $($(1)_C) $($(1)_O) $<
 -endef
 -
 -COMPILE_C = $(call COMPILE,CC)
 -COMPILE_S = $(call COMPILE,AS)
 -COMPILE_M = $(call COMPILE,OBJCC)
 -COMPILE_HOSTC = $(call COMPILE,HOSTCC)
 -
 -%.o: %.c
 -	$(COMPILE_C)
 -
 -%.o: %.S
 -	$(COMPILE_S)
 -
 -%.o: %.m
 -	$(COMPILE_M)
 -
 -%_host.o: %.c
 -	$(COMPILE_HOSTC)
 -
 -%.o: %.asm
 -	$(DEPYASM) $(YASMFLAGS) -I $(<D)/ -M -o $@ $< > $(@:.o=.d)
 -	$(YASM) $(YASMFLAGS) -I $(<D)/ -o $@ $<
 -	-$(STRIP) $(STRIPFLAGS) $@
 +AVPROGS-$(CONFIG_FFMPEG)   += ffmpeg
 +AVPROGS-$(CONFIG_FFPLAY)   += ffplay
 +AVPROGS-$(CONFIG_FFPROBE)  += ffprobe
 +AVPROGS-$(CONFIG_FFSERVER) += ffserver
  
 -%.i: %.c
 -	$(CC) $(CCFLAGS) $(CC_E) $<
 -
 -%.h.c:
 -	$(Q)echo '#include "$*.h"' >$@
 -
 -%.c %.h %.ver: TAG = GEN
 -
 -AVPROGS-$(CONFIG_AVCONV)   += avconv
 -AVPROGS-$(CONFIG_AVPLAY)   += avplay
 -AVPROGS-$(CONFIG_AVPROBE)  += avprobe
 -
 -AVPROGS    := $(AVPROGS-yes:%=%$(EXESUF))
 +AVPROGS    := $(AVPROGS-yes:%=%$(PROGSSUF)$(EXESUF))
 +INSTPROGS   = $(AVPROGS-yes:%=%$(PROGSSUF)$(EXESUF))
  PROGS      += $(AVPROGS)
  
 -AVBASENAMES = avconv avplay avprobe
 -ALLAVPROGS  = $(AVBASENAMES:%=%$(EXESUF))
 +AVBASENAMES  = ffmpeg ffplay ffprobe ffserver
 +ALLAVPROGS   = $(AVBASENAMES:%=%$(PROGSSUF)$(EXESUF))
 +ALLAVPROGS_G = $(AVBASENAMES:%=%$(PROGSSUF)_g$(EXESUF))
  
  $(foreach prog,$(AVBASENAMES),$(eval OBJS-$(prog) += cmdutils.o))
 +$(foreach prog,$(AVBASENAMES),$(eval OBJS-$(prog)-$(CONFIG_OPENCL) += cmdutils_opencl.o))
 +
 +OBJS-ffmpeg                   += ffmpeg_opt.o ffmpeg_filter.o
 +OBJS-ffmpeg-$(CONFIG_VIDEOTOOLBOX) += ffmpeg_videotoolbox.o
 +OBJS-ffmpeg-$(CONFIG_LIBMFX)  += ffmpeg_qsv.o
 +OBJS-ffmpeg-$(CONFIG_VAAPI)   += ffmpeg_vaapi.o
 +ifndef CONFIG_VIDEOTOOLBOX
 +OBJS-ffmpeg-$(CONFIG_VDA)     += ffmpeg_videotoolbox.o
 +endif
 +OBJS-ffmpeg-$(CONFIG_CUVID)   += ffmpeg_cuvid.o
 +OBJS-ffmpeg-$(HAVE_DXVA2_LIB) += ffmpeg_dxva2.o
 +OBJS-ffmpeg-$(HAVE_VDPAU_X11) += ffmpeg_vdpau.o
 +OBJS-ffserver                 += ffserver_config.o
  
 -OBJS-avconv                   += avconv_opt.o avconv_filter.o
 -OBJS-avconv-$(CONFIG_LIBMFX)  += avconv_qsv.o
 -OBJS-avconv-$(CONFIG_VAAPI)   += avconv_vaapi.o
 -OBJS-avconv-$(CONFIG_VDA)     += avconv_vda.o
 -OBJS-avconv-$(HAVE_DXVA2_LIB) += avconv_dxva2.o
 -OBJS-avconv-$(HAVE_VDPAU_X11) += avconv_vdpau.o
 -
 -TESTTOOLS   = audiogen videogen rotozoom tiny_psnr base64
 +TESTTOOLS   = audiogen videogen rotozoom tiny_psnr tiny_ssim base64 audiomatch
  HOSTPROGS  := $(TESTTOOLS:%=tests/%) doc/print_options
  
  # $(FFLIBS-yes) needs to be in linking order
@@@ -66,7 -110,7 +66,7 @@@ SKIPHEADERS = cmdutils_common_opts.
  all: all-yes
  
  include $(SRC_PATH)/tools/Makefile
- include $(SRC_PATH)/common.mak
 -include $(SRC_PATH)/avbuild/common.mak
++include $(SRC_PATH)/ffbuild/common.mak
  
  FF_EXTRALIBS := $(FFEXTRALIBS)
  FF_DEP_LIBS  := $(DEP_LIBS)
@@@ -91,8 -129,8 +91,8 @@@ CONFIGURABLE_COMPONENTS 
      $(SRC_PATH)/libavcodec/bitstream_filters.c                      \
      $(SRC_PATH)/libavformat/protocols.c                             \
  
- config.h: .config
- .config: $(CONFIGURABLE_COMPONENTS)
 -config.h: avbuild/.config
 -avbuild/.config: $(CONFIGURABLE_COMPONENTS)
++config.h: ffbuild/.config
++ffbuild/.config: $(CONFIGURABLE_COMPONENTS)
  	@-tput bold 2>/dev/null
  	@-printf '\nWARNING: $(?) newer than config.h, rerun configure\n\n'
  	@-tput sgr0 2>/dev/null
@@@ -115,7 -152,7 +115,7 @@@ SUBDIR := $(1)
  include $(SRC_PATH)/$(1)/Makefile
  -include $(SRC_PATH)/$(1)/$(ARCH)/Makefile
  -include $(SRC_PATH)/$(1)/$(INTRINSICS)/Makefile
- include $(SRC_PATH)/library.mak
 -include $(SRC_PATH)/avbuild/library.mak
++include $(SRC_PATH)/ffbuild/library.mak
  endef
  
  $(foreach D,$(FFLIBS),$(eval $(call DOSUBDIR,lib$(D))))
@@@ -131,25 -168,20 +131,25 @@@ $(1)$(PROGSSUF)_g$(EXESUF): FF_EXTRALIB
  -include $$(OBJS-$(1):.o=.d)
  endef
  
 -$(foreach P,$(PROGS),$(eval $(call DOPROG,$(P:$(EXESUF)=))))
 +$(foreach P,$(PROGS),$(eval $(call DOPROG,$(P:$(PROGSSUF)$(EXESUF)=))))
 +
 +ffprobe.o cmdutils.o libavcodec/utils.o libavformat/utils.o libavdevice/avdevice.o libavfilter/avfilter.o libavutil/utils.o libpostproc/postprocess.o libswresample/swresample.o libswscale/utils.o : libavutil/ffversion.h
  
 -$(PROGS): %$(EXESUF): %.o $(FF_DEP_LIBS)
 +$(PROGS): %$(PROGSSUF)$(EXESUF): %$(PROGSSUF)_g$(EXESUF)
 +	$(CP) $< $@
 +	$(STRIP) $@
 +
 +%$(PROGSSUF)_g$(EXESUF): %.o $(FF_DEP_LIBS)
  	$(LD) $(LDFLAGS) $(LDEXEFLAGS) $(LD_O) $(OBJS-$*) $(FF_EXTRALIBS)
  
- VERSION_SH  = $(SRC_PATH)/version.sh
 -VERSION_SH  = $(SRC_PATH)/avbuild/version.sh
++VERSION_SH  = $(SRC_PATH)/ffbuild/version.sh
  GIT_LOG     = $(SRC_PATH)/.git/logs/HEAD
  
- .version: $(wildcard $(GIT_LOG)) $(VERSION_SH) config.mak
 -.version: $(wildcard $(GIT_LOG)) $(VERSION_SH) avbuild/config.mak
++.version: $(wildcard $(GIT_LOG)) $(VERSION_SH) ffbuild/config.mak
  .version: M=@
  
 -cmdutils.o libavutil/utils.o: avversion.h
 -avversion.h .version:
 -	$(M)$(VERSION_SH) $(SRC_PATH) avversion.h $(EXTRA_VERSION)
 +libavutil/ffversion.h .version:
 +	$(M)$(VERSION_SH) $(SRC_PATH) libavutil/ffversion.h $(EXTRA_VERSION)
  	$(Q)touch .version
  
  # force version.sh to run whenever version might have changed
@@@ -194,16 -221,14 +194,19 @@@ clean:
  
  distclean::
  	$(RM) $(DISTCLEANSUFFIXES)
- 	$(RM) config.* .config libavutil/avconfig.h .version mapfile avversion.h version.h libavutil/ffversion.h libavcodec/codec_names.h libavcodec/bsf_list.c libavformat/protocol_list.c
 -	$(RM) .version avversion.h config.asm config.h mapfile \
 -            avbuild/.config avbuild/config.* libavutil/avconfig.h \
 -            libavcodec/bsf_list.c libavformat/protocol_list.c
++	$(RM) .version avversion.h config.asm config.h mapfile  \
++		ffbuild/.config ffbuild/config.* libavutil/avconfig.h \
++		version.h libavutil/ffversion.h libavcodec/codec_names.h \
++		libavcodec/bsf_list.c libavformat/protocol_list.c
 +ifeq ($(SRC_LINK),src)
 +	$(RM) src
 +endif
 +	$(RM) -rf doc/examples/pc-uninstalled
  
  config:
 -	$(SRC_PATH)/configure $(value LIBAV_CONFIGURATION)
 +	$(SRC_PATH)/configure $(value FFMPEG_CONFIGURATION)
  
 -check: all alltools checkheaders examples testprogs fate
 +check: all alltools examples testprogs fate
  
  include $(SRC_PATH)/tests/Makefile
  
diff --cc configure
index b3cb5b0c1e,bcc5f6ec72..c3fa9d858f
--- a/configure
+++ b/configure
@@@ -77,22 -77,17 +77,22 @@@ Help options
    --list-filters           show all available filters
  
  Standard options:
-   --logfile=FILE           log tests and output to FILE [config.log]
 -  --logfile=FILE           log tests and output to FILE [avbuild/config.log]
++  --logfile=FILE           log tests and output to FILE [ffbuild/config.log]
    --disable-logging        do not log configure debug information
 +  --fatal-warnings         fail if any configure warning is generated
    --prefix=PREFIX          install in PREFIX [$prefix_default]
    --bindir=DIR             install binaries in DIR [PREFIX/bin]
 -  --datadir=DIR            install data files in DIR [PREFIX/share/avconv]
 -  --docdir=DIR             install documentation in DIR [PREFIX/share/doc/libav]
 +  --datadir=DIR            install data files in DIR [PREFIX/share/ffmpeg]
 +  --docdir=DIR             install documentation in DIR [PREFIX/share/doc/ffmpeg]
    --libdir=DIR             install libs in DIR [PREFIX/lib]
 -  --shlibdir=DIR           install shared libs in DIR [PREFIX/lib]
 +  --shlibdir=DIR           install shared libs in DIR [LIBDIR]
    --incdir=DIR             install includes in DIR [PREFIX/include]
    --mandir=DIR             install man page in DIR [PREFIX/share/man]
 -  --enable-rpath           use rpath when linking programs (USE WITH CARE)
 +  --pkgconfigdir=DIR       install pkg-config files in DIR [LIBDIR/pkgconfig]
 +  --enable-rpath           use rpath to allow installing libraries in paths
 +                           not part of the dynamic linker search path
 +                           use rpath when linking programs (USE WITH CARE)
 +  --install-name-dir=DIR   Darwin directory name for installed targets
  
  Licensing options:
    --enable-gpl             allow use of GPL code, the resulting libs
@@@ -3224,7 -2495,7 +3224,7 @@@ doc_deps_any="manpages htmlpages podpag
  
  # default parameters
  
- logfile="config.log"
 -logfile="avbuild/config.log"
++logfile="ffbuild/config.log"
  
  # installation paths
  prefix_default="/usr/local"
@@@ -3581,16 -2808,10 +3581,17 @@@ disable_components()
  
  map 'disable_components $v' $LIBRARY_LIST
  
 -mkdir -p avbuild
 -echo "# $0 $LIBAV_CONFIGURATION" > $logfile
++mkdir -p ffbuild
 +echo "# $0 $FFMPEG_CONFIGURATION" > $logfile
  set >> $logfile
  
 +test -n "$valgrind" && toolchain="valgrind-memcheck"
 +
 +enabled ossfuzz && {
 +    add_cflags  -fsanitize=address,undefined -fsanitize-coverage=trace-pc-guard,trace-cmp -fno-omit-frame-pointer
 +    add_ldflags -fsanitize=address,undefined -fsanitize-coverage=trace-pc-guard,trace-cmp
 +}
 +
  case "$toolchain" in
      *-asan)
          cc_default="${toolchain%-asan}"
@@@ -5152,7 -4124,7 +5153,7 @@@ esc()
      echo "$*" | sed 's/%/%25/g;s/:/%3a/g'
  }
  
- echo "config:$arch:$subarch:$cpu:$target_os:$(esc $cc_ident):$(esc $FFMPEG_CONFIGURATION)" >config.fate
 -echo "config:$arch:$subarch:$cpu:$target_os:$(esc $cc_ident):$(esc $LIBAV_CONFIGURATION)" > avbuild/config.fate
++echo "config:$arch:$subarch:$cpu:$target_os:$(esc $cc_ident):$(esc $FFMPEG_CONFIGURATION)" > ffbuild/config.fate
  
  check_cpp_condition stdlib.h "defined(__PIC__) || defined(__pic__) || defined(PIC)" && enable_weak pic
  
@@@ -6617,15 -5211,11 +6618,15 @@@ fi # test "$quiet" != "yes
  
  test -e Makefile || echo "include $source_path/Makefile" > Makefile
  
 -config_files="$TMPH avbuild/config.mak"
 +enabled stripping || strip="echo skipping strip"
 +
- config_files="$TMPH config.mak doc/config.texi"
++config_files="$TMPH ffbuild/config.mak doc/config.texi"
  
- cat > config.mak <<EOF
 -cat > avbuild/config.mak <<EOF
++cat > ffbuild/config.mak <<EOF
  # Automatically generated by configure - do not modify!
 -LIBAV_CONFIGURATION=$LIBAV_CONFIGURATION
 +ifndef FFMPEG_CONFIG_MAK
 +FFMPEG_CONFIG_MAK=1
 +FFMPEG_CONFIGURATION=$FFMPEG_CONFIGURATION
  prefix=$prefix
  LIBDIR=\$(DESTDIR)$libdir
  SHLIBDIR=\$(DESTDIR)$shlibdir
@@@ -6753,20 -5323,19 +6754,20 @@@ get_version()
      name=$(toupper $lcname)
      file=$source_path/$lcname/version.h
      eval $(awk "/#define ${name}_VERSION_M/ { print \$2 \"=\" \$3 }" "$file")
 +    enabled raise_major && eval ${name}_VERSION_MAJOR=$((${name}_VERSION_MAJOR+100))
      eval ${name}_VERSION=\$${name}_VERSION_MAJOR.\$${name}_VERSION_MINOR.\$${name}_VERSION_MICRO
-     eval echo "${lcname}_VERSION=\$${name}_VERSION" >> config.mak
-     eval echo "${lcname}_VERSION_MAJOR=\$${name}_VERSION_MAJOR" >> config.mak
-     eval echo "${lcname}_VERSION_MINOR=\$${name}_VERSION_MINOR" >> config.mak
 -    eval echo "${lcname}_VERSION=\$${name}_VERSION"             >> avbuild/config.mak
 -    eval echo "${lcname}_VERSION_MAJOR=\$${name}_VERSION_MAJOR" >> avbuild/config.mak
 -    eval echo "${lcname}_VERSION_MINOR=\$${name}_VERSION_MINOR" >> avbuild/config.mak
++    eval echo "${lcname}_VERSION=\$${name}_VERSION"             >> ffbuild/config.mak
++    eval echo "${lcname}_VERSION_MAJOR=\$${name}_VERSION_MAJOR" >> ffbuild/config.mak
++    eval echo "${lcname}_VERSION_MINOR=\$${name}_VERSION_MINOR" >> ffbuild/config.mak
  }
  
  map 'get_version $v' $LIBRARY_LIST
  
- map 'eval echo "${v}_FFLIBS=\$${v}_deps" >> config.mak' $LIBRARY_LIST
 -map 'eval echo "${v}_FFLIBS=\$${v}_deps" >> avbuild/config.mak' $LIBRARY_LIST
++map 'eval echo "${v}_FFLIBS=\$${v}_deps" >> ffbuild/config.mak' $LIBRARY_LIST
  
  print_program_extralibs(){
      eval "program_extralibs=\$${1}_extralibs"
-     eval echo "EXTRALIBS-${1}=${program_extralibs}" >> config.mak
 -    eval echo "EXTRALIBS-${1}=${program_extralibs}" >> avbuild/config.mak
++    eval echo "EXTRALIBS-${1}=${program_extralibs}" >> ffbuild/config.mak
  }
  
  map 'print_program_extralibs $v' $PROGRAM_LIST
@@@ -6815,12 -5370,11 +6816,12 @@@ print_config CONFIG_ "$config_files" $C
                                       $CONFIG_EXTRA      \
                                       $ALL_COMPONENTS    \
  
 -echo "#endif /* LIBAV_CONFIG_H */" >> $TMPH
 +echo "#endif /* FFMPEG_CONFIG_H */" >> $TMPH
- echo "endif # FFMPEG_CONFIG_MAK" >> config.mak
++echo "endif # FFMPEG_CONFIG_MAK" >> ffbuild/config.mak
  
  # Do not overwrite an unchanged config.h to avoid superfluous rebuilds.
  cp_if_changed $TMPH config.h
- touch .config
 -touch avbuild/.config
++touch ffbuild/.config
  
  enabled yasm && cp_if_changed $TMPASM config.asm
  
diff --cc doc/Makefile
index c193fc3a66,bda815307c..4cc9eedd12
--- a/doc/Makefile
+++ b/doc/Makefile
@@@ -127,29 -73,19 +127,29 @@@ $(DOCS) doc/doxy/html: | doc
  $(DOC_EXAMPLES:%$(EXESUF)=%.o): | doc/examples
  OBJDIRS += doc/examples
  
 -DOXY_INPUT      = $(addprefix $(SRC_PATH)/, $(INSTHEADERS) $(DOC_EXAMPLES:%$(EXESUF)=%.c) $(LIB_EXAMPLES:%$(EXESUF)=%.c))
 -DOXY_TEMPLATES  = doxy_stylesheet.css footer.html header.html
 -DOXY_TEMPLATES := $(addprefix $(SRC_PATH)/doc/doxy/, $(DOXY_TEMPLATES))
 +DOXY_INPUT      = $(INSTHEADERS) $(DOC_EXAMPLES:%$(EXESUF)=%.c) $(LIB_EXAMPLES:%$(EXESUF)=%.c)
- DOXY_INPUT_DEPS = $(addprefix $(SRC_PATH)/, $(DOXY_INPUT)) config.mak
++DOXY_INPUT_DEPS = $(addprefix $(SRC_PATH)/, $(DOXY_INPUT)) ffbuild/config.mak
 +
 +doc/doxy/html: TAG = DOXY
 +doc/doxy/html: $(SRC_PATH)/doc/Doxyfile $(SRC_PATH)/doc/doxy-wrapper.sh $(DOXY_INPUT_DEPS)
 +	$(M)OUT_DIR=$$PWD/doc/doxy; cd $(SRC_PATH); ./doc/doxy-wrapper.sh $$OUT_DIR $< $(DOXYGEN) $(DOXY_INPUT);
 +
 +install-doc: install-html install-man
 +
 +install-html:
  
 -doc/doxy/html: $(SRC_PATH)/doc/Doxyfile $(DOXY_INPUT) $(DOXY_TEMPLATES)
 -	$(M)$(SRC_PATH)/doc/doxy-wrapper.sh $(SRC_PATH) $< $(DOXY_INPUT)
 +install-man:
  
 -install-progs-$(CONFIG_POD2MAN): install-man
 -install-progs-$(CONFIG_TEXI2HTML): install-doc
 +ifdef CONFIG_HTMLPAGES
 +install-progs-$(CONFIG_DOC): install-html
  
 -install-doc: $(HTMLPAGES)
 +install-html: $(HTMLPAGES)
  	$(Q)mkdir -p "$(DOCDIR)"
  	$(INSTALL) -m 644 $(HTMLPAGES) "$(DOCDIR)"
 +endif
 +
 +ifdef CONFIG_MANPAGES
 +install-progs-$(CONFIG_DOC): install-man
  
  install-man: $(MANPAGES)
  	$(Q)mkdir -p "$(MANDIR)/man1"
diff --cc doc/writing_filters.txt
index 66ebb53243,0000000000..5cd4ecd6a4
mode 100644,000000..100644
--- a/doc/writing_filters.txt
+++ b/doc/writing_filters.txt
@@@ -1,423 -1,0 +1,423 @@@
 +This document is a tutorial/initiation for writing simple filters in
 +libavfilter.
 +
 +Foreword: just like everything else in FFmpeg, libavfilter is monolithic, which
 +means that it is highly recommended that you submit your filters to the FFmpeg
 +development mailing-list and make sure that they are applied. Otherwise, your filters
 +are likely to have a very short lifetime due to more or less regular internal API
 +changes, and a limited distribution, review, and testing.
 +
 +Bootstrap
 +=========
 +
 +Let's say you want to write a new simple video filter called "foobar" which
 +takes one frame in input, changes the pixels in whatever fashion you fancy, and
 +outputs the modified frame. The most simple way of doing this is to take a
 +similar filter.  We'll pick edgedetect, but any other should do. You can look
 +for others using the `./ffmpeg -v 0 -filters|grep ' V->V '` command.
 +
 + - sed 's/edgedetect/foobar/g;s/EdgeDetect/Foobar/g' libavfilter/vf_edgedetect.c > libavfilter/vf_foobar.c
 + - edit libavfilter/Makefile, and add an entry for "foobar" following the
 +   pattern of the other filters.
 + - edit libavfilter/allfilters.c, and add an entry for "foobar" following the
 +   pattern of the other filters.
 + - ./configure ...
 + - make -j<whatever> ffmpeg
 + - ./ffmpeg -i http://samples.ffmpeg.org/image-samples/lena.pnm -vf foobar foobar.png
 +   Note here: you can obviously use a random local image instead of a remote URL.
 +
 +If everything went right, you should get a foobar.png with Lena edge-detected.
 +
 +That's it, your new playground is ready.
 +
 +Some little details about what's going on:
 +libavfilter/allfilters.c:avfilter_register_all() is called at runtime to create
 +a list of the available filters, but it's important to know that this file is
 +also parsed by the configure script, which in turn will define variables for
 +the build system and the C:
 +
 +    --- after running configure ---
 +
-     $ grep FOOBAR config.mak
++    $ grep FOOBAR ffbuild/config.mak
 +    CONFIG_FOOBAR_FILTER=yes
 +    $ grep FOOBAR config.h
 +    #define CONFIG_FOOBAR_FILTER 1
 +
- CONFIG_FOOBAR_FILTER=yes from the config.mak is later used to enable the filter in
- libavfilter/Makefile and CONFIG_FOOBAR_FILTER=1 from the config.h will be used
- for registering the filter in libavfilter/allfilters.c.
++CONFIG_FOOBAR_FILTER=yes from the ffbuild/config.mak is later used to enable
++the filter in libavfilter/Makefile and CONFIG_FOOBAR_FILTER=1 from the config.h
++will be used for registering the filter in libavfilter/allfilters.c.
 +
 +Filter code layout
 +==================
 +
 +You now need some theory about the general code layout of a filter. Open your
 +libavfilter/vf_foobar.c. This section will detail the important parts of the
 +code you need to understand before messing with it.
 +
 +Copyright
 +---------
 +
 +First chunk is the copyright. Most filters are LGPL, and we are assuming
 +vf_foobar is as well. We are also assuming vf_foobar is not an edge detector
 +filter, so you can update the boilerplate with your credits.
 +
 +Doxy
 +----
 +
 +Next chunk is the Doxygen about the file. See https://ffmpeg.org/doxygen/trunk/.
 +Detail here what the filter is, does, and add some references if you feel like
 +it.
 +
 +Context
 +-------
 +
 +Skip the headers and scroll down to the definition of FoobarContext. This is
 +your local state context. It is already filled with 0 when you get it so do not
 +worry about uninitialized reads into this context. This is where you put all
 +"global" information that you need; typically the variables storing the user options.
 +You'll notice the first field "const AVClass *class"; it's the only field you
 +need to keep assuming you have a context. There is some magic you don't need to
 +care about around this field, just let it be (in the first position) for now.
 +
 +Options
 +-------
 +
 +Then comes the options array. This is what will define the user accessible
 +options. For example, -vf foobar=mode=colormix:high=0.4:low=0.1. Most options
 +have the following pattern:
 +  name, description, offset, type, default value, minimum value, maximum value, flags
 +
 + - name is the option name, keep it simple and lowercase
 + - description are short, in lowercase, without period, and describe what they
 +   do, for example "set the foo of the bar"
 + - offset is the offset of the field in your local context, see the OFFSET()
 +   macro; the option parser will use that information to fill the fields
 +   according to the user input
 + - type is any of AV_OPT_TYPE_* defined in libavutil/opt.h
 + - default value is an union where you pick the appropriate type; "{.dbl=0.3}",
 +   "{.i64=0x234}", "{.str=NULL}", ...
 + - min and max values define the range of available values, inclusive
 + - flags are AVOption generic flags. See AV_OPT_FLAG_* definitions
 +
 +When in doubt, just look at the other AVOption definitions all around the codebase,
 +there are tons of examples.
 +
 +Class
 +-----
 +
 +AVFILTER_DEFINE_CLASS(foobar) will define a unique foobar_class with some kind
 +of signature referencing the options, etc. which will be referenced in the
 +definition of the AVFilter.
 +
 +Filter definition
 +-----------------
 +
 +At the end of the file, you will find foobar_inputs, foobar_outputs and
 +the AVFilter ff_vf_foobar. Don't forget to update the AVFilter.description with
 +a description of what the filter does, starting with a capitalized letter and
 +ending with a period. You'd better drop the AVFilter.flags entry for now, and
 +re-add them later depending on the capabilities of your filter.
 +
 +Callbacks
 +---------
 +
 +Let's now study the common callbacks. Before going into details, note that all
 +these callbacks are explained in details in libavfilter/avfilter.h, so in
 +doubt, refer to the doxy in that file.
 +
 +init()
 +~~~~~~
 +
 +First one to be called is init(). It's flagged as cold because not called
 +often. Look for "cold" on
 +http://gcc.gnu.org/onlinedocs/gcc/Function-Attributes.html for more
 +information.
 +
 +As the name suggests, init() is where you eventually initialize and allocate
 +your buffers, pre-compute your data, etc. Note that at this point, your local
 +context already has the user options initialized, but you still haven't any
 +clue about the kind of data input you will get, so this function is often
 +mainly used to sanitize the user options.
 +
 +Some init()s will also define the number of inputs or outputs dynamically
 +according to the user options. A good example of this is the split filter, but
 +we won't cover this here since vf_foobar is just a simple 1:1 filter.
 +
 +uninit()
 +~~~~~~~~
 +
 +Similarly, there is the uninit() callback, doing what the name suggests. Free
 +everything you allocated here.
 +
 +query_formats()
 +~~~~~~~~~~~~~~~
 +
 +This follows the init() and is used for the format negotiation. Basically
 +you specify here what pixel format(s) (gray, rgb 32, yuv 4:2:0, ...) you accept
 +for your inputs, and what you can output. All pixel formats are defined in
 +libavutil/pixfmt.h. If you don't change the pixel format between the input and
 +the output, you just have to define a pixel formats array and call
 +ff_set_common_formats(). For more complex negotiation, you can refer to other
 +filters such as vf_scale.
 +
 +config_props()
 +~~~~~~~~~~~~~~
 +
 +This callback is not necessary, but you will probably have one or more
 +config_props() anyway. It's not a callback for the filter itself but for its
 +inputs or outputs (they're called "pads" - AVFilterPad - in libavfilter's
 +lexicon).
 +
 +Inside the input config_props(), you are at a point where you know which pixel
 +format has been picked after query_formats(), and more information such as the
 +video width and height (inlink->{w,h}). So if you need to update your internal
 +context state depending on your input you can do it here. In edgedetect you can
 +see that this callback is used to allocate buffers depending on these
 +information. They will be destroyed in uninit().
 +
 +Inside the output config_props(), you can define what you want to change in the
 +output. Typically, if your filter is going to double the size of the video, you
 +will update outlink->w and outlink->h.
 +
 +filter_frame()
 +~~~~~~~~~~~~~~
 +
 +This is the callback you are waiting for from the beginning: it is where you
 +process the received frames. Along with the frame, you get the input link from
 +where the frame comes from.
 +
 +    static int filter_frame(AVFilterLink *inlink, AVFrame *in) { ... }
 +
 +You can get the filter context through that input link:
 +
 +    AVFilterContext *ctx = inlink->dst;
 +
 +Then access your internal state context:
 +
 +    FoobarContext *foobar = ctx->priv;
 +
 +And also the output link where you will send your frame when you are done:
 +
 +    AVFilterLink *outlink = ctx->outputs[0];
 +
 +Here, we are picking the first output. You can have several, but in our case we
 +only have one since we are in a 1:1 input-output situation.
 +
 +If you want to define a simple pass-through filter, you can just do:
 +
 +    return ff_filter_frame(outlink, in);
 +
 +But of course, you probably want to change the data of that frame.
 +
 +This can be done by accessing frame->data[] and frame->linesize[].  Important
 +note here: the width does NOT match the linesize. The linesize is always
 +greater or equal to the width. The padding created should not be changed or
 +even read. Typically, keep in mind that a previous filter in your chain might
 +have altered the frame dimension but not the linesize. Imagine a crop filter
 +that halves the video size: the linesizes won't be changed, just the width.
 +
 +    <-------------- linesize ------------------------>
 +    +-------------------------------+----------------+ ^
 +    |                               |                | |
 +    |                               |                | |
 +    |           picture             |    padding     | | height
 +    |                               |                | |
 +    |                               |                | |
 +    +-------------------------------+----------------+ v
 +    <----------- width ------------->
 +
 +Before modifying the "in" frame, you have to make sure it is writable, or get a
 +new one. Multiple scenarios are possible here depending on the kind of
 +processing you are doing.
 +
 +Let's say you want to change one pixel depending on multiple pixels (typically
 +the surrounding ones) of the input. In that case, you can't do an in-place
 +processing of the input so you will need to allocate a new frame, with the same
 +properties as the input one, and send that new frame to the next filter:
 +
 +    AVFrame *out = ff_get_video_buffer(outlink, outlink->w, outlink->h);
 +    if (!out) {
 +        av_frame_free(&in);
 +        return AVERROR(ENOMEM);
 +    }
 +    av_frame_copy_props(out, in);
 +
 +    // out->data[...] = foobar(in->data[...])
 +
 +    av_frame_free(&in);
 +    return ff_filter_frame(outlink, out);
 +
 +In-place processing
 +~~~~~~~~~~~~~~~~~~~
 +
 +If you can just alter the input frame, you probably just want to do that
 +instead:
 +
 +    av_frame_make_writable(in);
 +    // in->data[...] = foobar(in->data[...])
 +    return ff_filter_frame(outlink, in);
 +
 +You may wonder why a frame might not be writable. The answer is that for
 +example a previous filter might still own the frame data: imagine a filter
 +prior to yours in the filtergraph that needs to cache the frame. You must not
 +alter that frame, otherwise it will make that previous filter buggy. This is
 +where av_frame_make_writable() helps (it won't have any effect if the frame
 +already is writable).
 +
 +The problem with using av_frame_make_writable() is that in the worst case it
 +will copy the whole input frame before you change it all over again with your
 +filter: if the frame is not writable, av_frame_make_writable() will allocate
 +new buffers, and copy the input frame data. You don't want that, and you can
 +avoid it by just allocating a new buffer if necessary, and process from in to
 +out in your filter, saving the memcpy. Generally, this is done following this
 +scheme:
 +
 +    int direct = 0;
 +    AVFrame *out;
 +
 +    if (av_frame_is_writable(in)) {
 +        direct = 1;
 +        out = in;
 +    } else {
 +        out = ff_get_video_buffer(outlink, outlink->w, outlink->h);
 +        if (!out) {
 +            av_frame_free(&in);
 +            return AVERROR(ENOMEM);
 +        }
 +        av_frame_copy_props(out, in);
 +    }
 +
 +    // out->data[...] = foobar(in->data[...])
 +
 +    if (!direct)
 +        av_frame_free(&in);
 +    return ff_filter_frame(outlink, out);
 +
 +Of course, this will only work if you can do in-place processing. To test if
 +your filter handles well the permissions, you can use the perms filter. For
 +example with:
 +
 +    -vf perms=random,foobar
 +
 +Make sure no automatic pixel conversion is inserted between perms and foobar,
 +otherwise the frames permissions might change again and the test will be
 +meaningless: add av_log(0,0,"direct=%d\n",direct) in your code to check that.
 +You can avoid the issue with something like:
 +
 +    -vf format=rgb24,perms=random,foobar
 +
 +...assuming your filter accepts rgb24 of course. This will make sure the
 +necessary conversion is inserted before the perms filter.
 +
 +Timeline
 +~~~~~~~~
 +
 +Adding timeline support
 +(http://ffmpeg.org/ffmpeg-filters.html#Timeline-editing) is often an easy
 +feature to add. In the most simple case, you just have to add
 +AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC to the AVFilter.flags. You can typically
 +do this when your filter does not need to save the previous context frames, or
 +basically if your filter just alters whatever goes in and doesn't need
 +previous/future information. See for instance commit 86cb986ce that adds
 +timeline support to the fieldorder filter.
 +
 +In some cases, you might need to reset your context somehow. This is handled by
 +the AVFILTER_FLAG_SUPPORT_TIMELINE_INTERNAL flag which is used if the filter
 +must not process the frames but still wants to keep track of the frames going
 +through (to keep them in cache for when it's enabled again). See for example
 +commit 69d72140a that adds timeline support to the phase filter.
 +
 +Threading
 +~~~~~~~~~
 +
 +libavfilter does not yet support frame threading, but you can add slice
 +threading to your filters.
 +
 +Let's say the foobar filter has the following frame processing function:
 +
 +    dst = out->data[0];
 +    src = in ->data[0];
 +
 +    for (y = 0; y < inlink->h; y++) {
 +        for (x = 0; x < inlink->w; x++)
 +            dst[x] = foobar(src[x]);
 +        dst += out->linesize[0];
 +        src += in ->linesize[0];
 +    }
 +
 +The first thing is to make this function work into slices. The new code will
 +look like this:
 +
 +    for (y = slice_start; y < slice_end; y++) {
 +        for (x = 0; x < inlink->w; x++)
 +            dst[x] = foobar(src[x]);
 +        dst += out->linesize[0];
 +        src += in ->linesize[0];
 +    }
 +
 +The source and destination pointers, and slice_start/slice_end will be defined
 +according to the number of jobs. Generally, it looks like this:
 +
 +    const int slice_start = (in->height *  jobnr   ) / nb_jobs;
 +    const int slice_end   = (in->height * (jobnr+1)) / nb_jobs;
 +    uint8_t       *dst = out->data[0] + slice_start * out->linesize[0];
 +    const uint8_t *src =  in->data[0] + slice_start *  in->linesize[0];
 +
 +This new code will be isolated in a new filter_slice():
 +
 +    static int filter_slice(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs) { ... }
 +
 +Note that we need our input and output frame to define slice_{start,end} and
 +dst/src, which are not available in that callback. They will be transmitted
 +through the opaque void *arg. You have to define a structure which contains
 +everything you need:
 +
 +    typedef struct ThreadData {
 +        AVFrame *in, *out;
 +    } ThreadData;
 +
 +If you need some more information from your local context, put them here.
 +
 +In you filter_slice function, you access it like that:
 +
 +    const ThreadData *td = arg;
 +
 +Then in your filter_frame() callback, you need to call the threading
 +distributor with something like this:
 +
 +    ThreadData td;
 +
 +    // ...
 +
 +    td.in  = in;
 +    td.out = out;
 +    ctx->internal->execute(ctx, filter_slice, &td, NULL, FFMIN(outlink->h, ctx->graph->nb_threads));
 +
 +    // ...
 +
 +    return ff_filter_frame(outlink, out);
 +
 +Last step is to add AVFILTER_FLAG_SLICE_THREADS flag to AVFilter.flags.
 +
 +For more example of slice threading additions, you can try to run git log -p
 +--grep 'slice threading' libavfilter/
 +
 +Finalization
 +~~~~~~~~~~~~
 +
 +When your awesome filter is finished, you have a few more steps before you're
 +done:
 +
 + - write its documentation in doc/filters.texi, and test the output with make
 +   doc/ffmpeg-filters.html.
 + - add a FATE test, generally by adding an entry in
 +   tests/fate/filter-video.mak, add running make fate-filter-foobar GEN=1 to
 +   generate the data.
 + - add an entry in the Changelog
 + - edit libavfilter/version.h and increase LIBAVFILTER_VERSION_MINOR by one
 +   (and reset LIBAVFILTER_VERSION_MICRO to 100)
 + - git add ... && git commit -m "avfilter: add foobar filter." && git format-patch -1
 +
 +When all of this is done, you can submit your patch to the ffmpeg-devel
 +mailing-list for review.  If you need any help, feel free to come on our IRC
 +channel, #ffmpeg-devel on irc.freenode.net.
diff --cc ffbuild/.gitignore
index 0000000000,693b7aa0d3..693b7aa0d3
mode 000000,100644..100644
--- a/ffbuild/.gitignore
+++ b/ffbuild/.gitignore
diff --cc ffbuild/arch.mak
index 08f78b4efc,0000000000..08f78b4efc
mode 100644,000000..100644
--- a/ffbuild/arch.mak
+++ b/ffbuild/arch.mak
diff --cc ffbuild/common.mak
index 909dfc1bb6,0000000000..195737028a
mode 100644,000000..100644
--- a/ffbuild/common.mak
+++ b/ffbuild/common.mak
@@@ -1,168 -1,0 +1,168 @@@
 +#
 +# common bits used by all libraries
 +#
 +
 +DEFAULT_YASMD=.dbg
 +
 +ifeq ($(DBG),1)
 +YASMD=$(DEFAULT_YASMD)
 +else
 +YASMD=
 +endif
 +
 +ifndef SUBDIR
 +
 +ifndef V
 +Q      = @
 +ECHO   = printf "$(1)\t%s\n" $(2)
 +BRIEF  = CC CXX OBJCC HOSTCC HOSTLD AS YASM AR LD STRIP CP WINDRES
 +SILENT = DEPCC DEPHOSTCC DEPAS DEPYASM RANLIB RM
 +
 +MSG    = $@
 +M      = @$(call ECHO,$(TAG),$@);
 +$(foreach VAR,$(BRIEF), \
 +    $(eval override $(VAR) = @$$(call ECHO,$(VAR),$$(MSG)); $($(VAR))))
 +$(foreach VAR,$(SILENT),$(eval override $(VAR) = @$($(VAR))))
 +$(eval INSTALL = @$(call ECHO,INSTALL,$$(^:$(SRC_DIR)/%=%)); $(INSTALL))
 +endif
 +
 +ALLFFLIBS = avcodec avdevice avfilter avformat avresample avutil postproc swscale swresample
 +
 +# NASM requires -I path terminated with /
 +IFLAGS     := -I. -I$(SRC_LINK)/
 +CPPFLAGS   := $(IFLAGS) $(CPPFLAGS)
 +CFLAGS     += $(ECFLAGS)
 +CCFLAGS     = $(CPPFLAGS) $(CFLAGS)
 +OBJCFLAGS  += $(EOBJCFLAGS)
 +OBJCCFLAGS  = $(CPPFLAGS) $(CFLAGS) $(OBJCFLAGS)
 +ASFLAGS    := $(CPPFLAGS) $(ASFLAGS)
 +CXXFLAGS   := $(CPPFLAGS) $(CFLAGS) $(CXXFLAGS)
 +YASMFLAGS  += $(IFLAGS:%=%/) -Pconfig.asm
 +
 +HOSTCCFLAGS = $(IFLAGS) $(HOSTCPPFLAGS) $(HOSTCFLAGS)
 +LDFLAGS    := $(ALLFFLIBS:%=$(LD_PATH)lib%) $(LDFLAGS)
 +
 +define COMPILE
 +       $(call $(1)DEP,$(1))
 +       $($(1)) $($(1)FLAGS) $($(1)_DEPFLAGS) $($(1)_C) $($(1)_O) $(patsubst $(SRC_PATH)/%,$(SRC_LINK)/%,$<)
 +endef
 +
 +COMPILE_C = $(call COMPILE,CC)
 +COMPILE_CXX = $(call COMPILE,CXX)
 +COMPILE_S = $(call COMPILE,AS)
 +COMPILE_M = $(call COMPILE,OBJCC)
 +COMPILE_HOSTC = $(call COMPILE,HOSTCC)
 +
 +%.o: %.c
 +	$(COMPILE_C)
 +
 +%.o: %.cpp
 +	$(COMPILE_CXX)
 +
 +%.o: %.m
 +	$(COMPILE_M)
 +
 +%.s: %.c
 +	$(CC) $(CCFLAGS) -S -o $@ $<
 +
 +%.o: %.S
 +	$(COMPILE_S)
 +
 +%_host.o: %.c
 +	$(COMPILE_HOSTC)
 +
 +%$(DEFAULT_YASMD).asm: %.asm
 +	$(DEPYASM) $(YASMFLAGS) -I $(<D)/ -M -o $@ $< > $(@:.asm=.d)
 +	$(YASM) $(YASMFLAGS) -I $(<D)/ -e $< | sed '/^%/d;/^$$/d;' > $@
 +
 +%.o: %.asm
 +	$(DEPYASM) $(YASMFLAGS) -I $(<D)/ -M -o $@ $< > $(@:.o=.d)
 +	$(YASM) $(YASMFLAGS) -I $(<D)/ -o $@ $(patsubst $(SRC_PATH)/%,$(SRC_LINK)/%,$<)
 +	-$(if $(ASMSTRIPFLAGS), $(STRIP) $(ASMSTRIPFLAGS) $@)
 +
 +%.o: %.rc
 +	$(WINDRES) $(IFLAGS) --preprocessor "$(DEPWINDRES) -E -xc-header -DRC_INVOKED $(CC_DEPFLAGS)" -o $@ $<
 +
 +%.i: %.c
 +	$(CC) $(CCFLAGS) $(CC_E) $<
 +
 +%.h.c:
 +	$(Q)echo '#include "$*.h"' >$@
 +
 +%.c %.h %.ver: TAG = GEN
 +
 +# Dummy rule to stop make trying to rebuild removed or renamed headers
 +%.h:
 +	@:
 +
 +# Disable suffix rules.  Most of the builtin rules are suffix rules,
 +# so this saves some time on slow systems.
 +.SUFFIXES:
 +
 +# Do not delete intermediate files from chains of implicit rules
 +$(OBJS):
 +endif
 +
- include $(SRC_PATH)/arch.mak
++include $(SRC_PATH)/ffbuild/arch.mak
 +
 +OBJS      += $(OBJS-yes)
 +SLIBOBJS  += $(SLIBOBJS-yes)
 +FFLIBS    := $($(NAME)_FFLIBS) $(FFLIBS-yes) $(FFLIBS)
 +TESTPROGS += $(TESTPROGS-yes)
 +
 +LDLIBS       = $(FFLIBS:%=%$(BUILDSUF))
 +FFEXTRALIBS := $(LDLIBS:%=$(LD_LIB)) $(EXTRALIBS)
 +
 +OBJS      := $(sort $(OBJS:%=$(SUBDIR)%))
 +SLIBOBJS  := $(sort $(SLIBOBJS:%=$(SUBDIR)%))
 +TESTOBJS  := $(TESTOBJS:%=$(SUBDIR)tests/%) $(TESTPROGS:%=$(SUBDIR)tests/%.o)
 +TESTPROGS := $(TESTPROGS:%=$(SUBDIR)tests/%$(EXESUF))
 +HOSTOBJS  := $(HOSTPROGS:%=$(SUBDIR)%.o)
 +HOSTPROGS := $(HOSTPROGS:%=$(SUBDIR)%$(HOSTEXESUF))
 +TOOLS     += $(TOOLS-yes)
 +TOOLOBJS  := $(TOOLS:%=tools/%.o)
 +TOOLS     := $(TOOLS:%=tools/%$(EXESUF))
 +HEADERS   += $(HEADERS-yes)
 +
 +PATH_LIBNAME = $(foreach NAME,$(1),lib$(NAME)/$($(2)LIBNAME))
 +DEP_LIBS := $(foreach lib,$(FFLIBS),$(call PATH_LIBNAME,$(lib),$(CONFIG_SHARED:yes=S)))
 +STATIC_DEP_LIBS := $(foreach lib,$(FFLIBS),$(call PATH_LIBNAME,$(lib)))
 +
 +SRC_DIR    := $(SRC_PATH)/lib$(NAME)
 +ALLHEADERS := $(subst $(SRC_DIR)/,$(SUBDIR),$(wildcard $(SRC_DIR)/*.h $(SRC_DIR)/$(ARCH)/*.h))
 +SKIPHEADERS += $(ARCH_HEADERS:%=$(ARCH)/%) $(SKIPHEADERS-)
 +SKIPHEADERS := $(SKIPHEADERS:%=$(SUBDIR)%)
 +HOBJS        = $(filter-out $(SKIPHEADERS:.h=.h.o),$(ALLHEADERS:.h=.h.o))
 +$(HOBJS):     CCFLAGS += $(CFLAGS_HEADERS)
 +checkheaders: $(HOBJS)
 +.SECONDARY:   $(HOBJS:.o=.c)
 +
 +alltools: $(TOOLS)
 +
 +$(HOSTOBJS): %.o: %.c
 +	$(COMPILE_HOSTC)
 +
 +$(HOSTPROGS): %$(HOSTEXESUF): %.o
 +	$(HOSTLD) $(HOSTLDFLAGS) $(HOSTLD_O) $^ $(HOSTEXTRALIBS)
 +
 +$(OBJS):     | $(sort $(dir $(OBJS)))
 +$(HOBJS):    | $(sort $(dir $(HOBJS)))
 +$(HOSTOBJS): | $(sort $(dir $(HOSTOBJS)))
 +$(SLIBOBJS): | $(sort $(dir $(SLIBOBJS)))
 +$(TESTOBJS): | $(sort $(dir $(TESTOBJS)))
 +$(TOOLOBJS): | tools
 +
 +OBJDIRS := $(OBJDIRS) $(dir $(OBJS) $(HOBJS) $(HOSTOBJS) $(SLIBOBJS) $(TESTOBJS))
 +
 +CLEANSUFFIXES     = *.d *.o *~ *.h.c *.gcda *.gcno *.map *.ver *.ho *$(DEFAULT_YASMD).asm
 +DISTCLEANSUFFIXES = *.pc
 +LIBSUFFIXES       = *.a *.lib *.so *.so.* *.dylib *.dll *.def *.dll.a
 +
 +define RULES
 +clean::
 +	$(RM) $(HOSTPROGS) $(TESTPROGS) $(TOOLS)
 +endef
 +
 +$(eval $(RULES))
 +
 +-include $(wildcard $(OBJS:.o=.d) $(HOSTOBJS:.o=.d) $(TESTOBJS:.o=.d) $(HOBJS:.o=.d) $(SLIBOBJS:.o=.d)) $(OBJS:.o=$(DEFAULT_YASMD).d)
diff --cc ffbuild/library.mak
index 266176f1ae,0000000000..5e576d18cd
mode 100644,000000..100644
--- a/ffbuild/library.mak
+++ b/ffbuild/library.mak
@@@ -1,98 -1,0 +1,98 @@@
- include $(SRC_PATH)/common.mak
++include $(SRC_PATH)/ffbuild/common.mak
 +
 +LIBVERSION := $(lib$(NAME)_VERSION)
 +LIBMAJOR   := $(lib$(NAME)_VERSION_MAJOR)
 +LIBMINOR   := $(lib$(NAME)_VERSION_MINOR)
 +INCINSTDIR := $(INCDIR)/lib$(NAME)
 +
 +INSTHEADERS := $(INSTHEADERS) $(HEADERS:%=$(SUBDIR)%)
 +
 +all-$(CONFIG_STATIC): $(SUBDIR)$(LIBNAME)
 +all-$(CONFIG_SHARED): $(SUBDIR)$(SLIBNAME)
 +
 +LIBOBJS := $(OBJS) $(SUBDIR)%.h.o $(TESTOBJS)
 +$(LIBOBJS) $(LIBOBJS:.o=.s) $(LIBOBJS:.o=.i):   CPPFLAGS += -DHAVE_AV_CONFIG_H
 +$(TESTOBJS) $(TESTOBJS:.o=.i): CFLAGS += -Umain
 +
 +$(SUBDIR)$(LIBNAME): $(OBJS)
 +	$(RM) $@
 +	$(AR) $(ARFLAGS) $(AR_O) $^
 +	$(RANLIB) $@
 +
 +install-headers: install-lib$(NAME)-headers install-lib$(NAME)-pkgconfig
 +
 +install-libs-$(CONFIG_STATIC): install-lib$(NAME)-static
 +install-libs-$(CONFIG_SHARED): install-lib$(NAME)-shared
 +
 +define RULES
 +$(TOOLS):     THISLIB = $(FULLNAME:%=$(LD_LIB))
 +$(TESTPROGS): THISLIB = $(SUBDIR)$(LIBNAME)
 +
 +$(TESTPROGS) $(TOOLS): %$(EXESUF): %.o
 +	$$(LD) $(LDFLAGS) $(LDEXEFLAGS) $$(LD_O) $$(filter %.o,$$^) $$(THISLIB) $(FFEXTRALIBS) $$(ELIBS)
 +
 +$(SUBDIR)lib$(NAME).ver: $(SUBDIR)lib$(NAME).v $(OBJS)
 +	$$(M)sed 's/MAJOR/$(lib$(NAME)_VERSION_MAJOR)/' $$< | $(VERSION_SCRIPT_POSTPROCESS_CMD) > $$@
 +
 +$(SUBDIR)$(SLIBNAME): $(SUBDIR)$(SLIBNAME_WITH_MAJOR)
 +	$(Q)cd ./$(SUBDIR) && $(LN_S) $(SLIBNAME_WITH_MAJOR) $(SLIBNAME)
 +
 +$(SUBDIR)$(SLIBNAME_WITH_MAJOR): $(OBJS) $(SLIBOBJS) $(SUBDIR)lib$(NAME).ver
 +	$(SLIB_CREATE_DEF_CMD)
 +	$$(LD) $(SHFLAGS) $(LDFLAGS) $(LDLIBFLAGS) $$(LD_O) $$(filter %.o,$$^) $(FFEXTRALIBS)
 +	$(SLIB_EXTRA_CMD)
 +
 +ifdef SUBDIR
 +$(SUBDIR)$(SLIBNAME_WITH_MAJOR): $(DEP_LIBS)
 +endif
 +
 +clean::
 +	$(RM) $(addprefix $(SUBDIR),$(CLEANFILES) $(CLEANSUFFIXES) $(LIBSUFFIXES)) \
 +	    $(CLEANSUFFIXES:%=$(SUBDIR)$(ARCH)/%) $(CLEANSUFFIXES:%=$(SUBDIR)tests/%)
 + 
 +distclean:: clean
 +	$(RM) $(DISTCLEANSUFFIXES:%=$(SUBDIR)%) $(DISTCLEANSUFFIXES:%=$(SUBDIR)$(ARCH)/%) \
 +            $(DISTCLEANSUFFIXES:%=$(SUBDIR)tests/%)
 +
 +install-lib$(NAME)-shared: $(SUBDIR)$(SLIBNAME)
 +	$(Q)mkdir -p "$(SHLIBDIR)"
 +	$$(INSTALL) -m 755 $$< "$(SHLIBDIR)/$(SLIB_INSTALL_NAME)"
 +	$$(STRIP) "$(SHLIBDIR)/$(SLIB_INSTALL_NAME)"
 +	$(Q)$(foreach F,$(SLIB_INSTALL_LINKS),(cd "$(SHLIBDIR)" && $(LN_S) $(SLIB_INSTALL_NAME) $(F));)
 +	$(if $(SLIB_INSTALL_EXTRA_SHLIB),$$(INSTALL) -m 644 $(SLIB_INSTALL_EXTRA_SHLIB:%=$(SUBDIR)%) "$(SHLIBDIR)")
 +	$(if $(SLIB_INSTALL_EXTRA_LIB),$(Q)mkdir -p "$(LIBDIR)")
 +	$(if $(SLIB_INSTALL_EXTRA_LIB),$$(INSTALL) -m 644 $(SLIB_INSTALL_EXTRA_LIB:%=$(SUBDIR)%) "$(LIBDIR)")
 +
 +install-lib$(NAME)-static: $(SUBDIR)$(LIBNAME)
 +	$(Q)mkdir -p "$(LIBDIR)"
 +	$$(INSTALL) -m 644 $$< "$(LIBDIR)"
 +	$(LIB_INSTALL_EXTRA_CMD)
 +
 +install-lib$(NAME)-headers: $(addprefix $(SUBDIR),$(HEADERS) $(BUILT_HEADERS))
 +	$(Q)mkdir -p "$(INCINSTDIR)"
 +	$$(INSTALL) -m 644 $$^ "$(INCINSTDIR)"
 +
 +install-lib$(NAME)-pkgconfig: $(SUBDIR)lib$(FULLNAME).pc
 +	$(Q)mkdir -p "$(PKGCONFIGDIR)"
 +	$$(INSTALL) -m 644 $$^ "$(PKGCONFIGDIR)"
 +
 +uninstall-libs::
 +	-$(RM) "$(SHLIBDIR)/$(SLIBNAME_WITH_MAJOR)" \
 +	       "$(SHLIBDIR)/$(SLIBNAME)"            \
 +	       "$(SHLIBDIR)/$(SLIBNAME_WITH_VERSION)"
 +	-$(RM)  $(SLIB_INSTALL_EXTRA_SHLIB:%="$(SHLIBDIR)/%")
 +	-$(RM)  $(SLIB_INSTALL_EXTRA_LIB:%="$(LIBDIR)/%")
 +	-$(RM) "$(LIBDIR)/$(LIBNAME)"
 +
 +uninstall-headers::
 +	$(RM) $(addprefix "$(INCINSTDIR)/",$(HEADERS) $(BUILT_HEADERS))
 +	$(RM) "$(PKGCONFIGDIR)/lib$(FULLNAME).pc"
 +	-rmdir "$(INCINSTDIR)"
 +endef
 +
 +$(eval $(RULES))
 +
 +$(TOOLS):     $(DEP_LIBS) $(SUBDIR)$($(CONFIG_SHARED:yes=S)LIBNAME)
 +$(TESTPROGS): $(DEP_LIBS) $(SUBDIR)$(LIBNAME)
 +
 +testprogs: $(TESTPROGS)
diff --cc ffbuild/version.sh
index edc4dd33c5,0000000000..edc4dd33c5
mode 100755,000000..100755
--- a/ffbuild/version.sh
+++ b/ffbuild/version.sh
diff --cc libavcodec/Makefile
index 21cd81c6b2,239a4c0f0a..66d7587fb0
--- a/libavcodec/Makefile
+++ b/libavcodec/Makefile
@@@ -1,5 -1,3 +1,5 @@@
- include $(SUBDIR)../config.mak
++include $(SUBDIR)../ffbuild/config.mak
 +
  NAME = avcodec
  
  HEADERS = avcodec.h                                                     \
diff --cc libavdevice/Makefile
index 6139f1944d,664fa0f9ff..fb7623f713
--- a/libavdevice/Makefile
+++ b/libavdevice/Makefile
@@@ -1,5 -1,3 +1,5 @@@
- include $(SUBDIR)../config.mak
++include $(SUBDIR)../ffbuild/config.mak
 +
  NAME    = avdevice
  
  HEADERS = avdevice.h                                                    \
diff --cc libavfilter/Makefile
index 66c36e4d1d,646a5b5a26..d19c555c91
--- a/libavfilter/Makefile
+++ b/libavfilter/Makefile
@@@ -1,5 -1,3 +1,5 @@@
- include $(SUBDIR)../config.mak
++include $(SUBDIR)../ffbuild/config.mak
 +
  NAME = avfilter
  
  HEADERS = avfilter.h                                                    \
diff --cc libavformat/Makefile
index 6bdfbe6789,6146cbe12a..d82639d123
--- a/libavformat/Makefile
+++ b/libavformat/Makefile
@@@ -1,5 -1,3 +1,5 @@@
- include $(SUBDIR)../config.mak
++include $(SUBDIR)../ffbuild/config.mak
 +
  NAME = avformat
  
  HEADERS = avformat.h                                                    \
diff --cc libavutil/Makefile
index d669a924b0,f34c79950e..0239c499f3
--- a/libavutil/Makefile
+++ b/libavutil/Makefile
@@@ -1,5 -1,3 +1,5 @@@
- include $(SUBDIR)../config.mak
++include $(SUBDIR)../ffbuild/config.mak
 +
  NAME = avutil
  
  HEADERS = adler32.h                                                     \
diff --cc libpostproc/Makefile
index b9bb4beb8a,0000000000..3c21f00a21
mode 100644,000000..100644
--- a/libpostproc/Makefile
+++ b/libpostproc/Makefile
@@@ -1,12 -1,0 +1,12 @@@
- include $(SUBDIR)../config.mak
++include $(SUBDIR)../ffbuild/config.mak
 +
 +NAME = postproc
 +FFLIBS = avutil
 +
 +HEADERS = postprocess.h        \
 +          version.h            \
 +
 +OBJS = postprocess.o
 +
 +# Windows resource file
 +SLIBOBJS-$(HAVE_GNU_WINDRES) += postprocres.o
diff --cc libswresample/Makefile
index 120ee3385d,0000000000..f50ee0d5a0
mode 100644,000000..100644
--- a/libswresample/Makefile
+++ b/libswresample/Makefile
@@@ -1,24 -1,0 +1,24 @@@
- include $(SUBDIR)../config.mak
++include $(SUBDIR)../ffbuild/config.mak
 +
 +NAME = swresample
 +FFLIBS = avutil
 +
 +HEADERS = swresample.h                       \
 +          version.h                          \
 +
 +OBJS = audioconvert.o                        \
 +       dither.o                              \
 +       options.o                             \
 +       rematrix.o                            \
 +       resample.o                            \
 +       resample_dsp.o                        \
 +       swresample.o                          \
 +       swresample_frame.o                    \
 +
 +OBJS-$(CONFIG_LIBSOXR) += soxr_resample.o
 +OBJS-$(CONFIG_SHARED)  += log2_tab.o
 +
 +# Windows resource file
 +SLIBOBJS-$(HAVE_GNU_WINDRES) += swresampleres.o
 +
 +TESTPROGS = swresample
diff --cc libswscale/Makefile
index 183167cced,c9b2fc9c46..19182b370e
--- a/libswscale/Makefile
+++ b/libswscale/Makefile
@@@ -1,5 -1,3 +1,5 @@@
- include $(SUBDIR)../config.mak
++include $(SUBDIR)../ffbuild/config.mak
 +
  NAME = swscale
  
  HEADERS = swscale.h                                                     \
diff --cc tests/fate.sh
index 6fa631ea00,4608d2ddf7..3e106b7181
--- a/tests/fate.sh
+++ b/tests/fate.sh
@@@ -85,8 -83,7 +85,8 @@@ clean()
  report(){
      date=$(date -u +%Y%m%d%H%M%S)
      echo "fate:1:${date}:${slot}:${version}:$1:$2:${branch}:${comment}" >report
-     cat ${build}/config.fate >>report
 -    cat ${build}/avbuild/config.fate ${build}/tests/data/fate/*.rep >> report 2> /dev/null
++    cat ${build}/ffbuild/config.fate >>report
 +    cat ${build}/tests/data/fate/*.rep >>report 2>/dev/null || for i in ${build}/tests/data/fate/*.rep ; do cat "$i" >>report 2>/dev/null; done
      test -n "$fate_recv" && $tar report *.log | gzip | $fate_recv
  }
  
@@@ -108,7 -105,7 +108,7 @@@ test -d "$src" && update || checkout |
  
  cd ${workdir}
  
- version=$(${src}/version.sh ${src})
 -version=$(${src}/avbuild/version.sh ${src})
++version=$(${src}/ffbuild/version.sh ${src})
  test "$version" = "$(cat version-$slot 2>/dev/null)" && exit 0
  echo ${version} >version-$slot
  



More information about the ffmpeg-cvslog mailing list