diff mbox

[3/8] Add ffmpeg

Message ID 1407352737-7959-3-git-send-email-diorcet.yann@gmail.com
State Rejected
Delegated to: Christian Sørensen
Headers show

Commit Message

Yann Diorcet Aug. 6, 2014, 7:18 p.m. UTC
---
 recipes/ffmpeg/ffmpeg-0.10.2/disable-sdl.patch     | 42 +++++++++++
 recipes/ffmpeg/ffmpeg-0.10.2/dx.patch              | 11 +++
 recipes/ffmpeg/ffmpeg-0.10.2/mingw.patch           | 86 ++++++++++++++++++++++
 .../ffmpeg/ffmpeg-0.10.2/patch-configure-osx.patch | 36 +++++++++
 recipes/ffmpeg/ffmpeg-0.10.2/return.patch          | 12 +++
 recipes/ffmpeg/ffmpeg.inc                          | 84 +++++++++++++++++++++
 recipes/ffmpeg/ffmpeg_0.10.2.oe                    |  7 ++
 recipes/ffmpeg/ffmpeg_0.10.2.oe.sig                |  1 +
 8 files changed, 279 insertions(+)
 create mode 100644 recipes/ffmpeg/ffmpeg-0.10.2/disable-sdl.patch
 create mode 100644 recipes/ffmpeg/ffmpeg-0.10.2/dx.patch
 create mode 100644 recipes/ffmpeg/ffmpeg-0.10.2/mingw.patch
 create mode 100644 recipes/ffmpeg/ffmpeg-0.10.2/patch-configure-osx.patch
 create mode 100644 recipes/ffmpeg/ffmpeg-0.10.2/return.patch
 create mode 100644 recipes/ffmpeg/ffmpeg.inc
 create mode 100644 recipes/ffmpeg/ffmpeg_0.10.2.oe
 create mode 100644 recipes/ffmpeg/ffmpeg_0.10.2.oe.sig

Comments

christian.braunersorensen@prevas.dk Aug. 19, 2014, 8:27 a.m. UTC | #1
Hi Yann

On 2014-08-06 21:18, Yann Diorcet wrote:
> ---
>   recipes/ffmpeg/ffmpeg-0.10.2/disable-sdl.patch     | 42 +++++++++++
>   recipes/ffmpeg/ffmpeg-0.10.2/dx.patch              | 11 +++
>   recipes/ffmpeg/ffmpeg-0.10.2/mingw.patch           | 86 ++++++++++++++++++++++
>   .../ffmpeg/ffmpeg-0.10.2/patch-configure-osx.patch | 36 +++++++++
>   recipes/ffmpeg/ffmpeg-0.10.2/return.patch          | 12 +++
>   recipes/ffmpeg/ffmpeg.inc                          | 84 +++++++++++++++++++++
>   recipes/ffmpeg/ffmpeg_0.10.2.oe                    |  7 ++
>   recipes/ffmpeg/ffmpeg_0.10.2.oe.sig                |  1 +
>   8 files changed, 279 insertions(+)
>   create mode 100644 recipes/ffmpeg/ffmpeg-0.10.2/disable-sdl.patch
>   create mode 100644 recipes/ffmpeg/ffmpeg-0.10.2/dx.patch
>   create mode 100644 recipes/ffmpeg/ffmpeg-0.10.2/mingw.patch
>   create mode 100644 recipes/ffmpeg/ffmpeg-0.10.2/patch-configure-osx.patch
>   create mode 100644 recipes/ffmpeg/ffmpeg-0.10.2/return.patch
>   create mode 100644 recipes/ffmpeg/ffmpeg.inc
>   create mode 100644 recipes/ffmpeg/ffmpeg_0.10.2.oe
>   create mode 100644 recipes/ffmpeg/ffmpeg_0.10.2.oe.sig
>
> diff --git a/recipes/ffmpeg/ffmpeg-0.10.2/disable-sdl.patch b/recipes/ffmpeg/ffmpeg-0.10.2/disable-sdl.patch
> new file mode 100644
> index 0000000..234c4ad
> --- /dev/null
> +++ b/recipes/ffmpeg/ffmpeg-0.10.2/disable-sdl.patch
> @@ -0,0 +1,42 @@
> +diff -urN ffmpeg-0.10.2/configure ffmpeg-0.10.2.mod/configure
> +--- ffmpeg-0.10.2/configure	2012-01-26 23:15:59.000000000 +0100
> ++++ ffmpeg-0.10.2.mod/configure	2012-11-26 22:39:23.000000000 +0100
> +@@ -3178,22 +3178,22 @@
> +                         check_lib openssl/ssl.h SSL_library_init -lssl -lcrypto -lws2_32 -lgdi32 ||
> +                         die "ERROR: openssl not found"; }
> +
> +-SDL_CONFIG="${cross_prefix}sdl-config"
> +-if check_pkg_config sdl SDL_version.h SDL_Linked_Version; 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
> ++#SDL_CONFIG="${cross_prefix}sdl-config"
> ++#if check_pkg_config sdl SDL_version.h SDL_Linked_Version; 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 -version > /dev/null 2>&1 && enable texi2html || disable texi2html
> + makeinfo --version > /dev/null 2>&1 && enable makeinfo  || disable makeinfo
> diff --git a/recipes/ffmpeg/ffmpeg-0.10.2/dx.patch b/recipes/ffmpeg/ffmpeg-0.10.2/dx.patch
> new file mode 100644
> index 0000000..8ebdacc
> --- /dev/null
> +++ b/recipes/ffmpeg/ffmpeg-0.10.2/dx.patch
> @@ -0,0 +1,11 @@
> +diff -urN a/libavcodec/dxva2.h b/libavcodec/dxva2.h
> +--- a/libavcodec/dxva2.h	2012-01-26 23:15:59.000000000 +0100
> ++++ b/libavcodec/dxva2.h	2013-10-09 21:48:58.332721692 +0200
> +@@ -27,6 +27,7 @@
> +
> + #include <d3d9.h>
> + #include <dxva2api.h>
> ++#include <dxva.h>
> +
> + #define FF_DXVA2_WORKAROUND_SCALING_LIST_ZIGZAG 1 ///< Work around for DXVA2 and old UVD/UVD+ ATI video cards
> +
> diff --git a/recipes/ffmpeg/ffmpeg-0.10.2/mingw.patch b/recipes/ffmpeg/ffmpeg-0.10.2/mingw.patch
> new file mode 100644
> index 0000000..f849e93
> --- /dev/null
> +++ b/recipes/ffmpeg/ffmpeg-0.10.2/mingw.patch
> @@ -0,0 +1,86 @@
> +diff -urN ffmpeg-0.10.2/common.mak ffmpeg-0.10.2new/common.mak
> +--- ffmpeg-0.10.2/common.mak	2012-01-26 23:15:59.000000000 +0100
> ++++ ffmpeg-0.10.2new/common.mak	2012-04-11 21:03:13.141106358 +0200
> +@@ -10,7 +10,7 @@
> + ifndef V
> + Q      = @
> + ECHO   = printf "$(1)\t%s\n" $(2)
> +-BRIEF  = CC CXX AS YASM AR LD HOSTCC STRIP CP
> ++BRIEF  = CC CXX DLLTOOL AS YASM AR LD HOSTCC STRIP CP
> + SILENT = DEPCC YASMDEP RM RANLIB
> + MSG    = $@
> + M      = @$(call ECHO,$(TAG),$@);
> +diff -urN ffmpeg-0.10.2/configure ffmpeg-0.10.2new/configure
> +--- ffmpeg-0.10.2/configure	2012-01-26 23:15:59.000000000 +0100
> ++++ ffmpeg-0.10.2new/configure	2012-04-11 21:03:13.141106358 +0200
> +@@ -223,6 +223,7 @@
> +   --yasmexe=EXE            use yasm-compatible assembler EXE [$yasmexe_default]
> +   --cc=CC                  use C compiler CC [$cc_default]
> +   --cxx=CXX                use C compiler CXX [$cxx_default]
> ++  --dlltool=DLLTOOL	   use DLLTOOL [$dlltool_default]
> +   --ld=LD                  use linker LD [$ld_default]
> +   --host-cc=HOSTCC         use host C compiler HOSTCC
> +   --host-cflags=HCFLAGS    use HCFLAGS when compiling for host
> +@@ -1298,6 +1299,7 @@
> +     cpu
> +     cross_prefix
> +     cxx
> ++    dlltool
> +     dep_cc
> +     extra_version
> +     host_cc
> +@@ -1795,6 +1797,7 @@
> + ar_default="ar"
> + cc_default="gcc"
> + cxx_default="g++"
> ++dlltool_default="dlltool"
> + cc_version=\"unknown\"
> + host_cc_default="gcc"
> + install="install"
> +@@ -2044,14 +2047,14 @@
> + ar_default="${cross_prefix}${ar_default}"
> + cc_default="${cross_prefix}${cc_default}"
> + cxx_default="${cross_prefix}${cxx_default}"
> ++dlltool_default="${cross_prefix}${dlltool_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"
> +
> +-set_default cc cxx nm pkg_config strip sysinclude yasmexe
> ++set_default cc cxx dlltool nm pkg_config strip sysinclude yasmexe
> + enabled cross_compile || host_cc_default=$cc
> + set_default host_cc
> +
> +@@ -2666,7 +2669,7 @@
> +         SLIBSUF=".dll"
> +         SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME)-$(LIBVERSION)$(SLIBSUF)'
> +         SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(FULLNAME)-$(LIBMAJOR)$(SLIBSUF)'
> +-        SLIB_EXTRA_CMD='-lib.exe /machine:$(LIBTARGET) /def:$$(@:$(SLIBSUF)=.def) /out:$(SUBDIR)$(SLIBNAME:$(SLIBSUF)=.lib)'
> ++        SLIB_EXTRA_CMD='$(DLLTOOL) --dllname $(SLIBNAME) --input-def $$(@:$(SLIBSUF)=.def) --output-def $(SUBDIR)$(SLIBNAME:$(SLIBSUF)=.lib)'
> +         SLIB_INSTALL_NAME='$(SLIBNAME_WITH_MAJOR)'
> +         SLIB_INSTALL_LINKS=
> +         SLIB_INSTALL_EXTRA_SHLIB='$(SLIBNAME:$(SLIBSUF)=.lib)'
> +@@ -3542,6 +3545,7 @@
> + ARCH=$arch
> + CC=$cc
> + CXX=$cxx
> ++DLLTOOL=$dlltool
> + AS=$as
> + LD=$ld
> + DEPCC=$dep_cc
> +diff -urN ffmpeg-0.10.2/library.mak ffmpeg-0.10.2new/library.mak
> +--- ffmpeg-0.10.2/library.mak	2012-01-26 23:15:59.000000000 +0100
> ++++ ffmpeg-0.10.2new/library.mak	2012-04-11 21:04:21.441489409 +0200
> +@@ -63,8 +63,8 @@
> + 	$$(INSTALL) -m 755 $$< "$(SHLIBDIR)/$(SLIB_INSTALL_NAME)"
> + 	$$(STRIP) "$(SHLIBDIR)/$(SLIB_INSTALL_NAME)"
> + 	$(Q)$(foreach F,$(SLIB_INSTALL_LINKS),cd "$(SHLIBDIR)" && $(LN_S) $(SLIB_INSTALL_NAME) $(F);)
> +-	$(if $(SLIB_INSTALL_EXTRA_SHLIB),$$(INSTALL) -m 644 $(SLIB_INSTALL_EXTRA_SHLIB:%=$(SUBDIR)%) "$(SHLIBDIR)")
> + 	$(if $(SLIB_INSTALL_EXTRA_LIB),$(Q)mkdir -p "$(LIBDIR)")
> ++	$(if $(SLIB_INSTALL_EXTRA_SHLIB),$$(INSTALL) -m 644 $(SLIB_INSTALL_EXTRA_SHLIB:%=$(SUBDIR)%) "$(LIBDIR)")
> + 	$(if $(SLIB_INSTALL_EXTRA_LIB),$$(INSTALL) -m 644 $(SLIB_INSTALL_EXTRA_LIB:%=$(SUBDIR)%) "$(LIBDIR)")
> +
> + install-lib$(NAME)-static: $(SUBDIR)$(LIBNAME)
> diff --git a/recipes/ffmpeg/ffmpeg-0.10.2/patch-configure-osx.patch b/recipes/ffmpeg/ffmpeg-0.10.2/patch-configure-osx.patch
> new file mode 100644
> index 0000000..003da54
> --- /dev/null
> +++ b/recipes/ffmpeg/ffmpeg-0.10.2/patch-configure-osx.patch
> @@ -0,0 +1,36 @@
> +diff -urN a/configure b/configure
> +--- a/configure	2012-01-26 23:15:59.000000000 +0100
> ++++ b/configure	2013-10-29 14:22:13.627389142 +0100
> +@@ -2635,7 +2635,7 @@
> +         enable malloc_aligned
> +         gas="gas-preprocessor.pl $cc"
> +         enabled ppc && add_asflags -force_cpusubtype_ALL
> +-        SHFLAGS='-dynamiclib -Wl,-single_module -Wl,-install_name,$(SHLIBDIR)/$(SLIBNAME),-current_version,$(LIBVERSION),-compatibility_version,$(LIBMAJOR)'
> ++        SHFLAGS='-dynamiclib -Wl,-single_module -Wl,-install_name,$(SHLIBDIR)/$(SLIBNAME_WITH_VERSION),-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
> +diff -urN a/library.mak b/library.mak
> +--- a/library.mak	2012-01-26 23:15:59.000000000 +0100
> ++++ b/library.mak	2013-10-29 14:28:56.061909690 +0100
> +@@ -37,16 +37,16 @@
> + $(EXAMPLES) $(TESTPROGS) $(TOOLS): %$(EXESUF): %.o
> + 	$$(LD) $(LDFLAGS) -o $$@ $$^ -l$(FULLNAME) $(FFEXTRALIBS) $$(ELIBS)
> +
> +-$(SUBDIR)$(SLIBNAME): $(SUBDIR)$(SLIBNAME_WITH_MAJOR)
> +-	$(Q)cd ./$(SUBDIR) && $(LN_S) $(SLIBNAME_WITH_MAJOR) $(SLIBNAME)
> ++$(SUBDIR)$(SLIBNAME): $(SUBDIR)$(SLIBNAME_WITH_VERSION)
> ++	$(Q)cd ./$(SUBDIR) && $(LN_S) $(SLIBNAME_WITH_VERSION) $(SLIBNAME) && $(LN_S) $(SLIBNAME_WITH_VERSION) $(SLIBNAME_WITH_MAJOR)
> +
> +-$(SUBDIR)$(SLIBNAME_WITH_MAJOR): $(OBJS) $(SUBDIR)lib$(NAME).ver
> ++$(SUBDIR)$(SLIBNAME_WITH_VERSION): $(OBJS) $(SUBDIR)lib$(NAME).ver
> + 	$(SLIB_CREATE_DEF_CMD)
> + 	$$(LD) $(SHFLAGS) $(LDFLAGS) -o $$@ $$(filter %.o,$$^) $(FFEXTRALIBS) $(EXTRAOBJS)
> + 	$(SLIB_EXTRA_CMD)
> +
> + ifdef SUBDIR
> +-$(SUBDIR)$(SLIBNAME_WITH_MAJOR): $(DEP_LIBS)
> ++$(SUBDIR)$(SLIBNAME_WITH_VERSION): $(DEP_LIBS)
> + endif
> +
> + clean::
> diff --git a/recipes/ffmpeg/ffmpeg-0.10.2/return.patch b/recipes/ffmpeg/ffmpeg-0.10.2/return.patch
> new file mode 100644
> index 0000000..a78c2e7
> --- /dev/null
> +++ b/recipes/ffmpeg/ffmpeg-0.10.2/return.patch
> @@ -0,0 +1,12 @@
> +diff -urN a/libavcodec/w32pthreads.h b/libavcodec/w32pthreads.h
> +--- a/libavcodec/w32pthreads.h	2012-01-26 23:15:59.000000000 +0100
> ++++ b/libavcodec/w32pthreads.h	2014-05-06 01:39:00.101841775 +0200
> +@@ -223,7 +223,7 @@
> +         SetEvent(win32_cond->waiters_done);
> +
> +     // lock the external mutex
> +-    return pthread_mutex_lock(mutex);
> ++    pthread_mutex_lock(mutex);
> + }
> +
> + static void pthread_cond_signal(pthread_cond_t *cond)
> diff --git a/recipes/ffmpeg/ffmpeg.inc b/recipes/ffmpeg/ffmpeg.inc
> new file mode 100644
> index 0000000..bd03154
> --- /dev/null
> +++ b/recipes/ffmpeg/ffmpeg.inc
> @@ -0,0 +1,84 @@
> +DESCRIPTION = "FFmpeg is a complete, cross-platform solution to record, convert and stream audio and video."
> +LICENSE = "GPL"
> +
> +RECIPE_TYPES = "machine native"
> +
> +DEPENDS = "libz libm"
> +
> +inherit autotools pkgconfig
Ffmpeg is not autotools based....
> +
> +SRC_URI = "http://ffmpeg.org/releases/${PN}-${PV}.tar.gz"
> +
> +RECIPE_FLAGS += "ffmpeg_free"
> +DEFAULT_USE_ffmpeg_free = "0"
> +
> +EXTRA_FFMPEG = ""
> +EXTRA_FFMPEG:>USE_ffmpeg_free = " --disable-decoder=h26*,msmpeg*,mpeg2*,mpeg4*,mpeg_vdpau,mpeg_xvmc,mpegvideo,mp1,mp1*,mp2,mp2*,mp3,mp3* --disable-demuxer=h26*,mp3,vc1* --disable-muxer=h26*,mp3,mp2,mp4,mpeg1*,mpeg2*,vc1* --disable-encoder=h26*,msmpeg*,mpeg2*,mpeg4*,mpeg_vdpau,mpeg_xvmc,mpegvideo,mp1,mp1*,mp2,mp2*,mp3,mp3* --disable-parser=h26*,vc1*"
> +
> +autotools_configure () {
> +    extra_cflags=""
> +    target="${TARGET_OS}"
> +    case $target in
> +    linux*)
> +      target="linux"
> +      ;;
> +    darwin*)
> +      extra_cflags="-mdynamic-no-pic"
> +      target="darwin"
> +      ;;
> +    esac
> +    arch="${TARGET_CPU}"
> +    case $arch in
> +    i*86)
> +      arch="x86"
> +      ;;
> +    esac
> +
> +    useprefix="${prefix}"
> +    if [ -z "$useprefix" ] ; then
> +        useprefix="/"
> +    fi
> +    if [ -x "${CONFIGURE_SCRIPT}" ] ; then
> +        ${CONFIGURE_SCRIPT} \
> + 	--cross-prefix=${TARGET_PREFIX} \
> +	--prefix=$useprefix \
> +	--disable-bzlib \
> +        --sysroot=${stage_base_prefix} \
> +	--target-os=$target \
> +	--arch=$arch \
> +	--extra-cflags=$extra_cflags \
> +	--cc="${CC}" \
> +	${EXTRA_FFMPEG} \
> +	$@
> +    else
> +        oefatal "no configure script found"
> +    fi
> +}
Instead of overwriting autotools configure, please just "inherit make" 
instead and then append to EXTRA_OECONF with the extra options you want 
instead of overwriting the entire function.
Much easier to maintain, if only the needed diff is in a recipe, instead 
of an entire function in which its hard to see why the function was 
overwritten in the first place...
> +
> +PACKAGES += "${PN}-util"
> +
> +DEPENDS_${PN} += " ${DEPENDS}"
> +RDEPENDS_${PN} += " ${DEPENDS} ${PN}-libavfilter ${PN}-libavdevice ${PN}-libavformat ${PN}-libavcodec ${PN}-libavutil ${PN}-libswscale ${PN}-libswresample"
> +
> +inherit auto-package-libs
> +AUTO_PACKAGE_LIBS = "avfilter avdevice avformat avcodec avutil swscale swresample"
> +AUTO_PACKAGE_LIBS_PCPREFIX = "lib"
> +AUTO_PACKAGE_LIBS_DEV_DEPENDS = "${PN}-dev_${PV}"

Please split the utilities out in seperate recipes using auto-package-utils
and ensure that the dependencies for all packages are correct by "oe 
bake ffmpeg -t packageqa".
> +
> +FILES_${PN}-libavfilter   += "${sharedlibdir}/avfilter${SOLIBS}"
> +FILES_${PN}-libavfilter-dev:TARGET_OS_mingw32  += "${libdir}/avfilter*.def ${libdir}/avfilter*.lib"
> +FILES_${PN}-libavdevice   += "${sharedlibdir}/avdevice${SOLIBS}"
> +FILES_${PN}-libavdevice-dev:TARGET_OS_mingw32  += "${libdir}/avdevice*.def ${libdir}/avdevice*.lib"
> +FILES_${PN}-libavformat   += "${sharedlibdir}/avformat${SOLIBS}"
> +FILES_${PN}-libavformat-dev:TARGET_OS_mingw32  += "${libdir}/avformat*.def ${libdir}/avformat*.lib"
> +FILES_${PN}-libavcodec    += "${sharedlibdir}/avcodec${SOLIBS}"
> +FILES_${PN}-libavcodec-dev:TARGET_OS_mingw32  += "${libdir}/avcodec*.def ${libdir}/avcodec*.lib"
> +DEPENDS_${PN}-libavcodec += " ${PN}-libavutil ${PN}-libswscale"
> +RDEPENDS_${PN}-libavcodec += " ${DEPENDS} ${PN}-libavutil ${PN}-libswscale"
> +FILES_${PN}-libavutil     += "${sharedlibdir}/avutil${SOLIBS}"
> +FILES_${PN}-libavutil-dev:TARGET_OS_mingw32  += "${libdir}/avutil*.def ${libdir}/avutil*.lib"
> +FILES_${PN}-libswscale    += "${sharedlibdir}/swscale${SOLIBS}"
> +FILES_${PN}-libswscale-dev:TARGET_OS_mingw32  += "${libdir}/swscale*.def ${libdir}/swscale*.lib"
> +FILES_${PN}-libswresample += "${sharedlibdir}/swresample${SOLIBS}"
> +FILES_${PN}-libswresample-dev:TARGET_OS_mingw32  += "${libdir}/swresample*.def ${libdir}/swresample*.lib"
> +FILES_${PN}-util += "${bindir}/ffmpeg* ${bindir}/ffprobe* /usr/share/ffmpeg/*"
> diff --git a/recipes/ffmpeg/ffmpeg_0.10.2.oe b/recipes/ffmpeg/ffmpeg_0.10.2.oe
> new file mode 100644
> index 0000000..b5337cb
> --- /dev/null
> +++ b/recipes/ffmpeg/ffmpeg_0.10.2.oe
> @@ -0,0 +1,7 @@
> +require ffmpeg.inc
> +
> +SRC_URI += "file://disable-sdl.patch"
> +SRC_URI += "file://dx.patch"
> +SRC_URI += "file://return.patch"
> +SRC_URI:>TARGET_OS_mingw32 = " file://mingw.patch"
> +SRC_URI:>TARGET_OS_darwin = " file://patch-configure-osx.patch"
> diff --git a/recipes/ffmpeg/ffmpeg_0.10.2.oe.sig b/recipes/ffmpeg/ffmpeg_0.10.2.oe.sig
> new file mode 100644
> index 0000000..5c3f06e
> --- /dev/null
> +++ b/recipes/ffmpeg/ffmpeg_0.10.2.oe.sig
> @@ -0,0 +1 @@
> +b6e0050fefdc68aa34d7475c877e708bbecfd57d  ffmpeg-0.10.2.tar.gz
/Christian
diff mbox

Patch

diff --git a/recipes/ffmpeg/ffmpeg-0.10.2/disable-sdl.patch b/recipes/ffmpeg/ffmpeg-0.10.2/disable-sdl.patch
new file mode 100644
index 0000000..234c4ad
--- /dev/null
+++ b/recipes/ffmpeg/ffmpeg-0.10.2/disable-sdl.patch
@@ -0,0 +1,42 @@ 
+diff -urN ffmpeg-0.10.2/configure ffmpeg-0.10.2.mod/configure
+--- ffmpeg-0.10.2/configure	2012-01-26 23:15:59.000000000 +0100
++++ ffmpeg-0.10.2.mod/configure	2012-11-26 22:39:23.000000000 +0100
+@@ -3178,22 +3178,22 @@
+                         check_lib openssl/ssl.h SSL_library_init -lssl -lcrypto -lws2_32 -lgdi32 ||
+                         die "ERROR: openssl not found"; }
+ 
+-SDL_CONFIG="${cross_prefix}sdl-config"
+-if check_pkg_config sdl SDL_version.h SDL_Linked_Version; 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
++#SDL_CONFIG="${cross_prefix}sdl-config"
++#if check_pkg_config sdl SDL_version.h SDL_Linked_Version; 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 -version > /dev/null 2>&1 && enable texi2html || disable texi2html
+ makeinfo --version > /dev/null 2>&1 && enable makeinfo  || disable makeinfo
diff --git a/recipes/ffmpeg/ffmpeg-0.10.2/dx.patch b/recipes/ffmpeg/ffmpeg-0.10.2/dx.patch
new file mode 100644
index 0000000..8ebdacc
--- /dev/null
+++ b/recipes/ffmpeg/ffmpeg-0.10.2/dx.patch
@@ -0,0 +1,11 @@ 
+diff -urN a/libavcodec/dxva2.h b/libavcodec/dxva2.h
+--- a/libavcodec/dxva2.h	2012-01-26 23:15:59.000000000 +0100
++++ b/libavcodec/dxva2.h	2013-10-09 21:48:58.332721692 +0200
+@@ -27,6 +27,7 @@
+ 
+ #include <d3d9.h>
+ #include <dxva2api.h>
++#include <dxva.h>
+ 
+ #define FF_DXVA2_WORKAROUND_SCALING_LIST_ZIGZAG 1 ///< Work around for DXVA2 and old UVD/UVD+ ATI video cards
+ 
diff --git a/recipes/ffmpeg/ffmpeg-0.10.2/mingw.patch b/recipes/ffmpeg/ffmpeg-0.10.2/mingw.patch
new file mode 100644
index 0000000..f849e93
--- /dev/null
+++ b/recipes/ffmpeg/ffmpeg-0.10.2/mingw.patch
@@ -0,0 +1,86 @@ 
+diff -urN ffmpeg-0.10.2/common.mak ffmpeg-0.10.2new/common.mak
+--- ffmpeg-0.10.2/common.mak	2012-01-26 23:15:59.000000000 +0100
++++ ffmpeg-0.10.2new/common.mak	2012-04-11 21:03:13.141106358 +0200
+@@ -10,7 +10,7 @@
+ ifndef V
+ Q      = @
+ ECHO   = printf "$(1)\t%s\n" $(2)
+-BRIEF  = CC CXX AS YASM AR LD HOSTCC STRIP CP
++BRIEF  = CC CXX DLLTOOL AS YASM AR LD HOSTCC STRIP CP
+ SILENT = DEPCC YASMDEP RM RANLIB
+ MSG    = $@
+ M      = @$(call ECHO,$(TAG),$@);
+diff -urN ffmpeg-0.10.2/configure ffmpeg-0.10.2new/configure
+--- ffmpeg-0.10.2/configure	2012-01-26 23:15:59.000000000 +0100
++++ ffmpeg-0.10.2new/configure	2012-04-11 21:03:13.141106358 +0200
+@@ -223,6 +223,7 @@
+   --yasmexe=EXE            use yasm-compatible assembler EXE [$yasmexe_default]
+   --cc=CC                  use C compiler CC [$cc_default]
+   --cxx=CXX                use C compiler CXX [$cxx_default]
++  --dlltool=DLLTOOL	   use DLLTOOL [$dlltool_default]
+   --ld=LD                  use linker LD [$ld_default]
+   --host-cc=HOSTCC         use host C compiler HOSTCC
+   --host-cflags=HCFLAGS    use HCFLAGS when compiling for host
+@@ -1298,6 +1299,7 @@
+     cpu
+     cross_prefix
+     cxx
++    dlltool
+     dep_cc
+     extra_version
+     host_cc
+@@ -1795,6 +1797,7 @@
+ ar_default="ar"
+ cc_default="gcc"
+ cxx_default="g++"
++dlltool_default="dlltool"
+ cc_version=\"unknown\"
+ host_cc_default="gcc"
+ install="install"
+@@ -2044,14 +2047,14 @@
+ ar_default="${cross_prefix}${ar_default}"
+ cc_default="${cross_prefix}${cc_default}"
+ cxx_default="${cross_prefix}${cxx_default}"
++dlltool_default="${cross_prefix}${dlltool_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"
+ 
+-set_default cc cxx nm pkg_config strip sysinclude yasmexe
++set_default cc cxx dlltool nm pkg_config strip sysinclude yasmexe
+ enabled cross_compile || host_cc_default=$cc
+ set_default host_cc
+ 
+@@ -2666,7 +2669,7 @@
+         SLIBSUF=".dll"
+         SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME)-$(LIBVERSION)$(SLIBSUF)'
+         SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(FULLNAME)-$(LIBMAJOR)$(SLIBSUF)'
+-        SLIB_EXTRA_CMD='-lib.exe /machine:$(LIBTARGET) /def:$$(@:$(SLIBSUF)=.def) /out:$(SUBDIR)$(SLIBNAME:$(SLIBSUF)=.lib)'
++        SLIB_EXTRA_CMD='$(DLLTOOL) --dllname $(SLIBNAME) --input-def $$(@:$(SLIBSUF)=.def) --output-def $(SUBDIR)$(SLIBNAME:$(SLIBSUF)=.lib)'
+         SLIB_INSTALL_NAME='$(SLIBNAME_WITH_MAJOR)'
+         SLIB_INSTALL_LINKS=
+         SLIB_INSTALL_EXTRA_SHLIB='$(SLIBNAME:$(SLIBSUF)=.lib)'
+@@ -3542,6 +3545,7 @@
+ ARCH=$arch
+ CC=$cc
+ CXX=$cxx
++DLLTOOL=$dlltool
+ AS=$as
+ LD=$ld
+ DEPCC=$dep_cc
+diff -urN ffmpeg-0.10.2/library.mak ffmpeg-0.10.2new/library.mak
+--- ffmpeg-0.10.2/library.mak	2012-01-26 23:15:59.000000000 +0100
++++ ffmpeg-0.10.2new/library.mak	2012-04-11 21:04:21.441489409 +0200
+@@ -63,8 +63,8 @@
+ 	$$(INSTALL) -m 755 $$< "$(SHLIBDIR)/$(SLIB_INSTALL_NAME)"
+ 	$$(STRIP) "$(SHLIBDIR)/$(SLIB_INSTALL_NAME)"
+ 	$(Q)$(foreach F,$(SLIB_INSTALL_LINKS),cd "$(SHLIBDIR)" && $(LN_S) $(SLIB_INSTALL_NAME) $(F);)
+-	$(if $(SLIB_INSTALL_EXTRA_SHLIB),$$(INSTALL) -m 644 $(SLIB_INSTALL_EXTRA_SHLIB:%=$(SUBDIR)%) "$(SHLIBDIR)")
+ 	$(if $(SLIB_INSTALL_EXTRA_LIB),$(Q)mkdir -p "$(LIBDIR)")
++	$(if $(SLIB_INSTALL_EXTRA_SHLIB),$$(INSTALL) -m 644 $(SLIB_INSTALL_EXTRA_SHLIB:%=$(SUBDIR)%) "$(LIBDIR)")
+ 	$(if $(SLIB_INSTALL_EXTRA_LIB),$$(INSTALL) -m 644 $(SLIB_INSTALL_EXTRA_LIB:%=$(SUBDIR)%) "$(LIBDIR)")
+ 
+ install-lib$(NAME)-static: $(SUBDIR)$(LIBNAME)
diff --git a/recipes/ffmpeg/ffmpeg-0.10.2/patch-configure-osx.patch b/recipes/ffmpeg/ffmpeg-0.10.2/patch-configure-osx.patch
new file mode 100644
index 0000000..003da54
--- /dev/null
+++ b/recipes/ffmpeg/ffmpeg-0.10.2/patch-configure-osx.patch
@@ -0,0 +1,36 @@ 
+diff -urN a/configure b/configure
+--- a/configure	2012-01-26 23:15:59.000000000 +0100
++++ b/configure	2013-10-29 14:22:13.627389142 +0100
+@@ -2635,7 +2635,7 @@
+         enable malloc_aligned
+         gas="gas-preprocessor.pl $cc"
+         enabled ppc && add_asflags -force_cpusubtype_ALL
+-        SHFLAGS='-dynamiclib -Wl,-single_module -Wl,-install_name,$(SHLIBDIR)/$(SLIBNAME),-current_version,$(LIBVERSION),-compatibility_version,$(LIBMAJOR)'
++        SHFLAGS='-dynamiclib -Wl,-single_module -Wl,-install_name,$(SHLIBDIR)/$(SLIBNAME_WITH_VERSION),-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
+diff -urN a/library.mak b/library.mak
+--- a/library.mak	2012-01-26 23:15:59.000000000 +0100
++++ b/library.mak	2013-10-29 14:28:56.061909690 +0100
+@@ -37,16 +37,16 @@
+ $(EXAMPLES) $(TESTPROGS) $(TOOLS): %$(EXESUF): %.o
+ 	$$(LD) $(LDFLAGS) -o $$@ $$^ -l$(FULLNAME) $(FFEXTRALIBS) $$(ELIBS)
+ 
+-$(SUBDIR)$(SLIBNAME): $(SUBDIR)$(SLIBNAME_WITH_MAJOR)
+-	$(Q)cd ./$(SUBDIR) && $(LN_S) $(SLIBNAME_WITH_MAJOR) $(SLIBNAME)
++$(SUBDIR)$(SLIBNAME): $(SUBDIR)$(SLIBNAME_WITH_VERSION)
++	$(Q)cd ./$(SUBDIR) && $(LN_S) $(SLIBNAME_WITH_VERSION) $(SLIBNAME) && $(LN_S) $(SLIBNAME_WITH_VERSION) $(SLIBNAME_WITH_MAJOR)
+ 
+-$(SUBDIR)$(SLIBNAME_WITH_MAJOR): $(OBJS) $(SUBDIR)lib$(NAME).ver
++$(SUBDIR)$(SLIBNAME_WITH_VERSION): $(OBJS) $(SUBDIR)lib$(NAME).ver
+ 	$(SLIB_CREATE_DEF_CMD)
+ 	$$(LD) $(SHFLAGS) $(LDFLAGS) -o $$@ $$(filter %.o,$$^) $(FFEXTRALIBS) $(EXTRAOBJS)
+ 	$(SLIB_EXTRA_CMD)
+ 
+ ifdef SUBDIR
+-$(SUBDIR)$(SLIBNAME_WITH_MAJOR): $(DEP_LIBS)
++$(SUBDIR)$(SLIBNAME_WITH_VERSION): $(DEP_LIBS)
+ endif
+ 
+ clean::
diff --git a/recipes/ffmpeg/ffmpeg-0.10.2/return.patch b/recipes/ffmpeg/ffmpeg-0.10.2/return.patch
new file mode 100644
index 0000000..a78c2e7
--- /dev/null
+++ b/recipes/ffmpeg/ffmpeg-0.10.2/return.patch
@@ -0,0 +1,12 @@ 
+diff -urN a/libavcodec/w32pthreads.h b/libavcodec/w32pthreads.h
+--- a/libavcodec/w32pthreads.h	2012-01-26 23:15:59.000000000 +0100
++++ b/libavcodec/w32pthreads.h	2014-05-06 01:39:00.101841775 +0200
+@@ -223,7 +223,7 @@
+         SetEvent(win32_cond->waiters_done);
+ 
+     // lock the external mutex
+-    return pthread_mutex_lock(mutex);
++    pthread_mutex_lock(mutex);
+ }
+ 
+ static void pthread_cond_signal(pthread_cond_t *cond)
diff --git a/recipes/ffmpeg/ffmpeg.inc b/recipes/ffmpeg/ffmpeg.inc
new file mode 100644
index 0000000..bd03154
--- /dev/null
+++ b/recipes/ffmpeg/ffmpeg.inc
@@ -0,0 +1,84 @@ 
+DESCRIPTION = "FFmpeg is a complete, cross-platform solution to record, convert and stream audio and video."
+LICENSE = "GPL"
+
+RECIPE_TYPES = "machine native"
+
+DEPENDS = "libz libm"
+
+inherit autotools pkgconfig
+
+SRC_URI = "http://ffmpeg.org/releases/${PN}-${PV}.tar.gz"
+
+RECIPE_FLAGS += "ffmpeg_free"
+DEFAULT_USE_ffmpeg_free = "0"
+
+EXTRA_FFMPEG = ""
+EXTRA_FFMPEG:>USE_ffmpeg_free = " --disable-decoder=h26*,msmpeg*,mpeg2*,mpeg4*,mpeg_vdpau,mpeg_xvmc,mpegvideo,mp1,mp1*,mp2,mp2*,mp3,mp3* --disable-demuxer=h26*,mp3,vc1* --disable-muxer=h26*,mp3,mp2,mp4,mpeg1*,mpeg2*,vc1* --disable-encoder=h26*,msmpeg*,mpeg2*,mpeg4*,mpeg_vdpau,mpeg_xvmc,mpegvideo,mp1,mp1*,mp2,mp2*,mp3,mp3* --disable-parser=h26*,vc1*"
+
+autotools_configure () {
+    extra_cflags="" 
+    target="${TARGET_OS}"
+    case $target in
+    linux*)
+      target="linux"
+      ;;
+    darwin*)
+      extra_cflags="-mdynamic-no-pic"
+      target="darwin"
+      ;;
+    esac
+    arch="${TARGET_CPU}"
+    case $arch in
+    i*86)
+      arch="x86"
+      ;;
+    esac
+
+    useprefix="${prefix}"
+    if [ -z "$useprefix" ] ; then
+        useprefix="/"
+    fi
+    if [ -x "${CONFIGURE_SCRIPT}" ] ; then
+        ${CONFIGURE_SCRIPT} \
+ 	--cross-prefix=${TARGET_PREFIX} \
+	--prefix=$useprefix \
+	--disable-bzlib \
+        --sysroot=${stage_base_prefix} \
+	--target-os=$target \
+	--arch=$arch \
+	--extra-cflags=$extra_cflags \
+	--cc="${CC}" \
+	${EXTRA_FFMPEG} \
+	$@
+    else
+        oefatal "no configure script found"
+    fi
+}
+
+PACKAGES += "${PN}-util"
+
+DEPENDS_${PN} += " ${DEPENDS}"
+RDEPENDS_${PN} += " ${DEPENDS} ${PN}-libavfilter ${PN}-libavdevice ${PN}-libavformat ${PN}-libavcodec ${PN}-libavutil ${PN}-libswscale ${PN}-libswresample"
+
+inherit auto-package-libs
+AUTO_PACKAGE_LIBS = "avfilter avdevice avformat avcodec avutil swscale swresample"
+AUTO_PACKAGE_LIBS_PCPREFIX = "lib"
+AUTO_PACKAGE_LIBS_DEV_DEPENDS = "${PN}-dev_${PV}"
+
+FILES_${PN}-libavfilter   += "${sharedlibdir}/avfilter${SOLIBS}"
+FILES_${PN}-libavfilter-dev:TARGET_OS_mingw32  += "${libdir}/avfilter*.def ${libdir}/avfilter*.lib"
+FILES_${PN}-libavdevice   += "${sharedlibdir}/avdevice${SOLIBS}"
+FILES_${PN}-libavdevice-dev:TARGET_OS_mingw32  += "${libdir}/avdevice*.def ${libdir}/avdevice*.lib"
+FILES_${PN}-libavformat   += "${sharedlibdir}/avformat${SOLIBS}"
+FILES_${PN}-libavformat-dev:TARGET_OS_mingw32  += "${libdir}/avformat*.def ${libdir}/avformat*.lib"
+FILES_${PN}-libavcodec    += "${sharedlibdir}/avcodec${SOLIBS}"
+FILES_${PN}-libavcodec-dev:TARGET_OS_mingw32  += "${libdir}/avcodec*.def ${libdir}/avcodec*.lib"
+DEPENDS_${PN}-libavcodec += " ${PN}-libavutil ${PN}-libswscale"
+RDEPENDS_${PN}-libavcodec += " ${DEPENDS} ${PN}-libavutil ${PN}-libswscale"
+FILES_${PN}-libavutil     += "${sharedlibdir}/avutil${SOLIBS}"
+FILES_${PN}-libavutil-dev:TARGET_OS_mingw32  += "${libdir}/avutil*.def ${libdir}/avutil*.lib"
+FILES_${PN}-libswscale    += "${sharedlibdir}/swscale${SOLIBS}"
+FILES_${PN}-libswscale-dev:TARGET_OS_mingw32  += "${libdir}/swscale*.def ${libdir}/swscale*.lib"
+FILES_${PN}-libswresample += "${sharedlibdir}/swresample${SOLIBS}"
+FILES_${PN}-libswresample-dev:TARGET_OS_mingw32  += "${libdir}/swresample*.def ${libdir}/swresample*.lib"
+FILES_${PN}-util += "${bindir}/ffmpeg* ${bindir}/ffprobe* /usr/share/ffmpeg/*"
diff --git a/recipes/ffmpeg/ffmpeg_0.10.2.oe b/recipes/ffmpeg/ffmpeg_0.10.2.oe
new file mode 100644
index 0000000..b5337cb
--- /dev/null
+++ b/recipes/ffmpeg/ffmpeg_0.10.2.oe
@@ -0,0 +1,7 @@ 
+require ffmpeg.inc
+
+SRC_URI += "file://disable-sdl.patch"
+SRC_URI += "file://dx.patch"
+SRC_URI += "file://return.patch"
+SRC_URI:>TARGET_OS_mingw32 = " file://mingw.patch"
+SRC_URI:>TARGET_OS_darwin = " file://patch-configure-osx.patch"
diff --git a/recipes/ffmpeg/ffmpeg_0.10.2.oe.sig b/recipes/ffmpeg/ffmpeg_0.10.2.oe.sig
new file mode 100644
index 0000000..5c3f06e
--- /dev/null
+++ b/recipes/ffmpeg/ffmpeg_0.10.2.oe.sig
@@ -0,0 +1 @@ 
+b6e0050fefdc68aa34d7475c877e708bbecfd57d  ffmpeg-0.10.2.tar.gz