wok rev 2680

ffmpeg mktemp busybox hack and avutil hack
author Rohit Joshi <jozee@slitaz.org>
date Tue Apr 21 21:25:07 2009 +0000 (2009-04-21)
parents a313a0ccd48f
children c10bde9c89d7
files ffmpeg-dev/receipt ffmpeg-dev/stuff/avutil.h ffmpeg/receipt ffmpeg/stuff/build.patch
line diff
     1.1 --- a/ffmpeg-dev/receipt	Tue Apr 21 13:37:42 2009 +0000
     1.2 +++ b/ffmpeg-dev/receipt	Tue Apr 21 21:25:07 2009 +0000
     1.3 @@ -15,5 +15,8 @@
     1.4  	cp -a $_pkg/usr/include $fs/usr
     1.5  	cp -a $_pkg/usr/lib/*.a $fs/usr/lib
     1.6  	cp -a $_pkg/usr/lib/pkgconfig $fs/usr/lib
     1.7 +	
     1.8 +	# avutil.h file in svn version 18330 is incomplete: Kino hack
     1.9 +	cp -a stuff/avutil* $fs/usr/include/libavutil/
    1.10  }
    1.11  
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/ffmpeg-dev/stuff/avutil.h	Tue Apr 21 21:25:07 2009 +0000
     2.3 @@ -0,0 +1,156 @@
     2.4 +/*
     2.5 + * copyright (c) 2006 Michael Niedermayer <michaelni@gmx.at>
     2.6 + *
     2.7 + * This file is part of FFmpeg.
     2.8 + *
     2.9 + * FFmpeg is free software; you can redistribute it and/or
    2.10 + * modify it under the terms of the GNU Lesser General Public
    2.11 + * License as published by the Free Software Foundation; either
    2.12 + * version 2.1 of the License, or (at your option) any later version.
    2.13 + *
    2.14 + * FFmpeg is distributed in the hope that it will be useful,
    2.15 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
    2.16 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    2.17 + * Lesser General Public License for more details.
    2.18 + *
    2.19 + * You should have received a copy of the GNU Lesser General Public
    2.20 + * License along with FFmpeg; if not, write to the Free Software
    2.21 + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
    2.22 + */
    2.23 +
    2.24 +#ifndef AVUTIL_AVUTIL_H
    2.25 +#define AVUTIL_AVUTIL_H
    2.26 +
    2.27 +/**
    2.28 + * @file libavutil/avutil.h
    2.29 + * external API header
    2.30 + */
    2.31 +
    2.32 +
    2.33 +#define AV_STRINGIFY(s)         AV_TOSTRING(s)
    2.34 +#define AV_TOSTRING(s) #s
    2.35 +
    2.36 +#define AV_VERSION_INT(a, b, c) (a<<16 | b<<8 | c)
    2.37 +#define AV_VERSION_DOT(a, b, c) a ##.## b ##.## c
    2.38 +#define AV_VERSION(a, b, c) AV_VERSION_DOT(a, b, c)
    2.39 +
    2.40 +#define LIBAVUTIL_VERSION_MAJOR 49
    2.41 +#define LIBAVUTIL_VERSION_MINOR 14
    2.42 +#define LIBAVUTIL_VERSION_MICRO  0
    2.43 +
    2.44 +#define LIBAVUTIL_VERSION_INT   AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
    2.45 +                                               LIBAVUTIL_VERSION_MINOR, \
    2.46 +                                               LIBAVUTIL_VERSION_MICRO)
    2.47 +#define LIBAVUTIL_VERSION       AV_VERSION(LIBAVUTIL_VERSION_MAJOR,     \
    2.48 +                                           LIBAVUTIL_VERSION_MINOR,     \
    2.49 +                                           LIBAVUTIL_VERSION_MICRO)
    2.50 +#define LIBAVUTIL_BUILD         LIBAVUTIL_VERSION_INT
    2.51 +
    2.52 +#define LIBAVUTIL_IDENT         "Lavu" AV_STRINGIFY(LIBAVUTIL_VERSION)
    2.53 +
    2.54 +/**
    2.55 + * Returns the LIBAVUTIL_VERSION_INT constant.
    2.56 + */
    2.57 +unsigned avutil_version(void);
    2.58 +
    2.59 +#include "common.h"
    2.60 +#include "mathematics.h"
    2.61 +#include "rational.h"
    2.62 +#include "intfloat_readwrite.h"
    2.63 +#include "log.h"
    2.64 +
    2.65 +/**
    2.66 + * Pixel format. Notes:
    2.67 + *
    2.68 + * PIX_FMT_RGB32 is handled in an endian-specific manner. An RGBA
    2.69 + * color is put together as:
    2.70 + *  (A << 24) | (R << 16) | (G << 8) | B
    2.71 + * This is stored as BGRA on little-endian CPU architectures and ARGB on
    2.72 + * big-endian CPUs.
    2.73 + *
    2.74 + * When the pixel format is palettized RGB (PIX_FMT_PAL8), the palettized
    2.75 + * image data is stored in AVFrame.data[0]. The palette is transported in
    2.76 + * AVFrame.data[1], is 1024 bytes long (256 4-byte entries) and is
    2.77 + * formatted the same as in PIX_FMT_RGB32 described above (i.e., it is
    2.78 + * also endian-specific). Note also that the individual RGB palette
    2.79 + * components stored in AVFrame.data[1] should be in the range 0..255.
    2.80 + * This is important as many custom PAL8 video codecs that were designed
    2.81 + * to run on the IBM VGA graphics adapter use 6-bit palette components.
    2.82 + *
    2.83 + * For all the 8bit per pixel formats, an RGB32 palette is in data[1] like
    2.84 + * for pal8. This palette is filled in automatically by the function
    2.85 + * allocating the picture.
    2.86 + */
    2.87 +enum PixelFormat {
    2.88 +    PIX_FMT_NONE= -1,
    2.89 +    PIX_FMT_YUV420P,   ///< planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
    2.90 +    PIX_FMT_YUYV422,   ///< packed YUV 4:2:2, 16bpp, Y0 Cb Y1 Cr
    2.91 +    PIX_FMT_RGB24,     ///< packed RGB 8:8:8, 24bpp, RGBRGB...
    2.92 +    PIX_FMT_BGR24,     ///< packed RGB 8:8:8, 24bpp, BGRBGR...
    2.93 +    PIX_FMT_YUV422P,   ///< planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
    2.94 +    PIX_FMT_YUV444P,   ///< planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
    2.95 +    PIX_FMT_RGB32,     ///< packed RGB 8:8:8, 32bpp, (msb)8A 8R 8G 8B(lsb), in CPU endianness
    2.96 +    PIX_FMT_YUV410P,   ///< planar YUV 4:1:0,  9bpp, (1 Cr & Cb sample per 4x4 Y samples)
    2.97 +    PIX_FMT_YUV411P,   ///< planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples)
    2.98 +    PIX_FMT_RGB565,    ///< packed RGB 5:6:5, 16bpp, (msb)   5R 6G 5B(lsb), in CPU endianness
    2.99 +    PIX_FMT_RGB555,    ///< packed RGB 5:5:5, 16bpp, (msb)1A 5R 5G 5B(lsb), in CPU endianness, most significant bit to 0
   2.100 +    PIX_FMT_GRAY8,     ///<        Y        ,  8bpp
   2.101 +    PIX_FMT_MONOWHITE, ///<        Y        ,  1bpp, 0 is white, 1 is black
   2.102 +    PIX_FMT_MONOBLACK, ///<        Y        ,  1bpp, 0 is black, 1 is white
   2.103 +    PIX_FMT_PAL8,      ///< 8 bit with PIX_FMT_RGB32 palette
   2.104 +    PIX_FMT_YUVJ420P,  ///< planar YUV 4:2:0, 12bpp, full scale (JPEG)
   2.105 +    PIX_FMT_YUVJ422P,  ///< planar YUV 4:2:2, 16bpp, full scale (JPEG)
   2.106 +    PIX_FMT_YUVJ444P,  ///< planar YUV 4:4:4, 24bpp, full scale (JPEG)
   2.107 +    PIX_FMT_XVMC_MPEG2_MC,///< XVideo Motion Acceleration via common packet passing
   2.108 +    PIX_FMT_XVMC_MPEG2_IDCT,
   2.109 +    PIX_FMT_UYVY422,   ///< packed YUV 4:2:2, 16bpp, Cb Y0 Cr Y1
   2.110 +    PIX_FMT_UYYVYY411, ///< packed YUV 4:1:1, 12bpp, Cb Y0 Y1 Cr Y2 Y3
   2.111 +    PIX_FMT_BGR32,     ///< packed RGB 8:8:8, 32bpp, (msb)8A 8B 8G 8R(lsb), in CPU endianness
   2.112 +    PIX_FMT_BGR565,    ///< packed RGB 5:6:5, 16bpp, (msb)   5B 6G 5R(lsb), in CPU endianness
   2.113 +    PIX_FMT_BGR555,    ///< packed RGB 5:5:5, 16bpp, (msb)1A 5B 5G 5R(lsb), in CPU endianness, most significant bit to 1
   2.114 +    PIX_FMT_BGR8,      ///< packed RGB 3:3:2,  8bpp, (msb)2B 3G 3R(lsb)
   2.115 +    PIX_FMT_BGR4,      ///< packed RGB 1:2:1,  4bpp, (msb)1B 2G 1R(lsb)
   2.116 +    PIX_FMT_BGR4_BYTE, ///< packed RGB 1:2:1,  8bpp, (msb)1B 2G 1R(lsb)
   2.117 +    PIX_FMT_RGB8,      ///< packed RGB 3:3:2,  8bpp, (msb)2R 3G 3B(lsb)
   2.118 +    PIX_FMT_RGB4,      ///< packed RGB 1:2:1,  4bpp, (msb)1R 2G 1B(lsb)
   2.119 +    PIX_FMT_RGB4_BYTE, ///< packed RGB 1:2:1,  8bpp, (msb)1R 2G 1B(lsb)
   2.120 +    PIX_FMT_NV12,      ///< planar YUV 4:2:0, 12bpp, 1 plane for Y and 1 for UV
   2.121 +    PIX_FMT_NV21,      ///< as above, but U and V bytes are swapped
   2.122 +
   2.123 +    PIX_FMT_RGB32_1,   ///< packed RGB 8:8:8, 32bpp, (msb)8R 8G 8B 8A(lsb), in CPU endianness
   2.124 +    PIX_FMT_BGR32_1,   ///< packed RGB 8:8:8, 32bpp, (msb)8B 8G 8R 8A(lsb), in CPU endianness
   2.125 +
   2.126 +    PIX_FMT_GRAY16BE,  ///<        Y        , 16bpp, big-endian
   2.127 +    PIX_FMT_GRAY16LE,  ///<        Y        , 16bpp, little-endian
   2.128 +    PIX_FMT_YUV440P,   ///< planar YUV 4:4:0 (1 Cr & Cb sample per 1x2 Y samples)
   2.129 +    PIX_FMT_YUVJ440P,  ///< planar YUV 4:4:0 full scale (JPEG)
   2.130 +    PIX_FMT_YUVA420P,  ///< planar YUV 4:2:0, 20bpp, (1 Cr & Cb sample per 2x2 Y & A samples)
   2.131 +    PIX_FMT_VDPAU_H264,///< H.264 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
   2.132 +    PIX_FMT_VDPAU_MPEG1,///< MPEG-1 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
   2.133 +    PIX_FMT_VDPAU_MPEG2,///< MPEG-2 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
   2.134 +    PIX_FMT_VDPAU_WMV3,///< WMV3 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
   2.135 +    PIX_FMT_VDPAU_VC1, ///< VC-1 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
   2.136 +    PIX_FMT_NB,        ///< number of pixel formats, DO NOT USE THIS if you want to link with shared libav* because the number of formats might differ between versions
   2.137 +};
   2.138 +
   2.139 +#ifdef WORDS_BIGENDIAN
   2.140 +#define PIX_FMT_RGBA PIX_FMT_RGB32_1
   2.141 +#define PIX_FMT_BGRA PIX_FMT_BGR32_1
   2.142 +#define PIX_FMT_ARGB PIX_FMT_RGB32
   2.143 +#define PIX_FMT_ABGR PIX_FMT_BGR32
   2.144 +#define PIX_FMT_GRAY16 PIX_FMT_GRAY16BE
   2.145 +#else
   2.146 +#define PIX_FMT_RGBA PIX_FMT_BGR32
   2.147 +#define PIX_FMT_BGRA PIX_FMT_RGB32
   2.148 +#define PIX_FMT_ARGB PIX_FMT_BGR32_1
   2.149 +#define PIX_FMT_ABGR PIX_FMT_RGB32_1
   2.150 +#define PIX_FMT_GRAY16 PIX_FMT_GRAY16LE
   2.151 +#endif
   2.152 +
   2.153 +#if LIBAVUTIL_VERSION_INT < (50<<16)
   2.154 +#define PIX_FMT_UYVY411 PIX_FMT_UYYVYY411
   2.155 +#define PIX_FMT_RGBA32  PIX_FMT_RGB32
   2.156 +#define PIX_FMT_YUV422  PIX_FMT_YUYV422
   2.157 +#endif
   2.158 +
   2.159 +#endif /* AVUTIL_AVUTIL_H */
     3.1 --- a/ffmpeg/receipt	Tue Apr 21 13:37:42 2009 +0000
     3.2 +++ b/ffmpeg/receipt	Tue Apr 21 21:25:07 2009 +0000
     3.3 @@ -6,24 +6,25 @@
     3.4  SHORT_DESC="Record, convert and stream audio and video."
     3.5  MAINTAINER="pascal.bellard@slitaz.org"
     3.6  WEB_SITE="http://ffmpeg.org/"
     3.7 -DEPENDS="bzlib freetype libSDL libiconv imlib2"
     3.8  BUILD_DEPENDS="subversion"
     3.9  
    3.10  
    3.11 -
    3.12  # Référence externe extraite à la révision 27917.
    3.13  # 
    3.14 -# Révision 15261 extraite. 
    3.15 +# Révision 18330 extraite. 
    3.16  
    3.17  # Rules to configure and make the package.
    3.18  compile_rules()
    3.19  {
    3.20  	mkdir $src 2> /dev/null
    3.21  	cd $src
    3.22 -	[ -f ffmpeg/configure ] || svn checkout -r $VERSION \
    3.23 +	[ -f ffmpeg/configure ] || svn checkout -r 'HEAD' \
    3.24  		svn://svn.ffmpeg.org/ffmpeg/trunk ffmpeg
    3.25  	cd ffmpeg
    3.26  	sed -i 's/pr -. -t/cat/' configure
    3.27 +	# mktemp busybox hack patch
    3.28 +	patch -p1 < ../../stuff/build.patch
    3.29 +	
    3.30  	./configure --prefix=/usr --enable-gpl \
    3.31  	--arch=i486 --cpu=i486 \
    3.32  	--enable-shared --enable-small \
    3.33 @@ -36,9 +37,9 @@
    3.34  # Rules to gen a SliTaz package suitable for Tazpkg.
    3.35  genpkg_rules()
    3.36  {
    3.37 -	mkdir -p $fs/usr/lib $fs/usr/bin
    3.38 -	cp -a $_pkg/usr/lib/vhook $fs/usr/lib
    3.39 +	mkdir -p $fs/usr/lib 
    3.40  	cp -a $_pkg/usr/lib/*so* $fs/usr/lib
    3.41 -	cp -a $_pkg/usr/bin $fs/usr/		
    3.42 +	cp -a $_pkg/usr/bin $fs/usr
    3.43 +			
    3.44  }
    3.45  
     4.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.2 +++ b/ffmpeg/stuff/build.patch	Tue Apr 21 21:25:07 2009 +0000
     4.3 @@ -0,0 +1,42 @@
     4.4 +--- configure	Tue Apr 21 20:37:50 2009
     4.5 ++++ configure	Tue Apr 21 20:53:07 2009
     4.6 +@@ -1371,33 +1371,13 @@
     4.7 + : ${TMPDIR:=$TMP}
     4.8 + : ${TMPDIR:=/tmp}
     4.9 + 
    4.10 +-if ! check_cmd type mktemp; then
    4.11 +-    # simple replacement for missing mktemp
    4.12 +-    # NOT SAFE FOR GENERAL USE
    4.13 +-    mktemp(){
    4.14 +-        echo "${2%XXX*}.${HOSTNAME}.${UID}.$$"
    4.15 +-    }
    4.16 +-fi
    4.17 + 
    4.18 +-tmpfile(){
    4.19 +-    tmp=$(mktemp -u "${TMPDIR}/ffconf.XXXXXXXX")$2 &&
    4.20 +-        (set -C; exec > $tmp) 2>/dev/null ||
    4.21 +-        die "Unable to create temoporary file in $TMPDIR."
    4.22 +-    append TMPFILES $tmp
    4.23 +-    eval $1=$tmp
    4.24 +-}
    4.25 +-
    4.26 +-trap 'rm -f -- $TMPFILES' EXIT
    4.27 +-trap exit HUP INT TERM
    4.28 +-
    4.29 +-tmpfile TMPC  .c
    4.30 +-tmpfile TMPE  $EXESUF
    4.31 +-tmpfile TMPH  .h
    4.32 +-tmpfile TMPO  .o
    4.33 +-tmpfile TMPS  .S
    4.34 +-tmpfile TMPSH .sh
    4.35 +-
    4.36 +-unset -f mktemp
    4.37 ++TMPC="${TMPDIR}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.c"
    4.38 ++TMPE="${TMPDIR}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}${EXESUF}"
    4.39 ++TMPH="${TMPDIR}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.h"
    4.40 ++TMPO="${TMPDIR}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.o"
    4.41 ++TMPS="${TMPDIR}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.S"
    4.42 ++TMPSH="${TMPDIR}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.sh"
    4.43 + 
    4.44 + # make sure we can execute files in $TMPDIR
    4.45 + cat > $TMPSH 2>> $logfile <<EOF