ffmpeg: add 0.10.14. GCC2 only, does not compile on GCC4.

Already tried for GCC4:
  * -fstack-check=no
  * --enable-pic
  * --disable-pic
  * -O3, -O2
... all of which were listed as solving the problem by various Linux
distros. Will try for FFmpeg 2.2 next.
This commit is contained in:
Augustin Cavalier
2014-07-28 14:31:02 -04:00
parent 4038f2a711
commit 16ee50dad0
2 changed files with 273 additions and 74 deletions

View File

@@ -0,0 +1,163 @@
SUMMARY="Audio and video recording, conversion, and streaming library"
DESCRIPTION="
FFmpeg is a complete, cross-platform solution to record, convert and stream \
audio and video. It includes libavcodec - the leading audio/video codec library.
"
HOMEPAGE="http://www.ffmpeg.org"
LICENSE="
GNU LGPL v2.1
GNU GPL v2
"
COPYRIGHT="
2000-2003 Fabrice Bellard
2003-2012 the FFmpeg developers
"
SRC_URI="http://www.ffmpeg.org/releases/ffmpeg-0.10.14.tar.bz2"
CHECKSUM_SHA256="1ef77533f3803b8630403df413005c1c41b18c50b16895815182fd70d2f833bb"
REVISION="1"
ARCHITECTURES="x86_gcc2 !x86 !x86_64"
SECONDARY_ARCHITECTURES="x86_gcc2 !x86"
if [ $effectiveTargetArchitecture == x86_gcc2 ]; then
PATCHES="ffmpeg-0.10.14-gcc2.patch"
fi
PROVIDES="
ffmpeg$secondaryArchSuffix = $portVersion compat >= 0.10
lib:libavutil$secondaryArchSuffix = 51.35.100 compat >= 51
lib:libavcodec$secondaryArchSuffix = 53.61.100 compat >= 53
lib:libavformat$secondaryArchSuffix = 53.32.100 compat >= 53
lib:libavdevice$secondaryArchSuffix = 53.4.100 compat >= 53
lib:libavfilter$secondaryArchSuffix = 2.61.100 compat >= 2
lib:libswscale$secondaryArchSuffix = 2.1.100 compat >= 2
lib:libswresample$secondaryArchSuffix = 0.6.100 compat >= 0
"
if [ -z "$secondaryArchSuffix" ]; then
PROVIDES="$PROVIDES
cmd:ffmpeg = $portVersion compat >= 0.10
cmd:ffprobe = $portVersion compat >= 0.10
cmd:ffserver = $portVersion compat >= 0.10
"
fi
REQUIRES="
haiku$secondaryArchSuffix >= $haikuVersion
lib:libbz2$secondaryArchSuffix
lib:libogg$secondaryArchSuffix
lib:libspeex$secondaryArchSuffix
lib:libtheoradec$secondaryArchSuffix
lib:libtheoraenc$secondaryArchSuffix
lib:libvorbis$secondaryArchSuffix
lib:libvorbisenc$secondaryArchSuffix
lib:libvpx$secondaryArchSuffix
lib:libz$secondaryArchSuffix
"
BUILD_REQUIRES="
devel:libbz2$secondaryArchSuffix
devel:libogg$secondaryArchSuffix
devel:libspeex$secondaryArchSuffix
devel:libtheora$secondaryArchSuffix
devel:libvorbis$secondaryArchSuffix
devel:libvpx$secondaryArchSuffix
devel:libz$secondaryArchSuffix
"
BUILD_PREREQUIRES="
haiku${secondaryArchSuffix}_devel >= $haikuVersion
cmd:gcc$secondaryArchSuffix
cmd:ld$secondaryArchSuffix
cmd:awk
cmd:make
cmd:perl
cmd:pkg_config$secondaryArchSuffix
cmd:texi2html
cmd:yasm
"
GLOBAL_WRITABLE_FILES="
settings/ffserver.conf
"
PATCH()
{
# patch hard-coded config file path
sed -i "s,/etc/ffserver.conf,$sysconfDir/ffserver.conf," \
ffserver.c \
doc/ffserver.texi
# patch hard-coded paths to perl
sed -i "s,/usr/bin/perl,$portPackageLinksDir/cmd~perl/bin/perl," \
Doxyfile \
doc/texi2pod.pl
}
BUILD()
{
# not an autotools configure
./configure \
--prefix=$prefix \
--bindir=$binDir \
--datadir=$dataDir/$portName \
--incdir=$includeDir \
--libdir=$libDir \
--shlibdir=$libDir \
--mandir=$manDir \
--disable-debug \
--enable-shared \
--enable-libvorbis \
--enable-libspeex \
--enable-libtheora \
--enable-libvpx
make $jobArgs
}
INSTALL()
{
make install
rm $binDir/ffprobe
# TODO: Determine and fix what is wrong with ffprobe! The executable
# seems to be broken. The NEEDED entries in the dynamic section look
# weird and the runtime loader fails relocating with "Operation not
# allowed".
prepareInstalledDevelLibs \
libavcodec \
libavdevice \
libavfilter \
libavformat \
libavutil \
libswresample \
libswscale
fixPkgconfig
# include the documented ffserver.conf
mkdir -p $docDir
cp doc/ffserver.conf $docDir
# devel package
packageEntries devel \
$developDir
# Remove stuff we don't need in the secondary architecture base package.
if [ -n "$secondaryArchSuffix" ]; then
rm -rf $prefix/bin
rm -rf $documentationDir
fi
}
# ----- devel package -------------------------------------------------------
PROVIDES_devel="
ffmpeg${secondaryArchSuffix}_devel = $portVersion compat >= 0.10
devel:libavcodec$secondaryArchSuffix = 53.61.100 compat >= 53
devel:libavdevice$secondaryArchSuffix = 53.4.100 compat >= 53
devel:libavfilter$secondaryArchSuffix = 2.61.100 compat >= 2
devel:libavformat$secondaryArchSuffix = 53.32.100 compat >= 53
devel:libavutil$secondaryArchSuffix = 51.35.100 compat >= 51
devel:libswresample$secondaryArchSuffix = 0.6.100 compat >= 0
devel:libswscale$secondaryArchSuffix = 2.1.100 compat >= 2
"
REQUIRES_devel="
ffmpeg$secondaryArchSuffix == $portVersion
"

View File

@@ -1,7 +1,23 @@
From d2b98bf18abba445faed19bb2f796f9278f271ed Mon Sep 17 00:00:00 2001
From: Augustin Cavalier <waddlesplash@gmail.com>
Date: Mon, 28 Jul 2014 12:01:53 -0400
Subject: [PATCH] Make FFmpeg 0.10.14 compile on x86_gcc2.
---
cmdutils.c | 2 +-
configure | 12 +++---------
ffmpeg.c | 6 ++++--
ffprobe.c | 15 ++++++++++-----
libavcodec/aacenc.c | 6 ++++--
libavcodec/pngenc.c | 5 +++--
libavutil/pixdesc.c | 16 ----------------
libswscale/swscale_unscaled.c | 32 ++++++++++++++++++++------------
8 files changed, 45 insertions(+), 49 deletions(-)
diff --git a/cmdutils.c b/cmdutils.c
index 386db3d..f918600 100644
--- ffmpeg-0.10/cmdutils.c
+++ ffmpeg-0.10/cmdutils.c
index 01abc51..ea73b8c 100644
--- a/cmdutils.c
+++ b/cmdutils.c
@@ -89,7 +89,7 @@ static void log_callback_report(void *ptr, int level, const char *fmt, va_list v
char line[1024];
static int print_prefix = 1;
@@ -11,10 +27,68 @@ index 386db3d..f918600 100644
av_log_default_callback(ptr, level, fmt, vl);
av_log_format_line(ptr, level, fmt, vl2, line, sizeof(line), &print_prefix);
va_end(vl2);
diff --git a/configure b/configure
index b65cefe..8c6b676 100755
--- a/configure
+++ b/configure
@@ -1369,7 +1369,6 @@ avx_deps="ssse3"
aligned_stack_if_any="ppc x86"
fast_64bit_if_any="alpha ia64 mips64 parisc64 ppc64 sparc64 x86_64"
-fast_clz_if_any="alpha armv5te avr32 mips ppc x86"
fast_unaligned_if_any="armv6 ppc x86"
inline_asm_deps="!tms470"
@@ -1876,7 +1875,7 @@ AS_O='-o $@'
CC_O='-o $@'
CXX_O='-o $@'
-host_cflags='-D_ISOC99_SOURCE -O3 -g'
+host_cflags='-D_ISOC99_SOURCE -O2 -g'
host_libs='-lm'
target_path='$(CURDIR)'
@@ -1958,6 +1957,7 @@ for n in $COMPONENT_LIST; do
done
enable $ARCH_EXT_LIST $ALL_TESTS
+disable sse
die_unknown(){
echo "Unknown option \"$1\"."
@@ -2154,7 +2154,7 @@ elif $cc -v 2>&1 | grep -qi ^gcc; then
CC_DEPFLAGS='-MMD -MF $(@:.o=.d) -MT $@'
AS_DEPFLAGS='-MMD -MF $(@:.o=.d) -MT $@'
fi
- speed_cflags='-O3'
+ speed_cflags='-O2'
size_cflags='-Os'
elif $cc --version 2>/dev/null | grep -q Intel; then
cc_type=icc
@@ -2841,10 +2841,6 @@ check_cc <<EOF && enable attribute_packed
struct { int x; } __attribute__((packed)) x;
EOF
-check_cc <<EOF && enable attribute_may_alias
-union { int x; } __attribute__((may_alias)) x;
-EOF
-
check_cc <<EOF || die "endian test failed"
unsigned int endian = 'B' << 24 | 'I' << 16 | 'G' << 8 | 'E';
EOF
@@ -3116,8 +3112,6 @@ disabled crystalhd || check_lib libcrystalhd/libcrystalhd_if.h DtsCrystalHDVersi
enabled vaapi && require vaapi va/va.h vaInitialize -lva
check_mathfunc cbrtf
-check_mathfunc exp2
-check_mathfunc exp2f
check_mathfunc llrint
check_mathfunc llrintf
check_mathfunc log2
diff --git a/ffmpeg.c b/ffmpeg.c
index 463e1f4..245e8b5 100644
--- ffmpeg-0.10/ffmpeg.c
+++ ffmpeg-0.10/ffmpeg.c
index 2d2d081..de93ea2 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -1247,9 +1247,11 @@ need_realloc:
av_fifo_size(ost->fifo) / (enc->channels * osize); // FIXME wrong
@@ -30,9 +104,9 @@ index 463e1f4..245e8b5 100644
} else {
buftmp = buf;
diff --git a/ffprobe.c b/ffprobe.c
index ca6133e..43f9d39 100644
--- ffmpeg-0.10/ffprobe.c
+++ ffmpeg-0.10/ffprobe.c
index 48c813a..be3d3ad 100644
--- a/ffprobe.c
+++ b/ffprobe.c
@@ -293,7 +293,9 @@ static void writer_print_time(WriterContext *wctx, const char *key,
writer_print_string(wctx, key, "N/A", 1);
} else {
@@ -92,9 +166,9 @@ index ca6133e..43f9d39 100644
show_tags(fmt_ctx->metadata);
print_section_footer("format");
diff --git a/libavcodec/aacenc.c b/libavcodec/aacenc.c
index 55f0286..35d5f1a 100644
--- ffmpeg-0.10/libavcodec/aacenc.c
+++ ffmpeg-0.10/libavcodec/aacenc.c
index 2ff6f9c..344fbd4 100644
--- a/libavcodec/aacenc.c
+++ b/libavcodec/aacenc.c
@@ -223,8 +223,9 @@ WINDOW_FUNC(eight_short)
const float *pwindow = sce->ics.use_kb_window[1] ? ff_aac_kbd_short_128 : ff_sine_128;
const float *in = audio + 448;
@@ -120,10 +194,26 @@ index 55f0286..35d5f1a 100644
s->planar_samples[ch] = s->buffer.samples + 3 * 1024 * ch;
return 0;
diff --git a/libavcodec/pngenc.c b/libavcodec/pngenc.c
index d36914a..103b742 100644
--- a/libavcodec/pngenc.c
+++ b/libavcodec/pngenc.c
@@ -54,8 +54,9 @@ static void png_get_interlaced_row(uint8_t *dst, int row_size,
int x, mask, dst_x, j, b, bpp;
uint8_t *d;
const uint8_t *s;
-
- mask = (int[]){0x80, 0x08, 0x88, 0x22, 0xaa, 0x55, 0xff}[pass];
+ int mask_tmp[] = {0x80, 0x08, 0x88, 0x22, 0xaa, 0x55, 0xff};
+
+ mask = mask_tmp[pass];
switch(bits_per_pixel) {
case 1:
memset(dst, 0, row_size);
diff --git a/libavutil/pixdesc.c b/libavutil/pixdesc.c
index e73fbfe..3cde56c 100644
--- ffmpeg-0.10/libavutil/pixdesc.c
+++ ffmpeg-0.10/libavutil/pixdesc.c
--- a/libavutil/pixdesc.c
+++ b/libavutil/pixdesc.c
@@ -1096,12 +1096,6 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = {
.log2_chroma_h = 1,
.flags = PIX_FMT_HWACCEL,
@@ -155,9 +245,9 @@ index e73fbfe..3cde56c 100644
.name = "gbrp",
.nb_components = 3,
diff --git a/libswscale/swscale_unscaled.c b/libswscale/swscale_unscaled.c
index e1ba799..3820056 100644
--- ffmpeg-0.10/libswscale/swscale_unscaled.c
+++ ffmpeg-0.10/libswscale/swscale_unscaled.c
index d4b39f4..b98d38a 100644
--- a/libswscale/swscale_unscaled.c
+++ b/libswscale/swscale_unscaled.c
@@ -370,30 +370,38 @@ static int planarRgbToRgbWrapper(SwsContext *c, const uint8_t* src[], int srcStr
}
@@ -209,60 +299,6 @@ index e1ba799..3820056 100644
default:
av_log(c, AV_LOG_ERROR, "unsupported planar RGB conversion %s -> %s\n",
av_get_pix_fmt_name(c->srcFormat), av_get_pix_fmt_name(c->dstFormat));
diff --git a/configure b/configure
--- ffmpeg-0.10/configure 2012-01-26 22:15:59.047710208 +0000
+++ ffmpeg-0.10-haiku/configure 2012-03-28 22:30:34.330563584 +0000
@@ -1359,7 +1359,6 @@
aligned_stack_if_any="ppc x86"
fast_64bit_if_any="alpha ia64 mips64 parisc64 ppc64 sparc64 x86_64"
-fast_clz_if_any="alpha armv5te avr32 mips ppc x86"
fast_unaligned_if_any="armv6 ppc x86"
inline_asm_deps="!tms470"
@@ -1866,7 +1865,7 @@
CC_O='-o $@'
CXX_O='-o $@'
-host_cflags='-D_ISOC99_SOURCE -O3 -g'
+host_cflags='-D_ISOC99_SOURCE -O2 -g'
host_libs='-lm'
target_path='$(CURDIR)'
@@ -1948,6 +1947,7 @@
done
enable $ARCH_EXT_LIST $ALL_TESTS
+disable sse
die_unknown(){
echo "Unknown option \"$1\"."
@@ -2144,7 +2144,7 @@
CC_DEPFLAGS='-MMD -MF $(@:.o=.d) -MT $@'
AS_DEPFLAGS='-MMD -MF $(@:.o=.d) -MT $@'
fi
- speed_cflags='-O3'
+ speed_cflags='-O2'
size_cflags='-Os'
elif $cc --version 2>/dev/null | grep -q Intel; then
cc_type=icc
@@ -2831,10 +2831,6 @@
struct { int x; } __attribute__((packed)) x;
EOF
-check_cc <<EOF && enable attribute_may_alias
-union { int x; } __attribute__((may_alias)) x;
-EOF
-
check_cc <<EOF || die "endian test failed"
unsigned int endian = 'B' << 24 | 'I' << 16 | 'G' << 8 | 'E';
EOF
@@ -3108,8 +3104,6 @@
enabled vaapi && require vaapi va/va.h vaInitialize -lva
check_mathfunc cbrtf
-check_mathfunc exp2
-check_mathfunc exp2f
check_mathfunc llrint
check_mathfunc llrintf
check_mathfunc log2
--
1.8.3.4