diff --git a/project/jni/ffmpeg/.gitignore b/project/jni/ffmpeg/.gitignore new file mode 100644 index 000000000..7473a2512 --- /dev/null +++ b/project/jni/ffmpeg/.gitignore @@ -0,0 +1 @@ +android diff --git a/project/jni/ffmpeg/Android.mk b/project/jni/ffmpeg/Android.mk index af4c569fb..6949d073e 100644 --- a/project/jni/ffmpeg/Android.mk +++ b/project/jni/ffmpeg/Android.mk @@ -1,24 +1,613 @@ -LOCAL_PATH := $(call my-dir) +# FFmpeg for Android +# http://sourceforge.net/projects/ffmpeg4android/ +# Srdjan Obucina + +LOCAL_PATH:=$(call my-dir) + +ifeq ($(notdir $(LOCAL_PATH)),ffmpeg) # Build only from ffmpeg directory, ignore symlinks + +FFMPEG_ROOT_DIR := $(LOCAL_PATH) +FFMPEG_CONFIG_DIR := android/build + +VERSION_SUFFIX := -$(shell (cat $(FFMPEG_ROOT_DIR)/RELEASE)) + +ifeq ($(findstring 1.1, $(VERSION_SUFFIX)),1.1) + VERSION_BRANCH := 1.1 +else ifeq ($(findstring 1.0, $(VERSION_SUFFIX)),1.0) + VERSION_BRANCH := 1.0 +else ifeq ($(findstring 0.11, $(VERSION_SUFFIX)),0.11) + VERSION_BRANCH := 0.11 +else ifeq ($(findstring 0.10, $(VERSION_SUFFIX)),0.10) + VERSION_BRANCH := 0.10 +else ifeq ($(findstring 0.9, $(VERSION_SUFFIX)),0.9) + VERSION_BRANCH := 0.9 +else ifeq ($(findstring 0.8, $(VERSION_SUFFIX)),0.8) + VERSION_BRANCH := 0.8 +else ifeq ($(findstring 0.7, $(VERSION_SUFFIX)),0.7) + VERSION_BRANCH := 0.7 +endif + +ifeq ($(VERSION_BRANCH),) + $(error Unsupported FFmpeg version) +endif include $(CLEAR_VARS) -LOCAL_MODULE := $(notdir $(LOCAL_PATH)) -ifneq ($(LOCAL_MODULE),ffmpeg) +include $(FFMPEG_ROOT_DIR)/Android_configure.mk -LOCAL_C_INCLUDES := $(LOCAL_PATH)/include +include $(FFMPEG_ROOT_DIR)/$(FFMPEG_CONFIG_DIR)/config.mak -ifneq ($(NDK_R5_TOOLCHAIN),) -LOCAL_SRC_FILES := lib/$(TARGET_ARCH_ABI)/lib$(LOCAL_MODULE).so -include $(PREBUILT_SHARED_LIBRARY) -else -LOCAL_SRC_FILES := dummy.c -include $(BUILD_SHARED_LIBRARY) -$(abspath $(LOCAL_PATH)/../../obj/local/armeabi/lib$(LOCAL_MODULE).so): $(LOCAL_PATH)/lib/armeabi/lib$(LOCAL_MODULE).so OVERRIDE_CUSTOM_LIB - cp -f $< $@ -$(abspath $(LOCAL_PATH)/../../obj/local/armeabi-v7a/lib$(LOCAL_MODULE).so): $(LOCAL_PATH)/lib/armeabi-v7a/lib$(LOCAL_MODULE).so OVERRIDE_CUSTOM_LIB - cp -f $< $@ -.PHONY: OVERRIDE_CUSTOM_LIB -OVERRIDE_CUSTOM_LIB: +CONFIG_STATIC := +CONFIG_FFMPEG_COMPILE_TOOLS := + +TOOLS_LIBRARIES := + +#============================== libavdevice ============================= +ifeq ($(CONFIG_AVDEVICE),yes) + FFMPEG_LIB_DIR := libavdevice + TOOLS_LIBRARIES += libavdevice$(VERSION_SUFFIX) + include $(CLEAR_VARS) + include $(FFMPEG_ROOT_DIR)/Android_.mk + ifeq ($(CONFIG_SHARED),yes) + include $(CLEAR_VARS) + LOCAL_SRC_FILES := \ + $(FFFILES) + LOCAL_C_INCLUDES := \ + $(FFMPEG_ROOT_DIR)/$(FFMPEG_CONFIG_DIR) \ + $(FFMPEG_ROOT_DIR) + LOCAL_CFLAGS += \ + $(FFCFLAGS) + LOCAL_LDFLAGS += \ + -Wl,--version-script,$(FFMPEG_ROOT_DIR)/$(FFMPEG_CONFIG_DIR)/$(FFMPEG_LIB_DIR)/libavdevice.ver + LOCAL_SHARED_LIBRARIES := \ + $(FFLIBS) + LOCAL_LDLIBS := -lz + LOCAL_MODULE_TAGS := optional + LOCAL_PRELINK_MODULE := false + LOCAL_MODULE := $(FFNAME) + include $(BUILD_SHARED_LIBRARY) + endif + ifeq ($(CONFIG_STATIC),yes) + include $(CLEAR_VARS) + LOCAL_SRC_FILES := \ + $(FFFILES) + LOCAL_C_INCLUDES := \ + $(FFMPEG_ROOT_DIR)/$(FFMPEG_CONFIG_DIR) \ + $(FFMPEG_ROOT_DIR) + LOCAL_CFLAGS += \ + $(FFCFLAGS) + LOCAL_STATIC_LIBRARIES := \ + $(FFLIBS) + LOCAL_MODULE_TAGS := optional + LOCAL_PRELINK_MODULE := false + LOCAL_MODULE := $(FFNAME) + include $(BUILD_STATIC_LIBRARY) + endif endif +#======================================================================== +#============================== libavfilter ============================= +ifeq ($(CONFIG_AVFILTER),yes) + FFMPEG_LIB_DIR := libavfilter + TOOLS_LIBRARIES += libavfilter$(VERSION_SUFFIX) + include $(CLEAR_VARS) + include $(FFMPEG_ROOT_DIR)/Android_.mk + ifeq ($(CONFIG_SHARED),yes) + include $(CLEAR_VARS) + LOCAL_SRC_FILES := \ + $(FFFILES) + LOCAL_C_INCLUDES := \ + $(FFMPEG_ROOT_DIR)/$(FFMPEG_CONFIG_DIR) \ + $(FFMPEG_ROOT_DIR) + LOCAL_CFLAGS += \ + $(FFCFLAGS) + LOCAL_LDFLAGS += \ + -Wl,--version-script,$(FFMPEG_ROOT_DIR)/$(FFMPEG_CONFIG_DIR)/$(FFMPEG_LIB_DIR)/libavfilter.ver + LOCAL_SHARED_LIBRARIES := \ + $(FFLIBS) + LOCAL_MODULE_TAGS := optional + LOCAL_PRELINK_MODULE := false + LOCAL_MODULE := $(FFNAME) + include $(BUILD_SHARED_LIBRARY) + endif + ifeq ($(CONFIG_STATIC),yes) + include $(CLEAR_VARS) + LOCAL_SRC_FILES := \ + $(FFFILES) + LOCAL_C_INCLUDES := \ + $(FFMPEG_ROOT_DIR)/$(FFMPEG_CONFIG_DIR) \ + $(FFMPEG_ROOT_DIR) + LOCAL_CFLAGS += \ + $(FFCFLAGS) + LOCAL_STATIC_LIBRARIES := \ + $(FFLIBS) + LOCAL_MODULE_TAGS := optional + LOCAL_PRELINK_MODULE := false + LOCAL_MODULE := $(FFNAME) + include $(BUILD_STATIC_LIBRARY) + endif +endif +#======================================================================== + +#============================== libavformat ============================= +ifeq ($(CONFIG_AVFORMAT),yes) + FFMPEG_LIB_DIR := libavformat + TOOLS_LIBRARIES += libavformat$(VERSION_SUFFIX) + include $(CLEAR_VARS) + include $(FFMPEG_ROOT_DIR)/Android_.mk + ifeq ($(CONFIG_SHARED),yes) + include $(CLEAR_VARS) + LOCAL_SRC_FILES := \ + $(FFFILES) + LOCAL_C_INCLUDES := \ + $(FFMPEG_ROOT_DIR)/$(FFMPEG_CONFIG_DIR) \ + $(FFMPEG_ROOT_DIR) + LOCAL_CFLAGS += \ + $(FFCFLAGS) + LOCAL_LDFLAGS += \ + -Wl,--version-script,$(FFMPEG_ROOT_DIR)/$(FFMPEG_CONFIG_DIR)/$(FFMPEG_LIB_DIR)/libavformat.ver + LOCAL_SHARED_LIBRARIES := \ + $(FFLIBS) + LOCAL_LDLIBS := -lz + LOCAL_MODULE_TAGS := optional + LOCAL_PRELINK_MODULE := false + LOCAL_MODULE := $(FFNAME) + include $(BUILD_SHARED_LIBRARY) + endif + ifeq ($(CONFIG_STATIC),yes) + include $(CLEAR_VARS) + LOCAL_SRC_FILES := \ + $(FFFILES) + LOCAL_C_INCLUDES := \ + $(FFMPEG_ROOT_DIR)/$(FFMPEG_CONFIG_DIR) \ + $(FFMPEG_ROOT_DIR) + LOCAL_CFLAGS += \ + $(FFCFLAGS) + LOCAL_STATIC_LIBRARIES := \ + $(FFLIBS) + LOCAL_MODULE_TAGS := optional + LOCAL_PRELINK_MODULE := false + LOCAL_MODULE := $(FFNAME) + include $(BUILD_STATIC_LIBRARY) + endif +endif +#======================================================================== + +#============================== libavcodec ============================== +ifeq ($(CONFIG_AVCODEC),yes) + FFMPEG_LIB_DIR := libavcodec + TOOLS_LIBRARIES += libavcodec$(VERSION_SUFFIX) + include $(CLEAR_VARS) + include $(FFMPEG_ROOT_DIR)/Android_.mk + ifeq ($(CONFIG_SHARED),yes) + include $(CLEAR_VARS) + LOCAL_SRC_FILES := \ + $(FFFILES) + LOCAL_C_INCLUDES := \ + $(FFMPEG_ROOT_DIR)/$(FFMPEG_CONFIG_DIR) \ + $(FFMPEG_ROOT_DIR) + LOCAL_CFLAGS += \ + $(FFCFLAGS) + LOCAL_LDFLAGS += \ + -Wl,--version-script,$(FFMPEG_ROOT_DIR)/$(FFMPEG_CONFIG_DIR)/$(FFMPEG_LIB_DIR)/libavcodec.ver + LOCAL_SHARED_LIBRARIES := \ + $(FFLIBS) + LOCAL_LDLIBS := -lz + LOCAL_MODULE_TAGS := optional + LOCAL_PRELINK_MODULE := false + LOCAL_MODULE := $(FFNAME) + include $(BUILD_SHARED_LIBRARY) + endif + ifeq ($(CONFIG_STATIC),yes) + include $(CLEAR_VARS) + LOCAL_SRC_FILES := \ + $(FFFILES) + LOCAL_C_INCLUDES := \ + $(FFMPEG_ROOT_DIR)/$(FFMPEG_CONFIG_DIR) \ + $(FFMPEG_ROOT_DIR) + LOCAL_CFLAGS += \ + $(FFCFLAGS) + LOCAL_STATIC_LIBRARIES := \ + $(FFLIBS) + LOCAL_MODULE_TAGS := optional + LOCAL_PRELINK_MODULE := false + LOCAL_MODULE := $(FFNAME) + include $(BUILD_STATIC_LIBRARY) + endif +endif +#======================================================================== + +#============================== libavresample =========================== +ifeq ($(CONFIG_AVRESAMPLE),yes) + FFMPEG_LIB_DIR := libavresample + TOOLS_LIBRARIES += libavresample$(VERSION_SUFFIX) + include $(CLEAR_VARS) + include $(FFMPEG_ROOT_DIR)/Android_.mk + ifeq ($(CONFIG_SHARED),yes) + include $(CLEAR_VARS) + LOCAL_SRC_FILES := \ + $(FFFILES) + LOCAL_C_INCLUDES := \ + $(FFMPEG_ROOT_DIR)/$(FFMPEG_CONFIG_DIR) \ + $(FFMPEG_ROOT_DIR) + LOCAL_CFLAGS += \ + $(FFCFLAGS) + LOCAL_LDFLAGS += \ + -Wl,--version-script,$(FFMPEG_ROOT_DIR)/$(FFMPEG_CONFIG_DIR)/$(FFMPEG_LIB_DIR)/libavresample.ver + LOCAL_SHARED_LIBRARIES := \ + $(FFLIBS) + LOCAL_MODULE_TAGS := optional + LOCAL_PRELINK_MODULE := false + LOCAL_MODULE := $(FFNAME) + include $(BUILD_SHARED_LIBRARY) + endif + ifeq ($(CONFIG_STATIC),yes) + include $(CLEAR_VARS) + LOCAL_SRC_FILES := \ + $(FFFILES) + LOCAL_C_INCLUDES := \ + $(FFMPEG_ROOT_DIR)/$(FFMPEG_CONFIG_DIR) \ + $(FFMPEG_ROOT_DIR) + LOCAL_CFLAGS += \ + $(FFCFLAGS) + LOCAL_STATIC_LIBRARIES := \ + $(FFLIBS) + LOCAL_MODULE_TAGS := optional + LOCAL_PRELINK_MODULE := false + LOCAL_MODULE := $(FFNAME) + include $(BUILD_STATIC_LIBRARY) + endif +endif +#======================================================================== + +#============================== libpostproc ============================= +ifeq ($(CONFIG_POSTPROC),yes) + FFMPEG_LIB_DIR := libpostproc + TOOLS_LIBRARIES += libpostproc$(VERSION_SUFFIX) + include $(CLEAR_VARS) + include $(FFMPEG_ROOT_DIR)/Android_.mk + ifeq ($(CONFIG_SHARED),yes) + include $(CLEAR_VARS) + LOCAL_SRC_FILES := \ + $(FFFILES) + LOCAL_C_INCLUDES := \ + $(FFMPEG_ROOT_DIR)/$(FFMPEG_CONFIG_DIR) \ + $(FFMPEG_ROOT_DIR) + LOCAL_CFLAGS += \ + $(FFCFLAGS) + LOCAL_LDFLAGS += \ + -Wl,--version-script,$(FFMPEG_ROOT_DIR)/$(FFMPEG_CONFIG_DIR)/$(FFMPEG_LIB_DIR)/libpostproc.ver + LOCAL_SHARED_LIBRARIES := \ + $(FFLIBS) + LOCAL_MODULE_TAGS := optional + LOCAL_PRELINK_MODULE := false + LOCAL_MODULE := $(FFNAME) + include $(BUILD_SHARED_LIBRARY) + endif + ifeq ($(CONFIG_STATIC),yes) + include $(CLEAR_VARS) + LOCAL_SRC_FILES := \ + $(FFFILES) + LOCAL_C_INCLUDES := \ + $(FFMPEG_ROOT_DIR)/$(FFMPEG_CONFIG_DIR) \ + $(FFMPEG_ROOT_DIR) + LOCAL_CFLAGS += \ + $(FFCFLAGS) + LOCAL_STATIC_LIBRARIES := \ + $(FFLIBS) + LOCAL_MODULE_TAGS := optional + LOCAL_PRELINK_MODULE := false + LOCAL_MODULE := $(FFNAME) + include $(BUILD_STATIC_LIBRARY) + endif +endif +#======================================================================== + +#============================== libswresample =========================== +ifeq ($(CONFIG_SWRESAMPLE),yes) + FFMPEG_LIB_DIR := libswresample + TOOLS_LIBRARIES += libswresample$(VERSION_SUFFIX) + include $(CLEAR_VARS) + include $(FFMPEG_ROOT_DIR)/Android_.mk + ifeq ($(CONFIG_SHARED),yes) + include $(CLEAR_VARS) + LOCAL_SRC_FILES := \ + $(FFFILES) + LOCAL_C_INCLUDES := \ + $(FFMPEG_ROOT_DIR)/$(FFMPEG_CONFIG_DIR) \ + $(FFMPEG_ROOT_DIR) + LOCAL_CFLAGS += \ + $(FFCFLAGS) + LOCAL_LDFLAGS += \ + -Wl,--version-script,$(FFMPEG_ROOT_DIR)/$(FFMPEG_CONFIG_DIR)/$(FFMPEG_LIB_DIR)/libswresample.ver + LOCAL_SHARED_LIBRARIES := \ + $(FFLIBS) + LOCAL_MODULE_TAGS := optional + LOCAL_PRELINK_MODULE := false + LOCAL_MODULE := $(FFNAME) + include $(BUILD_SHARED_LIBRARY) + endif + ifeq ($(CONFIG_STATIC),yes) + include $(CLEAR_VARS) + LOCAL_SRC_FILES := \ + $(FFFILES) + LOCAL_C_INCLUDES := \ + $(FFMPEG_ROOT_DIR)/$(FFMPEG_CONFIG_DIR) \ + $(FFMPEG_ROOT_DIR) + LOCAL_CFLAGS += \ + $(FFCFLAGS) + LOCAL_STATIC_LIBRARIES := \ + $(FFLIBS) + LOCAL_MODULE_TAGS := optional + LOCAL_PRELINK_MODULE := false + LOCAL_MODULE := $(FFNAME) + include $(BUILD_STATIC_LIBRARY) + endif +endif +#======================================================================== + +#============================== libswscale ============================== +ifeq ($(CONFIG_SWSCALE),yes) + FFMPEG_LIB_DIR := libswscale + TOOLS_LIBRARIES += libswscale$(VERSION_SUFFIX) + include $(CLEAR_VARS) + include $(FFMPEG_ROOT_DIR)/Android_.mk + ifeq ($(CONFIG_SHARED),yes) + include $(CLEAR_VARS) + LOCAL_SRC_FILES := \ + $(FFFILES) + LOCAL_C_INCLUDES := \ + $(FFMPEG_ROOT_DIR)/$(FFMPEG_CONFIG_DIR) \ + $(FFMPEG_ROOT_DIR) + LOCAL_CFLAGS += \ + $(FFCFLAGS) + LOCAL_LDFLAGS += \ + -Wl,--version-script,$(FFMPEG_ROOT_DIR)/$(FFMPEG_CONFIG_DIR)/$(FFMPEG_LIB_DIR)/libswscale.ver + LOCAL_SHARED_LIBRARIES := \ + $(FFLIBS) + LOCAL_MODULE_TAGS := optional + LOCAL_PRELINK_MODULE := false + LOCAL_MODULE := $(FFNAME) + include $(BUILD_SHARED_LIBRARY) + endif + ifeq ($(CONFIG_STATIC),yes) + include $(CLEAR_VARS) + LOCAL_SRC_FILES := \ + $(FFFILES) + LOCAL_C_INCLUDES := \ + $(FFMPEG_ROOT_DIR)/$(FFMPEG_CONFIG_DIR) \ + $(FFMPEG_ROOT_DIR) + LOCAL_CFLAGS += \ + $(FFCFLAGS) + LOCAL_STATIC_LIBRARIES := \ + $(FFLIBS) + LOCAL_MODULE_TAGS := optional + LOCAL_PRELINK_MODULE := false + LOCAL_MODULE := $(FFNAME) + include $(BUILD_STATIC_LIBRARY) + endif +endif +#======================================================================== + +#============================== libavutil =============================== +FFMPEG_LIB_DIR := libavutil +TOOLS_LIBRARIES += libavutil$(VERSION_SUFFIX) +include $(CLEAR_VARS) +include $(FFMPEG_ROOT_DIR)/Android_.mk +ifeq ($(CONFIG_SHARED),yes) + include $(CLEAR_VARS) + LOCAL_SRC_FILES := \ + $(FFFILES) + LOCAL_C_INCLUDES := \ + $(FFMPEG_ROOT_DIR)/$(FFMPEG_CONFIG_DIR) \ + $(FFMPEG_ROOT_DIR) + LOCAL_CFLAGS += \ + $(FFCFLAGS) + LOCAL_LDFLAGS += \ + -Wl,--version-script,$(FFMPEG_ROOT_DIR)/$(FFMPEG_CONFIG_DIR)/$(FFMPEG_LIB_DIR)/libavutil.ver + LOCAL_SHARED_LIBRARIES := \ + $(FFLIBS) + LOCAL_MODULE_TAGS := optional + LOCAL_PRELINK_MODULE := false + LOCAL_MODULE := $(FFNAME) + include $(BUILD_SHARED_LIBRARY) +endif +ifeq ($(CONFIG_STATIC),yes) + include $(CLEAR_VARS) + LOCAL_SRC_FILES := \ + $(FFFILES) + LOCAL_C_INCLUDES := \ + $(FFMPEG_ROOT_DIR)/$(FFMPEG_CONFIG_DIR) \ + $(FFMPEG_ROOT_DIR) + LOCAL_CFLAGS += \ + $(FFCFLAGS) + LOCAL_STATIC_LIBRARIES := \ + $(FFLIBS) + LOCAL_MODULE_TAGS := optional + LOCAL_PRELINK_MODULE := false + LOCAL_MODULE := $(FFNAME) + include $(BUILD_STATIC_LIBRARY) +endif +#======================================================================== + +ifeq ($(CONFIG_FFMPEG_COMPILE_TOOLS),yes) +#============================== avconv ================================== +ifeq ($(CONFIG_AVCONV),yes) + ifeq ($(CONFIG_SHARED),yes) + include $(CLEAR_VARS) + LOCAL_SRC_FILES := \ + cmdutils.c \ + avconv.c + LOCAL_C_INCLUDES := \ + $(FFMPEG_ROOT_DIR)/$(FFMPEG_CONFIG_DIR) + LOCAL_SHARED_LIBRARIES := \ + $(TOOLS_LIBRARIES) + LOCAL_MODULE_TAGS := optional + LOCAL_MODULE := avconv$(VERSION_SUFFIX) + include $(BUILD_EXECUTABLE) + endif + ifeq ($(CONFIG_STATIC),yes) + include $(CLEAR_VARS) + LOCAL_SRC_FILES := \ + cmdutils.c \ + avconv.c + LOCAL_C_INCLUDES := \ + $(FFMPEG_ROOT_DIR)/$(FFMPEG_CONFIG_DIR) + LOCAL_STATIC_LIBRARIES := \ + $(TOOLS_LIBRARIES) + LOCAL_MODULE_TAGS := optional + LOCAL_MODULE := avconv-static$(VERSION_SUFFIX) + include $(BUILD_EXECUTABLE) + endif +endif +#======================================================================== + +#============================== ffplay ================================== +ifeq ($(CONFIG_FFPLAY),yes) + ifeq ($(CONFIG_SHARED),yes) + include $(CLEAR_VARS) + LOCAL_SRC_FILES := \ + cmdutils.c \ + ffplay.c + LOCAL_C_INCLUDES := \ + $(FFMPEG_ROOT_DIR)/$(FFMPEG_CONFIG_DIR) + LOCAL_SHARED_LIBRARIES := \ + $(TOOLS_LIBRARIES) + LOCAL_MODULE_TAGS := optional + LOCAL_MODULE := ffplay$(VERSION_SUFFIX) + include $(BUILD_EXECUTABLE) + endif + ifeq ($(CONFIG_STATIC),yes) + include $(CLEAR_VARS) + LOCAL_SRC_FILES := \ + cmdutils.c \ + ffplay.c + LOCAL_C_INCLUDES := \ + $(FFMPEG_ROOT_DIR)/$(FFMPEG_CONFIG_DIR) + LOCAL_STATIC_LIBRARIES := \ + $(TOOLS_LIBRARIES) + LOCAL_MODULE_TAGS := optional + LOCAL_MODULE := ffplay-static$(VERSION_SUFFIX) + include $(BUILD_EXECUTABLE) + endif +endif +#======================================================================== + +#============================== ffmpeg ================================== +ifeq ($(CONFIG_FFMPEG),yes) + ifeq ($(CONFIG_SHARED),yes) + include $(CLEAR_VARS) + LOCAL_SRC_FILES := \ + cmdutils.c \ + ffmpeg.c + ifeq ($(VERSION_BRANCH),1.1) + LOCAL_SRC_FILES += \ + ffmpeg_filter.c \ + ffmpeg_opt.c + endif + ifeq ($(VERSION_BRANCH),1.0) + LOCAL_SRC_FILES += \ + ffmpeg_filter.c \ + ffmpeg_opt.c + endif + LOCAL_C_INCLUDES := \ + $(FFMPEG_ROOT_DIR)/$(FFMPEG_CONFIG_DIR) + LOCAL_SHARED_LIBRARIES := \ + $(TOOLS_LIBRARIES) + LOCAL_MODULE_TAGS := optional + LOCAL_MODULE := ffmpeg$(VERSION_SUFFIX) + include $(BUILD_EXECUTABLE) + endif + ifeq ($(CONFIG_STATIC),yes) + include $(CLEAR_VARS) + LOCAL_SRC_FILES := \ + cmdutils.c \ + ffmpeg.c + ifeq ($(VERSION_BRANCH),1.1) + LOCAL_SRC_FILES += \ + ffmpeg_filter.c \ + ffmpeg_opt.c + endif + ifeq ($(VERSION_BRANCH),1.0) + LOCAL_SRC_FILES += \ + ffmpeg_filter.c \ + ffmpeg_opt.c + endif + LOCAL_C_INCLUDES := \ + $(FFMPEG_ROOT_DIR)/$(FFMPEG_CONFIG_DIR) + LOCAL_LDLIBS := -lz + LOCAL_STATIC_LIBRARIES := \ + $(TOOLS_LIBRARIES) + LOCAL_MODULE_TAGS := optional + LOCAL_MODULE := ffmpeg-static$(VERSION_SUFFIX) + include $(BUILD_EXECUTABLE) + endif +endif +#======================================================================== + +#============================== ffprobe ================================= +ifeq ($(CONFIG_FFPROBE),yes) + ifeq ($(CONFIG_SHARED),yes) + include $(CLEAR_VARS) + LOCAL_SRC_FILES := \ + cmdutils.c \ + ffprobe.c + LOCAL_C_INCLUDES := \ + $(FFMPEG_ROOT_DIR)/$(FFMPEG_CONFIG_DIR) + LOCAL_SHARED_LIBRARIES := \ + $(TOOLS_LIBRARIES) + LOCAL_MODULE_TAGS := optional + LOCAL_MODULE := ffprobe$(VERSION_SUFFIX) + include $(BUILD_EXECUTABLE) + endif + ifeq ($(CONFIG_STATIC),yes) + include $(CLEAR_VARS) + LOCAL_SRC_FILES := \ + cmdutils.c \ + ffprobe.c + LOCAL_C_INCLUDES := \ + $(FFMPEG_ROOT_DIR)/$(FFMPEG_CONFIG_DIR) + LOCAL_LDLIBS := -lz + LOCAL_STATIC_LIBRARIES := \ + $(TOOLS_LIBRARIES) + LOCAL_MODULE_TAGS := optional + LOCAL_MODULE := ffprobe-static$(VERSION_SUFFIX) + include $(BUILD_EXECUTABLE) + endif +endif +#======================================================================== + +#============================== ffserver ================================ +ifeq ($(CONFIG_FFSERVER),yes) + ifeq ($(CONFIG_SHARED),yes) + include $(CLEAR_VARS) + LOCAL_SRC_FILES := \ + cmdutils.c \ + ffserver.c + LOCAL_C_INCLUDES := \ + $(FFMPEG_ROOT_DIR)/$(FFMPEG_CONFIG_DIR) + LOCAL_SHARED_LIBRARIES := \ + $(TOOLS_LIBRARIES) + LOCAL_LDLIBS := -ldl -lz + LOCAL_MODULE_TAGS := optional + LOCAL_MODULE := ffserver$(VERSION_SUFFIX) + include $(BUILD_EXECUTABLE) + endif + ifeq ($(CONFIG_STATIC),yes) + include $(CLEAR_VARS) + LOCAL_SRC_FILES := \ + cmdutils.c \ + ffserver.c + LOCAL_C_INCLUDES := \ + $(FFMPEG_ROOT_DIR)/$(FFMPEG_CONFIG_DIR) + LOCAL_LDLIBS := -ldl -lz + LOCAL_STATIC_LIBRARIES := \ + $(TOOLS_LIBRARIES) + LOCAL_MODULE_TAGS := optional + LOCAL_MODULE := ffserver-static$(VERSION_SUFFIX) + include $(BUILD_EXECUTABLE) + endif +endif +#======================================================================== +endif #CONFIG_FFMPEG_COMPILE_TOOLS endif diff --git a/project/jni/ffmpeg/Android_.mk b/project/jni/ffmpeg/Android_.mk new file mode 100644 index 000000000..4a3276c17 --- /dev/null +++ b/project/jni/ffmpeg/Android_.mk @@ -0,0 +1,125 @@ +# FFmpeg for Android +# http://sourceforge.net/projects/ffmpeg4android/ +# Srdjan Obucina + +OBJS := +OBJS-yes := +ARMV5TE-OBJS := +ARMV5TE-OBJS-yes := +ARMV6-OBJS := +ARMV6-OBJS-yes := +ARMVFP-OBJS := +ARMVFP-OBJS-yes := +VFP-OBJS := +VFP-OBJS-yes := +NEON-OBJS := +NEON-OBJS-yes := +MMI-OBJS := +MMI-OBJS-yes := +MIPSFPU-OBJS := +MIPSFPU-OBJS-yes := +MIPS32R2-OBJS := +MIPS32R2-OBJS-yes := +MIPSDSPR1-OBJS := +MIPSDSPR1-OBJS-yes := +MIPSDSPR2-OBJS := +MIPSDSPR2-OBJS-yes := +ALTIVEC-OBJS := +ALTIVEC-OBJS-yes := +VIS-OBJS := +VIS-OBJS-yes := +MMX-OBJS := +MMX-OBJS-yes := +YASM-OBJS := +YASM-OBJS-yes := +FFLIBS := +FFLIBS-yes := + +include $(FFMPEG_ROOT_DIR)/$(FFMPEG_LIB_DIR)/Makefile.android +-include $(FFMPEG_ROOT_DIR)/$(FFMPEG_LIB_DIR)/$(TARGET_ARCH)/Makefile + +ifeq ($(VERSION_BRANCH),1.1) + include $(FFMPEG_ROOT_DIR)/arch.mak +endif +ifeq ($(VERSION_BRANCH),1.0) + include $(FFMPEG_ROOT_DIR)/arch.mak +endif +ifeq ($(VERSION_BRANCH),0.11) + include $(FFMPEG_ROOT_DIR)/arch.mak +endif + +OBJS += $(OBJS-yes) + +#FFNAME := lib$(NAME)$(VERSION_SUFFIX) +FFNAME := $(NAME) +FFLIBS += $(FFLIBS-yes) +#FFLIBS := $(foreach NAME, $(FFLIBS), lib$(NAME)$(VERSION_SUFFIX)) +FFLIBS := $(foreach NAME, $(FFLIBS), $(NAME)) +FFLIBS := $(sort $(FFLIBS)) +FFCFLAGS := -DHAVE_AV_CONFIG_H $(CFLAGS) \ + +FFCFLAGS_OUTPUT_CLEANING := \ + -Wno-cast-qual \ + -Wno-deprecated-declarations \ + -Wno-error=return-type \ + -Wno-maybe-uninitialized \ + -Wno-missing-field-initializers \ + -Wno-old-style-declaration \ + -Wno-override-init \ + -Wno-sign-compare \ + -Wno-strict-prototypes \ + -Wno-undef \ + -Wno-uninitialized \ + -Wno-unused-function \ + -Wno-unused-parameter \ + -Wno-unused-value + +FFCFLAGS += $(FFCFLAGS_OUTPUT_CLEANING) + +FFCPPFLAGS := $(CPPFLAGS) +FFCXXFLAGS := $(CXXFLAGS) +FFEXTRALIBS := $(EXTRALIBS) + + + +ALL_ASM_FILES := $(wildcard $(FFMPEG_ROOT_DIR)/$(FFMPEG_LIB_DIR)/$(TARGET_ARCH)/*.asm) +ALL_ASM_FILES := $(addprefix $(TARGET_ARCH)/, $(notdir $(ALL_ASM_FILES))) +ALL_ASM_OBJS := +ASM_OBJS := +ASM_FILES := + +ifneq ($(ALL_ASM_FILES),) + ALL_ASM_OBJS := $(patsubst %.asm,%.o, $(ALL_ASM_FILES)) + ASM_OBJS := $(filter $(ALL_ASM_OBJS), $(OBJS)) + ASM_FILES := $(patsubst %.o,%.asm, $(ASM_OBJS)) +endif + +ALL_S_FILES := $(wildcard $(FFMPEG_ROOT_DIR)/$(FFMPEG_LIB_DIR)/$(TARGET_ARCH)/*.S) +ALL_S_FILES := $(addprefix $(TARGET_ARCH)/, $(notdir $(ALL_S_FILES))) +ALL_S_OBJS := +S_OBJS := +S_FILES := + +ifneq ($(ALL_S_FILES),) + ALL_S_OBJS := $(patsubst %.S,%.o, $(ALL_S_FILES)) + S_OBJS := $(filter $(ALL_S_OBJS), $(OBJS)) + S_FILES := $(patsubst %.o,%.S, $(S_OBJS)) +endif + +ALL_NON_C_OBJS := $(ASM_OBJS) $(S_OBJS) +C_OBJS := $(filter-out $(ALL_NON_C_OBJS), $(OBJS)) +C_FILES := $(patsubst %.o,%.c, $(C_OBJS)) + +FFFILES := $(sort $(ASM_FILES)) $(sort $(S_FILES)) $(sort $(C_FILES)) + +ifeq ($(FFMPEG_VERBOSE_BUILD),yes) +$(warning ============================================================) +$(warning Library name: '$(FFNAME)') +$(warning =============================) +$(warning Files that will be compiled: '$(FFFILES)') +$(warning =============================) +$(warning Libraries that will be included: '$(FFLIBS)') +$(warning ============================================================) +endif + +FFFILES := $(addprefix $(FFMPEG_LIB_DIR)/, $(FFFILES)) diff --git a/project/jni/ffmpeg/Android_configure.mk b/project/jni/ffmpeg/Android_configure.mk new file mode 100644 index 000000000..f297148ac --- /dev/null +++ b/project/jni/ffmpeg/Android_configure.mk @@ -0,0 +1,482 @@ +# FFmpeg for Android +# http://sourceforge.net/projects/ffmpeg4android/ +# Srdjan Obucina + +LOCAL_PATH:=$(call my-dir) + +include $(CLEAR_VARS) + + +NDK_CROSS_PREFIX := $(subst -gcc,-,$(TARGET_CC)) + +NDK_SYSROOT := $(SYSROOT) + + +FF_CONFIGURATION_STRING := \ + --arch=$(TARGET_ARCH) \ + --target-os=linux \ + --enable-cross-compile \ + --cross-prefix=$(NDK_CROSS_PREFIX) \ + --sysroot=$(NDK_SYSROOT) \ + --enable-shared \ + --disable-static \ + +ifeq ($(VERSION_BRANCH),1.1) + FF_CONFIGURATION_STRING += \ + --enable-avresample +endif + +ifeq ($(VERSION_BRANCH),1.0) + FF_CONFIGURATION_STRING += \ + --enable-avresample +endif + +ifeq ($(VERSION_BRANCH),0.11) + FF_CONFIGURATION_STRING += \ + --enable-avresample +endif + +ifeq ($(VERSION_BRANCH),0.7) + FF_CONFIGURATION_STRING += \ + --disable-ffplay +endif + +# Temporary, until bug is fixed +ifeq ($(TARGET_ARCH),x86) + FF_DISABLE_MMX := --disable-mmx + FF_DISABLE_MMX2 := --disable-mmx2 + ifeq ($(VERSION_BRANCH),1.1) + FF_DISABLE_MMX2 := --disable-mmxext + endif + ifeq ($(VERSION_BRANCH),1.0) + FF_DISABLE_MMX2 := --disable-mmxext + endif + FF_CONFIGURATION_STRING += $(FF_DISABLE_MMX) $(FF_DISABLE_MMX2) +endif + + +FF_CONFIGURATION_STRING += --extra-cflags='$(TARGET_CFLAGS)' +FF_CONFIGURATION_STRING += --extra-ldflags='$(TARGET_LDFLAGS)' +FF_CONFIGURATION_STRING += --extra-version=.android + + + +# Do not edit after this line +#=============================================================================== + +FF_LAST_CONFIGURATION_STRING_COMMAND := \ + cat $(FFMPEG_ROOT_DIR)/$(FFMPEG_CONFIG_DIR)/LAST_CONFIGURATION_STRING; +FF_LAST_CONFIGURATION_STRING_OUTPUT := $(shell $(FF_LAST_CONFIGURATION_STRING_COMMAND)) + +#=============================================================================== +ifneq ($(FF_CONFIGURATION_STRING), $(FF_LAST_CONFIGURATION_STRING_OUTPUT)) + + FF_CREATE_CONFIG_DIR_COMMAND := \ + cd $(FFMPEG_ROOT_DIR); \ + rm -rf $(FFMPEG_CONFIG_DIR); \ + mkdir -p $(FFMPEG_CONFIG_DIR); \ + cd $$OLDPWD; + + $(warning ============================================================) + $(warning Creating configuration directory...) + $(warning $(FF_CREATE_CONFIG_DIR_COMMAND)) + FF_CREATE_CONFIG_DIR_OUTPUT := $(shell $(FF_CREATE_CONFIG_DIR_COMMAND)) + $(warning Done.) + $(warning ============================================================) + + + + FF_CREATE_REQUIRED_FILES_COMMAND := \ + cd $(FFMPEG_ROOT_DIR)/$(FFMPEG_CONFIG_DIR); \ + ../../configure \ + --enable-shared \ + --disable-static \ + --disable-everything \ + --disable-yasm; \ + make -j4; \ + cd $$OLDPWD; + + ifeq ($(VERSION_BRANCH),1.1) + FF_CREATE_REQUIRED_FILES_COMMAND := \ + cd $(FFMPEG_ROOT_DIR)/$(FFMPEG_CONFIG_DIR); \ + ../../configure \ + --enable-shared \ + --disable-static \ + --enable-avresample \ + --disable-everything \ + --disable-mmx \ + --disable-yasm; \ + make -j4; \ + cd $$OLDPWD; + endif + + ifeq ($(VERSION_BRANCH),1.0) + FF_CREATE_REQUIRED_FILES_COMMAND := \ + cd $(FFMPEG_ROOT_DIR)/$(FFMPEG_CONFIG_DIR); \ + ../../configure \ + --enable-shared \ + --disable-static \ + --enable-avresample \ + --disable-everything \ + --disable-yasm; \ + make -j4; \ + cd $$OLDPWD; + endif + + ifeq ($(VERSION_BRANCH),0.11) + FF_CREATE_REQUIRED_FILES_COMMAND := \ + cd $(FFMPEG_ROOT_DIR)/$(FFMPEG_CONFIG_DIR); \ + ../../configure \ + --enable-shared \ + --disable-static \ + --enable-avresample \ + --disable-everything \ + --disable-yasm; \ + make -j4; \ + cd $$OLDPWD; + endif + + $(warning ============================================================) + $(warning Creating required files...) + $(warning $(FF_CREATE_REQUIRED_FILES_COMMAND)) + FF_CREATE_REQUIRED_FILES_OUTPUT := $(shell $(FF_CREATE_REQUIRED_FILES_COMMAND)) + $(warning Done.) + $(warning ============================================================) + + + + FF_CONFIGURATION_COMMAND := \ + cd $(FFMPEG_ROOT_DIR)/$(FFMPEG_CONFIG_DIR); \ + ../../configure $(FF_CONFIGURATION_STRING); \ + cd $$OLDPWD; + + $(warning ============================================================) + $(warning Configuring FFmpeg...) + $(warning $(FF_CONFIGURATION_COMMAND)) + FF_CONFIGURATION_OUTPUT := $(shell $(FF_CONFIGURATION_COMMAND)) + $(warning Done.) + $(warning ============================================================) + + + + ifeq ($(VERSION_BRANCH),1.1) + FF_FIX_CONFIGURATION_COMMAND := \ + cd $(FFMPEG_ROOT_DIR)/$(FFMPEG_CONFIG_DIR); \ + \ + cat config.h | \ + sed 's/\#define ARCH_ARM /\#ifdef ARCH_ARM\n\#undef ARCH_ARM\n\#endif\n\#define ARCH_ARM /g' | \ + sed 's/\#define ARCH_MIPS /\#ifdef ARCH_MIPS\n\#undef ARCH_MIPS\n\#endif\n\#define ARCH_MIPS /g' | \ + sed 's/\#define ARCH_X86 /\#ifdef ARCH_X86\n\#undef ARCH_X86\n\#endif\n\#define ARCH_X86 /g' | \ + sed 's/\#define HAVE_PTHREADS/\#ifdef HAVE_PTHREADS\n\#undef HAVE_PTHREADS\n\#endif\n\#define HAVE_PTHREADS/g' | \ + sed 's/\#define HAVE_MALLOC_H/\#ifdef HAVE_MALLOC_H\n\#undef HAVE_MALLOC_H\n\#endif\n\#define HAVE_MALLOC_H/g' | \ + sed 's/\#define HAVE_STRERROR_R 1/\#define HAVE_STRERROR_R 0/g' | \ + cat > config.h.tmp; \ + mv config.h config.h.bak; \ + mv config.h.tmp config.h; \ + \ + cat config.mak | \ + sed 's/HAVE_STRERROR_R=yes/!HAVE_STRERROR_R=yes/g' | \ + cat > config.mak.tmp; \ + mv config.mak config.mak.bak; \ + mv config.mak.tmp config.mak; \ + \ + cd $(OLDPWD); + endif + + ifeq ($(VERSION_BRANCH),1.0) + FF_FIX_CONFIGURATION_COMMAND := \ + cd $(FFMPEG_ROOT_DIR)/$(FFMPEG_CONFIG_DIR); \ + \ + cat config.h | \ + sed 's/\#define ARCH_ARM /\#ifdef ARCH_ARM\n\#undef ARCH_ARM\n\#endif\n\#define ARCH_ARM /g' | \ + sed 's/\#define ARCH_MIPS /\#ifdef ARCH_MIPS\n\#undef ARCH_MIPS\n\#endif\n\#define ARCH_MIPS /g' | \ + sed 's/\#define ARCH_X86 /\#ifdef ARCH_X86\n\#undef ARCH_X86\n\#endif\n\#define ARCH_X86 /g' | \ + sed 's/\#define HAVE_PTHREADS/\#ifdef HAVE_PTHREADS\n\#undef HAVE_PTHREADS\n\#endif\n\#define HAVE_PTHREADS/g' | \ + sed 's/\#define HAVE_MALLOC_H/\#ifdef HAVE_MALLOC_H\n\#undef HAVE_MALLOC_H\n\#endif\n\#define HAVE_MALLOC_H/g' | \ + sed 's/\#define HAVE_STRERROR_R 1/\#define HAVE_STRERROR_R 0/g' | \ + cat > config.h.tmp; \ + mv config.h config.h.bak; \ + mv config.h.tmp config.h; \ + \ + cat config.mak | \ + sed 's/HAVE_STRERROR_R=yes/!HAVE_STRERROR_R=yes/g' | \ + cat > config.mak.tmp; \ + mv config.mak config.mak.bak; \ + mv config.mak.tmp config.mak; \ + \ + cd $(OLDPWD); + endif + + ifeq ($(VERSION_BRANCH),0.11) + FF_FIX_CONFIGURATION_COMMAND := \ + cd $(FFMPEG_ROOT_DIR)/$(FFMPEG_CONFIG_DIR); \ + \ + cat config.h | \ + sed 's/\#define ARCH_ARM /\#ifdef ARCH_ARM\n\#undef ARCH_ARM\n\#endif\n\#define ARCH_ARM /g' | \ + sed 's/\#define ARCH_MIPS /\#ifdef ARCH_MIPS\n\#undef ARCH_MIPS\n\#endif\n\#define ARCH_MIPS /g' | \ + sed 's/\#define ARCH_X86 /\#ifdef ARCH_X86\n\#undef ARCH_X86\n\#endif\n\#define ARCH_X86 /g' | \ + sed 's/\#define HAVE_PTHREADS/\#ifdef HAVE_PTHREADS\n\#undef HAVE_PTHREADS\n\#endif\n\#define HAVE_PTHREADS/g' | \ + sed 's/\#define HAVE_MALLOC_H/\#ifdef HAVE_MALLOC_H\n\#undef HAVE_MALLOC_H\n\#endif\n\#define HAVE_MALLOC_H/g' | \ + sed 's/\#define HAVE_STRERROR_R 1/\#define HAVE_STRERROR_R 0/g' | \ + cat > config.h.tmp; \ + mv config.h config.h.bak; \ + mv config.h.tmp config.h; \ + \ + cat config.mak | \ + sed 's/HAVE_STRERROR_R=yes/!HAVE_STRERROR_R=yes/g' | \ + cat > config.mak.tmp; \ + mv config.mak config.mak.bak; \ + mv config.mak.tmp config.mak; \ + \ + cd $(OLDPWD); + endif + + ifeq ($(VERSION_BRANCH),0.10) + FF_FIX_CONFIGURATION_COMMAND := \ + cd $(FFMPEG_ROOT_DIR)/$(FFMPEG_CONFIG_DIR); \ + \ + cat config.h | \ + sed 's/\#define ARCH_ARM /\#ifdef ARCH_ARM\n\#undef ARCH_ARM\n\#endif\n\#define ARCH_ARM /g' | \ + sed 's/\#define ARCH_MIPS /\#ifdef ARCH_MIPS\n\#undef ARCH_MIPS\n\#endif\n\#define ARCH_MIPS /g' | \ + sed 's/\#define ARCH_X86 /\#ifdef ARCH_X86\n\#undef ARCH_X86\n\#endif\n\#define ARCH_X86 /g' | \ + sed 's/\#define HAVE_PTHREADS/\#ifdef HAVE_PTHREADS\n\#undef HAVE_PTHREADS\n\#endif\n\#define HAVE_PTHREADS/g' | \ + sed 's/\#define HAVE_MALLOC_H/\#ifdef HAVE_MALLOC_H\n\#undef HAVE_MALLOC_H\n\#endif\n\#define HAVE_MALLOC_H/g' | \ + sed 's/\#define HAVE_STRERROR_R 1/\#define HAVE_STRERROR_R 0/g' | \ + cat > config.h.tmp; \ + mv config.h config.h.bak; \ + mv config.h.tmp config.h; \ + \ + cat config.mak | \ + sed 's/HAVE_STRERROR_R=yes/!HAVE_STRERROR_R=yes/g' | \ + cat > config.mak.tmp; \ + mv config.mak config.mak.bak; \ + mv config.mak.tmp config.mak; \ + \ + cd $(OLDPWD); + endif + + ifeq ($(VERSION_BRANCH),0.9) + FF_FIX_CONFIGURATION_COMMAND := \ + cd $(FFMPEG_ROOT_DIR)/$(FFMPEG_CONFIG_DIR); \ + \ + cat config.h | \ + sed 's/\#define ARCH_ARM /\#ifdef ARCH_ARM\n\#undef ARCH_ARM\n\#endif\n\#define ARCH_ARM /g' | \ + sed 's/\#define ARCH_MIPS /\#ifdef ARCH_MIPS\n\#undef ARCH_MIPS\n\#endif\n\#define ARCH_MIPS /g' | \ + sed 's/\#define ARCH_X86 /\#ifdef ARCH_X86\n\#undef ARCH_X86\n\#endif\n\#define ARCH_X86 /g' | \ + sed 's/\#define HAVE_PTHREADS/\#ifdef HAVE_PTHREADS\n\#undef HAVE_PTHREADS\n\#endif\n\#define HAVE_PTHREADS/g' | \ + sed 's/\#define HAVE_MALLOC_H/\#ifdef HAVE_MALLOC_H\n\#undef HAVE_MALLOC_H\n\#endif\n\#define HAVE_MALLOC_H/g' | \ + sed 's/\#define HAVE_STRERROR_R 1/\#define HAVE_STRERROR_R 0/g' | \ + cat > config.h.tmp; \ + mv config.h config.h.bak; \ + mv config.h.tmp config.h; \ + \ + cat config.mak | \ + sed 's/HAVE_STRERROR_R=yes/!HAVE_STRERROR_R=yes/g' | \ + cat > config.mak.tmp; \ + mv config.mak config.mak.bak; \ + mv config.mak.tmp config.mak; \ + \ + cd $(OLDPWD); + endif + + ifeq ($(VERSION_BRANCH),0.8) + FF_FIX_CONFIGURATION_COMMAND := \ + cd $(FFMPEG_ROOT_DIR)/$(FFMPEG_CONFIG_DIR); \ + \ + cat config.h | \ + sed 's/\#define ARCH_ARM /\#ifdef ARCH_ARM\n\#undef ARCH_ARM\n\#endif\n\#define ARCH_ARM /g' | \ + sed 's/\#define ARCH_MIPS /\#ifdef ARCH_MIPS\n\#undef ARCH_MIPS\n\#endif\n\#define ARCH_MIPS /g' | \ + sed 's/\#define ARCH_X86 /\#ifdef ARCH_X86\n\#undef ARCH_X86\n\#endif\n\#define ARCH_X86 /g' | \ + sed 's/\#define HAVE_PTHREADS/\#ifdef HAVE_PTHREADS\n\#undef HAVE_PTHREADS\n\#endif\n\#define HAVE_PTHREADS/g' | \ + sed 's/\#define HAVE_MALLOC_H/\#ifdef HAVE_MALLOC_H\n\#undef HAVE_MALLOC_H\n\#endif\n\#define HAVE_MALLOC_H/g' | \ + sed 's/\#define HAVE_STRERROR_R 1/\#define HAVE_STRERROR_R 0/g' | \ + cat > config.h.tmp; \ + mv config.h config.h.bak; \ + mv config.h.tmp config.h; \ + \ + cat config.mak | \ + sed 's/HAVE_STRERROR_R=yes/!HAVE_STRERROR_R=yes/g' | \ + cat > config.mak.tmp; \ + mv config.mak config.mak.bak; \ + mv config.mak.tmp config.mak; \ + \ + cd $(OLDPWD); + endif + + ifeq ($(VERSION_BRANCH),0.7) + FF_FIX_CONFIGURATION_COMMAND := \ + cd $(FFMPEG_ROOT_DIR)/$(FFMPEG_CONFIG_DIR); \ + \ + cat config.h | \ + sed 's/\#define ARCH_ARM /\#ifdef ARCH_ARM\n\#undef ARCH_ARM\n\#endif\n\#define ARCH_ARM /g' | \ + sed 's/\#define ARCH_MIPS /\#ifdef ARCH_MIPS\n\#undef ARCH_MIPS\n\#endif\n\#define ARCH_MIPS /g' | \ + sed 's/\#define ARCH_X86 /\#ifdef ARCH_X86\n\#undef ARCH_X86\n\#endif\n\#define ARCH_X86 /g' | \ + sed 's/\#define HAVE_PTHREADS/\#ifdef HAVE_PTHREADS\n\#undef HAVE_PTHREADS\n\#endif\n\#define HAVE_PTHREADS/g' | \ + sed 's/\#define HAVE_MALLOC_H/\#ifdef HAVE_MALLOC_H\n\#undef HAVE_MALLOC_H\n\#endif\n\#define HAVE_MALLOC_H/g' | \ + sed 's/\#define HAVE_STRERROR_R 1/\#define HAVE_STRERROR_R 0/g' | \ + cat > config.h.tmp; \ + mv config.h config.h.bak; \ + mv config.h.tmp config.h; \ + \ + cat config.mak | \ + sed 's/HAVE_STRERROR_R=yes/!HAVE_STRERROR_R=yes/g' | \ + cat > config.mak.tmp; \ + mv config.mak config.mak.bak; \ + mv config.mak.tmp config.mak; \ + \ + cd $(OLDPWD); + endif + + $(warning ============================================================) + $(warning Fixing configuration...) + #$(warning $(FF_FIX_CONFIGURATION_COMMAND)) + FF_FIX_CONFIGURATION_OUTPUT := $(shell $(FF_FIX_CONFIGURATION_COMMAND)) + $(warning Done.) + $(warning ============================================================) + + + + ifeq ($(VERSION_BRANCH),1.1) + FF_FIX_MAKEFILES_COMMAND := \ + cd $(FFMPEG_ROOT_DIR); \ + sed 's/include $$(SUBDIR)..\/config.mak/\#include $$(SUBDIR)..\/config.mak/g' libavcodec/Makefile > libavcodec/Makefile.android; \ + sed 's/include $$(SUBDIR)..\/config.mak/\#include $$(SUBDIR)..\/config.mak/g' libavdevice/Makefile > libavdevice/Makefile.android; \ + sed 's/include $$(SUBDIR)..\/config.mak/\#include $$(SUBDIR)..\/config.mak/g' libavfilter/Makefile | \ + sed 's/clean::/\#clean::/g' | \ + sed 's/\t$$(RM) $$(CLEANSUFFIXES/\#\t$$(RM) $$(CLEANSUFFIXES/g' > libavfilter/Makefile.android; \ + sed 's/include $$(SUBDIR)..\/config.mak/\#include $$(SUBDIR)..\/config.mak/g' libavformat/Makefile > libavformat/Makefile.android; \ + sed 's/include $$(SUBDIR)..\/config.mak/\#include $$(SUBDIR)..\/config.mak/g' libavresample/Makefile > libavresample/Makefile.android; \ + sed 's/include $$(SUBDIR)..\/config.mak/\#include $$(SUBDIR)..\/config.mak/g' libavutil/Makefile > libavutil/Makefile.android; \ + sed 's/include $$(SUBDIR)..\/config.mak/\#include $$(SUBDIR)..\/config.mak/g' libpostproc/Makefile > libpostproc/Makefile.android; \ + sed 's/include $$(SUBDIR)..\/config.mak/\#include $$(SUBDIR)..\/config.mak/g' libswresample/Makefile > libswresample/Makefile.android; \ + sed 's/include $$(SUBDIR)..\/config.mak/\#include $$(SUBDIR)..\/config.mak/g' libswscale/Makefile > libswscale/Makefile.android; \ + cd $$OLDPWD; + endif + ifeq ($(VERSION_BRANCH),1.0) + FF_FIX_MAKEFILES_COMMAND := \ + cd $(FFMPEG_ROOT_DIR); \ + sed 's/include $$(SUBDIR)..\/config.mak/\#include $$(SUBDIR)..\/config.mak/g' libavcodec/Makefile > libavcodec/Makefile.android; \ + sed 's/include $$(SUBDIR)..\/config.mak/\#include $$(SUBDIR)..\/config.mak/g' libavdevice/Makefile > libavdevice/Makefile.android; \ + sed 's/include $$(SUBDIR)..\/config.mak/\#include $$(SUBDIR)..\/config.mak/g' libavfilter/Makefile | \ + sed 's/clean::/\#clean::/g' | \ + sed 's/\t$$(RM) $$(CLEANSUFFIXES/\#\t$$(RM) $$(CLEANSUFFIXES/g' > libavfilter/Makefile.android; \ + sed 's/include $$(SUBDIR)..\/config.mak/\#include $$(SUBDIR)..\/config.mak/g' libavformat/Makefile > libavformat/Makefile.android; \ + sed 's/include $$(SUBDIR)..\/config.mak/\#include $$(SUBDIR)..\/config.mak/g' libavresample/Makefile > libavresample/Makefile.android; \ + sed 's/include $$(SUBDIR)..\/config.mak/\#include $$(SUBDIR)..\/config.mak/g' libavutil/Makefile > libavutil/Makefile.android; \ + sed 's/include $$(SUBDIR)..\/config.mak/\#include $$(SUBDIR)..\/config.mak/g' libpostproc/Makefile > libpostproc/Makefile.android; \ + sed 's/include $$(SUBDIR)..\/config.mak/\#include $$(SUBDIR)..\/config.mak/g' libswresample/Makefile > libswresample/Makefile.android; \ + sed 's/include $$(SUBDIR)..\/config.mak/\#include $$(SUBDIR)..\/config.mak/g' libswscale/Makefile > libswscale/Makefile.android; \ + cd $$OLDPWD; + endif + + ifeq ($(VERSION_BRANCH),0.11) + FF_FIX_MAKEFILES_COMMAND := \ + cd $(FFMPEG_ROOT_DIR); \ + sed 's/include $$(SUBDIR)..\/config.mak/\#include $$(SUBDIR)..\/config.mak/g' libavcodec/Makefile > libavcodec/Makefile.android; \ + sed 's/include $$(SUBDIR)..\/config.mak/\#include $$(SUBDIR)..\/config.mak/g' libavdevice/Makefile > libavdevice/Makefile.android; \ + sed 's/include $$(SUBDIR)..\/config.mak/\#include $$(SUBDIR)..\/config.mak/g' libavfilter/Makefile > libavfilter/Makefile.android; \ + sed 's/include $$(SUBDIR)..\/config.mak/\#include $$(SUBDIR)..\/config.mak/g' libavformat/Makefile > libavformat/Makefile.android; \ + sed 's/include $$(SUBDIR)..\/config.mak/\#include $$(SUBDIR)..\/config.mak/g' libavresample/Makefile > libavresample/Makefile.android; \ + sed 's/include $$(SUBDIR)..\/config.mak/\#include $$(SUBDIR)..\/config.mak/g' libavutil/Makefile > libavutil/Makefile.android; \ + sed 's/include $$(SUBDIR)..\/config.mak/\#include $$(SUBDIR)..\/config.mak/g' libpostproc/Makefile > libpostproc/Makefile.android; \ + sed 's/include $$(SUBDIR)..\/config.mak/\#include $$(SUBDIR)..\/config.mak/g' libswresample/Makefile > libswresample/Makefile.android; \ + sed 's/include $$(SUBDIR)..\/config.mak/\#include $$(SUBDIR)..\/config.mak/g' libswscale/Makefile > libswscale/Makefile.android; \ + cd $$OLDPWD; + endif + + ifeq ($(VERSION_BRANCH),0.10) + FF_FIX_MAKEFILES_COMMAND := \ + cd $(FFMPEG_ROOT_DIR); \ + sed 's/include $$(SUBDIR)..\/config.mak/\#include $$(SUBDIR)..\/config.mak/g' libavcodec/Makefile > libavcodec/Makefile.android; \ + sed 's/include $$(SUBDIR)..\/config.mak/\#include $$(SUBDIR)..\/config.mak/g' libavdevice/Makefile > libavdevice/Makefile.android; \ + sed 's/include $$(SUBDIR)..\/config.mak/\#include $$(SUBDIR)..\/config.mak/g' libavfilter/Makefile > libavfilter/Makefile.android; \ + sed 's/include $$(SUBDIR)..\/config.mak/\#include $$(SUBDIR)..\/config.mak/g' libavformat/Makefile > libavformat/Makefile.android; \ + sed 's/include $$(SUBDIR)..\/config.mak/\#include $$(SUBDIR)..\/config.mak/g' libavutil/Makefile > libavutil/Makefile.android; \ + sed 's/include $$(SUBDIR)..\/config.mak/\#include $$(SUBDIR)..\/config.mak/g' libpostproc/Makefile > libpostproc/Makefile.android; \ + sed 's/include $$(SUBDIR)..\/config.mak/\#include $$(SUBDIR)..\/config.mak/g' libswresample/Makefile > libswresample/Makefile.android; \ + sed 's/include $$(SUBDIR)..\/config.mak/\#include $$(SUBDIR)..\/config.mak/g' libswscale/Makefile > libswscale/Makefile.android; \ + cd $$OLDPWD; + endif + + ifeq ($(VERSION_BRANCH),0.9) + FF_FIX_MAKEFILES_COMMAND := \ + cd $(FFMPEG_ROOT_DIR); \ + sed 's/include $$(SUBDIR)..\/config.mak/\#include $$(SUBDIR)..\/config.mak/g' libavcodec/Makefile | \ + sed 's/include $$(SRC_PATH)\/subdir.mak/\#include $$(SRC_PATH)\/subdir.mak/g' | \ + sed 's/-include $$(SRC_PATH)\/$$(SUBDIR)$$(ARCH)\/Makefile/include $$(LOCAL_PATH)\/libavcodec\/$$(ARCH)\/Makefile/g' > libavcodec/Makefile.android; \ + sed 's/include $$(SUBDIR)..\/config.mak/\#include $$(SUBDIR)..\/config.mak/g' libavdevice/Makefile | \ + sed 's/include $$(SRC_PATH)\/subdir.mak/\#include $$(SRC_PATH)\/subdir.mak/g' > libavdevice/Makefile.android; \ + sed 's/include $$(SUBDIR)..\/config.mak/\#include $$(SUBDIR)..\/config.mak/g' libavfilter/Makefile | \ + sed 's/include $$(SRC_PATH)\/subdir.mak/\#include $$(SRC_PATH)\/subdir.mak/g' > libavfilter/Makefile.android; \ + sed 's/include $$(SUBDIR)..\/config.mak/\#include $$(SUBDIR)..\/config.mak/g' libavformat/Makefile | \ + sed 's/include $$(SRC_PATH)\/subdir.mak/\#include $$(SRC_PATH)\/subdir.mak/g' > libavformat/Makefile.android; \ + sed 's/include $$(SUBDIR)..\/config.mak/\#include $$(SUBDIR)..\/config.mak/g' libavutil/Makefile | \ + sed 's/include $$(SRC_PATH)\/subdir.mak/\#include $$(SRC_PATH)\/subdir.mak/g' > libavutil/Makefile.android; \ + sed 's/include $$(SUBDIR)..\/config.mak/\#include $$(SUBDIR)..\/config.mak/g' libpostproc/Makefile | \ + sed 's/include $$(SRC_PATH)\/subdir.mak/\#include $$(SRC_PATH)\/subdir.mak/g' > libpostproc/Makefile.android; \ + sed 's/include $$(SUBDIR)..\/config.mak/\#include $$(SUBDIR)..\/config.mak/g' libswresample/Makefile | \ + sed 's/include $$(SRC_PATH)\/subdir.mak/\#include $$(SRC_PATH)\/subdir.mak/g' > libswresample/Makefile.android; \ + sed 's/include $$(SUBDIR)..\/config.mak/\#include $$(SUBDIR)..\/config.mak/g' libswscale/Makefile | \ + sed 's/include $$(SRC_PATH)\/subdir.mak/\#include $$(SRC_PATH)\/subdir.mak/g' > libswscale/Makefile.android; \ + cd $$OLDPWD; + endif + + ifeq ($(VERSION_BRANCH),0.8) + FF_FIX_MAKEFILES_COMMAND := \ + cd $(FFMPEG_ROOT_DIR); \ + sed 's/include $$(SUBDIR)..\/config.mak/\#include $$(SUBDIR)..\/config.mak/g' libavcodec/Makefile | \ + sed 's/include $$(SUBDIR)..\/subdir.mak/\#include $$(SUBDIR)..\/subdir.mak/g' | \ + sed 's/-include $$(SUBDIR)..\/$$(SUBDIR)$$(ARCH)\/Makefile/include $$(LOCAL_PATH)\/libavcodec\/$$(ARCH)\/Makefile/g' > libavcodec/Makefile.android; \ + sed 's/include $$(SUBDIR)..\/config.mak/\#include $$(SUBDIR)..\/config.mak/g' libavdevice/Makefile | \ + sed 's/include $$(SUBDIR)..\/subdir.mak/\#include $$(SUBDIR)..\/subdir.mak/g' > libavdevice/Makefile.android; \ + sed 's/include $$(SUBDIR)..\/config.mak/\#include $$(SUBDIR)..\/config.mak/g' libavfilter/Makefile | \ + sed 's/include $$(SUBDIR)..\/subdir.mak/\#include $$(SUBDIR)..\/subdir.mak/g' > libavfilter/Makefile.android; \ + sed 's/include $$(SUBDIR)..\/config.mak/\#include $$(SUBDIR)..\/config.mak/g' libavformat/Makefile | \ + sed 's/include $$(SUBDIR)..\/subdir.mak/\#include $$(SUBDIR)..\/subdir.mak/g' > libavformat/Makefile.android; \ + sed 's/include $$(SUBDIR)..\/config.mak/\#include $$(SUBDIR)..\/config.mak/g' libavutil/Makefile | \ + sed 's/include $$(SUBDIR)..\/subdir.mak/\#include $$(SUBDIR)..\/subdir.mak/g' > libavutil/Makefile.android; \ + sed 's/include $$(SUBDIR)..\/config.mak/\#include $$(SUBDIR)..\/config.mak/g' libpostproc/Makefile | \ + sed 's/include $$(SUBDIR)..\/subdir.mak/\#include $$(SUBDIR)..\/subdir.mak/g' > libpostproc/Makefile.android; \ + sed 's/include $$(SUBDIR)..\/config.mak/\#include $$(SUBDIR)..\/config.mak/g' libswresample/Makefile | \ + sed 's/include $$(SUBDIR)..\/subdir.mak/\#include $$(SUBDIR)..\/subdir.mak/g' > libswresample/Makefile.android; \ + sed 's/include $$(SUBDIR)..\/config.mak/\#include $$(SUBDIR)..\/config.mak/g' libswscale/Makefile | \ + sed 's/include $$(SUBDIR)..\/subdir.mak/\#include $$(SUBDIR)..\/subdir.mak/g' > libswscale/Makefile.android; \ + cd $$OLDPWD; + endif + + ifeq ($(VERSION_BRANCH),0.7) + FF_FIX_MAKEFILES_COMMAND := \ + cd $(FFMPEG_ROOT_DIR); \ + sed 's/include $$(SUBDIR)..\/config.mak/\#include $$(SUBDIR)..\/config.mak/g' libavcodec/Makefile | \ + sed 's/include $$(SUBDIR)..\/subdir.mak/\#include $$(SUBDIR)..\/subdir.mak/g' | \ + sed 's/-include $$(SUBDIR)..\/$$(SUBDIR)$$(ARCH)\/Makefile/include $$(LOCAL_PATH)\/libavcodec\/$$(ARCH)\/Makefile/g' > libavcodec/Makefile.android; \ + sed 's/include $$(SUBDIR)..\/config.mak/\#include $$(SUBDIR)..\/config.mak/g' libavdevice/Makefile | \ + sed 's/include $$(SUBDIR)..\/subdir.mak/\#include $$(SUBDIR)..\/subdir.mak/g' > libavdevice/Makefile.android; \ + sed 's/include $$(SUBDIR)..\/config.mak/\#include $$(SUBDIR)..\/config.mak/g' libavfilter/Makefile | \ + sed 's/include $$(SUBDIR)..\/subdir.mak/\#include $$(SUBDIR)..\/subdir.mak/g' > libavfilter/Makefile.android; \ + sed 's/include $$(SUBDIR)..\/config.mak/\#include $$(SUBDIR)..\/config.mak/g' libavformat/Makefile | \ + sed 's/include $$(SUBDIR)..\/subdir.mak/\#include $$(SUBDIR)..\/subdir.mak/g' > libavformat/Makefile.android; \ + sed 's/include $$(SUBDIR)..\/config.mak/\#include $$(SUBDIR)..\/config.mak/g' libavutil/Makefile | \ + sed 's/include $$(SUBDIR)..\/subdir.mak/\#include $$(SUBDIR)..\/subdir.mak/g' > libavutil/Makefile.android; \ + sed 's/include $$(SUBDIR)..\/config.mak/\#include $$(SUBDIR)..\/config.mak/g' libpostproc/Makefile | \ + sed 's/include $$(SUBDIR)..\/subdir.mak/\#include $$(SUBDIR)..\/subdir.mak/g' > libpostproc/Makefile.android; \ + sed 's/include $$(SUBDIR)..\/config.mak/\#include $$(SUBDIR)..\/config.mak/g' libswscale/Makefile | \ + sed 's/include $$(SUBDIR)..\/subdir.mak/\#include $$(SUBDIR)..\/subdir.mak/g' > libswscale/Makefile.android; \ + cd $$OLDPWD; + endif + + $(warning ============================================================) + $(warning Fixing Makefiles...) + #$(warning $(FF_FIX_MAKEFILES_COMMAND)) + FF_FIX_MAKEFILES_OUTPUT := $(shell $(FF_FIX_MAKEFILES_COMMAND)) + $(warning Done.) + $(warning ============================================================) + + + + #Saving configuration + FF_LAST_CONFIGURATION_STRING_COMMAND := \ + echo "$(FF_CONFIGURATION_STRING)" > $(FFMPEG_ROOT_DIR)/$(FFMPEG_CONFIG_DIR)/LAST_CONFIGURATION_STRING + FF_LAST_CONFIGURATION_STRING_OUTPUT := $(shell $(FF_LAST_CONFIGURATION_STRING_COMMAND)) + +endif diff --git a/project/jni/ffmpeg/COPYING.GPLv2 b/project/jni/ffmpeg/COPYING.GPLv2 new file mode 100644 index 000000000..d159169d1 --- /dev/null +++ b/project/jni/ffmpeg/COPYING.GPLv2 @@ -0,0 +1,339 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. diff --git a/project/jni/ffmpeg/COPYING.GPLv3 b/project/jni/ffmpeg/COPYING.GPLv3 new file mode 100644 index 000000000..94a9ed024 --- /dev/null +++ b/project/jni/ffmpeg/COPYING.GPLv3 @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. diff --git a/project/jni/ffmpeg/COPYING.LGPLv2.1 b/project/jni/ffmpeg/COPYING.LGPLv2.1 new file mode 100644 index 000000000..58af0d378 --- /dev/null +++ b/project/jni/ffmpeg/COPYING.LGPLv2.1 @@ -0,0 +1,502 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 + + Copyright (C) 1991, 1999 Free Software Foundation, Inc. + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Lesser General Public License, applies to some +specially designated software packages--typically libraries--of the +Free Software Foundation and other authors who decide to use it. You +can use it too, but we suggest you first think carefully about whether +this license or the ordinary General Public License is the better +strategy to use in any particular case, based on the explanations below. + + When we speak of free software, we are referring to freedom of use, +not price. Our General Public Licenses are designed to make sure that +you have the freedom to distribute copies of free software (and charge +for this service if you wish); that you receive source code or can get +it if you want it; that you can change the software and use pieces of +it in new free programs; and that you are informed that you can do +these things. + + To protect your rights, we need to make restrictions that forbid +distributors to deny you these rights or to ask you to surrender these +rights. These restrictions translate to certain responsibilities for +you if you distribute copies of the library or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link other code with the library, you must provide +complete object files to the recipients, so that they can relink them +with the library after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal +permission to copy, distribute and/or modify the library. + + To protect each distributor, we want to make it very clear that +there is no warranty for the free library. Also, if the library is +modified by someone else and passed on, the recipients should know +that what they have is not the original version, so that the original +author's reputation will not be affected by problems that might be +introduced by others. + + Finally, software patents pose a constant threat to the existence of +any free program. We wish to make sure that a company cannot +effectively restrict the users of a free program by obtaining a +restrictive license from a patent holder. Therefore, we insist that +any patent license obtained for a version of the library must be +consistent with the full freedom of use specified in this license. + + Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License. This license, the GNU Lesser +General Public License, applies to certain designated libraries, and +is quite different from the ordinary General Public License. We use +this license for certain libraries in order to permit linking those +libraries into non-free programs. + + When a program is linked with a library, whether statically or using +a shared library, the combination of the two is legally speaking a +combined work, a derivative of the original library. The ordinary +General Public License therefore permits such linking only if the +entire combination fits its criteria of freedom. The Lesser General +Public License permits more lax criteria for linking other code with +the library. + + We call this license the "Lesser" General Public License because it +does Less to protect the user's freedom than the ordinary General +Public License. It also provides other free software developers Less +of an advantage over competing non-free programs. These disadvantages +are the reason we use the ordinary General Public License for many +libraries. However, the Lesser license provides advantages in certain +special circumstances. + + For example, on rare occasions, there may be a special need to +encourage the widest possible use of a certain library, so that it becomes +a de-facto standard. To achieve this, non-free programs must be +allowed to use the library. A more frequent case is that a free +library does the same job as widely used non-free libraries. In this +case, there is little to gain by limiting the free library to free +software only, so we use the Lesser General Public License. + + In other cases, permission to use a particular library in non-free +programs enables a greater number of people to use a large body of +free software. For example, permission to use the GNU C Library in +non-free programs enables many more people to use the whole GNU +operating system, as well as its variant, the GNU/Linux operating +system. + + Although the Lesser General Public License is Less protective of the +users' freedom, it does ensure that the user of a program that is +linked with the Library has the freedom and the wherewithal to run +that program using a modified version of the Library. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, whereas the latter must +be combined with the library in order to run. + + GNU LESSER GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library or other +program which contains a notice placed by the copyright holder or +other authorized party saying it may be distributed under the terms of +this Lesser General Public License (also called "this License"). +Each licensee is addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control compilation +and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also combine or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run time a + copy of the library already present on the user's computer system, + rather than copying library functions into the executable, and (2) + will operate properly with a modified version of the library, if + the user installs one, as long as the modified version is + interface-compatible with the version that the work was made with. + + c) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + d) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + e) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the materials to be distributed need not include anything that is +normally distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties with +this License. + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License may add +an explicit geographical distribution limitation excluding those countries, +so that distribution is permitted only in or among countries not thus +excluded. In such case, this License incorporates the limitation as if +written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Lesser General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Libraries + + If you develop a new library, and you want it to be of the greatest +possible use to the public, we recommend making it free software that +everyone can redistribute and change. You can do so by permitting +redistribution under these terms (or, alternatively, under the terms of the +ordinary General Public License). + + To apply these terms, attach the following notices to the library. It is +safest to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +Also add information on how to contact you by electronic and paper mail. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the library, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + library `Frob' (a library for tweaking knobs) written by James Random Hacker. + + , 1 April 1990 + Ty Coon, President of Vice + +That's all there is to it! diff --git a/project/jni/ffmpeg/COPYING.LGPLv3 b/project/jni/ffmpeg/COPYING.LGPLv3 new file mode 100644 index 000000000..65c5ca88a --- /dev/null +++ b/project/jni/ffmpeg/COPYING.LGPLv3 @@ -0,0 +1,165 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + + This version of the GNU Lesser General Public License incorporates +the terms and conditions of version 3 of the GNU General Public +License, supplemented by the additional permissions listed below. + + 0. Additional Definitions. + + As used herein, "this License" refers to version 3 of the GNU Lesser +General Public License, and the "GNU GPL" refers to version 3 of the GNU +General Public License. + + "The Library" refers to a covered work governed by this License, +other than an Application or a Combined Work as defined below. + + An "Application" is any work that makes use of an interface provided +by the Library, but which is not otherwise based on the Library. +Defining a subclass of a class defined by the Library is deemed a mode +of using an interface provided by the Library. + + A "Combined Work" is a work produced by combining or linking an +Application with the Library. The particular version of the Library +with which the Combined Work was made is also called the "Linked +Version". + + The "Minimal Corresponding Source" for a Combined Work means the +Corresponding Source for the Combined Work, excluding any source code +for portions of the Combined Work that, considered in isolation, are +based on the Application, and not on the Linked Version. + + The "Corresponding Application Code" for a Combined Work means the +object code and/or source code for the Application, including any data +and utility programs needed for reproducing the Combined Work from the +Application, but excluding the System Libraries of the Combined Work. + + 1. Exception to Section 3 of the GNU GPL. + + You may convey a covered work under sections 3 and 4 of this License +without being bound by section 3 of the GNU GPL. + + 2. Conveying Modified Versions. + + If you modify a copy of the Library, and, in your modifications, a +facility refers to a function or data to be supplied by an Application +that uses the facility (other than as an argument passed when the +facility is invoked), then you may convey a copy of the modified +version: + + a) under this License, provided that you make a good faith effort to + ensure that, in the event an Application does not supply the + function or data, the facility still operates, and performs + whatever part of its purpose remains meaningful, or + + b) under the GNU GPL, with none of the additional permissions of + this License applicable to that copy. + + 3. Object Code Incorporating Material from Library Header Files. + + The object code form of an Application may incorporate material from +a header file that is part of the Library. You may convey such object +code under terms of your choice, provided that, if the incorporated +material is not limited to numerical parameters, data structure +layouts and accessors, or small macros, inline functions and templates +(ten or fewer lines in length), you do both of the following: + + a) Give prominent notice with each copy of the object code that the + Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the object code with a copy of the GNU GPL and this license + document. + + 4. Combined Works. + + You may convey a Combined Work under terms of your choice that, +taken together, effectively do not restrict modification of the +portions of the Library contained in the Combined Work and reverse +engineering for debugging such modifications, if you also do each of +the following: + + a) Give prominent notice with each copy of the Combined Work that + the Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the Combined Work with a copy of the GNU GPL and this license + document. + + c) For a Combined Work that displays copyright notices during + execution, include the copyright notice for the Library among + these notices, as well as a reference directing the user to the + copies of the GNU GPL and this license document. + + d) Do one of the following: + + 0) Convey the Minimal Corresponding Source under the terms of this + License, and the Corresponding Application Code in a form + suitable for, and under terms that permit, the user to + recombine or relink the Application with a modified version of + the Linked Version to produce a modified Combined Work, in the + manner specified by section 6 of the GNU GPL for conveying + Corresponding Source. + + 1) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (a) uses at run time + a copy of the Library already present on the user's computer + system, and (b) will operate properly with a modified version + of the Library that is interface-compatible with the Linked + Version. + + e) Provide Installation Information, but only if you would otherwise + be required to provide such information under section 6 of the + GNU GPL, and only to the extent that such information is + necessary to install and execute a modified version of the + Combined Work produced by recombining or relinking the + Application with a modified version of the Linked Version. (If + you use option 4d0, the Installation Information must accompany + the Minimal Corresponding Source and Corresponding Application + Code. If you use option 4d1, you must provide the Installation + Information in the manner specified by section 6 of the GNU GPL + for conveying Corresponding Source.) + + 5. Combined Libraries. + + You may place library facilities that are a work based on the +Library side by side in a single library together with other library +facilities that are not Applications and are not covered by this +License, and convey such a combined library under terms of your +choice, if you do both of the following: + + a) Accompany the combined library with a copy of the same work based + on the Library, uncombined with any other library facilities, + conveyed under the terms of this License. + + b) Give prominent notice with the combined library that part of it + is a work based on the Library, and explaining where to find the + accompanying uncombined form of the same work. + + 6. Revised Versions of the GNU Lesser General Public License. + + The Free Software Foundation may publish revised and/or new versions +of the GNU Lesser General Public License from time to time. Such new +versions will be similar in spirit to the present version, but may +differ in detail to address new problems or concerns. + + Each version is given a distinguishing version number. If the +Library as you received it specifies that a certain numbered version +of the GNU Lesser General Public License "or any later version" +applies to it, you have the option of following the terms and +conditions either of that published version or of any later version +published by the Free Software Foundation. If the Library as you +received it does not specify a version number of the GNU Lesser +General Public License, you may choose any version of the GNU Lesser +General Public License ever published by the Free Software Foundation. + + If the Library as you received it specifies that a proxy can decide +whether future versions of the GNU Lesser General Public License shall +apply, that proxy's public statement of acceptance of any version is +permanent authorization for you to choose that version for the +Library. diff --git a/project/jni/ffmpeg/CREDITS b/project/jni/ffmpeg/CREDITS new file mode 100644 index 000000000..1d0666b6d --- /dev/null +++ b/project/jni/ffmpeg/CREDITS @@ -0,0 +1,55 @@ +This file contains the names of some of the people who have contributed to +FFmpeg. The names are sorted alphabetically by last name. As this file is +currently quite outdated and git serves as a much better tool for determining +authorship, it remains here for historical reasons only. + +DĂ©nes Balatoni +Michel Bardiaux +Fabrice Bellard +Patrice Bensoussan +Alex Beregszaszi +BERO +Thilo Borgmann +Mario Brito +Ronald Bultje +Alex Converse +Maarten Daniels +Reimar Doeffinger +Tim Ferguson +Brian Foley +Arpad Gereoffy +Philip Gladstone +Vladimir Gneushev +Roine Gustafsson +David Hammerton +Wolfgang Hesseler +Marc Hoffman +Falk Hueffner +AurĂ©lien Jacobs +Steven Johnson +Zdenek Kabelac +Robin Kay +Todd Kirby +Nick Kurshev +Benjamin Larsson +LoĂ¯c Le Loarer +Daniel Maas +Mike Melanson +Loren Merritt +Jeff Muizelaar +Michael Niedermayer +François Revol +Peter Ross +MĂ¥ns RullgĂ¥rd +Stefano Sabatini +Roman Shaposhnik +Oded Shimon +Dieter Shirley +Konstantin Shishkov +Juan J. Sierralta +Ewald Snel +Sascha Sommer +Leon van Stuivenberg +Roberto Togni +Lionel Ulmer +Reynaldo Verdejo diff --git a/project/jni/ffmpeg/Changelog b/project/jni/ffmpeg/Changelog new file mode 100644 index 000000000..aa36c4b93 --- /dev/null +++ b/project/jni/ffmpeg/Changelog @@ -0,0 +1,1058 @@ +Entries are sorted chronologically from oldest to youngest within each release, +releases are sorted from youngest to oldest. + +version : +- Fix a crash on windows platforms related to automatic stack alignment + in libavresample +- Fix memleaks in the ogg demuxer. Related to CVE-2012-2882 + + +version 1.1: + +- stream disposition information printing in ffprobe +- filter for loudness analysis following EBU R128 +- Opus encoder using libopus +- ffprobe -select_streams option +- Pinnacle TARGA CineWave YUV16 decoder +- TAK demuxer, decoder and parser +- DTS-HD demuxer +- remove -same_quant, it hasn't worked for years +- FFM2 support +- X-Face image encoder and decoder +- 24-bit FLAC encoding +- multi-channel ALAC encoding up to 7.1 +- metadata (INFO tag) support in WAV muxer +- subtitles raw text decoder +- support for building DLLs using MSVC +- LVF demuxer +- ffescape tool +- metadata (info chunk) support in CAF muxer +- field filter ported from libmpcodecs +- AVR demuxer +- geq filter ported from libmpcodecs +- remove ffserver daemon mode +- AST muxer/demuxer +- new expansion syntax for drawtext +- BRender PIX image decoder +- ffprobe -show_entries option +- ffprobe -sections option +- ADPCM IMA Dialogic decoder +- BRSTM demuxer +- animated GIF decoder and demuxer +- PVF demuxer +- subtitles filter +- IRCAM muxer/demuxer +- Paris Audio File demuxer +- Virtual concatenation demuxer +- VobSub demuxer +- JSON captions for TED talks decoding support +- SOX Resampler support in libswresample +- aselect filter +- SGI RLE 8-bit decoder +- Silicon Graphics Motion Video Compressor 1 & 2 decoder +- Silicon Graphics Movie demuxer +- apad filter +- Resolution & pixel format change support with multithreading for H.264 +- documentation split into per-component manuals +- pp (postproc) filter ported from MPlayer +- NIST Sphere demuxer +- MPL2, VPlayer, MPlayer, AQTitle, PJS and SubViewer v1 subtitles demuxers and decoders +- Sony Wave64 muxer +- adobe and limelight publisher authentication in RTMP +- data: URI scheme +- support building on the Plan 9 operating system +- kerndeint filter ported from MPlayer +- histeq filter ported from VirtualDub +- Megalux Frame demuxer +- 012v decoder +- Improved AVC Intra decoding support + + +version 1.0: + +- INI and flat output in ffprobe +- Scene detection in libavfilter +- Indeo Audio decoder +- channelsplit audio filter +- setnsamples audio filter +- atempo filter +- ffprobe -show_data option +- RTMPT protocol support +- iLBC encoding/decoding via libilbc +- Microsoft Screen 1 decoder +- join audio filter +- audio channel mapping filter +- Microsoft ATC Screen decoder +- RTSP listen mode +- TechSmith Screen Codec 2 decoder +- AAC encoding via libfdk-aac +- Microsoft Expression Encoder Screen decoder +- RTMPS protocol support +- RTMPTS protocol support +- RTMPE protocol support +- RTMPTE protocol support +- showwaves and showspectrum filter +- LucasArts SMUSH playback support +- SAMI, RealText and SubViewer demuxers and decoders +- Heart Of Darkness PAF playback support +- iec61883 device +- asettb filter +- new option: -progress +- 3GPP Timed Text encoder/decoder +- GeoTIFF decoder support +- ffmpeg -(no)stdin option +- Opus decoder using libopus +- caca output device using libcaca +- alphaextract and alphamerge filters +- concat filter +- flite filter +- Canopus Lossless Codec decoder +- bitmap subtitles in filters (experimental and temporary) +- MP2 encoding via TwoLAME +- bmp parser +- smptebars source +- asetpts filter +- hue filter +- ICO muxer +- SubRip encoder and decoder without embedded timing +- edge detection filter +- framestep filter +- ffmpeg -shortest option is now per-output file + -pass and -passlogfile are now per-output stream +- volume measurement filter +- Ut Video encoder +- Microsoft Screen 2 decoder +- smartblur filter ported from MPlayer +- CPiA decoder +- decimate filter ported from MPlayer +- RTP depacketization of JPEG +- Smooth Streaming live segmenter muxer +- F4V muxer +- sendcmd and asendcmd filters +- WebVTT demuxer and decoder (simple tags supported) +- RTP packetization of JPEG +- faststart option in the MOV/MP4 muxer +- support for building with MSVC + + +version 0.11: + +- Fixes: CVE-2012-2772, CVE-2012-2774, CVE-2012-2775, CVE-2012-2776, CVE-2012-2777, + CVE-2012-2779, CVE-2012-2782, CVE-2012-2783, CVE-2012-2784, CVE-2012-2785, + CVE-2012-2786, CVE-2012-2787, CVE-2012-2788, CVE-2012-2789, CVE-2012-2790, + CVE-2012-2791, CVE-2012-2792, CVE-2012-2793, CVE-2012-2794, CVE-2012-2795, + CVE-2012-2796, CVE-2012-2797, CVE-2012-2798, CVE-2012-2799, CVE-2012-2800, + CVE-2012-2801, CVE-2012-2802, CVE-2012-2803, CVE-2012-2804, +- v408 Quicktime and Microsoft AYUV Uncompressed 4:4:4:4 encoder and decoder +- setfield filter +- CDXL demuxer and decoder +- Apple ProRes encoder +- ffprobe -count_packets and -count_frames options +- Sun Rasterfile Encoder +- ID3v2 attached pictures reading and writing +- WMA Lossless decoder +- bluray protocol +- blackdetect filter +- libutvideo encoder wrapper (--enable-libutvideo) +- swapuv filter +- bbox filter +- XBM encoder and decoder +- RealAudio Lossless decoder +- ZeroCodec decoder +- tile video filter +- Metal Gear Solid: The Twin Snakes demuxer +- OpenEXR image decoder +- removelogo filter +- drop support for ffmpeg without libavfilter +- drawtext video filter: fontconfig support +- ffmpeg -benchmark_all option +- super2xsai filter ported from libmpcodecs +- add libavresample audio conversion library for compatibility +- MicroDVD decoder +- Avid Meridien (AVUI) encoder and decoder +- accept + prefix to -pix_fmt option to disable automatic conversions. +- complete audio filtering in libavfilter and ffmpeg +- add fps filter +- vorbis parser +- png parser +- audio mix filter +- ffv1: support (draft) version 1.3 + + +version 0.10: + +- Fixes: CVE-2011-3929, CVE-2011-3934, CVE-2011-3935, CVE-2011-3936, + CVE-2011-3937, CVE-2011-3940, CVE-2011-3941, CVE-2011-3944, + CVE-2011-3945, CVE-2011-3946, CVE-2011-3947, CVE-2011-3949, + CVE-2011-3950, CVE-2011-3951, CVE-2011-3952 +- v410 Quicktime Uncompressed 4:4:4 10-bit encoder and decoder +- SBaGen (SBG) binaural beats script demuxer +- OpenMG Audio muxer +- Timecode extraction in DV and MOV +- thumbnail video filter +- XML output in ffprobe +- asplit audio filter +- tinterlace video filter +- astreamsync audio filter +- amerge audio filter +- ISMV (Smooth Streaming) muxer +- GSM audio parser +- SMJPEG muxer +- XWD encoder and decoder +- Automatic thread count based on detection number of (available) CPU cores +- y41p Brooktree Uncompressed 4:1:1 12-bit encoder and decoder +- ffprobe -show_error option +- Avid 1:1 10-bit RGB Packer codec +- v308 Quicktime Uncompressed 4:4:4 encoder and decoder +- yuv4 libquicktime packed 4:2:0 encoder and decoder +- ffprobe -show_frames option +- silencedetect audio filter +- ffprobe -show_program_version, -show_library_versions, -show_versions options +- rv34: frame-level multi-threading +- optimized iMDCT transform on x86 using SSE for for mpegaudiodec +- Improved PGS subtitle decoder +- dumpgraph option to lavfi device +- r210 and r10k encoders +- ffwavesynth decoder +- aviocat tool +- ffeval tool + + +version 0.9: + +- openal input device added +- boxblur filter added +- BWF muxer +- Flash Screen Video 2 decoder +- lavfi input device added +- added avconv, which is almost the same for now, except +for a few incompatible changes in the options, which will hopefully make them +easier to use. The changes are: + * The options placement is now strictly enforced! While in theory the + options for ffmpeg should be given in [input options] -i INPUT [output + options] OUTPUT order, in practice it was possible to give output options + before the -i and it mostly worked. Except when it didn't - the behavior was + a bit inconsistent. In avconv, it is not possible to mix input and output + options. All non-global options are reset after an input or output filename. + * All per-file options are now truly per-file - they apply only to the next + input or output file and specifying different values for different files + will now work properly (notably -ss and -t options). + * All per-stream options are now truly per-stream - it is possible to + specify which stream(s) should a given option apply to. See the Stream + specifiers section in the avconv manual for details. + * In ffmpeg some options (like -newvideo/-newaudio/...) are irregular in the + sense that they're specified after the output filename instead of before, + like all other options. In avconv this irregularity is removed, all options + apply to the next input or output file. + * -newvideo/-newaudio/-newsubtitle options were removed. Not only were they + irregular and highly confusing, they were also redundant. In avconv the -map + option will create new streams in the output file and map input streams to + them. E.g. avconv -i INPUT -map 0 OUTPUT will create an output stream for + each stream in the first input file. + * The -map option now has slightly different and more powerful syntax: + + Colons (':') are used to separate file index/stream type/stream index + instead of dots. Comma (',') is used to separate the sync stream instead + of colon.. This is done for consistency with other options. + + It's possible to specify stream type. E.g. -map 0:a:2 creates an + output stream from the third input audio stream. + + Omitting the stream index now maps all the streams of the given type, + not just the first. E.g. -map 0:s creates output streams for all the + subtitle streams in the first input file. + + Since -map can now match multiple streams, negative mappings were + introduced. Negative mappings disable some streams from an already + defined map. E.g. '-map 0 -map -0:a:1' means 'create output streams for + all the stream in the first input file, except for the second audio + stream'. + * There is a new option -c (or -codec) for choosing the decoder/encoder to + use, which allows to precisely specify target stream(s) consistently with + other options. E.g. -c:v lib264 sets the codec for all video streams, -c:a:0 + libvorbis sets the codec for the first audio stream and -c copy copies all + the streams without reencoding. Old -vcodec/-acodec/-scodec options are now + aliases to -c:v/a/s + * It is now possible to precisely specify which stream should an AVOption + apply to. E.g. -b:v:0 2M sets the bitrate for the first video stream, while + -b:a 128k sets the bitrate for all audio streams. Note that the old -ab 128k + syntax is deprecated and will stop working soon. + * -map_chapters now takes only an input file index and applies to the next + output file. This is consistent with how all the other options work. + * -map_metadata now takes only an input metadata specifier and applies to + the next output file. Output metadata specifier is now part of the option + name, similarly to the AVOptions/map/codec feature above. + * -metadata can now be used to set metadata on streams and chapters, e.g. + -metadata:s:1 language=eng sets the language of the first stream to 'eng'. + This made -vlang/-alang/-slang options redundant, so they were removed. + * -qscale option now uses stream specifiers and applies to all streams, not + just video. I.e. plain -qscale number would now apply to all streams. To get + the old behavior, use -qscale:v. Also there is now a shortcut -q for -qscale + and -aq is now an alias for -q:a. + * -vbsf/-absf/-sbsf options were removed and replaced by a -bsf option which + uses stream specifiers. Use -bsf:v/a/s instead of the old options. + * -itsscale option now uses stream specifiers, so its argument is only the + scale parameter. + * -intra option was removed, use -g 0 for the same effect. + * -psnr option was removed, use -flags +psnr for the same effect. + * -vf option is now an alias to the new -filter option, which uses stream specifiers. + * -vframes/-aframes/-dframes options are now aliases to the new -frames option. + * -vtag/-atag/-stag options are now aliases to the new -tag option. +- XMV demuxer +- LOAS demuxer +- ashowinfo filter added +- Windows Media Image decoder +- amovie source added +- LATM muxer/demuxer +- Speex encoder via libspeex +- JSON output in ffprobe +- WTV muxer +- Optional C++ Support (needed for libstagefright) +- H.264 Decoding on Android via Stagefright +- Prores decoder +- BIN/XBIN/ADF/IDF text file decoder +- aconvert audio filter added +- audio support to lavfi input device added +- libcdio-paranoia input device for audio CD grabbing +- Apple ProRes decoder +- CELT in Ogg demuxing +- G.723.1 demuxer and decoder +- libmodplug support (--enable-libmodplug) +- VC-1 interlaced decoding +- libutvideo wrapper (--enable-libutvideo) +- aevalsrc audio source added +- Ut Video decoder +- Speex encoding via libspeex +- 4:2:2 H.264 decoding support +- 4:2:2 and 4:4:4 H.264 encoding with libx264 +- Pulseaudio input device +- Prores encoder +- Video Decoder Acceleration (VDA) HWAccel module. +- replacement Indeo 3 decoder +- new ffmpeg option: -map_channel +- volume audio filter added +- earwax audio filter added +- libv4l2 support (--enable-libv4l2) +- TLS/SSL and HTTPS protocol support +- AVOptions API rewritten and documented +- most of CODEC_FLAG2_*, some CODEC_FLAG_* and many codec-specific fields in + AVCodecContext deprecated. Codec private options should be used instead. +- Properly working defaults in libx264 wrapper, support for native presets. +- Encrypted OMA files support +- Discworld II BMV decoding support +- VBLE Decoder +- OS X Video Decoder Acceleration (VDA) support +- compact and csv output in ffprobe +- pan audio filter +- IFF Amiga Continuous Bitmap (ACBM) decoder +- ass filter +- CRI ADX audio format muxer and demuxer +- Playstation Portable PMP format demuxer +- Microsoft Windows ICO demuxer +- life source +- PCM format support in OMA demuxer +- CLJR encoder +- new option: -report +- Dxtory capture format decoder +- cellauto source +- Simple segmenting muxer +- Indeo 4 decoder +- SMJPEG demuxer + + +version 0.8: + +- many many things we forgot because we rather write code than changelogs +- WebM support in Matroska de/muxer +- low overhead Ogg muxing +- MMS-TCP support +- VP8 de/encoding via libvpx +- Demuxer for On2's IVF format +- Pictor/PC Paint decoder +- HE-AAC v2 decoder +- HE-AAC v2 encoding with libaacplus +- libfaad2 wrapper removed +- DTS-ES extension (XCh) decoding support +- native VP8 decoder +- RTSP tunneling over HTTP +- RTP depacketization of SVQ3 +- -strict inofficial replaced by -strict unofficial +- ffplay -exitonkeydown and -exitonmousedown options added +- native GSM / GSM MS decoder +- RTP depacketization of QDM2 +- ANSI/ASCII art playback system +- Lego Mindstorms RSO de/muxer +- libavcore added (and subsequently removed) +- SubRip subtitle file muxer and demuxer +- Chinese AVS encoding via libxavs +- ffprobe -show_packets option added +- RTP packetization of Theora and Vorbis +- RTP depacketization of MP4A-LATM +- RTP packetization and depacketization of VP8 +- hflip filter +- Apple HTTP Live Streaming demuxer +- a64 codec +- MMS-HTTP support +- G.722 ADPCM audio encoder/decoder +- R10k video decoder +- ocv_smooth filter +- frei0r wrapper filter +- change crop filter syntax to width:height:x:y +- make the crop filter accept parametric expressions +- make ffprobe accept AVFormatContext options +- yadif filter +- blackframe filter +- Demuxer for Leitch/Harris' VR native stream format (LXF) +- RTP depacketization of the X-QT QuickTime format +- SAP (Session Announcement Protocol, RFC 2974) muxer and demuxer +- cropdetect filter +- ffmpeg -crop* options removed +- transpose filter added +- ffmpeg -force_key_frames option added +- demuxer for receiving raw rtp:// URLs without an SDP description +- single stream LATM/LOAS decoder +- setpts filter added +- Win64 support for optimized x86 assembly functions +- MJPEG/AVI1 to JPEG/JFIF bitstream filter +- ASS subtitle encoder and decoder +- IEC 61937 encapsulation for E-AC-3, TrueHD, DTS-HD (for HDMI passthrough) +- overlay filter added +- rename aspect filter to setdar, and pixelaspect to setsar +- IEC 61937 demuxer +- Mobotix .mxg demuxer +- frei0r source added +- hqdn3d filter added +- RTP depacketization of QCELP +- FLAC parser added +- gradfun filter added +- AMR-WB decoder +- replace the ocv_smooth filter with a more generic ocv filter +- Windows Televison (WTV) demuxer +- FFmpeg metadata format muxer and demuxer +- SubRip (srt) subtitle encoder and decoder +- floating-point AC-3 encoder added +- Lagarith decoder +- ffmpeg -copytb option added +- IVF muxer added +- Wing Commander IV movies decoder added +- movie source added +- Bink version 'b' audio and video decoder +- Bitmap Brothers JV playback system +- Apple HTTP Live Streaming protocol handler +- sndio support for playback and record +- Linux framebuffer input device added +- Chronomaster DFA decoder +- DPX image encoder +- MicroDVD subtitle file muxer and demuxer +- Playstation Portable PMP format demuxer +- fieldorder video filter added +- AAC encoding via libvo-aacenc +- AMR-WB encoding via libvo-amrwbenc +- xWMA demuxer +- Mobotix MxPEG decoder +- VP8 frame-multithreading +- NEON optimizations for VP8 +- Lots of deprecated API cruft removed +- fft and imdct optimizations for AVX (Sandy Bridge) processors +- showinfo filter added +- SMPTE 302M AES3 audio decoder +- Apple Core Audio Format muxer +- 9bit and 10bit per sample support in the H.264 decoder +- 9bit and 10bit FFV1 encoding / decoding +- split filter added +- select filter added +- sdl output device added +- libmpcodecs video filter support (3 times as many filters than before) +- mpeg2 aspect ratio dection fixed +- libxvid aspect pickiness fixed +- Frame multithreaded decoding +- E-AC-3 audio encoder +- ac3enc: add channel coupling support +- floating-point sample format support to the ac3, eac3, dca, aac, and vorbis decoders. +- H264/MPEG frame-level multi-threading +- All av_metadata_* functions renamed to av_dict_* and moved to libavutil +- 4:4:4 H.264 decoding support +- 10-bit H.264 optimizations for x86 +- lut, lutrgb, and lutyuv filters added +- buffersink libavfilter sink added +- Bump libswscale for recently reported ABI break +- New J2K encoder (via OpenJPEG) + + +version 0.7: + +- all the changes for 0.8, but keeping API/ABI compatibility with the 0.6 release + + +version 0.6: + +- PB-frame decoding for H.263 +- deprecated vhook subsystem removed +- deprecated old scaler removed +- VQF demuxer +- Alpha channel scaler +- PCX encoder +- RTP packetization of H.263 +- RTP packetization of AMR +- RTP depacketization of Vorbis +- CorePNG decoding support +- Cook multichannel decoding support +- introduced avlanguage helpers in libavformat +- 8088flex TMV demuxer and decoder +- per-stream language-tags extraction in asfdec +- V210 decoder and encoder +- remaining GPL parts in AC-3 decoder converted to LGPL +- QCP demuxer +- SoX native format muxer and demuxer +- AMR-NB decoding/encoding, AMR-WB decoding via OpenCORE libraries +- DPX image decoder +- Electronic Arts Madcow decoder +- DivX (XSUB) subtitle encoder +- nonfree libamr support for AMR-NB/WB decoding/encoding removed +- experimental AAC encoder +- RTP depacketization of ASF and RTSP from WMS servers +- RTMP support in libavformat +- noX handling for OPT_BOOL X options +- Wave64 demuxer +- IEC-61937 compatible Muxer +- TwinVQ decoder +- Bluray (PGS) subtitle decoder +- LPCM support in MPEG-TS (HDMV RID as found on Blu-ray disks) +- WMA Pro decoder +- Core Audio Format demuxer +- Atrac1 decoder +- MD STUDIO audio demuxer +- RF64 support in WAV demuxer +- MPEG-4 Audio Lossless Coding (ALS) decoder +- -formats option split into -formats, -codecs, -bsfs, and -protocols +- IV8 demuxer +- CDG demuxer and decoder +- R210 decoder +- Auravision Aura 1 and 2 decoders +- Deluxe Paint Animation playback system +- SIPR decoder +- Adobe Filmstrip muxer and demuxer +- RTP depacketization of H.263 +- Bink demuxer and audio/video decoders +- enable symbol versioning by default for linkers that support it +- IFF PBM/ILBM bitmap decoder +- concat protocol +- Indeo 5 decoder +- RTP depacketization of AMR +- WMA Voice decoder +- ffprobe tool +- AMR-NB decoder +- RTSP muxer +- HE-AAC v1 decoder +- Kega Game Video (KGV1) decoder +- VorbisComment writing for FLAC, Ogg FLAC and Ogg Speex files +- RTP depacketization of Theora +- HTTP Digest authentication +- RTMP/RTMPT/RTMPS/RTMPE/RTMPTE protocol support via librtmp +- Psygnosis YOP demuxer and video decoder +- spectral extension support in the E-AC-3 decoder +- unsharp video filter +- RTP hinting in the mov/3gp/mp4 muxer +- Dirac in Ogg demuxing +- seek to keyframes in Ogg +- 4:2:2 and 4:4:4 Theora decoding +- 35% faster VP3/Theora decoding +- faster AAC decoding +- faster H.264 decoding +- RealAudio 1.0 (14.4K) encoder + + +version 0.5: + +- DV50 AKA DVCPRO50 encoder, decoder, muxer and demuxer +- TechSmith Camtasia (TSCC) video decoder +- IBM Ultimotion (ULTI) video decoder +- Sierra Online audio file demuxer and decoder +- Apple QuickDraw (qdrw) video decoder +- Creative ADPCM audio decoder (16 bits as well as 8 bits schemes) +- Electronic Arts Multimedia (WVE/UV2/etc.) file demuxer +- Miro VideoXL (VIXL) video decoder +- H.261 video encoder +- QPEG video decoder +- Nullsoft Video (NSV) file demuxer +- Shorten audio decoder +- LOCO video decoder +- Apple Lossless Audio Codec (ALAC) decoder +- Winnov WNV1 video decoder +- Autodesk Animator Studio Codec (AASC) decoder +- Indeo 2 video decoder +- Fraps FPS1 video decoder +- Snow video encoder/decoder +- Sonic audio encoder/decoder +- Vorbis audio decoder +- Macromedia ADPCM decoder +- Duck TrueMotion 2 video decoder +- support for decoding FLX and DTA extensions in FLIC files +- H.264 custom quantization matrices support +- ffserver fixed, it should now be usable again +- QDM2 audio decoder +- Real Cooker audio decoder +- TrueSpeech audio decoder +- WMA2 audio decoder fixed, now all files should play correctly +- RealAudio 14.4 and 28.8 decoders fixed +- JPEG-LS decoder +- build system improvements +- tabs and trailing whitespace removed from the codebase +- CamStudio video decoder +- AIFF/AIFF-C audio format, encoding and decoding +- ADTS AAC file reading and writing +- Creative VOC file reading and writing +- American Laser Games multimedia (*.mm) playback system +- Zip Motion Blocks Video decoder +- improved Theora/VP3 decoder +- True Audio (TTA) decoder +- AVS demuxer and video decoder +- JPEG-LS encoder +- Smacker demuxer and decoder +- NuppelVideo/MythTV demuxer and RTjpeg decoder +- KMVC decoder +- MPEG-2 intra VLC support +- MPEG-2 4:2:2 encoder +- Flash Screen Video decoder +- GXF demuxer +- Chinese AVS decoder +- GXF muxer +- MXF demuxer +- VC-1/WMV3/WMV9 video decoder +- MacIntel support +- AVISynth support +- VMware video decoder +- VP5 video decoder +- VP6 video decoder +- WavPack lossless audio decoder +- Targa (.TGA) picture decoder +- Vorbis audio encoder +- Delphine Software .cin demuxer/audio and video decoder +- Tiertex .seq demuxer/video decoder +- MTV demuxer +- TIFF picture encoder and decoder +- GIF picture decoder +- Intel Music Coder decoder +- Zip Motion Blocks Video encoder +- Musepack decoder +- Flash Screen Video encoder +- Theora encoding via libtheora +- BMP encoder +- WMA encoder +- GSM-MS encoder and decoder +- DCA decoder +- DXA demuxer and decoder +- DNxHD decoder +- Gamecube movie (.THP) playback system +- Blackfin optimizations +- Interplay C93 demuxer and video decoder +- Bethsoft VID demuxer and video decoder +- CRYO APC demuxer +- Atrac3 decoder +- V.Flash PTX decoder +- RoQ muxer, RoQ audio encoder +- Renderware TXD demuxer and decoder +- extern C declarations for C++ removed from headers +- sws_flags command line option +- codebook generator +- RoQ video encoder +- QTRLE encoder +- OS/2 support removed and restored again +- AC-3 decoder +- NUT muxer +- additional SPARC (VIS) optimizations +- Matroska muxer +- slice-based parallel H.264 decoding +- Monkey's Audio demuxer and decoder +- AMV audio and video decoder +- DNxHD encoder +- H.264 PAFF decoding +- Nellymoser ASAO decoder +- Beam Software SIFF demuxer and decoder +- libvorbis Vorbis decoding removed in favor of native decoder +- IntraX8 (J-Frame) subdecoder for WMV2 and VC-1 +- Ogg (Theora, Vorbis and FLAC) muxer +- The "device" muxers and demuxers are now in a new libavdevice library +- PC Paintbrush PCX decoder +- Sun Rasterfile decoder +- TechnoTrend PVA demuxer +- Linux Media Labs MPEG-4 (LMLM4) demuxer +- AVM2 (Flash 9) SWF muxer +- QT variant of IMA ADPCM encoder +- VFW grabber +- iPod/iPhone compatible mp4 muxer +- Mimic decoder +- MSN TCP Webcam stream demuxer +- RL2 demuxer / decoder +- IFF demuxer +- 8SVX audio decoder +- non-recursive Makefiles +- BFI demuxer +- MAXIS EA XA (.xa) demuxer / decoder +- BFI video decoder +- OMA demuxer +- MLP/TrueHD decoder +- Electronic Arts CMV decoder +- Motion Pixels Video decoder +- Motion Pixels MVI demuxer +- removed animated GIF decoder/demuxer +- D-Cinema audio muxer +- Electronic Arts TGV decoder +- Apple Lossless Audio Codec (ALAC) encoder +- AAC decoder +- floating point PCM encoder/decoder +- MXF muxer +- DV100 AKA DVCPRO HD decoder and demuxer +- E-AC-3 support added to AC-3 decoder +- Nellymoser ASAO encoder +- ASS and SSA demuxer and muxer +- liba52 wrapper removed +- SVQ3 watermark decoding support +- Speex decoding via libspeex +- Electronic Arts TGQ decoder +- RV40 decoder +- QCELP / PureVoice decoder +- RV30 decoder +- hybrid WavPack support +- R3D REDCODE demuxer +- ALSA support for playback and record +- Electronic Arts TQI decoder +- OpenJPEG based JPEG 2000 decoder +- NC (NC4600) camera file demuxer +- Gopher client support +- MXF D-10 muxer +- generic metadata API +- flash ScreenVideo2 encoder + + +version 0.4.9-pre1: + +- DV encoder, DV muxer +- Microsoft RLE video decoder +- Microsoft Video-1 decoder +- Apple Animation (RLE) decoder +- Apple Graphics (SMC) decoder +- Apple Video (RPZA) decoder +- Cinepak decoder +- Sega FILM (CPK) file demuxer +- Westwood multimedia support (VQA & AUD files) +- Id Quake II CIN playback support +- 8BPS video decoder +- FLIC playback support +- RealVideo 2.0 (RV20) decoder +- Duck TrueMotion v1 (DUCK) video decoder +- Sierra VMD demuxer and video decoder +- MSZH and ZLIB decoder support +- SVQ1 video encoder +- AMR-WB support +- PPC optimizations +- rate distortion optimal cbp support +- rate distorted optimal ac prediction for MPEG-4 +- rate distorted optimal lambda->qp support +- AAC encoding with libfaac +- Sunplus JPEG codec (SP5X) support +- use Lagrange multipler instead of QP for ratecontrol +- Theora/VP3 decoding support +- XA and ADX ADPCM codecs +- export MPEG-2 active display area / pan scan +- Add support for configuring with IBM XLC +- floating point AAN DCT +- initial support for zygo video (not complete) +- RGB ffv1 support +- new audio/video parser API +- av_log() system +- av_read_frame() and av_seek_frame() support +- missing last frame fixes +- seek by mouse in ffplay +- noise reduction of DCT coefficients +- H.263 OBMC & 4MV support +- H.263 alternative inter vlc support +- H.263 loop filter +- H.263 slice structured mode +- interlaced DCT support for MPEG-2 encoding +- stuffing to stay above min_bitrate +- MB type & QP visualization +- frame stepping for ffplay +- interlaced motion estimation +- alternate scantable support +- SVCD scan offset support +- closed GOP support +- SSE2 FDCT +- quantizer noise shaping +- G.726 ADPCM audio codec +- MS ADPCM encoding +- multithreaded/SMP motion estimation +- multithreaded/SMP encoding for MPEG-1/MPEG-2/MPEG-4/H.263 +- multithreaded/SMP decoding for MPEG-2 +- FLAC decoder +- Metrowerks CodeWarrior suppport +- H.263+ custom pcf support +- nicer output for 'ffmpeg -formats' +- Matroska demuxer +- SGI image format, encoding and decoding +- H.264 loop filter support +- H.264 CABAC support +- nicer looking arrows for the motion vector visualization +- improved VCD support +- audio timestamp drift compensation +- MPEG-2 YUV 422/444 support +- polyphase kaiser windowed sinc and blackman nuttall windowed sinc audio resample +- better image scaling +- H.261 support +- correctly interleave packets during encoding +- VIS optimized motion compensation +- intra_dc_precision>0 encoding support +- support reuse of motion vectors/MB types/field select values of the source video +- more accurate deblock filter +- padding support +- many optimizations and bugfixes +- FunCom ISS audio file demuxer and according ADPCM decoding + + +version 0.4.8: + +- MPEG-2 video encoding (Michael) +- Id RoQ playback subsystem (Mike Melanson and Tim Ferguson) +- Wing Commander III Movie (.mve) file playback subsystem (Mike Melanson + and Mario Brito) +- Xan DPCM audio decoder (Mario Brito) +- Interplay MVE playback subsystem (Mike Melanson) +- Duck DK3 and DK4 ADPCM audio decoders (Mike Melanson) + + +version 0.4.7: + +- RealAudio 1.0 (14_4) and 2.0 (28_8) native decoders. Author unknown, code from mplayerhq + (originally from public domain player for Amiga at http://www.honeypot.net/audio) +- current version now also compiles with older GCC (Fabrice) +- 4X multimedia playback system including 4xm file demuxer (Mike + Melanson), and 4X video and audio codecs (Michael) +- Creative YUV (CYUV) decoder (Mike Melanson) +- FFV1 codec (our very simple lossless intra only codec, compresses much better + than HuffYUV) (Michael) +- ASV1 (Asus), H.264, Intel indeo3 codecs have been added (various) +- tiny PNG encoder and decoder, tiny GIF decoder, PAM decoder (PPM with + alpha support), JPEG YUV colorspace support. (Fabrice Bellard) +- ffplay has been replaced with a newer version which uses SDL (optionally) + for multiplatform support (Fabrice) +- Sorenson Version 3 codec (SVQ3) support has been added (decoding only) - donated + by anonymous +- AMR format has been added (Johannes Carlsson) +- 3GP support has been added (Johannes Carlsson) +- VP3 codec has been added (Mike Melanson) +- more MPEG-1/2 fixes +- better multiplatform support, MS Visual Studio fixes (various) +- AltiVec optimizations (Magnus Damn and others) +- SH4 processor support has been added (BERO) +- new public interfaces (avcodec_get_pix_fmt) (Roman Shaposhnick) +- VOB streaming support (Brian Foley) +- better MP3 autodetection (Andriy Rysin) +- qpel encoding (Michael) +- 4mv+b frames encoding finally fixed (Michael) +- chroma ME (Michael) +- 5 comparison functions for ME (Michael) +- B-frame encoding speedup (Michael) +- WMV2 codec (unfinished - Michael) +- user specified diamond size for EPZS (Michael) +- Playstation STR playback subsystem, still experimental (Mike and Michael) +- ASV2 codec (Michael) +- CLJR decoder (Alex) + +.. And lots more new enhancements and fixes. + + +version 0.4.6: + +- completely new integer only MPEG audio layer 1/2/3 decoder rewritten + from scratch +- Recoded DCT and motion vector search with gcc (no longer depends on nasm) +- fix quantization bug in AC3 encoder +- added PCM codecs and format. Corrected WAV/AVI/ASF PCM issues +- added prototype ffplay program +- added GOB header parsing on H.263/H.263+ decoder (Juanjo) +- bug fix on MCBPC tables of H.263 (Juanjo) +- bug fix on DC coefficients of H.263 (Juanjo) +- added Advanced Prediction Mode on H.263/H.263+ decoder (Juanjo) +- now we can decode H.263 streams found in QuickTime files (Juanjo) +- now we can decode H.263 streams found in VIVO v1 files(Juanjo) +- preliminary RTP "friendly" mode for H.263/H.263+ coding. (Juanjo) +- added GOB header for H.263/H.263+ coding on RTP mode (Juanjo) +- now H.263 picture size is returned on the first decoded frame (Juanjo) +- added first regression tests +- added MPEG-2 TS demuxer +- new demux API for libav +- more accurate and faster IDCT (Michael) +- faster and entropy-controlled motion search (Michael) +- two pass video encoding (Michael) +- new video rate control (Michael) +- added MSMPEG4V1, MSMPEGV2 and WMV1 support (Michael) +- great performance improvement of video encoders and decoders (Michael) +- new and faster bit readers and vlc parsers (Michael) +- high quality encoding mode: tries all macroblock/VLC types (Michael) +- added DV video decoder +- preliminary RTP/RTSP support in ffserver and libavformat +- H.263+ AIC decoding/encoding support (Juanjo) +- VCD MPEG-PS mode (Juanjo) +- PSNR stuff (Juanjo) +- simple stats output (Juanjo) +- 16-bit and 15-bit RGB/BGR/GBR support (Bisqwit) + + +version 0.4.5: + +- some header fixes (Zdenek Kabelac ) +- many MMX optimizations (Nick Kurshev ) +- added configure system (actually a small shell script) +- added MPEG audio layer 1/2/3 decoding using LGPL'ed mpglib by + Michael Hipp (temporary solution - waiting for integer only + decoder) +- fixed VIDIOCSYNC interrupt +- added Intel H.263 decoding support ('I263' AVI fourCC) +- added Real Video 1.0 decoding (needs further testing) +- simplified image formats again. Added PGM format (=grey + pgm). Renamed old PGM to PGMYUV. +- fixed msmpeg4 slice issues (tell me if you still find problems) +- fixed OpenDivX bugs with newer versions (added VOL header decoding) +- added support for MPlayer interface +- added macroblock skip optimization +- added MJPEG decoder +- added mmx/mmxext IDCT from libmpeg2 +- added pgmyuvpipe, ppm, and ppm_pipe formats (original patch by Celer + ) +- added pixel format conversion layer (e.g. for MJPEG or PPM) +- added deinterlacing option +- MPEG-1/2 fixes +- MPEG-4 vol header fixes (Jonathan Marsden ) +- ARM optimizations (Lionel Ulmer ). +- Windows porting of file converter +- added MJPEG raw format (input/output) +- added JPEG image format support (input/output) + + +version 0.4.4: + +- fixed some std header definitions (Bjorn Lindgren + ). +- added MPEG demuxer (MPEG-1 and 2 compatible). +- added ASF demuxer +- added prototype RM demuxer +- added AC3 decoding (done with libac3 by Aaron Holtzman) +- added decoding codec parameter guessing (.e.g. for MPEG, because the + header does not include them) +- fixed header generation in MPEG-1, AVI and ASF muxer: wmplayer can now + play them (only tested video) +- fixed H.263 white bug +- fixed phase rounding in img resample filter +- add MMX code for polyphase img resample filter +- added CPU autodetection +- added generic title/author/copyright/comment string handling (ASF and RM + use them) +- added SWF demux to extract MP3 track (not usable yet because no MP3 + decoder) +- added fractional frame rate support +- codecs are no longer searched by read_header() (should fix ffserver + segfault) + + +version 0.4.3: + +- BGR24 patch (initial patch by Jeroen Vreeken ) +- fixed raw yuv output +- added motion rounding support in MPEG-4 +- fixed motion bug rounding in MSMPEG4 +- added B-frame handling in video core +- added full MPEG-1 decoding support +- added partial (frame only) MPEG-2 support +- changed the FOURCC code for H.263 to "U263" to be able to see the + +AVI/H.263 file with the UB Video H.263+ decoder. MPlayer works with + this +codec ;) (JuanJo). +- Halfpel motion estimation after MB type selection (JuanJo) +- added pgm and .Y.U.V output format +- suppressed 'img:' protocol. Simply use: /tmp/test%d.[pgm|Y] as input or + output. +- added pgmpipe I/O format (original patch from Martin Aumueller + , but changed completely since we use a format + instead of a protocol) + + +version 0.4.2: + +- added H.263/MPEG-4/MSMPEG4 decoding support. MPEG-4 decoding support + (for OpenDivX) is almost complete: 8x8 MVs and rounding are + missing. MSMPEG4 support is complete. +- added prototype MPEG-1 decoder. Only I- and P-frames handled yet (it + can decode ffmpeg MPEGs :-)). +- added libavcodec API documentation (see apiexample.c). +- fixed image polyphase bug (the bottom of some images could be + greenish) +- added support for non clipped motion vectors (decoding only) + and image sizes non-multiple of 16 +- added support for AC prediction (decoding only) +- added file overwrite confirmation (can be disabled with -y) +- added custom size picture to H.263 using H.263+ (Juanjo) + + +version 0.4.1: + +- added MSMPEG4 (aka DivX) compatible encoder. Changed default codec + of AVI and ASF to DIV3. +- added -me option to set motion estimation method + (default=log). suppressed redundant -hq option. +- added options -acodec and -vcodec to force a given codec (useful for + AVI for example) +- fixed -an option +- improved dct_quantize speed +- factorized some motion estimation code + + +version 0.4.0: + +- removing grab code from ffserver and moved it to ffmpeg. Added + multistream support to ffmpeg. +- added timeshifting support for live feeds (option ?date=xxx in the + URL) +- added high quality image resize code with polyphase filter (need + mmx/see optimization). Enable multiple image size support in ffserver. +- added multi live feed support in ffserver +- suppressed master feature from ffserver (it should be done with an + external program which opens the .ffm url and writes it to another + ffserver) +- added preliminary support for video stream parsing (WAV and AVI half + done). Added proper support for audio/video file conversion in + ffmpeg. +- added preliminary support for video file sending from ffserver +- redesigning I/O subsystem: now using URL based input and output + (see avio.h) +- added WAV format support +- added "tty user interface" to ffmpeg to stop grabbing gracefully +- added MMX/SSE optimizations to SAD (Sums of Absolutes Differences) + (Juan J. Sierralta P. a.k.a. "Juanjo" ) +- added MMX DCT from mpeg2_movie 1.5 (Juanjo) +- added new motion estimation algorithms, log and phods (Juanjo) +- changed directories: libav for format handling, libavcodec for + codecs + + +version 0.3.4: + +- added stereo in MPEG audio encoder + + +version 0.3.3: + +- added 'high quality' mode which use motion vectors. It can be used in + real time at low resolution. +- fixed rounding problems which caused quality problems at high + bitrates and large GOP size + + +version 0.3.2: small fixes + +- ASF fixes +- put_seek bug fix + + +version 0.3.1: added avi/divx support + +- added AVI support +- added MPEG-4 codec compatible with OpenDivX. It is based on the H.263 codec +- added sound for flash format (not tested) + + +version 0.3: initial public release diff --git a/project/jni/ffmpeg/INSTALL b/project/jni/ffmpeg/INSTALL new file mode 100644 index 000000000..954934630 --- /dev/null +++ b/project/jni/ffmpeg/INSTALL @@ -0,0 +1,15 @@ + +1) Type './configure' to create the configuration. A list of configure +options is printed by running 'configure --help'. + +'configure' can be launched from a directory different from the FFmpeg +sources to build the objects out of tree. To do this, use an absolute +path when launching 'configure', e.g. '/ffmpegdir/ffmpeg/configure'. + +2) Then type 'make' to build FFmpeg. GNU Make 3.81 or later is required. + +3) Type 'make install' to install all binaries and libraries you built. + +NOTICE + + - Non system dependencies (e.g. libx264, libvpx) are disabled by default. diff --git a/project/jni/ffmpeg/LICENSE b/project/jni/ffmpeg/LICENSE new file mode 100644 index 000000000..9665a2472 --- /dev/null +++ b/project/jni/ffmpeg/LICENSE @@ -0,0 +1,89 @@ +FFmpeg: + +Most files in FFmpeg are under the GNU Lesser General Public License version 2.1 +or later (LGPL v2.1+). Read the file COPYING.LGPLv2.1 for details. Some other +files have MIT/X11/BSD-style licenses. In combination the LGPL v2.1+ applies to +FFmpeg. + +Some optional parts of FFmpeg are licensed under the GNU General Public License +version 2 or later (GPL v2+). See the file COPYING.GPLv2 for details. None of +these parts are used by default, you have to explicitly pass --enable-gpl to +configure to activate them. In this case, FFmpeg's license changes to GPL v2+. + +Specifically, the GPL parts of FFmpeg are + +- libpostproc +- libmpcodecs +- optional x86 optimizations in the files + libavcodec/x86/idct_mmx.c +- libutvideo encoding/decoding wrappers in + libavcodec/libutvideo*.cpp +- the X11 grabber in libavdevice/x11grab.c +- the swresample test app in + libswresample/swresample-test.c +- the texi2pod.pl tool +- the following filters in libavfilter: + - f_ebur128.c + - vf_blackframe.c + - vf_boxblur.c + - vf_colormatrix.c + - vf_cropdetect.c + - vf_decimate.c + - vf_delogo.c + - vf_geq.c + - vf_histeq.c + - vf_hqdn3d.c + - vf_hue.c + - vf_kerndeint.c + - vf_mp.c + - vf_pp.c + - vf_smartblur.c + - vf_super2xsai.c + - vf_tinterlace.c + - vf_yadif.c + - vsrc_mptestsrc.c + +There are a handful of files under other licensing terms, namely: + +* The files libavcodec/jfdctfst.c, libavcodec/jfdctint_template.c and + libavcodec/jrevdct.c are taken from libjpeg, see the top of the files for + licensing details. Specifically note that you must credit the IJG in the + documentation accompanying your program if you only distribute executables. + You must also indicate any changes including additions and deletions to + those three files in the documentation. + +Should you, for whatever reason, prefer to use version 3 of the (L)GPL, then +the configure parameter --enable-version3 will activate this licensing option +for you. Read the file COPYING.LGPLv3 or, if you have enabled GPL parts, +COPYING.GPLv3 to learn the exact legal terms that apply in this case. + + +external libraries +================== + +FFmpeg can be combined with a number of external libraries, which sometimes +affect the licensing of binaries resulting from the combination. + +compatible libraries +-------------------- + +The libcdio, libx264, libxavs and libxvid libraries are under GPL. When +combining them with FFmpeg, FFmpeg needs to be licensed as GPL as well by +passing --enable-gpl to configure. + +The OpenCORE and VisualOn libraries are under the Apache License 2.0. That +license is incompatible with the LGPL v2.1 and the GPL v2, but not with +version 3 of those licenses. So to combine these libraries with FFmpeg, the +license version needs to be upgraded by passing --enable-version3 to configure. + +incompatible libraries +---------------------- + +The Fraunhofer AAC library, FAAC and aacplus are under licenses which +are incompatible with the GPLv2 and v3. We do not know for certain if their +licenses are compatible with the LGPL. +If you wish to enable these libraries, pass --enable-nonfree to configure. +But note that if you enable any of these libraries the resulting binary will +be under a complex license mix that is more restrictive than the LGPL and that +may result in additional obligations. It is possible that these +restrictions cause the resulting binary to be unredistributeable. diff --git a/project/jni/ffmpeg/MAINTAINERS b/project/jni/ffmpeg/MAINTAINERS new file mode 100644 index 000000000..3319359bd --- /dev/null +++ b/project/jni/ffmpeg/MAINTAINERS @@ -0,0 +1,483 @@ +FFmpeg maintainers +================== + +Below is a list of the people maintaining different parts of the +FFmpeg code. + +Please try to keep entries where you are the maintainer up to date! + +Names in () mean that the maintainer currently has no time to maintain the code. +A CC after the name means that the maintainer prefers to be CC-ed on patches +and related discussions. + + +Project Leader +============== + +Michael Niedermayer + final design decisions + + +Applications +============ + +ffmpeg: + ffmpeg.c Michael Niedermayer + +ffplay: + ffplay.c Marton Balint + +ffprobe: + ffprobe.c Stefano Sabatini + +ffserver: + ffserver.c, ffserver.h Baptiste Coudurier + +Commandline utility code: + cmdutils.c, cmdutils.h Michael Niedermayer + +QuickTime faststart: + tools/qt-faststart.c Baptiste Coudurier + + +Miscellaneous Areas +=================== + +documentation Mike Melanson +website Robert Swain, Lou Logan +build system (configure,Makefiles) Diego Biurrun, Mans Rullgard +project server ĂrpĂ¡d Gereöffy, Michael Niedermayer, Reimar Döffinger +mailinglists Michael Niedermayer, Baptiste Coudurier, Lou Logan +presets Robert Swain +metadata subsystem Aurelien Jacobs +release management Michael Niedermayer + + +libavutil +========= + +External Interfaces: + libavutil/avutil.h Michael Niedermayer +Internal Interfaces: + libavutil/common.h Michael Niedermayer + +Other: + intfloat* Michael Niedermayer + rational.c, rational.h Michael Niedermayer + mathematics.c, mathematics.h Michael Niedermayer + integer.c, integer.h Michael Niedermayer + bswap.h + + +libavcodec +========== + +Generic Parts: + External Interfaces: + avcodec.h Michael Niedermayer + utility code: + utils.c Michael Niedermayer + mem.c Michael Niedermayer + opt.c, opt.h Michael Niedermayer + arithmetic expression evaluator: + eval.c Michael Niedermayer + audio and video frame extraction: + parser.c Michael Niedermayer + bitstream reading: + bitstream.c, bitstream.h Michael Niedermayer + CABAC: + cabac.h, cabac.c Michael Niedermayer + codec names: + codec_names.sh Nicolas George + DSP utilities: + dsputils.c, dsputils.h Michael Niedermayer + entropy coding: + rangecoder.c, rangecoder.h Michael Niedermayer + lzw.* Michael Niedermayer + floating point AAN DCT: + faandct.c, faandct.h Michael Niedermayer + Golomb coding: + golomb.c, golomb.h Michael Niedermayer + LPC: + lpc.c, lpc.h Justin Ruggles + motion estimation: + motion* Michael Niedermayer + rate control: + ratecontrol.c Michael Niedermayer + libxvid_rc.c Michael Niedermayer + simple IDCT: + simple_idct.c, simple_idct.h Michael Niedermayer + postprocessing: + libpostproc/* Michael Niedermayer + table generation: + tableprint.c, tableprint.h Reimar Doeffinger + +Codecs: + 4xm.c Michael Niedermayer + 8bps.c Roberto Togni + 8svx.c Jaikrishnan Menon + aasc.c Kostya Shishkov + ac3* Justin Ruggles + alacenc.c Jaikrishnan Menon + alsdec.c Thilo Borgmann + apedec.c Kostya Shishkov + ass* Aurelien Jacobs + asv* Michael Niedermayer + atrac3* Benjamin Larsson + bgmc.c, bgmc.h Thilo Borgmann + bink.c Kostya Shishkov + binkaudio.c Peter Ross + bmp.c Mans Rullgard, Kostya Shishkov + cavs* Stefan Gehrer + celp_filters.* Vitor Sessak + cdxl.c Paul B Mahol + cinepak.c Roberto Togni + cljr Alex Beregszaszi + cllc.c Derek Buitenhuis + cook.c, cookdata.h Benjamin Larsson + cpia.c Stephan Hilb + crystalhd.c Philip Langdale + cscd.c Reimar Doeffinger + dca.c Kostya Shishkov, Benjamin Larsson + dnxhd* Baptiste Coudurier + dpcm.c Mike Melanson + dxa.c Kostya Shishkov + dv.c Roman Shaposhnik + eacmv*, eaidct*, eat* Peter Ross + ffv1.c Michael Niedermayer + ffwavesynth.c Nicolas George + flac* Justin Ruggles + flashsv* Benjamin Larsson + flicvideo.c Mike Melanson + g722.c Martin Storsjo + g726.c Roman Shaposhnik + gifdec.c Baptiste Coudurier + h264* Loren Merritt, Michael Niedermayer + h261* Michael Niedermayer + h263* Michael Niedermayer + huffyuv.c Michael Niedermayer + idcinvideo.c Mike Melanson + imc* Benjamin Larsson + indeo2* Kostya Shishkov + indeo5* Kostya Shishkov + interplayvideo.c Mike Melanson + ivi* Kostya Shishkov + jacosub* ClĂ©ment BÅ“sch + jpeg_ls.c Kostya Shishkov + jvdec.c Peter Ross + kmvc.c Kostya Shishkov + lcl*.c Roberto Togni, Reimar Doeffinger + libcelt_dec.c Nicolas George + libgsm.c Michel Bardiaux + libdirac* David Conrad + libopenjpeg.c Jaikrishnan Menon + libopenjpegenc.c Michael Bradshaw + libschroedinger* David Conrad + libspeexdec.c Justin Ruggles + libtheoraenc.c David Conrad + libutvideo* Derek Buitenhuis + libvorbis.c David Conrad + libxavs.c Stefan Gehrer + libx264.c Mans Rullgard, Jason Garrett-Glaser + loco.c Kostya Shishkov + lzo.h, lzo.c Reimar Doeffinger + mdec.c Michael Niedermayer + mimic.c Ramiro Polla + mjpeg*.c Michael Niedermayer + mlp* Ramiro Polla + mmvideo.c Peter Ross + mpc* Kostya Shishkov + mpeg12.c, mpeg12data.h Michael Niedermayer + mpegvideo.c, mpegvideo.h Michael Niedermayer + msmpeg4.c, msmpeg4data.h Michael Niedermayer + msrle.c Mike Melanson + msvideo1.c Mike Melanson + nellymoserdec.c Benjamin Larsson + nuv.c Reimar Doeffinger + paf.* Paul B Mahol + pcx.c Ivo van Poorten + pgssubdec.c Reimar Doeffinger + ptx.c Ivo van Poorten + qcelp* Reynaldo H. Verdejo Pinochet + qdm2.c, qdm2data.h Roberto Togni, Benjamin Larsson + qdrw.c Kostya Shishkov + qpeg.c Kostya Shishkov + qtrle.c Mike Melanson + ra144.c, ra144.h, ra288.c, ra288.h Roberto Togni + resample2.c Michael Niedermayer + rl2.c Sascha Sommer + rpza.c Roberto Togni + rtjpeg.c, rtjpeg.h Reimar Doeffinger + rv10.c Michael Niedermayer + rv3* Kostya Shishkov + rv4* Kostya Shishkov + s3tc* Ivo van Poorten + smacker.c Kostya Shishkov + smc.c Mike Melanson + snow.c Michael Niedermayer, Loren Merritt + sonic.c Alex Beregszaszi + srt* Aurelien Jacobs + sunrast.c Ivo van Poorten + svq3.c Michael Niedermayer + tak* Paul B Mahol + targa.c Kostya Shishkov + tiff.c Kostya Shishkov + truemotion1* Mike Melanson + truemotion2* Kostya Shishkov + truespeech.c Kostya Shishkov + tscc.c Kostya Shishkov + tta.c Alex Beregszaszi, Jaikrishnan Menon + txd.c Ivo van Poorten + ulti* Kostya Shishkov + v410*.c Derek Buitenhuis + vb.c Kostya Shishkov + vble.c Derek Buitenhuis + vc1* Kostya Shishkov + vcr1.c Michael Niedermayer + vda_h264_dec.c Xidorn Quan + vima.c Paul B Mahol + vmnc.c Kostya Shishkov + vorbis_enc.c Oded Shimon + vorbis_dec.c Denes Balatoni, David Conrad + vp3* Mike Melanson + vp5 Aurelien Jacobs + vp6 Aurelien Jacobs + vp8 David Conrad, Jason Garrett-Glaser, Ronald Bultje + vqavideo.c Mike Melanson + wavpack.c Kostya Shishkov + wmaprodec.c Sascha Sommer + wmavoice.c Ronald S. Bultje + wmv2.c Michael Niedermayer + wnv1.c Kostya Shishkov + xan.c Mike Melanson + xbm* Paul B Mahol + xl.c Kostya Shishkov + xvmc.c Ivan Kalvachev + xwd* Paul B Mahol + zerocodec.c Derek Buitenhuis + zmbv* Kostya Shishkov + +Hardware acceleration: + crystalhd.c Philip Langdale + dxva2* Laurent Aimar + libstagefright.cpp Mohamed Naufal + vaapi* Gwenole Beauchesne + vda* Sebastien Zwickert + vdpau* Carl Eugen Hoyos + + +libavdevice +=========== + External Interface: + libavdevice/avdevice.h + + + iec61883.c Georg Lippitsch + libdc1394.c Roman Shaposhnik + v4l2.c Luca Abeni + vfwcap.c Ramiro Polla + dshow.c Roger Pack + +libavfilter +=========== + +Generic parts: + graphdump.c Nicolas George + +Filters: + af_amerge.c Nicolas George + af_astreamsync.c Nicolas George + af_atempo.c Pavel Koshevoy + af_pan.c Nicolas George + vf_yadif.c Michael Niedermayer + +Sources: + vsrc_mandelbrot.c Michael Niedermayer + +libavformat +=========== + +Generic parts: + External Interface: + libavformat/avformat.h Michael Niedermayer + Utility Code: + libavformat/utils.c Michael Niedermayer + + +Muxers/Demuxers: + 4xm.c Mike Melanson + adtsenc.c Robert Swain + afc.c Paul B Mahol + aiff.c Baptiste Coudurier + ape.c Kostya Shishkov + ass* Aurelien Jacobs + astdec.c Paul B Mahol + astenc.c James Almer + avi* Michael Niedermayer + avr.c Paul B Mahol + bink.c Peter Ross + brstm.c Paul B Mahol + caf* Peter Ross + cdxl.c Paul B Mahol + crc.c Michael Niedermayer + daud.c Reimar Doeffinger + dtshddec.c Paul B Mahol + dv.c Roman Shaposhnik + dxa.c Kostya Shishkov + electronicarts.c Peter Ross + epafdec.c Paul B Mahol + ffm* Baptiste Coudurier + flac* Justin Ruggles + flic.c Mike Melanson + flvdec.c, flvenc.c Michael Niedermayer + gxf.c Reimar Doeffinger + gxfenc.c Baptiste Coudurier + idcin.c Mike Melanson + idroqdec.c Mike Melanson + iff.c Jaikrishnan Menon + ipmovie.c Mike Melanson + img2*.c Michael Niedermayer + ircam* Paul B Mahol + iss.c Stefan Gehrer + jacosub* ClĂ©ment BÅ“sch + jvdec.c Peter Ross + libmodplug.c ClĂ©ment BÅ“sch + libnut.c Oded Shimon + lmlm4.c Ivo van Poorten + lvfdec.c Paul B Mahol + lxfdec.c Tomas Härdin + matroska.c Aurelien Jacobs + matroskadec.c Aurelien Jacobs + matroskaenc.c David Conrad + metadata* Aurelien Jacobs + microdvd* Aurelien Jacobs + mgsts.c Paul B Mahol + mm.c Peter Ross + mov.c Michael Niedermayer, Baptiste Coudurier + movenc.c Michael Niedermayer, Baptiste Coudurier + mpc.c Kostya Shishkov + mpeg.c Michael Niedermayer + mpegenc.c Michael Niedermayer + mpegts* Baptiste Coudurier + msnwc_tcp.c Ramiro Polla + mtv.c Reynaldo H. Verdejo Pinochet + mxf* Baptiste Coudurier + mxfdec.c Tomas Härdin + nistspheredec.c Paul B Mahol + nsvdec.c Francois Revol + nut.c Michael Niedermayer + nuv.c Reimar Doeffinger + oggdec.c, oggdec.h David Conrad + oggenc.c Baptiste Coudurier + oggparse*.c David Conrad + oma.c Maxim Poliakovski + paf.c Paul B Mahol + psxstr.c Mike Melanson + pva.c Ivo van Poorten + pvfdec.c Paul B Mahol + r3d.c Baptiste Coudurier + raw.c Michael Niedermayer + rdt.c Ronald S. Bultje + rl2.c Sascha Sommer + rmdec.c, rmenc.c Ronald S. Bultje, Kostya Shishkov + rtmp* Kostya Shishkov + rtp.c, rtpenc.c Martin Storsjo + rtpdec_asf.* Ronald S. Bultje + rtpenc_mpv.*, rtpenc_aac.* Martin Storsjo + rtsp.c Luca Barbato + sbgdec.c Nicolas George + sdp.c Martin Storsjo + segafilm.c Mike Melanson + siff.c Kostya Shishkov + smacker.c Kostya Shishkov + smjpeg* Paul B Mahol + srtdec.c Aurelien Jacobs + swf.c Baptiste Coudurier + takdec.c Paul B Mahol + tta.c Alex Beregszaszi + txd.c Ivo van Poorten + voc.c Aurelien Jacobs + wav.c Michael Niedermayer + wc3movie.c Mike Melanson + westwood.c Mike Melanson + wtv.c Peter Ross + wv.c Kostya Shishkov + wvenc.c Paul B Mahol + +Protocols: + bluray.c Petri Hintukainen + http.c Ronald S. Bultje + mms*.c Ronald S. Bultje + udp.c Luca Abeni + + +libswresample +============= + +Generic parts: + audioconvert.c Michael Niedermayer + dither.c Michael Niedermayer + rematrix*.c Michael Niedermayer + swresample*.c Michael Niedermayer + +Resamplers: + resample*.c Michael Niedermayer + soxr_resample.c Rob Sykes + + +Operating systems / CPU architectures +===================================== + +Alpha Mans Rullgard, Falk Hueffner +ARM Mans Rullgard +AVR32 Mans Rullgard +MIPS Mans Rullgard +Mac OS X / PowerPC Romain Dolbeau, Guillaume Poirier +Amiga / PowerPC Colin Ward +Linux / PowerPC Luca Barbato +Windows MinGW Alex Beregszaszi, Ramiro Polla +Windows Cygwin Victor Paesa +ADI/Blackfin DSP Marc Hoffman +Sparc Roman Shaposhnik +x86 Michael Niedermayer + + +Releases +======== + +1.1 Michael Niedermayer +1.0 Michael Niedermayer +0.11 Michael Niedermayer + + + +GnuPG Fingerprints of maintainers and contributors +================================================== + +Anssi Hannula 1A92 FF42 2DD9 8D2E 8AF7 65A9 4278 C520 513D F3CB +Anton Khirnov 6D0C 6625 56F8 65D1 E5F5 814B B50A 1241 C067 07AB +Attila Kinali 11F0 F9A6 A1D2 11F6 C745 D10C 6520 BCDD F2DF E765 +Baptiste Coudurier 8D77 134D 20CC 9220 201F C5DB 0AC9 325C 5C1A BAAA +Ben Littler 3EE3 3723 E560 3214 A8CD 4DEB 2CDB FCE7 768C 8D2C +Benoit Fouet B22A 4F4F 43EF 636B BB66 FCDC 0023 AE1E 2985 49C8 +BÅ“sch ClĂ©ment 52D0 3A82 D445 F194 DB8B 2B16 87EE 2CB8 F4B8 FCF9 +Daniel Verkamp 78A6 07ED 782C 653E C628 B8B9 F0EB 8DD8 2F0E 21C7 +Diego Biurrun 8227 1E31 B6D9 4994 7427 E220 9CAE D6CC 4757 FCC5 +Gwenole Beauchesne 2E63 B3A6 3E44 37E2 017D 2704 53C7 6266 B153 99C4 +Jaikrishnan Menon 61A1 F09F 01C9 2D45 78E1 C862 25DC 8831 AF70 D368 +Justin Ruggles 3136 ECC0 C10D 6C04 5F43 CA29 FCBE CD2A 3787 1EBF +Loren Merritt ABD9 08F4 C920 3F65 D8BE 35D7 1540 DAA7 060F 56DE +Lou Logan 7D68 DC73 CBEF EABB 671A B6CF 621C 2E28 82F8 DC3A +Luca Barbato 6677 4209 213C 8843 5B67 29E7 E84C 78C2 84E9 0E34 +Michael Niedermayer 9FF2 128B 147E F673 0BAD F133 611E C787 040B 0FAB +Nicolas George 24CE 01CE 9ACC 5CEB 74D8 8D9D B063 D997 36E5 4C93 +Panagiotis Issaris 6571 13A3 33D9 3726 F728 AA98 F643 B12E ECF3 E029 +Peter Ross A907 E02F A6E5 0CD2 34CD 20D2 6760 79C5 AC40 DD6B +Reimar Döffinger C61D 16E5 9E2C D10C 8958 38A4 0899 A2B9 06D4 D9C7 +Reinhard Tartler 9300 5DC2 7E87 6C37 ED7B CA9A 9808 3544 9453 48A4 +Reynaldo H. Verdejo Pinochet 6E27 CD34 170C C78E 4D4F 5F40 C18E 077F 3114 452A +Robert Swain EE7A 56EA 4A81 A7B5 2001 A521 67FA 362D A2FC 3E71 +Sascha Sommer 38A0 F88B 868E 9D3A 97D4 D6A0 E823 706F 1E07 0D3C +Stefano Sabatini 0D0B AD6B 5330 BBAD D3D6 6A0C 719C 2839 FC43 2D5F +Stephan Hilb 4F38 0B3A 5F39 B99B F505 E562 8D5C 5554 4E17 8863 +Tomas Härdin A79D 4E3D F38F 763F 91F5 8B33 A01E 8AE0 41BB 2551 diff --git a/project/jni/ffmpeg/Makefile b/project/jni/ffmpeg/Makefile new file mode 100644 index 000000000..07821d114 --- /dev/null +++ b/project/jni/ffmpeg/Makefile @@ -0,0 +1,193 @@ +MAIN_MAKEFILE=1 +include config.mak + +vpath %.c $(SRC_PATH) +vpath %.cpp $(SRC_PATH) +vpath %.h $(SRC_PATH) +vpath %.S $(SRC_PATH) +vpath %.asm $(SRC_PATH) +vpath %.v $(SRC_PATH) +vpath %.texi $(SRC_PATH) +vpath %/fate_config.sh.template $(SRC_PATH) + +PROGS-$(CONFIG_FFMPEG) += ffmpeg +PROGS-$(CONFIG_FFPLAY) += ffplay +PROGS-$(CONFIG_FFPROBE) += ffprobe +PROGS-$(CONFIG_FFSERVER) += ffserver + +PROGS := $(PROGS-yes:%=%$(PROGSSUF)$(EXESUF)) +INSTPROGS = $(PROGS-yes:%=%$(PROGSSUF)$(EXESUF)) + +OBJS = cmdutils.o $(EXEOBJS) +OBJS-ffmpeg = ffmpeg_opt.o ffmpeg_filter.o +TESTTOOLS = audiogen videogen rotozoom tiny_psnr base64 +HOSTPROGS := $(TESTTOOLS:%=tests/%) doc/print_options +TOOLS = qt-faststart trasher +TOOLS-$(CONFIG_ZLIB) += cws2fws + +BASENAMES = ffmpeg ffplay ffprobe ffserver +ALLPROGS = $(BASENAMES:%=%$(PROGSSUF)$(EXESUF)) +ALLPROGS_G = $(BASENAMES:%=%$(PROGSSUF)_g$(EXESUF)) +ALLMANPAGES = $(BASENAMES:%=%.1) + +FFLIBS-$(CONFIG_AVDEVICE) += avdevice +FFLIBS-$(CONFIG_AVFILTER) += avfilter +FFLIBS-$(CONFIG_AVFORMAT) += avformat +FFLIBS-$(CONFIG_AVRESAMPLE) += avresample +FFLIBS-$(CONFIG_AVCODEC) += avcodec +FFLIBS-$(CONFIG_POSTPROC) += postproc +FFLIBS-$(CONFIG_SWRESAMPLE)+= swresample +FFLIBS-$(CONFIG_SWSCALE) += swscale + +FFLIBS := avutil + +DATA_FILES := $(wildcard $(SRC_PATH)/presets/*.ffpreset) $(SRC_PATH)/doc/ffprobe.xsd +EXAMPLES_FILES := $(wildcard $(SRC_PATH)/doc/examples/*.c) $(SRC_PATH)/doc/examples/Makefile $(SRC_PATH)/doc/examples/README + +SKIPHEADERS = cmdutils_common_opts.h + +include $(SRC_PATH)/common.mak + +FF_EXTRALIBS := $(FFEXTRALIBS) +FF_DEP_LIBS := $(DEP_LIBS) + +all: $(PROGS) + +$(PROGS): %$(EXESUF): %_g$(EXESUF) + $(CP) $< $@ + $(STRIP) $@ + +$(TOOLS): %$(EXESUF): %.o $(EXEOBJS) + $(LD) $(LDFLAGS) $(LD_O) $^ $(ELIBS) + +tools/cws2fws$(EXESUF): ELIBS = $(ZLIB) + +config.h: .config +.config: $(wildcard $(FFLIBS:%=$(SRC_PATH)/lib%/all*.c)) + @-tput bold 2>/dev/null + @-printf '\nWARNING: $(?F) newer than config.h, rerun configure\n\n' + @-tput sgr0 2>/dev/null + +SUBDIR_VARS := CLEANFILES EXAMPLES FFLIBS HOSTPROGS TESTPROGS TOOLS \ + HEADERS ARCH_HEADERS BUILT_HEADERS SKIPHEADERS \ + ARMV5TE-OBJS ARMV6-OBJS VFP-OBJS NEON-OBJS \ + ALTIVEC-OBJS VIS-OBJS \ + MMX-OBJS YASM-OBJS \ + MIPSFPU-OBJS MIPSDSPR2-OBJS MIPSDSPR1-OBJS MIPS32R2-OBJS \ + OBJS HOSTOBJS TESTOBJS + +define RESET +$(1) := +$(1)-yes := +endef + +define DOSUBDIR +$(foreach V,$(SUBDIR_VARS),$(eval $(call RESET,$(V)))) +SUBDIR := $(1)/ +include $(SRC_PATH)/$(1)/Makefile +-include $(SRC_PATH)/$(1)/$(ARCH)/Makefile +include $(SRC_PATH)/library.mak +endef + +$(foreach D,$(FFLIBS),$(eval $(call DOSUBDIR,lib$(D)))) + +define DOPROG +OBJS-$(1) += $(1).o cmdutils.o $(EXEOBJS) +$(1)$(PROGSSUF)_g$(EXESUF): $$(OBJS-$(1)) +$$(OBJS-$(1)): CFLAGS += $(CFLAGS-$(1)) +$(1)$(PROGSSUF)_g$(EXESUF): LDFLAGS += $(LDFLAGS-$(1)) +$(1)$(PROGSSUF)_g$(EXESUF): FF_EXTRALIBS += $(LIBS-$(1)) +-include $$(OBJS-$(1):.o=.d) +endef + +$(foreach P,$(PROGS-yes),$(eval $(call DOPROG,$(P)))) + +%$(PROGSSUF)_g$(EXESUF): %.o $(FF_DEP_LIBS) + $(LD) $(LDFLAGS) $(LD_O) $(OBJS-$*) $(FF_EXTRALIBS) + +OBJDIRS += tools + +-include $(wildcard tools/*.d) + +VERSION_SH = $(SRC_PATH)/version.sh +GIT_LOG = $(SRC_PATH)/.git/logs/HEAD + +.version: $(wildcard $(GIT_LOG)) $(VERSION_SH) config.mak +.version: M=@ + +version.h .version: + $(M)$(VERSION_SH) $(SRC_PATH) version.h $(EXTRA_VERSION) + $(Q)touch .version + +# force version.sh to run whenever version might have changed +-include .version + +ifdef PROGS +install: install-progs install-data +endif + +install: install-libs install-headers + +install-libs: install-libs-yes + +install-progs-yes: +install-progs-$(CONFIG_SHARED): install-libs + +install-progs: install-progs-yes $(PROGS) + $(Q)mkdir -p "$(BINDIR)" + $(INSTALL) -c -m 755 $(INSTPROGS) "$(BINDIR)" + +install-data: $(DATA_FILES) $(EXAMPLES_FILES) + $(Q)mkdir -p "$(DATADIR)/examples" + $(INSTALL) -m 644 $(DATA_FILES) "$(DATADIR)" + $(INSTALL) -m 644 $(EXAMPLES_FILES) "$(DATADIR)/examples" + +uninstall: uninstall-libs uninstall-headers uninstall-progs uninstall-data + +uninstall-progs: + $(RM) $(addprefix "$(BINDIR)/", $(ALLPROGS)) + +uninstall-data: + $(RM) -r "$(DATADIR)" + +clean:: + $(RM) $(ALLPROGS) $(ALLPROGS_G) + $(RM) $(CLEANSUFFIXES) + $(RM) $(CLEANSUFFIXES:%=tools/%) + $(RM) coverage.info + $(RM) -r coverage-html + +distclean:: + $(RM) $(DISTCLEANSUFFIXES) + $(RM) config.* .version version.h libavutil/avconfig.h libavcodec/codec_names.h + +config: + $(SRC_PATH)/configure $(value FFMPEG_CONFIGURATION) + +# Without the sed genthml thinks "libavutil" and "./libavutil" are two different things +coverage.info: $(wildcard *.gcda *.gcno */*.gcda */*.gcno */*/*.gcda */*/*.gcno) + $(Q)lcov -c -d . -b . | sed -e 's#/./#/#g' > $@ + +coverage-html: coverage.info + $(Q)mkdir -p $@ + $(Q)genhtml -o $@ $< + $(Q)touch $@ + +check: all alltools examples testprogs fate + +include $(SRC_PATH)/doc/Makefile +include $(SRC_PATH)/tests/Makefile + +$(sort $(OBJDIRS)): + $(Q)mkdir -p $@ + +# 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: + +.PHONY: all all-yes alltools check *clean config install* +.PHONY: testprogs uninstall* diff --git a/project/jni/ffmpeg/README b/project/jni/ffmpeg/README new file mode 100644 index 000000000..ae007bccc --- /dev/null +++ b/project/jni/ffmpeg/README @@ -0,0 +1,18 @@ +FFmpeg README +------------- + +1) Documentation +---------------- + +* Read the documentation in the doc/ directory in git. + You can also view it online at http://ffmpeg.org/documentation.html + +2) Licensing +------------ + +* See the LICENSE file. + +3) Build and Install +-------------------- + +* See the INSTALL file. diff --git a/project/jni/ffmpeg/RELEASE b/project/jni/ffmpeg/RELEASE new file mode 100644 index 000000000..45a1b3f44 --- /dev/null +++ b/project/jni/ffmpeg/RELEASE @@ -0,0 +1 @@ +1.1.2 diff --git a/project/jni/ffmpeg/VERSION b/project/jni/ffmpeg/VERSION new file mode 100644 index 000000000..45a1b3f44 --- /dev/null +++ b/project/jni/ffmpeg/VERSION @@ -0,0 +1 @@ +1.1.2 diff --git a/project/jni/ffmpeg/arch.mak b/project/jni/ffmpeg/arch.mak new file mode 100644 index 000000000..b71c8e51f --- /dev/null +++ b/project/jni/ffmpeg/arch.mak @@ -0,0 +1,16 @@ +OBJS-$(HAVE_ARMV5TE) += $(ARMV5TE-OBJS) $(ARMV5TE-OBJS-yes) +OBJS-$(HAVE_ARMV6) += $(ARMV6-OBJS) $(ARMV6-OBJS-yes) +OBJS-$(HAVE_VFP) += $(VFP-OBJS) $(VFP-OBJS-yes) +OBJS-$(HAVE_NEON) += $(NEON-OBJS) $(NEON-OBJS-yes) + +OBJS-$(HAVE_MIPSFPU) += $(MIPSFPU-OBJS) $(MIPSFPU-OBJS-yes) +OBJS-$(HAVE_MIPS32R2) += $(MIPS32R2-OBJS) $(MIPS32R2-OBJS-yes) +OBJS-$(HAVE_MIPSDSPR1) += $(MIPSDSPR1-OBJS) $(MIPSDSPR1-OBJS-yes) +OBJS-$(HAVE_MIPSDSPR2) += $(MIPSDSPR2-OBJS) $(MIPSDSPR2-OBJS-yes) + +OBJS-$(HAVE_ALTIVEC) += $(ALTIVEC-OBJS) $(ALTIVEC-OBJS-yes) + +OBJS-$(HAVE_VIS) += $(VIS-OBJS) $(VIS-OBJS-yes) + +OBJS-$(HAVE_MMX) += $(MMX-OBJS) $(MMX-OBJS-yes) +OBJS-$(HAVE_YASM) += $(YASM-OBJS) $(YASM-OBJS-yes) diff --git a/project/jni/ffmpeg/cmdutils.c b/project/jni/ffmpeg/cmdutils.c new file mode 100644 index 000000000..38c8159e7 --- /dev/null +++ b/project/jni/ffmpeg/cmdutils.c @@ -0,0 +1,1965 @@ +/* + * Various utilities for command line tools + * Copyright (c) 2000-2003 Fabrice Bellard + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include +#include +#include +#include + +/* Include only the enabled headers since some compilers (namely, Sun + Studio) will not omit unused inline functions and create undefined + references to libraries that are not being built. */ + +#include "config.h" +#include "compat/va_copy.h" +#include "libavformat/avformat.h" +#include "libavfilter/avfilter.h" +#include "libavdevice/avdevice.h" +#include "libavresample/avresample.h" +#include "libswscale/swscale.h" +#include "libswresample/swresample.h" +#if CONFIG_POSTPROC +#include "libpostproc/postprocess.h" +#endif +#include "libavutil/avassert.h" +#include "libavutil/avstring.h" +#include "libavutil/bprint.h" +#include "libavutil/mathematics.h" +#include "libavutil/imgutils.h" +#include "libavutil/parseutils.h" +#include "libavutil/pixdesc.h" +#include "libavutil/eval.h" +#include "libavutil/dict.h" +#include "libavutil/opt.h" +#include "cmdutils.h" +#include "version.h" +#if CONFIG_NETWORK +#include "libavformat/network.h" +#endif +#if HAVE_SYS_RESOURCE_H +#include +#include +#endif + +static int init_report(const char *env); + +struct SwsContext *sws_opts; +SwrContext *swr_opts; +AVDictionary *format_opts, *codec_opts; + +const int this_year = 2013; + +static FILE *report_file; + +void init_opts(void) +{ + + if(CONFIG_SWSCALE) + sws_opts = sws_getContext(16, 16, 0, 16, 16, 0, SWS_BICUBIC, + NULL, NULL, NULL); + + if(CONFIG_SWRESAMPLE) + swr_opts = swr_alloc(); +} + +void uninit_opts(void) +{ +#if CONFIG_SWSCALE + sws_freeContext(sws_opts); + sws_opts = NULL; +#endif + + if(CONFIG_SWRESAMPLE) + swr_free(&swr_opts); + + av_dict_free(&format_opts); + av_dict_free(&codec_opts); +} + +void log_callback_help(void *ptr, int level, const char *fmt, va_list vl) +{ + vfprintf(stdout, fmt, vl); +} + +static void log_callback_report(void *ptr, int level, const char *fmt, va_list vl) +{ + va_list vl2; + char line[1024]; + static int print_prefix = 1; + + va_copy(vl2, vl); + av_log_default_callback(ptr, level, fmt, vl); + av_log_format_line(ptr, level, fmt, vl2, line, sizeof(line), &print_prefix); + va_end(vl2); + fputs(line, report_file); + fflush(report_file); +} + +double parse_number_or_die(const char *context, const char *numstr, int type, + double min, double max) +{ + char *tail; + const char *error; + double d = av_strtod(numstr, &tail); + if (*tail) + error = "Expected number for %s but found: %s\n"; + else if (d < min || d > max) + error = "The value for %s was %s which is not within %f - %f\n"; + else if (type == OPT_INT64 && (int64_t)d != d) + error = "Expected int64 for %s but found %s\n"; + else if (type == OPT_INT && (int)d != d) + error = "Expected int for %s but found %s\n"; + else + return d; + av_log(NULL, AV_LOG_FATAL, error, context, numstr, min, max); + exit(1); + return 0; +} + +int64_t parse_time_or_die(const char *context, const char *timestr, + int is_duration) +{ + int64_t us; + if (av_parse_time(&us, timestr, is_duration) < 0) { + av_log(NULL, AV_LOG_FATAL, "Invalid %s specification for %s: %s\n", + is_duration ? "duration" : "date", context, timestr); + exit(1); + } + return us; +} + +void show_help_options(const OptionDef *options, const char *msg, int req_flags, + int rej_flags, int alt_flags) +{ + const OptionDef *po; + int first; + + first = 1; + for (po = options; po->name != NULL; po++) { + char buf[64]; + + if (((po->flags & req_flags) != req_flags) || + (alt_flags && !(po->flags & alt_flags)) || + (po->flags & rej_flags)) + continue; + + if (first) { + printf("%s\n", msg); + first = 0; + } + av_strlcpy(buf, po->name, sizeof(buf)); + if (po->argname) { + av_strlcat(buf, " ", sizeof(buf)); + av_strlcat(buf, po->argname, sizeof(buf)); + } + printf("-%-17s %s\n", buf, po->help); + } + printf("\n"); +} + +void show_help_children(const AVClass *class, int flags) +{ + const AVClass *child = NULL; + if (class->option) { + av_opt_show2(&class, NULL, flags, 0); + printf("\n"); + } + + while (child = av_opt_child_class_next(class, child)) + show_help_children(child, flags); +} + +static const OptionDef *find_option(const OptionDef *po, const char *name) +{ + const char *p = strchr(name, ':'); + int len = p ? p - name : strlen(name); + + while (po->name != NULL) { + if (!strncmp(name, po->name, len) && strlen(po->name) == len) + break; + po++; + } + return po; +} + +#if HAVE_COMMANDLINETOARGVW +#include +#include +/* Will be leaked on exit */ +static char** win32_argv_utf8 = NULL; +static int win32_argc = 0; + +/** + * Prepare command line arguments for executable. + * For Windows - perform wide-char to UTF-8 conversion. + * Input arguments should be main() function arguments. + * @param argc_ptr Arguments number (including executable) + * @param argv_ptr Arguments list. + */ +static void prepare_app_arguments(int *argc_ptr, char ***argv_ptr) +{ + char *argstr_flat; + wchar_t **argv_w; + int i, buffsize = 0, offset = 0; + + if (win32_argv_utf8) { + *argc_ptr = win32_argc; + *argv_ptr = win32_argv_utf8; + return; + } + + win32_argc = 0; + argv_w = CommandLineToArgvW(GetCommandLineW(), &win32_argc); + if (win32_argc <= 0 || !argv_w) + return; + + /* determine the UTF-8 buffer size (including NULL-termination symbols) */ + for (i = 0; i < win32_argc; i++) + buffsize += WideCharToMultiByte(CP_UTF8, 0, argv_w[i], -1, + NULL, 0, NULL, NULL); + + win32_argv_utf8 = av_mallocz(sizeof(char *) * (win32_argc + 1) + buffsize); + argstr_flat = (char *)win32_argv_utf8 + sizeof(char *) * (win32_argc + 1); + if (win32_argv_utf8 == NULL) { + LocalFree(argv_w); + return; + } + + for (i = 0; i < win32_argc; i++) { + win32_argv_utf8[i] = &argstr_flat[offset]; + offset += WideCharToMultiByte(CP_UTF8, 0, argv_w[i], -1, + &argstr_flat[offset], + buffsize - offset, NULL, NULL); + } + win32_argv_utf8[i] = NULL; + LocalFree(argv_w); + + *argc_ptr = win32_argc; + *argv_ptr = win32_argv_utf8; +} +#else +static inline void prepare_app_arguments(int *argc_ptr, char ***argv_ptr) +{ + /* nothing to do */ +} +#endif /* HAVE_COMMANDLINETOARGVW */ + +static int write_option(void *optctx, const OptionDef *po, const char *opt, + const char *arg) +{ + /* new-style options contain an offset into optctx, old-style address of + * a global var*/ + void *dst = po->flags & (OPT_OFFSET | OPT_SPEC) ? + (uint8_t *)optctx + po->u.off : po->u.dst_ptr; + int *dstcount; + + if (po->flags & OPT_SPEC) { + SpecifierOpt **so = dst; + char *p = strchr(opt, ':'); + + dstcount = (int *)(so + 1); + *so = grow_array(*so, sizeof(**so), dstcount, *dstcount + 1); + (*so)[*dstcount - 1].specifier = av_strdup(p ? p + 1 : ""); + dst = &(*so)[*dstcount - 1].u; + } + + if (po->flags & OPT_STRING) { + char *str; + str = av_strdup(arg); +// av_freep(dst); + *(char **)dst = str; + } else if (po->flags & OPT_BOOL || po->flags & OPT_INT) { + *(int *)dst = parse_number_or_die(opt, arg, OPT_INT64, INT_MIN, INT_MAX); + } else if (po->flags & OPT_INT64) { + *(int64_t *)dst = parse_number_or_die(opt, arg, OPT_INT64, INT64_MIN, INT64_MAX); + } else if (po->flags & OPT_TIME) { + *(int64_t *)dst = parse_time_or_die(opt, arg, 1); + } else if (po->flags & OPT_FLOAT) { + *(float *)dst = parse_number_or_die(opt, arg, OPT_FLOAT, -INFINITY, INFINITY); + } else if (po->flags & OPT_DOUBLE) { + *(double *)dst = parse_number_or_die(opt, arg, OPT_DOUBLE, -INFINITY, INFINITY); + } else if (po->u.func_arg) { + int ret = po->u.func_arg(optctx, opt, arg); + if (ret < 0) { + av_log(NULL, AV_LOG_ERROR, + "Failed to set value '%s' for option '%s'\n", arg, opt); + return ret; + } + } + if (po->flags & OPT_EXIT) + exit(0); + + return 0; +} + +int parse_option(void *optctx, const char *opt, const char *arg, + const OptionDef *options) +{ + const OptionDef *po; + int ret; + + po = find_option(options, opt); + if (!po->name && opt[0] == 'n' && opt[1] == 'o') { + /* handle 'no' bool option */ + po = find_option(options, opt + 2); + if ((po->name && (po->flags & OPT_BOOL))) + arg = "0"; + } else if (po->flags & OPT_BOOL) + arg = "1"; + + if (!po->name) + po = find_option(options, "default"); + if (!po->name) { + av_log(NULL, AV_LOG_ERROR, "Unrecognized option '%s'\n", opt); + return AVERROR(EINVAL); + } + if (po->flags & HAS_ARG && !arg) { + av_log(NULL, AV_LOG_ERROR, "Missing argument for option '%s'\n", opt); + return AVERROR(EINVAL); + } + + ret = write_option(optctx, po, opt, arg); + if (ret < 0) + return ret; + + return !!(po->flags & HAS_ARG); +} + +void parse_options(void *optctx, int argc, char **argv, const OptionDef *options, + void (*parse_arg_function)(void *, const char*)) +{ + const char *opt; + int optindex, handleoptions = 1, ret; + + /* perform system-dependent conversions for arguments list */ + prepare_app_arguments(&argc, &argv); + + /* parse options */ + optindex = 1; + while (optindex < argc) { + opt = argv[optindex++]; + + if (handleoptions && opt[0] == '-' && opt[1] != '\0') { + if (opt[1] == '-' && opt[2] == '\0') { + handleoptions = 0; + continue; + } + opt++; + + if ((ret = parse_option(optctx, opt, argv[optindex], options)) < 0) + exit(1); + optindex += ret; + } else { + if (parse_arg_function) + parse_arg_function(optctx, opt); + } + } +} + +int parse_optgroup(void *optctx, OptionGroup *g) +{ + int i, ret; + + av_log(NULL, AV_LOG_DEBUG, "Parsing a group of options: %s %s.\n", + g->group_def->name, g->arg); + + for (i = 0; i < g->nb_opts; i++) { + Option *o = &g->opts[i]; + + av_log(NULL, AV_LOG_DEBUG, "Applying option %s (%s) with argument %s.\n", + o->key, o->opt->help, o->val); + + ret = write_option(optctx, o->opt, o->key, o->val); + if (ret < 0) + return ret; + } + + av_log(NULL, AV_LOG_DEBUG, "Successfully parsed a group of options.\n"); + + return 0; +} + +int locate_option(int argc, char **argv, const OptionDef *options, + const char *optname) +{ + const OptionDef *po; + int i; + + for (i = 1; i < argc; i++) { + const char *cur_opt = argv[i]; + + if (*cur_opt++ != '-') + continue; + + po = find_option(options, cur_opt); + if (!po->name && cur_opt[0] == 'n' && cur_opt[1] == 'o') + po = find_option(options, cur_opt + 2); + + if ((!po->name && !strcmp(cur_opt, optname)) || + (po->name && !strcmp(optname, po->name))) + return i; + + if (po->flags & HAS_ARG) + i++; + } + return 0; +} + +static void dump_argument(const char *a) +{ + const unsigned char *p; + + for (p = a; *p; p++) + if (!((*p >= '+' && *p <= ':') || (*p >= '@' && *p <= 'Z') || + *p == '_' || (*p >= 'a' && *p <= 'z'))) + break; + if (!*p) { + fputs(a, report_file); + return; + } + fputc('"', report_file); + for (p = a; *p; p++) { + if (*p == '\\' || *p == '"' || *p == '$' || *p == '`') + fprintf(report_file, "\\%c", *p); + else if (*p < ' ' || *p > '~') + fprintf(report_file, "\\x%02x", *p); + else + fputc(*p, report_file); + } + fputc('"', report_file); +} + +void parse_loglevel(int argc, char **argv, const OptionDef *options) +{ + int idx = locate_option(argc, argv, options, "loglevel"); + const char *env; + if (!idx) + idx = locate_option(argc, argv, options, "v"); + if (idx && argv[idx + 1]) + opt_loglevel(NULL, "loglevel", argv[idx + 1]); + idx = locate_option(argc, argv, options, "report"); + if ((env = getenv("FFREPORT")) || idx) { + init_report(env); + if (report_file) { + int i; + fprintf(report_file, "Command line:\n"); + for (i = 0; i < argc; i++) { + dump_argument(argv[i]); + fputc(i < argc - 1 ? ' ' : '\n', report_file); + } + fflush(report_file); + } + } +} + +#define FLAGS (o->type == AV_OPT_TYPE_FLAGS) ? AV_DICT_APPEND : 0 +int opt_default(void *optctx, const char *opt, const char *arg) +{ + const AVOption *o; + int consumed = 0; + char opt_stripped[128]; + const char *p; + const AVClass *cc = avcodec_get_class(), *fc = avformat_get_class(); + const AVClass *sc, *swr_class; + + if (!strcmp(opt, "debug") || !strcmp(opt, "fdebug")) + av_log_set_level(AV_LOG_DEBUG); + + if (!(p = strchr(opt, ':'))) + p = opt + strlen(opt); + av_strlcpy(opt_stripped, opt, FFMIN(sizeof(opt_stripped), p - opt + 1)); + + if ((o = av_opt_find(&cc, opt_stripped, NULL, 0, + AV_OPT_SEARCH_CHILDREN | AV_OPT_SEARCH_FAKE_OBJ)) || + ((opt[0] == 'v' || opt[0] == 'a' || opt[0] == 's') && + (o = av_opt_find(&cc, opt + 1, NULL, 0, AV_OPT_SEARCH_FAKE_OBJ)))) { + av_dict_set(&codec_opts, opt, arg, FLAGS); + consumed = 1; + } + if ((o = av_opt_find(&fc, opt, NULL, 0, + AV_OPT_SEARCH_CHILDREN | AV_OPT_SEARCH_FAKE_OBJ))) { + av_dict_set(&format_opts, opt, arg, FLAGS); + if(consumed) + av_log(NULL, AV_LOG_VERBOSE, "Routing %s to codec and muxer layer\n", opt); + consumed = 1; + } +#if CONFIG_SWSCALE + sc = sws_get_class(); + if (!consumed && av_opt_find(&sc, opt, NULL, 0, + AV_OPT_SEARCH_CHILDREN | AV_OPT_SEARCH_FAKE_OBJ)) { + // XXX we only support sws_flags, not arbitrary sws options + int ret = av_opt_set(sws_opts, opt, arg, 0); + if (ret < 0) { + av_log(NULL, AV_LOG_ERROR, "Error setting option %s.\n", opt); + return ret; + } + consumed = 1; + } +#endif +#if CONFIG_SWRESAMPLE + swr_class = swr_get_class(); + if (!consumed && av_opt_find(&swr_class, opt, NULL, 0, + AV_OPT_SEARCH_CHILDREN | AV_OPT_SEARCH_FAKE_OBJ)) { + int ret = av_opt_set(swr_opts, opt, arg, 0); + if (ret < 0) { + av_log(NULL, AV_LOG_ERROR, "Error setting option %s.\n", opt); + return ret; + } + consumed = 1; + } +#endif + + if (consumed) + return 0; + return AVERROR_OPTION_NOT_FOUND; +} + +/* + * Check whether given option is a group separator. + * + * @return index of the group definition that matched or -1 if none + */ +static int match_group_separator(const OptionGroupDef *groups, int nb_groups, + const char *opt) +{ + int i; + + for (i = 0; i < nb_groups; i++) { + const OptionGroupDef *p = &groups[i]; + if (p->sep && !strcmp(p->sep, opt)) + return i; + } + + return -1; +} + +/* + * Finish parsing an option group. + * + * @param group_idx which group definition should this group belong to + * @param arg argument of the group delimiting option + */ +static void finish_group(OptionParseContext *octx, int group_idx, + const char *arg) +{ + OptionGroupList *l = &octx->groups[group_idx]; + OptionGroup *g; + + GROW_ARRAY(l->groups, l->nb_groups); + g = &l->groups[l->nb_groups - 1]; + + *g = octx->cur_group; + g->arg = arg; + g->group_def = l->group_def; +#if CONFIG_SWSCALE + g->sws_opts = sws_opts; +#endif + g->swr_opts = swr_opts; + g->codec_opts = codec_opts; + g->format_opts = format_opts; + + codec_opts = NULL; + format_opts = NULL; +#if CONFIG_SWSCALE + sws_opts = NULL; +#endif + swr_opts = NULL; + init_opts(); + + memset(&octx->cur_group, 0, sizeof(octx->cur_group)); +} + +/* + * Add an option instance to currently parsed group. + */ +static void add_opt(OptionParseContext *octx, const OptionDef *opt, + const char *key, const char *val) +{ + int global = !(opt->flags & (OPT_PERFILE | OPT_SPEC | OPT_OFFSET)); + OptionGroup *g = global ? &octx->global_opts : &octx->cur_group; + + GROW_ARRAY(g->opts, g->nb_opts); + g->opts[g->nb_opts - 1].opt = opt; + g->opts[g->nb_opts - 1].key = key; + g->opts[g->nb_opts - 1].val = val; +} + +static void init_parse_context(OptionParseContext *octx, + const OptionGroupDef *groups, int nb_groups) +{ + static const OptionGroupDef global_group = { "global" }; + int i; + + memset(octx, 0, sizeof(*octx)); + + octx->nb_groups = nb_groups; + octx->groups = av_mallocz(sizeof(*octx->groups) * octx->nb_groups); + if (!octx->groups) + exit(1); + + for (i = 0; i < octx->nb_groups; i++) + octx->groups[i].group_def = &groups[i]; + + octx->global_opts.group_def = &global_group; + octx->global_opts.arg = ""; + + init_opts(); +} + +void uninit_parse_context(OptionParseContext *octx) +{ + int i, j; + + for (i = 0; i < octx->nb_groups; i++) { + OptionGroupList *l = &octx->groups[i]; + + for (j = 0; j < l->nb_groups; j++) { + av_freep(&l->groups[j].opts); + av_dict_free(&l->groups[j].codec_opts); + av_dict_free(&l->groups[j].format_opts); +#if CONFIG_SWSCALE + sws_freeContext(l->groups[j].sws_opts); +#endif + if(CONFIG_SWRESAMPLE) + swr_free(&l->groups[j].swr_opts); + } + av_freep(&l->groups); + } + av_freep(&octx->groups); + + av_freep(&octx->cur_group.opts); + av_freep(&octx->global_opts.opts); + + uninit_opts(); +} + +int split_commandline(OptionParseContext *octx, int argc, char *argv[], + const OptionDef *options, + const OptionGroupDef *groups, int nb_groups) +{ + int optindex = 1; + + /* perform system-dependent conversions for arguments list */ + prepare_app_arguments(&argc, &argv); + + init_parse_context(octx, groups, nb_groups); + av_log(NULL, AV_LOG_DEBUG, "Splitting the commandline.\n"); + + while (optindex < argc) { + const char *opt = argv[optindex++], *arg; + const OptionDef *po; + int ret; + + av_log(NULL, AV_LOG_DEBUG, "Reading option '%s' ...", opt); + + /* unnamed group separators, e.g. output filename */ + if (opt[0] != '-' || !opt[1]) { + finish_group(octx, 0, opt); + av_log(NULL, AV_LOG_DEBUG, " matched as %s.\n", groups[0].name); + continue; + } + opt++; + +#define GET_ARG(arg) \ +do { \ + arg = argv[optindex++]; \ + if (!arg) { \ + av_log(NULL, AV_LOG_ERROR, "Missing argument for option '%s'.\n", opt);\ + return AVERROR(EINVAL); \ + } \ +} while (0) + + /* named group separators, e.g. -i */ + if ((ret = match_group_separator(groups, nb_groups, opt)) >= 0) { + GET_ARG(arg); + finish_group(octx, ret, arg); + av_log(NULL, AV_LOG_DEBUG, " matched as %s with argument '%s'.\n", + groups[ret].name, arg); + continue; + } + + /* normal options */ + po = find_option(options, opt); + if (po->name) { + if (po->flags & OPT_EXIT) { + /* optional argument, e.g. -h */ + arg = argv[optindex++]; + } else if (po->flags & HAS_ARG) { + GET_ARG(arg); + } else { + arg = "1"; + } + + add_opt(octx, po, opt, arg); + av_log(NULL, AV_LOG_DEBUG, " matched as option '%s' (%s) with " + "argument '%s'.\n", po->name, po->help, arg); + continue; + } + + /* AVOptions */ + if (argv[optindex]) { + ret = opt_default(NULL, opt, argv[optindex]); + if (ret >= 0) { + av_log(NULL, AV_LOG_DEBUG, " matched as AVOption '%s' with " + "argument '%s'.\n", opt, argv[optindex]); + optindex++; + continue; + } else if (ret != AVERROR_OPTION_NOT_FOUND) { + av_log(NULL, AV_LOG_ERROR, "Error parsing option '%s' " + "with argument '%s'.\n", opt, argv[optindex]); + return ret; + } + } + + /* boolean -nofoo options */ + if (opt[0] == 'n' && opt[1] == 'o' && + (po = find_option(options, opt + 2)) && + po->name && po->flags & OPT_BOOL) { + add_opt(octx, po, opt, "0"); + av_log(NULL, AV_LOG_DEBUG, " matched as option '%s' (%s) with " + "argument 0.\n", po->name, po->help); + continue; + } + + av_log(NULL, AV_LOG_ERROR, "Unrecognized option '%s'.\n", opt); + return AVERROR_OPTION_NOT_FOUND; + } + + if (octx->cur_group.nb_opts || codec_opts || format_opts) + av_log(NULL, AV_LOG_WARNING, "Trailing options were found on the " + "commandline.\n"); + + av_log(NULL, AV_LOG_DEBUG, "Finished splitting the commandline.\n"); + + return 0; +} + +int opt_loglevel(void *optctx, const char *opt, const char *arg) +{ + const struct { const char *name; int level; } log_levels[] = { + { "quiet" , AV_LOG_QUIET }, + { "panic" , AV_LOG_PANIC }, + { "fatal" , AV_LOG_FATAL }, + { "error" , AV_LOG_ERROR }, + { "warning", AV_LOG_WARNING }, + { "info" , AV_LOG_INFO }, + { "verbose", AV_LOG_VERBOSE }, + { "debug" , AV_LOG_DEBUG }, + }; + char *tail; + int level; + int i; + + for (i = 0; i < FF_ARRAY_ELEMS(log_levels); i++) { + if (!strcmp(log_levels[i].name, arg)) { + av_log_set_level(log_levels[i].level); + return 0; + } + } + + level = strtol(arg, &tail, 10); + if (*tail) { + av_log(NULL, AV_LOG_FATAL, "Invalid loglevel \"%s\". " + "Possible levels are numbers or:\n", arg); + for (i = 0; i < FF_ARRAY_ELEMS(log_levels); i++) + av_log(NULL, AV_LOG_FATAL, "\"%s\"\n", log_levels[i].name); + exit(1); + } + av_log_set_level(level); + return 0; +} + +static void expand_filename_template(AVBPrint *bp, const char *template, + struct tm *tm) +{ + int c; + + while ((c = *(template++))) { + if (c == '%') { + if (!(c = *(template++))) + break; + switch (c) { + case 'p': + av_bprintf(bp, "%s", program_name); + break; + case 't': + av_bprintf(bp, "%04d%02d%02d-%02d%02d%02d", + tm->tm_year + 1900, tm->tm_mon + 1, tm->tm_mday, + tm->tm_hour, tm->tm_min, tm->tm_sec); + break; + case '%': + av_bprint_chars(bp, c, 1); + break; + } + } else { + av_bprint_chars(bp, c, 1); + } + } +} + +static int init_report(const char *env) +{ + char *filename_template = NULL; + char *key, *val; + int ret, count = 0; + time_t now; + struct tm *tm; + AVBPrint filename; + + if (report_file) /* already opened */ + return 0; + time(&now); + tm = localtime(&now); + + while (env && *env) { + if ((ret = av_opt_get_key_value(&env, "=", ":", 0, &key, &val)) < 0) { + if (count) + av_log(NULL, AV_LOG_ERROR, + "Failed to parse FFREPORT environment variable: %s\n", + av_err2str(ret)); + break; + } + if (*env) + env++; + count++; + if (!strcmp(key, "file")) { + av_free(filename_template); + filename_template = val; + val = NULL; + } else { + av_log(NULL, AV_LOG_ERROR, "Unknown key '%s' in FFREPORT\n", key); + } + av_free(val); + av_free(key); + } + + av_bprint_init(&filename, 0, 1); + expand_filename_template(&filename, + av_x_if_null(filename_template, "%p-%t.log"), tm); + av_free(filename_template); + if (!av_bprint_is_complete(&filename)) { + av_log(NULL, AV_LOG_ERROR, "Out of memory building report file name\n"); + return AVERROR(ENOMEM); + } + + report_file = fopen(filename.str, "w"); + if (!report_file) { + av_log(NULL, AV_LOG_ERROR, "Failed to open report \"%s\": %s\n", + filename.str, strerror(errno)); + return AVERROR(errno); + } + av_log_set_callback(log_callback_report); + av_log(NULL, AV_LOG_INFO, + "%s started on %04d-%02d-%02d at %02d:%02d:%02d\n" + "Report written to \"%s\"\n", + program_name, + tm->tm_year + 1900, tm->tm_mon + 1, tm->tm_mday, + tm->tm_hour, tm->tm_min, tm->tm_sec, + filename.str); + av_log_set_level(FFMAX(av_log_get_level(), AV_LOG_VERBOSE)); + av_bprint_finalize(&filename, NULL); + return 0; +} + +int opt_report(const char *opt) +{ + return init_report(NULL); +} + +int opt_max_alloc(void *optctx, const char *opt, const char *arg) +{ + char *tail; + size_t max; + + max = strtol(arg, &tail, 10); + if (*tail) { + av_log(NULL, AV_LOG_FATAL, "Invalid max_alloc \"%s\".\n", arg); + exit(1); + } + av_max_alloc(max); + return 0; +} + +int opt_cpuflags(void *optctx, const char *opt, const char *arg) +{ + int ret; + unsigned flags = av_get_cpu_flags(); + + if ((ret = av_parse_cpu_caps(&flags, arg)) < 0) + return ret; + + av_force_cpu_flags(flags); + return 0; +} + +int opt_timelimit(void *optctx, const char *opt, const char *arg) +{ +#if HAVE_SETRLIMIT + int lim = parse_number_or_die(opt, arg, OPT_INT64, 0, INT_MAX); + struct rlimit rl = { lim, lim + 1 }; + if (setrlimit(RLIMIT_CPU, &rl)) + perror("setrlimit"); +#else + av_log(NULL, AV_LOG_WARNING, "-%s not implemented on this OS\n", opt); +#endif + return 0; +} + +void print_error(const char *filename, int err) +{ + char errbuf[128]; + const char *errbuf_ptr = errbuf; + + if (av_strerror(err, errbuf, sizeof(errbuf)) < 0) + errbuf_ptr = strerror(AVUNERROR(err)); + av_log(NULL, AV_LOG_ERROR, "%s: %s\n", filename, errbuf_ptr); +} + +static int warned_cfg = 0; + +#define INDENT 1 +#define SHOW_VERSION 2 +#define SHOW_CONFIG 4 +#define SHOW_COPYRIGHT 8 + +#define PRINT_LIB_INFO(libname, LIBNAME, flags, level) \ + if (CONFIG_##LIBNAME) { \ + const char *indent = flags & INDENT? " " : ""; \ + if (flags & SHOW_VERSION) { \ + unsigned int version = libname##_version(); \ + av_log(NULL, level, \ + "%slib%-11s %2d.%3d.%3d / %2d.%3d.%3d\n", \ + indent, #libname, \ + LIB##LIBNAME##_VERSION_MAJOR, \ + LIB##LIBNAME##_VERSION_MINOR, \ + LIB##LIBNAME##_VERSION_MICRO, \ + version >> 16, version >> 8 & 0xff, version & 0xff); \ + } \ + if (flags & SHOW_CONFIG) { \ + const char *cfg = libname##_configuration(); \ + if (strcmp(FFMPEG_CONFIGURATION, cfg)) { \ + if (!warned_cfg) { \ + av_log(NULL, level, \ + "%sWARNING: library configuration mismatch\n", \ + indent); \ + warned_cfg = 1; \ + } \ + av_log(NULL, level, "%s%-11s configuration: %s\n", \ + indent, #libname, cfg); \ + } \ + } \ + } \ + +static void print_all_libs_info(int flags, int level) +{ + PRINT_LIB_INFO(avutil, AVUTIL, flags, level); + PRINT_LIB_INFO(avcodec, AVCODEC, flags, level); + PRINT_LIB_INFO(avformat, AVFORMAT, flags, level); + PRINT_LIB_INFO(avdevice, AVDEVICE, flags, level); + PRINT_LIB_INFO(avfilter, AVFILTER, flags, level); +// PRINT_LIB_INFO(avresample, AVRESAMPLE, flags, level); + PRINT_LIB_INFO(swscale, SWSCALE, flags, level); + PRINT_LIB_INFO(swresample,SWRESAMPLE, flags, level); +#if CONFIG_POSTPROC + PRINT_LIB_INFO(postproc, POSTPROC, flags, level); +#endif +} + +static void print_program_info(int flags, int level) +{ + const char *indent = flags & INDENT? " " : ""; + + av_log(NULL, level, "%s version " FFMPEG_VERSION, program_name); + if (flags & SHOW_COPYRIGHT) + av_log(NULL, level, " Copyright (c) %d-%d the FFmpeg developers", + program_birth_year, this_year); + av_log(NULL, level, "\n"); + av_log(NULL, level, "%sbuilt on %s %s with %s\n", + indent, __DATE__, __TIME__, CC_IDENT); + + av_log(NULL, level, "%sconfiguration: " FFMPEG_CONFIGURATION "\n", indent); +} + +void show_banner(int argc, char **argv, const OptionDef *options) +{ + int idx = locate_option(argc, argv, options, "version"); + if (idx) + return; + + print_program_info (INDENT|SHOW_COPYRIGHT, AV_LOG_INFO); + print_all_libs_info(INDENT|SHOW_CONFIG, AV_LOG_INFO); + print_all_libs_info(INDENT|SHOW_VERSION, AV_LOG_INFO); +} + +int show_version(void *optctx, const char *opt, const char *arg) +{ + av_log_set_callback(log_callback_help); + print_program_info (0 , AV_LOG_INFO); + print_all_libs_info(SHOW_VERSION, AV_LOG_INFO); + + return 0; +} + +int show_license(void *optctx, const char *opt, const char *arg) +{ +#if CONFIG_NONFREE + printf( + "This version of %s has nonfree parts compiled in.\n" + "Therefore it is not legally redistributable.\n", + program_name ); +#elif CONFIG_GPLV3 + printf( + "%s is free software; you can redistribute it and/or modify\n" + "it under the terms of the GNU General Public License as published by\n" + "the Free Software Foundation; either version 3 of the License, or\n" + "(at your option) any later version.\n" + "\n" + "%s is distributed in the hope that it will be useful,\n" + "but WITHOUT ANY WARRANTY; without even the implied warranty of\n" + "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n" + "GNU General Public License for more details.\n" + "\n" + "You should have received a copy of the GNU General Public License\n" + "along with %s. If not, see .\n", + program_name, program_name, program_name ); +#elif CONFIG_GPL + printf( + "%s is free software; you can redistribute it and/or modify\n" + "it under the terms of the GNU General Public License as published by\n" + "the Free Software Foundation; either version 2 of the License, or\n" + "(at your option) any later version.\n" + "\n" + "%s is distributed in the hope that it will be useful,\n" + "but WITHOUT ANY WARRANTY; without even the implied warranty of\n" + "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n" + "GNU General Public License for more details.\n" + "\n" + "You should have received a copy of the GNU General Public License\n" + "along with %s; if not, write to the Free Software\n" + "Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n", + program_name, program_name, program_name ); +#elif CONFIG_LGPLV3 + printf( + "%s is free software; you can redistribute it and/or modify\n" + "it under the terms of the GNU Lesser General Public License as published by\n" + "the Free Software Foundation; either version 3 of the License, or\n" + "(at your option) any later version.\n" + "\n" + "%s is distributed in the hope that it will be useful,\n" + "but WITHOUT ANY WARRANTY; without even the implied warranty of\n" + "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n" + "GNU Lesser General Public License for more details.\n" + "\n" + "You should have received a copy of the GNU Lesser General Public License\n" + "along with %s. If not, see .\n", + program_name, program_name, program_name ); +#else + printf( + "%s is free software; you can redistribute it and/or\n" + "modify it under the terms of the GNU Lesser General Public\n" + "License as published by the Free Software Foundation; either\n" + "version 2.1 of the License, or (at your option) any later version.\n" + "\n" + "%s is distributed in the hope that it will be useful,\n" + "but WITHOUT ANY WARRANTY; without even the implied warranty of\n" + "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n" + "Lesser General Public License for more details.\n" + "\n" + "You should have received a copy of the GNU Lesser General Public\n" + "License along with %s; if not, write to the Free Software\n" + "Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n", + program_name, program_name, program_name ); +#endif + + return 0; +} + +int show_formats(void *optctx, const char *opt, const char *arg) +{ + AVInputFormat *ifmt = NULL; + AVOutputFormat *ofmt = NULL; + const char *last_name; + + printf("File formats:\n" + " D. = Demuxing supported\n" + " .E = Muxing supported\n" + " --\n"); + last_name = "000"; + for (;;) { + int decode = 0; + int encode = 0; + const char *name = NULL; + const char *long_name = NULL; + + while ((ofmt = av_oformat_next(ofmt))) { + if ((name == NULL || strcmp(ofmt->name, name) < 0) && + strcmp(ofmt->name, last_name) > 0) { + name = ofmt->name; + long_name = ofmt->long_name; + encode = 1; + } + } + while ((ifmt = av_iformat_next(ifmt))) { + if ((name == NULL || strcmp(ifmt->name, name) < 0) && + strcmp(ifmt->name, last_name) > 0) { + name = ifmt->name; + long_name = ifmt->long_name; + encode = 0; + } + if (name && strcmp(ifmt->name, name) == 0) + decode = 1; + } + if (name == NULL) + break; + last_name = name; + + printf(" %s%s %-15s %s\n", + decode ? "D" : " ", + encode ? "E" : " ", + name, + long_name ? long_name:" "); + } + return 0; +} + +#define PRINT_CODEC_SUPPORTED(codec, field, type, list_name, term, get_name) \ + if (codec->field) { \ + const type *p = codec->field; \ + \ + printf(" Supported " list_name ":"); \ + while (*p != term) { \ + get_name(*p); \ + printf(" %s", name); \ + p++; \ + } \ + printf("\n"); \ + } \ + +static void print_codec(const AVCodec *c) +{ + int encoder = av_codec_is_encoder(c); + + printf("%s %s [%s]:\n", encoder ? "Encoder" : "Decoder", c->name, + c->long_name ? c->long_name : ""); + + if (c->type == AVMEDIA_TYPE_VIDEO) { + printf(" Threading capabilities: "); + switch (c->capabilities & (CODEC_CAP_FRAME_THREADS | + CODEC_CAP_SLICE_THREADS)) { + case CODEC_CAP_FRAME_THREADS | + CODEC_CAP_SLICE_THREADS: printf("frame and slice"); break; + case CODEC_CAP_FRAME_THREADS: printf("frame"); break; + case CODEC_CAP_SLICE_THREADS: printf("slice"); break; + default: printf("no"); break; + } + printf("\n"); + } + + if (c->supported_framerates) { + const AVRational *fps = c->supported_framerates; + + printf(" Supported framerates:"); + while (fps->num) { + printf(" %d/%d", fps->num, fps->den); + fps++; + } + printf("\n"); + } + PRINT_CODEC_SUPPORTED(c, pix_fmts, enum AVPixelFormat, "pixel formats", + AV_PIX_FMT_NONE, GET_PIX_FMT_NAME); + PRINT_CODEC_SUPPORTED(c, supported_samplerates, int, "sample rates", 0, + GET_SAMPLE_RATE_NAME); + PRINT_CODEC_SUPPORTED(c, sample_fmts, enum AVSampleFormat, "sample formats", + AV_SAMPLE_FMT_NONE, GET_SAMPLE_FMT_NAME); + PRINT_CODEC_SUPPORTED(c, channel_layouts, uint64_t, "channel layouts", + 0, GET_CH_LAYOUT_DESC); + + if (c->priv_class) { + show_help_children(c->priv_class, + AV_OPT_FLAG_ENCODING_PARAM | + AV_OPT_FLAG_DECODING_PARAM); + } +} + +static char get_media_type_char(enum AVMediaType type) +{ + switch (type) { + case AVMEDIA_TYPE_VIDEO: return 'V'; + case AVMEDIA_TYPE_AUDIO: return 'A'; + case AVMEDIA_TYPE_DATA: return 'D'; + case AVMEDIA_TYPE_SUBTITLE: return 'S'; + case AVMEDIA_TYPE_ATTACHMENT:return 'T'; + default: return '?'; + } +} + +static const AVCodec *next_codec_for_id(enum AVCodecID id, const AVCodec *prev, + int encoder) +{ + while ((prev = av_codec_next(prev))) { + if (prev->id == id && + (encoder ? av_codec_is_encoder(prev) : av_codec_is_decoder(prev))) + return prev; + } + return NULL; +} + +static int compare_codec_desc(const void *a, const void *b) +{ + const AVCodecDescriptor * const *da = a; + const AVCodecDescriptor * const *db = b; + + return (*da)->type != (*db)->type ? (*da)->type - (*db)->type : + strcmp((*da)->name, (*db)->name); +} + +static unsigned get_codecs_sorted(const AVCodecDescriptor ***rcodecs) +{ + const AVCodecDescriptor *desc = NULL; + const AVCodecDescriptor **codecs; + unsigned nb_codecs = 0, i = 0; + + while ((desc = avcodec_descriptor_next(desc))) + nb_codecs++; + if (!(codecs = av_calloc(nb_codecs, sizeof(*codecs)))) { + av_log(NULL, AV_LOG_ERROR, "Out of memory\n"); + exit(1); + } + desc = NULL; + while ((desc = avcodec_descriptor_next(desc))) + codecs[i++] = desc; + av_assert0(i == nb_codecs); + qsort(codecs, nb_codecs, sizeof(*codecs), compare_codec_desc); + *rcodecs = codecs; + return nb_codecs; +} + +static void print_codecs_for_id(enum AVCodecID id, int encoder) +{ + const AVCodec *codec = NULL; + + printf(" (%s: ", encoder ? "encoders" : "decoders"); + + while ((codec = next_codec_for_id(id, codec, encoder))) + printf("%s ", codec->name); + + printf(")"); +} + +int show_codecs(void *optctx, const char *opt, const char *arg) +{ + const AVCodecDescriptor **codecs; + unsigned i, nb_codecs = get_codecs_sorted(&codecs); + + printf("Codecs:\n" + " D..... = Decoding supported\n" + " .E.... = Encoding supported\n" + " ..V... = Video codec\n" + " ..A... = Audio codec\n" + " ..S... = Subtitle codec\n" + " ...I.. = Intra frame-only codec\n" + " ....L. = Lossy compression\n" + " .....S = Lossless compression\n" + " -------\n"); + for (i = 0; i < nb_codecs; i++) { + const AVCodecDescriptor *desc = codecs[i]; + const AVCodec *codec = NULL; + + printf(" "); + printf(avcodec_find_decoder(desc->id) ? "D" : "."); + printf(avcodec_find_encoder(desc->id) ? "E" : "."); + + printf("%c", get_media_type_char(desc->type)); + printf((desc->props & AV_CODEC_PROP_INTRA_ONLY) ? "I" : "."); + printf((desc->props & AV_CODEC_PROP_LOSSY) ? "L" : "."); + printf((desc->props & AV_CODEC_PROP_LOSSLESS) ? "S" : "."); + + printf(" %-20s %s", desc->name, desc->long_name ? desc->long_name : ""); + + /* print decoders/encoders when there's more than one or their + * names are different from codec name */ + while ((codec = next_codec_for_id(desc->id, codec, 0))) { + if (strcmp(codec->name, desc->name)) { + print_codecs_for_id(desc->id, 0); + break; + } + } + codec = NULL; + while ((codec = next_codec_for_id(desc->id, codec, 1))) { + if (strcmp(codec->name, desc->name)) { + print_codecs_for_id(desc->id, 1); + break; + } + } + + printf("\n"); + } + av_free(codecs); + return 0; +} + +static void print_codecs(int encoder) +{ + const AVCodecDescriptor **codecs; + unsigned i, nb_codecs = get_codecs_sorted(&codecs); + + printf("%s:\n" + " V..... = Video\n" + " A..... = Audio\n" + " S..... = Subtitle\n" + " .F.... = Frame-level multithreading\n" + " ..S... = Slice-level multithreading\n" + " ...X.. = Codec is experimental\n" + " ....B. = Supports draw_horiz_band\n" + " .....D = Supports direct rendering method 1\n" + " ------\n", + encoder ? "Encoders" : "Decoders"); + for (i = 0; i < nb_codecs; i++) { + const AVCodecDescriptor *desc = codecs[i]; + const AVCodec *codec = NULL; + + while ((codec = next_codec_for_id(desc->id, codec, encoder))) { + printf(" %c", get_media_type_char(desc->type)); + printf((codec->capabilities & CODEC_CAP_FRAME_THREADS) ? "F" : "."); + printf((codec->capabilities & CODEC_CAP_SLICE_THREADS) ? "S" : "."); + printf((codec->capabilities & CODEC_CAP_EXPERIMENTAL) ? "X" : "."); + printf((codec->capabilities & CODEC_CAP_DRAW_HORIZ_BAND)?"B" : "."); + printf((codec->capabilities & CODEC_CAP_DR1) ? "D" : "."); + + printf(" %-20s %s", codec->name, codec->long_name ? codec->long_name : ""); + if (strcmp(codec->name, desc->name)) + printf(" (codec %s)", desc->name); + + printf("\n"); + } + } + av_free(codecs); +} + +int show_decoders(void *optctx, const char *opt, const char *arg) +{ + print_codecs(0); + return 0; +} + +int show_encoders(void *optctx, const char *opt, const char *arg) +{ + print_codecs(1); + return 0; +} + +int show_bsfs(void *optctx, const char *opt, const char *arg) +{ + AVBitStreamFilter *bsf = NULL; + + printf("Bitstream filters:\n"); + while ((bsf = av_bitstream_filter_next(bsf))) + printf("%s\n", bsf->name); + printf("\n"); + return 0; +} + +int show_protocols(void *optctx, const char *opt, const char *arg) +{ + void *opaque = NULL; + const char *name; + + printf("Supported file protocols:\n" + "Input:\n"); + while ((name = avio_enum_protocols(&opaque, 0))) + printf("%s\n", name); + printf("Output:\n"); + while ((name = avio_enum_protocols(&opaque, 1))) + printf("%s\n", name); + return 0; +} + +int show_filters(void *optctx, const char *opt, const char *arg) +{ + AVFilter av_unused(**filter) = NULL; + char descr[64], *descr_cur; + int i, j; + const AVFilterPad *pad; + + printf("Filters:\n"); +#if CONFIG_AVFILTER + while ((filter = av_filter_next(filter)) && *filter) { + descr_cur = descr; + for (i = 0; i < 2; i++) { + if (i) { + *(descr_cur++) = '-'; + *(descr_cur++) = '>'; + } + pad = i ? (*filter)->outputs : (*filter)->inputs; + for (j = 0; pad && pad[j].name; j++) { + if (descr_cur >= descr + sizeof(descr) - 4) + break; + *(descr_cur++) = get_media_type_char(pad[j].type); + } + if (!j) + *(descr_cur++) = '|'; + } + *descr_cur = 0; + printf("%-16s %-10s %s\n", (*filter)->name, descr, (*filter)->description); + } +#endif + return 0; +} + +int show_pix_fmts(void *optctx, const char *opt, const char *arg) +{ + const AVPixFmtDescriptor *pix_desc = NULL; + + printf("Pixel formats:\n" + "I.... = Supported Input format for conversion\n" + ".O... = Supported Output format for conversion\n" + "..H.. = Hardware accelerated format\n" + "...P. = Paletted format\n" + "....B = Bitstream format\n" + "FLAGS NAME NB_COMPONENTS BITS_PER_PIXEL\n" + "-----\n"); + +#if !CONFIG_SWSCALE +# define sws_isSupportedInput(x) 0 +# define sws_isSupportedOutput(x) 0 +#endif + + while ((pix_desc = av_pix_fmt_desc_next(pix_desc))) { + enum AVPixelFormat pix_fmt = av_pix_fmt_desc_get_id(pix_desc); + printf("%c%c%c%c%c %-16s %d %2d\n", + sws_isSupportedInput (pix_fmt) ? 'I' : '.', + sws_isSupportedOutput(pix_fmt) ? 'O' : '.', + pix_desc->flags & PIX_FMT_HWACCEL ? 'H' : '.', + pix_desc->flags & PIX_FMT_PAL ? 'P' : '.', + pix_desc->flags & PIX_FMT_BITSTREAM ? 'B' : '.', + pix_desc->name, + pix_desc->nb_components, + av_get_bits_per_pixel(pix_desc)); + } + return 0; +} + +int show_layouts(void *optctx, const char *opt, const char *arg) +{ + int i = 0; + uint64_t layout, j; + const char *name, *descr; + + printf("Individual channels:\n" + "NAME DESCRIPTION\n"); + for (i = 0; i < 63; i++) { + name = av_get_channel_name((uint64_t)1 << i); + if (!name) + continue; + descr = av_get_channel_description((uint64_t)1 << i); + printf("%-12s%s\n", name, descr); + } + printf("\nStandard channel layouts:\n" + "NAME DECOMPOSITION\n"); + for (i = 0; !av_get_standard_channel_layout(i, &layout, &name); i++) { + if (name) { + printf("%-12s", name); + for (j = 1; j; j <<= 1) + if ((layout & j)) + printf("%s%s", (layout & (j - 1)) ? "+" : "", av_get_channel_name(j)); + printf("\n"); + } + } + return 0; +} + +int show_sample_fmts(void *optctx, const char *opt, const char *arg) +{ + int i; + char fmt_str[128]; + for (i = -1; i < AV_SAMPLE_FMT_NB; i++) + printf("%s\n", av_get_sample_fmt_string(fmt_str, sizeof(fmt_str), i)); + return 0; +} + +static void show_help_codec(const char *name, int encoder) +{ + const AVCodecDescriptor *desc; + const AVCodec *codec; + + if (!name) { + av_log(NULL, AV_LOG_ERROR, "No codec name specified.\n"); + return; + } + + codec = encoder ? avcodec_find_encoder_by_name(name) : + avcodec_find_decoder_by_name(name); + + if (codec) + print_codec(codec); + else if ((desc = avcodec_descriptor_get_by_name(name))) { + int printed = 0; + + while ((codec = next_codec_for_id(desc->id, codec, encoder))) { + printed = 1; + print_codec(codec); + } + + if (!printed) { + av_log(NULL, AV_LOG_ERROR, "Codec '%s' is known to FFmpeg, " + "but no %s for it are available. FFmpeg might need to be " + "recompiled with additional external libraries.\n", + name, encoder ? "encoders" : "decoders"); + } + } else { + av_log(NULL, AV_LOG_ERROR, "Codec '%s' is not recognized by FFmpeg.\n", + name); + } +} + +static void show_help_demuxer(const char *name) +{ + const AVInputFormat *fmt = av_find_input_format(name); + + if (!fmt) { + av_log(NULL, AV_LOG_ERROR, "Unknown format '%s'.\n", name); + return; + } + + printf("Demuxer %s [%s]:\n", fmt->name, fmt->long_name); + + if (fmt->extensions) + printf(" Common extensions: %s.\n", fmt->extensions); + + if (fmt->priv_class) + show_help_children(fmt->priv_class, AV_OPT_FLAG_DECODING_PARAM); +} + +static void show_help_muxer(const char *name) +{ + const AVCodecDescriptor *desc; + const AVOutputFormat *fmt = av_guess_format(name, NULL, NULL); + + if (!fmt) { + av_log(NULL, AV_LOG_ERROR, "Unknown format '%s'.\n", name); + return; + } + + printf("Muxer %s [%s]:\n", fmt->name, fmt->long_name); + + if (fmt->extensions) + printf(" Common extensions: %s.\n", fmt->extensions); + if (fmt->mime_type) + printf(" Mime type: %s.\n", fmt->mime_type); + if (fmt->video_codec != AV_CODEC_ID_NONE && + (desc = avcodec_descriptor_get(fmt->video_codec))) { + printf(" Default video codec: %s.\n", desc->name); + } + if (fmt->audio_codec != AV_CODEC_ID_NONE && + (desc = avcodec_descriptor_get(fmt->audio_codec))) { + printf(" Default audio codec: %s.\n", desc->name); + } + if (fmt->subtitle_codec != AV_CODEC_ID_NONE && + (desc = avcodec_descriptor_get(fmt->subtitle_codec))) { + printf(" Default subtitle codec: %s.\n", desc->name); + } + + if (fmt->priv_class) + show_help_children(fmt->priv_class, AV_OPT_FLAG_ENCODING_PARAM); +} + +int show_help(void *optctx, const char *opt, const char *arg) +{ + char *topic, *par; + av_log_set_callback(log_callback_help); + + topic = av_strdup(arg ? arg : ""); + par = strchr(topic, '='); + if (par) + *par++ = 0; + + if (!*topic) { + show_help_default(topic, par); + } else if (!strcmp(topic, "decoder")) { + show_help_codec(par, 0); + } else if (!strcmp(topic, "encoder")) { + show_help_codec(par, 1); + } else if (!strcmp(topic, "demuxer")) { + show_help_demuxer(par); + } else if (!strcmp(topic, "muxer")) { + show_help_muxer(par); + } else { + show_help_default(topic, par); + } + + av_freep(&topic); + return 0; +} + +int read_yesno(void) +{ + int c = getchar(); + int yesno = (toupper(c) == 'Y'); + + while (c != '\n' && c != EOF) + c = getchar(); + + return yesno; +} + +int cmdutils_read_file(const char *filename, char **bufptr, size_t *size) +{ + int ret; + FILE *f = fopen(filename, "rb"); + + if (!f) { + av_log(NULL, AV_LOG_ERROR, "Cannot read file '%s': %s\n", filename, + strerror(errno)); + return AVERROR(errno); + } + fseek(f, 0, SEEK_END); + *size = ftell(f); + fseek(f, 0, SEEK_SET); + if (*size == (size_t)-1) { + av_log(NULL, AV_LOG_ERROR, "IO error: %s\n", strerror(errno)); + fclose(f); + return AVERROR(errno); + } + *bufptr = av_malloc(*size + 1); + if (!*bufptr) { + av_log(NULL, AV_LOG_ERROR, "Could not allocate file buffer\n"); + fclose(f); + return AVERROR(ENOMEM); + } + ret = fread(*bufptr, 1, *size, f); + if (ret < *size) { + av_free(*bufptr); + if (ferror(f)) { + av_log(NULL, AV_LOG_ERROR, "Error while reading file '%s': %s\n", + filename, strerror(errno)); + ret = AVERROR(errno); + } else + ret = AVERROR_EOF; + } else { + ret = 0; + (*bufptr)[(*size)++] = '\0'; + } + + fclose(f); + return ret; +} + +FILE *get_preset_file(char *filename, size_t filename_size, + const char *preset_name, int is_path, + const char *codec_name) +{ + FILE *f = NULL; + int i; + const char *base[3] = { getenv("FFMPEG_DATADIR"), + getenv("HOME"), + FFMPEG_DATADIR, }; + + if (is_path) { + av_strlcpy(filename, preset_name, filename_size); + f = fopen(filename, "r"); + } else { +#ifdef _WIN32 + char datadir[MAX_PATH], *ls; + base[2] = NULL; + + if (GetModuleFileNameA(GetModuleHandleA(NULL), datadir, sizeof(datadir) - 1)) + { + for (ls = datadir; ls < datadir + strlen(datadir); ls++) + if (*ls == '\\') *ls = '/'; + + if (ls = strrchr(datadir, '/')) + { + *ls = 0; + strncat(datadir, "/ffpresets", sizeof(datadir) - 1 - strlen(datadir)); + base[2] = datadir; + } + } +#endif + for (i = 0; i < 3 && !f; i++) { + if (!base[i]) + continue; + snprintf(filename, filename_size, "%s%s/%s.ffpreset", base[i], + i != 1 ? "" : "/.ffmpeg", preset_name); + f = fopen(filename, "r"); + if (!f && codec_name) { + snprintf(filename, filename_size, + "%s%s/%s-%s.ffpreset", + base[i], i != 1 ? "" : "/.ffmpeg", codec_name, + preset_name); + f = fopen(filename, "r"); + } + } + } + + return f; +} + +int check_stream_specifier(AVFormatContext *s, AVStream *st, const char *spec) +{ + int ret = avformat_match_stream_specifier(s, st, spec); + if (ret < 0) + av_log(s, AV_LOG_ERROR, "Invalid stream specifier: %s.\n", spec); + return ret; +} + +AVDictionary *filter_codec_opts(AVDictionary *opts, enum AVCodecID codec_id, + AVFormatContext *s, AVStream *st, AVCodec *codec) +{ + AVDictionary *ret = NULL; + AVDictionaryEntry *t = NULL; + int flags = s->oformat ? AV_OPT_FLAG_ENCODING_PARAM + : AV_OPT_FLAG_DECODING_PARAM; + char prefix = 0; + const AVClass *cc = avcodec_get_class(); + + if (!codec) + codec = s->oformat ? avcodec_find_encoder(codec_id) + : avcodec_find_decoder(codec_id); + if (!codec) + return NULL; + + switch (codec->type) { + case AVMEDIA_TYPE_VIDEO: + prefix = 'v'; + flags |= AV_OPT_FLAG_VIDEO_PARAM; + break; + case AVMEDIA_TYPE_AUDIO: + prefix = 'a'; + flags |= AV_OPT_FLAG_AUDIO_PARAM; + break; + case AVMEDIA_TYPE_SUBTITLE: + prefix = 's'; + flags |= AV_OPT_FLAG_SUBTITLE_PARAM; + break; + } + + while (t = av_dict_get(opts, "", t, AV_DICT_IGNORE_SUFFIX)) { + char *p = strchr(t->key, ':'); + + /* check stream specification in opt name */ + if (p) + switch (check_stream_specifier(s, st, p + 1)) { + case 1: *p = 0; break; + case 0: continue; + default: return NULL; + } + + if (av_opt_find(&cc, t->key, NULL, flags, AV_OPT_SEARCH_FAKE_OBJ) || + (codec && codec->priv_class && + av_opt_find(&codec->priv_class, t->key, NULL, flags, + AV_OPT_SEARCH_FAKE_OBJ))) + av_dict_set(&ret, t->key, t->value, 0); + else if (t->key[0] == prefix && + av_opt_find(&cc, t->key + 1, NULL, flags, + AV_OPT_SEARCH_FAKE_OBJ)) + av_dict_set(&ret, t->key + 1, t->value, 0); + + if (p) + *p = ':'; + } + return ret; +} + +AVDictionary **setup_find_stream_info_opts(AVFormatContext *s, + AVDictionary *codec_opts) +{ + int i; + AVDictionary **opts; + + if (!s->nb_streams) + return NULL; + opts = av_mallocz(s->nb_streams * sizeof(*opts)); + if (!opts) { + av_log(NULL, AV_LOG_ERROR, + "Could not alloc memory for stream options.\n"); + return NULL; + } + for (i = 0; i < s->nb_streams; i++) + opts[i] = filter_codec_opts(codec_opts, s->streams[i]->codec->codec_id, + s, s->streams[i], NULL); + return opts; +} + +void *grow_array(void *array, int elem_size, int *size, int new_size) +{ + if (new_size >= INT_MAX / elem_size) { + av_log(NULL, AV_LOG_ERROR, "Array too big.\n"); + exit(1); + } + if (*size < new_size) { + uint8_t *tmp = av_realloc(array, new_size*elem_size); + if (!tmp) { + av_log(NULL, AV_LOG_ERROR, "Could not alloc buffer.\n"); + exit(1); + } + memset(tmp + *size*elem_size, 0, (new_size-*size) * elem_size); + *size = new_size; + return tmp; + } + return array; +} + +static int alloc_buffer(FrameBuffer **pool, AVCodecContext *s, FrameBuffer **pbuf) +{ + const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(s->pix_fmt); + FrameBuffer *buf; + int i, ret; + int pixel_size; + int h_chroma_shift, v_chroma_shift; + int edge = 32; // XXX should be avcodec_get_edge_width(), but that fails on svq1 + int w = s->width, h = s->height; + + if (!desc) + return AVERROR(EINVAL); + pixel_size = desc->comp[0].step_minus1 + 1; + + buf = av_mallocz(sizeof(*buf)); + if (!buf) + return AVERROR(ENOMEM); + + avcodec_align_dimensions(s, &w, &h); + + if (!(s->flags & CODEC_FLAG_EMU_EDGE)) { + w += 2*edge; + h += 2*edge; + } + + if ((ret = av_image_alloc(buf->base, buf->linesize, w, h, + s->pix_fmt, 32)) < 0) { + av_freep(&buf); + av_log(s, AV_LOG_ERROR, "alloc_buffer: av_image_alloc() failed\n"); + return ret; + } + /* XXX this shouldn't be needed, but some tests break without this line + * those decoders are buggy and need to be fixed. + * the following tests fail: + * cdgraphics, ansi, aasc, fraps-v1, qtrle-1bit + */ + memset(buf->base[0], 128, ret); + + avcodec_get_chroma_sub_sample(s->pix_fmt, &h_chroma_shift, &v_chroma_shift); + for (i = 0; i < FF_ARRAY_ELEMS(buf->data); i++) { + const int h_shift = i==0 ? 0 : h_chroma_shift; + const int v_shift = i==0 ? 0 : v_chroma_shift; + if ((s->flags & CODEC_FLAG_EMU_EDGE) || !buf->linesize[i] || !buf->base[i]) + buf->data[i] = buf->base[i]; + else + buf->data[i] = buf->base[i] + + FFALIGN((buf->linesize[i]*edge >> v_shift) + + (pixel_size*edge >> h_shift), 32); + } + buf->w = s->width; + buf->h = s->height; + buf->pix_fmt = s->pix_fmt; + buf->pool = pool; + + *pbuf = buf; + return 0; +} + +int codec_get_buffer(AVCodecContext *s, AVFrame *frame) +{ + FrameBuffer **pool = s->opaque; + FrameBuffer *buf; + int ret, i; + + if(av_image_check_size(s->width, s->height, 0, s) || s->pix_fmt<0) { + av_log(s, AV_LOG_ERROR, "codec_get_buffer: image parameters invalid\n"); + return -1; + } + + if (!*pool && (ret = alloc_buffer(pool, s, pool)) < 0) + return ret; + + buf = *pool; + *pool = buf->next; + buf->next = NULL; + if (buf->w != s->width || buf->h != s->height || buf->pix_fmt != s->pix_fmt) { + av_freep(&buf->base[0]); + av_free(buf); + if ((ret = alloc_buffer(pool, s, &buf)) < 0) + return ret; + } + av_assert0(!buf->refcount); + buf->refcount++; + + frame->opaque = buf; + frame->type = FF_BUFFER_TYPE_USER; + frame->extended_data = frame->data; + + for (i = 0; i < FF_ARRAY_ELEMS(buf->data); i++) { + frame->base[i] = buf->base[i]; // XXX h264.c uses base though it shouldn't + frame->data[i] = buf->data[i]; + frame->linesize[i] = buf->linesize[i]; + } + + return 0; +} + +static void unref_buffer(FrameBuffer *buf) +{ + FrameBuffer **pool = buf->pool; + + av_assert0(buf->refcount > 0); + buf->refcount--; + if (!buf->refcount) { + FrameBuffer *tmp; + for(tmp= *pool; tmp; tmp= tmp->next) + av_assert1(tmp != buf); + + buf->next = *pool; + *pool = buf; + } +} + +void codec_release_buffer(AVCodecContext *s, AVFrame *frame) +{ + FrameBuffer *buf = frame->opaque; + int i; + + if(frame->type!=FF_BUFFER_TYPE_USER) { + avcodec_default_release_buffer(s, frame); + return; + } + + for (i = 0; i < FF_ARRAY_ELEMS(frame->data); i++) + frame->data[i] = NULL; + + unref_buffer(buf); +} + +void filter_release_buffer(AVFilterBuffer *fb) +{ + FrameBuffer *buf = fb->priv; + av_free(fb); + unref_buffer(buf); +} + +void free_buffer_pool(FrameBuffer **pool) +{ + FrameBuffer *buf = *pool; + while (buf) { + *pool = buf->next; + av_freep(&buf->base[0]); + av_free(buf); + buf = *pool; + } +} diff --git a/project/jni/ffmpeg/cmdutils.h b/project/jni/ffmpeg/cmdutils.h new file mode 100644 index 000000000..f193132f0 --- /dev/null +++ b/project/jni/ffmpeg/cmdutils.h @@ -0,0 +1,583 @@ +/* + * Various utilities for command line tools + * copyright (c) 2003 Fabrice Bellard + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef FFMPEG_CMDUTILS_H +#define FFMPEG_CMDUTILS_H + +#include + +#include "libavcodec/avcodec.h" +#include "libavfilter/avfilter.h" +#include "libavformat/avformat.h" +#include "libswscale/swscale.h" + +#ifdef __MINGW32__ +#undef main /* We don't want SDL to override our main() */ +#endif + +/** + * program name, defined by the program for show_version(). + */ +extern const char program_name[]; + +/** + * program birth year, defined by the program for show_banner() + */ +extern const int program_birth_year; + +/** + * this year, defined by the program for show_banner() + */ +extern const int this_year; + +extern AVCodecContext *avcodec_opts[AVMEDIA_TYPE_NB]; +extern AVFormatContext *avformat_opts; +extern struct SwsContext *sws_opts; +extern struct SwrContext *swr_opts; +extern AVDictionary *format_opts, *codec_opts; + +/** + * Initialize the cmdutils option system, in particular + * allocate the *_opts contexts. + */ +void init_opts(void); +/** + * Uninitialize the cmdutils option system, in particular + * free the *_opts contexts and their contents. + */ +void uninit_opts(void); + +/** + * Trivial log callback. + * Only suitable for opt_help and similar since it lacks prefix handling. + */ +void log_callback_help(void* ptr, int level, const char* fmt, va_list vl); + +/** + * Fallback for options that are not explicitly handled, these will be + * parsed through AVOptions. + */ +int opt_default(void *optctx, const char *opt, const char *arg); + +/** + * Set the libav* libraries log level. + */ +int opt_loglevel(void *optctx, const char *opt, const char *arg); + +int opt_report(const char *opt); + +int opt_max_alloc(void *optctx, const char *opt, const char *arg); + +int opt_cpuflags(void *optctx, const char *opt, const char *arg); + +int opt_codec_debug(void *optctx, const char *opt, const char *arg); + +/** + * Limit the execution time. + */ +int opt_timelimit(void *optctx, const char *opt, const char *arg); + +/** + * Parse a string and return its corresponding value as a double. + * Exit from the application if the string cannot be correctly + * parsed or the corresponding value is invalid. + * + * @param context the context of the value to be set (e.g. the + * corresponding command line option name) + * @param numstr the string to be parsed + * @param type the type (OPT_INT64 or OPT_FLOAT) as which the + * string should be parsed + * @param min the minimum valid accepted value + * @param max the maximum valid accepted value + */ +double parse_number_or_die(const char *context, const char *numstr, int type, + double min, double max); + +/** + * Parse a string specifying a time and return its corresponding + * value as a number of microseconds. Exit from the application if + * the string cannot be correctly parsed. + * + * @param context the context of the value to be set (e.g. the + * corresponding command line option name) + * @param timestr the string to be parsed + * @param is_duration a flag which tells how to interpret timestr, if + * not zero timestr is interpreted as a duration, otherwise as a + * date + * + * @see parse_date() + */ +int64_t parse_time_or_die(const char *context, const char *timestr, + int is_duration); + +typedef struct SpecifierOpt { + char *specifier; /**< stream/chapter/program/... specifier */ + union { + uint8_t *str; + int i; + int64_t i64; + float f; + double dbl; + } u; +} SpecifierOpt; + +typedef struct OptionDef { + const char *name; + int flags; +#define HAS_ARG 0x0001 +#define OPT_BOOL 0x0002 +#define OPT_EXPERT 0x0004 +#define OPT_STRING 0x0008 +#define OPT_VIDEO 0x0010 +#define OPT_AUDIO 0x0020 +#define OPT_INT 0x0080 +#define OPT_FLOAT 0x0100 +#define OPT_SUBTITLE 0x0200 +#define OPT_INT64 0x0400 +#define OPT_EXIT 0x0800 +#define OPT_DATA 0x1000 +#define OPT_PERFILE 0x2000 /* the option is per-file (currently ffmpeg-only). + implied by OPT_OFFSET or OPT_SPEC */ +#define OPT_OFFSET 0x4000 /* option is specified as an offset in a passed optctx */ +#define OPT_SPEC 0x8000 /* option is to be stored in an array of SpecifierOpt. + Implies OPT_OFFSET. Next element after the offset is + an int containing element count in the array. */ +#define OPT_TIME 0x10000 +#define OPT_DOUBLE 0x20000 + union { + void *dst_ptr; + int (*func_arg)(void *, const char *, const char *); + size_t off; + } u; + const char *help; + const char *argname; +} OptionDef; + +/** + * Print help for all options matching specified flags. + * + * @param options a list of options + * @param msg title of this group. Only printed if at least one option matches. + * @param req_flags print only options which have all those flags set. + * @param rej_flags don't print options which have any of those flags set. + * @param alt_flags print only options that have at least one of those flags set + */ +void show_help_options(const OptionDef *options, const char *msg, int req_flags, + int rej_flags, int alt_flags); + +/** + * Show help for all options with given flags in class and all its + * children. + */ +void show_help_children(const AVClass *class, int flags); + +/** + * Per-avtool specific help handler. Implemented in each + * avtool, called by show_help(). + */ +void show_help_default(const char *opt, const char *arg); + +/** + * Generic -h handler common to all avtools. + */ +int show_help(void *optctx, const char *opt, const char *arg); + +/** + * Parse the command line arguments. + * + * @param optctx an opaque options context + * @param argc number of command line arguments + * @param argv values of command line arguments + * @param options Array with the definitions required to interpret every + * option of the form: -option_name [argument] + * @param parse_arg_function Name of the function called to process every + * argument without a leading option name flag. NULL if such arguments do + * not have to be processed. + */ +void parse_options(void *optctx, int argc, char **argv, const OptionDef *options, + void (* parse_arg_function)(void *optctx, const char*)); + +/** + * Parse one given option. + * + * @return on success 1 if arg was consumed, 0 otherwise; negative number on error + */ +int parse_option(void *optctx, const char *opt, const char *arg, + const OptionDef *options); + +/** + * An option extracted from the commandline. + * Cannot use AVDictionary because of options like -map which can be + * used multiple times. + */ +typedef struct Option { + const OptionDef *opt; + const char *key; + const char *val; +} Option; + +typedef struct OptionGroupDef { + /**< group name */ + const char *name; + /** + * Option to be used as group separator. Can be NULL for groups which + * are terminated by a non-option argument (e.g. ffmpeg output files) + */ + const char *sep; +} OptionGroupDef; + +typedef struct OptionGroup { + const OptionGroupDef *group_def; + const char *arg; + + Option *opts; + int nb_opts; + + AVDictionary *codec_opts; + AVDictionary *format_opts; + struct SwsContext *sws_opts; + struct SwrContext *swr_opts; +} OptionGroup; + +/** + * A list of option groups that all have the same group type + * (e.g. input files or output files) + */ +typedef struct OptionGroupList { + const OptionGroupDef *group_def; + + OptionGroup *groups; + int nb_groups; +} OptionGroupList; + +typedef struct OptionParseContext { + OptionGroup global_opts; + + OptionGroupList *groups; + int nb_groups; + + /* parsing state */ + OptionGroup cur_group; +} OptionParseContext; + +/** + * Parse an options group and write results into optctx. + * + * @param optctx an app-specific options context. NULL for global options group + */ +int parse_optgroup(void *optctx, OptionGroup *g); + +/** + * Split the commandline into an intermediate form convenient for further + * processing. + * + * The commandline is assumed to be composed of options which either belong to a + * group (those with OPT_SPEC, OPT_OFFSET or OPT_PERFILE) or are global + * (everything else). + * + * A group (defined by an OptionGroupDef struct) is a sequence of options + * terminated by either a group separator option (e.g. -i) or a parameter that + * is not an option (doesn't start with -). A group without a separator option + * must always be first in the supplied groups list. + * + * All options within the same group are stored in one OptionGroup struct in an + * OptionGroupList, all groups with the same group definition are stored in one + * OptionGroupList in OptionParseContext.groups. The order of group lists is the + * same as the order of group definitions. + */ +int split_commandline(OptionParseContext *octx, int argc, char *argv[], + const OptionDef *options, + const OptionGroupDef *groups, int nb_groups); + +/** + * Free all allocated memory in an OptionParseContext. + */ +void uninit_parse_context(OptionParseContext *octx); + +/** + * Find the '-loglevel' option in the command line args and apply it. + */ +void parse_loglevel(int argc, char **argv, const OptionDef *options); + +/** + * Return index of option opt in argv or 0 if not found. + */ +int locate_option(int argc, char **argv, const OptionDef *options, + const char *optname); + +/** + * Check if the given stream matches a stream specifier. + * + * @param s Corresponding format context. + * @param st Stream from s to be checked. + * @param spec A stream specifier of the [v|a|s|d]:[\] form. + * + * @return 1 if the stream matches, 0 if it doesn't, <0 on error + */ +int check_stream_specifier(AVFormatContext *s, AVStream *st, const char *spec); + +/** + * Filter out options for given codec. + * + * Create a new options dictionary containing only the options from + * opts which apply to the codec with ID codec_id. + * + * @param opts dictionary to place options in + * @param codec_id ID of the codec that should be filtered for + * @param s Corresponding format context. + * @param st A stream from s for which the options should be filtered. + * @param codec The particular codec for which the options should be filtered. + * If null, the default one is looked up according to the codec id. + * @return a pointer to the created dictionary + */ +AVDictionary *filter_codec_opts(AVDictionary *opts, enum AVCodecID codec_id, + AVFormatContext *s, AVStream *st, AVCodec *codec); + +/** + * Setup AVCodecContext options for avformat_find_stream_info(). + * + * Create an array of dictionaries, one dictionary for each stream + * contained in s. + * Each dictionary will contain the options from codec_opts which can + * be applied to the corresponding stream codec context. + * + * @return pointer to the created array of dictionaries, NULL if it + * cannot be created + */ +AVDictionary **setup_find_stream_info_opts(AVFormatContext *s, + AVDictionary *codec_opts); + +/** + * Print an error message to stderr, indicating filename and a human + * readable description of the error code err. + * + * If strerror_r() is not available the use of this function in a + * multithreaded application may be unsafe. + * + * @see av_strerror() + */ +void print_error(const char *filename, int err); + +/** + * Print the program banner to stderr. The banner contents depend on the + * current version of the repository and of the libav* libraries used by + * the program. + */ +void show_banner(int argc, char **argv, const OptionDef *options); + +/** + * Print the version of the program to stdout. The version message + * depends on the current versions of the repository and of the libav* + * libraries. + * This option processing function does not utilize the arguments. + */ +int show_version(void *optctx, const char *opt, const char *arg); + +/** + * Print the license of the program to stdout. The license depends on + * the license of the libraries compiled into the program. + * This option processing function does not utilize the arguments. + */ +int show_license(void *optctx, const char *opt, const char *arg); + +/** + * Print a listing containing all the formats supported by the + * program. + * This option processing function does not utilize the arguments. + */ +int show_formats(void *optctx, const char *opt, const char *arg); + +/** + * Print a listing containing all the codecs supported by the + * program. + * This option processing function does not utilize the arguments. + */ +int show_codecs(void *optctx, const char *opt, const char *arg); + +/** + * Print a listing containing all the decoders supported by the + * program. + */ +int show_decoders(void *optctx, const char *opt, const char *arg); + +/** + * Print a listing containing all the encoders supported by the + * program. + */ +int show_encoders(void *optctx, const char *opt, const char *arg); + +/** + * Print a listing containing all the filters supported by the + * program. + * This option processing function does not utilize the arguments. + */ +int show_filters(void *optctx, const char *opt, const char *arg); + +/** + * Print a listing containing all the bit stream filters supported by the + * program. + * This option processing function does not utilize the arguments. + */ +int show_bsfs(void *optctx, const char *opt, const char *arg); + +/** + * Print a listing containing all the protocols supported by the + * program. + * This option processing function does not utilize the arguments. + */ +int show_protocols(void *optctx, const char *opt, const char *arg); + +/** + * Print a listing containing all the pixel formats supported by the + * program. + * This option processing function does not utilize the arguments. + */ +int show_pix_fmts(void *optctx, const char *opt, const char *arg); + +/** + * Print a listing containing all the standard channel layouts supported by + * the program. + * This option processing function does not utilize the arguments. + */ +int show_layouts(void *optctx, const char *opt, const char *arg); + +/** + * Print a listing containing all the sample formats supported by the + * program. + */ +int show_sample_fmts(void *optctx, const char *opt, const char *arg); + +/** + * Return a positive value if a line read from standard input + * starts with [yY], otherwise return 0. + */ +int read_yesno(void); + +/** + * Read the file with name filename, and put its content in a newly + * allocated 0-terminated buffer. + * + * @param filename file to read from + * @param bufptr location where pointer to buffer is returned + * @param size location where size of buffer is returned + * @return 0 in case of success, a negative value corresponding to an + * AVERROR error code in case of failure. + */ +int cmdutils_read_file(const char *filename, char **bufptr, size_t *size); + +/** + * Get a file corresponding to a preset file. + * + * If is_path is non-zero, look for the file in the path preset_name. + * Otherwise search for a file named arg.ffpreset in the directories + * $FFMPEG_DATADIR (if set), $HOME/.ffmpeg, and in the datadir defined + * at configuration time or in a "ffpresets" folder along the executable + * on win32, in that order. If no such file is found and + * codec_name is defined, then search for a file named + * codec_name-preset_name.avpreset in the above-mentioned directories. + * + * @param filename buffer where the name of the found filename is written + * @param filename_size size in bytes of the filename buffer + * @param preset_name name of the preset to search + * @param is_path tell if preset_name is a filename path + * @param codec_name name of the codec for which to look for the + * preset, may be NULL + */ +FILE *get_preset_file(char *filename, size_t filename_size, + const char *preset_name, int is_path, const char *codec_name); + +/** + * Realloc array to hold new_size elements of elem_size. + * Calls exit() on failure. + * + * @param array array to reallocate + * @param elem_size size in bytes of each element + * @param size new element count will be written here + * @param new_size number of elements to place in reallocated array + * @return reallocated array + */ +void *grow_array(void *array, int elem_size, int *size, int new_size); + +#define GROW_ARRAY(array, nb_elems)\ + array = grow_array(array, sizeof(*array), &nb_elems, nb_elems + 1) + +typedef struct FrameBuffer { + uint8_t *base[4]; + uint8_t *data[4]; + int linesize[4]; + + int h, w; + enum AVPixelFormat pix_fmt; + + int refcount; + struct FrameBuffer **pool; ///< head of the buffer pool + struct FrameBuffer *next; +} FrameBuffer; + +/** + * Get a frame from the pool. This is intended to be used as a callback for + * AVCodecContext.get_buffer. + * + * @param s codec context. s->opaque must be a pointer to the head of the + * buffer pool. + * @param frame frame->opaque will be set to point to the FrameBuffer + * containing the frame data. + */ +int codec_get_buffer(AVCodecContext *s, AVFrame *frame); + +/** + * A callback to be used for AVCodecContext.release_buffer along with + * codec_get_buffer(). + */ +void codec_release_buffer(AVCodecContext *s, AVFrame *frame); + +/** + * A callback to be used for AVFilterBuffer.free. + * @param fb buffer to free. fb->priv must be a pointer to the FrameBuffer + * containing the buffer data. + */ +void filter_release_buffer(AVFilterBuffer *fb); + +/** + * Free all the buffers in the pool. This must be called after all the + * buffers have been released. + */ +void free_buffer_pool(FrameBuffer **pool); + +#define GET_PIX_FMT_NAME(pix_fmt)\ + const char *name = av_get_pix_fmt_name(pix_fmt); + +#define GET_SAMPLE_FMT_NAME(sample_fmt)\ + const char *name = av_get_sample_fmt_name(sample_fmt) + +#define GET_SAMPLE_RATE_NAME(rate)\ + char name[16];\ + snprintf(name, sizeof(name), "%d", rate); + +#define GET_CH_LAYOUT_NAME(ch_layout)\ + char name[16];\ + snprintf(name, sizeof(name), "0x%"PRIx64, ch_layout); + +#define GET_CH_LAYOUT_DESC(ch_layout)\ + char name[128];\ + av_get_channel_layout_string(name, sizeof(name), 0, ch_layout); + +#endif /* CMDUTILS_H */ diff --git a/project/jni/ffmpeg/cmdutils_common_opts.h b/project/jni/ffmpeg/cmdutils_common_opts.h new file mode 100644 index 000000000..1a845645b --- /dev/null +++ b/project/jni/ffmpeg/cmdutils_common_opts.h @@ -0,0 +1,21 @@ + { "L" , OPT_EXIT, {.func_arg = show_license}, "show license" }, + { "h" , OPT_EXIT, {.func_arg = show_help}, "show help", "topic" }, + { "?" , OPT_EXIT, {.func_arg = show_help}, "show help", "topic" }, + { "help" , OPT_EXIT, {.func_arg = show_help}, "show help", "topic" }, + { "-help" , OPT_EXIT, {.func_arg = show_help}, "show help", "topic" }, + { "version" , OPT_EXIT, {.func_arg = show_version}, "show version" }, + { "formats" , OPT_EXIT, {.func_arg = show_formats }, "show available formats" }, + { "codecs" , OPT_EXIT, {.func_arg = show_codecs }, "show available codecs" }, + { "decoders" , OPT_EXIT, {.func_arg = show_decoders }, "show available decoders" }, + { "encoders" , OPT_EXIT, {.func_arg = show_encoders }, "show available encoders" }, + { "bsfs" , OPT_EXIT, {.func_arg = show_bsfs }, "show available bit stream filters" }, + { "protocols" , OPT_EXIT, {.func_arg = show_protocols}, "show available protocols" }, + { "filters" , OPT_EXIT, {.func_arg = show_filters }, "show available filters" }, + { "pix_fmts" , OPT_EXIT, {.func_arg = show_pix_fmts }, "show available pixel formats" }, + { "layouts" , OPT_EXIT, {.func_arg = show_layouts }, "show standard channel layouts" }, + { "sample_fmts", OPT_EXIT, {.func_arg = show_sample_fmts }, "show available audio sample formats" }, + { "loglevel" , HAS_ARG, {.func_arg = opt_loglevel}, "set libav* logging level", "loglevel" }, + { "v", HAS_ARG, {.func_arg = opt_loglevel}, "set libav* logging level", "loglevel" }, + { "report" , 0, {(void*)opt_report}, "generate a report" }, + { "max_alloc" , HAS_ARG, {.func_arg = opt_max_alloc}, "set maximum size of a single allocated block", "bytes" }, + { "cpuflags" , HAS_ARG | OPT_EXPERT, {.func_arg = opt_cpuflags}, "force specific cpu flags", "flags" }, diff --git a/project/jni/ffmpeg/common.mak b/project/jni/ffmpeg/common.mak new file mode 100644 index 000000000..8775b0215 --- /dev/null +++ b/project/jni/ffmpeg/common.mak @@ -0,0 +1,140 @@ +# +# common bits used by all libraries +# + +# first so "all" becomes default target +all: all-yes + +ifndef SUBDIR + +ifndef V +Q = @ +ECHO = printf "$(1)\t%s\n" $(2) +BRIEF = CC CXX HOSTCC HOSTLD AS YASM AR LD STRIP CP +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_PATH)/ +CPPFLAGS := $(IFLAGS) $(CPPFLAGS) +CFLAGS += $(ECFLAGS) +CCFLAGS = $(CPPFLAGS) $(CFLAGS) +ASFLAGS := $(CPPFLAGS) $(ASFLAGS) +CXXFLAGS += $(CPPFLAGS) $(CFLAGS) +YASMFLAGS += $(IFLAGS:%=%/) -Pconfig.asm + +HOSTCCFLAGS = $(IFLAGS) $(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_CXX = $(call COMPILE,CXX) +COMPILE_S = $(call COMPILE,AS) + +%.o: %.c + $(COMPILE_C) + +%.o: %.cpp + $(COMPILE_CXX) + +%.s: %.c + $(CC) $(CPPFLAGS) $(CFLAGS) -S -o $@ $< + +%.o: %.S + $(COMPILE_S) + +%.i: %.c + $(CC) $(CCFLAGS) $(CC_E) $< + +%.h.c: + $(Q)echo '#include "$*.h"' >$@ + +%.ver: %.v + $(Q)sed 's/$$MAJOR/$($(basename $(@F))_VERSION_MAJOR)/' $^ > $@ + +%.c %.h: 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 + +OBJS += $(OBJS-yes) +FFLIBS := $(FFLIBS-yes) $(FFLIBS) +TESTPROGS += $(TESTPROGS-yes) + +LDLIBS = $(FFLIBS:%=%$(BUILDSUF)) +FFEXTRALIBS := $(LDLIBS:%=$(LD_LIB)) $(EXTRALIBS) + +EXAMPLES := $(EXAMPLES:%=$(SUBDIR)%-example$(EXESUF)) +OBJS := $(sort $(OBJS:%=$(SUBDIR)%)) +TESTOBJS := $(TESTOBJS:%=$(SUBDIR)%) $(TESTPROGS:%=$(SUBDIR)%-test.o) +TESTPROGS := $(TESTPROGS:%=$(SUBDIR)%-test$(EXESUF)) +HOSTOBJS := $(HOSTPROGS:%=$(SUBDIR)%.o) +HOSTPROGS := $(HOSTPROGS:%=$(SUBDIR)%$(HOSTEXESUF)) +TOOLS += $(TOOLS-yes) +TOOLOBJS := $(TOOLS:%=tools/%.o) +TOOLS := $(TOOLS:%=tools/%$(EXESUF)) +HEADERS += $(HEADERS-yes) + +DEP_LIBS := $(foreach NAME,$(FFLIBS),lib$(NAME)/$($(CONFIG_SHARED:yes=S)LIBNAME)) + +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)) +checkheaders: $(HOBJS) +.SECONDARY: $(HOBJS:.o=.c) + +alltools: $(TOOLS) + +$(HOSTOBJS): %.o: %.c + $(call COMPILE,HOSTCC) + +$(HOSTPROGS): %$(HOSTEXESUF): %.o + $(HOSTLD) $(HOSTLDFLAGS) $(HOSTLD_O) $< $(HOSTLIBS) + +$(OBJS): | $(sort $(dir $(OBJS))) +$(HOSTOBJS): | $(sort $(dir $(HOSTOBJS))) +$(TESTOBJS): | $(sort $(dir $(TESTOBJS))) +$(HOBJS): | $(sort $(dir $(HOBJS))) +$(TOOLOBJS): | tools + +OBJDIRS := $(OBJDIRS) $(dir $(OBJS) $(HOSTOBJS) $(TESTOBJS) $(HOBJS)) + +CLEANSUFFIXES = *.d *.o *~ *.h.c *.map *.ver *.ho *.gcno *.gcda +DISTCLEANSUFFIXES = *.pc +LIBSUFFIXES = *.a *.lib *.so *.so.* *.dylib *.dll *.def *.dll.a + +define RULES +clean:: + $(RM) $(OBJS) $(OBJS:.o=.d) + $(RM) $(HOSTPROGS) + $(RM) $(TOOLS) +endef + +$(eval $(RULES)) + +-include $(wildcard $(OBJS:.o=.d) $(HOSTOBJS:.o=.d) $(TESTOBJS:.o=.d) $(HOBJS:.o=.d)) diff --git a/project/jni/ffmpeg/compat/getopt.c b/project/jni/ffmpeg/compat/getopt.c new file mode 100644 index 000000000..dd082ea2e --- /dev/null +++ b/project/jni/ffmpeg/compat/getopt.c @@ -0,0 +1,86 @@ +/* + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +/* + * This file was copied from the following newsgroup posting: + * + * Newsgroups: mod.std.unix + * Subject: public domain AT&T getopt source + * Date: 3 Nov 85 19:34:15 GMT + * + * Here's something you've all been waiting for: the AT&T public domain + * source for getopt(3). It is the code which was given out at the 1985 + * UNIFORUM conference in Dallas. I obtained it by electronic mail + * directly from AT&T. The people there assure me that it is indeed + * in the public domain. + */ + +#include +#include + +static int opterr = 1; +static int optind = 1; +static int optopt; +static char *optarg; + +#undef fprintf + +static int getopt(int argc, char *argv[], char *opts) +{ + static int sp = 1; + int c; + char *cp; + + if (sp == 1) { + if (optind >= argc || + argv[optind][0] != '-' || argv[optind][1] == '\0') + return EOF; + else if (!strcmp(argv[optind], "--")) { + optind++; + return EOF; + } + } + optopt = c = argv[optind][sp]; + if (c == ':' || (cp = strchr(opts, c)) == NULL) { + fprintf(stderr, ": illegal option -- %c\n", c); + if (argv[optind][++sp] == '\0') { + optind++; + sp = 1; + } + return '?'; + } + if (*++cp == ':') { + if (argv[optind][sp+1] != '\0') + optarg = &argv[optind++][sp+1]; + else if(++optind >= argc) { + fprintf(stderr, ": option requires an argument -- %c\n", c); + sp = 1; + return '?'; + } else + optarg = argv[optind++]; + sp = 1; + } else { + if (argv[optind][++sp] == '\0') { + sp = 1; + optind++; + } + optarg = NULL; + } + + return c; +} diff --git a/project/jni/ffmpeg/compat/msvcrt/snprintf.c b/project/jni/ffmpeg/compat/msvcrt/snprintf.c new file mode 100644 index 000000000..c64653fe8 --- /dev/null +++ b/project/jni/ffmpeg/compat/msvcrt/snprintf.c @@ -0,0 +1,71 @@ +/* + * C99-compatible snprintf() and vsnprintf() implementations + * Copyright (c) 2012 Ronald S. Bultje + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include +#include +#include +#include + +#include "compat/va_copy.h" +#include "libavutil/error.h" + +#if defined(__MINGW32__) +#define EOVERFLOW EFBIG +#endif + +int avpriv_snprintf(char *s, size_t n, const char *fmt, ...) +{ + va_list ap; + int ret; + + va_start(ap, fmt); + ret = avpriv_vsnprintf(s, n, fmt, ap); + va_end(ap); + + return ret; +} + +int avpriv_vsnprintf(char *s, size_t n, const char *fmt, + va_list ap) +{ + int ret; + va_list ap_copy; + + if (n == 0) + return _vscprintf(fmt, ap); + else if (n > INT_MAX) + return AVERROR(EOVERFLOW); + + /* we use n - 1 here because if the buffer is not big enough, the MS + * runtime libraries don't add a terminating zero at the end. MSDN + * recommends to provide _snprintf/_vsnprintf() a buffer size that + * is one less than the actual buffer, and zero it before calling + * _snprintf/_vsnprintf() to workaround this problem. + * See http://msdn.microsoft.com/en-us/library/1kt27hek(v=vs.80).aspx */ + memset(s, 0, n); + va_copy(ap_copy, ap); + ret = _vsnprintf(s, n - 1, fmt, ap_copy); + va_end(ap_copy); + if (ret == -1) + ret = _vscprintf(fmt, ap); + + return ret; +} diff --git a/project/jni/ffmpeg/compat/msvcrt/snprintf.h b/project/jni/ffmpeg/compat/msvcrt/snprintf.h new file mode 100644 index 000000000..f02113c5a --- /dev/null +++ b/project/jni/ffmpeg/compat/msvcrt/snprintf.h @@ -0,0 +1,38 @@ +/* + * C99-compatible snprintf() and vsnprintf() implementations + * Copyright (c) 2012 Ronald S. Bultje + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef COMPAT_SNPRINTF_H +#define COMPAT_SNPRINTF_H + +#include +#include + +int avpriv_snprintf(char *s, size_t n, const char *fmt, ...); +int avpriv_vsnprintf(char *s, size_t n, const char *fmt, va_list ap); + +#undef snprintf +#undef _snprintf +#undef vsnprintf +#define snprintf avpriv_snprintf +#define _snprintf avpriv_snprintf +#define vsnprintf avpriv_vsnprintf + +#endif /* COMPAT_SNPRINTF_H */ diff --git a/project/jni/ffmpeg/compat/plan9/head b/project/jni/ffmpeg/compat/plan9/head new file mode 100755 index 000000000..2840b2d50 --- /dev/null +++ b/project/jni/ffmpeg/compat/plan9/head @@ -0,0 +1,10 @@ +#!/bin/sh + +n=10 + +case "$1" in + -n) n=$2; shift 2 ;; + -n*) n=${1#-n}; shift ;; +esac + +exec sed ${n}q "$@" diff --git a/project/jni/ffmpeg/compat/plan9/main.c b/project/jni/ffmpeg/compat/plan9/main.c new file mode 100644 index 000000000..d46f96d17 --- /dev/null +++ b/project/jni/ffmpeg/compat/plan9/main.c @@ -0,0 +1,34 @@ +/* + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +int plan9_main(int argc, char **argv); + +#undef main +int main(int argc, char **argv) +{ + /* The setfcr() function in lib9 is broken, must use asm. */ +#ifdef __i386 + short fcr; + __asm__ volatile ("fstcw %0 \n" + "or $63, %0 \n" + "fldcw %0 \n" + : "=m"(fcr)); +#endif + + return plan9_main(argc, argv); +} diff --git a/project/jni/ffmpeg/compat/plan9/printf b/project/jni/ffmpeg/compat/plan9/printf new file mode 100755 index 000000000..1a70a9e91 --- /dev/null +++ b/project/jni/ffmpeg/compat/plan9/printf @@ -0,0 +1,2 @@ +#!/bin/sh +exec awk "BEGIN { for (i = 2; i < ARGC; i++) printf \"$1\", ARGV[i] }" "$@" diff --git a/project/jni/ffmpeg/compat/strtod.c b/project/jni/ffmpeg/compat/strtod.c new file mode 100644 index 000000000..d0f9b3d41 --- /dev/null +++ b/project/jni/ffmpeg/compat/strtod.c @@ -0,0 +1,94 @@ +/* + * C99-compatible strtod() implementation + * Copyright (c) 2012 Ronald S. Bultje + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include +#include +#include + +#include "libavutil/avstring.h" +#include "libavutil/mathematics.h" + +static char *check_nan_suffix(char *s) +{ + char *start = s; + + if (*s++ != '(') + return start; + + while ((*s >= 'a' && *s <= 'z') || (*s >= 'A' && *s <= 'Z') || + (*s >= '0' && *s <= '9') || *s == '_') + s++; + + return *s == ')' ? s + 1 : start; +} + +#undef strtod +double strtod(const char *, char **); + +double avpriv_strtod(const char *nptr, char **endptr) +{ + char *end; + double res; + + /* Skip leading spaces */ + while (isspace(*nptr)) + nptr++; + + if (!av_strncasecmp(nptr, "infinity", 8)) { + end = nptr + 8; + res = INFINITY; + } else if (!av_strncasecmp(nptr, "inf", 3)) { + end = nptr + 3; + res = INFINITY; + } else if (!av_strncasecmp(nptr, "+infinity", 9)) { + end = nptr + 9; + res = INFINITY; + } else if (!av_strncasecmp(nptr, "+inf", 4)) { + end = nptr + 4; + res = INFINITY; + } else if (!av_strncasecmp(nptr, "-infinity", 9)) { + end = nptr + 9; + res = -INFINITY; + } else if (!av_strncasecmp(nptr, "-inf", 4)) { + end = nptr + 4; + res = -INFINITY; + } else if (!av_strncasecmp(nptr, "nan", 3)) { + end = check_nan_suffix(nptr + 3); + res = NAN; + } else if (!av_strncasecmp(nptr, "+nan", 4) || + !av_strncasecmp(nptr, "-nan", 4)) { + end = check_nan_suffix(nptr + 4); + res = NAN; + } else if (!av_strncasecmp(nptr, "0x", 2) || + !av_strncasecmp(nptr, "-0x", 3) || + !av_strncasecmp(nptr, "+0x", 3)) { + /* FIXME this doesn't handle exponents, non-integers (float/double) + * and numbers too large for long long */ + res = strtoll(nptr, &end, 16); + } else { + res = strtod(nptr, &end); + } + + if (endptr) + *endptr = end; + + return res; +} diff --git a/project/jni/ffmpeg/compat/tms470/math.h b/project/jni/ffmpeg/compat/tms470/math.h new file mode 100644 index 000000000..1104d744e --- /dev/null +++ b/project/jni/ffmpeg/compat/tms470/math.h @@ -0,0 +1,7 @@ +#include_next + +#undef INFINITY +#undef NAN + +#define INFINITY (*(const float*)((const unsigned []){ 0x7f800000 })) +#define NAN (*(const float*)((const unsigned []){ 0x7fc00000 })) diff --git a/project/jni/ffmpeg/compat/va_copy.h b/project/jni/ffmpeg/compat/va_copy.h new file mode 100644 index 000000000..f89477194 --- /dev/null +++ b/project/jni/ffmpeg/compat/va_copy.h @@ -0,0 +1,26 @@ +/* + * MSVC Compatible va_copy macro + * Copyright (c) 2012 Derek Buitenhuis + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include + +#if !defined(va_copy) && defined(_MSC_VER) +#define va_copy(dst, src) ((dst) = (src)) +#endif diff --git a/project/jni/ffmpeg/configure b/project/jni/ffmpeg/configure new file mode 100755 index 000000000..0707a940c --- /dev/null +++ b/project/jni/ffmpeg/configure @@ -0,0 +1,4591 @@ +#!/bin/sh +# +# FFmpeg configure script +# +# Copyright (c) 2000-2002 Fabrice Bellard +# Copyright (c) 2005-2008 Diego Biurrun +# Copyright (c) 2005-2008 Mans Rullgard +# + +# Prevent locale nonsense from breaking basic text processing. +LC_ALL=C +export LC_ALL + +# make sure we are running under a compatible shell +# try to make this part work with most shells + +try_exec(){ + echo "Trying shell $1" + type "$1" > /dev/null 2>&1 && exec "$@" +} + +unset foo +(: ${foo%%bar}) 2> /dev/null +E1="$?" + +(: ${foo?}) 2> /dev/null +E2="$?" + +if test "$E1" != 0 || test "$E2" = 0; then + echo "Broken shell detected. Trying alternatives." + export FF_CONF_EXEC + if test "0$FF_CONF_EXEC" -lt 1; then + FF_CONF_EXEC=1 + try_exec bash "$0" "$@" + fi + if test "0$FF_CONF_EXEC" -lt 2; then + FF_CONF_EXEC=2 + try_exec ksh "$0" "$@" + fi + if test "0$FF_CONF_EXEC" -lt 3; then + FF_CONF_EXEC=3 + try_exec /usr/xpg4/bin/sh "$0" "$@" + fi + echo "No compatible shell script interpreter found." + echo "This configure script requires a POSIX-compatible shell" + echo "such as bash or ksh." + echo "THIS IS NOT A BUG IN FFMPEG, DO NOT REPORT IT AS SUCH." + echo "Instead, install a working POSIX-compatible shell." + echo "Disabling this configure test will create a broken FFmpeg." + if test "$BASH_VERSION" = '2.04.0(1)-release'; then + echo "This bash version ($BASH_VERSION) is broken on your platform." + echo "Upgrade to a later version if available." + fi + exit 1 +fi + +test -d /usr/xpg4/bin && PATH=/usr/xpg4/bin:$PATH + +show_help(){ + cat <> $logfile +} + +log_file(){ + log BEGIN $1 + pr -n -t $1 >> $logfile + log END $1 +} + +echolog(){ + log "$@" + echo "$@" +} + +warn(){ + log "WARNING: $*" + WARNINGS="${WARNINGS}WARNING: $*\n" +} + +die(){ + echolog "$@" + cat <>file; + } else if (file ~ /\\.asm\$/) { + printf(\"%%define %s %d\\n\", c, v) >>file; + } else if (file ~ /\\.mak\$/) { + n = -v ? \"\" : \"!\"; + printf(\"%s%s=yes\\n\", n, c) >>file; + } + } + }" +} + +print_enabled(){ + suf=$1 + shift + for v; do + enabled $v && printf "%s\n" ${v%$suf}; + done +} + +append(){ + var=$1 + shift + eval "$var=\"\$$var $*\"" +} + +prepend(){ + var=$1 + shift + eval "$var=\"$* \$$var\"" +} + +add_cppflags(){ + append CPPFLAGS "$@" +} + +add_cflags(){ + append CFLAGS $($cflags_filter "$@") +} + +add_cxxflags(){ + append CXXFLAGS $($cflags_filter "$@") +} + +add_asflags(){ + append ASFLAGS $($asflags_filter "$@") +} + +add_ldflags(){ + append LDFLAGS $($ldflags_filter "$@") +} + +add_extralibs(){ + prepend extralibs $($ldflags_filter "$@") +} + +add_host_cflags(){ + append host_cflags $($host_cflags_filter "$@") +} + +add_host_ldflags(){ + append host_ldflags $($host_ldflags_filter "$@") +} + +add_compat(){ + append compat_objs $1 + shift + map 'add_cppflags -D$v' "$@" +} + +check_cmd(){ + log "$@" + "$@" >> $logfile 2>&1 +} + +cc_o(){ + eval printf '%s\\n' $CC_O +} + +cc_e(){ + eval printf '%s\\n' $CC_E +} + +check_cc(){ + log check_cc "$@" + cat > $TMPC + log_file $TMPC + check_cmd $cc $CPPFLAGS $CFLAGS "$@" $CC_C $(cc_o $TMPO) $TMPC +} + +check_cxx(){ + log check_cxx "$@" + cat > $TMPCPP + log_file $TMPCPP + check_cmd $cxx $CPPFLAGS $CFLAGS $CXXFLAGS "$@" $CXX_C -o $TMPO $TMPCPP +} + +check_cpp(){ + log check_cpp "$@" + cat > $TMPC + log_file $TMPC + check_cmd $cc $CPPFLAGS $CFLAGS "$@" $(cc_e $TMPO) $TMPC +} + +as_o(){ + eval printf '%s\\n' $AS_O +} + +check_as(){ + log check_as "$@" + cat > $TMPS + log_file $TMPS + check_cmd $as $CPPFLAGS $ASFLAGS "$@" $AS_C $(as_o $TMPO) $TMPS +} + +check_inline_asm(){ + log check_inline_asm "$@" + name="$1" + code="$2" + shift 2 + disable $name + check_cc "$@" < $TMPS + log_file $TMPS + shift 1 + check_cmd $yasmexe $YASMFLAGS -Werror "$@" -o $TMPO $TMPS +} + +ld_o(){ + eval printf '%s\\n' $LD_O +} + +check_ld(){ + log check_ld "$@" + type=$1 + shift 1 + flags=$(filter_out '-l*|*.so' $@) + libs=$(filter '-l*|*.so' $@) + check_$type $($cflags_filter $flags) || return + flags=$($ldflags_filter $flags) + libs=$($ldflags_filter $libs) + check_cmd $ld $LDFLAGS $flags $(ld_o $TMPE) $TMPO $libs $extralibs +} + +check_code(){ + log check_code "$@" + check=$1 + headers=$2 + code=$3 + shift 3 + { + for hdr in $headers; do + echo "#include <$hdr>" + done + echo "int main(void) { $code; return 0; }" + } | check_$check "$@" +} + +check_cppflags(){ + log check_cppflags "$@" + check_cc "$@" < +int x; +EOF +} + +check_func(){ + log check_func "$@" + func=$1 + shift + disable $func + check_ld "cc" "$@" < +float foo(float f, float g) { return $func($args); } +int main(void){ return (int) foo; } +EOF +} + +check_func_headers(){ + log check_func_headers "$@" + headers=$1 + funcs=$2 + shift 2 + { + for hdr in $headers; do + echo "#include <$hdr>" + done + for func in $funcs; do + echo "long check_$func(void) { return (long) $func; }" + done + echo "int main(void) { return 0; }" + } | check_ld "cc" "$@" && enable $funcs && enable_safe $headers +} + +check_class_headers_cpp(){ + log check_class_headers_cpp "$@" + headers=$1 + classes=$2 + shift 2 + { + for hdr in $headers; do + echo "#include <$hdr>" + done + echo "int main(void) { " + i=1 + for class in $classes; do + echo "$class obj$i;" + i=$(expr $i + 1) + done + echo "return 0; }" + } | check_ld "cxx" "$@" && enable $funcs && enable_safe $headers +} + +check_cpp_condition(){ + log check_cpp_condition "$@" + header=$1 + condition=$2 + shift 2 + check_cpp "$@" < +#if !($condition) +#error "unsatisfied condition: $condition" +#endif +EOF +} + +check_lib(){ + log check_lib "$@" + header="$1" + func="$2" + shift 2 + check_header $header && check_func $func "$@" && add_extralibs "$@" +} + +check_lib2(){ + log check_lib2 "$@" + headers="$1" + funcs="$2" + shift 2 + check_func_headers "$headers" "$funcs" "$@" && add_extralibs "$@" +} + +check_lib_cpp(){ + log check_lib_cpp "$@" + headers="$1" + classes="$2" + shift 2 + check_class_headers_cpp "$headers" "$classes" "$@" && add_extralibs "$@" +} + +check_pkg_config(){ + log check_pkg_config "$@" + pkg="$1" + headers="$2" + funcs="$3" + shift 3 + $pkg_config --exists $pkg 2>/dev/null || return + pkg_cflags=$($pkg_config --cflags $pkg) + pkg_libs=$($pkg_config --libs $pkg) + check_func_headers "$headers" "$funcs" $pkg_cflags $pkg_libs "$@" && + set_safe ${pkg}_cflags $pkg_cflags && + set_safe ${pkg}_libs $pkg_libs +} + +check_exec(){ + check_ld "cc" "$@" && { enabled cross_compile || $TMPE >> $logfile 2>&1; } +} + +check_exec_crash(){ + code=$(cat) + + # exit() is not async signal safe. _Exit (C99) and _exit (POSIX) + # are safe but may not be available everywhere. Thus we use + # raise(SIGTERM) instead. The check is run in a subshell so we + # can redirect the "Terminated" message from the shell. SIGBUS + # is not defined by standard C so it is used conditionally. + + (check_exec "$@") >> $logfile 2>&1 < +static void sighandler(int sig){ + raise(SIGTERM); +} +int func(void){ + $code +} +int (*func_ptr)(void) = func; +int main(void){ + signal(SIGILL, sighandler); + signal(SIGFPE, sighandler); + signal(SIGSEGV, sighandler); +#ifdef SIGBUS + signal(SIGBUS, sighandler); +#endif + return func_ptr(); +} +EOF +} + +check_type(){ + log check_type "$@" + headers=$1 + type=$2 + shift 2 + disable_safe "$type" + check_code cc "$headers" "$type v" "$@" && enable_safe "$type" +} + +check_struct(){ + log check_type "$@" + headers=$1 + struct=$2 + member=$3 + shift 3 + disable_safe "${struct}_${member}" + check_code cc "$headers" "const void *p = &(($struct *)0)->$member" "$@" && + enable_safe "${struct}_${member}" +} + +require(){ + name="$1" + header="$2" + func="$3" + shift 3 + check_lib $header $func "$@" || die "ERROR: $name not found" +} + +require2(){ + name="$1" + headers="$2" + func="$3" + shift 3 + check_lib2 "$headers" $func "$@" || die "ERROR: $name not found" +} + +require_cpp(){ + name="$1" + headers="$2" + classes="$3" + shift 3 + check_lib_cpp "$headers" "$classes" "$@" || die "ERROR: $name not found" +} + +require_pkg_config(){ + pkg="$1" + check_pkg_config "$@" || die "ERROR: $pkg not found" + add_cflags $(get_safe ${pkg}_cflags) + add_extralibs $(get_safe ${pkg}_libs) +} + +hostcc_o(){ + eval printf '%s\\n' $HOSTCC_O +} + +check_host_cc(){ + log check_host_cc "$@" + cat > $TMPC + log_file $TMPC + check_cmd $host_cc $host_cflags "$@" $HOSTCC_C $(hostcc_o $TMPO) $TMPC +} + +check_host_cflags(){ + log check_host_cflags "$@" + set -- $($host_cflags_filter "$@") + check_host_cc "$@" < "$file.tmp" && mv "$file.tmp" "$file" || rm "$file.tmp" +} + +cp_if_changed(){ + cmp -s "$1" "$2" && echo "$2 is unchanged" && return + mkdir -p "$(dirname $2)" + $cp_f "$1" "$2" +} + +# CONFIG_LIST contains configurable options, while HAVE_LIST is for +# system-dependent things. + +COMPONENT_LIST=" + bsfs + decoders + demuxers + encoders + filters + hwaccels + indevs + muxers + outdevs + parsers + protocols +" + +DOCUMENT_LIST=" + doc + htmlpages + manpages + podpages + txtpages +" + +LIBRARY_LIST=" + avcodec + avdevice + avfilter + avformat + avresample + avutil + postproc + swresample + swscale +" + +PROGRAM_LIST=" + ffplay + ffprobe + ffserver + ffmpeg +" + +CONFIG_LIST=" + $COMPONENT_LIST + $DOCUMENT_LIST + $LIBRARY_LIST + $PROGRAM_LIST + avisynth + bzlib + crystalhd + dct + dwt + dxva2 + fast_unaligned + fft + fontconfig + frei0r + ftrapv + gnutls + gpl + gray + hardcoded_tables + incompatible_fork_abi + libaacplus + libass + libbluray + libcaca + libcdio + libcelt + libdc1394 + libfaac + libfdk_aac + libflite + libfreetype + libgsm + libiec61883 + libilbc + libmodplug + libmp3lame + libnut + libopencore_amrnb + libopencore_amrwb + libopencv + libopenjpeg + libopus + libpulse + librtmp + libschroedinger + libsoxr + libspeex + libstagefright_h264 + libtheora + libtwolame + libutvideo + libv4l2 + libvo_aacenc + libvo_amrwbenc + libvorbis + libvpx + libx264 + libxavs + libxvid + lsp + lzo + mdct + memalign_hack + memory_poisoning + network + nonfree + openal + openssl + pic + rdft + runtime_cpudetect + safe_bitstream_reader + shared + small + sram + static + swscale_alpha + thumb + vaapi + vda + vdpau + version3 + xmm_clobber_test + x11grab + zlib +" + +THREADS_LIST=' + pthreads + w32threads + os2threads +' + +ARCH_LIST=' + aarch64 + alpha + arm + avr32 + avr32_ap + avr32_uc + bfin + ia64 + m68k + mips + mips64 + parisc + ppc + ppc64 + s390 + sh4 + sparc + sparc64 + tilegx + tilepro + tomi + x86 + x86_32 + x86_64 +' + +ARCH_EXT_LIST_ARM=' + armv5te + armv6 + armv6t2 + neon + vfp + vfpv3 +' + +ARCH_EXT_LIST_X86=' + amd3dnow + amd3dnowext + avx + fma4 + mmx + mmxext + sse + sse2 + sse3 + sse4 + sse42 + ssse3 +' + +ARCH_EXT_LIST=" + $ARCH_EXT_LIST_ARM + $ARCH_EXT_LIST_X86 + altivec + ppc4xx + vis + mipsfpu + mips32r2 + mipsdspr1 + mipsdspr2 +" + +HAVE_LIST_CMDLINE=' + inline_asm + symver + yasm +' + +HAVE_LIST_PUB=' + bigendian + fast_unaligned + incompatible_fork_abi +' + +MATH_FUNCS=" + atanf + atan2f + cbrtf + cosf + exp2 + exp2f + expf + isinf + isnan + ldexpf + llrint + llrintf + log2 + log2f + log10f + lrint + lrintf + powf + rint + round + roundf + sinf + trunc + truncf +" + +HAVE_LIST=" + $ARCH_EXT_LIST + $(add_suffix _external $ARCH_EXT_LIST) + $(add_suffix _inline $ARCH_EXT_LIST) + $HAVE_LIST_CMDLINE + $HAVE_LIST_PUB + $THREADS_LIST + $MATH_FUNCS + access + aligned_malloc + aligned_stack + alsa_asoundlib_h + altivec_h + arpa_inet_h + asm_mod_q + asm_mod_y + asm_types_h + attribute_may_alias + attribute_packed + cdio_paranoia_h + cdio_paranoia_paranoia_h + clock_gettime + closesocket + cmov + CommandLineToArgvW + cpunop + CryptGenRandom + dcbzl + dev_bktr_ioctl_bt848_h + dev_bktr_ioctl_meteor_h + dev_ic_bt8xx_h + dev_video_bktr_ioctl_bt848_h + dev_video_meteor_ioctl_meteor_h + direct_h + dlfcn_h + dlopen + dos_paths + dxva_h + ebp_available + ebx_available + fast_64bit + fast_clz + fast_cmov + fcntl + fork + getaddrinfo + gethrtime + getopt + GetProcessAffinityMask + GetProcessMemoryInfo + GetProcessTimes + GetSystemTimeAsFileTime + getrusage + getservbyport + gettimeofday + glob + gnu_as + ibm_asm + inet_aton + io_h + isatty + jack_port_get_latency_range + kbhit + ldbrx + libdc1394_1 + libdc1394_2 + local_aligned_16 + local_aligned_8 + localtime_r + loongson + lzo1x_999_compress + machine_ioctl_bt848_h + machine_ioctl_meteor_h + makeinfo + malloc_h + MapViewOfFile + memalign + mkstemp + mm_empty + mmap + mprotect + msvcrt + nanosleep + openjpeg_1_5_openjpeg_h + PeekNamedPipe + perl + pod2man + poll_h + posix_memalign + pthread_cancel + rdtsc + rsync_contimeout + sched_getaffinity + sdl + sdl_video_size + SetConsoleTextAttribute + setmode + setrlimit + Sleep + sndio_h + socklen_t + soundcard_h + strerror_r + struct_addrinfo + struct_group_source_req + struct_ip_mreq_source + struct_ipv6_mreq + struct_pollfd + struct_rusage_ru_maxrss + struct_sctp_event_subscribe + struct_sockaddr_in6 + struct_sockaddr_sa_len + struct_sockaddr_storage + struct_v4l2_frmivalenum_discrete + symver_asm_label + symver_gnu_asm + sysconf + sysctl + sys_mman_h + sys_param_h + sys_resource_h + sys_select_h + sys_soundcard_h + sys_time_h + sys_videoio_h + termios_h + texi2html + threads + unistd_h + usleep + vfp_args + VirtualAlloc + windows_h + winsock2_h + xform_asm + xmm_clobbers +" + +# options emitted with CONFIG_ prefix but not available on the command line +CONFIG_EXTRA=" + aandcttables + ac3dsp + error_resilience + gcrypt + golomb + gplv3 + h264chroma + h264dsp + h264pred + h264qpel + huffman + lgplv3 + lpc + mpegaudio + mpegaudiodsp + mpegvideo + mpegvideoenc + nettle + rangecoder + rtpdec + rtpenc_chain + sinewin + videodsp + vp3dsp +" + +CMDLINE_SELECT=" + $ARCH_EXT_LIST + $CONFIG_LIST + $HAVE_LIST_CMDLINE + $THREADS_LIST + asm + coverage + cross_compile + debug + extra_warnings + logging + lto + optimizations + stripping +" + +PATHS_LIST=' + bindir + datadir + incdir + libdir + mandir + prefix + shlibdir +' + +CMDLINE_SET=" + $PATHS_LIST + ar + arch + as + assert_level + build_suffix + cc + cpu + cross_prefix + cxx + dep_cc + extra_version + host_cc + host_cflags + host_ld + host_ldflags + host_libs + host_os + install + ld + logfile + malloc_prefix + nm + optflags + pkg_config + progs_suffix + random_seed + samples + strip + sysinclude + sysroot + target_exec + target_os + target_path + toolchain + valgrind + yasmexe +" + +CMDLINE_APPEND=" + extra_cflags + extra_cxxflags +" + +# code dependency declarations + +# architecture extensions + +armv5te_deps="arm" +armv6_deps="arm" +armv6t2_deps="arm" +neon_deps="arm" +vfp_deps="arm" +vfpv3_deps="vfp" + +map 'eval ${v}_inline_deps=inline_asm' $ARCH_EXT_LIST_ARM + +mipsfpu_deps="mips" +mips32r2_deps="mips" +mipsdspr1_deps="mips" +mipsdspr2_deps="mips" + +altivec_deps="ppc" +ppc4xx_deps="ppc" + +vis_deps="sparc" + +x86_64_suggest="cmov fast_cmov" + +amd3dnow_deps="mmx" +amd3dnowext_deps="amd3dnow" +mmx_deps="x86" +mmxext_deps="mmx" +sse_deps="mmxext" +sse2_deps="sse" +sse3_deps="sse2" +ssse3_deps="sse3" +sse4_deps="ssse3" +sse42_deps="sse4" +avx_deps="sse42" +fma4_deps="avx" + +mmx_external_deps="yasm" +mmx_inline_deps="inline_asm" +mmx_suggest="mmx_external mmx_inline" + +for ext in $(filter_out mmx $ARCH_EXT_LIST_X86); do + eval dep=\$${ext}_deps + eval ${ext}_external_deps='"${dep}_external"' + eval ${ext}_inline_deps='"${dep}_inline"' + eval ${ext}_suggest='"${ext}_external ${ext}_inline"' +done + +aligned_stack_if_any="ppc x86" +fast_64bit_if_any="alpha ia64 mips64 parisc64 ppc64 sparc64 x86_64" +fast_clz_if_any="alpha avr32 mips ppc x86" +fast_unaligned_if_any="ppc x86" + +inline_asm_deps="!tms470" +need_memalign="altivec neon sse" + +symver_if_any="symver_asm_label symver_gnu_asm" + +log2_deps="!msvcrt" + +# subsystems +dct_select="rdft" +mdct_select="fft" +rdft_select="fft" +mpegaudio_select="mpegaudiodsp" +mpegaudiodsp_select="dct" +mpegvideo_select="videodsp" +mpegvideoenc_select="mpegvideo" + +# decoders / encoders +aac_decoder_select="mdct sinewin" +aac_encoder_select="mdct sinewin" +aac_latm_decoder_select="aac_decoder aac_latm_parser" +ac3_decoder_select="mdct ac3dsp ac3_parser" +ac3_encoder_select="mdct ac3dsp" +ac3_fixed_encoder_select="mdct ac3dsp" +alac_encoder_select="lpc" +amrnb_decoder_select="lsp" +amrwb_decoder_select="lsp" +amv_encoder_select="aandcttables" +atrac1_decoder_select="mdct sinewin" +atrac3_decoder_select="mdct" +binkaudio_dct_decoder_select="mdct rdft dct sinewin" +binkaudio_rdft_decoder_select="mdct rdft sinewin" +cavs_decoder_select="golomb mpegvideo" +comfortnoise_encoder_select="lpc" +cook_decoder_select="mdct sinewin" +cscd_decoder_select="lzo" +cscd_decoder_suggest="zlib" +dca_decoder_select="mdct" +dirac_decoder_select="dwt golomb" +dnxhd_encoder_select="aandcttables mpegvideoenc" +dxa_decoder_select="zlib" +eac3_decoder_select="ac3_decoder" +eac3_encoder_select="ac3_encoder" +eamad_decoder_select="aandcttables error_resilience mpegvideo" +eatgq_decoder_select="aandcttables" +eatqi_decoder_select="aandcttables error_resilience mpegvideo" +exr_decoder_select="zlib" +ffv1_decoder_select="golomb rangecoder" +ffv1_encoder_select="rangecoder" +ffvhuff_encoder_select="huffman" +flac_decoder_select="golomb" +flac_encoder_select="golomb lpc" +flashsv_decoder_select="zlib" +flashsv_encoder_select="zlib" +flashsv2_encoder_select="zlib" +flashsv2_decoder_select="zlib" +flv_decoder_select="h263_decoder" +flv_encoder_select="h263_encoder" +fraps_decoder_select="huffman" +h261_decoder_select="error_resilience mpegvideo" +h261_encoder_select="aandcttables mpegvideoenc" +h263_decoder_select="error_resilience h263_parser mpegvideo" +h263_encoder_select="aandcttables error_resilience mpegvideoenc" +h263i_decoder_select="h263_decoder" +h263p_encoder_select="h263_encoder" +h264_decoder_select="error_resilience golomb h264chroma h264dsp h264pred h264qpel mpegvideo" +huffyuv_encoder_select="huffman" +iac_decoder_select="fft mdct sinewin" +imc_decoder_select="fft mdct sinewin" +jpegls_decoder_select="golomb" +jpegls_encoder_select="golomb" +ljpeg_encoder_select="aandcttables mpegvideoenc" +loco_decoder_select="golomb" +mdec_decoder_select="error_resilience mpegvideo" +mjpeg_encoder_select="aandcttables mpegvideoenc" +mlp_decoder_select="mlp_parser" +mp1_decoder_select="mpegaudio" +mp1float_decoder_select="mpegaudio" +mp2_decoder_select="mpegaudio" +mp2float_decoder_select="mpegaudio" +mp3_decoder_select="mpegaudio" +mp3adu_decoder_select="mpegaudio" +mp3adufloat_decoder_select="mpegaudio" +mp3float_decoder_select="mpegaudio" +mp3on4_decoder_select="mpegaudio" +mp3on4float_decoder_select="mpegaudio" +mpc7_decoder_select="mpegaudiodsp" +mpc8_decoder_select="mpegaudiodsp" +mpeg_xvmc_decoder_deps="X11_extensions_XvMClib_h" +mpeg_xvmc_decoder_select="mpegvideo_decoder" +mpeg1video_decoder_select="error_resilience mpegvideo" +mpeg1video_encoder_select="aandcttables error_resilience mpegvideoenc" +mpeg2video_decoder_select="error_resilience mpegvideo" +mpeg2video_encoder_select="aandcttables error_resilience mpegvideoenc" +mpeg4_decoder_select="h263_decoder mpeg4video_parser" +mpeg4_encoder_select="h263_encoder" +msmpeg4v1_decoder_select="h263_decoder" +msmpeg4v1_encoder_select="h263_encoder" +msmpeg4v2_decoder_select="h263_decoder" +msmpeg4v2_encoder_select="h263_encoder" +msmpeg4v3_decoder_select="h263_decoder" +msmpeg4v3_encoder_select="h263_encoder" +mss2_decoder_select="vc1_decoder" +nellymoser_decoder_select="mdct sinewin" +nellymoser_encoder_select="mdct sinewin" +nuv_decoder_select="lzo" +png_decoder_select="zlib" +png_encoder_select="zlib" +qcelp_decoder_select="lsp" +qdm2_decoder_select="mdct rdft mpegaudiodsp" +ra_144_encoder_select="lpc" +ralf_decoder_select="golomb" +rv10_decoder_select="h263_decoder" +rv10_encoder_select="h263_encoder" +rv20_decoder_select="h263_decoder" +rv20_encoder_select="h263_encoder" +rv30_decoder_select="error_resilience golomb h264chroma h264pred h264qpel mpegvideo" +rv40_decoder_select="error_resilience golomb h264chroma h264pred h264qpel mpegvideo" +shorten_decoder_select="golomb" +sipr_decoder_select="lsp" +snow_decoder_select="dwt rangecoder" +snow_encoder_select="aandcttables dwt error_resilience mpegvideoenc rangecoder" +sonic_decoder_select="golomb" +sonic_encoder_select="golomb" +sonic_ls_encoder_select="golomb" +svq1_decoder_select="error_resilience mpegvideo" +svq1_encoder_select="aandcttables error_resilience mpegvideoenc" +svq3_decoder_select="error_resilience golomb h264chroma h264dsp h264pred h264qpel mpegvideo" +svq3_decoder_suggest="zlib" +theora_decoder_select="vp3_decoder" +tiff_decoder_suggest="zlib" +tiff_encoder_suggest="zlib" +truehd_decoder_select="mlp_parser" +tscc_decoder_select="zlib" +twinvq_decoder_select="mdct lsp sinewin" +utvideo_encoder_select="huffman" +vc1_decoder_select="h263_decoder h264chroma h264qpel" +vc1image_decoder_select="vc1_decoder" +vorbis_decoder_select="mdct" +vorbis_encoder_select="mdct" +vp3_decoder_select="vp3dsp videodsp" +vp5_decoder_select="vp3dsp videodsp" +vp6_decoder_select="huffman vp3dsp videodsp" +vp6a_decoder_select="vp6_decoder" +vp6f_decoder_select="vp6_decoder" +vp8_decoder_select="h264pred videodsp" +wmapro_decoder_select="mdct sinewin" +wmav1_decoder_select="mdct sinewin" +wmav1_encoder_select="mdct sinewin" +wmav2_decoder_select="mdct sinewin" +wmav2_encoder_select="mdct sinewin" +wmavoice_decoder_select="lsp rdft dct mdct sinewin" +wmv1_decoder_select="h263_decoder" +wmv1_encoder_select="h263_encoder" +wmv2_decoder_select="h263_decoder" +wmv2_encoder_select="h263_encoder" +wmv3_decoder_select="vc1_decoder" +wmv3image_decoder_select="wmv3_decoder" +zerocodec_decoder_select="zlib" +zlib_decoder_select="zlib" +zlib_encoder_select="zlib" +zmbv_decoder_select="zlib" +zmbv_encoder_select="zlib" + +# hardware accelerators +crystalhd_deps="libcrystalhd_libcrystalhd_if_h" +vaapi_deps="va_va_h" +vda_deps="VideoDecodeAcceleration_VDADecoder_h pthreads" +vdpau_deps="vdpau_vdpau_h vdpau_vdpau_x11_h" + +h263_vaapi_hwaccel_select="vaapi h263_decoder" +h264_crystalhd_decoder_select="crystalhd h264_mp4toannexb_bsf h264_parser" +h264_dxva2_hwaccel_deps="dxva2api_h" +h264_dxva2_hwaccel_select="dxva2 h264_decoder" +h264_vaapi_hwaccel_select="vaapi h264_decoder" +h264_vda_decoder_select="vda h264_parser h264_decoder" +h264_vda_hwaccel_deps="VideoDecodeAcceleration_VDADecoder_h pthreads" +h264_vda_hwaccel_select="vda h264_decoder" +h264_vdpau_decoder_select="vdpau h264_decoder" +mpeg_vdpau_decoder_select="vdpau mpegvideo_decoder" +mpeg1_vdpau_decoder_select="vdpau mpeg1video_decoder" +mpeg1_vdpau_hwaccel_select="vdpau mpeg1video_decoder" +mpeg2_crystalhd_decoder_select="crystalhd" +mpeg2_dxva2_hwaccel_deps="dxva2api_h" +mpeg2_dxva2_hwaccel_select="dxva2 mpeg2video_decoder" +mpeg2_vdpau_hwaccel_select="vdpau mpeg2video_decoder" +mpeg2_vaapi_hwaccel_select="vaapi mpeg2video_decoder" +mpeg4_crystalhd_decoder_select="crystalhd" +mpeg4_vaapi_hwaccel_select="vaapi mpeg4_decoder" +mpeg4_vdpau_decoder_select="vdpau mpeg4_decoder" +msmpeg4_crystalhd_decoder_select="crystalhd" +vc1_crystalhd_decoder_select="crystalhd" +vc1_dxva2_hwaccel_deps="dxva2api_h" +vc1_dxva2_hwaccel_select="dxva2 vc1_decoder" +vc1_vaapi_hwaccel_select="vaapi vc1_decoder" +vc1_vdpau_decoder_select="vdpau vc1_decoder" +wmv3_crystalhd_decoder_select="crystalhd" +wmv3_dxva2_hwaccel_select="vc1_dxva2_hwaccel" +wmv3_vaapi_hwaccel_select="vc1_vaapi_hwaccel" +wmv3_vdpau_decoder_select="vc1_vdpau_decoder" + +# parsers +h264_parser_select="error_resilience golomb h264dsp h264pred mpegvideo" +mpeg4video_parser_select="error_resilience mpegvideo" +mpegvideo_parser_select="error_resilience mpegvideo" +vc1_parser_select="error_resilience mpegvideo" + +# external libraries +libaacplus_encoder_deps="libaacplus" +libcelt_decoder_deps="libcelt" +libfaac_encoder_deps="libfaac" +libfdk_aac_encoder_deps="libfdk_aac" +libgsm_decoder_deps="libgsm" +libgsm_encoder_deps="libgsm" +libgsm_ms_decoder_deps="libgsm" +libgsm_ms_encoder_deps="libgsm" +libilbc_decoder_deps="libilbc" +libilbc_encoder_deps="libilbc" +libmodplug_demuxer_deps="libmodplug" +libmp3lame_encoder_deps="libmp3lame" +libopencore_amrnb_decoder_deps="libopencore_amrnb" +libopencore_amrnb_encoder_deps="libopencore_amrnb" +libopencore_amrwb_decoder_deps="libopencore_amrwb" +libopenjpeg_decoder_deps="libopenjpeg" +libopenjpeg_encoder_deps="libopenjpeg" +libopus_decoder_deps="libopus" +libopus_encoder_deps="libopus" +libschroedinger_decoder_deps="libschroedinger" +libschroedinger_encoder_deps="libschroedinger" +libspeex_decoder_deps="libspeex" +libspeex_encoder_deps="libspeex" +libstagefright_h264_decoder_deps="libstagefright_h264" +libtheora_encoder_deps="libtheora" +libtwolame_encoder_deps="libtwolame" +libvo_aacenc_encoder_deps="libvo_aacenc" +libvo_amrwbenc_encoder_deps="libvo_amrwbenc" +libvorbis_decoder_deps="libvorbis" +libvorbis_encoder_deps="libvorbis" +libvpx_decoder_deps="libvpx" +libvpx_encoder_deps="libvpx" +libx264_encoder_deps="libx264" +libx264rgb_encoder_deps="libx264" +libxavs_encoder_deps="libxavs" +libxvid_encoder_deps="libxvid" +libutvideo_decoder_deps="libutvideo" +libutvideo_encoder_deps="libutvideo" + +# demuxers / muxers +ac3_demuxer_select="ac3_parser" +asf_stream_muxer_select="asf_muxer" +avisynth_demuxer_deps="avisynth" +dirac_demuxer_select="dirac_parser" +dts_demuxer_select="dca_parser" +dtshd_demuxer_select="dca_parser" +eac3_demuxer_select="ac3_parser" +f4v_muxer_select="mov_muxer" +flac_demuxer_select="flac_parser" +ipod_muxer_select="mov_muxer" +ismv_muxer_select="mov_muxer" +libnut_demuxer_deps="libnut" +libnut_muxer_deps="libnut" +matroska_audio_muxer_select="matroska_muxer" +matroska_demuxer_suggest="bzlib lzo zlib" +mov_demuxer_suggest="zlib" +mov_muxer_select="rtpenc_chain" +mp3_demuxer_select="mpegaudio_parser" +mp4_muxer_select="mov_muxer" +mpegts_muxer_select="adts_muxer latm_muxer mpegvideo" +mpegtsraw_demuxer_select="mpegts_demuxer" +mxf_d10_muxer_select="mxf_muxer" +ogg_demuxer_select="golomb" +psp_muxer_select="mov_muxer" +rtp_demuxer_select="sdp_demuxer" +rtp_muxer_select="mpegvideo" +rtpdec_select="asf_demuxer rm_demuxer rtp_protocol mpegts_demuxer mov_demuxer" +rtsp_demuxer_select="http_protocol rtpdec" +rtsp_muxer_select="rtp_muxer http_protocol rtp_protocol rtpenc_chain" +sap_demuxer_select="sdp_demuxer" +sap_muxer_select="rtp_muxer rtp_protocol rtpenc_chain" +sdp_demuxer_select="rtpdec" +smoothstreaming_muxer_select="ismv_muxer" +spdif_muxer_select="aac_parser" +tak_demuxer_select="tak_parser" +tg2_muxer_select="mov_muxer" +tgp_muxer_select="mov_muxer" +vobsub_demuxer_select="mpegps_demuxer" +w64_demuxer_deps="wav_demuxer" +w64_muxer_deps="wav_muxer" + +# indevs / outdevs +alsa_indev_deps="alsa_asoundlib_h snd_pcm_htimestamp" +alsa_outdev_deps="alsa_asoundlib_h" +bktr_indev_deps_any="dev_bktr_ioctl_bt848_h machine_ioctl_bt848_h dev_video_bktr_ioctl_bt848_h dev_ic_bt8xx_h" +caca_outdev_deps="libcaca" +dshow_indev_deps="IBaseFilter" +dshow_indev_extralibs="-lpsapi -lole32 -lstrmiids -luuid" +dv1394_indev_deps="dv1394 dv_demuxer" +fbdev_indev_deps="linux_fb_h" +iec61883_indev_deps="libiec61883" +jack_indev_deps="jack_jack_h sem_timedwait" +lavfi_indev_deps="avfilter" +libcdio_indev_deps="libcdio" +libdc1394_indev_deps="libdc1394" +libv4l2_indev_deps="libv4l2" +openal_indev_deps="openal" +oss_indev_deps_any="soundcard_h sys_soundcard_h" +oss_outdev_deps_any="soundcard_h sys_soundcard_h" +pulse_indev_deps="libpulse" +sdl_outdev_deps="sdl" +sndio_indev_deps="sndio_h" +sndio_outdev_deps="sndio_h" +v4l_indev_deps="linux_videodev_h" +v4l2_indev_deps_any="linux_videodev2_h sys_videoio_h" +vfwcap_indev_deps="capCreateCaptureWindow vfwcap_defines" +vfwcap_indev_extralibs="-lavicap32" +x11grab_indev_deps="x11grab" + +# protocols +bluray_protocol_deps="libbluray" +ffrtmpcrypt_protocol_deps="!librtmp_protocol" +ffrtmpcrypt_protocol_deps_any="gcrypt nettle openssl" +ffrtmpcrypt_protocol_select="tcp_protocol" +ffrtmphttp_protocol_deps="!librtmp_protocol" +ffrtmphttp_protocol_select="http_protocol" +gopher_protocol_select="network" +httpproxy_protocol_select="tcp_protocol" +http_protocol_select="tcp_protocol" +https_protocol_select="tls_protocol" +librtmp_protocol_deps="librtmp" +librtmpe_protocol_deps="librtmp" +librtmps_protocol_deps="librtmp" +librtmpt_protocol_deps="librtmp" +librtmpte_protocol_deps="librtmp" +mmsh_protocol_select="http_protocol" +mmst_protocol_select="network" +rtmp_protocol_deps="!librtmp_protocol" +rtmp_protocol_select="tcp_protocol" +rtmpe_protocol_select="ffrtmpcrypt_protocol" +rtmps_protocol_deps="!librtmp_protocol" +rtmps_protocol_select="tls_protocol" +rtmpt_protocol_select="ffrtmphttp_protocol" +rtmpte_protocol_select="ffrtmpcrypt_protocol ffrtmphttp_protocol" +rtmpts_protocol_select="ffrtmphttp_protocol https_protocol" +rtp_protocol_select="udp_protocol" +sctp_protocol_deps="struct_sctp_event_subscribe" +sctp_protocol_select="network" +tcp_protocol_select="network" +tls_protocol_deps_any="openssl gnutls" +tls_protocol_select="tcp_protocol" +udp_protocol_select="network" + +# filters +aconvert_filter_deps="swresample" +amovie_filter_deps="avcodec avformat" +aresample_filter_deps="swresample" +ass_filter_deps="libass" +asyncts_filter_deps="avresample" +atempo_filter_deps="avcodec rdft" +blackframe_filter_deps="gpl" +boxblur_filter_deps="gpl" +colormatrix_filter_deps="gpl" +cropdetect_filter_deps="gpl" +decimate_filter_deps="gpl avcodec" +delogo_filter_deps="gpl" +deshake_filter_deps="avcodec" +drawtext_filter_deps="libfreetype" +ebur128_filter_deps="gpl" +flite_filter_deps="libflite" +frei0r_filter_deps="frei0r dlopen" +frei0r_filter_extralibs='$ldl' +frei0r_src_filter_deps="frei0r dlopen" +frei0r_src_filter_extralibs='$ldl' +geq_filter_deps="gpl" +histeq_filter_deps="gpl" +hqdn3d_filter_deps="gpl" +hue_filter_deps="gpl" +kerndeint_filter_deps="gpl" +movie_filter_deps="avcodec avformat" +mp_filter_deps="gpl avcodec swscale inline_asm" +mptestsrc_filter_deps="gpl" +negate_filter_deps="lut_filter" +resample_filter_deps="avresample" +ocv_filter_deps="libopencv" +pan_filter_deps="swresample" +pp_filter_deps="gpl postproc" +removelogo_filter_deps="avcodec avformat swscale" +scale_filter_deps="swscale" +smartblur_filter_deps="gpl swscale" +showspectrum_filter_deps="avcodec rdft" +subtitles_filter_deps="avformat avcodec libass" +super2xsai_filter_deps="gpl" +tinterlace_filter_deps="gpl" +yadif_filter_deps="gpl" +pixfmts_super2xsai_test_deps="super2xsai_filter" +tinterlace_merge_test_deps="tinterlace_filter" +tinterlace_pad_test_deps="tinterlace_filter" + +# libraries +avcodec_deps="avutil" +avdevice_deps="avutil avcodec avformat" +avfilter_deps="avutil" +avformat_deps="avutil avcodec" +avresample_deps="avutil" +postproc_deps="avutil gpl" +swscale_deps="avutil" + +# programs +ffmpeg_deps="avcodec avfilter avformat swscale swresample" +ffmpeg_select="ffbuffersink_filter format_filter aformat_filter + setpts_filter null_filter anull_filter ffabuffersink_filter" +ffplay_deps="avcodec avformat swscale swresample sdl" +ffplay_select="ffbuffersink_filter rdft crop_filter" +ffprobe_deps="avcodec avformat" +ffserver_deps="avformat ffm_muxer fork rtp_protocol rtsp_demuxer" +ffserver_extralibs='$ldl' + +# documentation +podpages_deps="perl" +manpages_deps="perl pod2man" +htmlpages_deps="texi2html" +txtpages_deps="makeinfo" +doc_deps_any="manpages htmlpages podpages txtpages" + +# default parameters + +logfile="config.log" + +# installation paths +prefix_default="/usr/local" +bindir_default='${prefix}/bin' +datadir_default='${prefix}/share/ffmpeg' +incdir_default='${prefix}/include' +libdir_default='${prefix}/lib' +mandir_default='${prefix}/share/man' +shlibdir_default="$libdir_default" + +# toolchain +ar_default="ar" +cc_default="gcc" +cxx_default="g++" +host_cc_default="gcc" +cp_f="cp -f" +install="install" +ln_s="ln -sf" +nm_default="nm -g" +objformat="elf" +pkg_config_default=pkg-config +ranlib="ranlib" +strip_default="strip" +yasmexe_default="yasm" + +nogas=":" + +# machine +arch_default=$(uname -m) +cpu="generic" + +# OS +target_os_default=$(tolower $(uname -s)) +host_os=$target_os_default + +# configurable options +enable $PROGRAM_LIST +enable $DOCUMENT_LIST +enable $(filter_out avresample $LIBRARY_LIST) +enable stripping + +enable asm +enable debug +enable doc +enable optimizations +enable runtime_cpudetect +enable safe_bitstream_reader +enable static +enable swscale_alpha + +# build settings +SHFLAGS='-shared -Wl,-soname,$$(@F)' +FFSERVERLDFLAGS=-Wl,-E +LIBPREF="lib" +LIBSUF=".a" +FULLNAME='$(NAME)$(BUILDSUF)' +LIBNAME='$(LIBPREF)$(FULLNAME)$(LIBSUF)' +SLIBPREF="lib" +SLIBSUF=".so" +SLIBNAME='$(SLIBPREF)$(FULLNAME)$(SLIBSUF)' +SLIBNAME_WITH_VERSION='$(SLIBNAME).$(LIBVERSION)' +SLIBNAME_WITH_MAJOR='$(SLIBNAME).$(LIBMAJOR)' +LIB_INSTALL_EXTRA_CMD='$$(RANLIB) "$(LIBDIR)/$(LIBNAME)"' +SLIB_INSTALL_NAME='$(SLIBNAME_WITH_VERSION)' +SLIB_INSTALL_LINKS='$(SLIBNAME_WITH_MAJOR) $(SLIBNAME)' + +asflags_filter=echo +cflags_filter=echo +ldflags_filter=echo + +AS_C='-c' +AS_O='-o $@' +CC_C='-c' +CC_E='-E -o $@' +CC_O='-o $@' +CXX_C='-c' +CXX_O='-o $@' +LD_O='-o $@' +LD_LIB='-l%' +LD_PATH='-L' +HOSTCC_C='-c' +HOSTCC_O='-o $@' +HOSTLD_O='-o $@' + +host_cflags='-D_ISOC99_SOURCE -D_XOPEN_SOURCE=600 -O3 -g' +host_libs='-lm' +host_cflags_filter=echo +host_ldflags_filter=echo + +target_path='$(CURDIR)' + +# since the object filename is not given with the -MM flag, the compiler +# is only able to print the basename, and we must add the path ourselves +DEPCMD='$(DEP$(1)) $(DEP$(1)FLAGS) $($(1)DEP_FLAGS) $< | sed -e "/^\#.*/d" -e "s,^[[:space:]]*$(*F)\\.o,$(@D)/$(*F).o," > $(@:.o=.d)' +DEPFLAGS='-MM' + +# find source path +if test -f configure; then + source_path=. +else + source_path=$(cd $(dirname "$0"); pwd) + echo "$source_path" | grep -q '[[:blank:]]' && + die "Out of tree builds are impossible with whitespace in source path." + test -e "$source_path/config.h" && + die "Out of tree builds are impossible with config.h in source dir." +fi + +for v in "$@"; do + r=${v#*=} + l=${v%"$r"} + r=$(sh_quote "$r") + FFMPEG_CONFIGURATION="${FFMPEG_CONFIGURATION# } ${l}${r}" +done + +find_things(){ + thing=$1 + pattern=$2 + file=$source_path/$3 + sed -n "s/^[^#]*$pattern.*([^,]*, *\([^,]*\)\(,.*\)*).*/\1_$thing/p" "$file" +} + +ENCODER_LIST=$(find_things encoder ENC libavcodec/allcodecs.c) +DECODER_LIST=$(find_things decoder DEC libavcodec/allcodecs.c) +HWACCEL_LIST=$(find_things hwaccel HWACCEL libavcodec/allcodecs.c) +PARSER_LIST=$(find_things parser PARSER libavcodec/allcodecs.c) +BSF_LIST=$(find_things bsf BSF libavcodec/allcodecs.c) +MUXER_LIST=$(find_things muxer _MUX libavformat/allformats.c) +DEMUXER_LIST=$(find_things demuxer DEMUX libavformat/allformats.c) +OUTDEV_LIST=$(find_things outdev OUTDEV libavdevice/alldevices.c) +INDEV_LIST=$(find_things indev _IN libavdevice/alldevices.c) +PROTOCOL_LIST=$(find_things protocol PROTOCOL libavformat/allformats.c) +FILTER_LIST=$(find_things filter FILTER libavfilter/allfilters.c) + +ALL_COMPONENTS=" + $BSF_LIST + $DECODER_LIST + $DEMUXER_LIST + $ENCODER_LIST + $FILTER_LIST + $HWACCEL_LIST + $INDEV_LIST + $MUXER_LIST + $OUTDEV_LIST + $PARSER_LIST + $PROTOCOL_LIST +" + +for n in $COMPONENT_LIST; do + v=$(toupper ${n%s})_LIST + eval enable \$$v + eval ${n}_if_any="\$$v" +done + +enable $ARCH_EXT_LIST + +die_unknown(){ + echo "Unknown option \"$1\"." + echo "See $0 --help for available options." + exit 1 +} + +show_list() { + suffix=_$1 + shift + echo $* | sed s/$suffix//g | tr ' ' '\n' | sort | pr -3 -t + exit 0 +} + +rand_list(){ + IFS=', ' + set -- $* + unset IFS + for thing; do + comp=${thing%:*} + prob=${thing#$comp} + prob=${prob#:} + is_in ${comp} $COMPONENT_LIST && eval comp=\$$(toupper ${comp%s})_LIST + echo "prob ${prob:-0.5}" + printf '%s\n' $comp + done +} + +do_random(){ + action=$1 + shift + random_seed=$(awk "BEGIN { srand($random_seed); print srand() }") + $action $(rand_list "$@" | awk "BEGIN { srand($random_seed) } \$1 == \"prob\" { prob = \$2; next } rand() < prob { print }") +} + +for opt do + optval="${opt#*=}" + case "$opt" in + --extra-ldflags=*) + add_ldflags $optval + ;; + --extra-libs=*) + add_extralibs $optval + ;; + --disable-devices) + disable $INDEV_LIST $OUTDEV_LIST + ;; + --enable-debug=*) + debuglevel="$optval" + ;; + --disable-programs) + disable $PROGRAM_LIST + ;; + --disable-everything) + map 'eval unset \${$(toupper ${v%s})_LIST}' $COMPONENT_LIST + ;; + --disable-all) + map 'eval unset \${$(toupper ${v%s})_LIST}' $COMPONENT_LIST + disable $LIBRARY_LIST $PROGRAM_LIST doc + ;; + --enable-random|--disable-random) + action=${opt%%-random} + do_random ${action#--} $COMPONENT_LIST + ;; + --enable-random=*|--disable-random=*) + action=${opt%%-random=*} + do_random ${action#--} $optval + ;; + --enable-*=*|--disable-*=*) + eval $(echo "${opt%%=*}" | sed 's/--/action=/;s/-/ thing=/') + is_in "${thing}s" $COMPONENT_LIST || die_unknown "$opt" + eval list=\$$(toupper $thing)_LIST + name=$(echo "${optval}" | sed "s/,/_${thing}|/g")_${thing} + list=$(filter "$name" $list) + [ "$list" = "" ] && warn "Option $opt did not match anything" + $action $list + ;; + --enable-?*|--disable-?*) + eval $(echo "$opt" | sed 's/--/action=/;s/-/ option=/;s/-/_/g') + if is_in $option $COMPONENT_LIST; then + test $action = disable && action=unset + eval $action \$$(toupper ${option%s})_LIST + elif is_in $option $CMDLINE_SELECT; then + $action $option + else + die_unknown $opt + fi + ;; + --list-*) + NAME="${opt#--list-}" + is_in $NAME $COMPONENT_LIST || die_unknown $opt + NAME=${NAME%s} + eval show_list $NAME \$$(toupper $NAME)_LIST + ;; + --help|-h) show_help + ;; + --fatal-warnings) enable fatal_warnings + ;; + *) + optname="${opt%%=*}" + optname="${optname#--}" + optname=$(echo "$optname" | sed 's/-/_/g') + if is_in $optname $CMDLINE_SET; then + eval $optname='$optval' + elif is_in $optname $CMDLINE_APPEND; then + append $optname "$optval" + else + die_unknown $opt + fi + ;; + esac +done + +disabled logging && logfile=/dev/null + +echo "# $0 $FFMPEG_CONFIGURATION" > $logfile +set >> $logfile + +test -n "$cross_prefix" && enable cross_compile + +if enabled cross_compile; then + test -n "$arch" && test -n "$target_os" || + die "Must specify target arch and OS when cross-compiling" +fi + +ar_default="${cross_prefix}${ar_default}" +cc_default="${cross_prefix}${cc_default}" +cxx_default="${cross_prefix}${cxx_default}" +nm_default="${cross_prefix}${nm_default}" +pkg_config_default="${cross_prefix}${pkg_config_default}" +ranlib="${cross_prefix}${ranlib}" +strip_default="${cross_prefix}${strip_default}" + +sysinclude_default="${sysroot}/usr/include" + +case "$toolchain" in + clang-asan) + cc_default="clang" + add_cflags -faddress-sanitizer + add_ldflags -faddress-sanitizer + ;; + clang-tsan) + cc_default="clang" + add_cflags -fthread-sanitizer + add_ldflags -fthread-sanitizer + ;; + msvc) + cc_default="c99wrap cl" + ld_default="c99wrap link" + nm_default="dumpbin -symbols" + ar_default="lib" + target_os_default="win32" + ;; + ?*) + die "Unknown toolchain $toolchain" + ;; +esac + +set_default arch cc cxx pkg_config strip sysinclude target_os yasmexe +enabled cross_compile || host_cc_default=$cc +set_default host_cc + +if ! $pkg_config --version >/dev/null 2>&1; then + warn "$pkg_config not found, library detection may fail." + pkg_config=false +fi + +exesuf() { + case $1 in + mingw32*|win32|win64|cygwin*|*-dos|freedos|opendos|os/2*|symbian) echo .exe ;; + esac +} + +EXESUF=$(exesuf $target_os) +HOSTEXESUF=$(exesuf $host_os) + +# set temporary file name +: ${TMPDIR:=$TEMPDIR} +: ${TMPDIR:=$TMP} +: ${TMPDIR:=/tmp} + +if ! check_cmd mktemp -u XXXXXX; then + # simple replacement for missing mktemp + # NOT SAFE FOR GENERAL USE + mktemp(){ + echo "${2%%XXX*}.${HOSTNAME}.${UID}.$$" + } +fi + +tmpfile(){ + tmp=$(mktemp -u "${TMPDIR}/ffconf.XXXXXXXX")$2 && + (set -C; exec > $tmp) 2>/dev/null || + die "Unable to create temporary file in $TMPDIR." + append TMPFILES $tmp + eval $1=$tmp +} + +trap 'rm -f -- $TMPFILES' EXIT + +tmpfile TMPASM .asm +tmpfile TMPC .c +tmpfile TMPCPP .cpp +tmpfile TMPE $EXESUF +tmpfile TMPH .h +tmpfile TMPO .o +tmpfile TMPS .S +tmpfile TMPSH .sh +tmpfile TMPV .ver + +unset -f mktemp + +chmod +x $TMPE + +# make sure we can execute files in $TMPDIR +cat > $TMPSH 2>> $logfile <> $logfile 2>&1 +if ! $TMPSH >> $logfile 2>&1; then + cat <&1 | grep -q '^gcc.*LLVM'; then + _type=llvm_gcc + gcc_extra_ver=$(expr "$($_cc --version | head -n1)" : '.*\((.*)\)') + _ident="llvm-gcc $($_cc -dumpversion) $gcc_extra_ver" + _depflags='-MMD -MF $(@:.o=.d) -MT $@' + _cflags_speed='-O3' + _cflags_size='-Os' + elif $_cc -v 2>&1 | grep -qi ^gcc; then + _type=gcc + gcc_version=$($_cc --version | head -n1) + gcc_basever=$($_cc -dumpversion) + gcc_pkg_ver=$(expr "$gcc_version" : '[^ ]* \(([^)]*)\)') + gcc_ext_ver=$(expr "$gcc_version" : ".*$gcc_pkg_ver $gcc_basever \\(.*\\)") + _ident=$(cleanws "gcc $gcc_basever $gcc_pkg_ver $gcc_ext_ver") + if ! $_cc -dumpversion | grep -q '^2\.'; then + _depflags='-MMD -MF $(@:.o=.d) -MT $@' + fi + _cflags_speed='-O3' + _cflags_size='-Os' + elif $_cc --version 2>/dev/null | grep -q Intel; then + _type=icc + _ident=$($_cc --version | head -n1) + _depflags='-MMD' + _cflags_speed='-O3' + _cflags_size='-Os' + _cflags_noopt='-O1' + elif $_cc -v 2>&1 | grep -q xlc; then + _type=xlc + _ident=$($_cc -qversion 2>/dev/null | head -n1) + _cflags_speed='-O5' + _cflags_size='-O5 -qcompact' + elif $_cc -V 2>/dev/null | grep -q Compaq; then + _type=ccc + _ident=$($_cc -V | head -n1 | cut -d' ' -f1-3) + _DEPFLAGS='-M' + _cflags_speed='-fast' + _cflags_size='-O1' + _flags_filter=ccc_flags + elif $_cc --vsn 2>/dev/null | grep -q "ARM C/C++ Compiler"; then + test -d "$sysroot" || die "No valid sysroot specified." + _type=armcc + _ident=$($_cc --vsn | head -n1) + armcc_conf="$PWD/armcc.conf" + $_cc --arm_linux_configure \ + --arm_linux_config_file="$armcc_conf" \ + --configure_sysroot="$sysroot" \ + --configure_cpp_headers="$sysinclude" >>$logfile 2>&1 || + die "Error creating armcc configuration file." + $_cc --vsn | grep -q RVCT && armcc_opt=rvct || armcc_opt=armcc + _flags="--arm_linux_config_file=$armcc_conf --translate_gcc" + as_default="${cross_prefix}gcc" + _depflags='-MMD' + _cflags_speed='-O3' + _cflags_size='-Os' + elif $_cc -version 2>/dev/null | grep -Eq 'TMS470|TI ARM'; then + _type=tms470 + _ident=$($_cc -version | head -n1 | tr -s ' ') + _flags='--gcc --abi=eabi -me' + _cc_e='-ppl -fe=$@' + _cc_o='-fe=$@' + _depflags='-ppa -ppd=$(@:.o=.d)' + _cflags_speed='-O3 -mf=5' + _cflags_size='-O3 -mf=2' + _flags_filter=tms470_flags + elif $_cc -v 2>&1 | grep -q clang; then + _type=clang + _ident=$($_cc --version | head -n1) + _depflags='-MMD' + _cflags_speed='-O3' + _cflags_size='-Os' + elif $_cc -V 2>&1 | grep -q Sun; then + _type=suncc + _ident=$($_cc -V 2>&1 | head -n1 | cut -d' ' -f 2-) + _DEPCMD='$(DEP$(1)) $(DEP$(1)FLAGS) $($(1)DEP_FLAGS) $< | sed -e "1s,^.*: ,$@: ," -e "\$$!s,\$$, \\\," -e "1!s,^.*: , ," > $(@:.o=.d)' + _DEPFLAGS='-xM1 -xc99' + _ldflags='-std=c99' + _cflags_speed='-O5' + _cflags_size='-O5 -xspace' + _flags_filter=suncc_flags + elif $_cc -v 2>&1 | grep -q 'PathScale\|Path64'; then + _type=pathscale + _ident=$($_cc -v 2>&1 | head -n1 | tr -d :) + _depflags='-MMD -MF $(@:.o=.d) -MT $@' + _cflags_speed='-O2' + _cflags_size='-Os' + _flags_filter='filter_out -Wdisabled-optimization' + elif $_cc -v 2>&1 | grep -q Open64; then + _type=open64 + _ident=$($_cc -v 2>&1 | head -n1 | tr -d :) + _depflags='-MMD -MF $(@:.o=.d) -MT $@' + _cflags_speed='-O2' + _cflags_size='-Os' + _flags_filter='filter_out -Wdisabled-optimization|-Wtype-limits|-fno-signed-zeros' + elif $_cc -V 2>&1 | grep -q Portland; then + _type=pgi + _ident="PGI $($_cc -V 2>&1 | awk '/^pgcc/ { print $2; exit }')" + opt_common='-alias=ansi -Mdse -Mlre -Mpre' + _cflags_speed="-O3 -Mautoinline -Munroll=c:4 $opt_common" + _cflags_size="-O2 -Munroll=c:1 $opt_common" + _cflags_noopt="-O1" + _flags_filter=pgi_flags + elif $_cc 2>&1 | grep -q Microsoft; then + _type=msvc + _ident=$($cc 2>&1 | head -n1) + _DEPCMD='$(DEP$(1)) $(DEP$(1)FLAGS) $($(1)DEP_FLAGS) $< 2>&1 | awk '\''/including/ { sub(/^.*file: */, ""); gsub(/\\/, "/"); if (!match($$0, / /)) print "$@:", $$0 }'\'' > $(@:.o=.d)' + _DEPFLAGS='$(CPPFLAGS) $(CFLAGS) -showIncludes -Zs' + _cflags_speed="-O2" + _cflags_size="-O1" + # Nonstandard output options, to avoid msys path conversion issues, relies on wrapper to remap it + if $_cc 2>&1 | grep -q Linker; then + _ld_o='-out $@' + else + _ld_o='-Fe$@' + fi + _cc_o='-Fo $@' + _cc_e='-P -Fi $@' + _flags_filter=msvc_flags + _ld_lib='lib%.a' + _ld_path='-libpath:' + _flags='-nologo' + _cflags='-D_USE_MATH_DEFINES -Dinline=__inline -FIstdlib.h -Dstrtoll=_strtoi64' + if [ $pfx = hostcc ]; then + append _cflags -Dsnprintf=_snprintf + fi + disable stripping + fi + + eval ${pfx}_type=\$_type + eval ${pfx}_ident=\$_ident +} + +set_ccvars(){ + eval ${1}_C=\${_cc_c-\${${1}_C}} + eval ${1}_E=\${_cc_e-\${${1}_E}} + eval ${1}_O=\${_cc_o-\${${1}_O}} + + if [ -n "$_depflags" ]; then + eval ${1}_DEPFLAGS=\$_depflags + else + eval ${1}DEP=\${_DEPCMD:-\$DEPCMD} + eval ${1}DEP_FLAGS=\${_DEPFLAGS:-\$DEPFLAGS} + eval DEP${1}FLAGS=\$_flags + fi +} + +probe_cc cc "$cc" +cflags_filter=$_flags_filter +cflags_speed=$_cflags_speed +cflags_size=$_cflags_size +cflags_noopt=$_cflags_noopt +add_cflags $_flags $_cflags +cc_ldflags=$_ldflags +set_ccvars CC + +probe_cc hostcc "$host_cc" +host_cflags_filter=$_flags_filter +add_host_cflags $_flags $_cflags +set_ccvars HOSTCC + +test -n "$cc_type" && enable $cc_type || + warn "Unknown C compiler $cc, unable to select optimal CFLAGS" + +: ${as_default:=$cc} +: ${dep_cc_default:=$cc} +: ${ld_default:=$cc} +: ${host_ld_default:=$host_cc} +set_default ar as dep_cc ld host_ld + +probe_cc as "$as" +asflags_filter=$_flags_filter +add_asflags $_flags $_cflags +set_ccvars AS + +probe_cc ld "$ld" +ldflags_filter=$_flags_filter +add_ldflags $_flags $_ldflags +test "$cc_type" != "$ld_type" && add_ldflags $cc_ldflags +LD_O=${_ld_o-$LD_O} +LD_LIB=${_ld_lib-$LD_LIB} +LD_PATH=${_ld_path-$LD_PATH} + +probe_cc hostld "$host_ld" +host_ldflags_filter=$_flags_filter +add_host_ldflags $_flags $_ldflags +HOSTLD_O=${_ld_o-$HOSTLD_O} + +if [ -z "$CC_DEPFLAGS" ] && [ "$dep_cc" != "$cc" ]; then + probe_cc depcc "$dep_cc" + CCDEP=${_DEPCMD:-$DEPCMD} + CCDEP_FLAGS=${_DEPFLAGS:=$DEPFLAGS} + DEPCCFLAGS=$_flags +fi + +if $ar 2>&1 | grep -q Microsoft; then + arflags="-nologo" + ar_o='-out:$@' +elif $ar 2>&1 | grep -q 'Texas Instruments'; then + arflags="rq" + ar_o='$@' +else + arflags="rc" + ar_o='$@' +fi + +add_cflags $extra_cflags +add_cxxflags $extra_cxxflags +add_asflags $extra_cflags + +if test -n "$sysroot"; then + case "$cc_type" in + gcc|llvm_gcc|clang) + add_cppflags --sysroot="$sysroot" + add_ldflags --sysroot="$sysroot" + ;; + tms470) + add_cppflags -I"$sysinclude" + add_ldflags --sysroot="$sysroot" + ;; + esac +fi + +if test "$cpu" = host; then + enabled cross_compile && die "--cpu=host makes no sense when cross-compiling." + + case "$cc_type" in + gcc|llvm_gcc) + check_native(){ + $cc $1=native -v -c -o $TMPO $TMPC >$TMPE 2>&1 || return + sed -n "/cc1.*$1=/{ + s/.*$1=\\([^ ]*\\).*/\\1/ + p + q + }" $TMPE + } + cpu=$(check_native -march || check_native -mcpu) + ;; + esac + + test "${cpu:-host}" = host && die "--cpu=host not supported with compiler $cc" +fi + +# Deal with common $arch aliases +case "$arch" in + aarch64|arm64) + arch="aarch64" + ;; + arm*|iPad*) + arch="arm" + ;; + mips*|IP*) + arch="mips" + ;; + parisc*|hppa*) + arch="parisc" + ;; + "Power Macintosh"|ppc*|powerpc*) + arch="ppc" + ;; + s390|s390x) + arch="s390" + ;; + sh4|sh) + arch="sh4" + ;; + sun4u|sparc*) + arch="sparc" + ;; + tilegx|tile-gx) + arch="tilegx" + ;; + i[3-6]86|i86pc|BePC|x86pc|x86_64|x86_32|amd64) + arch="x86" + ;; +esac + +is_in $arch $ARCH_LIST || warn "unknown architecture $arch" +enable $arch + +# Add processor-specific flags +if enabled aarch64; then + + case $cpu in + armv*) + cpuflags="-march=$cpu" + ;; + *) + cpuflags="-mcpu=$cpu" + ;; + esac + +elif enabled alpha; then + + cpuflags="-mcpu=$cpu" + +elif enabled arm; then + + check_arm_arch() { + check_cpp_condition stddef.h \ + "defined __ARM_ARCH_${1}__ || defined __TARGET_ARCH_${2:-$1}" \ + $cpuflags + } + + probe_arm_arch() { + if check_arm_arch 4; then echo armv4; + elif check_arm_arch 4T; then echo armv4t; + elif check_arm_arch 5; then echo armv5; + elif check_arm_arch 5E; then echo armv5e; + elif check_arm_arch 5T; then echo armv5t; + elif check_arm_arch 5TE; then echo armv5te; + elif check_arm_arch 5TEJ; then echo armv5te; + elif check_arm_arch 6; then echo armv6; + elif check_arm_arch 6J; then echo armv6j; + elif check_arm_arch 6K; then echo armv6k; + elif check_arm_arch 6Z; then echo armv6z; + elif check_arm_arch 6ZK; then echo armv6zk; + elif check_arm_arch 6T2; then echo armv6t2; + elif check_arm_arch 7; then echo armv7; + elif check_arm_arch 7A 7_A; then echo armv7-a; + elif check_arm_arch 7R 7_R; then echo armv7-r; + elif check_arm_arch 7M 7_M; then echo armv7-m; + elif check_arm_arch 7EM 7E_M; then echo armv7-m; + elif check_arm_arch 8A 8_A; then echo armv8-a; + fi + } + + [ "$cpu" = generic ] && cpu=$(probe_arm_arch) + + case $cpu in + armv*) + cpuflags="-march=$cpu" + subarch=$(echo $cpu | sed 's/[^a-z0-9]//g') + ;; + *) + cpuflags="-mcpu=$cpu" + case $cpu in + cortex-a*) subarch=armv7a ;; + cortex-r*) subarch=armv7r ;; + cortex-m*) enable thumb; subarch=armv7m ;; + arm11*) subarch=armv6 ;; + arm[79]*e*|arm9[24]6*|arm96*|arm102[26]) subarch=armv5te ;; + armv4*|arm7*|arm9[24]*) subarch=armv4 ;; + *) subarch=$(probe_arm_arch) ;; + esac + ;; + esac + + case "$subarch" in + armv5t*) enable fast_clz ;; + armv[6-8]*) enable fast_clz fast_unaligned ;; + esac + +elif enabled avr32; then + + case $cpu in + ap7[02]0[0-2]) + subarch="avr32_ap" + cpuflags="-mpart=$cpu" + ;; + ap) + subarch="avr32_ap" + cpuflags="-march=$cpu" + ;; + uc3[ab]*) + subarch="avr32_uc" + cpuflags="-mcpu=$cpu" + ;; + uc) + subarch="avr32_uc" + cpuflags="-march=$cpu" + ;; + esac + +elif enabled bfin; then + + cpuflags="-mcpu=$cpu" + +elif enabled mips; then + + cpuflags="-march=$cpu" + + case $cpu in + 24kc) + disable mipsfpu + disable mipsdspr1 + disable mipsdspr2 + ;; + 24kf*) + disable mipsdspr1 + disable mipsdspr2 + ;; + 24kec|34kc|1004kc) + disable mipsfpu + disable mipsdspr2 + ;; + 24kef*|34kf*|1004kf*) + disable mipsdspr2 + ;; + 74kc) + disable mipsfpu + ;; + esac + +elif enabled ppc; then + + case $(tolower $cpu) in + 601|ppc601|powerpc601) + cpuflags="-mcpu=601" + disable altivec + ;; + 603*|ppc603*|powerpc603*) + cpuflags="-mcpu=603" + disable altivec + ;; + 604*|ppc604*|powerpc604*) + cpuflags="-mcpu=604" + disable altivec + ;; + g3|75*|ppc75*|powerpc75*) + cpuflags="-mcpu=750" + disable altivec + ;; + g4|745*|ppc745*|powerpc745*) + cpuflags="-mcpu=7450" + ;; + 74*|ppc74*|powerpc74*) + cpuflags="-mcpu=7400" + ;; + g5|970|ppc970|powerpc970) + cpuflags="-mcpu=970" + ;; + power[3-7]*) + cpuflags="-mcpu=$cpu" + ;; + cell) + cpuflags="-mcpu=cell" + enable ldbrx + ;; + e500mc) + cpuflags="-mcpu=e500mc" + disable altivec + ;; + e500v2) + cpuflags="-mcpu=8548 -mhard-float -mfloat-gprs=double" + disable altivec + ;; + e500) + cpuflags="-mcpu=8540 -mhard-float" + disable altivec + ;; + esac + +elif enabled sparc; then + + case $cpu in + cypress|f93[04]|tsc701|sparcl*|supersparc|hypersparc|niagara|v[789]) + cpuflags="-mcpu=$cpu" + disable vis + ;; + ultrasparc*|niagara[234]) + cpuflags="-mcpu=$cpu" + ;; + esac + +elif enabled x86; then + + case $cpu in + i[345]86|pentium) + cpuflags="-march=$cpu" + disable mmx + ;; + # targets that do NOT support conditional mov (cmov) + pentium-mmx|k6|k6-[23]|winchip-c6|winchip2|c3) + cpuflags="-march=$cpu" + disable cmov + ;; + # targets that do support conditional mov (cmov) + i686|pentiumpro|pentium[23]|pentium-m|athlon|athlon-tbird|athlon-4|athlon-[mx]p|athlon64*|k8*|opteron*|athlon-fx|core2|corei7*|amdfam10|barcelona|atom|bdver*) + cpuflags="-march=$cpu" + enable cmov + enable fast_cmov + ;; + # targets that do support conditional mov but on which it's slow + pentium4|pentium4m|prescott|nocona) + cpuflags="-march=$cpu" + enable cmov + disable fast_cmov + ;; + esac + +fi + +if [ "$cpu" != generic ]; then + add_cflags $cpuflags + add_asflags $cpuflags +fi + +# compiler sanity check +check_exec < +EOF +check_cc -D_LARGEFILE_SOURCE < +EOF + +check_host_cflags -std=c99 +check_host_cflags -Wall + +check_64bit(){ + arch32=$1 + arch64=$2 + expr=$3 + check_code cc "" "int test[2*($expr) - 1]" && + subarch=$arch64 || subarch=$arch32 +} + +case "$arch" in + aarch64|alpha|ia64) + spic=$shared + ;; + mips) + check_64bit mips mips64 '_MIPS_SIM > 1' + spic=$shared + ;; + parisc) + check_64bit parisc parisc64 'sizeof(void *) > 4' + spic=$shared + ;; + ppc) + check_64bit ppc ppc64 'sizeof(void *) > 4' + spic=$shared + ;; + sparc) + check_64bit sparc sparc64 'sizeof(void *) > 4' + spic=$shared + ;; + x86) + check_64bit x86_32 x86_64 'sizeof(void *) > 4' + if test "$subarch" = "x86_64"; then + spic=$shared + fi + ;; + ppc) + check_cc < mapfile && add_ldflags -Wl,-M,mapfile + nm_default='nm -P -g' + ;; + netbsd) + disable symver + oss_indev_extralibs="-lossaudio" + oss_outdev_extralibs="-lossaudio" + enabled gcc || check_ldflags -Wl,-zmuldefs + ;; + openbsd|bitrig) + # On OpenBSD 4.5. the compiler does not use PIC unless + # explicitly using -fPIC. FFmpeg builds fine without PIC, + # however the generated executable will not do anything + # (simply quits with exit-code 1, no crash, no output). + # Thus explicitly enable PIC here. + enable pic + disable symver + SHFLAGS='-shared' + SLIBNAME_WITH_MAJOR='$(SLIBNAME).$(LIBVERSION)' + SLIB_INSTALL_LINKS= + oss_indev_extralibs="-lossaudio" + oss_outdev_extralibs="-lossaudio" + ;; + dragonfly) + disable symver + ;; + freebsd) + ;; + bsd/os) + add_extralibs -lpoll -lgnugetopt + strip="strip -d" + ;; + darwin) + gas="gas-preprocessor.pl $cc" + enabled ppc && add_asflags -force_cpusubtype_ALL + SHFLAGS='-dynamiclib -Wl,-single_module -Wl,-install_name,$(SHLIBDIR)/$(SLIBNAME_WITH_MAJOR),-current_version,$(LIBVERSION),-compatibility_version,$(LIBMAJOR)' + enabled x86_32 && append SHFLAGS -Wl,-read_only_relocs,suppress + strip="${strip} -x" + add_ldflags -Wl,-dynamic,-search_paths_first + SLIBSUF=".dylib" + SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME).$(LIBVERSION)$(SLIBSUF)' + SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(FULLNAME).$(LIBMAJOR)$(SLIBSUF)' + FFSERVERLDFLAGS=-Wl,-bind_at_load + objformat="macho" + enabled x86_64 && objformat="macho64" + enabled_any pic shared || + { check_cflags -mdynamic-no-pic && add_asflags -mdynamic-no-pic; } + ;; + mingw32*) + if test $target_os = "mingw32ce"; then + disable network + else + target_os=mingw32 + fi + LIBTARGET=i386 + if enabled x86_64; then + LIBTARGET="i386:x86-64" + elif enabled arm; then + LIBTARGET=arm-wince + fi + shlibdir_default="$bindir_default" + SLIBPREF="" + SLIBSUF=".dll" + SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME)-$(LIBVERSION)$(SLIBSUF)' + SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(FULLNAME)-$(LIBMAJOR)$(SLIBSUF)' + dlltool="${cross_prefix}dlltool" + if check_cmd lib.exe -list; then + SLIB_EXTRA_CMD=-'sed -e "s/ @[^ ]*//" $$(@:$(SLIBSUF)=.orig.def) > $$(@:$(SLIBSUF)=.def); lib.exe /machine:$(LIBTARGET) /def:$$(@:$(SLIBSUF)=.def) /out:$(SUBDIR)$(SLIBNAME:$(SLIBSUF)=.lib)' + if enabled x86_64; then + LIBTARGET=x64 + fi + elif check_cmd $dlltool --version; then + SLIB_EXTRA_CMD=-'sed -e "s/ @[^ ]*//" $$(@:$(SLIBSUF)=.orig.def) > $$(@:$(SLIBSUF)=.def); $(DLLTOOL) -m $(LIBTARGET) -d $$(@:$(SLIBSUF)=.def) -l $(SUBDIR)$(SLIBNAME:$(SLIBSUF)=.lib) -D $(SLIBNAME_WITH_MAJOR)' + fi + SLIB_INSTALL_NAME='$(SLIBNAME_WITH_MAJOR)' + SLIB_INSTALL_LINKS= + SLIB_INSTALL_EXTRA_SHLIB='$(SLIBNAME:$(SLIBSUF)=.lib)' + SLIB_INSTALL_EXTRA_LIB='lib$(SLIBNAME:$(SLIBSUF)=.dll.a) $(SLIBNAME_WITH_MAJOR:$(SLIBSUF)=.def)' + SHFLAGS='-shared -Wl,--output-def,$$(@:$(SLIBSUF)=.orig.def) -Wl,--out-implib,$(SUBDIR)lib$(SLIBNAME:$(SLIBSUF)=.dll.a) -Wl,--enable-runtime-pseudo-reloc -Wl,--enable-auto-image-base' + objformat="win32" + ranlib=: + enable dos_paths + add_cppflags -U__STRICT_ANSI__ + ;; + win32|win64) + if enabled shared; then + # Link to the import library instead of the normal static library + # for shared libs. + LD_LIB='%.lib' + # Cannot build shared and static libraries at the same time with + # MSVC. + disable static + fi + shlibdir_default="$bindir_default" + SLIBPREF="" + SLIBSUF=".dll" + SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME)-$(LIBVERSION)$(SLIBSUF)' + SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(FULLNAME)-$(LIBMAJOR)$(SLIBSUF)' + SLIB_CREATE_DEF_CMD='makedef $(SUBDIR)lib$(NAME).ver $(OBJS) > $$(@:$(SLIBSUF)=.def)' + SLIB_INSTALL_NAME='$(SLIBNAME_WITH_MAJOR)' + SLIB_INSTALL_LINKS= + SLIB_INSTALL_EXTRA_SHLIB='$(SLIBNAME:$(SLIBSUF)=.lib)' + SLIB_INSTALL_EXTRA_LIB='$(SLIBNAME_WITH_MAJOR:$(SLIBSUF)=.def)' + SHFLAGS='-dll -def:$$(@:$(SLIBSUF)=.def) -implib:$(SUBDIR)$(SLIBNAME:$(SLIBSUF)=.lib)' + objformat="win32" + ranlib=: + enable dos_paths + ;; + cygwin*) + target_os=cygwin + shlibdir_default="$bindir_default" + SLIBPREF="cyg" + SLIBSUF=".dll" + SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME)-$(LIBVERSION)$(SLIBSUF)' + SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(FULLNAME)-$(LIBMAJOR)$(SLIBSUF)' + SLIB_INSTALL_NAME='$(SLIBNAME_WITH_MAJOR)' + SLIB_INSTALL_LINKS= + SLIB_INSTALL_EXTRA_LIB='lib$(FULLNAME).dll.a' + SHFLAGS='-shared -Wl,--out-implib,$(SUBDIR)lib$(FULLNAME).dll.a' + objformat="win32" + enable dos_paths + ;; + *-dos|freedos|opendos) + network_extralibs="-lsocket" + objformat="coff" + enable dos_paths + add_cppflags -U__STRICT_ANSI__ + ;; + linux) + enable dv1394 + ;; + irix*) + target_os=irix + ranlib="echo ignoring ranlib" + ;; + os/2*) + strip="lxlite -CS" + ln_s="cp -f" + objformat="aout" + add_cppflags -D_GNU_SOURCE + add_ldflags -Zomf -Zbin-files -Zargs-wild -Zmap + SHFLAGS='$(SUBDIR)$(NAME).def -Zdll -Zomf' + FFSERVERLDFLAGS="" + LIBSUF="_s.a" + SLIBPREF="" + SLIBSUF=".dll" + SLIBNAME_WITH_VERSION='$(SLIBPREF)$(NAME)-$(LIBVERSION)$(SLIBSUF)' + SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(shell echo $(NAME) | cut -c1-6)$(LIBMAJOR)$(SLIBSUF)' + SLIB_CREATE_DEF_CMD='echo LIBRARY $(SLIBNAME_WITH_MAJOR) INITINSTANCE TERMINSTANCE > $(SUBDIR)$(NAME).def; \ + echo PROTMODE >> $(SUBDIR)$(NAME).def; \ + echo CODE PRELOAD MOVEABLE DISCARDABLE >> $(SUBDIR)$(NAME).def; \ + echo DATA PRELOAD MOVEABLE MULTIPLE NONSHARED >> $(SUBDIR)$(NAME).def; \ + echo EXPORTS >> $(SUBDIR)$(NAME).def; \ + emxexp -o $(OBJS) >> $(SUBDIR)$(NAME).def' + SLIB_EXTRA_CMD='emximp -o $(SUBDIR)$(LIBPREF)$(NAME)_dll.a $(SUBDIR)$(NAME).def; \ + emximp -o $(SUBDIR)$(LIBPREF)$(NAME)_dll.lib $(SUBDIR)$(NAME).def;' + SLIB_INSTALL_EXTRA_LIB='$(LIBPREF)$(NAME)_dll.a $(LIBPREF)$(NAME)_dll.lib' + enable dos_paths + enable_weak os2threads + ;; + gnu/kfreebsd) + add_cppflags -D_BSD_SOURCE + ;; + gnu) + ;; + qnx) + add_cppflags -D_QNX_SOURCE + network_extralibs="-lsocket" + ;; + symbian) + SLIBSUF=".dll" + enable dos_paths + add_cflags --include=$sysinclude/gcce/gcce.h -fvisibility=default + add_cppflags -D__GCCE__ -D__SYMBIAN32__ -DSYMBIAN_OE_POSIX_SIGNALS + add_ldflags -Wl,--target1-abs,--no-undefined \ + -Wl,-Ttext,0x80000,-Tdata,0x1000000 -shared \ + -Wl,--entry=_E32Startup -Wl,-u,_E32Startup + add_extralibs -l:eexe.lib -l:usrt2_2.lib -l:dfpaeabi.dso \ + -l:drtaeabi.dso -l:scppnwdl.dso -lsupc++ -lgcc \ + -l:libc.dso -l:libm.dso -l:euser.dso -l:libcrt0.lib + ;; + osf1) + add_cppflags -D_OSF_SOURCE -D_POSIX_PII -D_REENTRANT + FFSERVERLDFLAGS= + ;; + minix) + ;; + plan9) + add_cppflags -D_C99_SNPRINTF_EXTENSION \ + -D_REENTRANT_SOURCE \ + -D_RESEARCH_SOURCE \ + -DFD_SETSIZE=96 \ + -DHAVE_SOCK_OPTS + add_compat strtod.o strtod=avpriv_strtod + network_extralibs='-lbsd' + exeobjs=compat/plan9/main.o + disable ffserver + ln_s='ln -s -f' + cp_f='cp' + ;; + none) + ;; + *) + die "Unknown OS '$target_os'." + ;; +esac + +# determine libc flavour + +if check_cpp_condition features.h "defined __UCLIBC__"; then + libc_type=uclibc + add_cppflags -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 +elif check_cpp_condition features.h "defined __GLIBC__"; then + libc_type=glibc + add_cppflags -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 +elif check_header _mingw.h; then + libc_type=mingw + check_cpp_condition _mingw.h \ + "defined (__MINGW64_VERSION_MAJOR) || (__MINGW32_MAJOR_VERSION > 3) || \ + (__MINGW32_MAJOR_VERSION == 3 && __MINGW32_MINOR_VERSION >= 15)" || + die "ERROR: MinGW runtime version must be >= 3.15." + if check_cpp_condition _mingw.h "defined(__MINGW64_VERSION_MAJOR) && \ + __MINGW64_VERSION_MAJOR < 3"; then + add_compat msvcrt/snprintf.o + add_cflags "-include $source_path/compat/msvcrt/snprintf.h" + fi +elif check_cpp_condition newlib.h "defined _NEWLIB_VERSION"; then + libc_type=newlib + add_cppflags -U__STRICT_ANSI__ +elif check_func_headers stdlib.h _get_doserrno; then + libc_type=msvcrt + add_compat strtod.o strtod=avpriv_strtod + add_compat msvcrt/snprintf.o snprintf=avpriv_snprintf \ + _snprintf=avpriv_snprintf \ + vsnprintf=avpriv_vsnprintf +elif check_cpp_condition stddef.h "defined __KLIBC__"; then + libc_type=klibc +fi + +test -n "$libc_type" && enable $libc_type + +# hacks for compiler/libc/os combinations + +if enabled_all tms470 glibc; then + CPPFLAGS="-I${source_path}/compat/tms470 ${CPPFLAGS}" + add_cppflags -D__USER_LABEL_PREFIX__= + add_cppflags -D__builtin_memset=memset + add_cppflags -D__gnuc_va_list=va_list -D_VA_LIST_DEFINED + add_cflags -pds=48 # incompatible redefinition of macro +fi + +if enabled_all ccc glibc; then + add_ldflags -Wl,-z,now # calls to libots crash without this +fi + +esc(){ + echo "$*" | sed 's/%/%25/g;s/:/%3a/g' +} + +echo "config:$arch:$subarch:$cpu:$target_os:$(esc $cc_ident):$(esc $FFMPEG_CONFIGURATION)" >config.fate + +check_cpp_condition stdlib.h "defined(__PIC__) || defined(__pic__) || defined(PIC)" && enable pic + +set_default $PATHS_LIST +set_default nm + +# we need to build at least one lib type +if ! enabled_any static shared; then + cat <= 2.0.0" aacplus.h aacplusEncOpen -laacplus +enabled libass && require_pkg_config libass ass/ass.h ass_library_init +enabled libbluray && require libbluray libbluray/bluray.h bd_open -lbluray +enabled libcelt && require libcelt celt/celt.h celt_decode -lcelt0 && + { check_lib celt/celt.h celt_decoder_create_custom -lcelt0 || + die "ERROR: libcelt must be installed and version must be >= 0.11.0."; } +enabled libcaca && require_pkg_config caca caca.h caca_create_canvas +enabled libfaac && require2 libfaac "stdint.h faac.h" faacEncGetVersion -lfaac +enabled libfdk_aac && require libfdk_aac fdk-aac/aacenc_lib.h aacEncOpen -lfdk-aac +flite_libs="-lflite_cmu_time_awb -lflite_cmu_us_awb -lflite_cmu_us_kal -lflite_cmu_us_kal16 -lflite_cmu_us_rms -lflite_cmu_us_slt -lflite_usenglish -lflite_cmulex -lflite" +enabled libflite && require2 libflite "flite/flite.h" flite_init $flite_libs +enabled libfreetype && require_pkg_config freetype2 "ft2build.h freetype/freetype.h" FT_Init_FreeType +enabled libgsm && require libgsm gsm/gsm.h gsm_create -lgsm +enabled libilbc && require libilbc ilbc.h WebRtcIlbcfix_InitDecode -lilbc +enabled libmodplug && require libmodplug libmodplug/modplug.h ModPlug_Load -lmodplug +enabled libmp3lame && require "libmp3lame >= 3.98.3" lame/lame.h lame_set_VBR_quality -lmp3lame +enabled libnut && require libnut libnut.h nut_demuxer_init -lnut +enabled libopencore_amrnb && require libopencore_amrnb opencore-amrnb/interf_dec.h Decoder_Interface_init -lopencore-amrnb +enabled libopencore_amrwb && require libopencore_amrwb opencore-amrwb/dec_if.h D_IF_init -lopencore-amrwb +enabled libopencv && require_pkg_config opencv opencv/cxcore.h cvCreateImageHeader +enabled libopenjpeg && { check_lib openjpeg-1.5/openjpeg.h opj_version -lopenjpeg || + check_lib openjpeg.h opj_version -lopenjpeg || + die "ERROR: libopenjpeg not found"; } +enabled libopus && require_pkg_config opus opus_multistream.h opus_multistream_decoder_create +enabled libpulse && require_pkg_config libpulse-simple pulse/simple.h pa_simple_new +enabled librtmp && require_pkg_config librtmp librtmp/rtmp.h RTMP_Socket +enabled libschroedinger && require_pkg_config schroedinger-1.0 schroedinger/schro.h schro_init +enabled libsoxr && require libsoxr soxr.h soxr_create -lsoxr +enabled libspeex && require libspeex speex/speex.h speex_decoder_init -lspeex +enabled libstagefright_h264 && require_cpp libstagefright_h264 "binder/ProcessState.h media/stagefright/MetaData.h + media/stagefright/MediaBufferGroup.h media/stagefright/MediaDebug.h media/stagefright/MediaDefs.h + media/stagefright/OMXClient.h media/stagefright/OMXCodec.h" android::OMXClient -lstagefright -lmedia -lutils -lbinder -lgnustl_static +enabled libtheora && require libtheora theora/theoraenc.h th_info_init -ltheoraenc -ltheoradec -logg +enabled libtwolame && require libtwolame twolame.h twolame_init -ltwolame && + { check_lib twolame.h twolame_encode_buffer_float32_interleaved -ltwolame || + die "ERROR: libtwolame must be installed and version must be >= 0.3.10"; } +enabled libutvideo && require_cpp utvideo "stdint.h stdlib.h utvideo/utvideo.h utvideo/Codec.h" 'CCodec*' -lutvideo -lstdc++ +enabled libv4l2 && require_pkg_config libv4l2 libv4l2.h v4l2_ioctl +enabled libvo_aacenc && require libvo_aacenc vo-aacenc/voAAC.h voGetAACEncAPI -lvo-aacenc +enabled libvo_amrwbenc && require libvo_amrwbenc vo-amrwbenc/enc_if.h E_IF_init -lvo-amrwbenc +enabled libvorbis && require libvorbis vorbis/vorbisenc.h vorbis_info_init -lvorbisenc -lvorbis -logg +enabled libvpx && { + enabled libvpx_decoder && { check_lib2 "vpx/vpx_decoder.h vpx/vp8dx.h" vpx_codec_dec_init_ver -lvpx || + die "ERROR: libvpx decoder must be installed and version must be >=0.9.1"; } + enabled libvpx_encoder && { check_lib2 "vpx/vpx_encoder.h vpx/vp8cx.h" "vpx_codec_enc_init_ver VP8E_SET_MAX_INTRA_BITRATE_PCT" -lvpx || + die "ERROR: libvpx encoder version must be >=0.9.7"; } } +enabled libx264 && require libx264 x264.h x264_encoder_encode -lx264 && + { check_cpp_condition x264.h "X264_BUILD >= 118" || + die "ERROR: libx264 must be installed and version must be >= 0.118."; } +enabled libxavs && require libxavs xavs.h xavs_encoder_encode -lxavs +enabled libxvid && require libxvid xvid.h xvid_global -lxvidcore +enabled openal && { { for al_libs in "${OPENAL_LIBS}" "-lopenal" "-lOpenAL32"; do + check_lib 'AL/al.h' alGetError "${al_libs}" && break; done } || + die "ERROR: openal not found"; } && + { check_cpp_condition "AL/al.h" "defined(AL_VERSION_1_1)" || + die "ERROR: openal must be installed and version must be 1.1 or compatible"; } +enabled openssl && { check_lib openssl/ssl.h SSL_library_init -lssl -lcrypto || + check_lib openssl/ssl.h SSL_library_init -lssl32 -leay32 || + check_lib openssl/ssl.h SSL_library_init -lssl -lcrypto -lws2_32 -lgdi32 || + die "ERROR: openssl not found"; } + +if enabled gnutls; then + { check_lib nettle/bignum.h nettle_mpz_get_str_256 -lnettle -lhogweed -lgmp && enable nettle; } || + { check_lib gcrypt.h gcry_mpi_new -lgcrypt && enable gcrypt; } +fi + +# libdc1394 check +if enabled libdc1394; then + { check_lib dc1394/dc1394.h dc1394_new -ldc1394 -lraw1394 && + enable libdc1394_2; } || + { check_lib libdc1394/dc1394_control.h dc1394_create_handle -ldc1394_control -lraw1394 && + enable libdc1394_1; } || + die "ERROR: No version of libdc1394 found " +fi + +SDL_CONFIG="${cross_prefix}sdl-config" +if check_pkg_config sdl SDL_events.h SDL_PollEvent; then + check_cpp_condition SDL.h "(SDL_MAJOR_VERSION<<16 | SDL_MINOR_VERSION<<8 | SDL_PATCHLEVEL) >= 0x010201" $sdl_cflags && + enable sdl && + check_struct SDL.h SDL_VideoInfo current_w $sdl_cflags && enable sdl_video_size +else + if "${SDL_CONFIG}" --version > /dev/null 2>&1; then + sdl_cflags=$("${SDL_CONFIG}" --cflags) + sdl_libs=$("${SDL_CONFIG}" --libs) + check_func_headers SDL_version.h SDL_Linked_Version $sdl_cflags $sdl_libs && + check_cpp_condition SDL.h "(SDL_MAJOR_VERSION<<16 | SDL_MINOR_VERSION<<8 | SDL_PATCHLEVEL) >= 0x010201" $sdl_cflags && + enable sdl && + check_struct SDL.h SDL_VideoInfo current_w $sdl_cflags && enable sdl_video_size + fi +fi +enabled sdl && add_cflags $sdl_cflags && add_extralibs $sdl_libs + +texi2html --help 2> /dev/null | grep -q 'init-file' && enable texi2html || disable texi2html +makeinfo --version > /dev/null 2>&1 && enable makeinfo || disable makeinfo +perl --version > /dev/null 2>&1 && enable perl || disable perl +pod2man --help > /dev/null 2>&1 && enable pod2man || disable pod2man +rsync --help 2> /dev/null | grep -q 'contimeout' && enable rsync_contimeout || disable rsync_contimeout + +check_header linux/fb.h +check_header linux/videodev.h +check_header linux/videodev2.h +check_code cc linux/videodev2.h "struct v4l2_frmsizeenum vfse; vfse.discrete.width = 0;" && enable_safe struct_v4l2_frmivalenum_discrete + +check_header sys/videoio.h + +check_func_headers "windows.h vfw.h" capCreateCaptureWindow "$vfwcap_indev_extralibs" +# check that WM_CAP_DRIVER_CONNECT is defined to the proper value +# w32api 3.12 had it defined wrong +check_cpp_condition vfw.h "WM_CAP_DRIVER_CONNECT > WM_USER" && enable vfwcap_defines + +check_type "dshow.h" IBaseFilter + +# check for ioctl_meteor.h, ioctl_bt848.h and alternatives +{ check_header dev/bktr/ioctl_meteor.h && + check_header dev/bktr/ioctl_bt848.h; } || +{ check_header machine/ioctl_meteor.h && + check_header machine/ioctl_bt848.h; } || +{ check_header dev/video/meteor/ioctl_meteor.h && + check_header dev/video/bktr/ioctl_bt848.h; } || +check_header dev/ic/bt8xx.h + +check_header sndio.h +if check_struct sys/soundcard.h audio_buf_info bytes; then + enable_safe sys/soundcard.h +else + check_cc -D__BSD_VISIBLE -D__XSI_VISIBLE < + audio_buf_info abc; +EOF +fi +check_header soundcard.h + +enabled_any alsa_indev alsa_outdev && check_lib2 alsa/asoundlib.h snd_pcm_htimestamp -lasound + +enabled jack_indev && check_lib2 jack/jack.h jack_client_open -ljack && check_func sem_timedwait && + check_func jack_port_get_latency_range -ljack + +enabled_any sndio_indev sndio_outdev && check_lib2 sndio.h sio_open -lsndio + +if enabled libcdio; then + check_lib2 "cdio/cdda.h cdio/paranoia.h" cdio_cddap_open -lcdio_paranoia -lcdio_cdda -lcdio || check_lib2 "cdio/paranoia/cdda.h cdio/paranoia/paranoia.h" cdio_cddap_open -lcdio_paranoia -lcdio_cdda -lcdio +fi + +enabled x11grab && +require X11 X11/Xlib.h XOpenDisplay -lX11 && +require Xext X11/extensions/XShm.h XShmCreateImage -lXext && +require Xfixes X11/extensions/Xfixes.h XFixesGetCursorImage -lXfixes + +if ! disabled vaapi; then + check_lib va/va.h vaInitialize -lva && { + check_cpp_condition va/va_version.h "VA_CHECK_VERSION(0,32,0)" || + warn "Please upgrade to VA-API >= 0.32 if you would like full VA-API support."; + } || disable vaapi +fi + +if ! disabled vdpau && enabled vdpau_vdpau_h; then + check_cpp_condition vdpau/vdpau.h "defined VDP_DECODER_PROFILE_MPEG4_PART2_ASP" || + { echolog "Please upgrade to libvdpau >= 0.2 if you would like vdpau support." && disable vdpau; } +fi + +enabled debug && add_cflags -g"$debuglevel" && add_asflags -g"$debuglevel" +enabled coverage && add_cflags "-fprofile-arcs -ftest-coverage" && add_ldflags "-fprofile-arcs -ftest-coverage" +test -n "$valgrind" && target_exec="$valgrind --error-exitcode=1 --malloc-fill=0x2a --track-origins=yes --leak-check=full --gen-suppressions=all --suppressions=$source_path/tests/fate-valgrind.supp" + +# add some useful compiler flags if supported +check_cflags -Wdeclaration-after-statement +check_cflags -Wall +check_cflags -Wno-parentheses +check_cflags -Wno-switch +check_cflags -Wno-format-zero-length +check_cflags -Wdisabled-optimization +check_cflags -Wpointer-arith +check_cflags -Wredundant-decls +check_cflags -Wno-pointer-sign +check_cflags -Wwrite-strings +check_cflags -Wtype-limits +check_cflags -Wundef +check_cflags -Wmissing-prototypes +check_cflags -Wno-pointer-to-int-cast +check_cflags -Wstrict-prototypes +enabled extra_warnings && check_cflags -Winline + +# add some linker flags +check_ldflags -Wl,--warn-common +check_ldflags -Wl,-rpath-link=libpostproc:libswresample:libswscale:libavfilter:libavdevice:libavformat:libavcodec:libavutil:libavresample +test_ldflags -Wl,-Bsymbolic && append SHFLAGS -Wl,-Bsymbolic + +enabled xmm_clobber_test && + check_ldflags -Wl,--wrap,avcodec_open2 \ + -Wl,--wrap,avcodec_decode_audio4 \ + -Wl,--wrap,avcodec_decode_video2 \ + -Wl,--wrap,avcodec_decode_subtitle2 \ + -Wl,--wrap,avcodec_encode_audio2 \ + -Wl,--wrap,avcodec_encode_video \ + -Wl,--wrap,avcodec_encode_subtitle \ + -Wl,--wrap,sws_scale || + disable xmm_clobber_test + +echo "X{};" > $TMPV +if test_ldflags -Wl,--version-script,$TMPV; then + append SHFLAGS '-Wl,--version-script,\$(SUBDIR)lib\$(NAME).ver' + check_cc < enable ${lib}_deps_${dep} +# -> add $dep to ${lib}_deps only once +add_dep() { + lib=$1 + dep=$2 + enabled "${lib}_deps_${dep}" && return 0 + enable "${lib}_deps_${dep}" + prepend "${lib}_deps" $dep +} + +# merge deps lib components +# merge all ${component}_deps into ${lib}_deps and ${lib}_deps_* +merge_deps() { + lib=$1 + shift + for comp in $*; do + enabled $comp || continue + eval "dep=\"\$${comp}_deps\"" + for d in $dep; do + add_dep $lib $d + done + done +} + +merge_deps libavfilter $FILTER_LIST + +echo "install prefix $prefix" +echo "source path $source_path" +echo "C compiler $cc" +echo "ARCH $arch ($cpu)" +if test "$build_suffix" != ""; then + echo "build suffix $build_suffix" +fi +if test "$progs_suffix" != ""; then + echo "progs suffix $progs_suffix" +fi +if test "$extra_version" != ""; then + echo "version string suffix $extra_version" +fi +echo "big-endian ${bigendian-no}" +echo "runtime cpu detection ${runtime_cpudetect-no}" +if enabled x86; then + echo "${yasmexe} ${yasm-no}" + echo "MMX enabled ${mmx-no}" + echo "MMXEXT enabled ${mmxext-no}" + echo "3DNow! enabled ${amd3dnow-no}" + echo "3DNow! extended enabled ${amd3dnowext-no}" + echo "SSE enabled ${sse-no}" + echo "SSSE3 enabled ${ssse3-no}" + echo "AVX enabled ${avx-no}" + echo "FMA4 enabled ${fma4-no}" + echo "CMOV enabled ${cmov-no}" + echo "CMOV is fast ${fast_cmov-no}" + echo "EBX available ${ebx_available-no}" + echo "EBP available ${ebp_available-no}" +fi +if enabled arm; then + echo "ARMv5TE enabled ${armv5te-no}" + echo "ARMv6 enabled ${armv6-no}" + echo "ARMv6T2 enabled ${armv6t2-no}" + echo "VFP enabled ${vfp-no}" + echo "NEON enabled ${neon-no}" + echo "THUMB enabled ${thumb-no}" +fi +if enabled mips; then + echo "MIPS FPU enabled ${mipsfpu-no}" + echo "MIPS32R2 enabled ${mips32r2-no}" + echo "MIPS DSP R1 enabled ${mipsdspr1-no}" + echo "MIPS DSP R2 enabled ${mipsdspr2-no}" +fi +if enabled ppc; then + echo "AltiVec enabled ${altivec-no}" + echo "PPC 4xx optimizations ${ppc4xx-no}" + echo "dcbzl available ${dcbzl-no}" +fi +if enabled sparc; then + echo "VIS enabled ${vis-no}" +fi +echo "debug symbols ${debug-no}" +echo "strip symbols ${stripping-no}" +echo "optimize for size ${small-no}" +echo "optimizations ${optimizations-no}" +echo "static ${static-no}" +echo "shared ${shared-no}" +echo "postprocessing support ${postproc-no}" +echo "new filter support ${avfilter-no}" +echo "network support ${network-no}" +echo "threading support ${thread_type-no}" +echo "safe bitstream reader ${safe_bitstream_reader-no}" +echo "SDL support ${sdl-no}" +echo "libdxva2 enabled ${dxva2-no}" +echo "libva enabled ${vaapi-no}" +echo "libvdpau enabled ${vdpau-no}" +echo "AVISynth enabled ${avisynth-no}" +echo "frei0r enabled ${frei0r-no}" +echo "gnutls enabled ${gnutls-no}" +echo "libaacplus enabled ${libaacplus-no}" +echo "libass enabled ${libass-no}" +echo "libcaca enabled ${libcaca-no}" +echo "libcdio support ${libcdio-no}" +echo "libcelt enabled ${libcelt-no}" +echo "libdc1394 support ${libdc1394-no}" +echo "libfaac enabled ${libfaac-no}" +echo "libfdk-aac enabled ${libfdk_aac-no}" +echo "libgsm enabled ${libgsm-no}" +echo "libiec61883 support ${libiec61883-no}" +echo "libilbc enabled ${libilbc-no}" +echo "libmodplug enabled ${libmodplug-no}" +echo "libmp3lame enabled ${libmp3lame-no}" +echo "libnut enabled ${libnut-no}" +echo "libopencore-amrnb support ${libopencore_amrnb-no}" +echo "libopencore-amrwb support ${libopencore_amrwb-no}" +echo "libopencv support ${libopencv-no}" +echo "libopenjpeg enabled ${libopenjpeg-no}" +echo "libopus enabled ${libopus-no}" +echo "libpulse enabled ${libpulse-no}" +echo "librtmp enabled ${librtmp-no}" +echo "libschroedinger enabled ${libschroedinger-no}" +echo "libsoxr enabled ${libsoxr-no}" +echo "libspeex enabled ${libspeex-no}" +echo "libstagefright-h264 enabled ${libstagefright_h264-no}" +echo "libtheora enabled ${libtheora-no}" +echo "libtwolame enabled ${libtwolame-no}" +echo "libutvideo enabled ${libutvideo-no}" +echo "libv4l2 enabled ${libv4l2-no}" +echo "libvo-aacenc support ${libvo_aacenc-no}" +echo "libvo-amrwbenc support ${libvo_amrwbenc-no}" +echo "libvorbis enabled ${libvorbis-no}" +echo "libvpx enabled ${libvpx-no}" +echo "libx264 enabled ${libx264-no}" +echo "libxavs enabled ${libxavs-no}" +echo "libxvid enabled ${libxvid-no}" +echo "openal enabled ${openal-no}" +echo "openssl enabled ${openssl-no}" +echo "zlib enabled ${zlib-no}" +echo "bzlib enabled ${bzlib-no}" +echo "texi2html enabled ${texi2html-no}" +echo "perl enabled ${perl-no}" +echo "pod2man enabled ${pod2man-no}" +echo "makeinfo enabled ${makeinfo-no}" +test -n "$random_seed" && + echo "random seed ${random_seed}" +echo + +for type in decoder encoder hwaccel parser demuxer muxer protocol filter bsf indev outdev; do + echo "Enabled ${type}s:" + eval list=\$$(toupper $type)_LIST + print_enabled '_*' $list | sort | pr -r -3 -t + echo +done + +license="LGPL version 2.1 or later" +if enabled nonfree; then + license="nonfree and unredistributable" +elif enabled gplv3; then + license="GPL version 3 or later" +elif enabled lgplv3; then + license="LGPL version 3 or later" +elif enabled gpl; then + license="GPL version 2 or later" +fi + +echo "License: $license" + +echo "Creating config.mak and config.h..." + +test -e Makefile || $ln_s "$source_path/Makefile" . + +enabled stripping || strip="echo skipping strip" + +config_files="$TMPH config.mak" + +cat > config.mak <> config.mak + eval echo "${lcname}_VERSION_MAJOR=\$${name}_VERSION_MAJOR" >> config.mak +} + +map 'get_version $v' $LIBRARY_LIST + +cat > $TMPH <>$TMPH + +test -n "$malloc_prefix" && + echo "#define MALLOC_PREFIX $malloc_prefix" >>$TMPH + +if enabled yasm; then + append config_files $TMPASM + printf '' >$TMPASM +fi + +print_config ARCH_ "$config_files" $ARCH_LIST +print_config HAVE_ "$config_files" $HAVE_LIST +print_config CONFIG_ "$config_files" $CONFIG_LIST \ + $CONFIG_EXTRA \ + $ALL_COMPONENTS \ + +echo "#endif /* FFMPEG_CONFIG_H */" >> $TMPH +echo "endif # FFMPEG_CONFIG_MAK" >> config.mak + +# Do not overwrite an unchanged config.h to avoid superfluous rebuilds. +cp_if_changed $TMPH config.h +touch .config + +enabled yasm && cp_if_changed $TMPASM config.asm + +cat > $TMPH <> $TMPH + +cp_if_changed $TMPH libavutil/avconfig.h + +if test -n "$WARNINGS"; then + printf "\n$WARNINGS" + enabled fatal_warnings && exit 1 +fi + +# build pkg-config files + +pkgconfig_generate(){ + name=$1 + shortname=${name#lib}${build_suffix} + comment=$2 + version=$3 + libs=$4 + requires=$5 + enabled ${name#lib} || return 0 + mkdir -p $name + cat < $name/$name.pc +prefix=$prefix +exec_prefix=\${prefix} +libdir=$libdir +includedir=$incdir + +Name: $name +Description: $comment +Version: $version +Requires: $(enabled shared || echo $requires) +Requires.private: $(enabled shared && echo $requires) +Conflicts: +Libs: -L\${libdir} -l${shortname} $(enabled shared || echo $libs) +Libs.private: $(enabled shared && echo $libs) +Cflags: -I\${includedir} +EOF + +mkdir -p doc/examples/pc-uninstalled +includedir=${source_path} +[ "$includedir" = . ] && includedir="\${pcfiledir}/../../.." + cat < doc/examples/pc-uninstalled/$name.pc +prefix= +exec_prefix= +libdir=\${pcfiledir}/../../../$name +includedir=${includedir} + +Name: $name +Description: $comment +Version: $version +Requires: $requires +Conflicts: +Libs: -L\${libdir} -l${shortname} $(enabled shared || echo $libs) +Cflags: -I\${includedir} +EOF +} + +libavfilter_pc_deps="libavutil = $LIBAVUTIL_VERSION" +enabled libavfilter_deps_avcodec && prepend libavfilter_pc_deps "libavcodec = $LIBAVCODEC_VERSION," +enabled libavfilter_deps_avformat && prepend libavfilter_pc_deps "libavformat = $LIBAVFORMAT_VERSION," +enabled libavfilter_deps_avresample && prepend libavfilter_pc_deps "libavresample = $LIBAVRESAMPLE_VERSION," +enabled libavfilter_deps_swscale && prepend libavfilter_pc_deps "libswscale = $LIBSWSCALE_VERSION," +enabled libavfilter_deps_swresample && prepend libavfilter_pc_deps "libswresample = $LIBSWRESAMPLE_VERSION," +enabled libavfilter_deps_postproc && prepend libavfilter_pc_deps "libpostproc = $LIBPOSTPROC_VERSION," +libavfilter_pc_deps=${libavfilter_pc_deps%, } + +libavdevice_pc_deps="libavformat = $LIBAVFORMAT_VERSION" +enabled lavfi_indev && prepend libavdevice_pc_deps "libavfilter = $LIBAVFILTER_VERSION," + +pkgconfig_generate libavutil "FFmpeg utility library" "$LIBAVUTIL_VERSION" "$LIBM" +pkgconfig_generate libavcodec "FFmpeg codec library" "$LIBAVCODEC_VERSION" "$extralibs" "libavutil = $LIBAVUTIL_VERSION" +pkgconfig_generate libavformat "FFmpeg container format library" "$LIBAVFORMAT_VERSION" "$extralibs" "libavcodec = $LIBAVCODEC_VERSION" +pkgconfig_generate libavdevice "FFmpeg device handling library" "$LIBAVDEVICE_VERSION" "$extralibs" "$libavdevice_pc_deps" +pkgconfig_generate libavfilter "FFmpeg video filtering library" "$LIBAVFILTER_VERSION" "$extralibs" "$libavfilter_pc_deps" +pkgconfig_generate libpostproc "FFmpeg postprocessing library" "$LIBPOSTPROC_VERSION" "" "libavutil = $LIBAVUTIL_VERSION" +pkgconfig_generate libavresample "Libav audio resampling library" "$LIBAVRESAMPLE_VERSION" "$extralibs" "libavutil = $LIBAVUTIL_VERSION" +pkgconfig_generate libswscale "FFmpeg image rescaling library" "$LIBSWSCALE_VERSION" "$LIBM" "libavutil = $LIBAVUTIL_VERSION" +pkgconfig_generate libswresample "FFmpeg audio resampling library" "$LIBSWRESAMPLE_VERSION" "$LIBM" "libavutil = $LIBAVUTIL_VERSION" + +fix_ffmpeg_remote(){ + git_remote_from=$1 + git_remote_to=$2 + fixme_remote=$(git --git-dir=$source_path/.git --work-tree=$source_path remote -v | grep $git_remote_from | cut -f 1 | sort | uniq) + if [ "$fixme_remote" != "" ]; then + echolog " +Outdated domain in git config, the official domain for ffmpeg git is since +November 2011, source.ffmpeg.org, both the old and the new point to the same +repository and server. To update it enter the following commands: +" + for remote in $fixme_remote; do + echolog "git remote set-url $remote $git_remote_to" + done + fi +} + +if test -f "$source_path/.git/config"; then + remote_from=git.videolan.org + remote_to=source.ffmpeg.org + fix_ffmpeg_remote git@$remote_from:ffmpeg git@$remote_to:ffmpeg + fix_ffmpeg_remote git://$remote_from/ffmpeg git://$remote_to/ffmpeg +fi diff --git a/project/jni/ffmpeg/doc/APIchanges b/project/jni/ffmpeg/doc/APIchanges new file mode 100644 index 000000000..a75d268b3 --- /dev/null +++ b/project/jni/ffmpeg/doc/APIchanges @@ -0,0 +1,1501 @@ +Never assume the API of libav* to be stable unless at least 1 month has passed +since the last major version increase or the API was added. + +The last version increases were: +libavcodec: 2012-01-27 +libavdevice: 2011-04-18 +libavfilter: 2012-06-22 +libavformat: 2012-01-27 +libavresample: 2012-10-05 +libpostproc: 2011-04-18 +libswresample: 2011-09-19 +libswscale: 2011-06-20 +libavutil: 2012-10-22 + + +API changes, most recent first: + +2012-12-20 - xxxxxxx - lavfi 3.28.100 - avfilter.h + Add AVFilterLink.channels, avfilter_link_get_channels() + and avfilter_ref_get_channels(). + +2012-12-15 - 2ada584d - lavc 54.80.100 - avcodec.h + Add pkt_size field to AVFrame. + +2012-11-25 - c70ec631 - lavu 52.9.100 - opt.h + Add the following convenience functions to opt.h: + av_opt_get_image_size + av_opt_get_pixel_fmt + av_opt_get_sample_fmt + av_opt_set_image_size + av_opt_set_pixel_fmt + av_opt_set_sample_fmt + +2012-11-17 - 4cd74c81 - lavu 52.8.100 - bprint.h + Add av_bprint_strftime(). + +2012-11-15 - 92648107 - lavu 52.7.100 - opt.h + Add av_opt_get_key_value(). + +2012-11-13 - 79456652 - lavfi 3.23.100 - avfilter.h + Add channels field to AVFilterBufferRefAudioProps. + +2012-11-03 - 481fdeee - lavu 52.3.100 - opt.h + Add AV_OPT_TYPE_SAMPLE_FMT value to AVOptionType enum. + +2012-10-21 - 6fb2fd8 - lavc 54.68.100 - avcodec.h + lavfi 3.20.100 - avfilter.h + Add AV_PKT_DATA_STRINGS_METADATA side data type, used to transmit key/value + strings between AVPacket and AVFrame, and add metadata field to + AVCodecContext (which shall not be accessed by users; see AVFrame metadata + instead). + +2012-09-27 - a70b493 - lavd 54.3.100 - version.h + Add LIBAVDEVICE_IDENT symbol. + +2012-09-27 - a70b493 - lavfi 3.18.100 - version.h + Add LIBAVFILTER_IDENT symbol. + +2012-09-27 - a70b493 - libswr 0.16.100 - version.h + Add LIBSWRESAMPLE_VERSION, LIBSWRESAMPLE_BUILD + and LIBSWRESAMPLE_IDENT symbols. + +2012-09-06 - 29e972f - lavu 51.72.100 - parseutils.h + Add av_small_strptime() time parsing function. + + Can be used as a stripped-down replacement for strptime(), on + systems which do not support it. + +2012-08-25 - 2626cc4 - lavf 54.28.100 + Matroska demuxer now identifies SRT subtitles as AV_CODEC_ID_SUBRIP instead + of AV_CODEC_ID_TEXT. + +2012-08-13 - 5c0d8bc - lavfi 3.8.100 - avfilter.h + Add avfilter_get_class() function, and priv_class field to AVFilter + struct. + +2012-08-12 - a25346e - lavu 51.69.100 - opt.h + Add AV_OPT_FLAG_FILTERING_PARAM symbol in opt.h. + +2012-07-31 - 23fc4dd - lavc 54.46.100 + Add channels field to AVFrame. + +2012-07-30 - f893904 - lavu 51.66.100 + Add av_get_channel_description() + and av_get_standard_channel_layout() functions. + +2012-07-21 - 016a472 - lavc 54.43.100 + Add decode_error_flags field to AVFrame. + +2012-07-20 - b062936 - lavf 54.18.100 + Add avformat_match_stream_specifier() function. + +2012-07-14 - f49ec1b - lavc 54.38.100 - avcodec.h + Add metadata to AVFrame, and the accessor functions + av_frame_get_metadata() and av_frame_set_metadata(). + +2012-07-10 - 0e003d8 - lavc 54.33.100 + Add av_fast_padded_mallocz(). + +2012-07-10 - 21d5609 - lavfi 3.2.0 - avfilter.h + Add init_opaque() callback to AVFilter struct. + +2012-06-26 - e6674e4 - lavu 51.63.100 - imgutils.h + Add functions to libavutil/imgutils.h: + av_image_get_buffer_size() + av_image_fill_arrays() + av_image_copy_to_buffer() + +2012-06-24 - c41899a - lavu 51.62.100 - version.h + version moved from avutil.h to version.h + +2012-04-11 - 359abb1 - lavu 51.58.100 - error.h + Add av_make_error_string() and av_err2str() utilities to + libavutil/error.h. + +2012-06-05 - 62b39d4 - lavc 54.24.100 + Add pkt_duration field to AVFrame. + +2012-05-24 - f2ee065 - lavu 51.54.100 + Move AVPALETTE_SIZE and AVPALETTE_COUNT macros from + libavcodec/avcodec.h to libavutil/pixfmt.h. + +2012-05-14 - 94a9ac1 - lavf 54.5.100 + Add av_guess_sample_aspect_ratio() function. + +2012-04-20 - 65fa7bc - lavfi 2.70.100 + Add avfilter_unref_bufferp() to avfilter.h. + +2012-04-13 - 162e400 - lavfi 2.68.100 + Install libavfilter/asrc_abuffer.h public header. + +2012-03-26 - a67d9cf - lavfi 2.66.100 + Add avfilter_fill_frame_from_{audio_,}buffer_ref() functions. + +2012-12-29 - d8fd06c - lavu 52.3.0 - avstring.h + Add av_basename() and av_dirname(). + +2012-11-11 - 5980f5d - lavu 52.2.0 - audioconvert.h + Rename audioconvert.h to channel_layout.h. audioconvert.h is now deprecated. + +2012-11-05 - dfde8a3 - lavu 52.1.0 - intmath.h + Add av_ctz() for trailing zero bit count + +2012-10-21 - a893655 - lavu 51.45.0 - error.h + Add AVERROR_EXPERIMENTAL + +2012-10-12 - d2fcb35 - lavu 51.44.0 - pixdesc.h + Add functions for accessing pixel format descriptors. + Accessing the av_pix_fmt_descriptors array directly is now + deprecated. + +2012-10-11 - 9a92aea - lavu 51.43.0 - aes.h, md5.h, sha.h, tree.h + Add functions for allocating the opaque contexts for the algorithms, + +2012-10-10 - b522000 - lavf 54.18.0 - avio.h + Add avio_closep to complement avio_close. + +2012-10-08 - 78071a1 - lavu 51.42.0 - pixfmt.h + Rename PixelFormat to AVPixelFormat and all PIX_FMT_* to AV_PIX_FMT_*. + To provide backwards compatibility, PixelFormat is now #defined as + AVPixelFormat. + Note that this can break user code that includes pixfmt.h and uses the + 'PixelFormat' identifier. Such code should either #undef PixelFormat + or stop using the PixelFormat name. + +2012-10-05 - e7ba5b1 - lavr 1.0.0 - avresample.h + Data planes parameters to avresample_convert() and + avresample_read() are now uint8_t** instead of void**. + Libavresample is now stable. + +2012-09-24 - a42aada - lavc 54.28.0 - avcodec.h + Add avcodec_free_frame(). This function must now + be used for freeing an AVFrame. + +2012-09-12 - 8919fee - lavu 51.41.0 - audioconvert.h + Added AV_CH_LOW_FREQUENCY_2 channel mask value. + +2012-09-04 - 686a329 - lavu 51.40.0 - opt.h + Reordered the fields in default_val in AVOption, changed which + default_val field is used for which AVOptionType. + +2012-08-30 - a231832 - lavc 54.26.1 - avcodec.h + Add codec descriptor properties AV_CODEC_PROP_LOSSY and + AV_CODEC_PROP_LOSSLESS. + +2012-08-18 - lavc 54.26 - avcodec.h + Add codec descriptors for accessing codec properties without having + to refer to a specific decoder or encoder. + + c223d79 - Add an AVCodecDescriptor struct and functions + avcodec_descriptor_get() and avcodec_descriptor_next(). + 51efed1 - Add AVCodecDescriptor.props and AV_CODEC_PROP_INTRA_ONLY. + 91e59fe - Add avcodec_descriptor_get_by_name(). + +2012-08-08 - 987170c - lavu 51.38 - dict.h + Add av_dict_count(). + +2012-08-07 - 104e10f - lavc 54.25 - avcodec.h + Rename CodecID to AVCodecID and all CODEC_ID_* to AV_CODEC_ID_*. + To provide backwards compatibility, CodecID is now #defined as AVCodecID. + Note that this can break user code that includes avcodec.h and uses the + 'CodecID' identifier. Such code should either #undef CodecID or stop using the + CodecID name. + +2012-08-03 - 239fdf1 - lavu 51.37.1 - cpu.h + lsws 2.1.1 - swscale.h + Rename AV_CPU_FLAG_MMX2 ---> AV_CPU_FLAG_MMXEXT. + Rename SWS_CPU_CAPS_MMX2 ---> SWS_CPU_CAPS_MMXEXT. + +2012-07-29 - 681ed00 - lavf 54.13.0 - avformat.h + Add AVFMT_FLAG_NOBUFFER for low latency use cases. + +2012-07-10 - 5fade8a - lavu 51.37.0 + Add av_malloc_array() and av_mallocz_array() + +2012-06-22 - d3d3a32 - lavu 51.34.0 + Add av_usleep() + +2012-06-20 - ae0a301 - lavu 51.33.0 + Move av_gettime() to libavutil, add libavutil/time.h + +2012-06-09 - 3971be0 - lavr 0.0.3 + Add a parameter to avresample_build_matrix() for Dolby/DPLII downmixing. + +2012-06-12 - 9baeff9 - lavfi 2.23.0 - avfilter.h + Add AVFilterContext.nb_inputs/outputs. Deprecate + AVFilterContext.input/output_count. + +2012-06-12 - 84b9fbe - lavfi 2.22.0 - avfilter.h + Add avfilter_pad_get_type() and avfilter_pad_get_name(). Those + should now be used instead of accessing AVFilterPad members + directly. + +2012-06-12 - b0f0dfc - lavu 51.32.0 - audioconvert.h + Add av_get_channel_layout_channel_index(), av_get_channel_name() + and av_channel_layout_extract_channel(). + +2012-05-25 - 154486f - lavu 51.31.0 - opt.h + Add av_opt_set_bin() + +2012-05-15 - lavfi 2.17.0 + Add support for audio filters + ac71230/a2cd9be - add video/audio buffer sink in a new installed + header buffersink.h + 720c6b7 - add av_buffersrc_write_frame(), deprecate + av_vsrc_buffer_add_frame() + ab16504 - add avfilter_copy_buf_props() + 9453c9e - add extended_data to AVFilterBuffer + 1b8c927 - add avfilter_get_audio_buffer_ref_from_arrays() + +2012-05-09 - lavu 51.30.0 - samplefmt.h + 142e740 - add av_samples_copy() + 6d7f617 - add av_samples_set_silence() + +2012-05-09 - a5117a2 - lavc 54.13.1 + For audio formats with fixed frame size, the last frame + no longer needs to be padded with silence, libavcodec + will handle this internally (effectively all encoders + behave as if they had CODEC_CAP_SMALL_LAST_FRAME set). + +2012-05-07 - 828bd08 - lavc 54.13.0 - avcodec.h + Add sample_rate and channel_layout fields to AVFrame. + +2012-05-01 - 4010d72 - lavr 0.0.1 + Change AV_MIX_COEFF_TYPE_Q6 to AV_MIX_COEFF_TYPE_Q8. + +2012-04-25 - 3527a73 - lavu 51.29.0 - cpu.h + Add av_parse_cpu_flags() + +2012-04-24 - c8af852 - lavr 0.0.0 + Add libavresample audio conversion library + +2012-04-20 - 0c0d1bc - lavu 51.28.0 - audio_fifo.h + Add audio FIFO functions: + av_audio_fifo_free() + av_audio_fifo_alloc() + av_audio_fifo_realloc() + av_audio_fifo_write() + av_audio_fifo_read() + av_audio_fifo_drain() + av_audio_fifo_reset() + av_audio_fifo_size() + av_audio_fifo_space() + +2012-04-14 - lavfi 2.16.0 - avfiltergraph.h + d7bcc71 Add avfilter_graph_parse2(). + +2012-04-08 - 4d693b0 - lavu 51.27.0 - samplefmt.h + Add av_get_packed_sample_fmt() and av_get_planar_sample_fmt() + +2012-03-21 - b75c67d - lavu 51.43.100 + Add bprint.h for bprint API. + +2012-02-21 - 9cbf17e - lavc 54.4.100 + Add av_get_pcm_codec() function. + +2012-02-16 - 560b224 - libswr 0.7.100 + Add swr_set_matrix() function. + +2012-02-09 - c28e7af - lavu 51.39.100 + Add a new installed header libavutil/timestamp.h with timestamp + utilities. + +2012-02-06 - 70ffda3 - lavu 51.38.100 + Add av_parse_ratio() function to parseutils.h. + +2012-02-06 - 70ffda3 - lavu 51.38.100 + Add AV_LOG_MAX_OFFSET macro to log.h. + +2012-02-02 - 0eaa123 - lavu 51.37.100 + Add public timecode helpers. + +2012-01-24 - 0c3577b - lavfi 2.60.100 + Add avfilter_graph_dump. + +2012-03-20 - 3c90cc2 - lavfo 54.2.0 + Deprecate av_read_packet(), use av_read_frame() with + AVFMT_FLAG_NOPARSE | AVFMT_FLAG_NOFILLIN in AVFormatContext.flags + +2012-03-05 - lavc 54.8.0 + 6699d07 Add av_get_exact_bits_per_sample() + 9524cf7 Add av_get_audio_frame_duration() + +2012-03-04 - 44fe77b - lavc 54.7.0 - avcodec.h + Add av_codec_is_encoder/decoder(). + +2012-03-01 - 442c132 - lavc 54.3.0 - avcodec.h + Add av_packet_shrink_side_data. + +2012-02-29 - dd2a4bc - lavf 54.2.0 - avformat.h + Add AVStream.attached_pic and AV_DISPOSITION_ATTACHED_PIC, + used for dealing with attached pictures/cover art. + +2012-02-25 - c9bca80 - lavu 51.24.0 - error.h + Add AVERROR_UNKNOWN + NOTE: this was backported to 0.8 + +2012-02-20 - e9cda85 - lavc 54.2.0 + Add duration field to AVCodecParserContext + +2012-02-20 - 0b42a93 - lavu 51.23.1 - mathematics.h + Add av_rescale_q_rnd() + +2012-02-08 - 38d5533 - lavu 51.22.1 - pixdesc.h + Add PIX_FMT_PSEUDOPAL flag. + +2012-02-08 - 52f82a1 - lavc 54.01.0 + Add avcodec_encode_video2() and deprecate avcodec_encode_video(). + +2012-02-01 - 316fc74 - lavc 54.01.0 + Add av_fast_padded_malloc() as alternative for av_realloc() when aligned + memory is required. The buffer will always have FF_INPUT_BUFFER_PADDING_SIZE + zero-padded bytes at the end. + +2012-01-31 - dd6d3b0 - lavf 54.01.0 + Add avformat_get_riff_video_tags() and avformat_get_riff_audio_tags(). + NOTE: this was backported to 0.8 + +2012-01-31 - af08d9a - lavc 54.01.0 + Add avcodec_is_open() function. + NOTE: this was backported to 0.8 + +2012-01-30 - 8b93312 - lavu 51.22.0 - intfloat.h + Add a new installed header libavutil/intfloat.h with int/float punning + functions. + NOTE: this was backported to 0.8 + +2012-01-25 - lavf 53.22.0 + f1caf01 Allow doing av_write_frame(ctx, NULL) for flushing possible + buffered data within a muxer. Added AVFMT_ALLOW_FLUSH for + muxers supporting it (av_write_frame makes sure it is called + only for muxers with this flag). + +2012-01-15 - lavc 53.34.0 + New audio encoding API: + b2c75b6 Add CODEC_CAP_VARIABLE_FRAME_SIZE capability for use by audio + encoders. + 5ee5fa0 Add avcodec_fill_audio_frame() as a convenience function. + b2c75b6 Add avcodec_encode_audio2() and deprecate avcodec_encode_audio(). + Add AVCodec.encode2(). + +2012-01-12 - 3167dc9 - lavfi 2.15.0 + Add a new installed header -- libavfilter/version.h -- with version macros. + +2011-12-08 - a502939 - lavfi 2.52.0 + Add av_buffersink_poll_frame() to buffersink.h. + +2011-12-08 - 26c6fec - lavu 51.31.0 + Add av_log_format_line. + +2011-12-03 - 976b095 - lavu 51.30.0 + Add AVERROR_BUG. + +2011-11-24 - 573ffbb - lavu 51.28.1 + Add av_get_alt_sample_fmt() to samplefmt.h. + +2011-11-03 - 96949da - lavu 51.23.0 + Add av_strcasecmp() and av_strncasecmp() to avstring.h. + +2011-10-20 - b35e9e1 - lavu 51.22.0 + Add av_strtok() to avstring.h. + +2011-01-03 - b73ec05 - lavu 51.21.0 + Add av_popcount64 + +2011-12-18 - 8400b12 - lavc 53.28.1 + Deprecate AVFrame.age. The field is unused. + +2011-12-12 - 5266045 - lavf 53.17.0 + Add avformat_close_input(). + Deprecate av_close_input_file() and av_close_input_stream(). + +2011-12-02 - 0eea212 - lavc 53.25.0 + Add nb_samples and extended_data fields to AVFrame. + Deprecate AVCODEC_MAX_AUDIO_FRAME_SIZE. + Deprecate avcodec_decode_audio3() in favor of avcodec_decode_audio4(). + avcodec_decode_audio4() writes output samples to an AVFrame, which allows + audio decoders to use get_buffer(). + +2011-12-04 - 560f773 - lavc 53.24.0 + Change AVFrame.data[4]/base[4]/linesize[4]/error[4] to [8] at next major bump. + Change AVPicture.data[4]/linesize[4] to [8] at next major bump. + Change AVCodecContext.error[4] to [8] at next major bump. + Add AV_NUM_DATA_POINTERS to simplify the bump transition. + +2011-11-23 - bbb46f3 - lavu 51.18.0 + Add av_samples_get_buffer_size(), av_samples_fill_arrays(), and + av_samples_alloc(), to samplefmt.h. + +2011-11-23 - 8889cc4 - lavu 51.17.0 + Add planar sample formats and av_sample_fmt_is_planar() to samplefmt.h. + +2011-11-19 - f3a29b7 - lavc 53.21.0 + Move some AVCodecContext fields to a new private struct, AVCodecInternal, + which is accessed from a new field, AVCodecContext.internal. + - fields moved: + AVCodecContext.internal_buffer --> AVCodecInternal.buffer + AVCodecContext.internal_buffer_count --> AVCodecInternal.buffer_count + AVCodecContext.is_copy --> AVCodecInternal.is_copy + +2011-11-16 - 6270671 - lavu 51.16.0 + Add av_timegm() + +2011-11-13 - lavf 53.15.0 + New interrupt callback API, allowing per-AVFormatContext/AVIOContext + interrupt callbacks. + 6aa0b98 Add AVIOInterruptCB struct and the interrupt_callback field to + AVFormatContext. + 1dee0ac Add avio_open2() with additional parameters. Those are + an interrupt callback and an options AVDictionary. + This will allow passing AVOptions to protocols after lavf + 54.0. + +2011-11-06 - ba04ecf - lavu 51.14.0 + Add av_strcasecmp() and av_strncasecmp() to avstring.h. + +2011-11-06 - 07b172f - lavu 51.13.0 + Add av_toupper()/av_tolower() + +2011-11-05 - b6d08f4 - lavf 53.13.0 + Add avformat_network_init()/avformat_network_deinit() + +2011-10-27 - 512557b - lavc 53.15.0 + Remove avcodec_parse_frame. + Deprecate AVCodecContext.parse_only and CODEC_CAP_PARSE_ONLY. + +2011-10-19 - 569129a - lavf 53.10.0 + Add avformat_new_stream(). Deprecate av_new_stream(). + +2011-10-13 - b631fba - lavf 53.9.0 + Add AVFMT_NO_BYTE_SEEK AVInputFormat flag. + +2011-10-12 - lavu 51.12.0 + AVOptions API rewrite. + + - 145f741 FF_OPT_TYPE* renamed to AV_OPT_TYPE_* + - new setting/getting functions with slightly different semantics: + dac66da av_set_string3 -> av_opt_set + av_set_double -> av_opt_set_double + av_set_q -> av_opt_set_q + av_set_int -> av_opt_set_int + + 41d9d51 av_get_string -> av_opt_get + av_get_double -> av_opt_get_double + av_get_q -> av_opt_get_q + av_get_int -> av_opt_get_int + + - 8c5dcaa trivial rename av_next_option -> av_opt_next + - 641c7af new functions - av_opt_child_next, av_opt_child_class_next + and av_opt_find2() + +2011-09-22 - a70e787 - lavu 51.17.0 + Add av_x_if_null(). + +2011-09-18 - 645cebb - lavc 53.16.0 + Add showall flag2 + +2011-09-16 - ea8de10 - lavfi 2.42.0 + Add avfilter_all_channel_layouts. + +2011-09-16 - 9899037 - lavfi 2.41.0 + Rename avfilter_all_* function names to avfilter_make_all_*. + + In particular, apply the renames: + avfilter_all_formats -> avfilter_make_all_formats + avfilter_all_channel_layouts -> avfilter_make_all_channel_layouts + avfilter_all_packing_formats -> avfilter_make_all_packing_formats + +2011-09-12 - 4381bdd - lavfi 2.40.0 + Change AVFilterBufferRefAudioProps.sample_rate type from uint32_t to int. + +2011-09-12 - 2c03174 - lavfi 2.40.0 + Simplify signature for avfilter_get_audio_buffer(), make it + consistent with avfilter_get_video_buffer(). + +2011-09-06 - 4f7dfe1 - lavfi 2.39.0 + Rename libavfilter/vsink_buffer.h to libavfilter/buffersink.h. + +2011-09-06 - c4415f6 - lavfi 2.38.0 + Unify video and audio sink API. + + In particular, add av_buffersink_get_buffer_ref(), deprecate + av_vsink_buffer_get_video_buffer_ref() and change the value for the + opaque field passed to the abuffersink init function. + +2011-09-04 - 61e2e29 - lavu 51.16.0 + Add av_asprintf(). + +2011-08-22 - dacd827 - lavf 53.10.0 + Add av_find_program_from_stream(). + +2011-08-20 - 69e2c1a - lavu 51.13.0 + Add av_get_media_type_string(). + +2011-09-03 - fb4ca26 - lavc 53.13.0 + lavf 53.11.0 + lsws 2.1.0 + Add {avcodec,avformat,sws}_get_class(). + +2011-08-03 - c11fb82 - lavu 51.15.0 + Add AV_OPT_SEARCH_FAKE_OBJ flag for av_opt_find() function. + +2011-08-14 - 323b930 - lavu 51.12.0 + Add av_fifo_peek2(), deprecate av_fifo_peek(). + +2011-08-26 - lavu 51.9.0 + - add41de..abc78a5 Do not include intfloat_readwrite.h, + mathematics.h, rational.h, pixfmt.h, or log.h from avutil.h. + +2011-08-16 - 48f9e45 - lavf 53.8.0 + Add avformat_query_codec(). + +2011-08-16 - bca06e7 - lavc 53.11.0 + Add avcodec_get_type(). + +2011-08-06 - 2f63440 - lavf 53.7.0 + Add error_recognition to AVFormatContext. + +2011-08-02 - 9d39cbf - lavc 53.9.1 + Add AV_PKT_FLAG_CORRUPT AVPacket flag. + +2011-07-16 - b57df29 - lavfi 2.27.0 + Add audio packing negotiation fields and helper functions. + + In particular, add AVFilterPacking enum, planar, in_packings and + out_packings fields to AVFilterLink, and the functions: + avfilter_set_common_packing_formats() + avfilter_all_packing_formats() + +2011-07-10 - a67c061 - lavf 53.6.0 + Add avformat_find_stream_info(), deprecate av_find_stream_info(). + NOTE: this was backported to 0.7 + +2011-07-10 - 0b950fe - lavc 53.8.0 + Add avcodec_open2(), deprecate avcodec_open(). + NOTE: this was backported to 0.7 + + Add avcodec_alloc_context3. Deprecate avcodec_alloc_context() and + avcodec_alloc_context2(). + +2011-07-01 - b442ca6 - lavf 53.5.0 - avformat.h + Add function av_get_output_timestamp(). + +2011-06-28 - 5129336 - lavu 51.11.0 - avutil.h + Define the AV_PICTURE_TYPE_NONE value in AVPictureType enum. + +2011-06-19 - fd2c0a5 - lavfi 2.23.0 - avfilter.h + Add layout negotiation fields and helper functions. + + In particular, add in_chlayouts and out_chlayouts to AVFilterLink, + and the functions: + avfilter_set_common_sample_formats() + avfilter_set_common_channel_layouts() + avfilter_all_channel_layouts() + +2011-06-19 - 527ca39 - lavfi 2.22.0 - AVFilterFormats + Change type of AVFilterFormats.formats from int * to int64_t *, + and update formats handling API accordingly. + + avfilter_make_format_list() still takes a int32_t array and converts + it to int64_t. A new function, avfilter_make_format64_list(), that + takes int64_t arrays has been added. + +2011-06-19 - 44f669e - lavfi 2.21.0 - vsink_buffer.h + Add video sink buffer and vsink_buffer.h public header. + +2011-06-12 - 9fdf772 - lavfi 2.18.0 - avcodec.h + Add avfilter_get_video_buffer_ref_from_frame() function in + libavfilter/avcodec.h. + +2011-06-12 - c535494 - lavfi 2.17.0 - avfiltergraph.h + Add avfilter_inout_alloc() and avfilter_inout_free() functions. + +2011-06-12 - 6119b23 - lavfi 2.16.0 - avfilter_graph_parse() + Change avfilter_graph_parse() signature. + +2011-06-23 - 67e9ae1 - lavu 51.8.0 - attributes.h + Add av_printf_format(). + +2011-06-16 - 05e84c9, 25de595 - lavf 53.2.0 - avformat.h + Add avformat_open_input and avformat_write_header(). + Deprecate av_open_input_stream, av_open_input_file, + AVFormatParameters and av_write_header. + +2011-06-16 - 7e83e1c, dc59ec5 - lavu 51.7.0 - opt.h + Add av_opt_set_dict() and av_opt_find(). + Deprecate av_find_opt(). + Add AV_DICT_APPEND flag. + +2011-06-10 - cb7c11c - lavu 51.6.0 - opt.h + Add av_opt_flag_is_set(). + +2011-06-10 - c381960 - lavfi 2.15.0 - avfilter_get_audio_buffer_ref_from_arrays + Add avfilter_get_audio_buffer_ref_from_arrays() to avfilter.h. + +2011-06-09 - d9f80ea - lavu 51.8.0 - AVMetadata + Move AVMetadata from lavf to lavu and rename it to + AVDictionary -- new installed header dict.h. + All av_metadata_* functions renamed to av_dict_*. + +2011-06-07 - a6703fa - lavu 51.8.0 - av_get_bytes_per_sample() + Add av_get_bytes_per_sample() in libavutil/samplefmt.h. + Deprecate av_get_bits_per_sample_fmt(). + +2011-06-05 - b39b062 - lavu 51.8.0 - opt.h + Add av_opt_free convenience function. + +2011-06-06 - 95a0242 - lavfi 2.14.0 - AVFilterBufferRefAudioProps + Remove AVFilterBufferRefAudioProps.size, and use nb_samples in + avfilter_get_audio_buffer() and avfilter_default_get_audio_buffer() in + place of size. + +2011-06-06 - 0bc2cca - lavu 51.6.0 - av_samples_alloc() + Switch nb_channels and nb_samples parameters order in + av_samples_alloc(). + +2011-06-06 - e1c7414 - lavu 51.5.0 - av_samples_* + Change the data layout created by av_samples_fill_arrays() and + av_samples_alloc(). + +2011-06-06 - 27bcf55 - lavfi 2.13.0 - vsrc_buffer.h + Make av_vsrc_buffer_add_video_buffer_ref() accepts an additional + flags parameter in input. + +2011-06-03 - e977ca2 - lavfi 2.12.0 - avfilter_link_free() + Add avfilter_link_free() function. + +2011-06-02 - 5ad38d9 - lavu 51.4.0 - av_force_cpu_flags() + Add av_cpu_flags() in libavutil/cpu.h. + +2011-05-28 - e71f260 - lavu 51.3.0 - pixdesc.h + Add av_get_pix_fmt_name() in libavutil/pixdesc.h, and deprecate + avcodec_get_pix_fmt_name() in libavcodec/avcodec.h in its favor. + +2011-05-25 - 30315a8 - lavf 53.3.0 - avformat.h + Add fps_probe_size to AVFormatContext. + +2011-05-22 - 5ecdfd0 - lavf 53.2.0 - avformat.h + Introduce avformat_alloc_output_context2() and deprecate + avformat_alloc_output_context(). + +2011-05-22 - 83db719 - lavfi 2.10.0 - vsrc_buffer.h + Make libavfilter/vsrc_buffer.h public. + +2011-05-19 - c000a9f - lavfi 2.8.0 - avcodec.h + Add av_vsrc_buffer_add_frame() to libavfilter/avcodec.h. + +2011-05-14 - 9fdf772 - lavfi 2.6.0 - avcodec.h + Add avfilter_get_video_buffer_ref_from_frame() to libavfilter/avcodec.h. + +2011-05-18 - 64150ff - lavc 53.7.0 - AVCodecContext.request_sample_fmt + Add request_sample_fmt field to AVCodecContext. + +2011-05-10 - 188dea1 - lavc 53.6.0 - avcodec.h + Deprecate AVLPCType and the following fields in + AVCodecContext: lpc_coeff_precision, prediction_order_method, + min_partition_order, max_partition_order, lpc_type, lpc_passes. + Corresponding FLAC encoder options should be used instead. + +2011-05-07 - 9fdf772 - lavfi 2.5.0 - avcodec.h + Add libavfilter/avcodec.h header and avfilter_copy_frame_props() + function. + +2011-05-07 - 18ded93 - lavc 53.5.0 - AVFrame + Add format field to AVFrame. + +2011-05-07 - 22333a6 - lavc 53.4.0 - AVFrame + Add width and height fields to AVFrame. + +2011-05-01 - 35fe66a - lavfi 2.4.0 - avfilter.h + Rename AVFilterBufferRefVideoProps.pixel_aspect to + sample_aspect_ratio. + +2011-05-01 - 77e9dee - lavc 53.3.0 - AVFrame + Add a sample_aspect_ratio field to AVFrame. + +2011-05-01 - 1ba5727 - lavc 53.2.0 - AVFrame + Add a pkt_pos field to AVFrame. + +2011-04-29 - 35ceaa7 - lavu 51.2.0 - mem.h + Add av_dynarray_add function for adding + an element to a dynamic array. + +2011-04-26 - bebe72f - lavu 51.1.0 - avutil.h + Add AVPictureType enum and av_get_picture_type_char(), deprecate + FF_*_TYPE defines and av_get_pict_type_char() defined in + libavcodec/avcodec.h. + +2011-04-26 - 10d3940 - lavfi 2.3.0 - avfilter.h + Add pict_type and key_frame fields to AVFilterBufferRefVideo. + +2011-04-26 - 7a11c82 - lavfi 2.2.0 - vsrc_buffer + Add sample_aspect_ratio fields to vsrc_buffer arguments + +2011-04-21 - 94f7451 - lavc 53.1.0 - avcodec.h + Add CODEC_CAP_SLICE_THREADS for codecs supporting sliced threading. + +2011-04-15 - lavc 52.120.0 - avcodec.h + AVPacket structure got additional members for passing side information: + 4de339e introduce side information for AVPacket + 2d8591c make containers pass palette change in AVPacket + +2011-04-12 - lavf 52.107.0 - avio.h + Avio cleanup, part II - deprecate the entire URLContext API: + 175389c add avio_check as a replacement for url_exist + ff1ec0c add avio_pause and avio_seek_time as replacements + for _av_url_read_fseek/fpause + cdc6a87 deprecate av_protocol_next(), avio_enum_protocols + should be used instead. + 80c6e23 rename url_set_interrupt_cb->avio_set_interrupt_cb. + f87b1b3 rename open flags: URL_* -> AVIO_* + f8270bb add avio_enum_protocols. + 5593f03 deprecate URLProtocol. + c486dad deprecate URLContext. + 026e175 deprecate the typedef for URLInterruptCB + 8e76a19 deprecate av_register_protocol2. + b840484 deprecate URL_PROTOCOL_FLAG_NESTED_SCHEME + 1305d93 deprecate av_url_read_seek + fa104e1 deprecate av_url_read_pause + 727c7aa deprecate url_get_filename(). + 5958df3 deprecate url_max_packet_size(). + 1869ea0 deprecate url_get_file_handle(). + 32a97d4 deprecate url_filesize(). + e52a914 deprecate url_close(). + 58a48c6 deprecate url_seek(). + 925e908 deprecate url_write(). + dce3756 deprecate url_read_complete(). + bc371ac deprecate url_read(). + 0589da0 deprecate url_open(). + 62eaaea deprecate url_connect. + 5652bb9 deprecate url_alloc. + 333e894 deprecate url_open_protocol + e230705 deprecate url_poll and URLPollEntry + +2011-04-08 - lavf 52.106.0 - avformat.h + Minor avformat.h cleanup: + a9bf9d8 deprecate av_guess_image2_codec + c3675df rename avf_sdp_create->av_sdp_create + +2011-04-03 - lavf 52.105.0 - avio.h + Large-scale renaming/deprecating of AVIOContext-related functions: + 724f6a0 deprecate url_fdopen + 403ee83 deprecate url_open_dyn_packet_buf + 6dc7d80 rename url_close_dyn_buf -> avio_close_dyn_buf + b92c545 rename url_open_dyn_buf -> avio_open_dyn_buf + 8978fed introduce an AVIOContext.seekable field as a replacement for + AVIOContext.is_streamed and url_is_streamed() + b64030f deprecate get_checksum() + 4c4427a deprecate init_checksum() + 4ec153b deprecate udp_set_remote_url/get_local_port + 933e90a deprecate av_url_read_fseek/fpause + 8d9769a deprecate url_fileno + b7f2fdd rename put_flush_packet -> avio_flush + 35f1023 deprecate url_close_buf + 83fddae deprecate url_open_buf + d9d86e0 rename url_fprintf -> avio_printf + 59f65d9 deprecate url_setbufsize + 3e68b3b deprecate url_ferror + e8bb2e2 deprecate url_fget_max_packet_size + 76aa876 rename url_fsize -> avio_size + e519753 deprecate url_fgetc + 655e45e deprecate url_fgets + a2704c9 rename url_ftell -> avio_tell + e16ead0 deprecate get_strz() in favor of avio_get_str + 0300db8,2af07d3 rename url_fskip -> avio_skip + 6b4aa5d rename url_fseek -> avio_seek + 61840b4 deprecate put_tag + 22a3212 rename url_fopen/fclose -> avio_open/close. + 0ac8e2b deprecate put_nbyte + 77eb550 rename put_byte -> avio_w8 + put_[b/l]e -> avio_w[b/l] + put_buffer -> avio_write + b7effd4 rename get_byte -> avio_r8, + get_[b/l]e -> avio_r[b/l] + get_buffer -> avio_read + b3db9ce deprecate get_partial_buffer + 8d9ac96 rename av_alloc_put_byte -> avio_alloc_context + +2011-03-25 - 34b47d7 - lavc 52.115.0 - AVCodecContext.audio_service_type + Add audio_service_type field to AVCodecContext. + +2011-03-17 - e309fdc - lavu 50.40.0 - pixfmt.h + Add PIX_FMT_BGR48LE and PIX_FMT_BGR48BE pixel formats + +2011-03-02 - 863c471 - lavf 52.103.0 - av_pkt_dump2, av_pkt_dump_log2 + Add new functions av_pkt_dump2, av_pkt_dump_log2 that uses the + source stream timebase for outputting timestamps. Deprecate + av_pkt_dump and av_pkt_dump_log. + +2011-02-20 - e731b8d - lavf 52.102.0 - avio.h + * e731b8d - rename init_put_byte() to ffio_init_context(), deprecating the + original, and move it to a private header so it is no longer + part of our public API. Instead, use av_alloc_put_byte(). + * ae628ec - rename ByteIOContext to AVIOContext. + +2011-02-16 - 09d171b - lavf 52.101.0 - avformat.h + lavu 52.39.0 - parseutils.h + * 610219a - Add av_ prefix to dump_format(). + * f6c7375 - Replace parse_date() in lavf with av_parse_time() in lavu. + * ab0287f - Move find_info_tag from lavf to lavu and add av_prefix to it. + +2011-02-15 - lavu 52.38.0 - merge libavcore + libavcore is merged back completely into libavutil + +2011-02-10 - 55bad0c - lavc 52.113.0 - vbv_delay + Add vbv_delay field to AVCodecContext + +2011-02-14 - 24a83bd - lavf 52.100.0 - AV_DISPOSITION_CLEAN_EFFECTS + Add AV_DISPOSITION_CLEAN_EFFECTS disposition flag. + +2011-02-14 - 910b5b8 - lavfi 1.76.0 - AVFilterLink sample_aspect_ratio + Add sample_aspect_ratio field to AVFilterLink. + +2011-02-10 - 12c14cd - lavf 52.99.0 - AVStream.disposition + Add AV_DISPOSITION_HEARING_IMPAIRED and AV_DISPOSITION_VISUAL_IMPAIRED. + +2011-02-09 - 5592734 - lavc 52.112.0 - avcodec_thread_init() + Deprecate avcodec_thread_init()/avcodec_thread_free() use; instead + set thread_count before calling avcodec_open. + +2011-02-09 - 778b08a - lavc 52.111.0 - threading API + Add CODEC_CAP_FRAME_THREADS with new restrictions on get_buffer()/ + release_buffer()/draw_horiz_band() callbacks for appropriate codecs. + Add thread_type and active_thread_type fields to AVCodecContext. + +2011-02-08 - 3940caa - lavf 52.98.0 - av_probe_input_buffer + Add av_probe_input_buffer() to avformat.h for probing format from a + ByteIOContext. + +2011-02-06 - fe174fc - lavf 52.97.0 - avio.h + Add flag for non-blocking protocols: URL_FLAG_NONBLOCK + +2011-02-04 - f124b08 - lavf 52.96.0 - avformat_free_context() + Add avformat_free_context() in avformat.h. + +2011-02-03 - f5b82f4 - lavc 52.109.0 - add CODEC_ID_PRORES + Add CODEC_ID_PRORES to avcodec.h. + +2011-02-03 - fe9a3fb - lavc 52.109.0 - H.264 profile defines + Add defines for H.264 * Constrained Baseline and Intra profiles + +2011-02-02 - lavf 52.95.0 + * 50196a9 - add a new installed header version.h. + * 4efd5cf, dccbd97, 93b78d1 - add several variants of public + avio_{put,get}_str* functions. Deprecate corresponding semi-public + {put,get}_str*. + +2011-02-02 - dfd2a00 - lavu 50.37.0 - log.h + Make av_dlog public. + +2011-01-31 - 7b3ea55 - lavfi 1.76.0 - vsrc_buffer + Add sample_aspect_ratio fields to vsrc_buffer arguments + +2011-01-31 - 910b5b8 - lavfi 1.75.0 - AVFilterLink sample_aspect_ratio + Add sample_aspect_ratio field to AVFilterLink. + +2011-01-15 - a242ac3 - lavfi 1.74.0 - AVFilterBufferRefAudioProps + Rename AVFilterBufferRefAudioProps.samples_nb to nb_samples. + +2011-01-14 - 7f88a5b - lavf 52.93.0 - av_metadata_copy() + Add av_metadata_copy() in avformat.h. + +2011-01-07 - 81c623f - lavc 52.107.0 - deprecate reordered_opaque + Deprecate reordered_opaque in favor of pkt_pts/dts. + +2011-01-07 - 1919fea - lavc 52.106.0 - pkt_dts + Add pkt_dts to AVFrame, this will in the future allow multithreading decoders + to not mess up dts. + +2011-01-07 - 393cbb9 - lavc 52.105.0 - pkt_pts + Add pkt_pts to AVFrame. + +2011-01-07 - 060ec0a - lavc 52.104.0 - av_get_profile_name() + Add av_get_profile_name to libavcodec/avcodec.h. + +2010-12-27 - 0ccabee - lavfi 1.71.0 - AV_PERM_NEG_LINESIZES + Add AV_PERM_NEG_LINESIZES in avfilter.h. + +2010-12-27 - 9128ae0 - lavf 52.91.0 - av_find_best_stream() + Add av_find_best_stream to libavformat/avformat.h. + +2010-12-27 - 107a7e3 - lavf 52.90.0 + Add AVFMT_NOSTREAMS flag for formats with no streams, + like e.g. text metadata. + +2010-12-22 - 0328b9e - lavu 50.36.0 - file.h + Add functions av_file_map() and av_file_unmap() in file.h. + +2010-12-19 - 0bc55f5 - lavu 50.35.0 - error.h + Add "not found" error codes: + AVERROR_DEMUXER_NOT_FOUND + AVERROR_MUXER_NOT_FOUND + AVERROR_DECODER_NOT_FOUND + AVERROR_ENCODER_NOT_FOUND + AVERROR_PROTOCOL_NOT_FOUND + AVERROR_FILTER_NOT_FOUND + AVERROR_BSF_NOT_FOUND + AVERROR_STREAM_NOT_FOUND + +2010-12-09 - c61cdd0 - lavcore 0.16.0 - avcore.h + Move AV_NOPTS_VALUE, AV_TIME_BASE, AV_TIME_BASE_Q symbols from + avcodec.h to avcore.h. + +2010-12-04 - 16cfc96 - lavc 52.98.0 - CODEC_CAP_NEG_LINESIZES + Add CODEC_CAP_NEG_LINESIZES codec capability flag in avcodec.h. + +2010-12-04 - bb4afa1 - lavu 50.34.0 - av_get_pix_fmt_string() + Deprecate avcodec_pix_fmt_string() in favor of + pixdesc.h/av_get_pix_fmt_string(). + +2010-12-04 - 4da12e3 - lavcore 0.15.0 - av_image_alloc() + Add av_image_alloc() to libavcore/imgutils.h. + +2010-12-02 - 037be76 - lavfi 1.67.0 - avfilter_graph_create_filter() + Add function avfilter_graph_create_filter() in avfiltergraph.h. + +2010-11-25 - 4723bc2 - lavfi 1.65.0 - avfilter_get_video_buffer_ref_from_arrays() + Add function avfilter_get_video_buffer_ref_from_arrays() in + avfilter.h. + +2010-11-21 - 176a615 - lavcore 0.14.0 - audioconvert.h + Add a public audio channel API in audioconvert.h, and deprecate the + corresponding functions in libavcodec: + avcodec_get_channel_name() + avcodec_get_channel_layout() + avcodec_get_channel_layout_string() + avcodec_channel_layout_num_channels() + and the CH_* macros defined in libavcodec/avcodec.h. + +2010-11-21 - 6bfc268 - lavf 52.85.0 - avformat.h + Add av_append_packet(). + +2010-11-21 - a08d918 - lavc 52.97.0 - avcodec.h + Add av_grow_packet(). + +2010-11-17 - 0985e1a - lavcore 0.13.0 - parseutils.h + Add av_parse_color() declared in libavcore/parseutils.h. + +2010-11-13 - cb2c971 - lavc 52.95.0 - AVCodecContext + Add AVCodecContext.subtitle_header and AVCodecContext.subtitle_header_size + fields. + +2010-11-13 - 5aaea02 - lavfi 1.62.0 - avfiltergraph.h + Make avfiltergraph.h public. + +2010-11-13 - 4fcbb2a - lavfi 1.61.0 - avfiltergraph.h + Remove declarations from avfiltergraph.h for the functions: + avfilter_graph_check_validity() + avfilter_graph_config_links() + avfilter_graph_config_formats() + which are now internal. + Use avfilter_graph_config() instead. + +2010-11-08 - d2af720 - lavu 50.33.0 - eval.h + Deprecate functions: + av_parse_and_eval_expr(), + av_parse_expr(), + av_eval_expr(), + av_free_expr(), + in favor of the functions: + av_expr_parse_and_eval(), + av_expr_parse(), + av_expr_eval(), + av_expr_free(). + +2010-11-08 - 24de0ed - lavfi 1.59.0 - avfilter_free() + Rename avfilter_destroy() to avfilter_free(). + This change breaks libavfilter API/ABI. + +2010-11-07 - 1e80a0e - lavfi 1.58.0 - avfiltergraph.h + Remove graphparser.h header, move AVFilterInOut and + avfilter_graph_parse() declarations to libavfilter/avfiltergraph.h. + +2010-11-07 - 7313132 - lavfi 1.57.0 - AVFilterInOut + Rename field AVFilterInOut.filter to AVFilterInOut.filter_ctx. + This change breaks libavfilter API. + +2010-11-04 - 97dd1e4 - lavfi 1.56.0 - avfilter_graph_free() + Rename avfilter_graph_destroy() to avfilter_graph_free(). + This change breaks libavfilter API/ABI. + +2010-11-04 - e15aeea - lavfi 1.55.0 - avfilter_graph_alloc() + Add avfilter_graph_alloc() to libavfilter/avfiltergraph.h. + +2010-11-02 - 6f84cd1 - lavcore 0.12.0 - av_get_bits_per_sample_fmt() + Add av_get_bits_per_sample_fmt() to libavcore/samplefmt.h and + deprecate av_get_bits_per_sample_format(). + +2010-11-02 - d63e456 - lavcore 0.11.0 - samplefmt.h + Add sample format functions in libavcore/samplefmt.h: + av_get_sample_fmt_name(), + av_get_sample_fmt(), + av_get_sample_fmt_string(), + and deprecate the corresponding libavcodec/audioconvert.h functions: + avcodec_get_sample_fmt_name(), + avcodec_get_sample_fmt(), + avcodec_sample_fmt_string(). + +2010-11-02 - 262d1c5 - lavcore 0.10.0 - samplefmt.h + Define enum AVSampleFormat in libavcore/samplefmt.h, deprecate enum + SampleFormat. + +2010-10-16 - 2a24df9 - lavfi 1.52.0 - avfilter_graph_config() + Add the function avfilter_graph_config() in avfiltergraph.h. + +2010-10-15 - 03700d3 - lavf 52.83.0 - metadata API + Change demuxers to export metadata in generic format and + muxers to accept generic format. Deprecate the public + conversion API. + +2010-10-10 - 867ae7a - lavfi 1.49.0 - AVFilterLink.time_base + Add time_base field to AVFilterLink. + +2010-09-27 - c85eef4 - lavu 50.31.0 - av_set_options_string() + Move av_set_options_string() from libavfilter/parseutils.h to + libavutil/opt.h. + +2010-09-27 - acc0490 - lavfi 1.47.0 - AVFilterLink + Make the AVFilterLink fields srcpad and dstpad store the pointers to + the source and destination pads, rather than their indexes. + +2010-09-27 - 372e288 - lavu 50.30.0 - av_get_token() + Move av_get_token() from libavfilter/parseutils.h to + libavutil/avstring.h. + +2010-09-26 - 635d4ae - lsws 0.12.0 - swscale.h + Add the functions sws_alloc_context() and sws_init_context(). + +2010-09-26 - 6ed0404 - lavu 50.29.0 - opt.h + Move libavcodec/opt.h to libavutil/opt.h. + +2010-09-24 - 1c1c80f - lavu 50.28.0 - av_log_set_flags() + Default of av_log() changed due to many problems to the old no repeat + detection. Read the docs of AV_LOG_SKIP_REPEATED in log.h before + enabling it for your app!. + +2010-09-24 - f66eb58 - lavc 52.90.0 - av_opt_show2() + Deprecate av_opt_show() in favor or av_opt_show2(). + +2010-09-14 - bc6f0af - lavu 50.27.0 - av_popcount() + Add av_popcount() to libavutil/common.h. + +2010-09-08 - c6c98d0 - lavu 50.26.0 - av_get_cpu_flags() + Add av_get_cpu_flags(). + +2010-09-07 - 34017fd - lavcore 0.9.0 - av_image_copy() + Add av_image_copy(). + +2010-09-07 - 9686abb - lavcore 0.8.0 - av_image_copy_plane() + Add av_image_copy_plane(). + +2010-09-07 - 9b7269e - lavcore 0.7.0 - imgutils.h + Adopt hierarchical scheme for the imgutils.h function names, + deprecate the old names. + +2010-09-04 - 7160bb7 - lavu 50.25.0 - AV_CPU_FLAG_* + Deprecate the FF_MM_* flags defined in libavcodec/avcodec.h in favor + of the AV_CPU_FLAG_* flags defined in libavutil/cpu.h. + +2010-08-26 - 5da19b5 - lavc 52.87.0 - avcodec_get_channel_layout() + Add avcodec_get_channel_layout() in audioconvert.h. + +2010-08-20 - e344336 - lavcore 0.6.0 - av_fill_image_max_pixsteps() + Rename av_fill_image_max_pixstep() to av_fill_image_max_pixsteps(). + +2010-08-18 - a6ddf8b - lavcore 0.5.0 - av_fill_image_max_pixstep() + Add av_fill_image_max_pixstep() in imgutils.h. + +2010-08-17 - 4f2d2e4 - lavu 50.24.0 - AV_NE() + Add the AV_NE macro. + +2010-08-17 - ad2c950 - lavfi 1.36.0 - audio framework + Implement AVFilterBufferRefAudioProps struct for audio properties, + get_audio_buffer(), filter_samples() functions and related changes. + +2010-08-12 - 81c1eca - lavcore 0.4.0 - av_get_image_linesize() + Add av_get_image_linesize() in imgutils.h. + +2010-08-11 - c1db7bf - lavfi 1.34.0 - AVFilterBufferRef + Resize data and linesize arrays in AVFilterBufferRef to 8. + + This change breaks libavfilter API/ABI. + +2010-08-11 - 9f08d80 - lavc 52.85.0 - av_picture_data_copy() + Add av_picture_data_copy in avcodec.h. + +2010-08-11 - 84c0386 - lavfi 1.33.0 - avfilter_open() + Change avfilter_open() signature: + AVFilterContext *avfilter_open(AVFilter *filter, const char *inst_name) -> + int avfilter_open(AVFilterContext **filter_ctx, AVFilter *filter, const char *inst_name); + + This change breaks libavfilter API/ABI. + +2010-08-11 - cc80caf - lavfi 1.32.0 - AVFilterBufferRef + Add a type field to AVFilterBufferRef, and move video specific + properties to AVFilterBufferRefVideoProps. + + This change breaks libavfilter API/ABI. + +2010-08-07 - 5d4890d - lavfi 1.31.0 - AVFilterLink + Rename AVFilterLink fields: + AVFilterLink.srcpic -> AVFilterLink.src_buf + AVFilterLink.cur_pic -> AVFilterLink.cur_buf + AVFilterLink.outpic -> AVFilterLink.out_buf + +2010-08-07 - 7fce481 - lavfi 1.30.0 + Rename functions and fields: + avfilter_(un)ref_pic -> avfilter_(un)ref_buffer + avfilter_copy_picref_props -> avfilter_copy_buffer_ref_props + AVFilterBufferRef.pic -> AVFilterBufferRef.buffer + +2010-08-07 - ecc8dad - lavfi 1.29.0 - AVFilterBufferRef + Rename AVFilterPicRef to AVFilterBufferRef. + +2010-08-07 - d54e094 - lavfi 1.28.0 - AVFilterBuffer + Move format field from AVFilterBuffer to AVFilterPicRef. + +2010-08-06 - bf176f5 - lavcore 0.3.0 - av_check_image_size() + Deprecate avcodec_check_dimensions() in favor of the function + av_check_image_size() defined in libavcore/imgutils.h. + +2010-07-30 - 56b5e9d - lavfi 1.27.0 - AVFilterBuffer + Increase size of the arrays AVFilterBuffer.data and + AVFilterBuffer.linesize from 4 to 8. + + This change breaks libavfilter ABI. + +2010-07-29 - e7bd48a - lavcore 0.2.0 - imgutils.h + Add functions av_fill_image_linesizes() and + av_fill_image_pointers(), declared in libavcore/imgutils.h. + +2010-07-27 - 126b638 - lavcore 0.1.0 - parseutils.h + Deprecate av_parse_video_frame_size() and av_parse_video_frame_rate() + defined in libavcodec in favor of the newly added functions + av_parse_video_size() and av_parse_video_rate() declared in + libavcore/parseutils.h. + +2010-07-23 - 4485247 - lavu 50.23.0 - mathematics.h + Add the M_PHI constant definition. + +2010-07-22 - bdab614 - lavfi 1.26.0 - media format generalization + Add a type field to AVFilterLink. + + Change the field types: + enum PixelFormat format -> int format in AVFilterBuffer + enum PixelFormat *formats -> int *formats in AVFilterFormats + enum PixelFormat *format -> int format in AVFilterLink + + Change the function signatures: + AVFilterFormats *avfilter_make_format_list(const enum PixelFormat *pix_fmts); -> + AVFilterFormats *avfilter_make_format_list(const int *fmts); + + int avfilter_add_colorspace(AVFilterFormats **avff, enum PixelFormat pix_fmt); -> + int avfilter_add_format (AVFilterFormats **avff, int fmt); + + AVFilterFormats *avfilter_all_colorspaces(void); -> + AVFilterFormats *avfilter_all_formats (enum AVMediaType type); + + This change breaks libavfilter API/ABI. + +2010-07-21 - aac6ca6 - lavcore 0.0.0 + Add libavcore. + +2010-07-17 - b5c582f - lavfi 1.25.0 - AVFilterBuffer + Remove w and h fields from AVFilterBuffer. + +2010-07-17 - f0d77b2 - lavfi 1.24.0 - AVFilterBuffer + Rename AVFilterPic to AVFilterBuffer. + +2010-07-17 - 57fe80f - lavf 52.74.0 - url_fskip() + Make url_fskip() return an int error code instead of void. + +2010-07-11 - 23940f1 - lavc 52.83.0 + Add AVCodecContext.lpc_type and AVCodecContext.lpc_passes fields. + Add AVLPCType enum. + Deprecate AVCodecContext.use_lpc. + +2010-07-11 - e1d7c88 - lavc 52.82.0 - avsubtitle_free() + Add a function for free the contents of a AVSubtitle generated by + avcodec_decode_subtitle. + +2010-07-11 - b91d08f - lavu 50.22.0 - bswap.h and intreadwrite.h + Make the bswap.h and intreadwrite.h API public. + +2010-07-08 - ce1cd1c - lavu 50.21.0 - pixdesc.h + Rename read/write_line() to av_read/write_image_line(). + +2010-07-07 - 4d508e4 - lavfi 1.21.0 - avfilter_copy_picref_props() + Add avfilter_copy_picref_props(). + +2010-07-03 - 2d525ef - lavc 52.79.0 + Add FF_COMPLIANCE_UNOFFICIAL and change all instances of + FF_COMPLIANCE_INOFFICIAL to use FF_COMPLIANCE_UNOFFICIAL. + +2010-07-02 - 89eec74 - lavu 50.20.0 - lfg.h + Export av_lfg_init(), av_lfg_get(), av_mlfg_get(), and av_bmg_get() through + lfg.h. + +2010-06-28 - a52e2c3 - lavfi 1.20.1 - av_parse_color() + Extend av_parse_color() syntax, make it accept an alpha value specifier and + set the alpha value to 255 by default. + +2010-06-22 - 735cf6b - lavf 52.71.0 - URLProtocol.priv_data_size, priv_data_class + Add priv_data_size and priv_data_class to URLProtocol. + +2010-06-22 - ffbb289 - lavf 52.70.0 - url_alloc(), url_connect() + Add url_alloc() and url_connect(). + +2010-06-22 - 9b07a2d - lavf 52.69.0 - av_register_protocol2() + Add av_register_protocol2(), deprecating av_register_protocol(). + +2010-06-09 - 65db058 - lavu 50.19.0 - av_compare_mod() + Add av_compare_mod() to libavutil/mathematics.h. + +2010-06-05 - 0b99215 - lavu 50.18.0 - eval API + Make the eval API public. + +2010-06-04 - 31878fc - lavu 50.17.0 - AV_BASE64_SIZE + Add AV_BASE64_SIZE() macro. + +2010-06-02 - 7e566bb - lavc 52.73.0 - av_get_codec_tag_string() + Add av_get_codec_tag_string(). + +2010-06-01 - 2b99142 - lsws 0.11.0 - convertPalette API + Add sws_convertPalette8ToPacked32() and sws_convertPalette8ToPacked24(). + +2010-05-26 - 93ebfee - lavc 52.72.0 - CODEC_CAP_EXPERIMENTAL + Add CODEC_CAP_EXPERIMENTAL flag. + NOTE: this was backported to 0.6 + +2010-05-23 - 9977863 - lavu 50.16.0 - av_get_random_seed() + Add av_get_random_seed(). + +2010-05-18 - 796ac23 - lavf 52.63.0 - AVFMT_FLAG_RTP_HINT + Add AVFMT_FLAG_RTP_HINT as possible value for AVFormatContext.flags. + NOTE: this was backported to 0.6 + +2010-05-09 - b6bc205 - lavfi 1.20.0 - AVFilterPicRef + Add interlaced and top_field_first fields to AVFilterPicRef. + +------------------------------8<------------------------------------- + 0.6 branch was cut here +----------------------------->8-------------------------------------- + +2010-05-01 - 8e2ee18 - lavf 52.62.0 - probe function + Add av_probe_input_format2 to API, it allows ignoring probe + results below given score and returns the actual probe score. + +2010-04-01 - 3dd6180 - lavf 52.61.0 - metadata API + Add a flag for av_metadata_set2() to disable overwriting of + existing tags. + +2010-04-01 - 0fb49b5 - lavc 52.66.0 + Add avcodec_get_edge_width(). + +2010-03-31 - d103218 - lavc 52.65.0 + Add avcodec_copy_context(). + +2010-03-31 - 1a70d12 - lavf 52.60.0 - av_match_ext() + Make av_match_ext() public. + +2010-03-31 - 1149150 - lavu 50.14.0 - AVMediaType + Move AVMediaType enum from libavcodec to libavutil. + +2010-03-31 - 72415b2 - lavc 52.64.0 - AVMediaType + Define AVMediaType enum, and use it instead of enum CodecType, which + is deprecated and will be dropped at the next major bump. + +2010-03-25 - 8795823 - lavu 50.13.0 - av_strerror() + Implement av_strerror(). + +2010-03-23 - e1484eb - lavc 52.60.0 - av_dct_init() + Support DCT-I and DST-I. + +2010-03-15 - b8819c8 - lavf 52.56.0 - AVFormatContext.start_time_realtime + Add AVFormatContext.start_time_realtime field. + +2010-03-13 - 5bb5c1d - lavfi 1.18.0 - AVFilterPicRef.pos + Add AVFilterPicRef.pos field. + +2010-03-13 - 60c144f - lavu 50.12.0 - error.h + Move error code definitions from libavcodec/avcodec.h to + the new public header libavutil/error.h. + +2010-03-07 - c709483 - lavc 52.56.0 - avfft.h + Add public FFT interface. + +2010-03-06 - ac6ef86 - lavu 50.11.0 - av_stristr() + Add av_stristr(). + +2010-03-03 - 4b83fc0 - lavu 50.10.0 - av_tree_enumerate() + Add av_tree_enumerate(). + +2010-02-07 - b687c1a - lavu 50.9.0 - av_compare_ts() + Add av_compare_ts(). + +2010-02-05 - 3f3dc76 - lsws 0.10.0 - sws_getCoefficients() + Add sws_getCoefficients(). + +2010-02-01 - ca76a11 - lavf 52.50.0 - metadata API + Add a list of generic tag names, change 'author' -> 'artist', + 'year' -> 'date'. + +2010-01-30 - 80a07f6 - lavu 50.8.0 - av_get_pix_fmt() + Add av_get_pix_fmt(). + +2010-01-21 - 01cc47d - lsws 0.9.0 - sws_scale() + Change constness attributes of sws_scale() parameters. + +2010-01-10 - 3fb8e77 - lavfi 1.15.0 - avfilter_graph_config_links() + Add a log_ctx parameter to avfilter_graph_config_links(). + +2010-01-07 - 8e9767f - lsws 0.8.0 - sws_isSupported{In,Out}put() + Add sws_isSupportedInput() and sws_isSupportedOutput() functions. + +2010-01-06 - c1d662f - lavfi 1.14.0 - avfilter_add_colorspace() + Change the avfilter_add_colorspace() signature, make it accept an + (AVFilterFormats **) rather than an (AVFilterFormats *) as before. + +2010-01-03 - 4fd1f18 - lavfi 1.13.0 - avfilter_add_colorspace() + Add avfilter_add_colorspace(). + +2010-01-02 - 8eb631f - lavf 52.46.0 - av_match_ext() + Add av_match_ext(), it should be used in place of match_ext(). + +2010-01-01 - a1f547b - lavf 52.45.0 - av_guess_format() + Add av_guess_format(), it should be used in place of guess_format(). + +2009-12-13 - a181981 - lavf 52.43.0 - metadata API + Add av_metadata_set2(), AV_METADATA_DONT_STRDUP_KEY and + AV_METADATA_DONT_STRDUP_VAL. + +2009-12-13 - 277c733 - lavu 50.7.0 - avstring.h API + Add av_d2str(). + +2009-12-13 - 02b398e - lavc 52.42.0 - AVStream + Add avg_frame_rate. + +2009-12-12 - 3ba69a1 - lavu 50.6.0 - av_bmg_next() + Introduce the av_bmg_next() function. + +2009-12-05 - a13a543 - lavfi 1.12.0 - avfilter_draw_slice() + Add a slice_dir parameter to avfilter_draw_slice(). + +2009-11-26 - 4cc3f6a - lavfi 1.11.0 - AVFilter + Remove the next field from AVFilter, this is not anymore required. + +2009-11-25 - 1433c4a - lavfi 1.10.0 - avfilter_next() + Introduce the avfilter_next() function. + +2009-11-25 - 86a60fa - lavfi 1.9.0 - avfilter_register() + Change the signature of avfilter_register() to make it return an + int. This is required since now the registration operation may fail. + +2009-11-25 - 74a0059 - lavu 50.5.0 - pixdesc.h API + Make the pixdesc.h API public. + +2009-10-27 - 243110f - lavfi 1.5.0 - AVFilter.next + Add a next field to AVFilter, this is used for simplifying the + registration and management of the registered filters. + +2009-10-23 - cccd292 - lavfi 1.4.1 - AVFilter.description + Add a description field to AVFilter. + +2009-10-19 - 6b5dc05 - lavfi 1.3.0 - avfilter_make_format_list() + Change the interface of avfilter_make_format_list() from + avfilter_make_format_list(int n, ...) to + avfilter_make_format_list(enum PixelFormat *pix_fmts). + +2009-10-18 - 0eb4ff9 - lavfi 1.0.0 - avfilter_get_video_buffer() + Make avfilter_get_video_buffer() recursive and add the w and h + parameters to it. + +2009-10-07 - 46c40e4 - lavfi 0.5.1 - AVFilterPic + Add w and h fields to AVFilterPic. + +2009-06-22 - 92400be - lavf 52.34.1 - AVFormatContext.packet_size + This is now an unsigned int instead of a signed int. + +2009-06-19 - a4276ba - lavc 52.32.0 - AVSubtitle.pts + Add a pts field to AVSubtitle which gives the subtitle packet pts + in AV_TIME_BASE. Some subtitle de-/encoders (e.g. XSUB) will + not work right without this. + +2009-06-03 - 8f3f2e0 - lavc 52.30.2 - AV_PKT_FLAG_KEY + PKT_FLAG_KEY has been deprecated and will be dropped at the next + major version. Use AV_PKT_FLAG_KEY instead. + +2009-06-01 - f988ce6 - lavc 52.30.0 - av_lockmgr_register() + av_lockmgr_register() can be used to register a callback function + that lavc (and in the future, libraries that depend on lavc) can use + to implement mutexes. The application should provide a callback function + that implements the AV_LOCK_* operations described in avcodec.h. + When the lock manager is registered, FFmpeg is guaranteed to behave + correctly in a multi-threaded application. + +2009-04-30 - ce1d9c8 - lavc 52.28.0 - av_free_packet() + av_free_packet() is no longer an inline function. It is now exported. + +2009-04-11 - 80d403f - lavc 52.25.0 - deprecate av_destruct_packet_nofree() + Please use NULL instead. This has been supported since r16506 + (lavf > 52.23.1, lavc > 52.10.0). + +2009-04-07 - 7a00bba - lavc 52.23.0 - avcodec_decode_video/audio/subtitle + The old decoding functions are deprecated, all new code should use the + new functions avcodec_decode_video2(), avcodec_decode_audio3() and + avcodec_decode_subtitle2(). These new functions take an AVPacket *pkt + argument instead of a const uint8_t *buf / int buf_size pair. + +2009-04-03 - 7b09db3 - lavu 50.3.0 - av_fifo_space() + Introduce the av_fifo_space() function. + +2009-04-02 - fabd246 - lavc 52.23.0 - AVPacket + Move AVPacket declaration from libavformat/avformat.h to + libavcodec/avcodec.h. + +2009-03-22 - 6e08ca9 - lavu 50.2.0 - RGB32 pixel formats + Convert the pixel formats PIX_FMT_ARGB, PIX_FMT_RGBA, PIX_FMT_ABGR, + PIX_FMT_BGRA, which were defined as macros, into enum PixelFormat values. + Conversely PIX_FMT_RGB32, PIX_FMT_RGB32_1, PIX_FMT_BGR32 and + PIX_FMT_BGR32_1 are now macros. + avcodec_get_pix_fmt() now recognizes the "rgb32" and "bgr32" aliases. + Re-sort the enum PixelFormat list accordingly. + This change breaks API/ABI backward compatibility. + +2009-03-22 - f82674e - lavu 50.1.0 - PIX_FMT_RGB5X5 endian variants + Add the enum PixelFormat values: + PIX_FMT_RGB565BE, PIX_FMT_RGB565LE, PIX_FMT_RGB555BE, PIX_FMT_RGB555LE, + PIX_FMT_BGR565BE, PIX_FMT_BGR565LE, PIX_FMT_BGR555BE, PIX_FMT_BGR555LE. + +2009-03-21 - ee6624e - lavu 50.0.0 - av_random* + The Mersenne Twister PRNG implemented through the av_random* functions + was removed. Use the lagged Fibonacci PRNG through the av_lfg* functions + instead. + +2009-03-08 - 41dd680 - lavu 50.0.0 - AVFifoBuffer + av_fifo_init, av_fifo_read, av_fifo_write and av_fifo_realloc were dropped + and replaced by av_fifo_alloc, av_fifo_generic_read, av_fifo_generic_write + and av_fifo_realloc2. + In addition, the order of the function arguments of av_fifo_generic_read + was changed to match av_fifo_generic_write. + The AVFifoBuffer/struct AVFifoBuffer may only be used in an opaque way by + applications, they may not use sizeof() or directly access members. + +2009-03-01 - ec26457 - lavf 52.31.0 - Generic metadata API + Introduce a new metadata API (see av_metadata_get() and friends). + The old API is now deprecated and should not be used anymore. This especially + includes the following structure fields: + - AVFormatContext.title + - AVFormatContext.author + - AVFormatContext.copyright + - AVFormatContext.comment + - AVFormatContext.album + - AVFormatContext.year + - AVFormatContext.track + - AVFormatContext.genre + - AVStream.language + - AVStream.filename + - AVProgram.provider_name + - AVProgram.name + - AVChapter.title diff --git a/project/jni/ffmpeg/doc/Doxyfile b/project/jni/ffmpeg/doc/Doxyfile new file mode 100644 index 000000000..b67606b6f --- /dev/null +++ b/project/jni/ffmpeg/doc/Doxyfile @@ -0,0 +1,1624 @@ +# Doxyfile 1.7.1 + +# This file describes the settings to be used by the documentation system +# doxygen (www.doxygen.org) for a project +# +# All text after a hash (#) is considered a comment and will be ignored +# The format is: +# TAG = value [value, ...] +# For lists items can also be appended using: +# TAG += value [value, ...] +# Values that contain spaces should be placed between quotes (" ") + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- + +# This tag specifies the encoding used for all characters in the config file +# that follow. The default is UTF-8 which is also the encoding used for all +# text before the first occurrence of this tag. Doxygen uses libiconv (or the +# iconv built into libc) for the transcoding. See +# http://www.gnu.org/software/libiconv for the list of possible encodings. + +DOXYFILE_ENCODING = UTF-8 + +# The PROJECT_NAME tag is a single word (or a sequence of words surrounded +# by quotes) that should identify the project. + +PROJECT_NAME = FFmpeg + +# The PROJECT_NUMBER tag can be used to enter a project or revision number. +# This could be handy for archiving the generated documentation or +# if some version control system is used. + +PROJECT_NUMBER = 1.1.2 + +# With the PROJECT_LOGO tag one can specify an logo or icon that is included +# in the documentation. The maximum height of the logo should not exceed 55 +# pixels and the maximum width should not exceed 200 pixels. Doxygen will +# copy the logo to the output directory. +PROJECT_LOGO = + +# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) +# base path where the generated documentation will be put. +# If a relative path is entered, it will be relative to the location +# where doxygen was started. If left blank the current directory will be used. + +OUTPUT_DIRECTORY = doc/doxy + +# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create +# 4096 sub-directories (in 2 levels) under the output directory of each output +# format and will distribute the generated files over these directories. +# Enabling this option can be useful when feeding doxygen a huge amount of +# source files, where putting all generated files in the same directory would +# otherwise cause performance problems for the file system. + +CREATE_SUBDIRS = NO + +# The OUTPUT_LANGUAGE tag is used to specify the language in which all +# documentation generated by doxygen is written. Doxygen will use this +# information to generate all constant output in the proper language. +# The default language is English, other supported languages are: +# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional, +# Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German, +# Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English +# messages), Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian, +# Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrilic, Slovak, +# Slovene, Spanish, Swedish, Ukrainian, and Vietnamese. + +OUTPUT_LANGUAGE = English + +# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will +# include brief member descriptions after the members that are listed in +# the file and class documentation (similar to JavaDoc). +# Set to NO to disable this. + +BRIEF_MEMBER_DESC = YES + +# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend +# the brief description of a member or function before the detailed description. +# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the +# brief descriptions will be completely suppressed. + +REPEAT_BRIEF = YES + +# This tag implements a quasi-intelligent brief description abbreviator +# that is used to form the text in various listings. Each string +# in this list, if found as the leading text of the brief description, will be +# stripped from the text and the result after processing the whole list, is +# used as the annotated text. Otherwise, the brief description is used as-is. +# If left blank, the following values are used ("$name" is automatically +# replaced with the name of the entity): "The $name class" "The $name widget" +# "The $name file" "is" "provides" "specifies" "contains" +# "represents" "a" "an" "the" + +ABBREVIATE_BRIEF = + +# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then +# Doxygen will generate a detailed section even if there is only a brief +# description. + +ALWAYS_DETAILED_SEC = NO + +# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all +# inherited members of a class in the documentation of that class as if those +# members were ordinary class members. Constructors, destructors and assignment +# operators of the base classes will not be shown. + +INLINE_INHERITED_MEMB = NO + +# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full +# path before files name in the file list and in the header files. If set +# to NO the shortest path that makes the file name unique will be used. + +FULL_PATH_NAMES = YES + +# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag +# can be used to strip a user-defined part of the path. Stripping is +# only done if one of the specified strings matches the left-hand part of +# the path. The tag can be used to show relative paths in the file list. +# If left blank the directory from which doxygen is run is used as the +# path to strip. + +STRIP_FROM_PATH = . + +# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of +# the path mentioned in the documentation of a class, which tells +# the reader which header file to include in order to use a class. +# If left blank only the name of the header file containing the class +# definition is used. Otherwise one should specify the include paths that +# are normally passed to the compiler using the -I flag. + +STRIP_FROM_INC_PATH = + +# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter +# (but less readable) file names. This can be useful is your file systems +# doesn't support long names like on DOS, Mac, or CD-ROM. + +SHORT_NAMES = NO + +# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen +# will interpret the first line (until the first dot) of a JavaDoc-style +# comment as the brief description. If set to NO, the JavaDoc +# comments will behave just like regular Qt-style comments +# (thus requiring an explicit @brief command for a brief description.) + +JAVADOC_AUTOBRIEF = YES + +# If the QT_AUTOBRIEF tag is set to YES then Doxygen will +# interpret the first line (until the first dot) of a Qt-style +# comment as the brief description. If set to NO, the comments +# will behave just like regular Qt-style comments (thus requiring +# an explicit \brief command for a brief description.) + +QT_AUTOBRIEF = NO + +# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen +# treat a multi-line C++ special comment block (i.e. a block of //! or /// +# comments) as a brief description. This used to be the default behaviour. +# The new default is to treat a multi-line C++ comment block as a detailed +# description. Set this tag to YES if you prefer the old behaviour instead. + +MULTILINE_CPP_IS_BRIEF = NO + +# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented +# member inherits the documentation from any documented member that it +# re-implements. + +INHERIT_DOCS = YES + +# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce +# a new page for each member. If set to NO, the documentation of a member will +# be part of the file/class/namespace that contains it. + +SEPARATE_MEMBER_PAGES = NO + +# The TAB_SIZE tag can be used to set the number of spaces in a tab. +# Doxygen uses this value to replace tabs by spaces in code fragments. + +TAB_SIZE = 8 + +# This tag can be used to specify a number of aliases that acts +# as commands in the documentation. An alias has the form "name=value". +# For example adding "sideeffect=\par Side Effects:\n" will allow you to +# put the command \sideeffect (or @sideeffect) in the documentation, which +# will result in a user-defined paragraph with heading "Side Effects:". +# You can put \n's in the value part of an alias to insert newlines. + +ALIASES = + +# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C +# sources only. Doxygen will then generate output that is more tailored for C. +# For instance, some of the names that are used will be different. The list +# of all members will be omitted, etc. + +OPTIMIZE_OUTPUT_FOR_C = YES + +# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java +# sources only. Doxygen will then generate output that is more tailored for +# Java. For instance, namespaces will be presented as packages, qualified +# scopes will look different, etc. + +OPTIMIZE_OUTPUT_JAVA = NO + +# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran +# sources only. Doxygen will then generate output that is more tailored for +# Fortran. + +OPTIMIZE_FOR_FORTRAN = NO + +# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL +# sources. Doxygen will then generate output that is tailored for +# VHDL. + +OPTIMIZE_OUTPUT_VHDL = NO + +# Doxygen selects the parser to use depending on the extension of the files it +# parses. With this tag you can assign which parser to use for a given extension. +# Doxygen has a built-in mapping, but you can override or extend it using this +# tag. The format is ext=language, where ext is a file extension, and language +# is one of the parsers supported by doxygen: IDL, Java, Javascript, CSharp, C, +# C++, D, PHP, Objective-C, Python, Fortran, VHDL, C, C++. For instance to make +# doxygen treat .inc files as Fortran files (default is PHP), and .f files as C +# (default is Fortran), use: inc=Fortran f=C. Note that for custom extensions +# you also need to set FILE_PATTERNS otherwise the files are not read by doxygen. + +EXTENSION_MAPPING = + +# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want +# to include (a tag file for) the STL sources as input, then you should +# set this tag to YES in order to let doxygen match functions declarations and +# definitions whose arguments contain STL classes (e.g. func(std::string); v.s. +# func(std::string) {}). This also make the inheritance and collaboration +# diagrams that involve STL classes more complete and accurate. + +BUILTIN_STL_SUPPORT = NO + +# If you use Microsoft's C++/CLI language, you should set this option to YES to +# enable parsing support. + +CPP_CLI_SUPPORT = NO + +# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only. +# Doxygen will parse them like normal C++ but will assume all classes use public +# instead of private inheritance when no explicit protection keyword is present. + +SIP_SUPPORT = NO + +# For Microsoft's IDL there are propget and propput attributes to indicate getter +# and setter methods for a property. Setting this option to YES (the default) +# will make doxygen to replace the get and set methods by a property in the +# documentation. This will only work if the methods are indeed getting or +# setting a simple type. If this is not the case, or you want to show the +# methods anyway, you should set this option to NO. + +IDL_PROPERTY_SUPPORT = YES + +# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC +# tag is set to YES, then doxygen will reuse the documentation of the first +# member in the group (if any) for the other members of the group. By default +# all members of a group must be documented explicitly. + +DISTRIBUTE_GROUP_DOC = NO + +# Set the SUBGROUPING tag to YES (the default) to allow class member groups of +# the same type (for instance a group of public functions) to be put as a +# subgroup of that type (e.g. under the Public Functions section). Set it to +# NO to prevent subgrouping. Alternatively, this can be done per class using +# the \nosubgrouping command. + +SUBGROUPING = YES + +# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum +# is documented as struct, union, or enum with the name of the typedef. So +# typedef struct TypeS {} TypeT, will appear in the documentation as a struct +# with name TypeT. When disabled the typedef will appear as a member of a file, +# namespace, or class. And the struct will be named TypeS. This can typically +# be useful for C code in case the coding convention dictates that all compound +# types are typedef'ed and only the typedef is referenced, never the tag name. + +TYPEDEF_HIDES_STRUCT = NO + +# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to +# determine which symbols to keep in memory and which to flush to disk. +# When the cache is full, less often used symbols will be written to disk. +# For small to medium size projects (<1000 input files) the default value is +# probably good enough. For larger projects a too small cache size can cause +# doxygen to be busy swapping symbols to and from disk most of the time +# causing a significant performance penality. +# If the system has enough physical memory increasing the cache will improve the +# performance by keeping more symbols in memory. Note that the value works on +# a logarithmic scale so increasing the size by one will roughly double the +# memory usage. The cache size is given by this formula: +# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0, +# corresponding to a cache size of 2^16 = 65536 symbols + +SYMBOL_CACHE_SIZE = 0 + +#--------------------------------------------------------------------------- +# Build related configuration options +#--------------------------------------------------------------------------- + +# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in +# documentation are documented, even if no documentation was available. +# Private class members and static file members will be hidden unless +# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES + +EXTRACT_ALL = YES + +# If the EXTRACT_PRIVATE tag is set to YES all private members of a class +# will be included in the documentation. + +EXTRACT_PRIVATE = YES + +# If the EXTRACT_STATIC tag is set to YES all static members of a file +# will be included in the documentation. + +EXTRACT_STATIC = YES + +# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) +# defined locally in source files will be included in the documentation. +# If set to NO only classes defined in header files are included. + +EXTRACT_LOCAL_CLASSES = YES + +# This flag is only useful for Objective-C code. When set to YES local +# methods, which are defined in the implementation section but not in +# the interface are included in the documentation. +# If set to NO (the default) only methods in the interface are included. + +EXTRACT_LOCAL_METHODS = NO + +# If this flag is set to YES, the members of anonymous namespaces will be +# extracted and appear in the documentation as a namespace called +# 'anonymous_namespace{file}', where file will be replaced with the base +# name of the file that contains the anonymous namespace. By default +# anonymous namespace are hidden. + +EXTRACT_ANON_NSPACES = NO + +# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all +# undocumented members of documented classes, files or namespaces. +# If set to NO (the default) these members will be included in the +# various overviews, but no documentation section is generated. +# This option has no effect if EXTRACT_ALL is enabled. + +HIDE_UNDOC_MEMBERS = NO + +# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all +# undocumented classes that are normally visible in the class hierarchy. +# If set to NO (the default) these classes will be included in the various +# overviews. This option has no effect if EXTRACT_ALL is enabled. + +HIDE_UNDOC_CLASSES = NO + +# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all +# friend (class|struct|union) declarations. +# If set to NO (the default) these declarations will be included in the +# documentation. + +HIDE_FRIEND_COMPOUNDS = NO + +# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any +# documentation blocks found inside the body of a function. +# If set to NO (the default) these blocks will be appended to the +# function's detailed documentation block. + +HIDE_IN_BODY_DOCS = NO + +# The INTERNAL_DOCS tag determines if documentation +# that is typed after a \internal command is included. If the tag is set +# to NO (the default) then the documentation will be excluded. +# Set it to YES to include the internal documentation. + +INTERNAL_DOCS = NO + +# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate +# file names in lower-case letters. If set to YES upper-case letters are also +# allowed. This is useful if you have classes or files whose names only differ +# in case and if your file system supports case sensitive file names. Windows +# and Mac users are advised to set this option to NO. + +CASE_SENSE_NAMES = YES + +# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen +# will show members with their full class and namespace scopes in the +# documentation. If set to YES the scope will be hidden. + +HIDE_SCOPE_NAMES = NO + +# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen +# will put a list of the files that are included by a file in the documentation +# of that file. + +SHOW_INCLUDE_FILES = YES + +# If the FORCE_LOCAL_INCLUDES tag is set to YES then Doxygen +# will list include files with double quotes in the documentation +# rather than with sharp brackets. + +FORCE_LOCAL_INCLUDES = NO + +# If the INLINE_INFO tag is set to YES (the default) then a tag [inline] +# is inserted in the documentation for inline members. + +INLINE_INFO = YES + +# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen +# will sort the (detailed) documentation of file and class members +# alphabetically by member name. If set to NO the members will appear in +# declaration order. + +SORT_MEMBER_DOCS = YES + +# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the +# brief documentation of file, namespace and class members alphabetically +# by member name. If set to NO (the default) the members will appear in +# declaration order. + +SORT_BRIEF_DOCS = NO + +# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen +# will sort the (brief and detailed) documentation of class members so that +# constructors and destructors are listed first. If set to NO (the default) +# the constructors will appear in the respective orders defined by +# SORT_MEMBER_DOCS and SORT_BRIEF_DOCS. +# This tag will be ignored for brief docs if SORT_BRIEF_DOCS is set to NO +# and ignored for detailed docs if SORT_MEMBER_DOCS is set to NO. + +SORT_MEMBERS_CTORS_1ST = NO + +# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the +# hierarchy of group names into alphabetical order. If set to NO (the default) +# the group names will appear in their defined order. + +SORT_GROUP_NAMES = NO + +# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be +# sorted by fully-qualified names, including namespaces. If set to +# NO (the default), the class list will be sorted only by class name, +# not including the namespace part. +# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. +# Note: This option applies only to the class list, not to the +# alphabetical list. + +SORT_BY_SCOPE_NAME = NO + +# The GENERATE_TODOLIST tag can be used to enable (YES) or +# disable (NO) the todo list. This list is created by putting \todo +# commands in the documentation. + +GENERATE_TODOLIST = YES + +# The GENERATE_TESTLIST tag can be used to enable (YES) or +# disable (NO) the test list. This list is created by putting \test +# commands in the documentation. + +GENERATE_TESTLIST = YES + +# The GENERATE_BUGLIST tag can be used to enable (YES) or +# disable (NO) the bug list. This list is created by putting \bug +# commands in the documentation. + +GENERATE_BUGLIST = YES + +# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or +# disable (NO) the deprecated list. This list is created by putting +# \deprecated commands in the documentation. + +GENERATE_DEPRECATEDLIST= YES + +# The ENABLED_SECTIONS tag can be used to enable conditional +# documentation sections, marked by \if sectionname ... \endif. + +ENABLED_SECTIONS = + +# The MAX_INITIALIZER_LINES tag determines the maximum number of lines +# the initial value of a variable or define consists of for it to appear in +# the documentation. If the initializer consists of more lines than specified +# here it will be hidden. Use a value of 0 to hide initializers completely. +# The appearance of the initializer of individual variables and defines in the +# documentation can be controlled using \showinitializer or \hideinitializer +# command in the documentation regardless of this setting. + +MAX_INITIALIZER_LINES = 30 + +# Set the SHOW_USED_FILES tag to NO to disable the list of files generated +# at the bottom of the documentation of classes and structs. If set to YES the +# list will mention the files that were used to generate the documentation. + +SHOW_USED_FILES = YES + +# Set the SHOW_FILES tag to NO to disable the generation of the Files page. +# This will remove the Files entry from the Quick Index and from the +# Folder Tree View (if specified). The default is YES. + +SHOW_FILES = YES + +# Set the SHOW_NAMESPACES tag to NO to disable the generation of the +# Namespaces page. +# This will remove the Namespaces entry from the Quick Index +# and from the Folder Tree View (if specified). The default is YES. + +SHOW_NAMESPACES = YES + +# The FILE_VERSION_FILTER tag can be used to specify a program or script that +# doxygen should invoke to get the current version for each file (typically from +# the version control system). Doxygen will invoke the program by executing (via +# popen()) the command , where is the value of +# the FILE_VERSION_FILTER tag, and is the name of an input file +# provided by doxygen. Whatever the program writes to standard output +# is used as the file version. See the manual for examples. + +FILE_VERSION_FILTER = + +# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed +# by doxygen. The layout file controls the global structure of the generated +# output files in an output format independent way. The create the layout file +# that represents doxygen's defaults, run doxygen with the -l option. +# You can optionally specify a file name after the option, if omitted +# DoxygenLayout.xml will be used as the name of the layout file. + +LAYOUT_FILE = + +#--------------------------------------------------------------------------- +# configuration options related to warning and progress messages +#--------------------------------------------------------------------------- + +# The QUIET tag can be used to turn on/off the messages that are generated +# by doxygen. Possible values are YES and NO. If left blank NO is used. + +QUIET = YES + +# The WARNINGS tag can be used to turn on/off the warning messages that are +# generated by doxygen. Possible values are YES and NO. If left blank +# NO is used. + +WARNINGS = YES + +# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings +# for undocumented members. If EXTRACT_ALL is set to YES then this flag will +# automatically be disabled. + +WARN_IF_UNDOCUMENTED = YES + +# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for +# potential errors in the documentation, such as not documenting some +# parameters in a documented function, or documenting parameters that +# don't exist or using markup commands wrongly. + +WARN_IF_DOC_ERROR = YES + +# This WARN_NO_PARAMDOC option can be abled to get warnings for +# functions that are documented, but have no documentation for their parameters +# or return value. If set to NO (the default) doxygen will only warn about +# wrong or incomplete parameter documentation, but not about the absence of +# documentation. + +WARN_NO_PARAMDOC = NO + +# The WARN_FORMAT tag determines the format of the warning messages that +# doxygen can produce. The string should contain the $file, $line, and $text +# tags, which will be replaced by the file and line number from which the +# warning originated and the warning text. Optionally the format may contain +# $version, which will be replaced by the version of the file (if it could +# be obtained via FILE_VERSION_FILTER) + +WARN_FORMAT = "$file:$line: $text" + +# The WARN_LOGFILE tag can be used to specify a file to which warning +# and error messages should be written. If left blank the output is written +# to stderr. + +WARN_LOGFILE = + +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- + +# The INPUT tag can be used to specify the files and/or directories that contain +# documented source files. You may enter file names like "myfile.cpp" or +# directories like "/usr/src/myproject". Separate the files or directories +# with spaces. + +INPUT = + +# This tag can be used to specify the character encoding of the source files +# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is +# also the default input encoding. Doxygen uses libiconv (or the iconv built +# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for +# the list of possible encodings. + +INPUT_ENCODING = UTF-8 + +# If the value of the INPUT tag contains directories, you can use the +# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp +# and *.h) to filter out the source-files in the directories. If left +# blank the following patterns are tested: +# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx +# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py *.f90 + +FILE_PATTERNS = + +# The RECURSIVE tag can be used to turn specify whether or not subdirectories +# should be searched for input files as well. Possible values are YES and NO. +# If left blank NO is used. + +RECURSIVE = YES + +# The EXCLUDE tag can be used to specify files and/or directories that should +# excluded from the INPUT source files. This way you can easily exclude a +# subdirectory from a directory tree whose root is specified with the INPUT tag. + +EXCLUDE = + +# The EXCLUDE_SYMLINKS tag can be used select whether or not files or +# directories that are symbolic links (a Unix filesystem feature) are excluded +# from the input. + +EXCLUDE_SYMLINKS = NO + +# If the value of the INPUT tag contains directories, you can use the +# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude +# certain files from those directories. Note that the wildcards are matched +# against the file with absolute path, so to exclude all test directories +# for example use the pattern */test/* + +EXCLUDE_PATTERNS = *.git \ + *.d + +# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names +# (namespaces, classes, functions, etc.) that should be excluded from the +# output. The symbol name can be a fully qualified name, a word, or if the +# wildcard * is used, a substring. Examples: ANamespace, AClass, +# AClass::ANamespace, ANamespace::*Test + +EXCLUDE_SYMBOLS = + +# The EXAMPLE_PATH tag can be used to specify one or more files or +# directories that contain example code fragments that are included (see +# the \include command). + +EXAMPLE_PATH = doc/examples/ + +# If the value of the EXAMPLE_PATH tag contains directories, you can use the +# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp +# and *.h) to filter out the source-files in the directories. If left +# blank all files are included. + +EXAMPLE_PATTERNS = *.c + +# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be +# searched for input files to be used with the \include or \dontinclude +# commands irrespective of the value of the RECURSIVE tag. +# Possible values are YES and NO. If left blank NO is used. + +EXAMPLE_RECURSIVE = NO + +# The IMAGE_PATH tag can be used to specify one or more files or +# directories that contain image that are included in the documentation (see +# the \image command). + +IMAGE_PATH = + +# The INPUT_FILTER tag can be used to specify a program that doxygen should +# invoke to filter for each input file. Doxygen will invoke the filter program +# by executing (via popen()) the command , where +# is the value of the INPUT_FILTER tag, and is the name of an +# input file. Doxygen will then use the output that the filter program writes +# to standard output. +# If FILTER_PATTERNS is specified, this tag will be +# ignored. + +INPUT_FILTER = + +# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern +# basis. +# Doxygen will compare the file name with each pattern and apply the +# filter if there is a match. +# The filters are a list of the form: +# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further +# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER +# is applied to all files. + +FILTER_PATTERNS = + +# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using +# INPUT_FILTER) will be used to filter the input files when producing source +# files to browse (i.e. when SOURCE_BROWSER is set to YES). + +FILTER_SOURCE_FILES = NO + +#--------------------------------------------------------------------------- +# configuration options related to source browsing +#--------------------------------------------------------------------------- + +# If the SOURCE_BROWSER tag is set to YES then a list of source files will +# be generated. Documented entities will be cross-referenced with these sources. +# Note: To get rid of all source code in the generated output, make sure also +# VERBATIM_HEADERS is set to NO. + +SOURCE_BROWSER = YES + +# Setting the INLINE_SOURCES tag to YES will include the body +# of functions and classes directly in the documentation. + +INLINE_SOURCES = NO + +# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct +# doxygen to hide any special comment blocks from generated source code +# fragments. Normal C and C++ comments will always remain visible. + +STRIP_CODE_COMMENTS = YES + +# If the REFERENCED_BY_RELATION tag is set to YES +# then for each documented function all documented +# functions referencing it will be listed. + +REFERENCED_BY_RELATION = YES + +# If the REFERENCES_RELATION tag is set to YES +# then for each documented function all documented entities +# called/used by that function will be listed. + +REFERENCES_RELATION = NO + +# If the REFERENCES_LINK_SOURCE tag is set to YES (the default) +# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from +# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will +# link to the source code. +# Otherwise they will link to the documentation. + +REFERENCES_LINK_SOURCE = YES + +# If the USE_HTAGS tag is set to YES then the references to source code +# will point to the HTML generated by the htags(1) tool instead of doxygen +# built-in source browser. The htags tool is part of GNU's global source +# tagging system (see http://www.gnu.org/software/global/global.html). You +# will need version 4.8.6 or higher. + +USE_HTAGS = NO + +# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen +# will generate a verbatim copy of the header file for each class for +# which an include is specified. Set to NO to disable this. + +VERBATIM_HEADERS = YES + +#--------------------------------------------------------------------------- +# configuration options related to the alphabetical class index +#--------------------------------------------------------------------------- + +# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index +# of all compounds will be generated. Enable this if the project +# contains a lot of classes, structs, unions or interfaces. + +ALPHABETICAL_INDEX = YES + +# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then +# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns +# in which this list will be split (can be a number in the range [1..20]) + +COLS_IN_ALPHA_INDEX = 2 + +# In case all classes in a project start with a common prefix, all +# classes will be put under the same header in the alphabetical index. +# The IGNORE_PREFIX tag can be used to specify one or more prefixes that +# should be ignored while generating the index headers. + +IGNORE_PREFIX = + +#--------------------------------------------------------------------------- +# configuration options related to the HTML output +#--------------------------------------------------------------------------- + +# If the GENERATE_HTML tag is set to YES (the default) Doxygen will +# generate HTML output. + +GENERATE_HTML = YES + +# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `html' will be used as the default path. + +HTML_OUTPUT = html + +# The HTML_FILE_EXTENSION tag can be used to specify the file extension for +# each generated HTML page (for example: .htm,.php,.asp). If it is left blank +# doxygen will generate files with .html extension. + +HTML_FILE_EXTENSION = .html + +# The HTML_HEADER tag can be used to specify a personal HTML header for +# each generated HTML page. If it is left blank doxygen will generate a +# standard header. + +#HTML_HEADER = doc/doxy/header.html + +# The HTML_FOOTER tag can be used to specify a personal HTML footer for +# each generated HTML page. If it is left blank doxygen will generate a +# standard footer. + +#HTML_FOOTER = doc/doxy/footer.html + +# The HTML_STYLESHEET tag can be used to specify a user-defined cascading +# style sheet that is used by each HTML page. It can be used to +# fine-tune the look of the HTML output. If the tag is left blank doxygen +# will generate a default style sheet. Note that doxygen will try to copy +# the style sheet file to the HTML output directory, so don't put your own +# stylesheet in the HTML output directory as well, or it will be erased! + +#HTML_STYLESHEET = doc/doxy/doxy_stylesheet.css + +# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. +# Doxygen will adjust the colors in the stylesheet and background images +# according to this color. Hue is specified as an angle on a colorwheel, +# see http://en.wikipedia.org/wiki/Hue for more information. +# For instance the value 0 represents red, 60 is yellow, 120 is green, +# 180 is cyan, 240 is blue, 300 purple, and 360 is red again. +# The allowed range is 0 to 359. + +#HTML_COLORSTYLE_HUE = 120 + +# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of +# the colors in the HTML output. For a value of 0 the output will use +# grayscales only. A value of 255 will produce the most vivid colors. + +HTML_COLORSTYLE_SAT = 100 + +# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to +# the luminance component of the colors in the HTML output. Values below +# 100 gradually make the output lighter, whereas values above 100 make +# the output darker. The value divided by 100 is the actual gamma applied, +# so 80 represents a gamma of 0.8, The value 220 represents a gamma of 2.2, +# and 100 does not change the gamma. + +HTML_COLORSTYLE_GAMMA = 80 + +# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML +# page will contain the date and time when the page was generated. Setting +# this to NO can help when comparing the output of multiple runs. + +HTML_TIMESTAMP = YES + +# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML +# documentation will contain sections that can be hidden and shown after the +# page has loaded. For this to work a browser that supports +# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox +# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari). + +HTML_DYNAMIC_SECTIONS = NO + +# If the GENERATE_DOCSET tag is set to YES, additional index files +# will be generated that can be used as input for Apple's Xcode 3 +# integrated development environment, introduced with OS X 10.5 (Leopard). +# To create a documentation set, doxygen will generate a Makefile in the +# HTML output directory. Running make will produce the docset in that +# directory and running "make install" will install the docset in +# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find +# it at startup. +# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html +# for more information. + +GENERATE_DOCSET = NO + +# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the +# feed. A documentation feed provides an umbrella under which multiple +# documentation sets from a single provider (such as a company or product suite) +# can be grouped. + +DOCSET_FEEDNAME = "Doxygen generated docs" + +# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that +# should uniquely identify the documentation set bundle. This should be a +# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen +# will append .docset to the name. + +DOCSET_BUNDLE_ID = org.doxygen.Project + +# When GENERATE_PUBLISHER_ID tag specifies a string that should uniquely identify +# the documentation publisher. This should be a reverse domain-name style +# string, e.g. com.mycompany.MyDocSet.documentation. + +DOCSET_PUBLISHER_ID = org.doxygen.Publisher + +# The GENERATE_PUBLISHER_NAME tag identifies the documentation publisher. + +DOCSET_PUBLISHER_NAME = Publisher + +# If the GENERATE_HTMLHELP tag is set to YES, additional index files +# will be generated that can be used as input for tools like the +# Microsoft HTML help workshop to generate a compiled HTML help file (.chm) +# of the generated HTML documentation. + +GENERATE_HTMLHELP = NO + +# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can +# be used to specify the file name of the resulting .chm file. You +# can add a path in front of the file if the result should not be +# written to the html output directory. + +CHM_FILE = + +# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can +# be used to specify the location (absolute path including file name) of +# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run +# the HTML help compiler on the generated index.hhp. + +HHC_LOCATION = + +# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag +# controls if a separate .chi index file is generated (YES) or that +# it should be included in the master .chm file (NO). + +GENERATE_CHI = NO + +# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING +# is used to encode HtmlHelp index (hhk), content (hhc) and project file +# content. + +CHM_INDEX_ENCODING = + +# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag +# controls whether a binary table of contents is generated (YES) or a +# normal table of contents (NO) in the .chm file. + +BINARY_TOC = NO + +# The TOC_EXPAND flag can be set to YES to add extra items for group members +# to the contents of the HTML help documentation and to the tree view. + +TOC_EXPAND = NO + +# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and +# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated +# that can be used as input for Qt's qhelpgenerator to generate a +# Qt Compressed Help (.qch) of the generated HTML documentation. + +GENERATE_QHP = NO + +# If the QHG_LOCATION tag is specified, the QCH_FILE tag can +# be used to specify the file name of the resulting .qch file. +# The path specified is relative to the HTML output folder. + +QCH_FILE = + +# The QHP_NAMESPACE tag specifies the namespace to use when generating +# Qt Help Project output. For more information please see +# http://doc.trolltech.com/qthelpproject.html#namespace + +QHP_NAMESPACE = org.doxygen.Project + +# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating +# Qt Help Project output. For more information please see +# http://doc.trolltech.com/qthelpproject.html#virtual-folders + +QHP_VIRTUAL_FOLDER = doc + +# If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to +# add. For more information please see +# http://doc.trolltech.com/qthelpproject.html#custom-filters + +QHP_CUST_FILTER_NAME = + +# The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the +# custom filter to add. For more information please see +# +# Qt Help Project / Custom Filters. + +QHP_CUST_FILTER_ATTRS = + +# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this +# project's +# filter section matches. +# +# Qt Help Project / Filter Attributes. + +QHP_SECT_FILTER_ATTRS = + +# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can +# be used to specify the location of Qt's qhelpgenerator. +# If non-empty doxygen will try to run qhelpgenerator on the generated +# .qhp file. + +QHG_LOCATION = + +# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files +# will be generated, which together with the HTML files, form an Eclipse help +# plugin. To install this plugin and make it available under the help contents +# menu in Eclipse, the contents of the directory containing the HTML and XML +# files needs to be copied into the plugins directory of eclipse. The name of +# the directory within the plugins directory should be the same as +# the ECLIPSE_DOC_ID value. After copying Eclipse needs to be restarted before +# the help appears. + +GENERATE_ECLIPSEHELP = NO + +# A unique identifier for the eclipse help plugin. When installing the plugin +# the directory name containing the HTML and XML files should also have +# this name. + +ECLIPSE_DOC_ID = org.doxygen.Project + +# The DISABLE_INDEX tag can be used to turn on/off the condensed index at +# top of each HTML page. The value NO (the default) enables the index and +# the value YES disables it. + +DISABLE_INDEX = NO + +# This tag can be used to set the number of enum values (range [1..20]) +# that doxygen will group on one line in the generated HTML documentation. + +ENUM_VALUES_PER_LINE = 4 + +# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index +# structure should be generated to display hierarchical information. +# If the tag value is set to YES, a side panel will be generated +# containing a tree-like index structure (just like the one that +# is generated for HTML Help). For this to work a browser that supports +# JavaScript, DHTML, CSS and frames is required (i.e. any modern browser). +# Windows users are probably better off using the HTML help feature. + +GENERATE_TREEVIEW = NO + +# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be +# used to set the initial width (in pixels) of the frame in which the tree +# is shown. + +TREEVIEW_WIDTH = 250 + +# When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open +# links to external symbols imported via tag files in a separate window. + +EXT_LINKS_IN_WINDOW = NO + +# Use this tag to change the font size of Latex formulas included +# as images in the HTML documentation. The default is 10. Note that +# when you change the font size after a successful doxygen run you need +# to manually remove any form_*.png images from the HTML output directory +# to force them to be regenerated. + +FORMULA_FONTSIZE = 10 + +# Use the FORMULA_TRANPARENT tag to determine whether or not the images +# generated for formulas are transparent PNGs. Transparent PNGs are +# not supported properly for IE 6.0, but are supported on all modern browsers. +# Note that when changing this option you need to delete any form_*.png files +# in the HTML output before the changes have effect. + +FORMULA_TRANSPARENT = YES + +# When the SEARCHENGINE tag is enabled doxygen will generate a search box +# for the HTML output. The underlying search engine uses javascript +# and DHTML and should work on any modern browser. Note that when using +# HTML help (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets +# (GENERATE_DOCSET) there is already a search function so this one should +# typically be disabled. For large projects the javascript based search engine +# can be slow, then enabling SERVER_BASED_SEARCH may provide a better solution. + +SEARCHENGINE = NO + +# When the SERVER_BASED_SEARCH tag is enabled the search engine will be +# implemented using a PHP enabled web server instead of at the web client +# using Javascript. Doxygen will generate the search PHP script and index +# file to put on the web server. The advantage of the server +# based approach is that it scales better to large projects and allows +# full text search. The disadvances is that it is more difficult to setup +# and does not have live searching capabilities. + +SERVER_BASED_SEARCH = NO + +#--------------------------------------------------------------------------- +# configuration options related to the LaTeX output +#--------------------------------------------------------------------------- + +# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will +# generate Latex output. + +GENERATE_LATEX = NO + +# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `latex' will be used as the default path. + +LATEX_OUTPUT = latex + +# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be +# invoked. If left blank `latex' will be used as the default command name. +# Note that when enabling USE_PDFLATEX this option is only used for +# generating bitmaps for formulas in the HTML output, but not in the +# Makefile that is written to the output directory. + +LATEX_CMD_NAME = latex + +# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to +# generate index for LaTeX. If left blank `makeindex' will be used as the +# default command name. + +MAKEINDEX_CMD_NAME = makeindex + +# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact +# LaTeX documents. This may be useful for small projects and may help to +# save some trees in general. + +COMPACT_LATEX = NO + +# The PAPER_TYPE tag can be used to set the paper type that is used +# by the printer. Possible values are: a4, a4wide, letter, legal and +# executive. If left blank a4wide will be used. + +PAPER_TYPE = a4wide + +# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX +# packages that should be included in the LaTeX output. + +EXTRA_PACKAGES = + +# The LATEX_HEADER tag can be used to specify a personal LaTeX header for +# the generated latex document. The header should contain everything until +# the first chapter. If it is left blank doxygen will generate a +# standard header. Notice: only use this tag if you know what you are doing! + +LATEX_HEADER = + +# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated +# is prepared for conversion to pdf (using ps2pdf). The pdf file will +# contain links (just like the HTML output) instead of page references +# This makes the output suitable for online browsing using a pdf viewer. + +PDF_HYPERLINKS = NO + +# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of +# plain latex in the generated Makefile. Set this option to YES to get a +# higher quality PDF documentation. + +USE_PDFLATEX = NO + +# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. +# command to the generated LaTeX files. This will instruct LaTeX to keep +# running if errors occur, instead of asking the user for help. +# This option is also used when generating formulas in HTML. + +LATEX_BATCHMODE = NO + +# If LATEX_HIDE_INDICES is set to YES then doxygen will not +# include the index chapters (such as File Index, Compound Index, etc.) +# in the output. + +LATEX_HIDE_INDICES = NO + +# If LATEX_SOURCE_CODE is set to YES then doxygen will include +# source code with syntax highlighting in the LaTeX output. +# Note that which sources are shown also depends on other settings +# such as SOURCE_BROWSER. + +LATEX_SOURCE_CODE = NO + +#--------------------------------------------------------------------------- +# configuration options related to the RTF output +#--------------------------------------------------------------------------- + +# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output +# The RTF output is optimized for Word 97 and may not look very pretty with +# other RTF readers or editors. + +GENERATE_RTF = NO + +# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `rtf' will be used as the default path. + +RTF_OUTPUT = rtf + +# If the COMPACT_RTF tag is set to YES Doxygen generates more compact +# RTF documents. This may be useful for small projects and may help to +# save some trees in general. + +COMPACT_RTF = NO + +# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated +# will contain hyperlink fields. The RTF file will +# contain links (just like the HTML output) instead of page references. +# This makes the output suitable for online browsing using WORD or other +# programs which support those fields. +# Note: wordpad (write) and others do not support links. + +RTF_HYPERLINKS = NO + +# Load stylesheet definitions from file. Syntax is similar to doxygen's +# config file, i.e. a series of assignments. You only have to provide +# replacements, missing definitions are set to their default value. + +RTF_STYLESHEET_FILE = + +# Set optional variables used in the generation of an rtf document. +# Syntax is similar to doxygen's config file. + +RTF_EXTENSIONS_FILE = + +#--------------------------------------------------------------------------- +# configuration options related to the man page output +#--------------------------------------------------------------------------- + +# If the GENERATE_MAN tag is set to YES (the default) Doxygen will +# generate man pages + +GENERATE_MAN = NO + +# The MAN_OUTPUT tag is used to specify where the man pages will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `man' will be used as the default path. + +MAN_OUTPUT = man + +# The MAN_EXTENSION tag determines the extension that is added to +# the generated man pages (default is the subroutine's section .3) + +MAN_EXTENSION = .3 + +# If the MAN_LINKS tag is set to YES and Doxygen generates man output, +# then it will generate one additional man file for each entity +# documented in the real man page(s). These additional files +# only source the real man page, but without them the man command +# would be unable to find the correct page. The default is NO. + +MAN_LINKS = NO + +#--------------------------------------------------------------------------- +# configuration options related to the XML output +#--------------------------------------------------------------------------- + +# If the GENERATE_XML tag is set to YES Doxygen will +# generate an XML file that captures the structure of +# the code including all documentation. + +GENERATE_XML = NO + +# The XML_OUTPUT tag is used to specify where the XML pages will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `xml' will be used as the default path. + +XML_OUTPUT = xml + +# The XML_SCHEMA tag can be used to specify an XML schema, +# which can be used by a validating XML parser to check the +# syntax of the XML files. + +XML_SCHEMA = + +# The XML_DTD tag can be used to specify an XML DTD, +# which can be used by a validating XML parser to check the +# syntax of the XML files. + +XML_DTD = + +# If the XML_PROGRAMLISTING tag is set to YES Doxygen will +# dump the program listings (including syntax highlighting +# and cross-referencing information) to the XML output. Note that +# enabling this will significantly increase the size of the XML output. + +XML_PROGRAMLISTING = YES + +#--------------------------------------------------------------------------- +# configuration options for the AutoGen Definitions output +#--------------------------------------------------------------------------- + +# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will +# generate an AutoGen Definitions (see autogen.sf.net) file +# that captures the structure of the code including all +# documentation. Note that this feature is still experimental +# and incomplete at the moment. + +GENERATE_AUTOGEN_DEF = NO + +#--------------------------------------------------------------------------- +# configuration options related to the Perl module output +#--------------------------------------------------------------------------- + +# If the GENERATE_PERLMOD tag is set to YES Doxygen will +# generate a Perl module file that captures the structure of +# the code including all documentation. Note that this +# feature is still experimental and incomplete at the +# moment. + +GENERATE_PERLMOD = NO + +# If the PERLMOD_LATEX tag is set to YES Doxygen will generate +# the necessary Makefile rules, Perl scripts and LaTeX code to be able +# to generate PDF and DVI output from the Perl module output. + +PERLMOD_LATEX = NO + +# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be +# nicely formatted so it can be parsed by a human reader. +# This is useful +# if you want to understand what is going on. +# On the other hand, if this +# tag is set to NO the size of the Perl module output will be much smaller +# and Perl will parse it just the same. + +PERLMOD_PRETTY = YES + +# The names of the make variables in the generated doxyrules.make file +# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. +# This is useful so different doxyrules.make files included by the same +# Makefile don't overwrite each other's variables. + +PERLMOD_MAKEVAR_PREFIX = + +#--------------------------------------------------------------------------- +# Configuration options related to the preprocessor +#--------------------------------------------------------------------------- + +# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will +# evaluate all C-preprocessor directives found in the sources and include +# files. + +ENABLE_PREPROCESSING = YES + +# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro +# names in the source code. If set to NO (the default) only conditional +# compilation will be performed. Macro expansion can be done in a controlled +# way by setting EXPAND_ONLY_PREDEF to YES. + +MACRO_EXPANSION = YES + +# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES +# then the macro expansion is limited to the macros specified with the +# PREDEFINED and EXPAND_AS_DEFINED tags. + +EXPAND_ONLY_PREDEF = YES + +# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files +# in the INCLUDE_PATH (see below) will be search if a #include is found. + +SEARCH_INCLUDES = YES + +# The INCLUDE_PATH tag can be used to specify one or more directories that +# contain include files that are not input files but should be processed by +# the preprocessor. + +INCLUDE_PATH = + +# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard +# patterns (like *.h and *.hpp) to filter out the header-files in the +# directories. If left blank, the patterns specified with FILE_PATTERNS will +# be used. + +INCLUDE_FILE_PATTERNS = + +# The PREDEFINED tag can be used to specify one or more macro names that +# are defined before the preprocessor is started (similar to the -D option of +# gcc). The argument of the tag is a list of macros of the form: name +# or name=definition (no spaces). If the definition and the = are +# omitted =1 is assumed. To prevent a macro definition from being +# undefined via #undef or recursively expanded use the := operator +# instead of the = operator. + +PREDEFINED = "__attribute__(x)=" \ + "DECLARE_ALIGNED(a,t,n)=t n" \ + "offsetof(x,y)=0x42" \ + av_alloc_size \ + +# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then +# this tag can be used to specify a list of macro names that should be expanded. +# The macro definition that is found in the sources will be used. +# Use the PREDEFINED tag if you want to use a different macro definition. + +EXPAND_AS_DEFINED = declare_idct \ + READ_PAR_DATA \ + +# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then +# doxygen's preprocessor will remove all function-like macros that are alone +# on a line, have an all uppercase name, and do not end with a semicolon. Such +# function macros are typically used for boiler-plate code, and will confuse +# the parser if not removed. + +SKIP_FUNCTION_MACROS = YES + +#--------------------------------------------------------------------------- +# Configuration::additions related to external references +#--------------------------------------------------------------------------- + +# The TAGFILES option can be used to specify one or more tagfiles. +# Optionally an initial location of the external documentation +# can be added for each tagfile. The format of a tag file without +# this location is as follows: +# +# TAGFILES = file1 file2 ... +# Adding location for the tag files is done as follows: +# +# TAGFILES = file1=loc1 "file2 = loc2" ... +# where "loc1" and "loc2" can be relative or absolute paths or +# URLs. If a location is present for each tag, the installdox tool +# does not have to be run to correct the links. +# Note that each tag file must have a unique name +# (where the name does NOT include the path) +# If a tag file is not located in the directory in which doxygen +# is run, you must also specify the path to the tagfile here. + +TAGFILES = + +# When a file name is specified after GENERATE_TAGFILE, doxygen will create +# a tag file that is based on the input files it reads. + +GENERATE_TAGFILE = + +# If the ALLEXTERNALS tag is set to YES all external classes will be listed +# in the class index. If set to NO only the inherited external classes +# will be listed. + +ALLEXTERNALS = NO + +# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed +# in the modules index. If set to NO, only the current project's groups will +# be listed. + +EXTERNAL_GROUPS = YES + +# The PERL_PATH should be the absolute path and name of the perl script +# interpreter (i.e. the result of `which perl'). + +PERL_PATH = /usr/bin/perl + +#--------------------------------------------------------------------------- +# Configuration options related to the dot tool +#--------------------------------------------------------------------------- + +# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will +# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base +# or super classes. Setting the tag to NO turns the diagrams off. Note that +# this option is superseded by the HAVE_DOT option below. This is only a +# fallback. It is recommended to install and use dot, since it yields more +# powerful graphs. + +CLASS_DIAGRAMS = YES + +# You can define message sequence charts within doxygen comments using the \msc +# command. Doxygen will then run the mscgen tool (see +# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the +# documentation. The MSCGEN_PATH tag allows you to specify the directory where +# the mscgen tool resides. If left empty the tool is assumed to be found in the +# default search path. + +MSCGEN_PATH = + +# If set to YES, the inheritance and collaboration graphs will hide +# inheritance and usage relations if the target is undocumented +# or is not a class. + +HIDE_UNDOC_RELATIONS = YES + +# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is +# available from the path. This tool is part of Graphviz, a graph visualization +# toolkit from AT&T and Lucent Bell Labs. The other options in this section +# have no effect if this option is set to NO (the default) + +HAVE_DOT = NO + +# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is +# allowed to run in parallel. When set to 0 (the default) doxygen will +# base this on the number of processors available in the system. You can set it +# explicitly to a value larger than 0 to get control over the balance +# between CPU load and processing speed. + +DOT_NUM_THREADS = 0 + +# By default doxygen will write a font called FreeSans.ttf to the output +# directory and reference it in all dot files that doxygen generates. This +# font does not include all possible unicode characters however, so when you need +# these (or just want a differently looking font) you can specify the font name +# using DOT_FONTNAME. You need need to make sure dot is able to find the font, +# which can be done by putting it in a standard location or by setting the +# DOTFONTPATH environment variable or by setting DOT_FONTPATH to the directory +# containing the font. + +DOT_FONTNAME = FreeSans + +# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs. +# The default size is 10pt. + +DOT_FONTSIZE = 10 + +# By default doxygen will tell dot to use the output directory to look for the +# FreeSans.ttf font (which doxygen will put there itself). If you specify a +# different font using DOT_FONTNAME you can set the path where dot +# can find it using this tag. + +DOT_FONTPATH = + +# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for each documented class showing the direct and +# indirect inheritance relations. Setting this tag to YES will force the +# the CLASS_DIAGRAMS tag to NO. + +CLASS_GRAPH = YES + +# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for each documented class showing the direct and +# indirect implementation dependencies (inheritance, containment, and +# class references variables) of the class with other documented classes. + +COLLABORATION_GRAPH = YES + +# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for groups, showing the direct groups dependencies + +GROUP_GRAPHS = YES + +# If the UML_LOOK tag is set to YES doxygen will generate inheritance and +# collaboration diagrams in a style similar to the OMG's Unified Modeling +# Language. + +UML_LOOK = NO + +# If set to YES, the inheritance and collaboration graphs will show the +# relations between templates and their instances. + +TEMPLATE_RELATIONS = YES + +# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT +# tags are set to YES then doxygen will generate a graph for each documented +# file showing the direct and indirect include dependencies of the file with +# other documented files. + +INCLUDE_GRAPH = YES + +# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and +# HAVE_DOT tags are set to YES then doxygen will generate a graph for each +# documented header file showing the documented files that directly or +# indirectly include this file. + +INCLUDED_BY_GRAPH = YES + +# If the CALL_GRAPH and HAVE_DOT options are set to YES then +# doxygen will generate a call dependency graph for every global function +# or class method. Note that enabling this option will significantly increase +# the time of a run. So in most cases it will be better to enable call graphs +# for selected functions only using the \callgraph command. + +CALL_GRAPH = NO + +# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then +# doxygen will generate a caller dependency graph for every global function +# or class method. Note that enabling this option will significantly increase +# the time of a run. So in most cases it will be better to enable caller +# graphs for selected functions only using the \callergraph command. + +CALLER_GRAPH = NO + +# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen +# will graphical hierarchy of all classes instead of a textual one. + +GRAPHICAL_HIERARCHY = YES + +# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES +# then doxygen will show the dependencies a directory has on other directories +# in a graphical way. The dependency relations are determined by the #include +# relations between the files in the directories. + +DIRECTORY_GRAPH = YES + +# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images +# generated by dot. Possible values are png, jpg, or gif +# If left blank png will be used. + +DOT_IMAGE_FORMAT = png + +# The tag DOT_PATH can be used to specify the path where the dot tool can be +# found. If left blank, it is assumed the dot tool can be found in the path. + +DOT_PATH = + +# The DOTFILE_DIRS tag can be used to specify one or more directories that +# contain dot files that are included in the documentation (see the +# \dotfile command). + +DOTFILE_DIRS = + +# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of +# nodes that will be shown in the graph. If the number of nodes in a graph +# becomes larger than this value, doxygen will truncate the graph, which is +# visualized by representing a node as a red box. Note that doxygen if the +# number of direct children of the root node in a graph is already larger than +# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note +# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH. + +DOT_GRAPH_MAX_NODES = 50 + +# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the +# graphs generated by dot. A depth value of 3 means that only nodes reachable +# from the root by following a path via at most 3 edges will be shown. Nodes +# that lay further from the root node will be omitted. Note that setting this +# option to 1 or 2 may greatly reduce the computation time needed for large +# code bases. Also note that the size of a graph can be further restricted by +# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction. + +MAX_DOT_GRAPH_DEPTH = 0 + +# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent +# background. This is disabled by default, because dot on Windows does not +# seem to support this out of the box. Warning: Depending on the platform used, +# enabling this option may lead to badly anti-aliased labels on the edges of +# a graph (i.e. they become hard to read). + +DOT_TRANSPARENT = YES + +# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output +# files in one run (i.e. multiple -o and -T options on the command line). This +# makes dot run faster, but since only newer versions of dot (>1.8.10) +# support this, this feature is disabled by default. + +DOT_MULTI_TARGETS = NO + +# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will +# generate a legend page explaining the meaning of the various boxes and +# arrows in the dot generated graphs. + +GENERATE_LEGEND = YES + +# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will +# remove the intermediate dot files that are used to generate +# the various graphs. + +DOT_CLEANUP = YES diff --git a/project/jni/ffmpeg/doc/Makefile b/project/jni/ffmpeg/doc/Makefile new file mode 100644 index 000000000..b1b4016af --- /dev/null +++ b/project/jni/ffmpeg/doc/Makefile @@ -0,0 +1,103 @@ +LIBRARIES-$(CONFIG_AVUTIL) += libavutil +LIBRARIES-$(CONFIG_SWSCALE) += libswscale +LIBRARIES-$(CONFIG_SWRESAMPLE) += libswresample +LIBRARIES-$(CONFIG_AVCODEC) += libavcodec +LIBRARIES-$(CONFIG_AVFORMAT) += libavformat +LIBRARIES-$(CONFIG_AVDEVICE) += libavdevice +LIBRARIES-$(CONFIG_AVFILTER) += libavfilter + +COMPONENTS-yes = $(PROGS-yes) +COMPONENTS-$(CONFIG_AVUTIL) += ffmpeg-utils +COMPONENTS-$(CONFIG_SWSCALE) += ffmpeg-scaler +COMPONENTS-$(CONFIG_SWRESAMPLE) += ffmpeg-resampler +COMPONENTS-$(CONFIG_AVCODEC) += ffmpeg-codecs ffmpeg-bitstream-filters +COMPONENTS-$(CONFIG_AVFORMAT) += ffmpeg-formats ffmpeg-protocols +COMPONENTS-$(CONFIG_AVDEVICE) += ffmpeg-devices +COMPONENTS-$(CONFIG_AVFILTER) += ffmpeg-filters + +MANPAGES = $(COMPONENTS-yes:%=doc/%.1) $(LIBRARIES-yes:%=doc/%.3) +PODPAGES = $(COMPONENTS-yes:%=doc/%.pod) $(LIBRARIES-yes:%=doc/%.pod) +HTMLPAGES = $(COMPONENTS-yes:%=doc/%.html) $(LIBRARIES-yes:%=doc/%.html) \ + doc/developer.html \ + doc/faq.html \ + doc/fate.html \ + doc/general.html \ + doc/git-howto.html \ + doc/nut.html \ + doc/platform.html \ + +TXTPAGES = doc/fate.txt \ + + +DOCS-$(CONFIG_HTMLPAGES) += $(HTMLPAGES) +DOCS-$(CONFIG_PODPAGES) += $(PODPAGES) +DOCS-$(CONFIG_MANPAGES) += $(MANPAGES) +DOCS-$(CONFIG_TXTPAGES) += $(TXTPAGES) +DOCS = $(DOCS-yes) + +all-$(CONFIG_DOC): doc + +doc: documentation + +apidoc: doc/doxy/html +documentation: $(DOCS) + +TEXIDEP = awk '/^@(verbatim)?include/ { printf "$@: $(@D)/%s\n", $$2 }' <$< >$(@:%=%.d) + +doc/%.txt: TAG = TXT +doc/%.txt: doc/%.texi + $(Q)$(TEXIDEP) + $(M)makeinfo --force --no-headers -o $@ $< 2>/dev/null + +GENTEXI = format codec +GENTEXI := $(GENTEXI:%=doc/avoptions_%.texi) + +$(GENTEXI): TAG = GENTEXI +$(GENTEXI): doc/avoptions_%.texi: doc/print_options$(HOSTEXESUF) + $(M)doc/print_options $* > $@ + +doc/%.html: TAG = HTML +doc/%.html: doc/%.texi $(SRC_PATH)/doc/t2h.init $(GENTEXI) + $(Q)$(TEXIDEP) + $(M)texi2html -I doc -monolithic --init-file $(SRC_PATH)/doc/t2h.init --output $@ $< + +doc/%.pod: TAG = POD +doc/%.pod: doc/%.texi $(GENTEXI) + $(Q)$(TEXIDEP) + $(M)perl $(SRC_PATH)/doc/texi2pod.pl -Idoc $< $@ + +doc/%.1 doc/%.3: TAG = MAN +doc/%.1: doc/%.pod $(GENTEXI) + $(M)pod2man --section=1 --center=" " --release=" " $< > $@ +doc/%.3: doc/%.pod $(GENTEXI) + $(M)pod2man --section=3 --center=" " --release=" " $< > $@ + +$(DOCS) doc/doxy/html: | doc/ + +doc/doxy/html: $(SRC_PATH)/doc/Doxyfile $(INSTHEADERS) + $(M)$(SRC_PATH)/doc/doxy-wrapper.sh $(SRC_PATH) $^ + +install-man: + +ifdef CONFIG_MANPAGES +install-progs-$(CONFIG_DOC): install-man + +install-man: $(MANPAGES) + $(Q)mkdir -p "$(MANDIR)/man1" + $(INSTALL) -m 644 $(MANPAGES) "$(MANDIR)/man1" +endif + +uninstall: uninstall-man + +uninstall-man: + $(RM) $(addprefix "$(MANDIR)/man1/",$(ALLMANPAGES)) + +docclean: clean + +clean:: + $(RM) $(TXTPAGES) doc/*.html doc/*.pod doc/*.1 doc/*.3 $(CLEANSUFFIXES:%=doc/%) doc/avoptions_*.texi + $(RM) -r doc/doxy/html + +-include $(wildcard $(DOCS:%=%.d)) + +.PHONY: apidoc doc documentation diff --git a/project/jni/ffmpeg/doc/RELEASE_NOTES b/project/jni/ffmpeg/doc/RELEASE_NOTES new file mode 100644 index 000000000..768a747ba --- /dev/null +++ b/project/jni/ffmpeg/doc/RELEASE_NOTES @@ -0,0 +1,25 @@ +Release Notes +============= + +* 1.1 "Fire Flower" January, 2013 + + +General notes +------------- +See the Changelog file for a list of significant changes. Note, there +are many more new features and bugfixes than whats listed there. + +Bugreports against FFmpeg git master or the most recent FFmpeg release are +accepted. If you are experiencing issues with any formally released version of +FFmpeg, please try git master to check if the issue still exists. If it does, +make your report against the development code following the usual bug reporting +guidelines. + +Of big interest to our Windows users, FFmpeg now supports building with the MSVC +compiler. Since MSVC does not support C99 features used extensively by FFmpeg, +this has been accomplished using a converter that turns C99 code to C89. See the +platform-specific documentation for more detailed documentation on building +FFmpeg with MSVC. + +The used output sample format for several audio decoders has changed, make +sure you always check/use AVCodecContext.sample_fmt or AVFrame.format. diff --git a/project/jni/ffmpeg/doc/authors.texi b/project/jni/ffmpeg/doc/authors.texi new file mode 100644 index 000000000..6c8c1d7ef --- /dev/null +++ b/project/jni/ffmpeg/doc/authors.texi @@ -0,0 +1,11 @@ +@chapter Authors + +The FFmpeg developers. + +For details about the authorship, see the Git history of the project +(git://source.ffmpeg.org/ffmpeg), e.g. by typing the command +@command{git log} in the FFmpeg source directory, or browsing the +online repository at @url{http://source.ffmpeg.org}. + +Maintainers for the specific components are listed in the file +@file{MAINTAINERS} in the source code tree. diff --git a/project/jni/ffmpeg/doc/avtools-common-opts.texi b/project/jni/ffmpeg/doc/avtools-common-opts.texi new file mode 100644 index 000000000..d9d0bd08c --- /dev/null +++ b/project/jni/ffmpeg/doc/avtools-common-opts.texi @@ -0,0 +1,211 @@ +All the numerical options, if not specified otherwise, accept in input +a string representing a number, which may contain one of the +SI unit prefixes, for example 'K', 'M', 'G'. +If 'i' is appended after the prefix, binary prefixes are used, +which are based on powers of 1024 instead of powers of 1000. +The 'B' postfix multiplies the value by 8, and can be +appended after a unit prefix or used alone. This allows using for +example 'KB', 'MiB', 'G' and 'B' as number postfix. + +Options which do not take arguments are boolean options, and set the +corresponding value to true. They can be set to false by prefixing +with "no" the option name, for example using "-nofoo" in the +command line will set to false the boolean option with name "foo". + +@anchor{Stream specifiers} +@section Stream specifiers +Some options are applied per-stream, e.g. bitrate or codec. Stream specifiers +are used to precisely specify which stream(s) does a given option belong to. + +A stream specifier is a string generally appended to the option name and +separated from it by a colon. E.g. @code{-codec:a:1 ac3} option contains +@code{a:1} stream specifier, which matches the second audio stream. Therefore it +would select the ac3 codec for the second audio stream. + +A stream specifier can match several streams, the option is then applied to all +of them. E.g. the stream specifier in @code{-b:a 128k} matches all audio +streams. + +An empty stream specifier matches all streams, for example @code{-codec copy} +or @code{-codec: copy} would copy all the streams without reencoding. + +Possible forms of stream specifiers are: +@table @option +@item @var{stream_index} +Matches the stream with this index. E.g. @code{-threads:1 4} would set the +thread count for the second stream to 4. +@item @var{stream_type}[:@var{stream_index}] +@var{stream_type} is one of: 'v' for video, 'a' for audio, 's' for subtitle, +'d' for data and 't' for attachments. If @var{stream_index} is given, then +matches stream number @var{stream_index} of this type. Otherwise matches all +streams of this type. +@item p:@var{program_id}[:@var{stream_index}] +If @var{stream_index} is given, then matches stream number @var{stream_index} in +program with id @var{program_id}. Otherwise matches all streams in this program. +@item #@var{stream_id} +Matches the stream by format-specific ID. +@end table + +@section Generic options + +These options are shared amongst the av* tools. + +@table @option + +@item -L +Show license. + +@item -h, -?, -help, --help [@var{arg}] +Show help. An optional parameter may be specified to print help about a specific +item. + +Possible values of @var{arg} are: +@table @option +@item decoder=@var{decoder_name} +Print detailed information about the decoder named @var{decoder_name}. Use the +@option{-decoders} option to get a list of all decoders. + +@item encoder=@var{encoder_name} +Print detailed information about the encoder named @var{encoder_name}. Use the +@option{-encoders} option to get a list of all encoders. + +@item demuxer=@var{demuxer_name} +Print detailed information about the demuxer named @var{demuxer_name}. Use the +@option{-formats} option to get a list of all demuxers and muxers. + +@item muxer=@var{muxer_name} +Print detailed information about the muxer named @var{muxer_name}. Use the +@option{-formats} option to get a list of all muxers and demuxers. + +@end table + +@item -version +Show version. + +@item -formats +Show available formats. + +The fields preceding the format names have the following meanings: +@table @samp +@item D +Decoding available +@item E +Encoding available +@end table + +@item -codecs +Show all codecs known to libavcodec. + +Note that the term 'codec' is used throughout this documentation as a shortcut +for what is more correctly called a media bitstream format. + +@item -decoders +Show available decoders. + +@item -encoders +Show all available encoders. + +@item -bsfs +Show available bitstream filters. + +@item -protocols +Show available protocols. + +@item -filters +Show available libavfilter filters. + +@item -pix_fmts +Show available pixel formats. + +@item -sample_fmts +Show available sample formats. + +@item -layouts +Show channel names and standard channel layouts. + +@item -loglevel @var{loglevel} | -v @var{loglevel} +Set the logging level used by the library. +@var{loglevel} is a number or a string containing one of the following values: +@table @samp +@item quiet +@item panic +@item fatal +@item error +@item warning +@item info +@item verbose +@item debug +@end table + +By default the program logs to stderr, if coloring is supported by the +terminal, colors are used to mark errors and warnings. Log coloring +can be disabled setting the environment variable +@env{AV_LOG_FORCE_NOCOLOR} or @env{NO_COLOR}, or can be forced setting +the environment variable @env{AV_LOG_FORCE_COLOR}. +The use of the environment variable @env{NO_COLOR} is deprecated and +will be dropped in a following FFmpeg version. + +@item -report +Dump full command line and console output to a file named +@code{@var{program}-@var{YYYYMMDD}-@var{HHMMSS}.log} in the current +directory. +This file can be useful for bug reports. +It also implies @code{-loglevel verbose}. + +Setting the environment variable @code{FFREPORT} to any value has the +same effect. If the value is a ':'-separated key=value sequence, these +options will affect the report; options values must be escaped if they +contain special characters or the options delimiter ':' (see the +``Quoting and escaping'' section in the ffmpeg-utils manual). The +following option is recognized: +@table @option +@item file +set the file name to use for the report; @code{%p} is expanded to the name +of the program, @code{%t} is expanded to a timestamp, @code{%%} is expanded +to a plain @code{%} +@end table + +Errors in parsing the environment variable are not fatal, and will not +appear in the report. + +@item -cpuflags flags (@emph{global}) +Allows setting and clearing cpu flags. This option is intended +for testing. Do not use it unless you know what you're doing. +@example +ffmpeg -cpuflags -sse+mmx ... +ffmpeg -cpuflags mmx ... +ffmpeg -cpuflags 0 ... +@end example + +@end table + +@section AVOptions + +These options are provided directly by the libavformat, libavdevice and +libavcodec libraries. To see the list of available AVOptions, use the +@option{-help} option. They are separated into two categories: +@table @option +@item generic +These options can be set for any container, codec or device. Generic options +are listed under AVFormatContext options for containers/devices and under +AVCodecContext options for codecs. +@item private +These options are specific to the given container, device or codec. Private +options are listed under their corresponding containers/devices/codecs. +@end table + +For example to write an ID3v2.3 header instead of a default ID3v2.4 to +an MP3 file, use the @option{id3v2_version} private option of the MP3 +muxer: +@example +ffmpeg -i input.flac -id3v2_version 3 out.mp3 +@end example + +All codec AVOptions are obviously per-stream, so the chapter on stream +specifiers applies to them + +Note @option{-nooption} syntax cannot be used for boolean AVOptions, +use @option{-option 0}/@option{-option 1}. + +Note2 old undocumented way of specifying per-stream AVOptions by prepending +v/a/s to the options name is now obsolete and will be removed soon. diff --git a/project/jni/ffmpeg/doc/avutil.txt b/project/jni/ffmpeg/doc/avutil.txt new file mode 100644 index 000000000..0847683d1 --- /dev/null +++ b/project/jni/ffmpeg/doc/avutil.txt @@ -0,0 +1,36 @@ +AVUtil +====== +libavutil is a small lightweight library of generally useful functions. +It is not a library for code needed by both libavcodec and libavformat. + + +Overview: +========= +adler32.c adler32 checksum +aes.c AES encryption and decryption +fifo.c resizeable first in first out buffer +intfloat_readwrite.c portable reading and writing of floating point values +log.c "printf" with context and level +md5.c MD5 Message-Digest Algorithm +rational.c code to perform exact calculations with rational numbers +tree.c generic AVL tree +crc.c generic CRC checksumming code +integer.c 128bit integer math +lls.c +mathematics.c greatest common divisor, integer sqrt, integer log2, ... +mem.c memory allocation routines with guaranteed alignment + +Headers: +bswap.h big/little/native-endian conversion code +x86_cpu.h a few useful macros for unifying x86-64 and x86-32 code +avutil.h +common.h +intreadwrite.h reading and writing of unaligned big/little/native-endian integers + + +Goals: +====== +* Modular (few interdependencies and the possibility of disabling individual parts during ./configure) +* Small (source and object) +* Efficient (low CPU and memory usage) +* Useful (avoid useless features almost no one needs) diff --git a/project/jni/ffmpeg/doc/bitstream_filters.texi b/project/jni/ffmpeg/doc/bitstream_filters.texi new file mode 100644 index 000000000..2ee00c134 --- /dev/null +++ b/project/jni/ffmpeg/doc/bitstream_filters.texi @@ -0,0 +1,91 @@ +@chapter Bitstream Filters +@c man begin BITSTREAM FILTERS + +When you configure your FFmpeg build, all the supported bitstream +filters are enabled by default. You can list all available ones using +the configure option @code{--list-bsfs}. + +You can disable all the bitstream filters using the configure option +@code{--disable-bsfs}, and selectively enable any bitstream filter using +the option @code{--enable-bsf=BSF}, or you can disable a particular +bitstream filter using the option @code{--disable-bsf=BSF}. + +The option @code{-bsfs} of the ff* tools will display the list of +all the supported bitstream filters included in your build. + +Below is a description of the currently available bitstream filters. + +@section aac_adtstoasc + +@section chomp + +@section dump_extradata + +@section h264_mp4toannexb + +Convert an H.264 bitstream from length prefixed mode to start code +prefixed mode (as defined in the Annex B of the ITU-T H.264 +specification). + +This is required by some streaming formats, typically the MPEG-2 +transport stream format ("mpegts"). + +For example to remux an MP4 file containing an H.264 stream to mpegts +format with @command{ffmpeg}, you can use the command: + +@example +ffmpeg -i INPUT.mp4 -codec copy -bsf:v h264_mp4toannexb OUTPUT.ts +@end example + +@section imx_dump_header + +@section mjpeg2jpeg + +Convert MJPEG/AVI1 packets to full JPEG/JFIF packets. + +MJPEG is a video codec wherein each video frame is essentially a +JPEG image. The individual frames can be extracted without loss, +e.g. by + +@example +ffmpeg -i ../some_mjpeg.avi -c:v copy frames_%d.jpg +@end example + +Unfortunately, these chunks are incomplete JPEG images, because +they lack the DHT segment required for decoding. Quoting from +@url{http://www.digitalpreservation.gov/formats/fdd/fdd000063.shtml}: + +Avery Lee, writing in the rec.video.desktop newsgroup in 2001, +commented that "MJPEG, or at least the MJPEG in AVIs having the +MJPG fourcc, is restricted JPEG with a fixed -- and *omitted* -- +Huffman table. The JPEG must be YCbCr colorspace, it must be 4:2:2, +and it must use basic Huffman encoding, not arithmetic or +progressive. . . . You can indeed extract the MJPEG frames and +decode them with a regular JPEG decoder, but you have to prepend +the DHT segment to them, or else the decoder won't have any idea +how to decompress the data. The exact table necessary is given in +the OpenDML spec." + +This bitstream filter patches the header of frames extracted from an MJPEG +stream (carrying the AVI1 header ID and lacking a DHT segment) to +produce fully qualified JPEG images. + +@example +ffmpeg -i mjpeg-movie.avi -c:v copy -bsf:v mjpeg2jpeg frame_%d.jpg +exiftran -i -9 frame*.jpg +ffmpeg -i frame_%d.jpg -c:v copy rotated.avi +@end example + +@section mjpega_dump_header + +@section movsub + +@section mp3_header_compress + +@section mp3_header_decompress + +@section noise + +@section remove_extradata + +@c man end BITSTREAM FILTERS diff --git a/project/jni/ffmpeg/doc/build_system.txt b/project/jni/ffmpeg/doc/build_system.txt new file mode 100644 index 000000000..36c141e9e --- /dev/null +++ b/project/jni/ffmpeg/doc/build_system.txt @@ -0,0 +1,50 @@ +FFmpeg currently uses a custom build system, this text attempts to document +some of its obscure features and options. + +Makefile variables: + +V + Disable the default terse mode, the full command issued by make and its + output will be shown on the screen. + +DESTDIR + Destination directory for the install targets, useful to prepare packages + or install FFmpeg in cross-environments. + +Makefile targets: + +all + Default target, builds all the libraries and the executables. + +fate + Run the fate test suite, note you must have installed it + +fate-list + Will list all fate/regression test targets + +install + Install headers, libraries and programs. + +libavformat/output-example + Build the libavformat basic example. + +libavcodec/api-example + Build the libavcodec basic example. + +libswscale/swscale-test + Build the swscale self-test (useful also as example). + + +Useful standard make commands: +make -t + Touch all files that otherwise would be build, this is useful to reduce + unneeded rebuilding when changing headers, but note you must force rebuilds + of files that actually need it by hand then. + +make -j + rebuild with multiple jobs at the same time. Faster on multi processor systems + +make -k + continue build in case of errors, this is useful for the regression tests + sometimes but note it will still not run all reg tests. + diff --git a/project/jni/ffmpeg/doc/decoders.texi b/project/jni/ffmpeg/doc/decoders.texi new file mode 100644 index 000000000..2d812a27f --- /dev/null +++ b/project/jni/ffmpeg/doc/decoders.texi @@ -0,0 +1,89 @@ +@chapter Decoders +@c man begin DECODERS + +Decoders are configured elements in FFmpeg which allow the decoding of +multimedia streams. + +When you configure your FFmpeg build, all the supported native decoders +are enabled by default. Decoders requiring an external library must be enabled +manually via the corresponding @code{--enable-lib} option. You can list all +available decoders using the configure option @code{--list-decoders}. + +You can disable all the decoders with the configure option +@code{--disable-decoders} and selectively enable / disable single decoders +with the options @code{--enable-decoder=@var{DECODER}} / +@code{--disable-decoder=@var{DECODER}}. + +The option @code{-codecs} of the ff* tools will display the list of +enabled decoders. + +@c man end DECODERS + +@chapter Video Decoders +@c man begin VIDEO DECODERS + +A description of some of the currently available video decoders +follows. + +@section rawvideo + +Raw video decoder. + +This decoder decodes rawvideo streams. + +@subsection Options + +@table @option +@item top @var{top_field_first} +Specify the assumed field type of the input video. +@table @option +@item -1 +the video is assumed to be progressive (default) +@item 0 +bottom-field-first is assumed +@item 1 +top-field-first is assumed +@end table + +@end table + +@c man end VIDEO DECODERS + +@chapter Audio Decoders +@c man begin AUDIO DECODERS + +@section ffwavesynth + +Internal wave synthetizer. + +This decoder generates wave patterns according to predefined sequences. Its +use is purely internal and the format of the data it accepts is not publicly +documented. + +@c man end AUDIO DECODERS + +@chapter Subtitles Decoders +@c man begin SUBTILES DECODERS + +@section dvdsub + +This codec decodes the bitmap subtitles used in DVDs; the same subtitles can +also be found in VobSub file pairs and in some Matroska files. + +@subsection Options + +@table @option +@item palette +Specify the global palette used by the bitmaps. When stored in VobSub, the +palette is normally specified in the index file; in Matroska, the palette is +stored in the codec extra-data in the same format as in VobSub. In DVDs, the +palette is stored in the IFO file, and therefore not available when reading +from dumped VOB files. + +The format for this option is a string containing 16 24-bits hexadecimal +numbers (without 0x prefix) separated by comas, for example @code{0d00ee, +ee450d, 101010, eaeaea, 0ce60b, ec14ed, ebff0b, 0d617a, 7b7b7b, d1d1d1, +7b2a0e, 0d950c, 0f007b, cf0dec, cfa80c, 7c127b}. +@end table + +@c man end SUBTILES DECODERS diff --git a/project/jni/ffmpeg/doc/default.css b/project/jni/ffmpeg/doc/default.css new file mode 100644 index 000000000..77a3514ed --- /dev/null +++ b/project/jni/ffmpeg/doc/default.css @@ -0,0 +1,149 @@ +a { + color: #2D6198; +} + +a:visited { + color: #884488; +} + +#banner { + background-color: white; + position: relative; + text-align: center; +} + +#banner img { + padding-bottom: 1px; + padding-top: 5px; +} + +#body { + margin-left: 1em; + margin-right: 1em; +} + +body { + background-color: #313131; + margin: 0; + text-align: justify; +} + +.center { + margin-left: auto; + margin-right: auto; + text-align: center; +} + +#container { + background-color: white; + color: #202020; + margin-left: 1em; + margin-right: 1em; +} + +#footer { + text-align: center; +} + +h1, h2, h3 { + padding-left: 0.4em; + border-radius: 4px; + padding-bottom: 0.2em; + padding-top: 0.2em; + border: 1px solid #6A996A; +} + +h1 { + background-color: #7BB37B; + color: #151515; + font-size: 1.2em; + padding-bottom: 0.3em; + padding-top: 0.3em; +} + +h2 { + color: #313131; + font-size: 0.9em; + background-color: #ABE3AB; +} + +h3 { + color: #313131; + font-size: 0.8em; + margin-bottom: -8px; + background-color: #BBF3BB; +} + +img { + border: 0; +} + +#navbar { + background-color: #738073; + border-bottom: 1px solid #5C665C; + border-top: 1px solid #5C665C; + margin-top: 12px; + padding: 0.3em; + position: relative; + text-align: center; +} + +#navbar a, #navbar_secondary a { + color: white; + padding: 0.3em; + text-decoration: none; +} + +#navbar a:hover, #navbar_secondary a:hover { + background-color: #313131; + color: white; + text-decoration: none; +} + +#navbar_secondary { + background-color: #738073; + border-bottom: 1px solid #5C665C; + border-left: 1px solid #5C665C; + border-right: 1px solid #5C665C; + padding: 0.3em; + position: relative; + text-align: center; +} + +p { + margin-left: 1em; + margin-right: 1em; +} + +pre { + margin-left: 3em; + margin-right: 3em; + padding: 0.3em; + border: 1px solid #bbb; + background-color: #f7f7f7; +} + +dl dt { + font-weight: bold; +} + +#proj_desc { + font-size: 1.2em; +} + +#repos { + margin-left: 1em; + margin-right: 1em; + border-collapse: collapse; + border: solid 1px #6A996A; +} + +#repos th { + background-color: #7BB37B; + border: solid 1px #6A996A; +} + +#repos td { + padding: 0.2em; + border: solid 1px #6A996A; +} diff --git a/project/jni/ffmpeg/doc/demuxers.texi b/project/jni/ffmpeg/doc/demuxers.texi new file mode 100644 index 000000000..1187b6a01 --- /dev/null +++ b/project/jni/ffmpeg/doc/demuxers.texi @@ -0,0 +1,239 @@ +@chapter Demuxers +@c man begin DEMUXERS + +Demuxers are configured elements in FFmpeg which allow to read the +multimedia streams from a particular type of file. + +When you configure your FFmpeg build, all the supported demuxers +are enabled by default. You can list all available ones using the +configure option "--list-demuxers". + +You can disable all the demuxers using the configure option +"--disable-demuxers", and selectively enable a single demuxer with +the option "--enable-demuxer=@var{DEMUXER}", or disable it +with the option "--disable-demuxer=@var{DEMUXER}". + +The option "-formats" of the ff* tools will display the list of +enabled demuxers. + +The description of some of the currently available demuxers follows. + +@section image2 + +Image file demuxer. + +This demuxer reads from a list of image files specified by a pattern. +The syntax and meaning of the pattern is specified by the +option @var{pattern_type}. + +The pattern may contain a suffix which is used to automatically +determine the format of the images contained in the files. + +The size, the pixel format, and the format of each image must be the +same for all the files in the sequence. + +This demuxer accepts the following options: +@table @option +@item framerate +Set the framerate for the video stream. It defaults to 25. +@item loop +If set to 1, loop over the input. Default value is 0. +@item pattern_type +Select the pattern type used to interpret the provided filename. + +@var{pattern_type} accepts one of the following values. +@table @option +@item sequence +Select a sequence pattern type, used to specify a sequence of files +indexed by sequential numbers. + +A sequence pattern may contain the string "%d" or "%0@var{N}d", which +specifies the position of the characters representing a sequential +number in each filename matched by the pattern. If the form +"%d0@var{N}d" is used, the string representing the number in each +filename is 0-padded and @var{N} is the total number of 0-padded +digits representing the number. The literal character '%' can be +specified in the pattern with the string "%%". + +If the sequence pattern contains "%d" or "%0@var{N}d", the first filename of +the file list specified by the pattern must contain a number +inclusively contained between @var{start_number} and +@var{start_number}+@var{start_number_range}-1, and all the following +numbers must be sequential. + +For example the pattern "img-%03d.bmp" will match a sequence of +filenames of the form @file{img-001.bmp}, @file{img-002.bmp}, ..., +@file{img-010.bmp}, etc.; the pattern "i%%m%%g-%d.jpg" will match a +sequence of filenames of the form @file{i%m%g-1.jpg}, +@file{i%m%g-2.jpg}, ..., @file{i%m%g-10.jpg}, etc. + +Note that the pattern must not necessarily contain "%d" or +"%0@var{N}d", for example to convert a single image file +@file{img.jpeg} you can employ the command: +@example +ffmpeg -i img.jpeg img.png +@end example + +@item glob +Select a glob wildcard pattern type. + +The pattern is interpreted like a @code{glob()} pattern. This is only +selectable if libavformat was compiled with globbing support. + +@item glob_sequence @emph{(deprecated, will be removed)} +Select a mixed glob wildcard/sequence pattern. + +If your version of libavformat was compiled with globbing support, and +the provided pattern contains at least one glob meta character among +@code{%*?[]@{@}} that is preceded by an unescaped "%", the pattern is +interpreted like a @code{glob()} pattern, otherwise it is interpreted +like a sequence pattern. + +All glob special characters @code{%*?[]@{@}} must be prefixed +with "%". To escape a literal "%" you shall use "%%". + +For example the pattern @code{foo-%*.jpeg} will match all the +filenames prefixed by "foo-" and terminating with ".jpeg", and +@code{foo-%?%?%?.jpeg} will match all the filenames prefixed with +"foo-", followed by a sequence of three characters, and terminating +with ".jpeg". + +This pattern type is deprecated in favor of @var{glob} and +@var{sequence}. +@end table + +Default value is @var{glob_sequence}. +@item pixel_format +Set the pixel format of the images to read. If not specified the pixel +format is guessed from the first image file in the sequence. +@item start_number +Set the index of the file matched by the image file pattern to start +to read from. Default value is 0. +@item start_number_range +Set the index interval range to check when looking for the first image +file in the sequence, starting from @var{start_number}. Default value +is 5. +@item video_size +Set the video size of the images to read. If not specified the video +size is guessed from the first image file in the sequence. +@end table + +@subsection Examples + +@itemize +@item +Use @command{ffmpeg} for creating a video from the images in the file +sequence @file{img-001.jpeg}, @file{img-002.jpeg}, ..., assuming an +input frame rate of 10 frames per second: +@example +ffmpeg -i 'img-%03d.jpeg' -r 10 out.mkv +@end example + +@item +As above, but start by reading from a file with index 100 in the sequence: +@example +ffmpeg -start_number 100 -i 'img-%03d.jpeg' -r 10 out.mkv +@end example + +@item +Read images matching the "*.png" glob pattern , that is all the files +terminating with the ".png" suffix: +@example +ffmpeg -pattern_type glob -i "*.png" -r 10 out.mkv +@end example +@end itemize + +@section applehttp + +Apple HTTP Live Streaming demuxer. + +This demuxer presents all AVStreams from all variant streams. +The id field is set to the bitrate variant index number. By setting +the discard flags on AVStreams (by pressing 'a' or 'v' in ffplay), +the caller can decide which variant streams to actually receive. +The total bitrate of the variant that the stream belongs to is +available in a metadata key named "variant_bitrate". + +@section sbg + +SBaGen script demuxer. + +This demuxer reads the script language used by SBaGen +@url{http://uazu.net/sbagen/} to generate binaural beats sessions. A SBG +script looks like that: +@example +-SE +a: 300-2.5/3 440+4.5/0 +b: 300-2.5/0 440+4.5/3 +off: - +NOW == a ++0:07:00 == b ++0:14:00 == a ++0:21:00 == b ++0:30:00 off +@end example + +A SBG script can mix absolute and relative timestamps. If the script uses +either only absolute timestamps (including the script start time) or only +relative ones, then its layout is fixed, and the conversion is +straightforward. On the other hand, if the script mixes both kind of +timestamps, then the @var{NOW} reference for relative timestamps will be +taken from the current time of day at the time the script is read, and the +script layout will be frozen according to that reference. That means that if +the script is directly played, the actual times will match the absolute +timestamps up to the sound controller's clock accuracy, but if the user +somehow pauses the playback or seeks, all times will be shifted accordingly. + +@section concat + +Virtual concatenation script demuxer. + +This demuxer reads a list of files and other directives from a text file and +demuxes them one after the other, as if all their packet had been muxed +together. + +The timestamps in the files are adjusted so that the first file starts at 0 +and each next file starts where the previous one finishes. Note that it is +done globally and may cause gaps if all streams do not have exactly the same +length. + +All files must have the same streams (same codecs, same time base, etc.). + +This script format can currently not be probed, it must be specified explicitly. + +@subsection Syntax + +The script is a text file in extended-ASCII, with one directive per line. +Empty lines, leading spaces and lines starting with '#' are ignored. The +following directive is recognized: + +@table @option + +@item @code{file @var{path}} +Path to a file to read; special characters and spaces must be escaped with +backslash or single quotes. + +@end table + +@section tedcaptions + +JSON captions used for @url{http://www.ted.com/, TED Talks}. + +TED does not provide links to the captions, but they can be guessed from the +page. The file @file{tools/bookmarklets.html} from the FFmpeg source tree +contains a bookmarklet to expose them. + +This demuxer accepts the following option: +@table @option +@item start_time +Set the start time of the TED talk, in milliseconds. The default is 15000 +(15s). It is used to sync the captions with the downloadable videos, because +they include a 15s intro. +@end table + +Example: convert the captions to a format most players understand: +@example +ffmpeg -i http://www.ted.com/talks/subtitles/id/1/lang/en talk1-en.srt +@end example + +@c man end INPUT DEVICES diff --git a/project/jni/ffmpeg/doc/developer.texi b/project/jni/ffmpeg/doc/developer.texi new file mode 100644 index 000000000..e75f3b940 --- /dev/null +++ b/project/jni/ffmpeg/doc/developer.texi @@ -0,0 +1,551 @@ +\input texinfo @c -*- texinfo -*- + +@settitle Developer Documentation +@titlepage +@center @titlefont{Developer Documentation} +@end titlepage + +@top + +@contents + +@chapter Developers Guide + +@section API +@itemize @bullet +@item libavcodec is the library containing the codecs (both encoding and +decoding). Look at @file{doc/examples/decoding_encoding.c} to see how to use +it. + +@item libavformat is the library containing the file format handling (mux and +demux code for several formats). Look at @file{ffplay.c} to use it in a +player. See @file{doc/examples/muxing.c} to use it to generate audio or video +streams. + +@end itemize + +@section Integrating libavcodec or libavformat in your program + +You can integrate all the source code of the libraries to link them +statically to avoid any version problem. All you need is to provide a +'config.mak' and a 'config.h' in the parent directory. See the defines +generated by ./configure to understand what is needed. + +You can use libavcodec or libavformat in your commercial program, but +@emph{any patch you make must be published}. The best way to proceed is +to send your patches to the FFmpeg mailing list. + +@section Contributing + +There are 3 ways by which code gets into ffmpeg. +@itemize @bullet +@item Submitting Patches to the main developer mailing list + see @ref{Submitting patches} for details. +@item Directly committing changes to the main tree. +@item Committing changes to a git clone, for example on github.com or + gitorious.org. And asking us to merge these changes. +@end itemize + +Whichever way, changes should be reviewed by the maintainer of the code +before they are committed. And they should follow the @ref{Coding Rules}. +The developer making the commit and the author are responsible for their changes +and should try to fix issues their commit causes. + +@anchor{Coding Rules} +@section Coding Rules + +@subsection Code formatting conventions + +There are the following guidelines regarding the indentation in files: +@itemize @bullet +@item +Indent size is 4. +@item +The TAB character is forbidden outside of Makefiles as is any +form of trailing whitespace. Commits containing either will be +rejected by the git repository. +@item +You should try to limit your code lines to 80 characters; however, do so if +and only if this improves readability. +@end itemize +The presentation is one inspired by 'indent -i4 -kr -nut'. + +The main priority in FFmpeg is simplicity and small code size in order to +minimize the bug count. + +@subsection Comments +Use the JavaDoc/Doxygen format (see examples below) so that code documentation +can be generated automatically. All nontrivial functions should have a comment +above them explaining what the function does, even if it is just one sentence. +All structures and their member variables should be documented, too. + +Avoid Qt-style and similar Doxygen syntax with @code{!} in it, i.e. replace +@code{//!} with @code{///} and similar. Also @@ syntax should be employed +for markup commands, i.e. use @code{@@param} and not @code{\param}. + +@example +/** + * @@file + * MPEG codec. + * @@author ... + */ + +/** + * Summary sentence. + * more text ... + * ... + */ +typedef struct Foobar@{ + int var1; /**< var1 description */ + int var2; ///< var2 description + /** var3 description */ + int var3; +@} Foobar; + +/** + * Summary sentence. + * more text ... + * ... + * @@param my_parameter description of my_parameter + * @@return return value description + */ +int myfunc(int my_parameter) +... +@end example + +@subsection C language features + +FFmpeg is programmed in the ISO C90 language with a few additional +features from ISO C99, namely: +@itemize @bullet +@item +the @samp{inline} keyword; +@item +@samp{//} comments; +@item +designated struct initializers (@samp{struct s x = @{ .i = 17 @};}) +@item +compound literals (@samp{x = (struct s) @{ 17, 23 @};}) +@end itemize + +These features are supported by all compilers we care about, so we will not +accept patches to remove their use unless they absolutely do not impair +clarity and performance. + +All code must compile with recent versions of GCC and a number of other +currently supported compilers. To ensure compatibility, please do not use +additional C99 features or GCC extensions. Especially watch out for: +@itemize @bullet +@item +mixing statements and declarations; +@item +@samp{long long} (use @samp{int64_t} instead); +@item +@samp{__attribute__} not protected by @samp{#ifdef __GNUC__} or similar; +@item +GCC statement expressions (@samp{(x = (@{ int y = 4; y; @})}). +@end itemize + +@subsection Naming conventions +All names are using underscores (_), not CamelCase. For example, @samp{avfilter_get_video_buffer} is +a valid function name and @samp{AVFilterGetVideo} is not. The exception from this are type names, like +for example structs and enums; they should always be in the CamelCase + + +There are following conventions for naming variables and functions: +@itemize @bullet +@item +For local variables no prefix is required. +@item +For variables and functions declared as @code{static} no prefixes are required. +@item +For variables and functions used internally by the library, @code{ff_} prefix +should be used. +For example, @samp{ff_w64_demuxer}. +@item +For variables and functions used internally across multiple libraries, use +@code{avpriv_}. For example, @samp{avpriv_aac_parse_header}. +@item +For exported names, each library has its own prefixes. Just check the existing +code and name accordingly. +@end itemize + +@subsection Miscellaneous conventions +@itemize @bullet +@item +fprintf and printf are forbidden in libavformat and libavcodec, +please use av_log() instead. +@item +Casts should be used only when necessary. Unneeded parentheses +should also be avoided if they don't make the code easier to understand. +@end itemize + +@subsection Editor configuration +In order to configure Vim to follow FFmpeg formatting conventions, paste +the following snippet into your @file{.vimrc}: +@example +" indentation rules for FFmpeg: 4 spaces, no tabs +set expandtab +set shiftwidth=4 +set softtabstop=4 +set cindent +set cinoptions=(0 +" allow tabs in Makefiles +autocmd FileType make set noexpandtab shiftwidth=8 softtabstop=8 +" Trailing whitespace and tabs are forbidden, so highlight them. +highlight ForbiddenWhitespace ctermbg=red guibg=red +match ForbiddenWhitespace /\s\+$\|\t/ +" Do not highlight spaces at the end of line while typing on that line. +autocmd InsertEnter * match ForbiddenWhitespace /\t\|\s\+\%#\@@ 5 lines) chunk of code, + then either do NOT change the indentation of the inner part within (do not + move it to the right)! or do so in a separate commit +@item + Always fill out the commit log message. Describe in a few lines what you + changed and why. You can refer to mailing list postings if you fix a + particular bug. Comments such as "fixed!" or "Changed it." are unacceptable. + Recommended format: + area changed: Short 1 line description + + details describing what and why and giving references. +@item + Make sure the author of the commit is set correctly. (see git commit --author) + If you apply a patch, send an + answer to ffmpeg-devel (or wherever you got the patch from) saying that + you applied the patch. +@item + When applying patches that have been discussed (at length) on the mailing + list, reference the thread in the log message. +@item + Do NOT commit to code actively maintained by others without permission. + Send a patch to ffmpeg-devel instead. If no one answers within a reasonable + timeframe (12h for build failures and security fixes, 3 days small changes, + 1 week for big patches) then commit your patch if you think it is OK. + Also note, the maintainer can simply ask for more time to review! +@item + Subscribe to the ffmpeg-cvslog mailing list. The diffs of all commits + are sent there and reviewed by all the other developers. Bugs and possible + improvements or general questions regarding commits are discussed there. We + expect you to react if problems with your code are uncovered. +@item + Update the documentation if you change behavior or add features. If you are + unsure how best to do this, send a patch to ffmpeg-devel, the documentation + maintainer(s) will review and commit your stuff. +@item + Try to keep important discussions and requests (also) on the public + developer mailing list, so that all developers can benefit from them. +@item + Never write to unallocated memory, never write over the end of arrays, + always check values read from some untrusted source before using them + as array index or other risky things. +@item + Remember to check if you need to bump versions for the specific libav* + parts (libavutil, libavcodec, libavformat) you are changing. You need + to change the version integer. + Incrementing the first component means no backward compatibility to + previous versions (e.g. removal of a function from the public API). + Incrementing the second component means backward compatible change + (e.g. addition of a function to the public API or extension of an + existing data structure). + Incrementing the third component means a noteworthy binary compatible + change (e.g. encoder bug fix that matters for the decoder). The third + component always starts at 100 to distinguish FFmpeg from Libav. +@item + Compiler warnings indicate potential bugs or code with bad style. If a type of + warning always points to correct and clean code, that warning should + be disabled, not the code changed. + Thus the remaining warnings can either be bugs or correct code. + If it is a bug, the bug has to be fixed. If it is not, the code should + be changed to not generate a warning unless that causes a slowdown + or obfuscates the code. +@item + If you add a new file, give it a proper license header. Do not copy and + paste it from a random place, use an existing file as template. +@end enumerate + +We think our rules are not too hard. If you have comments, contact us. + +Note, these rules are mostly borrowed from the MPlayer project. + +@anchor{Submitting patches} +@section Submitting patches + +First, read the @ref{Coding Rules} above if you did not yet, in particular +the rules regarding patch submission. + +When you submit your patch, please use @code{git format-patch} or +@code{git send-email}. We cannot read other diffs :-) + +Also please do not submit a patch which contains several unrelated changes. +Split it into separate, self-contained pieces. This does not mean splitting +file by file. Instead, make the patch as small as possible while still +keeping it as a logical unit that contains an individual change, even +if it spans multiple files. This makes reviewing your patches much easier +for us and greatly increases your chances of getting your patch applied. + +Use the patcheck tool of FFmpeg to check your patch. +The tool is located in the tools directory. + +Run the @ref{Regression tests} before submitting a patch in order to verify +it does not cause unexpected problems. + +Patches should be posted as base64 encoded attachments (or any other +encoding which ensures that the patch will not be trashed during +transmission) to the ffmpeg-devel mailing list, see +@url{http://lists.ffmpeg.org/mailman/listinfo/ffmpeg-devel} + +It also helps quite a bit if you tell us what the patch does (for example +'replaces lrint by lrintf'), and why (for example '*BSD isn't C99 compliant +and has no lrint()') + +Also please if you send several patches, send each patch as a separate mail, +do not attach several unrelated patches to the same mail. + +Your patch will be reviewed on the mailing list. You will likely be asked +to make some changes and are expected to send in an improved version that +incorporates the requests from the review. This process may go through +several iterations. Once your patch is deemed good enough, some developer +will pick it up and commit it to the official FFmpeg tree. + +Give us a few days to react. But if some time passes without reaction, +send a reminder by email. Your patch should eventually be dealt with. + + +@section New codecs or formats checklist + +@enumerate +@item + Did you use av_cold for codec initialization and close functions? +@item + Did you add a long_name under NULL_IF_CONFIG_SMALL to the AVCodec or + AVInputFormat/AVOutputFormat struct? +@item + Did you bump the minor version number (and reset the micro version + number) in @file{libavcodec/version.h} or @file{libavformat/version.h}? +@item + Did you register it in @file{allcodecs.c} or @file{allformats.c}? +@item + Did you add the AVCodecID to @file{avcodec.h}? + When adding new codec IDs, also add an entry to the codec descriptor + list in @file{libavcodec/codec_desc.c}. +@item + If it has a fourCC, did you add it to @file{libavformat/riff.c}, + even if it is only a decoder? +@item + Did you add a rule to compile the appropriate files in the Makefile? + Remember to do this even if you're just adding a format to a file that is + already being compiled by some other rule, like a raw demuxer. +@item + Did you add an entry to the table of supported formats or codecs in + @file{doc/general.texi}? +@item + Did you add an entry in the Changelog? +@item + If it depends on a parser or a library, did you add that dependency in + configure? +@item + Did you @code{git add} the appropriate files before committing? +@item + Did you make sure it compiles standalone, i.e. with + @code{configure --disable-everything --enable-decoder=foo} + (or @code{--enable-demuxer} or whatever your component is)? +@end enumerate + + +@section patch submission checklist + +@enumerate +@item + Does @code{make fate} pass with the patch applied? +@item + Was the patch generated with git format-patch or send-email? +@item + Did you sign off your patch? (git commit -s) + See @url{http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=blob_plain;f=Documentation/SubmittingPatches} for the meaning + of sign off. +@item + Did you provide a clear git commit log message? +@item + Is the patch against latest FFmpeg git master branch? +@item + Are you subscribed to ffmpeg-devel? + (the list is subscribers only due to spam) +@item + Have you checked that the changes are minimal, so that the same cannot be + achieved with a smaller patch and/or simpler final code? +@item + If the change is to speed critical code, did you benchmark it? +@item + If you did any benchmarks, did you provide them in the mail? +@item + Have you checked that the patch does not introduce buffer overflows or + other security issues? +@item + Did you test your decoder or demuxer against damaged data? If no, see + tools/trasher and the noise bitstream filter. Your decoder or demuxer + should not crash or end in a (near) infinite loop when fed damaged data. +@item + Does the patch not mix functional and cosmetic changes? +@item + Did you add tabs or trailing whitespace to the code? Both are forbidden. +@item + Is the patch attached to the email you send? +@item + Is the mime type of the patch correct? It should be text/x-diff or + text/x-patch or at least text/plain and not application/octet-stream. +@item + If the patch fixes a bug, did you provide a verbose analysis of the bug? +@item + If the patch fixes a bug, did you provide enough information, including + a sample, so the bug can be reproduced and the fix can be verified? + Note please do not attach samples >100k to mails but rather provide a + URL, you can upload to ftp://upload.ffmpeg.org +@item + Did you provide a verbose summary about what the patch does change? +@item + Did you provide a verbose explanation why it changes things like it does? +@item + Did you provide a verbose summary of the user visible advantages and + disadvantages if the patch is applied? +@item + Did you provide an example so we can verify the new feature added by the + patch easily? +@item + If you added a new file, did you insert a license header? It should be + taken from FFmpeg, not randomly copied and pasted from somewhere else. +@item + You should maintain alphabetical order in alphabetically ordered lists as + long as doing so does not break API/ABI compatibility. +@item + Lines with similar content should be aligned vertically when doing so + improves readability. +@item + Consider to add a regression test for your code. +@item + If you added YASM code please check that things still work with --disable-yasm +@item + Make sure you check the return values of function and return appropriate + error codes. Especially memory allocation functions like @code{av_malloc()} + are notoriously left unchecked, which is a serious problem. +@end enumerate + +@section Patch review process + +All patches posted to ffmpeg-devel will be reviewed, unless they contain a +clear note that the patch is not for the git master branch. +Reviews and comments will be posted as replies to the patch on the +mailing list. The patch submitter then has to take care of every comment, +that can be by resubmitting a changed patch or by discussion. Resubmitted +patches will themselves be reviewed like any other patch. If at some point +a patch passes review with no comments then it is approved, that can for +simple and small patches happen immediately while large patches will generally +have to be changed and reviewed many times before they are approved. +After a patch is approved it will be committed to the repository. + +We will review all submitted patches, but sometimes we are quite busy so +especially for large patches this can take several weeks. + +If you feel that the review process is too slow and you are willing to try to +take over maintainership of the area of code you change then just clone +git master and maintain the area of code there. We will merge each area from +where its best maintained. + +When resubmitting patches, please do not make any significant changes +not related to the comments received during review. Such patches will +be rejected. Instead, submit significant changes or new features as +separate patches. + +@anchor{Regression tests} +@section Regression tests + +Before submitting a patch (or committing to the repository), you should at least +test that you did not break anything. + +Running 'make fate' accomplishes this, please see @url{fate.html} for details. + +[Of course, some patches may change the results of the regression tests. In +this case, the reference results of the regression tests shall be modified +accordingly]. + +@subsection Adding files to the fate-suite dataset + +When there is no muxer or encoder available to generate test media for a +specific test then the media has to be inlcuded in the fate-suite. +First please make sure that the sample file is as small as possible to test the +respective decoder or demuxer sufficiently. Large files increase network +bandwidth and disk space requirements. +Once you have a working fate test and fate sample, provide in the commit +message or introductionary message for the patch series that you post to +the ffmpeg-devel mailing list, a direct link to download the sample media. + + +@bye diff --git a/project/jni/ffmpeg/doc/doxy-wrapper.sh b/project/jni/ffmpeg/doc/doxy-wrapper.sh new file mode 100755 index 000000000..6650e3885 --- /dev/null +++ b/project/jni/ffmpeg/doc/doxy-wrapper.sh @@ -0,0 +1,14 @@ +#!/bin/sh + +SRC_PATH="${1}" +DOXYFILE="${2}" + +shift 2 + +doxygen - < li > a { + display: block; +} +.tablist > li > a:hover { + text-decoration: none; + background-color: #eeeeee; +} +.tablist > .pull-right { + float: right; +} +.tablist-header { + display: block; + padding: 3px 15px; + font-size: 11px; + font-weight: bold; + line-height: 20px; + color: #999999; + text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5); + text-transform: uppercase; +} +.tablist li + .tablist-header { + margin-top: 9px; +} +.tablist-list { + padding-left: 15px; + padding-right: 15px; + margin-bottom: 0; +} +.tablist-list > li > a, +.tablist-list .tablist-header { + margin-left: -15px; + margin-right: -15px; + text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5); +} +.tablist-list > li > a { + padding: 3px 15px; +} +.tablist-list > .current > a, +.tablist-list > .current > a:hover { + color: #ffffff; + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.2); + background-color: #0088cc; +} +.tablist-list [class^="icon-"] { + margin-right: 2px; +} +.tablist-list .divider { + *width: 100%; + height: 1px; + margin: 9px 1px; + *margin: -5px 0 5px; + overflow: hidden; + background-color: #e5e5e5; + border-bottom: 1px solid #ffffff; +} +.tablist-tabs, +.tablist { + *zoom: 1; +} +.tablist-tabs:before, +.tablist:before, +.tablist-tabs:after, +.tablist:after { + display: table; + content: ""; + line-height: 0; +} +.tablist-tabs:after, +.tablist:after { + clear: both; +} +.tablist-tabs > li, +.tablist > li { + float: left; +} +.tablist-tabs > li > a, +.tablist > li > a { + padding-right: 12px; + padding-left: 12px; + margin-right: 2px; + line-height: 14px; +} +.tablist-tabs { + border-bottom: 1px solid #ddd; +} +.tablist-tabs > li { + margin-bottom: -1px; +} +.tablist-tabs > li > a { + padding-top: 8px; + padding-bottom: 8px; + line-height: 20px; + border: 1px solid transparent; + -webkit-border-radius: 4px 4px 0 0; + -moz-border-radius: 4px 4px 0 0; + border-radius: 4px 4px 0 0; +} +.tablist-tabs > li > a:hover { + border-color: #eeeeee #eeeeee #dddddd; +} +.tablist-tabs > .current > a, +.tablist-tabs > .current > a:hover { + color: #555555; + background-color: #ffffff; + border: 1px solid #ddd; + border-bottom-color: transparent; + cursor: default; +} +.tablist > li > a { + padding-top: 8px; + padding-bottom: 8px; + margin-top: 2px; + margin-bottom: 2px; + -webkit-border-radius: 5px; + -moz-border-radius: 5px; + border-radius: 5px; +} +.tablist > .current > a, +.tablist > .current > a:hover { + color: #ffffff; + background-color: #0088cc; +} +.tablist-stacked > li { + float: none; +} +.tablist-stacked > li > a { + margin-right: 0; +} +.tablist-tabs.tablist-stacked { + border-bottom: 0; +} +.tablist-tabs.tablist-stacked > li > a { + border: 1px solid #ddd; + -webkit-border-radius: 0; + -moz-border-radius: 0; + border-radius: 0; +} +.tablist-tabs.tablist-stacked > li:first-child > a { + -webkit-border-top-right-radius: 4px; + -moz-border-radius-topright: 4px; + border-top-right-radius: 4px; + -webkit-border-top-left-radius: 4px; + -moz-border-radius-topleft: 4px; + border-top-left-radius: 4px; +} +.tablist-tabs.tablist-stacked > li:last-child > a { + -webkit-border-bottom-right-radius: 4px; + -moz-border-radius-bottomright: 4px; + border-bottom-right-radius: 4px; + -webkit-border-bottom-left-radius: 4px; + -moz-border-radius-bottomleft: 4px; + border-bottom-left-radius: 4px; +} +.tablist-tabs.tablist-stacked > li > a:hover { + border-color: #ddd; + z-index: 2; +} +.tablist.tablist-stacked > li > a { + margin-bottom: 3px; +} +.tablist.tablist-stacked > li:last-child > a { + margin-bottom: 1px; +} +.tablist-tabs .dropdown-menu { + -webkit-border-radius: 0 0 6px 6px; + -moz-border-radius: 0 0 6px 6px; + border-radius: 0 0 6px 6px; +} +.tablist .dropdown-menu { + -webkit-border-radius: 6px; + -moz-border-radius: 6px; + border-radius: 6px; +} +.tablist .dropdown-toggle .caret { + border-top-color: #0088cc; + border-bottom-color: #0088cc; + margin-top: 6px; +} +.tablist .dropdown-toggle:hover .caret { + border-top-color: #005580; + border-bottom-color: #005580; +} +/* move down carets for tabs */ +.tablist-tabs .dropdown-toggle .caret { + margin-top: 8px; +} +.tablist .current .dropdown-toggle .caret { + border-top-color: #fff; + border-bottom-color: #fff; +} +.tablist-tabs .current .dropdown-toggle .caret { + border-top-color: #555555; + border-bottom-color: #555555; +} +.tablist > .dropdown.current > a:hover { + cursor: pointer; +} +.tablist-tabs .open .dropdown-toggle, +.tablist .open .dropdown-toggle, +.tablist > li.dropdown.open.current > a:hover { + color: #ffffff; + background-color: #999999; + border-color: #999999; +} +.tablist li.dropdown.open .caret, +.tablist li.dropdown.open.current .caret, +.tablist li.dropdown.open a:hover .caret { + border-top-color: #ffffff; + border-bottom-color: #ffffff; + opacity: 1; + filter: alpha(opacity=100); +} +.tabs-stacked .open > a:hover { + border-color: #999999; +} +.tab-content > .tab-pane, +.pill-content > .pill-pane { + display: none; +} +.tab-content > .current, +.pill-content > .current { + display: block; +} +.tabs-below > .tablist-tabs { + border-top: 1px solid #ddd; +} +.tabs-below > .tablist-tabs > li { + margin-top: -1px; + margin-bottom: 0; +} +.tabs-below > .tablist-tabs > li > a { + -webkit-border-radius: 0 0 4px 4px; + -moz-border-radius: 0 0 4px 4px; + border-radius: 0 0 4px 4px; +} +.tabs-below > .tablist-tabs > li > a:hover { + border-bottom-color: transparent; + border-top-color: #ddd; +} +.tabs-below > .tablist-tabs > .current > a, +.tabs-below > .tablist-tabs > .current > a:hover { + border-color: transparent #ddd #ddd #ddd; +} +.tabs-left > .tablist-tabs > li, +.tabs-right > .tablist-tabs > li { + float: none; +} +.tabs-left > .tablist-tabs > li > a, +.tabs-right > .tablist-tabs > li > a { + min-width: 74px; + margin-right: 0; + margin-bottom: 3px; +} +.tabs-left > .tablist-tabs { + float: left; + margin-right: 19px; + border-right: 1px solid #ddd; +} +.tabs-left > .tablist-tabs > li > a { + margin-right: -1px; + -webkit-border-radius: 4px 0 0 4px; + -moz-border-radius: 4px 0 0 4px; + border-radius: 4px 0 0 4px; +} +.tabs-left > .tablist-tabs > li > a:hover { + border-color: #eeeeee #dddddd #eeeeee #eeeeee; +} +.tabs-left > .tablist-tabs .current > a, +.tabs-left > .tablist-tabs .current > a:hover { + border-color: #ddd transparent #ddd #ddd; + *border-right-color: #ffffff; +} +.tabs-right > .tablist-tabs { + float: right; + margin-left: 19px; + border-left: 1px solid #ddd; +} +.tabs-right > .tablist-tabs > li > a { + margin-left: -1px; + -webkit-border-radius: 0 4px 4px 0; + -moz-border-radius: 0 4px 4px 0; + border-radius: 0 4px 4px 0; +} +.tabs-right > .tablist-tabs > li > a:hover { + border-color: #eeeeee #eeeeee #eeeeee #dddddd; +} +.tabs-right > .tablist-tabs .current > a, +.tabs-right > .tablist-tabs .current > a:hover { + border-color: #ddd #ddd #ddd transparent; + *border-left-color: #ffffff; +} +.tablist > .disabled > a { + color: #999999; +} +.tablist > .disabled > a:hover { + text-decoration: none; + background-color: transparent; + cursor: default; +} +.tablistbar { + overflow: visible; + margin-bottom: 20px; + color: #ffffff; + *position: relative; + *z-index: 2; +} +.tablistbar-inner { + min-height: 40px; + padding-left: 20px; + padding-right: 20px; + background-color: #034c03; + background-image: -moz-linear-gradient(top, #024002, #045f04); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#024002), to(#045f04)); + background-image: -webkit-linear-gradient(top, #024002, #045f04); + background-image: -o-linear-gradient(top, #024002, #045f04); + background-image: linear-gradient(to bottom, #024002, #045f04); + background-repeat: repeat-x; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff024002', endColorstr='#ff045f04', GradientType=0); + border: 1px solid #022402; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; + -webkit-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.065); + -moz-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.065); + box-shadow: 0 1px 4px rgba(0, 0, 0, 0.065); + *zoom: 1; +} +.tablistbar-inner:before, +.tablistbar-inner:after { + display: table; + content: ""; + line-height: 0; +} +.tablistbar-inner:after { + clear: both; +} +.tablistbar .container { + width: auto; +} +.tablist-collapse.collapse { + height: auto; +} +.tablistbar .brand { + float: left; + display: block; + padding: 10px 20px 10px; + margin-left: -20px; + font-size: 20px; + font-weight: 200; + color: #ffffff; + text-shadow: 0 1px 0 #024002; +} +.tablistbar .brand:hover { + text-decoration: none; +} +.tablistbar-text { + margin-bottom: 0; + line-height: 40px; +} +.tablistbar-link { + color: #ffffff; +} +.tablistbar-link:hover { + color: #333333; +} +.tablistbar .tablist { + position: relative; + left: 0; + display: block; + float: left; + margin: 0 10px 0 0; +} +.tablistbar .tablist.pull-right { + float: right; + margin-right: 0; +} +.tablistbar .tablist > li { + float: left; +} +.tablistbar .tablist > li > a { + float: none; + padding: 10px 15px 10px; + color: #ffffff; + text-decoration: none; + text-shadow: 0 1px 0 #024002; +} +.tablistbar .tablist .dropdown-toggle .caret { + margin-top: 8px; +} +.tablistbar .tablist > li > a:focus, +.tablistbar .tablist > li > a:hover { + background-color: transparent; + color: white; + text-decoration: none; +} +.tablistbar .tablist > .current > a, +.tablistbar .tablist > .current > a:hover, +.tablistbar .tablist > .current > a:focus { + color: #555555; + text-decoration: none; + background-color: #034703; + -webkit-box-shadow: inset 0 3px 8px rgba(0, 0, 0, 0.125); + -moz-box-shadow: inset 0 3px 8px rgba(0, 0, 0, 0.125); + box-shadow: inset 0 3px 8px rgba(0, 0, 0, 0.125); +} +.tablistbar .btn-navbar { + display: none; + float: right; + padding: 7px 10px; + margin-left: 5px; + margin-right: 5px; + color: #ffffff; + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); + background-color: #023402; + background-image: -moz-linear-gradient(top, #012701, #034703); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#012701), to(#034703)); + background-image: -webkit-linear-gradient(top, #012701, #034703); + background-image: -o-linear-gradient(top, #012701, #034703); + background-image: linear-gradient(to bottom, #012701, #034703); + background-repeat: repeat-x; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff012701', endColorstr='#ff034703', GradientType=0); + border-color: #034703 #034703 #000000; + border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); + *background-color: #034703; + /* Darken IE7 buttons by default so they stand out more given they won't have borders */ + + filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); + -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.075); + -moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.075); + box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.075); +} +.tablistbar .tablist > li > .dropdown-menu:before { + content: ''; + display: inline-block; + border-left: 7px solid transparent; + border-right: 7px solid transparent; + border-bottom: 7px solid #ccc; + border-bottom-color: rgba(0, 0, 0, 0.2); + position: absolute; + top: -7px; + left: 9px; +} +.tablistbar .tablist > li > .dropdown-menu:after { + content: ''; + display: inline-block; + border-left: 6px solid transparent; + border-right: 6px solid transparent; + border-bottom: 6px solid #ffffff; + position: absolute; + top: -6px; + left: 10px; +} +.tablistbar .tablist li.dropdown.open > .dropdown-toggle, +.tablistbar .tablist li.dropdown.current > .dropdown-toggle, +.tablistbar .tablist li.dropdown.open.current > .dropdown-toggle { + background-color: #034703; + color: #555555; +} +.tablistbar .tablist li.dropdown > .dropdown-toggle .caret { + border-top-color: #ffffff; + border-bottom-color: #ffffff; +} +.tablistbar .tablist li.dropdown.open > .dropdown-toggle .caret, +.tablistbar .tablist li.dropdown.current > .dropdown-toggle .caret, +.tablistbar .tablist li.dropdown.open.current > .dropdown-toggle .caret { + border-top-color: #555555; + border-bottom-color: #555555; +} +.tablistbar .pull-right > li > .dropdown-menu, +.tablistbar .tablist > li > .dropdown-menu.pull-right { + left: auto; + right: 0; +} +.tablistbar .pull-right > li > .dropdown-menu:before, +.tablistbar .tablist > li > .dropdown-menu.pull-right:before { + left: auto; + right: 12px; +} +.tablistbar .pull-right > li > .dropdown-menu:after, +.tablistbar .tablist > li > .dropdown-menu.pull-right:after { + left: auto; + right: 13px; +} +.tablistbar .pull-right > li > .dropdown-menu .dropdown-menu, +.tablistbar .tablist > li > .dropdown-menu.pull-right .dropdown-menu { + left: auto; + right: 100%; + margin-left: 0; + margin-right: -1px; + -webkit-border-radius: 6px 0 6px 6px; + -moz-border-radius: 6px 0 6px 6px; + border-radius: 6px 0 6px 6px; +} +.breadcrumb { + padding: 8px 15px; + margin: 0 0 20px; + list-style: none; + background-color: #f5f5f5; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; +} +.breadcrumb li { + display: inline-block; + *display: inline; + /* IE7 inline-block hack */ + + *zoom: 1; + text-shadow: 0 1px 0 #ffffff; +} +.breadcrumb .divider { + padding: 0 5px; + color: #ccc; +} +.breadcrumb .current { + color: #999999; +} +.pagination-right { + text-align: right; +} +.fade { + opacity: 0; + -webkit-transition: opacity 0.15s linear; + -moz-transition: opacity 0.15s linear; + -o-transition: opacity 0.15s linear; + transition: opacity 0.15s linear; +} +.fade.in { + opacity: 1; +} +.collapse { + position: relative; + height: 0; + overflow: hidden; + -webkit-transition: height 0.35s ease; + -moz-transition: height 0.35s ease; + -o-transition: height 0.35s ease; + transition: height 0.35s ease; +} +.collapse.in { + height: auto; +} +.hidden { + display: none; + visibility: hidden; +} +.visible-phone { + display: none !important; +} +.visible-tablet { + display: none !important; +} +.hidden-desktop { + display: none !important; +} +.visible-desktop { + display: inherit !important; +} +@media (min-width: 768px) and (max-width: 979px) { + .hidden-desktop { + display: inherit !important; + } + .visible-desktop { + display: none !important ; + } + .visible-tablet { + display: inherit !important; + } + .hidden-tablet { + display: none !important; + } +} +@media (max-width: 767px) { + .hidden-desktop { + display: inherit !important; + } + .visible-desktop { + display: none !important; + } + .visible-phone { + display: inherit !important; + } + .hidden-phone { + display: none !important; + } +} +@media (max-width: 767px) { + body { + padding-left: 20px; + padding-right: 20px; + } + .container { + width: auto; + } + .row, + .thumbnails { + margin-left: 0; + } +} +@media (max-width: 480px) { + .tablist-collapse { + -webkit-transform: translate3d(0, 0, 0); + } + .page-header h1 small { + display: block; + line-height: 20px; + } +} +@media (min-width: 768px) and (max-width: 979px) { + .row { + margin-left: -20px; + *zoom: 1; + } + .row:before, + .row:after { + display: table; + content: ""; + line-height: 0; + } + .row:after { + clear: both; + } + [class*="span"] { + float: left; + min-height: 1px; + margin-left: 20px; + } + .container { + width: 724px; + } +} +@media (min-width: 1200px) { + .row { + margin-left: -30px; + *zoom: 1; + } + .row:before, + .row:after { + display: table; + content: ""; + line-height: 0; + } + .row:after { + clear: both; + } + [class*="span"] { + float: left; + min-height: 1px; + margin-left: 30px; + } + .container { + width: 1070px; + } +} +@media (max-width: 979px) { + body { + padding-top: 0; + } +} +@media (min-width: 980px) { + .tablist-collapse.collapse { + height: auto !important; + overflow: visible !important; + } +} +.tablistbar .brand { + padding: 5px; + margin-left: 0; +} +.tablistbar .brand img { + width: 30px; + vertical-align: middle; +} + +h1 small { + font-size: 18px; +} + +h1 small, +h2 small, +h3 small, +h4 small, +h5 small, +h6 small, +.page-header small { + line-height: 0.8; + font-weight: normal; + color: #999999; + display:block; + vertical-align: middle; +} + +.page-header h1, h1:first-child { + font-size: 40px; + padding-bottom: 5px; +} + +.page-header h1 { + border-bottom: 1px solid #999999; + padding-bottom: 9px; +} + +.page-header img { + height: 80px; + padding-bottom: 5px; +} + +.page-header small { + line-height: 1.1; + font-size: 18px; +} + +h2, +h3, +h4, +div.ah, +.title { + border-color: #D6E9C6; + color: #468847; + border-style: solid; + border-width: 0 0 1px; + padding-left: 0.5em; +} + + +.google { + color: white; +} + +.breadcrumb { + font-size: 11px; + padding-top: 2px; + padding-bottom: 2px; +} + +h1 a, +h2 a, +h3 a, +h4 a { + color: inherit; +} + +.tablistbar-inner a { + font-weight: bold; +} + +.list-2panes:before, +.list-2panes:after { + display: table; + content: ""; + line-height: 0; +} + +.list-2panes:after { + clear:both; +} + +.list-2panes li { + width: 470px; + width: 470px; + float: left; + margin-left: 30px; + min-height: 1px; +} +/* The standard CSS for doxygen */ + +/* @group Heading Levels */ + + +dt { + font-weight: bold; +} + +div.multicol { + -moz-column-gap: 1em; + -webkit-column-gap: 1em; + -moz-column-count: 3; + -webkit-column-count: 3; +} + +p.startli, p.startdd, p.starttd { + margin-top: 2px; +} + +p.endli { + margin-bottom: 0px; +} + +p.enddd { + margin-bottom: 4px; +} + +p.endtd { + margin-bottom: 2px; +} + +/* @end */ + +caption { + font-weight: bold; +} + +span.legend { + font-size: 70%; + text-align: center; +} + +h3.version { + font-size: 90%; + text-align: center; +} + +div.qindex, div.tablisttab{ + background-color: #EBF6EB; + border: 1px solid #A3D7A3; + text-align: center; +} + +div.qindex, div.tablistpath { + width: 100%; + line-height: 140%; +} + +div.tablisttab { + margin-right: 15px; +} + +/* @group Link Styling */ + +a { + color: #3D8C3D; + font-weight: normal; + text-decoration: none; +} + +.contents a:visited { + color: #46A246; +} + +a:hover { + text-decoration: underline; +} + +a.qindex { + font-weight: bold; +} + +a.qindexHL { + font-weight: bold; + background-color: #9CD49C; + color: #ffffff; + border: 1px double #86CA86; +} + +.contents a.qindexHL:visited { + color: #ffffff; +} + +a.el { + font-weight: bold; +} + +a.elRef { +} + +a.code { + color: #4665A2; +} + +a.codeRef { + color: #4665A2; +} + +/* @end */ + +dl.el { + margin-left: -1cm; +} + +.fragment { + font-family: monospace, fixed; + font-size: 105%; +} + +pre.fragment { + border: 1px solid #C4E5C4; + background-color: #FBFDFB; + padding: 4px 6px; + margin: 4px 8px 4px 2px; + overflow: auto; + word-wrap: break-word; + font-size: 9pt; + line-height: 125%; +} + +div.groupHeader { + margin-left: 16px; + margin-top: 12px; + font-weight: bold; +} + +div.groupText { + margin-left: 16px; + font-style: italic; +} + +div.contents { + margin-top: 10px; + margin-left: 8px; + margin-right: 8px; +} + +td.indexkey { + white-space: nowrap; + vertical-align: top; +} + + +tr.memlist { + background-color: #EEF7EE; +} + +p.formulaDsp { + text-align: center; +} + +img.formulaDsp { + +} + +img.formulaInl { + vertical-align: middle; +} + +div.center { + text-align: center; + margin-top: 0px; + margin-bottom: 0px; + padding: 0px; +} + +div.center img { + border: 0px; +} + +#footer { + margin: -10px 1em 0; + padding-top: 20px; + text-align: center; + font-size: small; +} + +address.footer { + background-color: #ffffff; + text-align: center; +} + +img.footer { + border: 0px; + vertical-align: middle; +} + +/* @group Code Colorization */ + +span.keyword { + color: #008000 +} + +span.keywordtype { + color: #604020 +} + +span.keywordflow { + color: #e08000 +} + +span.comment { + color: #800000 +} + +span.preprocessor { + color: #806020 +} + +span.stringliteral { + color: #002080 +} + +span.charliteral { + color: #008080 +} + +span.vhdldigit { + color: #ff00ff +} + +span.vhdlchar { + color: #000000 +} + +span.vhdlkeyword { + color: #700070 +} + +span.vhdllogic { + color: #ff0000 +} + +/* @end */ + +/* +.search { + color: #003399; + font-weight: bold; +} + +form.search { + margin-bottom: 0px; + margin-top: 0px; +} + +input.search { + font-size: 75%; + color: #000080; + font-weight: normal; + background-color: #e8eef2; +} +*/ + +td.tiny { + font-size: 75%; +} + +.dirtab { + padding: 4px; + border-collapse: collapse; + border: 1px solid #A3D7A3; +} + +th.dirtab { + background: #EBF6EB; + font-weight: bold; +} + +hr { + height: 0px; + border: none; + border-top: 1px solid #4AAA4A; +} + +hr.footer { + height: 1px; +} + +/* @group Member Descriptions */ + +table.memberdecls { + border-spacing: 0px; + padding: 0px; +} + +.mdescLeft, .mdescRight, +.memItemLeft, .memItemRight, +.memTemplItemLeft, .memTemplItemRight, .memTemplParams { + background-color: #F9FCF9; + border: none; + margin: 4px; + padding: 1px 0 0 8px; +} + +.mdescLeft, .mdescRight { + padding: 0px 8px 4px 8px; + color: #555; +} + +.memItemLeft, .memItemRight, .memTemplParams { + border-top: 1px solid #C4E5C4; +} + +.memItemLeft, .memTemplItemLeft { + white-space: nowrap; +} + +.memItemRight { + width: 100%; +} + +.memTemplParams { + color: #46A246; + white-space: nowrap; +} + +/* @end */ + +/* @group Member Details */ + +/* Styles for detailed member documentation */ + +.memtemplate { + font-size: 80%; + color: #46A246; + font-weight: normal; + margin-left: 9px; +} + +.memnav { + background-color: #EBF6EB; + border: 1px solid #A3D7A3; + text-align: center; + margin: 2px; + margin-right: 15px; + padding: 2px; +} + +.mempage { + width: 100%; +} + +.memitem { + padding: 0; + margin-bottom: 10px; + margin-right: 5px; +} + +.memname { + white-space: nowrap; + font-weight: bold; + margin-left: 6px; +} + +.memproto, dl.reflist dt { + border-top: 1px solid #A8D9A8; + border-left: 1px solid #A8D9A8; + border-right: 1px solid #A8D9A8; + padding: 6px 0px 6px 0px; + color: #255525; + font-weight: bold; + text-shadow: 0px 1px 1px rgba(255, 255, 255, 0.9); + /* opera specific markup */ + box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); + border-top-right-radius: 8px; + border-top-left-radius: 8px; + /* firefox specific markup */ + -moz-box-shadow: rgba(0, 0, 0, 0.15) 5px 5px 5px; + -moz-border-radius-topright: 8px; + -moz-border-radius-topleft: 8px; + /* webkit specific markup */ + -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); + -webkit-border-top-right-radius: 8px; + -webkit-border-top-left-radius: 8px; + background-image:url('nav_f.png'); + background-repeat:repeat-x; + background-color: #E2F2E2; + +} + +.memdoc, dl.reflist dd { + border-bottom: 1px solid #A8D9A8; + border-left: 1px solid #A8D9A8; + border-right: 1px solid #A8D9A8; + padding: 2px 5px; + background-color: #FBFDFB; + border-top-width: 0; + /* opera specific markup */ + border-bottom-left-radius: 8px; + border-bottom-right-radius: 8px; + box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); + /* firefox specific markup */ + -moz-border-radius-bottomleft: 8px; + -moz-border-radius-bottomright: 8px; + -moz-box-shadow: rgba(0, 0, 0, 0.15) 5px 5px 5px; + background-image: -moz-linear-gradient(center top, #FFFFFF 0%, #FFFFFF 60%, #F7FBF7 95%, #EEF7EE); + /* webkit specific markup */ + -webkit-border-bottom-left-radius: 8px; + -webkit-border-bottom-right-radius: 8px; + -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); + background-image: -webkit-gradient(linear,center top,center bottom,from(#FFFFFF), color-stop(0.6,#FFFFFF), color-stop(0.60,#FFFFFF), color-stop(0.95,#F7FBF7), to(#EEF7EE)); +} + +dl.reflist dt { + padding: 5px; +} + +dl.reflist dd { + margin: 0px 0px 10px 0px; + padding: 5px; +} + +.paramkey { + text-align: right; +} + +.paramtype { + white-space: nowrap; +} + +.paramname { + color: #602020; + white-space: nowrap; +} +.paramname em { + font-style: normal; +} + +.params, .retval, .exception, .tparams { + border-spacing: 6px 2px; +} + +.params .paramname, .retval .paramname { + font-weight: bold; + vertical-align: top; +} + +.params .paramtype { + font-style: italic; + vertical-align: top; +} + +.params .paramdir { + font-family: "courier new",courier,monospace; + vertical-align: top; +} + + + + +/* @end */ + +/* @group Directory (tree) */ + +/* for the tree view */ + +.ftvtree { + font-family: sans-serif; + margin: 0px; +} + +/* these are for tree view when used as main index */ + +.directory { + font-size: 9pt; + font-weight: bold; + margin: 5px; +} + +.directory h3 { + margin: 0px; + margin-top: 1em; + font-size: 11pt; +} + +/* +The following two styles can be used to replace the root node title +with an image of your choice. Simply uncomment the next two styles, +specify the name of your image and be sure to set 'height' to the +proper pixel height of your image. +*/ + +/* +.directory h3.swap { + height: 61px; + background-repeat: no-repeat; + background-image: url("yourimage.gif"); +} +.directory h3.swap span { + display: none; +} +*/ + +.directory > h3 { + margin-top: 0; +} + +.directory p { + margin: 0px; + white-space: nowrap; +} + +.directory div { + display: none; + margin: 0px; +} + +.directory img { + vertical-align: -30%; +} + +/* these are for tree view when not used as main index */ + +.directory-alt { + font-size: 100%; + font-weight: bold; +} + +.directory-alt h3 { + margin: 0px; + margin-top: 1em; + font-size: 11pt; +} + +.directory-alt > h3 { + margin-top: 0; +} + +.directory-alt p { + margin: 0px; + white-space: nowrap; +} + +.directory-alt div { + display: none; + margin: 0px; +} + +.directory-alt img { + vertical-align: -30%; +} + +/* @end */ + +div.dynheader { + margin-top: 8px; +} + +address { + font-style: normal; + color: #2A612A; +} + +table.doxtable { + border-collapse:collapse; +} + +table.doxtable td, table.doxtable th { + border: 1px solid #2D682D; + padding: 3px 7px 2px; +} + +table.doxtable th { + background-color: #377F37; + color: #FFFFFF; + font-size: 110%; + padding-bottom: 4px; + padding-top: 5px; + text-align:left; +} + +table.fieldtable { + width: 100%; + margin-bottom: 10px; + border: 1px solid #A8D9A8; + border-spacing: 0px; + -moz-border-radius: 4px; + -webkit-border-radius: 4px; + border-radius: 4px; + -moz-box-shadow: rgba(0, 0, 0, 0.15) 2px 2px 2px; + -webkit-box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.15); + box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.15); +} + +.fieldtable td, .fieldtable th { + padding: 3px 7px 2px; +} + +.fieldtable td.fieldtype, .fieldtable td.fieldname { + white-space: nowrap; + border-right: 1px solid #A8D9A8; + border-bottom: 1px solid #A8D9A8; + vertical-align: top; +} + +.fieldtable td.fielddoc { + border-bottom: 1px solid #A8D9A8; + width: 100%; +} + +.fieldtable tr:last-child td { + border-bottom: none; +} + +.fieldtable th { + background-image:url('nav_f.png'); + background-repeat:repeat-x; + background-color: #E2F2E2; + font-size: 90%; + color: #255525; + padding-bottom: 4px; + padding-top: 5px; + text-align:left; + -moz-border-radius-topleft: 4px; + -moz-border-radius-topright: 4px; + -webkit-border-top-left-radius: 4px; + -webkit-border-top-right-radius: 4px; + border-top-left-radius: 4px; + border-top-right-radius: 4px; + border-bottom: 1px solid #A8D9A8; +} + + +.tabsearch { + top: 0px; + left: 10px; + height: 36px; + background-image: url('tab_b.png'); + z-index: 101; + overflow: hidden; + font-size: 13px; +} + +.tablistpath ul +{ + font-size: 11px; + background-image:url('tab_b.png'); + background-repeat:repeat-x; + height:30px; + line-height:30px; + color:#8ACC8A; + border:solid 1px #C2E4C2; + overflow:hidden; + margin:0px; + padding:0px; +} + +.tablistpath li +{ + list-style-type:none; + float:left; + padding-left:10px; + padding-right:15px; + background-image:url('bc_s.png'); + background-repeat:no-repeat; + background-position:right; + color:#367C36; +} + +.tablistpath li.tablistelem a +{ + height:32px; + display:block; + text-decoration: none; + outline: none; +} + +.tablistpath li.tablistelem a:hover +{ + color:#68BD68; +} + +.tablistpath li.footer +{ + list-style-type:none; + float:right; + padding-left:10px; + padding-right:15px; + background-image:none; + background-repeat:no-repeat; + background-position:right; + color:#367C36; + font-size: 8pt; +} + + +div.summary +{ + margin-top: 12px; + text-align: center; +} + +div.summary a +{ + white-space: nowrap; +} + +div.ingroups +{ + margin-left: 5px; + font-size: 8pt; + padding-left: 5px; + width: 50%; + text-align: left; +} + +div.ingroups a +{ + white-space: nowrap; +} + +div.headertitle +{ + padding: 5px 5px 5px 7px; +} + +dl +{ + padding: 0 0 0 10px; +} + +dl.note, dl.warning, dl.attention, dl.pre, dl.post, dl.invariant, dl.deprecated, dl.todo, dl.test, dl.bug +{ + border-left:4px solid; + padding: 0 0 0 6px; +} + +dl.note +{ + border-color: #D0C000; +} + +dl.warning, dl.attention +{ + border-color: #FF0000; +} + +dl.pre, dl.post, dl.invariant +{ + border-color: #00D000; +} + +dl.deprecated +{ + border-color: #505050; +} + +dl.todo +{ + border-color: #00C0E0; +} + +dl.test +{ + border-color: #3030E0; +} + +dl.bug +{ + border-color: #C08050; +} + +#projectlogo +{ + text-align: center; + vertical-align: bottom; + border-collapse: separate; +} + +#projectlogo img +{ + border: 0px none; +} + +#projectname +{ + font: 300% Tahoma, Arial,sans-serif; + margin: 0px; + padding: 2px 0px; +} + +#projectbrief +{ + font: 120% Tahoma, Arial,sans-serif; + margin: 0px; + padding: 0px; +} + +#projectnumber +{ + font: 50% Tahoma, Arial,sans-serif; + margin: 0px; + padding: 0px; +} + +#titlearea +{ + padding: 0px; + margin: 0px; + width: 100%; + border-bottom: 1px solid #53B453; +} + +.image +{ + text-align: center; +} + +.dotgraph +{ + text-align: center; +} + +.mscgraph +{ + text-align: center; +} + +.caption +{ + font-weight: bold; +} + +div.zoom +{ + border: 1px solid #90CE90; +} + +dl.citelist { + margin-bottom:50px; +} + +dl.citelist dt { + color:#337533; + float:left; + font-weight:bold; + margin-right:10px; + padding:5px; +} + +dl.citelist dd { + margin:2px 0; + padding:5px 0; +} + +@media print +{ + #top { display: none; } + #side-nav { display: none; } + #nav-path { display: none; } + body { overflow:visible; } + h1, h2, h3, h4, h5, h6 { page-break-after: avoid; } + .summary { display: none; } + .memitem { page-break-inside: avoid; } + #doc-content + { + margin-left:0 !important; + height:auto !important; + width:auto !important; + overflow:inherit; + display:inline; + } + pre.fragment + { + overflow: visible; + text-wrap: unrestricted; + white-space: -moz-pre-wrap; /* Moz */ + white-space: -pre-wrap; /* Opera 4-6 */ + white-space: -o-pre-wrap; /* Opera 7 */ + white-space: pre-wrap; /* CSS3 */ + word-wrap: break-word; /* IE 5.5+ */ + } +} + +#proj_desc { + font-size: 1.2em; +} diff --git a/project/jni/ffmpeg/doc/doxy/footer.html b/project/jni/ffmpeg/doc/doxy/footer.html new file mode 100644 index 000000000..101e6fe70 --- /dev/null +++ b/project/jni/ffmpeg/doc/doxy/footer.html @@ -0,0 +1,9 @@ + +
+ + Generated on $datetime for $projectname by doxygen $doxygenversion + +
+ + + diff --git a/project/jni/ffmpeg/doc/doxy/header.html b/project/jni/ffmpeg/doc/doxy/header.html new file mode 100644 index 000000000..312990cdb --- /dev/null +++ b/project/jni/ffmpeg/doc/doxy/header.html @@ -0,0 +1,16 @@ + + + + + +$projectname: $title +$title + + + + + +
+ + +'; + +$SMALL_RULE = ''; +$BODYTEXT = ''; + +$print_page_foot = \&FFmpeg_print_page_foot; +sub FFmpeg_print_page_foot($$) +{ + my $fh = shift; + my $program_string = defined &T2H_DEFAULT_program_string ? + T2H_DEFAULT_program_string() : program_string(); + print $fh '
' . "\n"; + print $fh '' . $program_string; + print $fh "
\n"; +} + +$float = \&FFmpeg_float; + +sub FFmpeg_float($$$$) +{ + my $text = shift; + my $float = shift; + my $caption = shift; + my $shortcaption = shift; + + my $label = ''; + if (exists($float->{'id'})) + { + $label = &$anchor($float->{'id'}); + } + my $class = ''; + my $subject = ''; + + if ($caption =~ /NOTE/) + { + $class = "alert alert-info"; + } + elsif ($caption =~ /IMPORTANT/) + { + $class = "alert alert-warning"; + } + + return '
' . "$label\n" . $text . '
'; +} + +$print_page_head = \&FFmpeg_print_page_head; +sub FFmpeg_print_page_head($$) +{ + my $fh = shift; + my $longtitle = "$Texi2HTML::THISDOC{'title_no_texi'}"; + $longtitle .= ": $Texi2HTML::NO_TEXI{'This'}" if exists $Texi2HTML::NO_TEXI{'This'}; + my $description = $DOCUMENT_DESCRIPTION; + $description = $longtitle if (!defined($description)); + $description = "" if + ($description ne ''); + $description = $Texi2HTML::THISDOC{'documentdescription'} if (defined($Texi2HTML::THISDOC{'documentdescription'})); + my $encoding = ''; + $encoding = "" if (defined($ENCODING) and ($ENCODING ne '')); + $longtitle =~ s/Documentation.*//g; + $longtitle = "FFmpeg documentation : " . $longtitle; + + print $fh < + +$Texi2HTML::THISDOC{'copying'} + + +$longtitle + +$description + + + + +$encoding +$CSS_LINES +$TEMPLATE_HEADER +EOT +} + +# declare encoding in header +$IN_ENCODING = $ENCODING = "utf-8"; + +# no navigation elements +$SECTION_NAVIGATION = 0; +# the same for texi2html 5.0 +$HEADERS = 0; + +# TOC and Chapter headings link +$TOC_LINKS = 1; + +# print the TOC where @contents is used +$INLINE_CONTENTS = 1; diff --git a/project/jni/ffmpeg/doc/tablegen.txt b/project/jni/ffmpeg/doc/tablegen.txt new file mode 100644 index 000000000..4c4f036e6 --- /dev/null +++ b/project/jni/ffmpeg/doc/tablegen.txt @@ -0,0 +1,70 @@ +Writing a table generator + +This documentation is preliminary. +Parts of the API are not good and should be changed. + +Basic concepts + +A table generator consists of two files, *_tablegen.c and *_tablegen.h. +The .h file will provide the variable declarations and initialization +code for the tables, the .c calls the initialization code and then prints +the tables as a header file using the tableprint.h helpers. +Both of these files will be compiled for the host system, so to avoid +breakage with cross-compilation neither of them may include, directly +or indirectly, config.h or avconfig.h. +This means that e.g. libavutil/mathematics.h is ok but libavutil/libm.h is not. +Due to this, the .c file or Makefile may have to provide additional defines +or stubs, though if possible this should be avoided. +In particular, CONFIG_HARDCODED_TABLES should always be defined to 0. + +The .c file + +This file should include the *_tablegen.h and tableprint.h files and +anything else it needs as long as it does not depend on config.h or +avconfig.h. +In addition to that it must contain a main() function which initializes +all tables by calling the init functions from the .h file and then prints +them. +The printing code typically looks like this: + write_fileheader(); + printf("static const uint8_t my_array[100] = {\n"); + write_uint8_t_array(my_array, 100); + printf("};\n"); + +This is the more generic form, in case you need to do something special. +Usually you should instead use the short form: + write_fileheader(); + WRITE_ARRAY("static const", uint8_t, my_array); + +write_fileheader() adds some minor things like a "this is a generated file" +comment and some standard includes. +tablegen.h defines some write functions for one- and two-dimensional arrays +for standard types - they print only the "core" parts so they are easier +to reuse for multi-dimensional arrays so the outermost {} must be printed +separately. +If there's no standard function for printing the type you need, the +WRITE_1D_FUNC_ARGV macro is a very quick way to create one. +See libavcodec/dv_tablegen.c for an example. + + +The .h file + +This file should contain: + - one or more initialization functions + - the table variable declarations +If CONFIG_HARDCODED_TABLES is set, the initialization functions should +not do anything, and instead of the variable declarations the +generated *_tables.h file should be included. +Since that will be generated in the build directory, the path must be +included, i.e. +#include "libavcodec/example_tables.h" +not +#include "example_tables.h" + +Makefile changes + +To make the automatic table creation work, you must manually declare the +new dependency. +For this add a line similar to this: +$(SUBDIR)example.o: $(SUBDIR)example_tables.h +under the "ifdef CONFIG_HARDCODED_TABLES" section in the Makefile. diff --git a/project/jni/ffmpeg/doc/texi2pod.pl b/project/jni/ffmpeg/doc/texi2pod.pl new file mode 100755 index 000000000..879056313 --- /dev/null +++ b/project/jni/ffmpeg/doc/texi2pod.pl @@ -0,0 +1,436 @@ +#! /usr/bin/perl + +# Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc. + +# This file is part of GNU CC. + +# GNU CC is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# GNU CC is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with GNU CC; see the file COPYING. If not, write to +# the Free Software Foundation, 51 Franklin Street, Fifth Floor, +# Boston, MA 02110-1301 USA + +# This does trivial (and I mean _trivial_) conversion of Texinfo +# markup to Perl POD format. It's intended to be used to extract +# something suitable for a manpage from a Texinfo document. + +use warnings; + +$output = 0; +$skipping = 0; +%chapters = (); +@chapters_sequence = (); +$chapter = ""; +@icstack = (); +@endwstack = (); +@skstack = (); +@instack = (); +$shift = ""; +%defs = (); +$fnno = 1; +$inf = ""; +@ibase = (); + +while ($_ = shift) { + if (/^-D(.*)$/) { + if ($1 ne "") { + $flag = $1; + } else { + $flag = shift; + } + $value = ""; + ($flag, $value) = ($flag =~ /^([^=]+)(?:=(.+))?/); + die "no flag specified for -D\n" + unless $flag ne ""; + die "flags may only contain letters, digits, hyphens, dashes and underscores\n" + unless $flag =~ /^[a-zA-Z0-9_-]+$/; + $defs{$flag} = $value; + } elsif (/^-I(.*)$/) { + push @ibase, $1 ne "" ? $1 : shift; + } elsif (/^-/) { + usage(); + } else { + $in = $_, next unless defined $in; + $out = $_, next unless defined $out; + usage(); + } +} + +push @ibase, "."; + +if (defined $in) { + $inf = gensym(); + open($inf, "<$in") or die "opening \"$in\": $!\n"; + push @ibase, $1 if $in =~ m|^(.+)/[^/]+$|; +} else { + $inf = \*STDIN; +} + +if (defined $out) { + open(STDOUT, ">$out") or die "opening \"$out\": $!\n"; +} + +while(defined $inf) { +INF: while(<$inf>) { + # Certain commands are discarded without further processing. + /^\@(?: + [a-z]+index # @*index: useful only in complete manual + |need # @need: useful only in printed manual + |(?:end\s+)?group # @group .. @end group: ditto + |page # @page: ditto + |node # @node: useful only in .info file + |(?:end\s+)?ifnottex # @ifnottex .. @end ifnottex: use contents + )\b/x and next; + + chomp; + + # Look for filename and title markers. + /^\@setfilename\s+([^.]+)/ and $fn = $1, next; + /^\@settitle\s+([^.]+)/ and $tl = postprocess($1), next; + + # Identify a man title but keep only the one we are interested in. + /^\@c\s+man\s+title\s+([A-Za-z0-9-]+)\s+(.+)/ and do { + if (exists $defs{$1}) { + $fn = $1; + $tl = postprocess($2); + } + next; + }; + + /^\@include\s+(.+)$/ and do { + push @instack, $inf; + $inf = gensym(); + + for (@ibase) { + open($inf, "<" . $_ . "/" . $1) and next INF; + } + die "cannot open $1: $!\n"; + }; + + /^\@chapter\s+([A-Za-z ]+)/ and do { + # close old chapter + $chapters{$chapter_name} .= postprocess($chapter) if ($chapter_name); + + # start new chapter + $chapter_name = $1, push (@chapters_sequence, $chapter_name); + $chapters{$chapter_name} = "" unless exists $chapters{$chapter_name}; + $chapter = ""; + $output = 1; + next; + }; + + /^\@bye/ and do { + # close old chapter + $chapters{$chapter_name} .= postprocess($chapter) if ($chapter_name); + last INF; + }; + + # handle variables + /^\@set\s+([a-zA-Z0-9_-]+)\s*(.*)$/ and do { + $defs{$1} = $2; + next; + }; + /^\@clear\s+([a-zA-Z0-9_-]+)/ and do { + delete $defs{$1}; + next; + }; + + next unless $output; + + # Discard comments. (Can't do it above, because then we'd never see + # @c man lines.) + /^\@c\b/ and next; + + # End-block handler goes up here because it needs to operate even + # if we are skipping. + /^\@end\s+([a-z]+)/ and do { + # Ignore @end foo, where foo is not an operation which may + # cause us to skip, if we are presently skipping. + my $ended = $1; + next if $skipping && $ended !~ /^(?:ifset|ifclear|ignore|menu|iftex|ifhtml|ifnothtml)$/; + + die "\@end $ended without \@$ended at line $.\n" unless defined $endw; + die "\@$endw ended by \@end $ended at line $.\n" unless $ended eq $endw; + + $endw = pop @endwstack; + + if ($ended =~ /^(?:ifset|ifclear|ignore|menu|iftex|ifhtml|ifnothtml)$/) { + $skipping = pop @skstack; + next; + } elsif ($ended =~ /^(?:example|smallexample|display)$/) { + $shift = ""; + $_ = ""; # need a paragraph break + } elsif ($ended =~ /^(?:itemize|enumerate|[fv]?table)$/) { + $_ = "\n=back\n"; + $ic = pop @icstack; + } else { + die "unknown command \@end $ended at line $.\n"; + } + }; + + # We must handle commands which can cause skipping even while we + # are skipping, otherwise we will not process nested conditionals + # correctly. + /^\@ifset\s+([a-zA-Z0-9_-]+)/ and do { + push @endwstack, $endw; + push @skstack, $skipping; + $endw = "ifset"; + $skipping = 1 unless exists $defs{$1}; + next; + }; + + /^\@ifclear\s+([a-zA-Z0-9_-]+)/ and do { + push @endwstack, $endw; + push @skstack, $skipping; + $endw = "ifclear"; + $skipping = 1 if exists $defs{$1}; + next; + }; + + /^\@(ignore|menu|iftex|ifhtml|ifnothtml)\b/ and do { + push @endwstack, $endw; + push @skstack, $skipping; + $endw = $1; + $skipping = $endw !~ /ifnothtml/; + next; + }; + + next if $skipping; + + # Character entities. First the ones that can be replaced by raw text + # or discarded outright: + s/\@copyright\{\}/(c)/g; + s/\@dots\{\}/.../g; + s/\@enddots\{\}/..../g; + s/\@([.!? ])/$1/g; + s/\@[:-]//g; + s/\@bullet(?:\{\})?/*/g; + s/\@TeX\{\}/TeX/g; + s/\@pounds\{\}/\#/g; + s/\@minus(?:\{\})?/-/g; + + # Now the ones that have to be replaced by special escapes + # (which will be turned back into text by unmunge()) + s/&/&/g; + s/\@\{/{/g; + s/\@\}/}/g; + s/\@\@/&at;/g; + + # Inside a verbatim block, handle @var specially. + if ($shift ne "") { + s/\@var\{([^\}]*)\}/<$1>/g; + } + + # POD doesn't interpret E<> inside a verbatim block. + if ($shift eq "") { + s//>/g; + } else { + s//>/g; + } + + # Single line command handlers. + + /^\@(?:section|unnumbered|unnumberedsec|center|heading)\s+(.+)$/ + and $_ = "\n=head2 $1\n"; + /^\@(?:subsection|subheading)\s+(.+)$/ + and $_ = "\n=head3 $1\n"; + /^\@(?:subsubsection|subsubheading)\s+(.+)$/ + and $_ = "\n=head4 $1\n"; + + # Block command handlers: + /^\@itemize\s*(\@[a-z]+|\*|-)?/ and do { + push @endwstack, $endw; + push @icstack, $ic; + $ic = $1 ? $1 : "*"; + $_ = "\n=over 4\n"; + $endw = "itemize"; + }; + + /^\@enumerate(?:\s+([a-zA-Z0-9]+))?/ and do { + push @endwstack, $endw; + push @icstack, $ic; + if (defined $1) { + $ic = $1 . "."; + } else { + $ic = "1."; + } + $_ = "\n=over 4\n"; + $endw = "enumerate"; + }; + + /^\@([fv]?table)\s+(\@[a-z]+)/ and do { + push @endwstack, $endw; + push @icstack, $ic; + $endw = $1; + $ic = $2; + $ic =~ s/\@(?:samp|strong|key|gcctabopt|option|env|command)/B/; + $ic =~ s/\@(?:code|kbd)/C/; + $ic =~ s/\@(?:dfn|var|emph|cite|i)/I/; + $ic =~ s/\@(?:file)/F/; + $_ = "\n=over 4\n"; + }; + + /^\@((?:small)?example|display)/ and do { + push @endwstack, $endw; + $endw = $1; + $shift = "\t"; + $_ = ""; # need a paragraph break + }; + + /^\@itemx?\s*(.+)?$/ and do { + if (defined $1) { + # Entity escapes prevent munging by the <> processing below. + $_ = "\n=item $ic\<$1\>\n"; + } else { + $_ = "\n=item $ic\n"; + $ic =~ y/A-Ya-y/B-Zb-z/; + $ic =~ s/(\d+)/$1 + 1/eg; + } + }; + + $chapter .= $shift.$_."\n"; +} +# End of current file. +close($inf); +$inf = pop @instack; +} + +die "No filename or title\n" unless defined $fn && defined $tl; + +$chapters{NAME} = "$fn \- $tl\n"; +$chapters{FOOTNOTES} .= "=back\n" if exists $chapters{FOOTNOTES}; + +unshift @chapters_sequence, "NAME"; +for $chapter (@chapters_sequence) { + if (exists $chapters{$chapter}) { + $head = uc($chapter); + print "=head1 $head\n\n"; + print scalar unmunge ($chapters{$chapter}); + print "\n"; + } +} + +sub usage +{ + die "usage: $0 [-D toggle...] [infile [outfile]]\n"; +} + +sub postprocess +{ + local $_ = $_[0]; + + # @value{foo} is replaced by whatever 'foo' is defined as. + while (m/(\@value\{([a-zA-Z0-9_-]+)\})/g) { + if (! exists $defs{$2}) { + print STDERR "Option $2 not defined\n"; + s/\Q$1\E//; + } else { + $value = $defs{$2}; + s/\Q$1\E/$value/; + } + } + + # Formatting commands. + # Temporary escape for @r. + s/\@r\{([^\}]*)\}/R<$1>/g; + s/\@(?:dfn|var|emph|cite|i)\{([^\}]*)\}/I<$1>/g; + s/\@(?:code|kbd)\{([^\}]*)\}/C<$1>/g; + s/\@(?:gccoptlist|samp|strong|key|option|env|command|b)\{([^\}]*)\}/B<$1>/g; + s/\@sc\{([^\}]*)\}/\U$1/g; + s/\@file\{([^\}]*)\}/F<$1>/g; + s/\@w\{([^\}]*)\}/S<$1>/g; + s/\@(?:dmn|math)\{([^\}]*)\}/$1/g; + + # Cross references are thrown away, as are @noindent and @refill. + # (@noindent is impossible in .pod, and @refill is unnecessary.) + # @* is also impossible in .pod; we discard it and any newline that + # follows it. Similarly, our macro @gol must be discarded. + + s/\@anchor{(?:[^\}]*)\}//g; + s/\(?\@xref\{(?:[^\}]*)\}(?:[^.<]|(?:<[^<>]*>))*\.\)?//g; + s/\s+\(\@pxref\{(?:[^\}]*)\}\)//g; + s/;\s+\@pxref\{(?:[^\}]*)\}//g; + s/\@ref\{([^\}]*)\}/$1/g; + s/\@noindent\s*//g; + s/\@refill//g; + s/\@gol//g; + s/\@\*\s*\n?//g; + + # @uref can take one, two, or three arguments, with different + # semantics each time. @url and @email are just like @uref with + # one argument, for our purposes. + s/\@(?:uref|url|email)\{([^\},]*),?[^\}]*\}/<B<$1>>/g; + s/\@uref\{([^\},]*),([^\},]*)\}/$2 (C<$1>)/g; + s/\@uref\{([^\},]*),([^\},]*),([^\},]*)\}/$3/g; + + # Turn B blah> into B I B to + # match Texinfo semantics of @emph inside @samp. Also handle @r + # inside bold. + s/<//g; + 1 while s/B<((?:[^<>]|I<[^<>]*>)*)R<([^>]*)>/B<$1>${2}B]*)I<([^>]+)>/B<$1>I<$2>B]*)B<([^>]+)>/I<$1>B<$2>I//g; + s/([BI])<(\s+)([^>]+)>/$2$1<$3>/g; + s/([BI])<([^>]+?)(\s+)>/$1<$2>$3/g; + + # Extract footnotes. This has to be done after all other + # processing because otherwise the regexp will choke on formatting + # inside @footnote. + while (/\@footnote/g) { + s/\@footnote\{([^\}]+)\}/[$fnno]/; + add_footnote($1, $fnno); + $fnno++; + } + + return $_; +} + +sub unmunge +{ + # Replace escaped symbols with their equivalents. + local $_ = $_[0]; + + s/</E/g; + s/>/E/g; + s/{/\{/g; + s/}/\}/g; + s/&at;/\@/g; + s/&/&/g; + return $_; +} + +sub add_footnote +{ + unless (exists $chapters{FOOTNOTES}) { + $chapters{FOOTNOTES} = "\n=over 4\n\n"; + } + + $chapters{FOOTNOTES} .= "=item $fnno.\n\n"; $fnno++; + $chapters{FOOTNOTES} .= $_[0]; + $chapters{FOOTNOTES} .= "\n\n"; +} + +# stolen from Symbol.pm +{ + my $genseq = 0; + sub gensym + { + my $name = "GEN" . $genseq++; + my $ref = \*{$name}; + delete $::{$name}; + return $ref; + } +} diff --git a/project/jni/ffmpeg/doc/viterbi.txt b/project/jni/ffmpeg/doc/viterbi.txt new file mode 100644 index 000000000..97825462c --- /dev/null +++ b/project/jni/ffmpeg/doc/viterbi.txt @@ -0,0 +1,109 @@ +This is a quick description of the viterbi aka dynamic programing +algorthm. + +Its reason for existence is that wikipedia has become very poor on +describing algorithms in a way that makes it useable for understanding +them or anything else actually. It tends now to describe the very same +algorithm under 50 different names and pages with few understandable +by even people who fully understand the algorithm and the theory behind. + +Problem description: (that is what it can solve) +assume we have a 2d table, or you could call it a graph or matrix if you +prefer + + O O O O O O O + + O O O O O O O + + O O O O O O O + + O O O O O O O + + +That table has edges connecting points from each column to the next column +and each edge has a score like: (only some edge and scores shown to keep it +readable) + + + O--5--O-----O-----O-----O-----O + 2 / 7 / \ / \ / \ / + \ / \ / \ / \ / \ / + O7-/--O--/--O--/--O--/--O--/--O + \/ \/ 1/ \/ \/ \/ \/ \/ \/ \/ + /\ /\ 2\ /\ /\ /\ /\ /\ /\ /\ + O3-/--O--/--O--/--O--/--O--/--O + / \ / \ / \ / \ / \ + 1 \ 9 \ / \ / \ / \ + O--2--O--1--O--5--O--3--O--8--O + + + +Our goal is to find a path from left to right through it which +minimizes the sum of the score of all edges. +(and of course left/right is just a convention here it could be top down too) +Similarly the minimum could be the maximum by just fliping the sign, +Example of a path with scores: + + O O O O O O O + +>---O. O O .O-2-O O O + 5. .7 . + O O-1-O O O 8 O O + . + O O O O O O-1-O---> (sum here is 24) + + +The viterbi algorthm now solves this simply column by column +For the previous column each point has a best path and a associated +score: + + O-----5 O + \ + \ + O \ 1 O + \/ + /\ + O / 2 O + / + / + O-----2 O + + +To move one column forward we just need to find the best path and associated +scores for the next column +here are some edges we could choose from: + + + O-----5--3--O + \ \8 + \ \ + O \ 1--9--O + \/ \3 + /\ \ + O / 2--1--O + / \2 + / \ + O-----2--4--O + +Finding the new best paths and scores for each point of our new column is +trivial given we know the previous column best paths and scores: + + O-----0-----8 + \ + \ + O \ 0----10 + \/ + /\ + O / 0-----3 + / \ + / \ + O 0 4 + + +the viterbi algorthm continues exactly like this column for column until the +end and then just picks the path with the best score (above that would be the +one with score 3) + + +Author: Michael niedermayer +Copyright LGPL diff --git a/project/jni/ffmpeg/dummy.c b/project/jni/ffmpeg/dummy.c deleted file mode 100644 index 824cda3cc..000000000 --- a/project/jni/ffmpeg/dummy.c +++ /dev/null @@ -1,7 +0,0 @@ - -int -SDL_main(int argc, char *argv[]) -{ - return 0; -} - diff --git a/project/jni/ffmpeg/ffmpeg-android/README b/project/jni/ffmpeg/ffmpeg-android/README deleted file mode 100644 index f616a0c2c..000000000 --- a/project/jni/ffmpeg/ffmpeg-android/README +++ /dev/null @@ -1,35 +0,0 @@ -Downloaded from: http://bambuser.com/opensource - -Toolchain setup ---------------- - -Download the Android NDK Revision 5b from -http://developer.android.com/sdk/ndk/index.html - -Extract it into a folder (e.g. your home directory, the example is -for the mac os x version): - -tar -jxvf android-ndk-r5b-darwin-x86.tar.bz2 -mv android-ndk-r5b android-ndk - - -Extracting the source ---------------------- - -The original upstream source (and the patches, if any) can be extracted -by running ./extract.sh. - -Building --------- - -To build, first set the environment variable NDK to point to the -directory where the NDK is installed: - -export NDK=~/android-ndk - -Then just call ./build.sh. - -To clean up the newly built files (removed unused files, remove libraries -with version numbers in the name), call ./clean-build.sh. - - diff --git a/project/jni/ffmpeg/ffmpeg-android/build.sh b/project/jni/ffmpeg/ffmpeg-android/build.sh deleted file mode 100755 index c17369736..000000000 --- a/project/jni/ffmpeg/ffmpeg-android/build.sh +++ /dev/null @@ -1,60 +0,0 @@ -#!/bin/bash - -if [ "$NDK" = "" ]; then - echo NDK variable not set, assuming ${HOME}/android-ndk - export NDK=${HOME}/android-ndk -fi - -SYSROOT=$NDK/platforms/android-3/arch-arm -# Expand the prebuilt/* path into the correct one -TOOLCHAIN=`echo $NDK/toolchains/arm-linux-androideabi-4.4.3/prebuilt/*-x86` -export PATH=$TOOLCHAIN/bin:$PATH - -rm -rf build/ffmpeg -mkdir -p build/ffmpeg -cd ffmpeg - -# Don't build any neon version for now -for version in armv5te armv7a; do - - DEST=../build/ffmpeg - FLAGS="--target-os=linux --cross-prefix=arm-linux-androideabi- --arch=arm" - FLAGS="$FLAGS --sysroot=$SYSROOT" -# FLAGS="$FLAGS --soname-prefix=/data/data/com.bambuser.broadcaster/lib/" - FLAGS="$FLAGS --enable-shared --disable-symver" - FLAGS="$FLAGS --enable-small --optimization-flags=-O2" - FLAGS="$FLAGS --disable-everything" - FLAGS="$FLAGS --enable-encoder=mpeg2video --enable-encoder=nellymoser" - - case "$version" in - neon) - EXTRA_CFLAGS="-march=armv7-a -mfloat-abi=softfp -mfpu=neon" - EXTRA_LDFLAGS="-Wl,--fix-cortex-a8" - # Runtime choosing neon vs non-neon requires - # renamed files - ABI="armeabi-v7a" - ;; - armv7a) - EXTRA_CFLAGS="-march=armv7-a -mfloat-abi=softfp" - EXTRA_LDFLAGS="" - ABI="armeabi-v7a" - ;; - *) - EXTRA_CFLAGS="" - EXTRA_LDFLAGS="" - ABI="armeabi" - ;; - esac - DEST="$DEST/$ABI" - FLAGS="$FLAGS --prefix=$DEST" - - mkdir -p $DEST - echo $FLAGS --extra-cflags="$EXTRA_CFLAGS" --extra-ldflags="$EXTRA_LDFLAGS" > $DEST/info.txt - ./configure $FLAGS --extra-cflags="$EXTRA_CFLAGS" --extra-ldflags="$EXTRA_LDFLAGS" | tee $DEST/configuration.txt - [ $PIPESTATUS == 0 ] || exit 1 - make clean - make -j4 || exit 1 - make install || exit 1 - -done - diff --git a/project/jni/ffmpeg/ffmpeg-android/clean-build.sh b/project/jni/ffmpeg/ffmpeg-android/clean-build.sh deleted file mode 100755 index 5f2c1aab0..000000000 --- a/project/jni/ffmpeg/ffmpeg-android/clean-build.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh - -for base in build/ffmpeg/*; do - # Remove symlinks, just keep the main versions - mv $base/lib $base/lib-orig - mkdir -p $base/lib - for i in $base/lib-orig/lib*.so; do - cp $base/lib-orig/`basename $i` $base/lib - done - rm -rf $base/lib-orig - - # Remove unnecessary stuff - rm -rf $base/share -done - diff --git a/project/jni/ffmpeg/ffmpeg-android/diffs/0001-Set-the-soname-to-be-SLIBNAME-instead-of-SLIBNAME_WI.patch b/project/jni/ffmpeg/ffmpeg-android/diffs/0001-Set-the-soname-to-be-SLIBNAME-instead-of-SLIBNAME_WI.patch deleted file mode 100644 index e7c00370d..000000000 --- a/project/jni/ffmpeg/ffmpeg-android/diffs/0001-Set-the-soname-to-be-SLIBNAME-instead-of-SLIBNAME_WI.patch +++ /dev/null @@ -1,38 +0,0 @@ -From 35a5863acf5ee7e1569e803e8471f9d5a51eacae Mon Sep 17 00:00:00 2001 -From: Martin Storsjo -Date: Fri, 9 Oct 2009 13:59:55 +0300 -Subject: [PATCH 1/3] Set the soname to be $(SLIBNAME) instead of $(SLIBNAME_WITH_MAJOR) - -Both due to the ways the android linker works, and due to the apk -builder that only includes files named *.so, we want to have the libs -named and refer to each other in the form lib.so. ---- - subdir.mak | 7 ++----- - 1 files changed, 2 insertions(+), 5 deletions(-) - -diff --git a/subdir.mak b/subdir.mak -index 8a407fe..107d37c 100644 ---- a/subdir.mak -+++ b/subdir.mak -@@ -36,16 +36,13 @@ define RULES - $(SUBDIR)%$(EXESUF): $(SUBDIR)%.o - $$(LD) $(FFLDFLAGS) -o $$@ $$^ -l$(FULLNAME) $(FFEXTRALIBS) $$(ELIBS) - --$(SUBDIR)$(SLIBNAME): $(SUBDIR)$(SLIBNAME_WITH_MAJOR) -- $(Q)cd ./$(SUBDIR) && $(LN_S) $(SLIBNAME_WITH_MAJOR) $(SLIBNAME) -- --$(SUBDIR)$(SLIBNAME_WITH_MAJOR): $(OBJS) $(SUBDIR)lib$(NAME).ver -+$(SUBDIR)$(SLIBNAME): $(OBJS) $(SUBDIR)lib$(NAME).ver - $(SLIB_CREATE_DEF_CMD) - $$(LD) $(SHFLAGS) $(FFLDFLAGS) -o $$@ $$(filter %.o,$$^) $(FFEXTRALIBS) $(EXTRAOBJS) - $(SLIB_EXTRA_CMD) - - ifdef SUBDIR --$(SUBDIR)$(SLIBNAME_WITH_MAJOR): $(DEP_LIBS) -+$(SUBDIR)$(SLIBNAME): $(DEP_LIBS) - endif - - clean:: --- -1.7.3.1 - diff --git a/project/jni/ffmpeg/ffmpeg-android/diffs/0002-Add-a-configure-parameter-for-adding-a-prefix-to-the.patch b/project/jni/ffmpeg/ffmpeg-android/diffs/0002-Add-a-configure-parameter-for-adding-a-prefix-to-the.patch deleted file mode 100644 index 851a7182b..000000000 --- a/project/jni/ffmpeg/ffmpeg-android/diffs/0002-Add-a-configure-parameter-for-adding-a-prefix-to-the.patch +++ /dev/null @@ -1,57 +0,0 @@ -From f29136842eb089a545a26064f17824f4b773b45f Mon Sep 17 00:00:00 2001 -From: Martin Storsjo -Date: Fri, 9 Oct 2009 15:24:14 +0300 -Subject: [PATCH 2/3] Add a configure parameter for adding a prefix to the soname - ---- - configure | 6 +++++- - 1 files changed, 5 insertions(+), 1 deletions(-) - -diff --git a/configure b/configure -index 2165382..98ea5c2 100755 ---- a/configure -+++ b/configure -@@ -70,6 +70,7 @@ Standard options: - --shlibdir=DIR install shared libs in DIR [PREFIX/lib] - --incdir=DIR install includes in DIR [PREFIX/include] - --mandir=DIR install man page in DIR [PREFIX/share/man] -+ --soname-prefix=PREFIX add PREFIX before the libraries soname - - Configuration options: - --disable-static do not build static libraries [no] -@@ -1110,6 +1111,7 @@ PATHS_LIST=' - mandir - prefix - shlibdir -+ soname_prefix - ' - - CMDLINE_SET=" -@@ -1544,6 +1546,7 @@ incdir_default='${prefix}/include' - libdir_default='${prefix}/lib' - mandir_default='${prefix}/share/man' - shlibdir_default="$libdir_default" -+soname_prefix_default="" - - # toolchain - ar_default="ar" -@@ -1593,7 +1596,7 @@ enable swscale - enable swscale_alpha - - # build settings --SHFLAGS='-shared -Wl,-soname,$$(@F)' -+SHFLAGS='-shared -Wl,-soname,$$(SONAME_PREFIX)$$(@F)' - FFSERVERLDFLAGS=-Wl,-E - LIBPREF="lib" - LIBSUF=".a" -@@ -3145,6 +3148,7 @@ INCDIR=\$(DESTDIR)$incdir - BINDIR=\$(DESTDIR)$bindir - DATADIR=\$(DESTDIR)$datadir - MANDIR=\$(DESTDIR)$mandir -+SONAME_PREFIX=$soname_prefix - SRC_PATH="$source_path" - SRC_PATH_BARE=$source_path - BUILD_ROOT="$PWD" --- -1.7.3.1 - diff --git a/project/jni/ffmpeg/ffmpeg-android/diffs/0003-Add-an-option-for-overriding-the-optimization-settin.patch b/project/jni/ffmpeg/ffmpeg-android/diffs/0003-Add-an-option-for-overriding-the-optimization-settin.patch deleted file mode 100644 index 00161299c..000000000 --- a/project/jni/ffmpeg/ffmpeg-android/diffs/0003-Add-an-option-for-overriding-the-optimization-settin.patch +++ /dev/null @@ -1,44 +0,0 @@ -From 792f45e9dc338240cfa4b1548bf06533baee2faa Mon Sep 17 00:00:00 2001 -From: Martin Storsjo -Date: Wed, 14 Oct 2009 18:40:10 +0300 -Subject: [PATCH 3/3] Add an option for overriding the optimization settings chosen by configure - ---- - configure | 7 +++++++ - 1 files changed, 7 insertions(+), 0 deletions(-) - -diff --git a/configure b/configure -index 98ea5c2..4416665 100755 ---- a/configure -+++ b/configure -@@ -212,6 +212,7 @@ Advanced options (experts only): - --extra-ldflags=ELDFLAGS add ELDFLAGS to LDFLAGS [$LDFLAGS] - --extra-libs=ELIBS add ELIBS [$ELIBS] - --extra-version=STRING version string suffix [] -+ --optimization-flags=FLAGS use FLAGS instead of the optimization flags chosen by other options [] - --build-suffix=SUFFIX library name suffix [] - --arch=ARCH select architecture [$arch] - --cpu=CPU select the minimum required CPU (affects -@@ -1134,6 +1135,7 @@ CMDLINE_SET=" - logfile - malloc_prefix - nm -+ optimization_flags - samples - source_path - strip -@@ -2909,6 +2911,11 @@ void ff_foo(void) {} - EOF - fi - -+if test "$optimization_flags" != ""; then -+ size_cflags="$optimization_flags" -+ speed_cflags="$optimization_flags" -+ noopt_cflags="$optimization_flags" -+fi - if enabled small; then - add_cflags $size_cflags - optimizations="small" --- -1.7.3.1 - diff --git a/project/jni/ffmpeg/ffmpeg-android/extract.sh b/project/jni/ffmpeg/ffmpeg-android/extract.sh deleted file mode 100755 index a1f373479..000000000 --- a/project/jni/ffmpeg/ffmpeg-android/extract.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -tar -zxvf ffmpeg-4f7d2fe-2010-12-16.tar.gz -for i in `find diffs -type f`; do - (cd ffmpeg && patch -p1 < ../$i) -done diff --git a/project/jni/ffmpeg/ffmpeg-android/ffmpeg-4f7d2fe-2010-12-16.tar.gz b/project/jni/ffmpeg/ffmpeg-android/ffmpeg-4f7d2fe-2010-12-16.tar.gz deleted file mode 100644 index d64408efd..000000000 Binary files a/project/jni/ffmpeg/ffmpeg-android/ffmpeg-4f7d2fe-2010-12-16.tar.gz and /dev/null differ diff --git a/project/jni/ffmpeg/ffmpeg.c b/project/jni/ffmpeg/ffmpeg.c new file mode 100644 index 000000000..e9837bf83 --- /dev/null +++ b/project/jni/ffmpeg/ffmpeg.c @@ -0,0 +1,3224 @@ +/* + * Copyright (c) 2000-2003 Fabrice Bellard + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +/** + * @file + * multimedia converter based on the FFmpeg libraries + */ + +#include "config.h" +#include +#include +#include +#include +#include +#include +#if HAVE_ISATTY +#if HAVE_IO_H +#include +#endif +#if HAVE_UNISTD_H +#include +#endif +#endif +#include "libavformat/avformat.h" +#include "libavdevice/avdevice.h" +#include "libswscale/swscale.h" +#include "libswresample/swresample.h" +#include "libavutil/opt.h" +#include "libavutil/channel_layout.h" +#include "libavutil/parseutils.h" +#include "libavutil/samplefmt.h" +#include "libavutil/colorspace.h" +#include "libavutil/fifo.h" +#include "libavutil/intreadwrite.h" +#include "libavutil/dict.h" +#include "libavutil/mathematics.h" +#include "libavutil/pixdesc.h" +#include "libavutil/avstring.h" +#include "libavutil/libm.h" +#include "libavutil/imgutils.h" +#include "libavutil/timestamp.h" +#include "libavutil/bprint.h" +#include "libavutil/time.h" +#include "libavformat/os_support.h" + +#include "libavformat/ffm.h" // not public API + +# include "libavfilter/avcodec.h" +# include "libavfilter/avfilter.h" +# include "libavfilter/avfiltergraph.h" +# include "libavfilter/buffersrc.h" +# include "libavfilter/buffersink.h" + +#if HAVE_SYS_RESOURCE_H +#include +#include +#include +#elif HAVE_GETPROCESSTIMES +#include +#endif +#if HAVE_GETPROCESSMEMORYINFO +#include +#include +#endif + +#if HAVE_SYS_SELECT_H +#include +#endif + +#if HAVE_TERMIOS_H +#include +#include +#include +#include +#elif HAVE_KBHIT +#include +#endif + +#if HAVE_PTHREADS +#include +#endif + +#include + +#include "ffmpeg.h" +#include "cmdutils.h" + +#include "libavutil/avassert.h" + +const char program_name[] = "ffmpeg"; +const int program_birth_year = 2000; + +static FILE *vstats_file; + +static void do_video_stats(OutputStream *ost, int frame_size); +static int64_t getutime(void); + +static int run_as_daemon = 0; +static int64_t video_size = 0; +static int64_t audio_size = 0; +static int64_t subtitle_size = 0; +static int64_t extra_size = 0; +static int nb_frames_dup = 0; +static int nb_frames_drop = 0; + +static int current_time; +AVIOContext *progress_avio = NULL; + +static uint8_t *subtitle_out; + +#if HAVE_PTHREADS +/* signal to input threads that they should exit; set by the main thread */ +static int transcoding_finished; +#endif + +#define DEFAULT_PASS_LOGFILENAME_PREFIX "ffmpeg2pass" + +InputStream **input_streams = NULL; +int nb_input_streams = 0; +InputFile **input_files = NULL; +int nb_input_files = 0; + +OutputStream **output_streams = NULL; +int nb_output_streams = 0; +OutputFile **output_files = NULL; +int nb_output_files = 0; + +FilterGraph **filtergraphs; +int nb_filtergraphs; + +#if HAVE_TERMIOS_H + +/* init terminal so that we can grab keys */ +static struct termios oldtty; +static int restore_tty; +#endif + + +/* sub2video hack: + Convert subtitles to video with alpha to insert them in filter graphs. + This is a temporary solution until libavfilter gets real subtitles support. + */ + + + +static void sub2video_copy_rect(uint8_t *dst, int dst_linesize, int w, int h, + AVSubtitleRect *r) +{ + uint32_t *pal, *dst2; + uint8_t *src, *src2; + int x, y; + + if (r->type != SUBTITLE_BITMAP) { + av_log(NULL, AV_LOG_WARNING, "sub2video: non-bitmap subtitle\n"); + return; + } + if (r->x < 0 || r->x + r->w > w || r->y < 0 || r->y + r->h > h) { + av_log(NULL, AV_LOG_WARNING, "sub2video: rectangle overflowing\n"); + return; + } + + dst += r->y * dst_linesize + r->x * 4; + src = r->pict.data[0]; + pal = (uint32_t *)r->pict.data[1]; + for (y = 0; y < r->h; y++) { + dst2 = (uint32_t *)dst; + src2 = src; + for (x = 0; x < r->w; x++) + *(dst2++) = pal[*(src2++)]; + dst += dst_linesize; + src += r->pict.linesize[0]; + } +} + +static void sub2video_push_ref(InputStream *ist, int64_t pts) +{ + AVFilterBufferRef *ref = ist->sub2video.ref; + int i; + + ist->sub2video.last_pts = ref->pts = pts; + for (i = 0; i < ist->nb_filters; i++) + av_buffersrc_add_ref(ist->filters[i]->filter, + avfilter_ref_buffer(ref, ~0), + AV_BUFFERSRC_FLAG_NO_CHECK_FORMAT | + AV_BUFFERSRC_FLAG_NO_COPY | + AV_BUFFERSRC_FLAG_PUSH); +} + +static void sub2video_update(InputStream *ist, AVSubtitle *sub) +{ + int w = ist->sub2video.w, h = ist->sub2video.h; + AVFilterBufferRef *ref = ist->sub2video.ref; + int8_t *dst; + int dst_linesize; + int num_rects, i; + int64_t pts, end_pts; + + if (!ref) + return; + if (sub) { + pts = av_rescale_q(sub->pts + sub->start_display_time * 1000, + AV_TIME_BASE_Q, ist->st->time_base); + end_pts = av_rescale_q(sub->pts + sub->end_display_time * 1000, + AV_TIME_BASE_Q, ist->st->time_base); + num_rects = sub->num_rects; + } else { + pts = ist->sub2video.end_pts; + end_pts = INT64_MAX; + num_rects = 0; + } + dst = ref->data [0]; + dst_linesize = ref->linesize[0]; + memset(dst, 0, h * dst_linesize); + for (i = 0; i < num_rects; i++) + sub2video_copy_rect(dst, dst_linesize, w, h, sub->rects[i]); + sub2video_push_ref(ist, pts); + ist->sub2video.end_pts = end_pts; +} + +static void sub2video_heartbeat(InputStream *ist, int64_t pts) +{ + InputFile *infile = input_files[ist->file_index]; + int i, j, nb_reqs; + int64_t pts2; + + /* When a frame is read from a file, examine all sub2video streams in + the same file and send the sub2video frame again. Otherwise, decoded + video frames could be accumulating in the filter graph while a filter + (possibly overlay) is desperately waiting for a subtitle frame. */ + for (i = 0; i < infile->nb_streams; i++) { + InputStream *ist2 = input_streams[infile->ist_index + i]; + if (!ist2->sub2video.ref) + continue; + /* subtitles seem to be usually muxed ahead of other streams; + if not, substracting a larger time here is necessary */ + pts2 = av_rescale_q(pts, ist->st->time_base, ist2->st->time_base) - 1; + /* do not send the heartbeat frame if the subtitle is already ahead */ + if (pts2 <= ist2->sub2video.last_pts) + continue; + if (pts2 >= ist2->sub2video.end_pts) + sub2video_update(ist2, NULL); + for (j = 0, nb_reqs = 0; j < ist2->nb_filters; j++) + nb_reqs += av_buffersrc_get_nb_failed_requests(ist2->filters[j]->filter); + if (nb_reqs) + sub2video_push_ref(ist2, pts2); + } +} + +static void sub2video_flush(InputStream *ist) +{ + int i; + + for (i = 0; i < ist->nb_filters; i++) + av_buffersrc_add_ref(ist->filters[i]->filter, NULL, 0); +} + +/* end of sub2video hack */ + +void term_exit(void) +{ + av_log(NULL, AV_LOG_QUIET, "%s", ""); +#if HAVE_TERMIOS_H + if(restore_tty) + tcsetattr (0, TCSANOW, &oldtty); +#endif +} + +static volatile int received_sigterm = 0; +static volatile int received_nb_signals = 0; + +static void +sigterm_handler(int sig) +{ + received_sigterm = sig; + received_nb_signals++; + term_exit(); + if(received_nb_signals > 3) + exit(123); +} + +void term_init(void) +{ +#if HAVE_TERMIOS_H + if(!run_as_daemon){ + struct termios tty; + int istty = 1; +#if HAVE_ISATTY + istty = isatty(0) && isatty(2); +#endif + if (istty && tcgetattr (0, &tty) == 0) { + oldtty = tty; + restore_tty = 1; + atexit(term_exit); + + tty.c_iflag &= ~(IGNBRK|BRKINT|PARMRK|ISTRIP + |INLCR|IGNCR|ICRNL|IXON); + tty.c_oflag |= OPOST; + tty.c_lflag &= ~(ECHO|ECHONL|ICANON|IEXTEN); + tty.c_cflag &= ~(CSIZE|PARENB); + tty.c_cflag |= CS8; + tty.c_cc[VMIN] = 1; + tty.c_cc[VTIME] = 0; + + tcsetattr (0, TCSANOW, &tty); + } + signal(SIGQUIT, sigterm_handler); /* Quit (POSIX). */ + } +#endif + avformat_network_deinit(); + + signal(SIGINT , sigterm_handler); /* Interrupt (ANSI). */ + signal(SIGTERM, sigterm_handler); /* Termination (ANSI). */ +#ifdef SIGXCPU + signal(SIGXCPU, sigterm_handler); +#endif +} + +/* read a key without blocking */ +static int read_key(void) +{ + unsigned char ch; +#if HAVE_TERMIOS_H + int n = 1; + struct timeval tv; + fd_set rfds; + + FD_ZERO(&rfds); + FD_SET(0, &rfds); + tv.tv_sec = 0; + tv.tv_usec = 0; + n = select(1, &rfds, NULL, NULL, &tv); + if (n > 0) { + n = read(0, &ch, 1); + if (n == 1) + return ch; + + return n; + } +#elif HAVE_KBHIT +# if HAVE_PEEKNAMEDPIPE + static int is_pipe; + static HANDLE input_handle; + DWORD dw, nchars; + if(!input_handle){ + input_handle = GetStdHandle(STD_INPUT_HANDLE); + is_pipe = !GetConsoleMode(input_handle, &dw); + } + + if (stdin->_cnt > 0) { + read(0, &ch, 1); + return ch; + } + if (is_pipe) { + /* When running under a GUI, you will end here. */ + if (!PeekNamedPipe(input_handle, NULL, 0, NULL, &nchars, NULL)) { + // input pipe may have been closed by the program that ran ffmpeg + return -1; + } + //Read it + if(nchars != 0) { + read(0, &ch, 1); + return ch; + }else{ + return -1; + } + } +# endif + if(kbhit()) + return(getch()); +#endif + return -1; +} + +static int decode_interrupt_cb(void *ctx) +{ + return received_nb_signals > 1; +} + +const AVIOInterruptCB int_cb = { decode_interrupt_cb, NULL }; + +static void exit_program(void) +{ + int i, j; + + for (i = 0; i < nb_filtergraphs; i++) { + avfilter_graph_free(&filtergraphs[i]->graph); + for (j = 0; j < filtergraphs[i]->nb_inputs; j++) { + av_freep(&filtergraphs[i]->inputs[j]->name); + av_freep(&filtergraphs[i]->inputs[j]); + } + av_freep(&filtergraphs[i]->inputs); + for (j = 0; j < filtergraphs[i]->nb_outputs; j++) { + av_freep(&filtergraphs[i]->outputs[j]->name); + av_freep(&filtergraphs[i]->outputs[j]); + } + av_freep(&filtergraphs[i]->outputs); + av_freep(&filtergraphs[i]); + } + av_freep(&filtergraphs); + + av_freep(&subtitle_out); + + /* close files */ + for (i = 0; i < nb_output_files; i++) { + AVFormatContext *s = output_files[i]->ctx; + if (!(s->oformat->flags & AVFMT_NOFILE) && s->pb) + avio_close(s->pb); + avformat_free_context(s); + av_dict_free(&output_files[i]->opts); + av_freep(&output_files[i]); + } + for (i = 0; i < nb_output_streams; i++) { + AVBitStreamFilterContext *bsfc = output_streams[i]->bitstream_filters; + while (bsfc) { + AVBitStreamFilterContext *next = bsfc->next; + av_bitstream_filter_close(bsfc); + bsfc = next; + } + output_streams[i]->bitstream_filters = NULL; + avcodec_free_frame(&output_streams[i]->filtered_frame); + + av_freep(&output_streams[i]->forced_keyframes); + av_freep(&output_streams[i]->avfilter); + av_freep(&output_streams[i]->logfile_prefix); + av_freep(&output_streams[i]); + } + for (i = 0; i < nb_input_files; i++) { + avformat_close_input(&input_files[i]->ctx); + av_freep(&input_files[i]); + } + for (i = 0; i < nb_input_streams; i++) { + avcodec_free_frame(&input_streams[i]->decoded_frame); + av_dict_free(&input_streams[i]->opts); + free_buffer_pool(&input_streams[i]->buffer_pool); + avfilter_unref_bufferp(&input_streams[i]->sub2video.ref); + av_freep(&input_streams[i]->filters); + av_freep(&input_streams[i]); + } + + if (vstats_file) + fclose(vstats_file); + av_free(vstats_filename); + + av_freep(&input_streams); + av_freep(&input_files); + av_freep(&output_streams); + av_freep(&output_files); + + uninit_opts(); + + avfilter_uninit(); + avformat_network_deinit(); + + if (received_sigterm) { + av_log(NULL, AV_LOG_INFO, "Received signal %d: terminating.\n", + (int) received_sigterm); + } +} + +void assert_avoptions(AVDictionary *m) +{ + AVDictionaryEntry *t; + if ((t = av_dict_get(m, "", NULL, AV_DICT_IGNORE_SUFFIX))) { + av_log(NULL, AV_LOG_FATAL, "Option %s not found.\n", t->key); + exit(1); + } +} + +static void abort_codec_experimental(AVCodec *c, int encoder) +{ + exit(1); +} + +static void update_benchmark(const char *fmt, ...) +{ + if (do_benchmark_all) { + int64_t t = getutime(); + va_list va; + char buf[1024]; + + if (fmt) { + va_start(va, fmt); + vsnprintf(buf, sizeof(buf), fmt, va); + va_end(va); + printf("bench: %8"PRIu64" %s \n", t - current_time, buf); + } + current_time = t; + } +} + +static void write_frame(AVFormatContext *s, AVPacket *pkt, OutputStream *ost) +{ + AVBitStreamFilterContext *bsfc = ost->bitstream_filters; + AVCodecContext *avctx = ost->st->codec; + int ret; + + if ((avctx->codec_type == AVMEDIA_TYPE_VIDEO && video_sync_method == VSYNC_DROP) || + (avctx->codec_type == AVMEDIA_TYPE_AUDIO && audio_sync_method < 0)) + pkt->pts = pkt->dts = AV_NOPTS_VALUE; + + if ((avctx->codec_type == AVMEDIA_TYPE_AUDIO || avctx->codec_type == AVMEDIA_TYPE_VIDEO) && pkt->dts != AV_NOPTS_VALUE) { + int64_t max = ost->st->cur_dts + !(s->oformat->flags & AVFMT_TS_NONSTRICT); + if (ost->st->cur_dts && ost->st->cur_dts != AV_NOPTS_VALUE && max > pkt->dts) { + av_log(s, max - pkt->dts > 2 || avctx->codec_type == AVMEDIA_TYPE_VIDEO ? AV_LOG_WARNING : AV_LOG_DEBUG, + "st:%d PTS: %"PRId64" DTS: %"PRId64" < %"PRId64" invalid, clipping\n", pkt->stream_index, pkt->pts, pkt->dts, max); + if(pkt->pts >= pkt->dts) + pkt->pts = FFMAX(pkt->pts, max); + pkt->dts = max; + } + } + + /* + * Audio encoders may split the packets -- #frames in != #packets out. + * But there is no reordering, so we can limit the number of output packets + * by simply dropping them here. + * Counting encoded video frames needs to be done separately because of + * reordering, see do_video_out() + */ + if (!(avctx->codec_type == AVMEDIA_TYPE_VIDEO && avctx->codec)) { + if (ost->frame_number >= ost->max_frames) { + av_free_packet(pkt); + return; + } + ost->frame_number++; + } + + while (bsfc) { + AVPacket new_pkt = *pkt; + int a = av_bitstream_filter_filter(bsfc, avctx, NULL, + &new_pkt.data, &new_pkt.size, + pkt->data, pkt->size, + pkt->flags & AV_PKT_FLAG_KEY); + if(a == 0 && new_pkt.data != pkt->data && new_pkt.destruct) { + uint8_t *t = av_malloc(new_pkt.size + FF_INPUT_BUFFER_PADDING_SIZE); //the new should be a subset of the old so cannot overflow + if(t) { + memcpy(t, new_pkt.data, new_pkt.size); + memset(t + new_pkt.size, 0, FF_INPUT_BUFFER_PADDING_SIZE); + new_pkt.data = t; + a = 1; + } else + a = AVERROR(ENOMEM); + } + if (a > 0) { + av_free_packet(pkt); + new_pkt.destruct = av_destruct_packet; + } else if (a < 0) { + av_log(NULL, AV_LOG_ERROR, "Failed to open bitstream filter %s for stream %d with codec %s", + bsfc->filter->name, pkt->stream_index, + avctx->codec ? avctx->codec->name : "copy"); + print_error("", a); + if (exit_on_error) + exit(1); + } + *pkt = new_pkt; + + bsfc = bsfc->next; + } + + pkt->stream_index = ost->index; + + if (debug_ts) { + av_log(NULL, AV_LOG_INFO, "muxer <- type:%s " + "pkt_pts:%s pkt_pts_time:%s pkt_dts:%s pkt_dts_time:%s size:%d\n", + av_get_media_type_string(ost->st->codec->codec_type), + av_ts2str(pkt->pts), av_ts2timestr(pkt->pts, &ost->st->time_base), + av_ts2str(pkt->dts), av_ts2timestr(pkt->dts, &ost->st->time_base), + pkt->size + ); + } + + ret = av_interleaved_write_frame(s, pkt); + if (ret < 0) { + print_error("av_interleaved_write_frame()", ret); + exit(1); + } +} + +static void close_output_stream(OutputStream *ost) +{ + OutputFile *of = output_files[ost->file_index]; + + ost->finished = 1; + if (of->shortest) { + int64_t end = av_rescale_q(ost->sync_opts - ost->first_pts, ost->st->codec->time_base, AV_TIME_BASE_Q); + of->recording_time = FFMIN(of->recording_time, end); + } +} + +static int check_recording_time(OutputStream *ost) +{ + OutputFile *of = output_files[ost->file_index]; + + if (of->recording_time != INT64_MAX && + av_compare_ts(ost->sync_opts - ost->first_pts, ost->st->codec->time_base, of->recording_time, + AV_TIME_BASE_Q) >= 0) { + close_output_stream(ost); + return 0; + } + return 1; +} + +static void do_audio_out(AVFormatContext *s, OutputStream *ost, + AVFrame *frame) +{ + AVCodecContext *enc = ost->st->codec; + AVPacket pkt; + int got_packet = 0; + + av_init_packet(&pkt); + pkt.data = NULL; + pkt.size = 0; + + if (!check_recording_time(ost)) + return; + + if (frame->pts == AV_NOPTS_VALUE || audio_sync_method < 0) + frame->pts = ost->sync_opts; + ost->sync_opts = frame->pts + frame->nb_samples; + + av_assert0(pkt.size || !pkt.data); + update_benchmark(NULL); + if (avcodec_encode_audio2(enc, &pkt, frame, &got_packet) < 0) { + av_log(NULL, AV_LOG_FATAL, "Audio encoding failed (avcodec_encode_audio2)\n"); + exit(1); + } + update_benchmark("encode_audio %d.%d", ost->file_index, ost->index); + + if (got_packet) { + if (pkt.pts != AV_NOPTS_VALUE) + pkt.pts = av_rescale_q(pkt.pts, enc->time_base, ost->st->time_base); + if (pkt.dts != AV_NOPTS_VALUE) + pkt.dts = av_rescale_q(pkt.dts, enc->time_base, ost->st->time_base); + if (pkt.duration > 0) + pkt.duration = av_rescale_q(pkt.duration, enc->time_base, ost->st->time_base); + + if (debug_ts) { + av_log(NULL, AV_LOG_INFO, "encoder -> type:audio " + "pkt_pts:%s pkt_pts_time:%s pkt_dts:%s pkt_dts_time:%s\n", + av_ts2str(pkt.pts), av_ts2timestr(pkt.pts, &ost->st->time_base), + av_ts2str(pkt.dts), av_ts2timestr(pkt.dts, &ost->st->time_base)); + } + + audio_size += pkt.size; + write_frame(s, &pkt, ost); + + av_free_packet(&pkt); + } +} + +static void pre_process_video_frame(InputStream *ist, AVPicture *picture, void **bufp) +{ + AVCodecContext *dec; + AVPicture *picture2; + AVPicture picture_tmp; + uint8_t *buf = 0; + + dec = ist->st->codec; + + /* deinterlace : must be done before any resize */ + if (do_deinterlace) { + int size; + + /* create temporary picture */ + size = avpicture_get_size(dec->pix_fmt, dec->width, dec->height); + if (size < 0) + return; + buf = av_malloc(size); + if (!buf) + return; + + picture2 = &picture_tmp; + avpicture_fill(picture2, buf, dec->pix_fmt, dec->width, dec->height); + + if (avpicture_deinterlace(picture2, picture, + dec->pix_fmt, dec->width, dec->height) < 0) { + /* if error, do not deinterlace */ + av_log(NULL, AV_LOG_WARNING, "Deinterlacing failed\n"); + av_free(buf); + buf = NULL; + picture2 = picture; + } + } else { + picture2 = picture; + } + + if (picture != picture2) + *picture = *picture2; + *bufp = buf; +} + +static void do_subtitle_out(AVFormatContext *s, + OutputStream *ost, + InputStream *ist, + AVSubtitle *sub) +{ + int subtitle_out_max_size = 1024 * 1024; + int subtitle_out_size, nb, i; + AVCodecContext *enc; + AVPacket pkt; + int64_t pts; + + if (sub->pts == AV_NOPTS_VALUE) { + av_log(NULL, AV_LOG_ERROR, "Subtitle packets must have a pts\n"); + if (exit_on_error) + exit(1); + return; + } + + enc = ost->st->codec; + + if (!subtitle_out) { + subtitle_out = av_malloc(subtitle_out_max_size); + } + + /* Note: DVB subtitle need one packet to draw them and one other + packet to clear them */ + /* XXX: signal it in the codec context ? */ + if (enc->codec_id == AV_CODEC_ID_DVB_SUBTITLE) + nb = 2; + else + nb = 1; + + /* shift timestamp to honor -ss and make check_recording_time() work with -t */ + pts = sub->pts - output_files[ost->file_index]->start_time; + for (i = 0; i < nb; i++) { + ost->sync_opts = av_rescale_q(pts, AV_TIME_BASE_Q, enc->time_base); + if (!check_recording_time(ost)) + return; + + sub->pts = pts; + // start_display_time is required to be 0 + sub->pts += av_rescale_q(sub->start_display_time, (AVRational){ 1, 1000 }, AV_TIME_BASE_Q); + sub->end_display_time -= sub->start_display_time; + sub->start_display_time = 0; + if (i == 1) + sub->num_rects = 0; + subtitle_out_size = avcodec_encode_subtitle(enc, subtitle_out, + subtitle_out_max_size, sub); + if (subtitle_out_size < 0) { + av_log(NULL, AV_LOG_FATAL, "Subtitle encoding failed\n"); + exit(1); + } + + av_init_packet(&pkt); + pkt.data = subtitle_out; + pkt.size = subtitle_out_size; + pkt.pts = av_rescale_q(sub->pts, AV_TIME_BASE_Q, ost->st->time_base); + pkt.duration = av_rescale_q(sub->end_display_time, (AVRational){ 1, 1000 }, ost->st->time_base); + if (enc->codec_id == AV_CODEC_ID_DVB_SUBTITLE) { + /* XXX: the pts correction is handled here. Maybe handling + it in the codec would be better */ + if (i == 0) + pkt.pts += 90 * sub->start_display_time; + else + pkt.pts += 90 * sub->end_display_time; + } + subtitle_size += pkt.size; + write_frame(s, &pkt, ost); + } +} + +static void do_video_out(AVFormatContext *s, + OutputStream *ost, + AVFrame *in_picture) +{ + int ret, format_video_sync; + AVPacket pkt; + AVCodecContext *enc = ost->st->codec; + int nb_frames, i; + double sync_ipts, delta; + double duration = 0; + int frame_size = 0; + InputStream *ist = NULL; + + if (ost->source_index >= 0) + ist = input_streams[ost->source_index]; + + if(ist && ist->st->start_time != AV_NOPTS_VALUE && ist->st->first_dts != AV_NOPTS_VALUE && ost->frame_rate.num) + duration = 1/(av_q2d(ost->frame_rate) * av_q2d(enc->time_base)); + + sync_ipts = in_picture->pts; + delta = sync_ipts - ost->sync_opts + duration; + + /* by default, we output a single frame */ + nb_frames = 1; + + format_video_sync = video_sync_method; + if (format_video_sync == VSYNC_AUTO) + format_video_sync = (s->oformat->flags & AVFMT_VARIABLE_FPS) ? ((s->oformat->flags & AVFMT_NOTIMESTAMPS) ? VSYNC_PASSTHROUGH : VSYNC_VFR) : VSYNC_CFR; + + switch (format_video_sync) { + case VSYNC_CFR: + // FIXME set to 0.5 after we fix some dts/pts bugs like in avidec.c + if (delta < -1.1) + nb_frames = 0; + else if (delta > 1.1) + nb_frames = lrintf(delta); + break; + case VSYNC_VFR: + if (delta <= -0.6) + nb_frames = 0; + else if (delta > 0.6) + ost->sync_opts = lrint(sync_ipts); + break; + case VSYNC_DROP: + case VSYNC_PASSTHROUGH: + ost->sync_opts = lrint(sync_ipts); + break; + default: + av_assert0(0); + } + + nb_frames = FFMIN(nb_frames, ost->max_frames - ost->frame_number); + if (nb_frames == 0) { + nb_frames_drop++; + av_log(NULL, AV_LOG_VERBOSE, "*** drop!\n"); + return; + } else if (nb_frames > 1) { + if (nb_frames > dts_error_threshold * 30) { + av_log(NULL, AV_LOG_ERROR, "%d frame duplication too large, skipping\n", nb_frames - 1); + nb_frames_drop++; + return; + } + nb_frames_dup += nb_frames - 1; + av_log(NULL, AV_LOG_VERBOSE, "*** %d dup!\n", nb_frames - 1); + } + + /* duplicates frame if needed */ + for (i = 0; i < nb_frames; i++) { + av_init_packet(&pkt); + pkt.data = NULL; + pkt.size = 0; + + in_picture->pts = ost->sync_opts; + + if (!check_recording_time(ost)) + return; + + if (s->oformat->flags & AVFMT_RAWPICTURE && + enc->codec->id == AV_CODEC_ID_RAWVIDEO) { + /* raw pictures are written as AVPicture structure to + avoid any copies. We support temporarily the older + method. */ + enc->coded_frame->interlaced_frame = in_picture->interlaced_frame; + enc->coded_frame->top_field_first = in_picture->top_field_first; + if (enc->coded_frame->interlaced_frame) + enc->field_order = enc->coded_frame->top_field_first ? AV_FIELD_TB:AV_FIELD_BT; + else + enc->field_order = AV_FIELD_PROGRESSIVE; + pkt.data = (uint8_t *)in_picture; + pkt.size = sizeof(AVPicture); + pkt.pts = av_rescale_q(in_picture->pts, enc->time_base, ost->st->time_base); + pkt.flags |= AV_PKT_FLAG_KEY; + + video_size += pkt.size; + write_frame(s, &pkt, ost); + } else { + int got_packet; + AVFrame big_picture; + + big_picture = *in_picture; + /* better than nothing: use input picture interlaced + settings */ + big_picture.interlaced_frame = in_picture->interlaced_frame; + if (ost->st->codec->flags & (CODEC_FLAG_INTERLACED_DCT|CODEC_FLAG_INTERLACED_ME)) { + if (ost->top_field_first == -1) + big_picture.top_field_first = in_picture->top_field_first; + else + big_picture.top_field_first = !!ost->top_field_first; + } + + if (big_picture.interlaced_frame) { + if (enc->codec->id == AV_CODEC_ID_MJPEG) + enc->field_order = big_picture.top_field_first ? AV_FIELD_TT:AV_FIELD_BB; + else + enc->field_order = big_picture.top_field_first ? AV_FIELD_TB:AV_FIELD_BT; + } else + enc->field_order = AV_FIELD_PROGRESSIVE; + + big_picture.quality = ost->st->codec->global_quality; + if (!enc->me_threshold) + big_picture.pict_type = 0; + if (ost->forced_kf_index < ost->forced_kf_count && + big_picture.pts >= ost->forced_kf_pts[ost->forced_kf_index]) { + big_picture.pict_type = AV_PICTURE_TYPE_I; + ost->forced_kf_index++; + } + update_benchmark(NULL); + ret = avcodec_encode_video2(enc, &pkt, &big_picture, &got_packet); + update_benchmark("encode_video %d.%d", ost->file_index, ost->index); + if (ret < 0) { + av_log(NULL, AV_LOG_FATAL, "Video encoding failed\n"); + exit(1); + } + + if (got_packet) { + if (pkt.pts == AV_NOPTS_VALUE && !(enc->codec->capabilities & CODEC_CAP_DELAY)) + pkt.pts = ost->sync_opts; + + if (pkt.pts != AV_NOPTS_VALUE) + pkt.pts = av_rescale_q(pkt.pts, enc->time_base, ost->st->time_base); + if (pkt.dts != AV_NOPTS_VALUE) + pkt.dts = av_rescale_q(pkt.dts, enc->time_base, ost->st->time_base); + + if (debug_ts) { + av_log(NULL, AV_LOG_INFO, "encoder -> type:video " + "pkt_pts:%s pkt_pts_time:%s pkt_dts:%s pkt_dts_time:%s\n", + av_ts2str(pkt.pts), av_ts2timestr(pkt.pts, &ost->st->time_base), + av_ts2str(pkt.dts), av_ts2timestr(pkt.dts, &ost->st->time_base)); + } + + frame_size = pkt.size; + video_size += pkt.size; + write_frame(s, &pkt, ost); + av_free_packet(&pkt); + + /* if two pass, output log */ + if (ost->logfile && enc->stats_out) { + fprintf(ost->logfile, "%s", enc->stats_out); + } + } + } + ost->sync_opts++; + /* + * For video, number of frames in == number of packets out. + * But there may be reordering, so we can't throw away frames on encoder + * flush, we need to limit them here, before they go into encoder. + */ + ost->frame_number++; + } + + if (vstats_filename && frame_size) + do_video_stats(ost, frame_size); +} + +static double psnr(double d) +{ + return -10.0 * log(d) / log(10.0); +} + +static void do_video_stats(OutputStream *ost, int frame_size) +{ + AVCodecContext *enc; + int frame_number; + double ti1, bitrate, avg_bitrate; + + /* this is executed just the first time do_video_stats is called */ + if (!vstats_file) { + vstats_file = fopen(vstats_filename, "w"); + if (!vstats_file) { + perror("fopen"); + exit(1); + } + } + + enc = ost->st->codec; + if (enc->codec_type == AVMEDIA_TYPE_VIDEO) { + frame_number = ost->st->nb_frames; + fprintf(vstats_file, "frame= %5d q= %2.1f ", frame_number, enc->coded_frame->quality / (float)FF_QP2LAMBDA); + if (enc->flags&CODEC_FLAG_PSNR) + fprintf(vstats_file, "PSNR= %6.2f ", psnr(enc->coded_frame->error[0] / (enc->width * enc->height * 255.0 * 255.0))); + + fprintf(vstats_file,"f_size= %6d ", frame_size); + /* compute pts value */ + ti1 = ost->st->pts.val * av_q2d(enc->time_base); + if (ti1 < 0.01) + ti1 = 0.01; + + bitrate = (frame_size * 8) / av_q2d(enc->time_base) / 1000.0; + avg_bitrate = (double)(video_size * 8) / ti1 / 1000.0; + fprintf(vstats_file, "s_size= %8.0fkB time= %0.3f br= %7.1fkbits/s avg_br= %7.1fkbits/s ", + (double)video_size / 1024, ti1, bitrate, avg_bitrate); + fprintf(vstats_file, "type= %c\n", av_get_picture_type_char(enc->coded_frame->pict_type)); + } +} + +/** + * Get and encode new output from any of the filtergraphs, without causing + * activity. + * + * @return 0 for success, <0 for severe errors + */ +static int reap_filters(void) +{ + AVFilterBufferRef *picref; + AVFrame *filtered_frame = NULL; + int i; + int64_t frame_pts; + + /* Reap all buffers present in the buffer sinks */ + for (i = 0; i < nb_output_streams; i++) { + OutputStream *ost = output_streams[i]; + OutputFile *of = output_files[ost->file_index]; + int ret = 0; + + if (!ost->filter) + continue; + + if (!ost->filtered_frame && !(ost->filtered_frame = avcodec_alloc_frame())) { + return AVERROR(ENOMEM); + } else + avcodec_get_frame_defaults(ost->filtered_frame); + filtered_frame = ost->filtered_frame; + + while (1) { + ret = av_buffersink_get_buffer_ref(ost->filter->filter, &picref, + AV_BUFFERSINK_FLAG_NO_REQUEST); + if (ret < 0) { + if (ret != AVERROR(EAGAIN) && ret != AVERROR_EOF) { + char buf[256]; + av_strerror(ret, buf, sizeof(buf)); + av_log(NULL, AV_LOG_WARNING, + "Error in av_buffersink_get_buffer_ref(): %s\n", buf); + } + break; + } + frame_pts = AV_NOPTS_VALUE; + if (picref->pts != AV_NOPTS_VALUE) { + filtered_frame->pts = frame_pts = av_rescale_q(picref->pts, + ost->filter->filter->inputs[0]->time_base, + ost->st->codec->time_base) - + av_rescale_q(of->start_time, + AV_TIME_BASE_Q, + ost->st->codec->time_base); + + if (of->start_time && filtered_frame->pts < 0) { + avfilter_unref_buffer(picref); + continue; + } + } + //if (ost->source_index >= 0) + // *filtered_frame= *input_streams[ost->source_index]->decoded_frame; //for me_threshold + + + switch (ost->filter->filter->inputs[0]->type) { + case AVMEDIA_TYPE_VIDEO: + avfilter_copy_buf_props(filtered_frame, picref); + filtered_frame->pts = frame_pts; + if (!ost->frame_aspect_ratio) + ost->st->codec->sample_aspect_ratio = picref->video->sample_aspect_ratio; + + do_video_out(of->ctx, ost, filtered_frame); + break; + case AVMEDIA_TYPE_AUDIO: + avfilter_copy_buf_props(filtered_frame, picref); + filtered_frame->pts = frame_pts; + do_audio_out(of->ctx, ost, filtered_frame); + break; + default: + // TODO support subtitle filters + av_assert0(0); + } + + avfilter_unref_buffer(picref); + } + } + + return 0; +} + +static void print_report(int is_last_report, int64_t timer_start, int64_t cur_time) +{ + char buf[1024]; + AVBPrint buf_script; + OutputStream *ost; + AVFormatContext *oc; + int64_t total_size; + AVCodecContext *enc; + int frame_number, vid, i; + double bitrate; + int64_t pts = INT64_MIN; + static int64_t last_time = -1; + static int qp_histogram[52]; + int hours, mins, secs, us; + + if (!print_stats && !is_last_report && !progress_avio) + return; + + if (!is_last_report) { + if (last_time == -1) { + last_time = cur_time; + return; + } + if ((cur_time - last_time) < 500000) + return; + last_time = cur_time; + } + + + oc = output_files[0]->ctx; + + total_size = avio_size(oc->pb); + if (total_size <= 0) // FIXME improve avio_size() so it works with non seekable output too + total_size = avio_tell(oc->pb); + + buf[0] = '\0'; + vid = 0; + av_bprint_init(&buf_script, 0, 1); + for (i = 0; i < nb_output_streams; i++) { + float q = -1; + ost = output_streams[i]; + enc = ost->st->codec; + if (!ost->stream_copy && enc->coded_frame) + q = enc->coded_frame->quality / (float)FF_QP2LAMBDA; + if (vid && enc->codec_type == AVMEDIA_TYPE_VIDEO) { + snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), "q=%2.1f ", q); + av_bprintf(&buf_script, "stream_%d_%d_q=%.1f\n", + ost->file_index, ost->index, q); + } + if (!vid && enc->codec_type == AVMEDIA_TYPE_VIDEO) { + float fps, t = (cur_time-timer_start) / 1000000.0; + + frame_number = ost->frame_number; + fps = t > 1 ? frame_number / t : 0; + snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), "frame=%5d fps=%3.*f q=%3.1f ", + frame_number, fps < 9.95, fps, q); + av_bprintf(&buf_script, "frame=%d\n", frame_number); + av_bprintf(&buf_script, "fps=%.1f\n", fps); + av_bprintf(&buf_script, "stream_%d_%d_q=%.1f\n", + ost->file_index, ost->index, q); + if (is_last_report) + snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), "L"); + if (qp_hist) { + int j; + int qp = lrintf(q); + if (qp >= 0 && qp < FF_ARRAY_ELEMS(qp_histogram)) + qp_histogram[qp]++; + for (j = 0; j < 32; j++) + snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), "%X", (int)lrintf(log2(qp_histogram[j] + 1))); + } + if ((enc->flags&CODEC_FLAG_PSNR) && (enc->coded_frame || is_last_report)) { + int j; + double error, error_sum = 0; + double scale, scale_sum = 0; + double p; + char type[3] = { 'Y','U','V' }; + snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), "PSNR="); + for (j = 0; j < 3; j++) { + if (is_last_report) { + error = enc->error[j]; + scale = enc->width * enc->height * 255.0 * 255.0 * frame_number; + } else { + error = enc->coded_frame->error[j]; + scale = enc->width * enc->height * 255.0 * 255.0; + } + if (j) + scale /= 4; + error_sum += error; + scale_sum += scale; + p = psnr(error / scale); + snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), "%c:%2.2f ", type[j], p); + av_bprintf(&buf_script, "stream_%d_%d_psnr_%c=%2.2f\n", + ost->file_index, ost->index, type[i] | 32, p); + } + p = psnr(error_sum / scale_sum); + snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), "*:%2.2f ", psnr(error_sum / scale_sum)); + av_bprintf(&buf_script, "stream_%d_%d_psnr_all=%2.2f\n", + ost->file_index, ost->index, p); + } + vid = 1; + } + /* compute min output value */ + if ((is_last_report || !ost->finished) && ost->st->pts.val != AV_NOPTS_VALUE) + pts = FFMAX(pts, av_rescale_q(ost->st->pts.val, + ost->st->time_base, AV_TIME_BASE_Q)); + } + + secs = pts / AV_TIME_BASE; + us = pts % AV_TIME_BASE; + mins = secs / 60; + secs %= 60; + hours = mins / 60; + mins %= 60; + + bitrate = pts && total_size >= 0 ? total_size * 8 / (pts / 1000.0) : -1; + + if (total_size < 0) snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), + "size=N/A time="); + else snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), + "size=%8.0fkB time=", total_size / 1024.0); + snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), + "%02d:%02d:%02d.%02d ", hours, mins, secs, + (100 * us) / AV_TIME_BASE); + if (bitrate < 0) snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), + "bitrate=N/A"); + else snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), + "bitrate=%6.1fkbits/s", bitrate); + if (total_size < 0) av_bprintf(&buf_script, "total_size=N/A\n"); + else av_bprintf(&buf_script, "total_size=%"PRId64"\n", total_size); + av_bprintf(&buf_script, "out_time_ms=%"PRId64"\n", pts); + av_bprintf(&buf_script, "out_time=%02d:%02d:%02d.%06d\n", + hours, mins, secs, us); + + if (nb_frames_dup || nb_frames_drop) + snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), " dup=%d drop=%d", + nb_frames_dup, nb_frames_drop); + av_bprintf(&buf_script, "dup_frames=%d\n", nb_frames_dup); + av_bprintf(&buf_script, "drop_frames=%d\n", nb_frames_drop); + + if (print_stats || is_last_report) { + av_log(NULL, AV_LOG_INFO, "%s \r", buf); + + fflush(stderr); + } + + if (progress_avio) { + av_bprintf(&buf_script, "progress=%s\n", + is_last_report ? "end" : "continue"); + avio_write(progress_avio, buf_script.str, + FFMIN(buf_script.len, buf_script.size - 1)); + avio_flush(progress_avio); + av_bprint_finalize(&buf_script, NULL); + if (is_last_report) { + avio_close(progress_avio); + progress_avio = NULL; + } + } + + if (is_last_report) { + int64_t raw= audio_size + video_size + subtitle_size + extra_size; + av_log(NULL, AV_LOG_INFO, "\n"); + av_log(NULL, AV_LOG_INFO, "video:%1.0fkB audio:%1.0fkB subtitle:%1.0f global headers:%1.0fkB muxing overhead %f%%\n", + video_size / 1024.0, + audio_size / 1024.0, + subtitle_size / 1024.0, + extra_size / 1024.0, + 100.0 * (total_size - raw) / raw + ); + if(video_size + audio_size + subtitle_size + extra_size == 0){ + av_log(NULL, AV_LOG_WARNING, "Output file is empty, nothing was encoded (check -ss / -t / -frames parameters if used)\n"); + } + } +} + +static void flush_encoders(void) +{ + int i, ret; + + for (i = 0; i < nb_output_streams; i++) { + OutputStream *ost = output_streams[i]; + AVCodecContext *enc = ost->st->codec; + AVFormatContext *os = output_files[ost->file_index]->ctx; + int stop_encoding = 0; + + if (!ost->encoding_needed) + continue; + + if (ost->st->codec->codec_type == AVMEDIA_TYPE_AUDIO && enc->frame_size <= 1) + continue; + if (ost->st->codec->codec_type == AVMEDIA_TYPE_VIDEO && (os->oformat->flags & AVFMT_RAWPICTURE) && enc->codec->id == AV_CODEC_ID_RAWVIDEO) + continue; + + for (;;) { + int (*encode)(AVCodecContext*, AVPacket*, const AVFrame*, int*) = NULL; + const char *desc; + int64_t *size; + + switch (ost->st->codec->codec_type) { + case AVMEDIA_TYPE_AUDIO: + encode = avcodec_encode_audio2; + desc = "Audio"; + size = &audio_size; + break; + case AVMEDIA_TYPE_VIDEO: + encode = avcodec_encode_video2; + desc = "Video"; + size = &video_size; + break; + default: + stop_encoding = 1; + } + + if (encode) { + AVPacket pkt; + int got_packet; + av_init_packet(&pkt); + pkt.data = NULL; + pkt.size = 0; + + update_benchmark(NULL); + ret = encode(enc, &pkt, NULL, &got_packet); + update_benchmark("flush %s %d.%d", desc, ost->file_index, ost->index); + if (ret < 0) { + av_log(NULL, AV_LOG_FATAL, "%s encoding failed\n", desc); + exit(1); + } + *size += pkt.size; + if (ost->logfile && enc->stats_out) { + fprintf(ost->logfile, "%s", enc->stats_out); + } + if (!got_packet) { + stop_encoding = 1; + break; + } + if (pkt.pts != AV_NOPTS_VALUE) + pkt.pts = av_rescale_q(pkt.pts, enc->time_base, ost->st->time_base); + if (pkt.dts != AV_NOPTS_VALUE) + pkt.dts = av_rescale_q(pkt.dts, enc->time_base, ost->st->time_base); + if (pkt.duration > 0) + pkt.duration = av_rescale_q(pkt.duration, enc->time_base, ost->st->time_base); + write_frame(os, &pkt, ost); + if (ost->st->codec->codec_type == AVMEDIA_TYPE_VIDEO && vstats_filename) { + do_video_stats(ost, pkt.size); + } + } + + if (stop_encoding) + break; + } + } +} + +/* + * Check whether a packet from ist should be written into ost at this time + */ +static int check_output_constraints(InputStream *ist, OutputStream *ost) +{ + OutputFile *of = output_files[ost->file_index]; + int ist_index = input_files[ist->file_index]->ist_index + ist->st->index; + + if (ost->source_index != ist_index) + return 0; + + if (of->start_time && ist->pts < of->start_time) + return 0; + + return 1; +} + +static void do_streamcopy(InputStream *ist, OutputStream *ost, const AVPacket *pkt) +{ + OutputFile *of = output_files[ost->file_index]; + int64_t ost_tb_start_time = av_rescale_q(of->start_time, AV_TIME_BASE_Q, ost->st->time_base); + AVPicture pict; + AVPacket opkt; + + av_init_packet(&opkt); + + if ((!ost->frame_number && !(pkt->flags & AV_PKT_FLAG_KEY)) && + !ost->copy_initial_nonkeyframes) + return; + + if (!ost->frame_number && ist->pts < of->start_time && + !ost->copy_prior_start) + return; + + if (of->recording_time != INT64_MAX && + ist->pts >= of->recording_time + of->start_time) { + close_output_stream(ost); + return; + } + + /* force the input stream PTS */ + if (ost->st->codec->codec_type == AVMEDIA_TYPE_AUDIO) + audio_size += pkt->size; + else if (ost->st->codec->codec_type == AVMEDIA_TYPE_VIDEO) { + video_size += pkt->size; + ost->sync_opts++; + } else if (ost->st->codec->codec_type == AVMEDIA_TYPE_SUBTITLE) { + subtitle_size += pkt->size; + } + + if (pkt->pts != AV_NOPTS_VALUE) + opkt.pts = av_rescale_q(pkt->pts, ist->st->time_base, ost->st->time_base) - ost_tb_start_time; + else + opkt.pts = AV_NOPTS_VALUE; + + if (pkt->dts == AV_NOPTS_VALUE) + opkt.dts = av_rescale_q(ist->dts, AV_TIME_BASE_Q, ost->st->time_base); + else + opkt.dts = av_rescale_q(pkt->dts, ist->st->time_base, ost->st->time_base); + opkt.dts -= ost_tb_start_time; + + if (ost->st->codec->codec_type == AVMEDIA_TYPE_AUDIO && pkt->dts != AV_NOPTS_VALUE) { + int duration = av_get_audio_frame_duration(ist->st->codec, pkt->size); + if(!duration) + duration = ist->st->codec->frame_size; + opkt.dts = opkt.pts = av_rescale_delta(ist->st->time_base, pkt->dts, + (AVRational){1, ist->st->codec->sample_rate}, duration, &ist->filter_in_rescale_delta_last, + ost->st->time_base) - ost_tb_start_time; + } + + opkt.duration = av_rescale_q(pkt->duration, ist->st->time_base, ost->st->time_base); + opkt.flags = pkt->flags; + + // FIXME remove the following 2 lines they shall be replaced by the bitstream filters + if ( ost->st->codec->codec_id != AV_CODEC_ID_H264 + && ost->st->codec->codec_id != AV_CODEC_ID_MPEG1VIDEO + && ost->st->codec->codec_id != AV_CODEC_ID_MPEG2VIDEO + && ost->st->codec->codec_id != AV_CODEC_ID_VC1 + ) { + if (av_parser_change(ist->st->parser, ost->st->codec, &opkt.data, &opkt.size, pkt->data, pkt->size, pkt->flags & AV_PKT_FLAG_KEY)) + opkt.destruct = av_destruct_packet; + } else { + opkt.data = pkt->data; + opkt.size = pkt->size; + } + + if (ost->st->codec->codec_type == AVMEDIA_TYPE_VIDEO && (of->ctx->oformat->flags & AVFMT_RAWPICTURE)) { + /* store AVPicture in AVPacket, as expected by the output format */ + avpicture_fill(&pict, opkt.data, ost->st->codec->pix_fmt, ost->st->codec->width, ost->st->codec->height); + opkt.data = (uint8_t *)&pict; + opkt.size = sizeof(AVPicture); + opkt.flags |= AV_PKT_FLAG_KEY; + } + + write_frame(of->ctx, &opkt, ost); + ost->st->codec->frame_number++; +} + +static void rate_emu_sleep(InputStream *ist) +{ + if (input_files[ist->file_index]->rate_emu) { + int64_t pts = av_rescale(ist->dts, 1000000, AV_TIME_BASE); + int64_t now = av_gettime() - ist->start; + if (pts > now) + av_usleep(pts - now); + } +} + +int guess_input_channel_layout(InputStream *ist) +{ + AVCodecContext *dec = ist->st->codec; + + if (!dec->channel_layout) { + char layout_name[256]; + + dec->channel_layout = av_get_default_channel_layout(dec->channels); + if (!dec->channel_layout) + return 0; + av_get_channel_layout_string(layout_name, sizeof(layout_name), + dec->channels, dec->channel_layout); + av_log(NULL, AV_LOG_WARNING, "Guessed Channel Layout for Input Stream " + "#%d.%d : %s\n", ist->file_index, ist->st->index, layout_name); + } + return 1; +} + +static int decode_audio(InputStream *ist, AVPacket *pkt, int *got_output) +{ + AVFrame *decoded_frame; + AVCodecContext *avctx = ist->st->codec; + int i, ret, resample_changed; + AVRational decoded_frame_tb; + + if (!ist->decoded_frame && !(ist->decoded_frame = avcodec_alloc_frame())) + return AVERROR(ENOMEM); + decoded_frame = ist->decoded_frame; + + update_benchmark(NULL); + ret = avcodec_decode_audio4(avctx, decoded_frame, got_output, pkt); + update_benchmark("decode_audio %d.%d", ist->file_index, ist->st->index); + + if (ret >= 0 && avctx->sample_rate <= 0) { + av_log(avctx, AV_LOG_ERROR, "Sample rate %d invalid\n", avctx->sample_rate); + ret = AVERROR_INVALIDDATA; + } + + if (!*got_output || ret < 0) { + if (!pkt->size) { + for (i = 0; i < ist->nb_filters; i++) + av_buffersrc_add_ref(ist->filters[i]->filter, NULL, 0); + } + return ret; + } + +#if 1 + /* increment next_dts to use for the case where the input stream does not + have timestamps or there are multiple frames in the packet */ + ist->next_pts += ((int64_t)AV_TIME_BASE * decoded_frame->nb_samples) / + avctx->sample_rate; + ist->next_dts += ((int64_t)AV_TIME_BASE * decoded_frame->nb_samples) / + avctx->sample_rate; +#endif + + rate_emu_sleep(ist); + + resample_changed = ist->resample_sample_fmt != decoded_frame->format || + ist->resample_channels != avctx->channels || + ist->resample_channel_layout != decoded_frame->channel_layout || + ist->resample_sample_rate != decoded_frame->sample_rate; + if (resample_changed) { + char layout1[64], layout2[64]; + + if (!guess_input_channel_layout(ist)) { + av_log(NULL, AV_LOG_FATAL, "Unable to find default channel " + "layout for Input Stream #%d.%d\n", ist->file_index, + ist->st->index); + exit(1); + } + decoded_frame->channel_layout = avctx->channel_layout; + + av_get_channel_layout_string(layout1, sizeof(layout1), ist->resample_channels, + ist->resample_channel_layout); + av_get_channel_layout_string(layout2, sizeof(layout2), avctx->channels, + decoded_frame->channel_layout); + + av_log(NULL, AV_LOG_INFO, + "Input stream #%d:%d frame changed from rate:%d fmt:%s ch:%d chl:%s to rate:%d fmt:%s ch:%d chl:%s\n", + ist->file_index, ist->st->index, + ist->resample_sample_rate, av_get_sample_fmt_name(ist->resample_sample_fmt), + ist->resample_channels, layout1, + decoded_frame->sample_rate, av_get_sample_fmt_name(decoded_frame->format), + avctx->channels, layout2); + + ist->resample_sample_fmt = decoded_frame->format; + ist->resample_sample_rate = decoded_frame->sample_rate; + ist->resample_channel_layout = decoded_frame->channel_layout; + ist->resample_channels = avctx->channels; + + for (i = 0; i < nb_filtergraphs; i++) + if (ist_in_filtergraph(filtergraphs[i], ist)) { + FilterGraph *fg = filtergraphs[i]; + int j; + if (configure_filtergraph(fg) < 0) { + av_log(NULL, AV_LOG_FATAL, "Error reinitializing filters!\n"); + exit(1); + } + for (j = 0; j < fg->nb_outputs; j++) { + OutputStream *ost = fg->outputs[j]->ost; + if (ost->enc->type == AVMEDIA_TYPE_AUDIO && + !(ost->enc->capabilities & CODEC_CAP_VARIABLE_FRAME_SIZE)) + av_buffersink_set_frame_size(ost->filter->filter, + ost->st->codec->frame_size); + } + } + } + + /* if the decoder provides a pts, use it instead of the last packet pts. + the decoder could be delaying output by a packet or more. */ + if (decoded_frame->pts != AV_NOPTS_VALUE) { + ist->dts = ist->next_dts = ist->pts = ist->next_pts = av_rescale_q(decoded_frame->pts, avctx->time_base, AV_TIME_BASE_Q); + decoded_frame_tb = avctx->time_base; + } else if (decoded_frame->pkt_pts != AV_NOPTS_VALUE) { + decoded_frame->pts = decoded_frame->pkt_pts; + pkt->pts = AV_NOPTS_VALUE; + decoded_frame_tb = ist->st->time_base; + } else if (pkt->pts != AV_NOPTS_VALUE) { + decoded_frame->pts = pkt->pts; + pkt->pts = AV_NOPTS_VALUE; + decoded_frame_tb = ist->st->time_base; + }else { + decoded_frame->pts = ist->dts; + decoded_frame_tb = AV_TIME_BASE_Q; + } + if (decoded_frame->pts != AV_NOPTS_VALUE) + decoded_frame->pts = av_rescale_delta(decoded_frame_tb, decoded_frame->pts, + (AVRational){1, ist->st->codec->sample_rate}, decoded_frame->nb_samples, &ist->filter_in_rescale_delta_last, + (AVRational){1, ist->st->codec->sample_rate}); + for (i = 0; i < ist->nb_filters; i++) + av_buffersrc_add_frame(ist->filters[i]->filter, decoded_frame, + AV_BUFFERSRC_FLAG_PUSH); + + decoded_frame->pts = AV_NOPTS_VALUE; + + return ret; +} + +static int decode_video(InputStream *ist, AVPacket *pkt, int *got_output) +{ + AVFrame *decoded_frame; + void *buffer_to_free = NULL; + int i, ret = 0, resample_changed; + int64_t best_effort_timestamp; + AVRational *frame_sample_aspect; + + if (!ist->decoded_frame && !(ist->decoded_frame = avcodec_alloc_frame())) + return AVERROR(ENOMEM); + decoded_frame = ist->decoded_frame; + pkt->dts = av_rescale_q(ist->dts, AV_TIME_BASE_Q, ist->st->time_base); + + update_benchmark(NULL); + ret = avcodec_decode_video2(ist->st->codec, + decoded_frame, got_output, pkt); + update_benchmark("decode_video %d.%d", ist->file_index, ist->st->index); + if (!*got_output || ret < 0) { + if (!pkt->size) { + for (i = 0; i < ist->nb_filters; i++) + av_buffersrc_add_ref(ist->filters[i]->filter, NULL, 0); + } + return ret; + } + + if(ist->top_field_first>=0) + decoded_frame->top_field_first = ist->top_field_first; + + best_effort_timestamp= av_frame_get_best_effort_timestamp(decoded_frame); + if(best_effort_timestamp != AV_NOPTS_VALUE) + ist->next_pts = ist->pts = av_rescale_q(decoded_frame->pts = best_effort_timestamp, ist->st->time_base, AV_TIME_BASE_Q); + + if (debug_ts) { + av_log(NULL, AV_LOG_INFO, "decoder -> ist_index:%d type:video " + "frame_pts:%s frame_pts_time:%s best_effort_ts:%"PRId64" best_effort_ts_time:%s keyframe:%d frame_type:%d \n", + ist->st->index, av_ts2str(decoded_frame->pts), + av_ts2timestr(decoded_frame->pts, &ist->st->time_base), + best_effort_timestamp, + av_ts2timestr(best_effort_timestamp, &ist->st->time_base), + decoded_frame->key_frame, decoded_frame->pict_type); + } + + pkt->size = 0; + pre_process_video_frame(ist, (AVPicture *)decoded_frame, &buffer_to_free); + + rate_emu_sleep(ist); + + if (ist->st->sample_aspect_ratio.num) + decoded_frame->sample_aspect_ratio = ist->st->sample_aspect_ratio; + + resample_changed = ist->resample_width != decoded_frame->width || + ist->resample_height != decoded_frame->height || + ist->resample_pix_fmt != decoded_frame->format; + if (resample_changed) { + av_log(NULL, AV_LOG_INFO, + "Input stream #%d:%d frame changed from size:%dx%d fmt:%s to size:%dx%d fmt:%s\n", + ist->file_index, ist->st->index, + ist->resample_width, ist->resample_height, av_get_pix_fmt_name(ist->resample_pix_fmt), + decoded_frame->width, decoded_frame->height, av_get_pix_fmt_name(decoded_frame->format)); + + ist->resample_width = decoded_frame->width; + ist->resample_height = decoded_frame->height; + ist->resample_pix_fmt = decoded_frame->format; + + for (i = 0; i < nb_filtergraphs; i++) { + if (ist_in_filtergraph(filtergraphs[i], ist) && ist->reinit_filters && + configure_filtergraph(filtergraphs[i]) < 0) { + av_log(NULL, AV_LOG_FATAL, "Error reinitializing filters!\n"); + exit(1); + } + } + } + + frame_sample_aspect= av_opt_ptr(avcodec_get_frame_class(), decoded_frame, "sample_aspect_ratio"); + for (i = 0; i < ist->nb_filters; i++) { + int changed = ist->st->codec->width != ist->filters[i]->filter->outputs[0]->w + || ist->st->codec->height != ist->filters[i]->filter->outputs[0]->h + || ist->st->codec->pix_fmt != ist->filters[i]->filter->outputs[0]->format; + + if (!frame_sample_aspect->num) + *frame_sample_aspect = ist->st->sample_aspect_ratio; + if (ist->dr1 && decoded_frame->type==FF_BUFFER_TYPE_USER && !changed) { + FrameBuffer *buf = decoded_frame->opaque; + AVFilterBufferRef *fb = avfilter_get_video_buffer_ref_from_arrays( + decoded_frame->data, decoded_frame->linesize, + AV_PERM_READ | AV_PERM_PRESERVE, + ist->st->codec->width, ist->st->codec->height, + ist->st->codec->pix_fmt); + + avfilter_copy_frame_props(fb, decoded_frame); + fb->buf->priv = buf; + fb->buf->free = filter_release_buffer; + + av_assert0(buf->refcount>0); + buf->refcount++; + av_buffersrc_add_ref(ist->filters[i]->filter, fb, + AV_BUFFERSRC_FLAG_NO_CHECK_FORMAT | + AV_BUFFERSRC_FLAG_NO_COPY | + AV_BUFFERSRC_FLAG_PUSH); + } else + if(av_buffersrc_add_frame(ist->filters[i]->filter, decoded_frame, AV_BUFFERSRC_FLAG_PUSH)<0) { + av_log(NULL, AV_LOG_FATAL, "Failed to inject frame into filter network\n"); + exit(1); + } + + } + + av_free(buffer_to_free); + return ret; +} + +static int transcode_subtitles(InputStream *ist, AVPacket *pkt, int *got_output) +{ + AVSubtitle subtitle; + int i, ret = avcodec_decode_subtitle2(ist->st->codec, + &subtitle, got_output, pkt); + if (ret < 0 || !*got_output) { + if (!pkt->size) + sub2video_flush(ist); + return ret; + } + + if (ist->fix_sub_duration) { + if (ist->prev_sub.got_output) { + int end = av_rescale(subtitle.pts - ist->prev_sub.subtitle.pts, + 1000, AV_TIME_BASE); + if (end < ist->prev_sub.subtitle.end_display_time) { + av_log(ist->st->codec, AV_LOG_DEBUG, + "Subtitle duration reduced from %d to %d\n", + ist->prev_sub.subtitle.end_display_time, end); + ist->prev_sub.subtitle.end_display_time = end; + } + } + FFSWAP(int, *got_output, ist->prev_sub.got_output); + FFSWAP(int, ret, ist->prev_sub.ret); + FFSWAP(AVSubtitle, subtitle, ist->prev_sub.subtitle); + } + + sub2video_update(ist, &subtitle); + + if (!*got_output || !subtitle.num_rects) + return ret; + + rate_emu_sleep(ist); + + for (i = 0; i < nb_output_streams; i++) { + OutputStream *ost = output_streams[i]; + + if (!check_output_constraints(ist, ost) || !ost->encoding_needed) + continue; + + do_subtitle_out(output_files[ost->file_index]->ctx, ost, ist, &subtitle); + } + + avsubtitle_free(&subtitle); + return ret; +} + +/* pkt = NULL means EOF (needed to flush decoder buffers) */ +static int output_packet(InputStream *ist, const AVPacket *pkt) +{ + int ret = 0, i; + int got_output; + + AVPacket avpkt; + if (!ist->saw_first_ts) { + ist->dts = ist->st->avg_frame_rate.num ? - ist->st->codec->has_b_frames * AV_TIME_BASE / av_q2d(ist->st->avg_frame_rate) : 0; + ist->pts = 0; + if (pkt != NULL && pkt->pts != AV_NOPTS_VALUE && !ist->decoding_needed) { + ist->dts += av_rescale_q(pkt->pts, ist->st->time_base, AV_TIME_BASE_Q); + ist->pts = ist->dts; //unused but better to set it to a value thats not totally wrong + } + ist->saw_first_ts = 1; + } + + if (ist->next_dts == AV_NOPTS_VALUE) + ist->next_dts = ist->dts; + if (ist->next_pts == AV_NOPTS_VALUE) + ist->next_pts = ist->pts; + + if (pkt == NULL) { + /* EOF handling */ + av_init_packet(&avpkt); + avpkt.data = NULL; + avpkt.size = 0; + goto handle_eof; + } else { + avpkt = *pkt; + } + + if (pkt->dts != AV_NOPTS_VALUE) { + ist->next_dts = ist->dts = av_rescale_q(pkt->dts, ist->st->time_base, AV_TIME_BASE_Q); + if (ist->st->codec->codec_type != AVMEDIA_TYPE_VIDEO || !ist->decoding_needed) + ist->next_pts = ist->pts = ist->dts; + } + + // while we have more to decode or while the decoder did output something on EOF + while (ist->decoding_needed && (avpkt.size > 0 || (!pkt && got_output))) { + int duration; + handle_eof: + + ist->pts = ist->next_pts; + ist->dts = ist->next_dts; + + if (avpkt.size && avpkt.size != pkt->size) { + av_log(NULL, ist->showed_multi_packet_warning ? AV_LOG_VERBOSE : AV_LOG_WARNING, + "Multiple frames in a packet from stream %d\n", pkt->stream_index); + ist->showed_multi_packet_warning = 1; + } + + switch (ist->st->codec->codec_type) { + case AVMEDIA_TYPE_AUDIO: + ret = decode_audio (ist, &avpkt, &got_output); + break; + case AVMEDIA_TYPE_VIDEO: + ret = decode_video (ist, &avpkt, &got_output); + if (avpkt.duration) { + duration = av_rescale_q(avpkt.duration, ist->st->time_base, AV_TIME_BASE_Q); + } else if(ist->st->codec->time_base.num != 0 && ist->st->codec->time_base.den != 0) { + int ticks= ist->st->parser ? ist->st->parser->repeat_pict+1 : ist->st->codec->ticks_per_frame; + duration = ((int64_t)AV_TIME_BASE * + ist->st->codec->time_base.num * ticks) / + ist->st->codec->time_base.den; + } else + duration = 0; + + if(ist->dts != AV_NOPTS_VALUE && duration) { + ist->next_dts += duration; + }else + ist->next_dts = AV_NOPTS_VALUE; + + if (got_output) + ist->next_pts += duration; //FIXME the duration is not correct in some cases + break; + case AVMEDIA_TYPE_SUBTITLE: + ret = transcode_subtitles(ist, &avpkt, &got_output); + break; + default: + return -1; + } + + if (ret < 0) + return ret; + + avpkt.dts= + avpkt.pts= AV_NOPTS_VALUE; + + // touch data and size only if not EOF + if (pkt) { + if(ist->st->codec->codec_type != AVMEDIA_TYPE_AUDIO) + ret = avpkt.size; + avpkt.data += ret; + avpkt.size -= ret; + } + if (!got_output) { + continue; + } + } + + /* handle stream copy */ + if (!ist->decoding_needed) { + rate_emu_sleep(ist); + ist->dts = ist->next_dts; + switch (ist->st->codec->codec_type) { + case AVMEDIA_TYPE_AUDIO: + ist->next_dts += ((int64_t)AV_TIME_BASE * ist->st->codec->frame_size) / + ist->st->codec->sample_rate; + break; + case AVMEDIA_TYPE_VIDEO: + if (pkt->duration) { + ist->next_dts += av_rescale_q(pkt->duration, ist->st->time_base, AV_TIME_BASE_Q); + } else if(ist->st->codec->time_base.num != 0) { + int ticks= ist->st->parser ? ist->st->parser->repeat_pict + 1 : ist->st->codec->ticks_per_frame; + ist->next_dts += ((int64_t)AV_TIME_BASE * + ist->st->codec->time_base.num * ticks) / + ist->st->codec->time_base.den; + } + break; + } + ist->pts = ist->dts; + ist->next_pts = ist->next_dts; + } + for (i = 0; pkt && i < nb_output_streams; i++) { + OutputStream *ost = output_streams[i]; + + if (!check_output_constraints(ist, ost) || ost->encoding_needed) + continue; + + do_streamcopy(ist, ost, pkt); + } + + return 0; +} + +static void print_sdp(void) +{ + char sdp[2048]; + int i; + AVFormatContext **avc = av_malloc(sizeof(*avc) * nb_output_files); + + if (!avc) + exit(1); + for (i = 0; i < nb_output_files; i++) + avc[i] = output_files[i]->ctx; + + av_sdp_create(avc, nb_output_files, sdp, sizeof(sdp)); + printf("SDP:\n%s\n", sdp); + fflush(stdout); + av_freep(&avc); +} + +static int init_input_stream(int ist_index, char *error, int error_len) +{ + int ret; + InputStream *ist = input_streams[ist_index]; + + if (ist->decoding_needed) { + AVCodec *codec = ist->dec; + if (!codec) { + snprintf(error, error_len, "Decoder (codec %s) not found for input stream #%d:%d", + avcodec_get_name(ist->st->codec->codec_id), ist->file_index, ist->st->index); + return AVERROR(EINVAL); + } + + ist->dr1 = (codec->capabilities & CODEC_CAP_DR1) && !do_deinterlace; + if (codec->type == AVMEDIA_TYPE_VIDEO && ist->dr1) { + ist->st->codec->get_buffer = codec_get_buffer; + ist->st->codec->release_buffer = codec_release_buffer; + ist->st->codec->opaque = &ist->buffer_pool; + } + + if (!av_dict_get(ist->opts, "threads", NULL, 0)) + av_dict_set(&ist->opts, "threads", "auto", 0); + if ((ret = avcodec_open2(ist->st->codec, codec, &ist->opts)) < 0) { + if (ret == AVERROR_EXPERIMENTAL) + abort_codec_experimental(codec, 0); + snprintf(error, error_len, "Error while opening decoder for input stream #%d:%d", + ist->file_index, ist->st->index); + return ret; + } + assert_avoptions(ist->opts); + } + + ist->next_pts = AV_NOPTS_VALUE; + ist->next_dts = AV_NOPTS_VALUE; + ist->is_start = 1; + + return 0; +} + +static InputStream *get_input_stream(OutputStream *ost) +{ + if (ost->source_index >= 0) + return input_streams[ost->source_index]; + return NULL; +} + +static void parse_forced_key_frames(char *kf, OutputStream *ost, + AVCodecContext *avctx) +{ + char *p; + int n = 1, i; + int64_t t; + + for (p = kf; *p; p++) + if (*p == ',') + n++; + ost->forced_kf_count = n; + ost->forced_kf_pts = av_malloc(sizeof(*ost->forced_kf_pts) * n); + if (!ost->forced_kf_pts) { + av_log(NULL, AV_LOG_FATAL, "Could not allocate forced key frames array.\n"); + exit(1); + } + + p = kf; + for (i = 0; i < n; i++) { + char *next = strchr(p, ','); + + if (next) + *next++ = 0; + + t = parse_time_or_die("force_key_frames", p, 1); + ost->forced_kf_pts[i] = av_rescale_q(t, AV_TIME_BASE_Q, avctx->time_base); + + p = next; + } +} + +static void report_new_stream(int input_index, AVPacket *pkt) +{ + InputFile *file = input_files[input_index]; + AVStream *st = file->ctx->streams[pkt->stream_index]; + + if (pkt->stream_index < file->nb_streams_warn) + return; + av_log(file->ctx, AV_LOG_WARNING, + "New %s stream %d:%d at pos:%"PRId64" and DTS:%ss\n", + av_get_media_type_string(st->codec->codec_type), + input_index, pkt->stream_index, + pkt->pos, av_ts2timestr(pkt->dts, &st->time_base)); + file->nb_streams_warn = pkt->stream_index + 1; +} + +static int transcode_init(void) +{ + int ret = 0, i, j, k; + AVFormatContext *oc; + AVCodecContext *codec; + OutputStream *ost; + InputStream *ist; + char error[1024]; + int want_sdp = 1; + + /* init framerate emulation */ + for (i = 0; i < nb_input_files; i++) { + InputFile *ifile = input_files[i]; + if (ifile->rate_emu) + for (j = 0; j < ifile->nb_streams; j++) + input_streams[j + ifile->ist_index]->start = av_gettime(); + } + + /* output stream init */ + for (i = 0; i < nb_output_files; i++) { + oc = output_files[i]->ctx; + if (!oc->nb_streams && !(oc->oformat->flags & AVFMT_NOSTREAMS)) { + av_dump_format(oc, i, oc->filename, 1); + av_log(NULL, AV_LOG_ERROR, "Output file #%d does not contain any stream\n", i); + return AVERROR(EINVAL); + } + } + + /* init complex filtergraphs */ + for (i = 0; i < nb_filtergraphs; i++) + if ((ret = avfilter_graph_config(filtergraphs[i]->graph, NULL)) < 0) + return ret; + + /* for each output stream, we compute the right encoding parameters */ + for (i = 0; i < nb_output_streams; i++) { + AVCodecContext *icodec = NULL; + ost = output_streams[i]; + oc = output_files[ost->file_index]->ctx; + ist = get_input_stream(ost); + + if (ost->attachment_filename) + continue; + + codec = ost->st->codec; + + if (ist) { + icodec = ist->st->codec; + + ost->st->disposition = ist->st->disposition; + codec->bits_per_raw_sample = icodec->bits_per_raw_sample; + codec->chroma_sample_location = icodec->chroma_sample_location; + } + + if (ost->stream_copy) { + uint64_t extra_size; + + av_assert0(ist && !ost->filter); + + extra_size = (uint64_t)icodec->extradata_size + FF_INPUT_BUFFER_PADDING_SIZE; + + if (extra_size > INT_MAX) { + return AVERROR(EINVAL); + } + + /* if stream_copy is selected, no need to decode or encode */ + codec->codec_id = icodec->codec_id; + codec->codec_type = icodec->codec_type; + + if (!codec->codec_tag) { + if (!oc->oformat->codec_tag || + av_codec_get_id (oc->oformat->codec_tag, icodec->codec_tag) == codec->codec_id || + av_codec_get_tag(oc->oformat->codec_tag, icodec->codec_id) <= 0) + codec->codec_tag = icodec->codec_tag; + } + + codec->bit_rate = icodec->bit_rate; + codec->rc_max_rate = icodec->rc_max_rate; + codec->rc_buffer_size = icodec->rc_buffer_size; + codec->field_order = icodec->field_order; + codec->extradata = av_mallocz(extra_size); + if (!codec->extradata) { + return AVERROR(ENOMEM); + } + memcpy(codec->extradata, icodec->extradata, icodec->extradata_size); + codec->extradata_size= icodec->extradata_size; + codec->bits_per_coded_sample = icodec->bits_per_coded_sample; + + codec->time_base = ist->st->time_base; + /* + * Avi is a special case here because it supports variable fps but + * having the fps and timebase differe significantly adds quite some + * overhead + */ + if(!strcmp(oc->oformat->name, "avi")) { + if ( copy_tb<0 && av_q2d(ist->st->r_frame_rate) >= av_q2d(ist->st->avg_frame_rate) + && 0.5/av_q2d(ist->st->r_frame_rate) > av_q2d(ist->st->time_base) + && 0.5/av_q2d(ist->st->r_frame_rate) > av_q2d(icodec->time_base) + && av_q2d(ist->st->time_base) < 1.0/500 && av_q2d(icodec->time_base) < 1.0/500 + || copy_tb==2){ + codec->time_base.num = ist->st->r_frame_rate.den; + codec->time_base.den = 2*ist->st->r_frame_rate.num; + codec->ticks_per_frame = 2; + } else if ( copy_tb<0 && av_q2d(icodec->time_base)*icodec->ticks_per_frame > 2*av_q2d(ist->st->time_base) + && av_q2d(ist->st->time_base) < 1.0/500 + || copy_tb==0){ + codec->time_base = icodec->time_base; + codec->time_base.num *= icodec->ticks_per_frame; + codec->time_base.den *= 2; + codec->ticks_per_frame = 2; + } + } else if(!(oc->oformat->flags & AVFMT_VARIABLE_FPS) + && strcmp(oc->oformat->name, "mov") && strcmp(oc->oformat->name, "mp4") && strcmp(oc->oformat->name, "3gp") + && strcmp(oc->oformat->name, "3g2") && strcmp(oc->oformat->name, "psp") && strcmp(oc->oformat->name, "ipod") + && strcmp(oc->oformat->name, "f4v") + ) { + if( copy_tb<0 && icodec->time_base.den + && av_q2d(icodec->time_base)*icodec->ticks_per_frame > av_q2d(ist->st->time_base) + && av_q2d(ist->st->time_base) < 1.0/500 + || copy_tb==0){ + codec->time_base = icodec->time_base; + codec->time_base.num *= icodec->ticks_per_frame; + } + } + if ( codec->codec_tag == AV_RL32("tmcd") + && icodec->time_base.num < icodec->time_base.den + && icodec->time_base.num > 0 + && 121LL*icodec->time_base.num > icodec->time_base.den) { + codec->time_base = icodec->time_base; + } + + if(ost->frame_rate.num) + codec->time_base = av_inv_q(ost->frame_rate); + + av_reduce(&codec->time_base.num, &codec->time_base.den, + codec->time_base.num, codec->time_base.den, INT_MAX); + + switch (codec->codec_type) { + case AVMEDIA_TYPE_AUDIO: + if (audio_volume != 256) { + av_log(NULL, AV_LOG_FATAL, "-acodec copy and -vol are incompatible (frames are not decoded)\n"); + exit(1); + } + codec->channel_layout = icodec->channel_layout; + codec->sample_rate = icodec->sample_rate; + codec->channels = icodec->channels; + codec->frame_size = icodec->frame_size; + codec->audio_service_type = icodec->audio_service_type; + codec->block_align = icodec->block_align; + if((codec->block_align == 1 || codec->block_align == 1152) && codec->codec_id == AV_CODEC_ID_MP3) + codec->block_align= 0; + if(codec->codec_id == AV_CODEC_ID_AC3) + codec->block_align= 0; + break; + case AVMEDIA_TYPE_VIDEO: + codec->pix_fmt = icodec->pix_fmt; + codec->width = icodec->width; + codec->height = icodec->height; + codec->has_b_frames = icodec->has_b_frames; + if (!codec->sample_aspect_ratio.num) { + codec->sample_aspect_ratio = + ost->st->sample_aspect_ratio = + ist->st->sample_aspect_ratio.num ? ist->st->sample_aspect_ratio : + ist->st->codec->sample_aspect_ratio.num ? + ist->st->codec->sample_aspect_ratio : (AVRational){0, 1}; + } + ost->st->avg_frame_rate = ist->st->avg_frame_rate; + break; + case AVMEDIA_TYPE_SUBTITLE: + codec->width = icodec->width; + codec->height = icodec->height; + break; + case AVMEDIA_TYPE_DATA: + case AVMEDIA_TYPE_ATTACHMENT: + break; + default: + abort(); + } + } else { + if (!ost->enc) + ost->enc = avcodec_find_encoder(codec->codec_id); + if (!ost->enc) { + /* should only happen when a default codec is not present. */ + snprintf(error, sizeof(error), "Encoder (codec %s) not found for output stream #%d:%d", + avcodec_get_name(ost->st->codec->codec_id), ost->file_index, ost->index); + ret = AVERROR(EINVAL); + goto dump_format; + } + + if (ist) + ist->decoding_needed++; + ost->encoding_needed = 1; + + if (!ost->filter && + (codec->codec_type == AVMEDIA_TYPE_VIDEO || + codec->codec_type == AVMEDIA_TYPE_AUDIO)) { + FilterGraph *fg; + fg = init_simple_filtergraph(ist, ost); + if (configure_filtergraph(fg)) { + av_log(NULL, AV_LOG_FATAL, "Error opening filters!\n"); + exit(1); + } + } + + if (codec->codec_type == AVMEDIA_TYPE_VIDEO) { + if (ost->filter && !ost->frame_rate.num) + ost->frame_rate = av_buffersink_get_frame_rate(ost->filter->filter); + if (ist && !ost->frame_rate.num) + ost->frame_rate = ist->framerate; + if (ist && !ost->frame_rate.num) + ost->frame_rate = ist->st->r_frame_rate.num ? ist->st->r_frame_rate : (AVRational){25, 1}; +// ost->frame_rate = ist->st->avg_frame_rate.num ? ist->st->avg_frame_rate : (AVRational){25, 1}; + if (ost->enc && ost->enc->supported_framerates && !ost->force_fps) { + int idx = av_find_nearest_q_idx(ost->frame_rate, ost->enc->supported_framerates); + ost->frame_rate = ost->enc->supported_framerates[idx]; + } + } + + switch (codec->codec_type) { + case AVMEDIA_TYPE_AUDIO: + codec->sample_fmt = ost->filter->filter->inputs[0]->format; + codec->sample_rate = ost->filter->filter->inputs[0]->sample_rate; + codec->channel_layout = ost->filter->filter->inputs[0]->channel_layout; + codec->channels = av_get_channel_layout_nb_channels(codec->channel_layout); + codec->time_base = (AVRational){ 1, codec->sample_rate }; + break; + case AVMEDIA_TYPE_VIDEO: + codec->time_base = av_inv_q(ost->frame_rate); + if (ost->filter && !(codec->time_base.num && codec->time_base.den)) + codec->time_base = ost->filter->filter->inputs[0]->time_base; + if ( av_q2d(codec->time_base) < 0.001 && video_sync_method != VSYNC_PASSTHROUGH + && (video_sync_method == VSYNC_CFR || (video_sync_method == VSYNC_AUTO && !(oc->oformat->flags & AVFMT_VARIABLE_FPS)))){ + av_log(oc, AV_LOG_WARNING, "Frame rate very high for a muxer not efficiently supporting it.\n" + "Please consider specifying a lower framerate, a different muxer or -vsync 2\n"); + } + for (j = 0; j < ost->forced_kf_count; j++) + ost->forced_kf_pts[j] = av_rescale_q(ost->forced_kf_pts[j], + AV_TIME_BASE_Q, + codec->time_base); + + codec->width = ost->filter->filter->inputs[0]->w; + codec->height = ost->filter->filter->inputs[0]->h; + codec->sample_aspect_ratio = ost->st->sample_aspect_ratio = + ost->frame_aspect_ratio ? // overridden by the -aspect cli option + av_d2q(ost->frame_aspect_ratio * codec->height/codec->width, 255) : + ost->filter->filter->inputs[0]->sample_aspect_ratio; + codec->pix_fmt = ost->filter->filter->inputs[0]->format; + + if (!icodec || + codec->width != icodec->width || + codec->height != icodec->height || + codec->pix_fmt != icodec->pix_fmt) { + codec->bits_per_raw_sample = frame_bits_per_raw_sample; + } + + if (ost->forced_keyframes) + parse_forced_key_frames(ost->forced_keyframes, ost, + ost->st->codec); + break; + case AVMEDIA_TYPE_SUBTITLE: + codec->time_base = (AVRational){1, 1000}; + if (!codec->width) { + codec->width = input_streams[ost->source_index]->st->codec->width; + codec->height = input_streams[ost->source_index]->st->codec->height; + } + break; + default: + abort(); + break; + } + /* two pass mode */ + if (codec->flags & (CODEC_FLAG_PASS1 | CODEC_FLAG_PASS2)) { + char logfilename[1024]; + FILE *f; + + snprintf(logfilename, sizeof(logfilename), "%s-%d.log", + ost->logfile_prefix ? ost->logfile_prefix : + DEFAULT_PASS_LOGFILENAME_PREFIX, + i); + if (!strcmp(ost->enc->name, "libx264")) { + av_dict_set(&ost->opts, "stats", logfilename, AV_DICT_DONT_OVERWRITE); + } else { + if (codec->flags & CODEC_FLAG_PASS2) { + char *logbuffer; + size_t logbuffer_size; + if (cmdutils_read_file(logfilename, &logbuffer, &logbuffer_size) < 0) { + av_log(NULL, AV_LOG_FATAL, "Error reading log file '%s' for pass-2 encoding\n", + logfilename); + exit(1); + } + codec->stats_in = logbuffer; + } + if (codec->flags & CODEC_FLAG_PASS1) { + f = fopen(logfilename, "wb"); + if (!f) { + av_log(NULL, AV_LOG_FATAL, "Cannot write log file '%s' for pass-1 encoding: %s\n", + logfilename, strerror(errno)); + exit(1); + } + ost->logfile = f; + } + } + } + } + } + + /* open each encoder */ + for (i = 0; i < nb_output_streams; i++) { + ost = output_streams[i]; + if (ost->encoding_needed) { + AVCodec *codec = ost->enc; + AVCodecContext *dec = NULL; + + if ((ist = get_input_stream(ost))) + dec = ist->st->codec; + if (dec && dec->subtitle_header) { + /* ASS code assumes this buffer is null terminated so add extra byte. */ + ost->st->codec->subtitle_header = av_mallocz(dec->subtitle_header_size + 1); + if (!ost->st->codec->subtitle_header) { + ret = AVERROR(ENOMEM); + goto dump_format; + } + memcpy(ost->st->codec->subtitle_header, dec->subtitle_header, dec->subtitle_header_size); + ost->st->codec->subtitle_header_size = dec->subtitle_header_size; + } + if (!av_dict_get(ost->opts, "threads", NULL, 0)) + av_dict_set(&ost->opts, "threads", "auto", 0); + if ((ret = avcodec_open2(ost->st->codec, codec, &ost->opts)) < 0) { + if (ret == AVERROR_EXPERIMENTAL) + abort_codec_experimental(codec, 1); + snprintf(error, sizeof(error), "Error while opening encoder for output stream #%d:%d - maybe incorrect parameters such as bit_rate, rate, width or height", + ost->file_index, ost->index); + goto dump_format; + } + if (ost->enc->type == AVMEDIA_TYPE_AUDIO && + !(ost->enc->capabilities & CODEC_CAP_VARIABLE_FRAME_SIZE)) + av_buffersink_set_frame_size(ost->filter->filter, + ost->st->codec->frame_size); + assert_avoptions(ost->opts); + if (ost->st->codec->bit_rate && ost->st->codec->bit_rate < 1000) + av_log(NULL, AV_LOG_WARNING, "The bitrate parameter is set too low." + " It takes bits/s as argument, not kbits/s\n"); + extra_size += ost->st->codec->extradata_size; + + if (ost->st->codec->me_threshold) + input_streams[ost->source_index]->st->codec->debug |= FF_DEBUG_MV; + } + } + + /* init input streams */ + for (i = 0; i < nb_input_streams; i++) + if ((ret = init_input_stream(i, error, sizeof(error))) < 0) + goto dump_format; + + /* discard unused programs */ + for (i = 0; i < nb_input_files; i++) { + InputFile *ifile = input_files[i]; + for (j = 0; j < ifile->ctx->nb_programs; j++) { + AVProgram *p = ifile->ctx->programs[j]; + int discard = AVDISCARD_ALL; + + for (k = 0; k < p->nb_stream_indexes; k++) + if (!input_streams[ifile->ist_index + p->stream_index[k]]->discard) { + discard = AVDISCARD_DEFAULT; + break; + } + p->discard = discard; + } + } + + /* open files and write file headers */ + for (i = 0; i < nb_output_files; i++) { + oc = output_files[i]->ctx; + oc->interrupt_callback = int_cb; + if ((ret = avformat_write_header(oc, &output_files[i]->opts)) < 0) { + char errbuf[128]; + const char *errbuf_ptr = errbuf; + if (av_strerror(ret, errbuf, sizeof(errbuf)) < 0) + errbuf_ptr = strerror(AVUNERROR(ret)); + snprintf(error, sizeof(error), "Could not write header for output file #%d (incorrect codec parameters ?): %s", i, errbuf_ptr); + ret = AVERROR(EINVAL); + goto dump_format; + } +// assert_avoptions(output_files[i]->opts); + if (strcmp(oc->oformat->name, "rtp")) { + want_sdp = 0; + } + } + + dump_format: + /* dump the file output parameters - cannot be done before in case + of stream copy */ + for (i = 0; i < nb_output_files; i++) { + av_dump_format(output_files[i]->ctx, i, output_files[i]->ctx->filename, 1); + } + + /* dump the stream mapping */ + av_log(NULL, AV_LOG_INFO, "Stream mapping:\n"); + for (i = 0; i < nb_input_streams; i++) { + ist = input_streams[i]; + + for (j = 0; j < ist->nb_filters; j++) { + if (ist->filters[j]->graph->graph_desc) { + av_log(NULL, AV_LOG_INFO, " Stream #%d:%d (%s) -> %s", + ist->file_index, ist->st->index, ist->dec ? ist->dec->name : "?", + ist->filters[j]->name); + if (nb_filtergraphs > 1) + av_log(NULL, AV_LOG_INFO, " (graph %d)", ist->filters[j]->graph->index); + av_log(NULL, AV_LOG_INFO, "\n"); + } + } + } + + for (i = 0; i < nb_output_streams; i++) { + ost = output_streams[i]; + + if (ost->attachment_filename) { + /* an attached file */ + av_log(NULL, AV_LOG_INFO, " File %s -> Stream #%d:%d\n", + ost->attachment_filename, ost->file_index, ost->index); + continue; + } + + if (ost->filter && ost->filter->graph->graph_desc) { + /* output from a complex graph */ + av_log(NULL, AV_LOG_INFO, " %s", ost->filter->name); + if (nb_filtergraphs > 1) + av_log(NULL, AV_LOG_INFO, " (graph %d)", ost->filter->graph->index); + + av_log(NULL, AV_LOG_INFO, " -> Stream #%d:%d (%s)\n", ost->file_index, + ost->index, ost->enc ? ost->enc->name : "?"); + continue; + } + + av_log(NULL, AV_LOG_INFO, " Stream #%d:%d -> #%d:%d", + input_streams[ost->source_index]->file_index, + input_streams[ost->source_index]->st->index, + ost->file_index, + ost->index); + if (ost->sync_ist != input_streams[ost->source_index]) + av_log(NULL, AV_LOG_INFO, " [sync #%d:%d]", + ost->sync_ist->file_index, + ost->sync_ist->st->index); + if (ost->stream_copy) + av_log(NULL, AV_LOG_INFO, " (copy)"); + else + av_log(NULL, AV_LOG_INFO, " (%s -> %s)", input_streams[ost->source_index]->dec ? + input_streams[ost->source_index]->dec->name : "?", + ost->enc ? ost->enc->name : "?"); + av_log(NULL, AV_LOG_INFO, "\n"); + } + + if (ret) { + av_log(NULL, AV_LOG_ERROR, "%s\n", error); + return ret; + } + + if (want_sdp) { + print_sdp(); + } + + return 0; +} + +/* Return 1 if there remain streams where more output is wanted, 0 otherwise. */ +static int need_output(void) +{ + int i; + + for (i = 0; i < nb_output_streams; i++) { + OutputStream *ost = output_streams[i]; + OutputFile *of = output_files[ost->file_index]; + AVFormatContext *os = output_files[ost->file_index]->ctx; + + if (ost->finished || + (os->pb && avio_tell(os->pb) >= of->limit_filesize)) + continue; + if (ost->frame_number >= ost->max_frames) { + int j; + for (j = 0; j < of->ctx->nb_streams; j++) + close_output_stream(output_streams[of->ost_index + j]); + continue; + } + + return 1; + } + + return 0; +} + +/** + * Select the output stream to process. + * + * @return selected output stream, or NULL if none available + */ +static OutputStream *choose_output(void) +{ + int i; + int64_t opts_min = INT64_MAX; + OutputStream *ost_min = NULL; + + for (i = 0; i < nb_output_streams; i++) { + OutputStream *ost = output_streams[i]; + int64_t opts = av_rescale_q(ost->st->cur_dts, ost->st->time_base, + AV_TIME_BASE_Q); + if (!ost->unavailable && !ost->finished && opts < opts_min) { + opts_min = opts; + ost_min = ost; + } + } + return ost_min; +} + +static int check_keyboard_interaction(int64_t cur_time) +{ + int i, ret, key; + static int64_t last_time; + if (received_nb_signals) + return AVERROR_EXIT; + /* read_key() returns 0 on EOF */ + if(cur_time - last_time >= 100000 && !run_as_daemon){ + key = read_key(); + last_time = cur_time; + }else + key = -1; + if (key == 'q') + return AVERROR_EXIT; + if (key == '+') av_log_set_level(av_log_get_level()+10); + if (key == '-') av_log_set_level(av_log_get_level()-10); + if (key == 's') qp_hist ^= 1; + if (key == 'h'){ + if (do_hex_dump){ + do_hex_dump = do_pkt_dump = 0; + } else if(do_pkt_dump){ + do_hex_dump = 1; + } else + do_pkt_dump = 1; + av_log_set_level(AV_LOG_DEBUG); + } + if (key == 'c' || key == 'C'){ + char buf[4096], target[64], command[256], arg[256] = {0}; + double time; + int k, n = 0; + fprintf(stderr, "\nEnter command: