Switch to FFMPEG v2diff -r1.97 -r1.98 pkgsrc/multimedia/transcode/Makefile
(adam)
@@ -1,68 +1,69 @@ | @@ -1,68 +1,69 @@ | |||
1 | # $NetBSD: Makefile,v 1.97 2015/11/18 14:19:53 ryoon Exp $ | 1 | # $NetBSD: Makefile,v 1.98 2015/11/21 17:14:26 adam Exp $ | |
2 | 2 | |||
3 | DISTNAME= transcode-1.1.7 | 3 | DISTNAME= transcode-1.1.7 | |
4 | PKGREVISION= 16 | 4 | PKGREVISION= 17 | |
5 | CATEGORIES= multimedia | 5 | CATEGORIES= multimedia | |
6 | #MASTER_SITES= http://download.berlios.de/tcforge/ | |||
7 | MASTER_SITES= http://bitbucket.org/france/transcode-tcforge/downloads/ | 6 | MASTER_SITES= http://bitbucket.org/france/transcode-tcforge/downloads/ | |
8 | EXTRACT_SUFX= .tar.bz2 | 7 | EXTRACT_SUFX= .tar.bz2 | |
9 | 8 | |||
10 | MAINTAINER= pkgsrc-users@NetBSD.org | 9 | MAINTAINER= pkgsrc-users@NetBSD.org | |
11 | HOMEPAGE= http://tcforge.berlios.de/ | 10 | HOMEPAGE= http://tcforge.berlios.de/ | |
12 | COMMENT= Command line video-stream processing tool | 11 | COMMENT= Command line video-stream processing tool | |
12 | LICENSE= gnu-gpl-v2 | |||
13 | 13 | |||
14 | USE_LANGUAGES= c c++ | 14 | USE_LANGUAGES= c c++ | |
15 | USE_LIBTOOL= yes | 15 | USE_LIBTOOL= yes | |
16 | USE_TOOLS+= awk:run gmake pkg-config | 16 | USE_TOOLS+= awk:run gmake pkg-config | |
17 | GNU_CONFIGURE= yes | 17 | GNU_CONFIGURE= yes | |
18 | CONFIGURE_ARGS+= --disable-xio | 18 | CONFIGURE_ARGS+= --disable-xio | |
19 | CONFIGURE_ARGS+= --enable-freetype2 | |||
19 | CONFIGURE_ARGS+= --enable-libmpeg2 | 20 | CONFIGURE_ARGS+= --enable-libmpeg2 | |
20 | CONFIGURE_ARGS+= --enable-libmpeg2convert | 21 | CONFIGURE_ARGS+= --enable-libmpeg2convert | |
21 | CONFIGURE_ARGS+= --enable-libpostproc | 22 | CONFIGURE_ARGS+= --enable-libpostproc | |
22 | CONFIGURE_ARGS+= --enable-ogg | 23 | CONFIGURE_ARGS+= --enable-ogg | |
23 | CONFIGURE_ARGS+= --enable-theora | 24 | CONFIGURE_ARGS+= --enable-theora | |
24 | CONFIGURE_ARGS+= --enable-vorbis | 25 | CONFIGURE_ARGS+= --enable-vorbis | |
25 | CONFIGURE_ARGS+= --enable-xvid | 26 | CONFIGURE_ARGS+= --enable-xvid | |
26 | CONFIGURE_ARGS+= --with-libavcodec-prefix=${BUILDLINK_PREFIX.ffmpeg} | 27 | CONFIGURE_ARGS+= --with-libavcodec-prefix=${BUILDLINK_PREFIX.ffmpeg} | |
27 | CONFIGURE_ENV+= PATH_TO_AWK=${AWK:Q} | 28 | CONFIGURE_ENV+= PATH_TO_AWK=${AWK:Q} | |
28 | 29 | |||
29 | PTHREAD_AUTO_VARS= yes | 30 | PTHREAD_AUTO_VARS= yes | |
30 | PTHREAD_OPTS= require | 31 | PTHREAD_OPTS= require | |
31 | 32 | |||
32 | .include "../../mk/bsd.prefs.mk" | 33 | .include "../../mk/bsd.prefs.mk" | |
33 | 34 | |||
35 | PLIST_VARS+= i386 oss x11 | |||
36 | ||||
34 | .if ${MACHINE_ARCH} == "i386" | 37 | .if ${MACHINE_ARCH} == "i386" | |
35 | PLIST.i386= yes | 38 | PLIST.i386= yes | |
36 | .endif | 39 | .endif | |
37 | 40 | |||
38 | PLIST_VARS+= i386 oss x11 | |||
39 | ||||
40 | .if ${OPSYS} != "Darwin" | 41 | .if ${OPSYS} != "Darwin" | |
41 | CONFIGURE_ARGS+= --enable-oss | 42 | CONFIGURE_ARGS+= --enable-oss | |
42 | PLIST.oss= yes | 43 | PLIST.oss= yes | |
43 | PLIST.x11= yes | 44 | PLIST.x11= yes | |
44 | LIBS+= ${LIBOSSAUDIO} | 45 | LIBS+= ${LIBOSSAUDIO} | |
45 | .endif | 46 | .endif | |
46 | 47 | |||
47 | .include "options.mk" | 48 | .include "options.mk" | |
48 | 49 | |||
49 | .include "../../audio/lame/buildlink3.mk" | 50 | .include "../../audio/lame/buildlink3.mk" | |
50 | .include "../../audio/libvorbis/buildlink3.mk" | 51 | .include "../../audio/libvorbis/buildlink3.mk" | |
51 | .include "../../converters/libiconv/buildlink3.mk" | 52 | .include "../../converters/libiconv/buildlink3.mk" | |
52 | .include "../../devel/zlib/buildlink3.mk" | 53 | .include "../../devel/zlib/buildlink3.mk" | |
53 | .include "../../graphics/freetype2/buildlink3.mk" | 54 | .include "../../graphics/freetype2/buildlink3.mk" | |
54 | .include "../../graphics/png/buildlink3.mk" | 55 | .include "../../graphics/png/buildlink3.mk" | |
55 | .include "../../multimedia/ffmpeg1/buildlink3.mk" | 56 | .include "../../multimedia/ffmpeg2/buildlink3.mk" | |
56 | .include "../../multimedia/libdvdread/buildlink3.mk" | 57 | .include "../../multimedia/libdvdread/buildlink3.mk" | |
57 | .include "../../multimedia/libmpeg2/buildlink3.mk" | 58 | .include "../../multimedia/libmpeg2/buildlink3.mk" | |
58 | .include "../../multimedia/libogg/buildlink3.mk" | 59 | .include "../../multimedia/libogg/buildlink3.mk" | |
59 | .include "../../multimedia/libtheora/buildlink3.mk" | 60 | .include "../../multimedia/libtheora/buildlink3.mk" | |
60 | .if ${OPSYS} != "Darwin" | 61 | .if ${OPSYS} != "Darwin" | |
61 | .include "../../x11/libXaw/buildlink3.mk" | 62 | .include "../../x11/libXaw/buildlink3.mk" | |
62 | .include "../../x11/libXext/buildlink3.mk" | 63 | .include "../../x11/libXext/buildlink3.mk" | |
63 | .include "../../x11/libXpm/buildlink3.mk" | 64 | .include "../../x11/libXpm/buildlink3.mk" | |
64 | .include "../../x11/libXv/buildlink3.mk" | 65 | .include "../../x11/libXv/buildlink3.mk" | |
65 | .include "../../mk/oss.buildlink3.mk" | 66 | .include "../../mk/oss.buildlink3.mk" | |
66 | .endif | 67 | .endif | |
67 | .include "../../mk/jpeg.buildlink3.mk" | 68 | .include "../../mk/jpeg.buildlink3.mk" | |
68 | .include "../../mk/pthread.buildlink3.mk" | 69 | .include "../../mk/pthread.buildlink3.mk" |
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | @comment $NetBSD: PLIST,v 1.17 2012/07/07 15:50:19 adam Exp $ | 1 | @comment $NetBSD: PLIST,v 1.18 2015/11/21 17:14:26 adam Exp $ | |
2 | bin/avifix | 2 | bin/avifix | |
3 | bin/aviindex | 3 | bin/aviindex | |
4 | bin/avimerge | 4 | bin/avimerge | |
5 | bin/avisplit | 5 | bin/avisplit | |
6 | bin/avisync | 6 | bin/avisync | |
7 | bin/tccat | 7 | bin/tccat | |
8 | bin/tcdecode | 8 | bin/tcdecode | |
9 | bin/tcdemux | 9 | bin/tcdemux | |
10 | bin/tcextract | 10 | bin/tcextract | |
11 | bin/tcmodinfo | 11 | bin/tcmodinfo | |
12 | bin/tcmp3cut | 12 | bin/tcmp3cut | |
13 | bin/tcprobe | 13 | bin/tcprobe | |
14 | bin/tcscan | 14 | bin/tcscan | |
@@ -79,27 +79,27 @@ lib/transcode/filter_null.la | @@ -79,27 +79,27 @@ lib/transcode/filter_null.la | |||
79 | lib/transcode/filter_pp.la | 79 | lib/transcode/filter_pp.la | |
80 | ${PLIST.dv}lib/transcode/filter_preview.la | 80 | ${PLIST.dv}lib/transcode/filter_preview.la | |
81 | ${PLIST.x11}lib/transcode/filter_pv.la | 81 | ${PLIST.x11}lib/transcode/filter_pv.la | |
82 | lib/transcode/filter_resample.la | 82 | lib/transcode/filter_resample.la | |
83 | lib/transcode/filter_skip.la | 83 | lib/transcode/filter_skip.la | |
84 | lib/transcode/filter_slowmo.la | 84 | lib/transcode/filter_slowmo.la | |
85 | lib/transcode/filter_smartbob.la | 85 | lib/transcode/filter_smartbob.la | |
86 | lib/transcode/filter_smartdeinter.la | 86 | lib/transcode/filter_smartdeinter.la | |
87 | lib/transcode/filter_smartyuv.la | 87 | lib/transcode/filter_smartyuv.la | |
88 | lib/transcode/filter_smooth.la | 88 | lib/transcode/filter_smooth.la | |
89 | lib/transcode/filter_stabilize.la | 89 | lib/transcode/filter_stabilize.la | |
90 | ${PLIST.x11}lib/transcode/filter_subtitler.la | 90 | ${PLIST.x11}lib/transcode/filter_subtitler.la | |
91 | lib/transcode/filter_testframe.la | 91 | lib/transcode/filter_testframe.la | |
92 | ${PLIST.freetype2}lib/transcode/filter_text.la | 92 | lib/transcode/filter_text.la | |
93 | ${PLIST.i386}lib/transcode/filter_tomsmocomp.la | 93 | ${PLIST.i386}lib/transcode/filter_tomsmocomp.la | |
94 | lib/transcode/filter_transform.la | 94 | lib/transcode/filter_transform.la | |
95 | lib/transcode/filter_unsharp.la | 95 | lib/transcode/filter_unsharp.la | |
96 | lib/transcode/filter_whitebalance.la | 96 | lib/transcode/filter_whitebalance.la | |
97 | lib/transcode/filter_xsharpen.la | 97 | lib/transcode/filter_xsharpen.la | |
98 | lib/transcode/filter_yait.la | 98 | lib/transcode/filter_yait.la | |
99 | lib/transcode/filter_yuvdenoise.la | 99 | lib/transcode/filter_yuvdenoise.la | |
100 | lib/transcode/filter_yuvmedian.la | 100 | lib/transcode/filter_yuvmedian.la | |
101 | lib/transcode/import_ac3.la | 101 | lib/transcode/import_ac3.la | |
102 | lib/transcode/import_avi.la | 102 | lib/transcode/import_avi.la | |
103 | lib/transcode/import_bsdav.la | 103 | lib/transcode/import_bsdav.la | |
104 | lib/transcode/import_dv.la | 104 | lib/transcode/import_dv.la | |
105 | lib/transcode/import_dvd.la | 105 | lib/transcode/import_dvd.la |
@@ -1,18 +1,20 @@ | @@ -1,18 +1,20 @@ | |||
1 | $NetBSD: distinfo,v 1.24 2015/11/03 23:54:33 agc Exp $ | 1 | $NetBSD: distinfo,v 1.25 2015/11/21 17:14:26 adam Exp $ | |
2 | 2 | |||
3 | SHA1 (transcode-1.1.7.tar.bz2) = e35df68b960eb56ef0a59a4cdbed1491be56aee6 | 3 | SHA1 (transcode-1.1.7.tar.bz2) = e35df68b960eb56ef0a59a4cdbed1491be56aee6 | |
4 | RMD160 (transcode-1.1.7.tar.bz2) = faa854acbbfd52faaa216505176f94d756d77841 | 4 | RMD160 (transcode-1.1.7.tar.bz2) = faa854acbbfd52faaa216505176f94d756d77841 | |
5 | SHA512 (transcode-1.1.7.tar.bz2) = d6f9674f3f5c3346194120585741ca660eb9ee133085cfce9460a14eaa0cf16fdf291761bd1db78e1c784e4d69a9481c7470cf8357dc7638ee3017620500f45f | 5 | SHA512 (transcode-1.1.7.tar.bz2) = d6f9674f3f5c3346194120585741ca660eb9ee133085cfce9460a14eaa0cf16fdf291761bd1db78e1c784e4d69a9481c7470cf8357dc7638ee3017620500f45f | |
6 | Size (transcode-1.1.7.tar.bz2) = 2183627 bytes | 6 | Size (transcode-1.1.7.tar.bz2) = 2183627 bytes | |
7 | SHA1 (patch-ac) = 3a738bc76d427d28a1c03edfcef7dc227537bc3b | 7 | SHA1 (patch-avilib_avidump.c) = 640aac6fc274a685b1847b48870b37b2c2ab1e88 | |
8 | SHA1 (patch-aw) = a2a118bad9e3783f98e8cbfa62cff8771118ac17 | 8 | SHA1 (patch-configure) = 43010b1f4679be42fd3d7e6ac0948a0e08988b44 | |
9 | SHA1 (patch-ax) = 4e767e6ab77e49bb375de55457e3956e1531c7bb | 9 | SHA1 (patch-encode_encode_lavc.c) = c33f40dab212b601e5d808d972d132db4eee2d2e | |
10 | SHA1 (patch-ba) = 92f31ca0d49cee2883d278b443b1d616381fee2d | 10 | SHA1 (patch-export_aud__aux.c) = 84b774d13e363721db692b1edc53589e165b094e | |
11 | SHA1 (patch-encode_encode_lavc.c) = b93926d54f149fabfc35051c7bfb800efd3892cf | 11 | SHA1 (patch-export_export_ffmpeg.c) = 4367d16ba83ccc5c868f0dc470dcd0b64770b185 | |
12 | SHA1 (patch-export_export_ffmpeg.c) = 1559892fb1c13c3bd6be32ae9b5a1d04348139e9 | 12 | SHA1 (patch-export_ffmpeg_cfg.c) = 216f7970f3885a3f7fc8c229e4d1950cd6430cff | |
13 | SHA1 (patch-export_ffmpeg_cfg.c) = c48acb7c9163f45fc1aa02216e083594fee67331 | 13 | SHA1 (patch-export_ffmpeg_cfg.h) = 7cf230de948de004cc0500f0ae2511561081e952 | |
14 | SHA1 (patch-filter_filter__pp.c) = a7a3f9c49e65e87bed343dd2d045457341e42114 | |||
14 | SHA1 (patch-filter_subtitler_load_font.c) = 2c496c63f4fe27190761d170cc825633eb63c11f | 15 | SHA1 (patch-filter_subtitler_load_font.c) = 2c496c63f4fe27190761d170cc825633eb63c11f | |
15 | SHA1 (patch-import_decode_lavc.c) = 2a3b9b9f0909794a9fba0f13901121dd48fc9f5f | 16 | SHA1 (patch-import_decode_lavc.c) = adf9274c5085012adcfeeb2f2366600155f0994c | |
16 | SHA1 (patch-import_import_ffmpeg.c) = 2b1782d0d87de873f2d5e8397a8f3a1b618e21d4 | 17 | SHA1 (patch-import_import_ffmpeg.c) = bbbbdec6a1c20a9c02a1e2ef4cca10919eb2854c | |
17 | SHA1 (patch-import_probe_ffmpeg.c) = c755ed421f7cae0d89555c9faffcdce8610178ea | 18 | SHA1 (patch-import_nuv_import__nuv.c) = e4a57c29b97b23aed068c06a2ed29dd9e29a9919 | |
18 | SHA1 (patch-libtc_tcavcodec.h) = 9c8ea3ac1b8bc048becb92ae1e854911cfd6c3eb | 19 | SHA1 (patch-import_probe_ffmpeg.c) = 6bbf65b513e999ac770bafc6aa9b508bfdb5ae15 | |
20 | SHA1 (patch-libtc_tcavcodec.h) = 6fcef1e338e53c974b295b1a10b2cb06e6fcfbd3 |
@@ -1,44 +1,32 @@ | @@ -1,44 +1,32 @@ | |||
1 | # $NetBSD: options.mk,v 1.8 2010/05/08 16:04:05 drochner Exp $ | 1 | # $NetBSD: options.mk,v 1.9 2015/11/21 17:14:26 adam Exp $ | |
2 | # | |||
3 | 2 | |||
4 | PKG_OPTIONS_VAR= PKG_OPTIONS.transcode | 3 | PKG_OPTIONS_VAR= PKG_OPTIONS.transcode | |
5 | PKG_SUPPORTED_OPTIONS= a52 freetype2 mjpegtools lzo libxml2 | 4 | PKG_SUPPORTED_OPTIONS= a52 dv faac imagemagick mjpegtools lzo libxml2 x264 | |
6 | PKG_SUPPORTED_OPTIONS+= dv imagemagick x264 faac | 5 | PKG_SUGGESTED_OPTIONS= a52 imagemagick mjpegtools libxml2 x264 | |
7 | ||||
8 | PKG_SUGGESTED_OPTIONS= a52 freetype2 mjpegtools libxml2 | |||
9 | PKG_SUGGESTED_OPTIONS+= imagemagick x264 | |||
10 | 6 | |||
11 | .include "../../mk/bsd.options.mk" | 7 | .include "../../mk/bsd.options.mk" | |
12 | 8 | |||
13 | PLIST_VARS+= ${PKG_SUPPORTED_OPTIONS} | 9 | PLIST_VARS+= ${PKG_SUPPORTED_OPTIONS} | |
14 | 10 | |||
15 | .if !empty(PKG_OPTIONS:Ma52) | 11 | .if !empty(PKG_OPTIONS:Ma52) | |
16 | . include "../../audio/liba52/buildlink3.mk" | 12 | . include "../../audio/liba52/buildlink3.mk" | |
17 | CONFIGURE_ARGS+= --enable-a52 | 13 | CONFIGURE_ARGS+= --enable-a52 | |
18 | CONFIGURE_ARGS+= --enable-a52-default-decoder | 14 | CONFIGURE_ARGS+= --enable-a52-default-decoder | |
19 | PLIST.a52= yes | 15 | PLIST.a52= yes | |
20 | .else | 16 | .else | |
21 | CONFIGURE_ARGS+= --disable-a52 | 17 | CONFIGURE_ARGS+= --disable-a52 | |
22 | .endif | 18 | .endif | |
23 | 19 | |||
24 | .if !empty(PKG_OPTIONS:Mfreetype2) | |||
25 | . include "../../graphics/freetype2/buildlink3.mk" | |||
26 | CONFIGURE_ARGS+= --enable-freetype2 | |||
27 | PLIST.freetype2= yes | |||
28 | .else | |||
29 | CONFIGURE_ARGS+= --disable-freetype2 | |||
30 | .endif | |||
31 | ||||
32 | .if !empty(PKG_OPTIONS:Mmjpegtools) | 20 | .if !empty(PKG_OPTIONS:Mmjpegtools) | |
33 | . include "../../multimedia/mjpegtools/buildlink3.mk" | 21 | . include "../../multimedia/mjpegtools/buildlink3.mk" | |
34 | PLIST.mjpegtools= yes | 22 | PLIST.mjpegtools= yes | |
35 | CONFIGURE_ARGS+= --enable-mjpegtools | 23 | CONFIGURE_ARGS+= --enable-mjpegtools | |
36 | .else | 24 | .else | |
37 | CONFIGURE_ARGS+= --disable-mjpegtools | 25 | CONFIGURE_ARGS+= --disable-mjpegtools | |
38 | .endif | 26 | .endif | |
39 | 27 | |||
40 | .if !empty(PKG_OPTIONS:Mlzo) | 28 | .if !empty(PKG_OPTIONS:Mlzo) | |
41 | . include "../../archivers/lzo/buildlink3.mk" | 29 | . include "../../archivers/lzo/buildlink3.mk" | |
42 | PLIST.lzo= yes | 30 | PLIST.lzo= yes | |
43 | CONFIGURE_ARGS+= --enable-lzo | 31 | CONFIGURE_ARGS+= --enable-lzo | |
44 | CONFIGURE_ARGS+= --with-lzo-prefix=${BUILDLINK_PREFIX.lzo} | 32 | CONFIGURE_ARGS+= --with-lzo-prefix=${BUILDLINK_PREFIX.lzo} |
$NetBSD: patch-avilib_avidump.c,v 1.1 2015/11/21 17:14:26 adam Exp $
Compatibility fix.
--- avilib/avidump.c.orig 2012-02-01 17:07:24.000000000 +0000
+++ avilib/avidump.c
@@ -320,7 +320,7 @@ static void dump_vals(int fd, int count,
{
uint32_t i,j,val32;
uint16_t val16;
- loff_t val64;
+ uint64_t val64;
char val8;
for (i = 0; names[i].type != EoLST; i++) {
@@ -605,7 +605,7 @@ static boolean ProcessChunk(int fd, off_
case indxtag: {
uint32_t chunks=*chunksize-sizeof(names_indx)/sizeof(char*);
- loff_t offset;
+ uint64_t offset;
uint32_t size, duration;
uint32_t u=0;
off_t indxend = datapos + chunks;
$NetBSD: patch-configure,v 1.1 2015/11/21 17:14:26 adam Exp $
Add DragonFly support.
Make use of PTHREAD_LDFLAGS.
Portability fix.
--- configure.orig 2011-11-19 16:50:37.000000000 +0000
+++ configure
@@ -5096,7 +5096,7 @@ case "${target_os}" in
$as_echo "#define OS_LINUX 1" >>confdefs.h
;;
- freebsd*|openbsd*|netbsd*|bsdi*|darwin*|rhapsody*)
+ freebsd*|openbsd*|netbsd*|bsdi*|darwin*|rhapsody*|dragonfly*)
is_bsd=yes
$as_echo "#define OS_BSD 1" >>confdefs.h
@@ -19431,7 +19431,7 @@ case "$host" in
esac
# let user override
if test -n "$PTHREAD_LIBS" ; then
- pthread_libs="$PTHREAD_LIBS"
+ pthread_libs="$PTHREAD_LIBS $PTHREAD_LDFLAGS"
fi
if test -n "$PTHREAD_CFLAGS" ; then
pthread_cflags="$PTHREAD_CFLAGS"
@@ -29507,7 +29507,7 @@ if test "${enable_nuv+set}" = set; then
yes) if test yes != "$have_lzo"; then
as_fn_error $? "liblzo2 is required for NuppelVideo support, try --enable-lzo" "$LINENO" 5
fi
- if test true == "$have_x86_64cpu"; then
+ if test true = "$have_x86_64cpu"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: NuppelVideo support on x86_64 platform is ***EXPERIMENTAL***" >&5
$as_echo "$as_me: WARNING: NuppelVideo support on x86_64 platform is ***EXPERIMENTAL***" >&2;}
elif test true != "$have_x86cpu"; then
$NetBSD: patch-export_aud__aux.c,v 1.1 2015/11/21 17:14:26 adam Exp $
Fixes building against FFmpeg version >= 2.0.0 (gentoo patch).
--- export/aud_aux.c.orig 2011-11-19 16:50:27.000000000 +0000
+++ export/aud_aux.c
@@ -346,7 +346,7 @@ static int tc_audio_init_ffmpeg(vob_t *v
//-- set parameters (bitrate, channels and sample-rate) --
//--------------------------------------------------------
- avcodec_get_context_defaults(&mpa_ctx);
+ avcodec_get_context_defaults3(&mpa_ctx, mpa_codec);
#if LIBAVCODEC_VERSION_MAJOR < 53
mpa_ctx.codec_type = CODEC_TYPE_AUDIO;
#else
@@ -359,7 +359,7 @@ static int tc_audio_init_ffmpeg(vob_t *v
//-- open codec --
//----------------
TC_LOCK_LIBAVCODEC;
- ret = avcodec_open(&mpa_ctx, mpa_codec);
+ ret = avcodec_open2(&mpa_ctx, mpa_codec, NULL);
TC_UNLOCK_LIBAVCODEC;
if (ret < 0) {
tc_warn("tc_audio_init_ffmpeg: could not open %s codec !",
$NetBSD: patch-export_ffmpeg_cfg.h,v 1.1 2015/11/21 17:14:26 adam Exp $
Fixes building against FFmpeg version >= 2.0.0 (gentoo patch).
--- export/ffmpeg_cfg.h.orig 2011-11-19 16:50:27.000000000 +0000
+++ export/ffmpeg_cfg.h
@@ -13,8 +13,6 @@ extern int lavc_param_vme;
//extern int lavc_param_vqscale;
//extern int lavc_param_vqmin;
//extern int lavc_param_vqmax;
-extern int lavc_param_mb_qmin;
-extern int lavc_param_mb_qmax;
extern int lavc_param_lmin;
extern int lavc_param_lmax;
extern int lavc_param_vqdiff;
$NetBSD: patch-filter_filter__pp.c,v 1.1 2015/11/21 17:14:26 adam Exp $
Fixes building against FFmpeg version >= 2.0.0 (gentoo patch).
--- filter/filter_pp.c.orig 2011-11-19 16:50:27.000000000 +0000
+++ filter/filter_pp.c
@@ -38,8 +38,8 @@
/* FIXME: these use the filter ID as an index--the ID can grow
* arbitrarily large, so this needs to be fixed */
-static pp_mode_t *mode[100];
-static pp_context_t *context[100];
+static pp_mode *mode[100];
+static pp_context *context[100];
static int width[100], height[100];
static int pre[100];
$NetBSD: patch-import_nuv_import__nuv.c,v 1.1 2015/11/21 17:14:26 adam Exp $
Optionally build LZO support.
--- import/nuv/import_nuv.c.orig 2009-02-21 22:01:57.000000000 +0100
+++ import/nuv/import_nuv.c
@@ -15,7 +15,9 @@
#include "aclib/ac.h"
#include "nuppelvideo.h"
#include "RTjpegN.h"
+#ifdef HAVE_LZO
#include "libtc/tc_lzo.h"
+#endif
#define MOD_NAME "import_nuv.so"
#define MOD_VERSION "v0.9 (2006-06-03)"
@@ -467,6 +469,7 @@ static int nuv_decode_video(TCModuleInst
in_framesize = inframe->video_size-5-sizeof(pd->cdata);
out_framesize = pd->width*pd->height + (pd->width/2)*(pd->height/2)*2;
+#ifdef HAVE_LZO
if (comptype == '2' || comptype == '3') {
/* Undo LZO compression */
uint8_t *decompressed_frame;
@@ -489,6 +492,7 @@ static int nuv_decode_video(TCModuleInst
/* Convert 2 -> 1, 3 -> 0 */
comptype ^= 3;
}
+#endif
switch (comptype) {
@@ -1,94 +1,226 @@ | @@ -1,94 +1,226 @@ | |||
1 | $NetBSD: patch-encode_encode_lavc.c,v 1.1 2012/11/17 21:46:44 markd Exp $ | 1 | $NetBSD: patch-encode_encode_lavc.c,v 1.2 2015/11/21 17:14:26 adam Exp $ | |
2 | 2 | |||
3 | Fix build with ffmpeg 0.11. gentoo patch from Brennan Shacklett | 3 | Fixes building against FFmpeg version >= 2.0.0 (gentoo patch). | |
4 | 4 | |||
5 | --- encode/encode_lavc.c.orig 2011-11-19 16:50:27.000000000 +0000 | 5 | --- encode/encode_lavc.c.orig 2011-11-19 16:50:27.000000000 +0000 | |
6 | +++ encode/encode_lavc.c | 6 | +++ encode/encode_lavc.c | |
7 | @@ -114,6 +114,7 @@ struct tclavcprivatedata_ { | 7 | @@ -74,6 +74,9 @@ struct tclavcconfigdata_ { | |
8 | int lmin; | |||
9 | int lmax; | |||
10 | int me_method; | |||
11 | + int luma_elim_threshold; | |||
12 | + int chroma_elim_threshold; | |||
13 | + int quantizer_noise_shaping; | |||
14 | ||||
15 | /* same as above for flags */ | |||
16 | struct { | |||
17 | @@ -114,6 +117,7 @@ struct tclavcprivatedata_ { | |||
8 | 18 | |||
9 | AVFrame ff_venc_frame; | 19 | AVFrame ff_venc_frame; | |
10 | AVCodecContext ff_vcontext; | 20 | AVCodecContext ff_vcontext; | |
11 | + AVDictionary ** ff_opts; | 21 | + AVDictionary * ff_opts; | |
12 | 22 | |||
13 | AVCodec *ff_vcodec; | 23 | AVCodec *ff_vcodec; | |
14 | 24 | |||
15 | @@ -1036,14 +1037,10 @@ static void tc_lavc_dispatch_settings(TC | 25 | @@ -164,6 +168,7 @@ static const TCCodecID tc_lavc_codecs_ou | |
26 | TC_CODEC_ERROR | |||
27 | }; | |||
28 | ||||
29 | +#if LIBAVCODEC_VERSION_MAJOR < 55 | |||
30 | static const enum CodecID tc_lavc_internal_codecs[] = { | |||
31 | CODEC_ID_MPEG1VIDEO, CODEC_ID_MPEG2VIDEO, CODEC_ID_MPEG4, | |||
32 | CODEC_ID_H263I, CODEC_ID_H263P, | |||
33 | @@ -176,6 +181,20 @@ static const enum CodecID tc_lavc_intern | |||
34 | CODEC_ID_MSMPEG4V2, CODEC_ID_MSMPEG4V3, | |||
35 | CODEC_ID_NONE | |||
36 | }; | |||
37 | +#else | |||
38 | +static const enum AVCodecID tc_lavc_internal_codecs[] = { | |||
39 | + AV_CODEC_ID_MPEG1VIDEO, AV_CODEC_ID_MPEG2VIDEO, AV_CODEC_ID_MPEG4, | |||
40 | + AV_CODEC_ID_H263I, AV_CODEC_ID_H263P, | |||
41 | + AV_CODEC_ID_H264, | |||
42 | + AV_CODEC_ID_WMV1, AV_CODEC_ID_WMV2, | |||
43 | + AV_CODEC_ID_RV10, | |||
44 | + AV_CODEC_ID_HUFFYUV, AV_CODEC_ID_FFV1, | |||
45 | + AV_CODEC_ID_DVVIDEO, | |||
46 | + AV_CODEC_ID_MJPEG, AV_CODEC_ID_LJPEG, | |||
47 | + AV_CODEC_ID_MSMPEG4V2, AV_CODEC_ID_MSMPEG4V3, | |||
48 | + AV_CODEC_ID_NONE | |||
49 | +}; | |||
50 | +#endif | |||
51 | ||||
52 | static const TCFormatID tc_lavc_formats[] = { TC_FORMAT_ERROR }; | |||
53 | ||||
54 | @@ -937,7 +956,11 @@ static int tc_lavc_settings_from_vob(TCL | |||
55 | static void tc_lavc_config_defaults(TCLavcPrivateData *pd) | |||
56 | { | |||
57 | /* first of all reinitialize lavc data */ | |||
58 | +#if LIBAVCODEC_VERSION_MAJOR < 55 | |||
59 | avcodec_get_context_defaults(&pd->ff_vcontext); | |||
60 | +#else | |||
61 | + avcodec_get_context_defaults3(&pd->ff_vcontext, NULL); | |||
62 | +#endif | |||
63 | ||||
64 | pd->confdata.thread_count = 1; | |||
65 | ||||
66 | @@ -955,8 +978,6 @@ static void tc_lavc_config_defaults(TCLa | |||
67 | /* | |||
68 | * context *transcode* (not libavcodec) defaults | |||
69 | */ | |||
70 | - pd->ff_vcontext.mb_qmin = 2; | |||
71 | - pd->ff_vcontext.mb_qmax = 31; | |||
72 | pd->ff_vcontext.max_qdiff = 3; | |||
73 | pd->ff_vcontext.max_b_frames = 0; | |||
74 | pd->ff_vcontext.me_range = 0; | |||
75 | @@ -977,8 +998,8 @@ static void tc_lavc_config_defaults(TCLa | |||
76 | pd->ff_vcontext.mpeg_quant = 0; | |||
77 | pd->ff_vcontext.rc_initial_cplx = 0.0; | |||
78 | pd->ff_vcontext.rc_qsquish = 1.0; | |||
79 | - pd->ff_vcontext.luma_elim_threshold = 0; | |||
80 | - pd->ff_vcontext.chroma_elim_threshold = 0; | |||
81 | + pd->confdata.luma_elim_threshold = 0; | |||
82 | + pd->confdata.chroma_elim_threshold = 0; | |||
83 | pd->ff_vcontext.strict_std_compliance = 0; | |||
84 | pd->ff_vcontext.dct_algo = FF_DCT_AUTO; | |||
85 | pd->ff_vcontext.idct_algo = FF_IDCT_AUTO; | |||
86 | @@ -1002,7 +1023,7 @@ static void tc_lavc_config_defaults(TCLa | |||
87 | pd->ff_vcontext.intra_quant_bias = FF_DEFAULT_QUANT_BIAS; | |||
88 | pd->ff_vcontext.inter_quant_bias = FF_DEFAULT_QUANT_BIAS; | |||
89 | pd->ff_vcontext.noise_reduction = 0; | |||
90 | - pd->ff_vcontext.quantizer_noise_shaping = 0; | |||
91 | + pd->confdata.quantizer_noise_shaping = 0; | |||
92 | pd->ff_vcontext.flags = 0; | |||
93 | } | |||
94 | ||||
95 | @@ -1034,16 +1055,11 @@ static void tc_lavc_dispatch_settings(TC | |||
96 | ||||
97 | pd->ff_vcontext.flags = 0; | |||
16 | SET_FLAG(pd, mv0); | 98 | SET_FLAG(pd, mv0); | |
17 | SET_FLAG(pd, cbp); | 99 | - SET_FLAG(pd, cbp); | |
18 | SET_FLAG(pd, qpel); | 100 | SET_FLAG(pd, qpel); | |
19 | - SET_FLAG(pd, alt); | 101 | - SET_FLAG(pd, alt); | |
20 | - SET_FLAG(pd, vdpart); | 102 | - SET_FLAG(pd, vdpart); | |
21 | SET_FLAG(pd, naq); | 103 | SET_FLAG(pd, naq); | |
22 | SET_FLAG(pd, ilme); | 104 | SET_FLAG(pd, ilme); | |
23 | SET_FLAG(pd, ildct); | 105 | SET_FLAG(pd, ildct); | |
24 | SET_FLAG(pd, aic); | 106 | SET_FLAG(pd, aic); | |
25 | - SET_FLAG(pd, aiv); | 107 | - SET_FLAG(pd, aiv); | |
26 | - SET_FLAG(pd, umv); | 108 | - SET_FLAG(pd, umv); | |
27 | SET_FLAG(pd, psnr); | 109 | SET_FLAG(pd, psnr); | |
28 | SET_FLAG(pd, trell); | 110 | SET_FLAG(pd, trell); | |
29 | SET_FLAG(pd, gray); | 111 | SET_FLAG(pd, gray); | |
30 | @@ -1064,6 +1061,18 @@ static void tc_lavc_dispatch_settings(TC | 112 | @@ -1064,6 +1080,30 @@ static void tc_lavc_dispatch_settings(TC | |
31 | pd->ff_vcontext.flags |= CODEC_FLAG_INTERLACED_DCT; | 113 | pd->ff_vcontext.flags |= CODEC_FLAG_INTERLACED_DCT; | |
32 | pd->ff_vcontext.flags |= CODEC_FLAG_INTERLACED_ME; | 114 | pd->ff_vcontext.flags |= CODEC_FLAG_INTERLACED_ME; | |
33 | } | 115 | } | |
34 | + if (pd->confdata.flags.alt) { | 116 | + if (pd->confdata.flags.alt) { | |
35 | + av_dict_set(pd->ff_opts, "alternate_scan", "1", 0); | 117 | + av_dict_set(&(pd->ff_opts), "alternate_scan", "1", 0); | |
36 | + } | 118 | + } | |
37 | + if (pd->confdata.flags.vdpart) { | 119 | + if (pd->confdata.flags.vdpart) { | |
38 | + av_dict_set(pd->ff_opts, "data_partitioning", "1", 0); | 120 | + av_dict_set(&(pd->ff_opts), "data_partitioning", "1", 0); | |
39 | + } | 121 | + } | |
40 | + if (pd->confdata.flags.umv) { | 122 | + if (pd->confdata.flags.umv) { | |
41 | + av_dict_set(pd->ff_opts, "umv", "1", 0); | 123 | + av_dict_set(&(pd->ff_opts), "umv", "1", 0); | |
42 | + } | 124 | + } | |
43 | + if (pd->confdata.flags.aiv) { | 125 | + if (pd->confdata.flags.aiv) { | |
44 | + av_dict_set(pd->ff_opts, "aiv", "1", 0); | 126 | + av_dict_set(&(pd->ff_opts), "aiv", "1", 0); | |
45 | + } | 127 | + } | |
128 | + if (pd->confdata.flags.cbp) { | |||
129 | + av_dict_set(&(pd->ff_opts), "mpv_flags", "+cbp_rd", 0); | |||
130 | + } | |||
131 | + | |||
132 | + char buf[1024]; | |||
133 | +#define set_dict_opt(val, opt) \ | |||
134 | + snprintf(buf, sizeof(buf), "%i", pd->confdata.val);\ | |||
135 | + av_dict_set(&(pd->ff_opts), opt, buf, 0) | |||
136 | + | |||
137 | + set_dict_opt(luma_elim_threshold, "luma_elim_threshold"); | |||
138 | + set_dict_opt(chroma_elim_threshold, "chroma_elim_threshold"); | |||
139 | + set_dict_opt(quantizer_noise_shaping, "quantizer_noise_shaping"); | |||
46 | } | 140 | } | |
47 | 141 | |||
48 | #undef SET_FLAG | 142 | #undef SET_FLAG | |
49 | @@ -1184,18 +1193,18 @@ static int tc_lavc_read_config(TCLavcPri | 143 | @@ -1116,8 +1156,6 @@ static int tc_lavc_read_config(TCLavcPri | |
144 | // handled by transcode core | |||
145 | // { "vqmax", PCTX(qmax), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 1, 60 }, | |||
146 | // handled by transcode core | |||
147 | - { "mbqmin", PCTX(mb_qmin), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 1, 60 }, | |||
148 | - { "mbqmax", PCTX(mb_qmax), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 1, 60 }, | |||
149 | { "lmin", PAUX(lmin), TCCONF_TYPE_FLOAT, TCCONF_FLAG_RANGE, 0.01, 255.0 }, | |||
150 | { "lmax", PAUX(lmax), TCCONF_TYPE_FLOAT, TCCONF_FLAG_RANGE, 0.01, 255.0 }, | |||
151 | { "vqdiff", PCTX(max_qdiff), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 1, 31 }, | |||
152 | @@ -1150,8 +1188,8 @@ static int tc_lavc_read_config(TCLavcPri | |||
153 | { "vrc_init_cplx", PCTX(rc_initial_cplx), TCCONF_TYPE_FLOAT, TCCONF_FLAG_RANGE, 0.0, 9999999.0 }, | |||
154 | // { "vrc_init_occupancy", }, // not yet supported | |||
155 | { "vqsquish", PCTX(rc_qsquish), TCCONF_TYPE_FLOAT, TCCONF_FLAG_RANGE, 0.0, 99.0 }, | |||
156 | - { "vlelim", PCTX(luma_elim_threshold), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, -99, 99 }, | |||
157 | - { "vcelim", PCTX(chroma_elim_threshold), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, -99, 99 }, | |||
158 | + { "vlelim", PAUX(luma_elim_threshold), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, -99, 99 }, | |||
159 | + { "vcelim", PAUX(chroma_elim_threshold), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, -99, 99 }, | |||
160 | { "vstrict", PCTX(strict_std_compliance), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, -99, 99 }, | |||
161 | { "vpsize", PCTX(rtp_payload_size), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 100000000 }, | |||
162 | { "dct", PCTX(dct_algo), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 10 }, | |||
163 | @@ -1177,25 +1215,25 @@ static int tc_lavc_read_config(TCLavcPri | |||
164 | { "ibias", PCTX(intra_quant_bias), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, -512, 512 }, | |||
165 | { "pbias", PCTX(inter_quant_bias), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, -512, 512 }, | |||
166 | { "nr", PCTX(noise_reduction), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 1000000}, | |||
167 | - { "qns", PCTX(quantizer_noise_shaping), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 3 }, | |||
168 | + { "qns", PAUX(quantizer_noise_shaping), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 3 }, | |||
169 | { "inter_matrix_file", inter_matrix_file, TCCONF_TYPE_STRING, 0, 0, 0 }, | |||
170 | { "intra_matrix_file", intra_matrix_file, TCCONF_TYPE_STRING, 0, 0, 0 }, | |||
171 | ||||
50 | { "mv0", PAUX(flags.mv0), TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_MV0 }, | 172 | { "mv0", PAUX(flags.mv0), TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_MV0 }, | |
51 | { "cbp", PAUX(flags.cbp), TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_CBP_RD }, | 173 | - { "cbp", PAUX(flags.cbp), TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_CBP_RD }, | |
174 | + { "cbp", PAUX(flags.cbp), TCCONF_TYPE_FLAG, 0, 0, 1 }, | |||
52 | { "qpel", PAUX(flags.qpel), TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_QPEL }, | 175 | { "qpel", PAUX(flags.qpel), TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_QPEL }, | |
53 | - { "alt", PAUX(flags.alt), TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_ALT_SCAN }, | 176 | - { "alt", PAUX(flags.alt), TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_ALT_SCAN }, | |
54 | + { "alt", PAUX(flags.alt), TCCONF_TYPE_FLAG, 0, 0, 1 }, | 177 | + { "alt", PAUX(flags.alt), TCCONF_TYPE_FLAG, 0, 0, 1 }, | |
55 | { "ilme", PAUX(flags.ilme), TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_INTERLACED_ME }, | 178 | { "ilme", PAUX(flags.ilme), TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_INTERLACED_ME }, | |
56 | { "ildct", PAUX(flags.ildct), TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_INTERLACED_DCT }, | 179 | { "ildct", PAUX(flags.ildct), TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_INTERLACED_DCT }, | |
57 | { "naq", PAUX(flags.naq), TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_NORMALIZE_AQP }, | 180 | { "naq", PAUX(flags.naq), TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_NORMALIZE_AQP }, | |
58 | - { "vdpart", PAUX(flags.vdpart), TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_PART }, | 181 | - { "vdpart", PAUX(flags.vdpart), TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_PART }, | |
59 | + { "vdpart", PAUX(flags.vdpart), TCCONF_TYPE_FLAG, 0, 0, 1 }, | 182 | + { "vdpart", PAUX(flags.vdpart), TCCONF_TYPE_FLAG, 0, 0, 1 }, | |
60 | #if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0) | 183 | #if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0) | |
61 | { "aic", PAUX(flags.aic), TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_H263P_AIC }, | 184 | { "aic", PAUX(flags.aic), TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_H263P_AIC }, | |
62 | #else | 185 | #else | |
63 | { "aic", PAUX(flags.aic), TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_AC_PRED }, | 186 | { "aic", PAUX(flags.aic), TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_AC_PRED }, | |
64 | #endif | 187 | #endif | |
65 | - { "aiv", PAUX(flags.aiv), TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_H263P_AIV }, | 188 | - { "aiv", PAUX(flags.aiv), TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_H263P_AIV }, | |
66 | - { "umv", PAUX(flags.umv), TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_H263P_UMV }, | 189 | - { "umv", PAUX(flags.umv), TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_H263P_UMV }, | |
67 | + { "aiv", PAUX(flags.aiv), TCCONF_TYPE_FLAG, 0, 0, 1 }, | 190 | + { "aiv", PAUX(flags.aiv), TCCONF_TYPE_FLAG, 0, 0, 1 }, | |
68 | + { "umv", PAUX(flags.umv), TCCONF_TYPE_FLAG, 0, 0, 1 }, | 191 | + { "umv", PAUX(flags.umv), TCCONF_TYPE_FLAG, 0, 0, 1 }, | |
69 | { "psnr", PAUX(flags.psnr), TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_PSNR }, | 192 | { "psnr", PAUX(flags.psnr), TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_PSNR }, | |
70 | #if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0) | 193 | #if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0) | |
71 | { "trell", PAUX(flags.trell), TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_TRELLIS_QUANT }, | 194 | { "trell", PAUX(flags.trell), TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_TRELLIS_QUANT }, | |
72 | @@ -1387,7 +1396,7 @@ static int tc_lavc_configure(TCModuleIns | 195 | @@ -1345,6 +1383,8 @@ static int tc_lavc_configure(TCModuleIns | |
196 | ||||
197 | pd = self->userdata; | |||
198 | ||||
199 | + pd->ff_opts = NULL; | |||
200 | + | |||
201 | pd->flush_flag = vob->encoder_flush; | |||
202 | ||||
203 | /* FIXME: move into core? */ | |||
204 | @@ -1387,7 +1427,7 @@ static int tc_lavc_configure(TCModuleIns | |||
73 | pd->confdata.thread_count, | 205 | pd->confdata.thread_count, | |
74 | (pd->confdata.thread_count > 1) ?"s" :""); | 206 | (pd->confdata.thread_count > 1) ?"s" :""); | |
75 | } | 207 | } | |
76 | - avcodec_thread_init(&pd->ff_vcontext, pd->confdata.thread_count); | 208 | - avcodec_thread_init(&pd->ff_vcontext, pd->confdata.thread_count); | |
77 | + pd->ff_vcontext.thread_count = pd->confdata.thread_count; | 209 | + pd->ff_vcontext.thread_count = pd->confdata.thread_count; | |
78 | 210 | |||
79 | pd->ff_vcodec = avcodec_find_encoder(FF_VCODEC_ID(pd)); | 211 | pd->ff_vcodec = avcodec_find_encoder(FF_VCODEC_ID(pd)); | |
80 | if (pd->ff_vcodec == NULL) { | 212 | if (pd->ff_vcodec == NULL) { | |
81 | @@ -1397,11 +1406,11 @@ static int tc_lavc_configure(TCModuleIns | 213 | @@ -1397,11 +1437,11 @@ static int tc_lavc_configure(TCModuleIns | |
82 | } | 214 | } | |
83 | 215 | |||
84 | TC_LOCK_LIBAVCODEC; | 216 | TC_LOCK_LIBAVCODEC; | |
85 | - ret = avcodec_open(&pd->ff_vcontext, pd->ff_vcodec); | 217 | - ret = avcodec_open(&pd->ff_vcontext, pd->ff_vcodec); | |
86 | + ret = avcodec_open2(&pd->ff_vcontext, pd->ff_vcodec, pd->ff_opts); | 218 | + ret = avcodec_open2(&pd->ff_vcontext, pd->ff_vcodec, &(pd->ff_opts)); | |
87 | TC_UNLOCK_LIBAVCODEC; | 219 | TC_UNLOCK_LIBAVCODEC; | |
88 | 220 | |||
89 | if (ret < 0) { | 221 | if (ret < 0) { | |
90 | - tc_log_error(MOD_NAME, "avcodec_open() failed"); | 222 | - tc_log_error(MOD_NAME, "avcodec_open() failed"); | |
91 | + tc_log_error(MOD_NAME, "avcodec_open2() failed"); | 223 | + tc_log_error(MOD_NAME, "avcodec_open2() failed"); | |
92 | goto failed; | 224 | goto failed; | |
93 | } | 225 | } | |
94 | /* finally, pass up the extradata, if any */ | 226 | /* finally, pass up the extradata, if any */ |
@@ -1,124 +1,165 @@ | @@ -1,124 +1,165 @@ | |||
1 | $NetBSD: patch-export_export_ffmpeg.c,v 1.1 2012/11/17 21:46:44 markd Exp $ | 1 | $NetBSD: patch-export_export_ffmpeg.c,v 1.2 2015/11/21 17:14:26 adam Exp $ | |
2 | 2 | |||
3 | Fix build with ffmpeg 0.11. gentoo patch from Brennan Shacklett | 3 | Fixes building against FFmpeg version >= 2.0.0 (gentoo patch). | |
4 | 4 | |||
5 | --- export/export_ffmpeg.c.orig 2011-11-19 16:50:27.000000000 +0000 | 5 | --- export/export_ffmpeg.c.orig 2011-11-19 16:50:27.000000000 +0000 | |
6 | +++ export/export_ffmpeg.c | 6 | +++ export/export_ffmpeg.c | |
7 | @@ -122,6 +122,7 @@ static uint8_t *img_buffer = | 7 | @@ -122,6 +122,7 @@ static uint8_t *img_buffer = | |
8 | static AVFrame *lavc_convert_frame = NULL; | 8 | static AVFrame *lavc_convert_frame = NULL; | |
9 | 9 | |||
10 | static AVCodec *lavc_venc_codec = NULL; | 10 | static AVCodec *lavc_venc_codec = NULL; | |
11 | +static AVDictionary **lavc_venc_opts = NULL; | 11 | +static AVDictionary *lavc_venc_opts = NULL; | |
12 | static AVFrame *lavc_venc_frame = NULL; | 12 | static AVFrame *lavc_venc_frame = NULL; | |
13 | static AVCodecContext *lavc_venc_context; | 13 | static AVCodecContext *lavc_venc_context; | |
14 | static avi_t *avifile = NULL; | 14 | static avi_t *avifile = NULL; | |
15 | @@ -180,7 +181,7 @@ static char *tc_strchrnul(const char *s, | 15 | @@ -180,7 +181,7 @@ static char *tc_strchrnul(const char *s, | |
16 | 16 | |||
17 | 17 | |||
18 | /* START: COPIED FROM ffmpeg-0.5_p22846(ffmpeg.c, cmdutils.c) */ | 18 | /* START: COPIED FROM ffmpeg-0.5_p22846(ffmpeg.c, cmdutils.c) */ | |
19 | -#include <libavcodec/opt.h> | 19 | -#include <libavcodec/opt.h> | |
20 | +#include <libavutil/opt.h> | 20 | +#include <libavutil/opt.h> | |
21 | #include <libavutil/avstring.h> | 21 | #include <libavutil/avstring.h> | |
22 | #include <libswscale/swscale.h> | 22 | #include <libswscale/swscale.h> | |
23 | 23 | |||
24 | @@ -470,7 +471,6 @@ MOD_init | 24 | @@ -470,7 +471,6 @@ MOD_init | |
25 | } | 25 | } | |
26 | 26 | |||
27 | TC_LOCK_LIBAVCODEC; | 27 | TC_LOCK_LIBAVCODEC; | |
28 | - avcodec_init(); | 28 | - avcodec_init(); | |
29 | avcodec_register_all(); | 29 | avcodec_register_all(); | |
30 | TC_UNLOCK_LIBAVCODEC; | 30 | TC_UNLOCK_LIBAVCODEC; | |
31 | 31 | |||
32 | @@ -486,7 +486,7 @@ MOD_init | |||
33 | codec->name, codec->fourCC, codec->comments); | |||
34 | } | |||
35 | ||||
36 | - lavc_venc_context = avcodec_alloc_context(); | |||
37 | + lavc_venc_context = avcodec_alloc_context3(lavc_venc_codec); | |||
38 | lavc_venc_frame = avcodec_alloc_frame(); | |||
39 | ||||
40 | lavc_convert_frame= avcodec_alloc_frame(); | |||
32 | @@ -634,7 +634,7 @@ MOD_init | 41 | @@ -634,7 +634,7 @@ MOD_init | |
33 | lavc_param_rc_max_rate = 2516; | 42 | lavc_param_rc_max_rate = 2516; | |
34 | lavc_param_rc_buffer_size = 224 * 8; | 43 | lavc_param_rc_buffer_size = 224 * 8; | |
35 | lavc_param_rc_buffer_aggressivity = 99; | 44 | lavc_param_rc_buffer_aggressivity = 99; | |
36 | - lavc_param_scan_offset = CODEC_FLAG_SVCD_SCAN_OFFSET; | 45 | - lavc_param_scan_offset = CODEC_FLAG_SVCD_SCAN_OFFSET; | |
37 | + lavc_param_scan_offset = 1; | 46 | + lavc_param_scan_offset = 1; | |
38 | 47 | |||
39 | break; | 48 | break; | |
40 | 49 | |||
41 | @@ -674,7 +674,7 @@ MOD_init | 50 | @@ -674,7 +674,7 @@ MOD_init | |
42 | 51 | |||
43 | lavc_param_rc_buffer_size = 224 * 8; | 52 | lavc_param_rc_buffer_size = 224 * 8; | |
44 | lavc_param_rc_buffer_aggressivity = 99; | 53 | lavc_param_rc_buffer_aggressivity = 99; | |
45 | - lavc_param_scan_offset = CODEC_FLAG_SVCD_SCAN_OFFSET; | 54 | - lavc_param_scan_offset = CODEC_FLAG_SVCD_SCAN_OFFSET; | |
46 | + lavc_param_scan_offset = 1; | 55 | + lavc_param_scan_offset = 1; | |
47 | 56 | |||
48 | break; | 57 | break; | |
49 | 58 | |||
50 | @@ -887,7 +887,7 @@ MOD_init | 59 | @@ -838,8 +838,13 @@ MOD_init | |
60 | lavc_venc_context->rc_strategy = lavc_param_vrc_strategy; | |||
61 | lavc_venc_context->b_frame_strategy = lavc_param_vb_strategy; | |||
62 | lavc_venc_context->b_quant_offset = lavc_param_vb_qoffset; | |||
63 | - lavc_venc_context->luma_elim_threshold= lavc_param_luma_elim_threshold; | |||
64 | - lavc_venc_context->chroma_elim_threshold= lavc_param_chroma_elim_threshold; | |||
65 | + | |||
66 | + char buf[1024]; | |||
67 | +#define set_dict_opt(val, opt) \ | |||
68 | + snprintf(buf, sizeof(buf), "%i", val); \ | |||
69 | + av_dict_set(&lavc_venc_opts, opt, buf, 0) | |||
70 | + set_dict_opt(lavc_param_luma_elim_threshold, "luma_elim_threshold"); | |||
71 | + set_dict_opt(lavc_param_chroma_elim_threshold, "chroma_elim_threshold"); | |||
72 | lavc_venc_context->rtp_payload_size = lavc_param_packet_size; | |||
73 | #if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0) | |||
74 | if (lavc_param_packet_size) | |||
75 | @@ -870,7 +875,7 @@ MOD_init | |||
76 | lavc_venc_context->context_model = lavc_param_context; | |||
77 | lavc_venc_context->scenechange_threshold= lavc_param_sc_threshold; | |||
78 | lavc_venc_context->noise_reduction = lavc_param_noise_reduction; | |||
79 | - lavc_venc_context->inter_threshold = lavc_param_inter_threshold; | |||
80 | + set_dict_opt(lavc_param_inter_threshold, "inter_threshold"); | |||
81 | lavc_venc_context->intra_dc_precision = lavc_param_intra_dc_precision; | |||
82 | lavc_venc_context->skip_top = lavc_param_skip_top; | |||
83 | lavc_venc_context->skip_bottom = lavc_param_skip_bottom; | |||
84 | @@ -887,7 +892,7 @@ MOD_init | |||
51 | lavc_venc_context->thread_count); | 85 | lavc_venc_context->thread_count); | |
52 | } | 86 | } | |
53 | 87 | |||
54 | - avcodec_thread_init(lavc_venc_context, lavc_param_threads); | 88 | - avcodec_thread_init(lavc_venc_context, lavc_param_threads); | |
55 | + lavc_venc_context->thread_count = lavc_param_threads; | 89 | + lavc_venc_context->thread_count = lavc_param_threads; | |
56 | 90 | |||
57 | if (lavc_param_intra_matrix) { | 91 | if (lavc_param_intra_matrix) { | |
58 | char *tmp; | 92 | char *tmp; | |
59 | @@ -1065,15 +1065,10 @@ MOD_init | 93 | @@ -1065,15 +1070,12 @@ MOD_init | |
60 | lavc_venc_context->flags |= lavc_param_closedgop; | 94 | lavc_venc_context->flags |= lavc_param_closedgop; | |
61 | lavc_venc_context->flags |= lavc_param_trunc; | 95 | lavc_venc_context->flags |= lavc_param_trunc; | |
62 | lavc_venc_context->flags |= lavc_param_aic; | 96 | lavc_venc_context->flags |= lavc_param_aic; | |
63 | - lavc_venc_context->flags |= lavc_param_umv; | 97 | - lavc_venc_context->flags |= lavc_param_umv; | |
64 | lavc_venc_context->flags |= lavc_param_v4mv; | 98 | lavc_venc_context->flags |= lavc_param_v4mv; | |
65 | - lavc_venc_context->flags |= lavc_param_data_partitioning; | 99 | - lavc_venc_context->flags |= lavc_param_data_partitioning; | |
66 | lavc_venc_context->flags |= lavc_param_cbp; | 100 | - lavc_venc_context->flags |= lavc_param_cbp; | |
101 | + if(lavc_param_cbp) | |||
102 | + av_dict_set(&lavc_venc_opts, "mpv_flags", "+cbp_rd", 0); | |||
67 | lavc_venc_context->flags |= lavc_param_mv0; | 103 | lavc_venc_context->flags |= lavc_param_mv0; | |
68 | lavc_venc_context->flags |= lavc_param_qp_rd; | 104 | - lavc_venc_context->flags |= lavc_param_qp_rd; | |
69 | - lavc_venc_context->flags |= lavc_param_scan_offset; | 105 | - lavc_venc_context->flags |= lavc_param_scan_offset; | |
70 | - lavc_venc_context->flags |= lavc_param_ss; | 106 | - lavc_venc_context->flags |= lavc_param_ss; | |
71 | - lavc_venc_context->flags |= lavc_param_alt; | 107 | - lavc_venc_context->flags |= lavc_param_alt; | |
108 | + if(lavc_param_qp_rd) | |||
109 | + av_dict_set(&lavc_venc_opts, "mpv_flags", "+qp_rd", 0); | |||
72 | lavc_venc_context->flags |= lavc_param_ilme; | 110 | lavc_venc_context->flags |= lavc_param_ilme; | |
73 | #if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0) | 111 | #if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0) | |
74 | lavc_venc_context->flags |= lavc_param_trell; | 112 | lavc_venc_context->flags |= lavc_param_trell; | |
75 | @@ -1203,7 +1198,6 @@ MOD_init | 113 | @@ -1203,9 +1205,8 @@ MOD_init | |
76 | 114 | |||
77 | lavc_venc_context->me_method = ME_ZERO + lavc_param_vme; | 115 | lavc_venc_context->me_method = ME_ZERO + lavc_param_vme; | |
78 | 116 | |||
79 | - | 117 | - | |
80 | /* FIXME: transcode itself contains "broken ffmpeg default settings", thus we need to override them! */ | 118 | /* FIXME: transcode itself contains "broken ffmpeg default settings", thus we need to override them! */ | |
81 | if (lavc_param_video_preset) { | 119 | - if (lavc_param_video_preset) { | |
120 | + if (lavc_param_video_preset && strcmp(lavc_param_video_preset, "none")) { | |||
82 | avcodec_opts[AVMEDIA_TYPE_VIDEO] = lavc_venc_context; | 121 | avcodec_opts[AVMEDIA_TYPE_VIDEO] = lavc_venc_context; | |
83 | @@ -1241,20 +1235,39 @@ MOD_init | 122 | video_codec_name = ffmpeg_codec_name(codec->name); | |
123 | ||||
124 | @@ -1241,20 +1242,39 @@ MOD_init | |||
84 | } | 125 | } | |
85 | } | 126 | } | |
86 | 127 | |||
87 | + if (lavc_param_scan_offset) { | 128 | + if (lavc_param_scan_offset) { | |
88 | + av_dict_set(lavc_venc_opts, "scan_offset", "1", 0); | 129 | + av_dict_set(&lavc_venc_opts, "scan_offset", "1", 0); | |
89 | + } | 130 | + } | |
90 | + | 131 | + | |
91 | + if (lavc_param_ss) { | 132 | + if (lavc_param_ss) { | |
92 | + av_dict_set(lavc_venc_opts, "structured_slices", "1", 0); | 133 | + av_dict_set(&lavc_venc_opts, "structured_slices", "1", 0); | |
93 | + } | 134 | + } | |
94 | + | 135 | + | |
95 | + if (lavc_param_alt) { | 136 | + if (lavc_param_alt) { | |
96 | + av_dict_set(lavc_venc_opts, "alternate_scan", "1", 0); | 137 | + av_dict_set(&lavc_venc_opts, "alternate_scan", "1", 0); | |
97 | + } | 138 | + } | |
98 | + | 139 | + | |
99 | + if (lavc_param_umv) { | 140 | + if (lavc_param_umv) { | |
100 | + av_dict_set(lavc_venc_opts, "umv", "1", 0); | 141 | + av_dict_set(&lavc_venc_opts, "umv", "1", 0); | |
101 | + } | 142 | + } | |
102 | + | 143 | + | |
103 | + if (lavc_param_data_partitioning) { | 144 | + if (lavc_param_data_partitioning) { | |
104 | + av_dict_set(lavc_venc_opts, "vdpart", "1", 0); | 145 | + av_dict_set(&lavc_venc_opts, "vdpart", "1", 0); | |
105 | + } | 146 | + } | |
106 | 147 | |||
107 | //-- open codec -- | 148 | //-- open codec -- | |
108 | //---------------- | 149 | //---------------- | |
109 | TC_LOCK_LIBAVCODEC; | 150 | TC_LOCK_LIBAVCODEC; | |
110 | - ret = avcodec_open(lavc_venc_context, lavc_venc_codec); | 151 | - ret = avcodec_open(lavc_venc_context, lavc_venc_codec); | |
111 | + ret = avcodec_open2(lavc_venc_context, lavc_venc_codec, lavc_venc_opts); | 152 | + ret = avcodec_open2(lavc_venc_context, lavc_venc_codec, &lavc_venc_opts); | |
112 | TC_UNLOCK_LIBAVCODEC; | 153 | TC_UNLOCK_LIBAVCODEC; | |
113 | if (ret < 0) { | 154 | if (ret < 0) { | |
114 | tc_log_warn(MOD_NAME, "could not open FFMPEG codec"); | 155 | tc_log_warn(MOD_NAME, "could not open FFMPEG codec"); | |
115 | return TC_EXPORT_ERROR; | 156 | return TC_EXPORT_ERROR; | |
116 | } | 157 | } | |
117 | 158 | |||
118 | - if (lavc_venc_context->codec->encode == NULL) { | 159 | - if (lavc_venc_context->codec->encode == NULL) { | |
119 | + if (av_codec_is_encoder(lavc_venc_context->codec) == 0) { | 160 | + if (av_codec_is_encoder(lavc_venc_context->codec) == 0) { | |
120 | tc_log_warn(MOD_NAME, "could not open FFMPEG codec " | 161 | tc_log_warn(MOD_NAME, "could not open FFMPEG codec " | |
121 | - "(lavc_venc_context->codec->encode == NULL)"); | 162 | - "(lavc_venc_context->codec->encode == NULL)"); | |
122 | + "(av_codec_is_encoder(lavc_venc_context->codec) == 0)"); | 163 | + "(av_codec_is_encoder(lavc_venc_context->codec) == 0)"); | |
123 | return TC_EXPORT_ERROR; | 164 | return TC_EXPORT_ERROR; | |
124 | } | 165 | } |
@@ -1,40 +1,73 @@ | @@ -1,40 +1,73 @@ | |||
1 | $NetBSD: patch-export_ffmpeg_cfg.c,v 1.1 2012/11/17 21:46:44 markd Exp $ | 1 | $NetBSD: patch-export_ffmpeg_cfg.c,v 1.2 2015/11/21 17:14:26 adam Exp $ | |
2 | 2 | |||
3 | Fix build with ffmpeg 0.11. gentoo patch from Brennan Shacklett | 3 | Fixes building against FFmpeg version >= 2.0.0 (gentoo patch). | |
4 | 4 | |||
5 | --- export/ffmpeg_cfg.c.orig 2011-11-19 16:50:27.000000000 +0000 | 5 | --- export/ffmpeg_cfg.c.orig 2011-11-19 16:50:27.000000000 +0000 | |
6 | +++ export/ffmpeg_cfg.c | 6 | +++ export/ffmpeg_cfg.c | |
7 | @@ -160,9 +160,9 @@ TCConfigEntry lavcopts_conf[]={ | 7 | @@ -34,8 +34,6 @@ int lavc_param_vme = 4; | |
8 | //int lavc_param_vqscale = 0; | |||
9 | //int lavc_param_vqmin = 2; | |||
10 | //int lavc_param_vqmax = 31; | |||
11 | -int lavc_param_mb_qmin = 2; | |||
12 | -int lavc_param_mb_qmax = 31; | |||
13 | int lavc_param_lmin = 2; | |||
14 | int lavc_param_lmax = 31; | |||
15 | int lavc_param_vqdiff = 3; | |||
16 | @@ -126,7 +124,7 @@ int lavc_param_gmc = 0; | |||
17 | //int lavc_param_atag = 0; | |||
18 | //int lavc_param_abitrate = 224; | |||
19 | ||||
20 | -char *lavc_param_video_preset = "medium"; | |||
21 | +char *lavc_param_video_preset = "none"; | |||
22 | char *lavc_param_ffmpeg_datadir = "/usr/share/ffmpeg"; | |||
23 | ||||
24 | TCConfigEntry lavcopts_conf[]={ | |||
25 | @@ -143,8 +141,6 @@ TCConfigEntry lavcopts_conf[]={ | |||
26 | // {"vqscale", &lavc_param_vqscale, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 1, 31}, | |||
27 | // {"vqmin", &lavc_param_vqmin, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 1, 31}, | |||
28 | // {"vqmax", &lavc_param_vqmax, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 1, 31}, | |||
29 | - {"mbqmin", &lavc_param_mb_qmin, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 1, 31}, | |||
30 | - {"mbqmax", &lavc_param_mb_qmax, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 1, 31}, | |||
31 | {"lmin", &lavc_param_lmin, TCCONF_TYPE_FLOAT, TCCONF_FLAG_RANGE, 0.01, 255.0}, | |||
32 | {"lmax", &lavc_param_lmax, TCCONF_TYPE_FLOAT, TCCONF_FLAG_RANGE, 0.01, 255.0}, | |||
33 | {"vqdiff", &lavc_param_vqdiff, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 1, 31}, | |||
34 | @@ -160,9 +156,9 @@ TCConfigEntry lavcopts_conf[]={ | |||
8 | {"vcelim", &lavc_param_chroma_elim_threshold, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, -99, 99}, | 35 | {"vcelim", &lavc_param_chroma_elim_threshold, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, -99, 99}, | |
9 | {"vpsize", &lavc_param_packet_size, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 100000000}, | 36 | {"vpsize", &lavc_param_packet_size, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 100000000}, | |
10 | {"vstrict", &lavc_param_strict, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, -99, 99}, | 37 | {"vstrict", &lavc_param_strict, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, -99, 99}, | |
11 | - {"vdpart", &lavc_param_data_partitioning, TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_PART}, | 38 | - {"vdpart", &lavc_param_data_partitioning, TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_PART}, | |
12 | + {"vdpart", &lavc_param_data_partitioning, TCCONF_TYPE_FLAG, 0, 0, 1}, | 39 | + {"vdpart", &lavc_param_data_partitioning, TCCONF_TYPE_FLAG, 0, 0, 1}, | |
13 | // {"keyint", &lavc_param_keyint, TCCONF_TYPE_INT, 0, 0, 0}, | 40 | // {"keyint", &lavc_param_keyint, TCCONF_TYPE_INT, 0, 0, 0}, | |
14 | - {"gray", &lavc_param_gray, TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_PART}, | 41 | - {"gray", &lavc_param_gray, TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_PART}, | |
15 | + {"gray", &lavc_param_gray, TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_GRAY}, | 42 | + {"gray", &lavc_param_gray, TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_GRAY}, | |
16 | {"mpeg_quant", &lavc_param_mpeg_quant, TCCONF_TYPE_FLAG, 0, 0, 1}, | 43 | {"mpeg_quant", &lavc_param_mpeg_quant, TCCONF_TYPE_FLAG, 0, 0, 1}, | |
17 | {"vi_qfactor", &lavc_param_vi_qfactor, TCCONF_TYPE_FLOAT, TCCONF_FLAG_RANGE, -31.0, 31.0}, | 44 | {"vi_qfactor", &lavc_param_vi_qfactor, TCCONF_TYPE_FLOAT, TCCONF_FLAG_RANGE, -31.0, 31.0}, | |
18 | {"vi_qoffset", &lavc_param_vi_qoffset, TCCONF_TYPE_FLOAT, TCCONF_FLAG_RANGE, 0.0, 31.0}, | 45 | {"vi_qoffset", &lavc_param_vi_qoffset, TCCONF_TYPE_FLOAT, TCCONF_FLAG_RANGE, 0.0, 31.0}, | |
19 | @@ -211,7 +211,7 @@ TCConfigEntry lavcopts_conf[]={ | 46 | @@ -211,21 +207,21 @@ TCConfigEntry lavcopts_conf[]={ | |
20 | #else | 47 | #else | |
21 | {"aic", &lavc_param_aic, TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_AC_PRED}, | 48 | {"aic", &lavc_param_aic, TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_AC_PRED}, | |
22 | #endif | 49 | #endif | |
23 | - {"umv", &lavc_param_umv, TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_H263P_UMV}, | 50 | - {"umv", &lavc_param_umv, TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_H263P_UMV}, | |
24 | + {"umv", &lavc_param_umv, TCCONF_TYPE_FLAG, 0, 0, 1}, | 51 | + {"umv", &lavc_param_umv, TCCONF_TYPE_FLAG, 0, 0, 1}, | |
25 | {"ibias", &lavc_param_ibias, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, -512, 512}, | 52 | {"ibias", &lavc_param_ibias, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, -512, 512}, | |
26 | {"pbias", &lavc_param_pbias, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, -512, 512}, | 53 | {"pbias", &lavc_param_pbias, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, -512, 512}, | |
27 | {"coder", &lavc_param_coder, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 10}, | 54 | {"coder", &lavc_param_coder, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 10}, | |
28 | @@ -223,9 +223,9 @@ TCConfigEntry lavcopts_conf[]={ | 55 | {"context", &lavc_param_context, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 10}, | |
56 | {"intra_matrix", &lavc_param_intra_matrix, TCCONF_TYPE_STRING, 0, 0, 0}, | |||
57 | {"inter_matrix", &lavc_param_inter_matrix, TCCONF_TYPE_STRING, 0, 0, 0}, | |||
58 | - {"cbp", &lavc_param_cbp, TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_CBP_RD}, | |||
59 | + {"cbp", &lavc_param_cbp, TCCONF_TYPE_FLAG, 0, 0, 1}, | |||
60 | {"mv0", &lavc_param_mv0, TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_MV0}, | |||
29 | {"nr", &lavc_param_noise_reduction, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 1000000}, | 61 | {"nr", &lavc_param_noise_reduction, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 1000000}, | |
30 | {"qprd", &lavc_param_qp_rd, TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_QP_RD}, | 62 | - {"qprd", &lavc_param_qp_rd, TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_QP_RD}, | |
63 | + {"qprd", &lavc_param_qp_rd, TCCONF_TYPE_FLAG, 0, 0, 1}, | |||
31 | {"threads", &lavc_param_threads, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 1, 16}, | 64 | {"threads", &lavc_param_threads, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 1, 16}, | |
32 | - {"ss", &lavc_param_ss, TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_H263P_SLICE_STRUCT}, | 65 | - {"ss", &lavc_param_ss, TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_H263P_SLICE_STRUCT}, | |
33 | - {"svcd_sof", &lavc_param_scan_offset, TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_SVCD_SCAN_OFFSET}, | 66 | - {"svcd_sof", &lavc_param_scan_offset, TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_SVCD_SCAN_OFFSET}, | |
34 | - {"alt", &lavc_param_alt, TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_ALT_SCAN}, | 67 | - {"alt", &lavc_param_alt, TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_ALT_SCAN}, | |
35 | + {"ss", &lavc_param_ss, TCCONF_TYPE_FLAG, 0, 0, 1}, | 68 | + {"ss", &lavc_param_ss, TCCONF_TYPE_FLAG, 0, 0, 1}, | |
36 | + {"svcd_sof", &lavc_param_scan_offset, TCCONF_TYPE_FLAG, 0, 0, 1}, | 69 | + {"svcd_sof", &lavc_param_scan_offset, TCCONF_TYPE_FLAG, 0, 0, 1}, | |
37 | + {"alt", &lavc_param_alt, TCCONF_TYPE_FLAG, 0, 0, 1}, | 70 | + {"alt", &lavc_param_alt, TCCONF_TYPE_FLAG, 0, 0, 1}, | |
38 | {"ilme", &lavc_param_ilme, TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_INTERLACED_ME}, | 71 | {"ilme", &lavc_param_ilme, TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_INTERLACED_ME}, | |
39 | {"inter_threshold", &lavc_param_inter_threshold, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, -1000000, 1000000}, | 72 | {"inter_threshold", &lavc_param_inter_threshold, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, -1000000, 1000000}, | |
40 | {"sc_threshold", &lavc_param_sc_threshold, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, -1000000, 1000000}, | 73 | {"sc_threshold", &lavc_param_sc_threshold, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, -1000000, 1000000}, |
@@ -1,15 +1,30 @@ | @@ -1,15 +1,30 @@ | |||
1 | $NetBSD: patch-import_decode_lavc.c,v 1.1 2012/11/17 21:46:44 markd Exp $ | 1 | $NetBSD: patch-import_decode_lavc.c,v 1.2 2015/11/21 17:14:26 adam Exp $ | |
2 | 2 | |||
3 | Fix build with ffmpeg 0.11. gentoo patch from Brennan Shacklett | 3 | Fixes building against FFmpeg version >= 2.0.0 (gentoo patch). | |
4 | 4 | |||
5 | --- import/decode_lavc.c.orig 2011-11-19 16:50:27.000000000 +0000 | 5 | --- import/decode_lavc.c.orig 2011-11-19 16:50:27.000000000 +0000 | |
6 | +++ import/decode_lavc.c | 6 | +++ import/decode_lavc.c | |
7 | @@ -181,7 +181,7 @@ void decode_lavc(decode_t *decode) | 7 | @@ -170,7 +170,7 @@ void decode_lavc(decode_t *decode) | |
8 | ||||
9 | // Set these to the expected values so that ffmpeg's decoder can | |||
10 | // properly detect interlaced input. | |||
11 | - lavc_dec_context = avcodec_alloc_context(); | |||
12 | + lavc_dec_context = avcodec_alloc_context3(NULL); | |||
13 | if (lavc_dec_context == NULL) { | |||
14 | tc_log_error(__FILE__, "Could not allocate enough memory."); | |||
15 | goto decoder_error; | |||
16 | @@ -181,12 +181,12 @@ void decode_lavc(decode_t *decode) | |||
8 | #if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0) | 17 | #if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0) | |
9 | lavc_dec_context->error_resilience = 2; | 18 | lavc_dec_context->error_resilience = 2; | |
10 | #else | 19 | #else | |
11 | - lavc_dec_context->error_recognition = 2; | 20 | - lavc_dec_context->error_recognition = 2; | |
12 | + lavc_dec_context->err_recognition = 2; | 21 | + lavc_dec_context->err_recognition = 2; | |
13 | #endif | 22 | #endif | |
14 | lavc_dec_context->error_concealment = 3; | 23 | lavc_dec_context->error_concealment = 3; | |
15 | lavc_dec_context->workaround_bugs = FF_BUG_AUTODETECT; | 24 | lavc_dec_context->workaround_bugs = FF_BUG_AUTODETECT; | |
25 | ||||
26 | - if (avcodec_open(lavc_dec_context, lavc_dec_codec) < 0) { | |||
27 | + if (avcodec_open2(lavc_dec_context, lavc_dec_codec, NULL) < 0) { | |||
28 | tc_log_error(__FILE__, "Could not initialize the '%s' codec.", | |||
29 | codec->name); | |||
30 | goto decoder_error; |
@@ -1,15 +1,33 @@ | @@ -1,15 +1,33 @@ | |||
1 | $NetBSD: patch-import_import_ffmpeg.c,v 1.1 2012/11/17 21:46:44 markd Exp $ | 1 | $NetBSD: patch-import_import_ffmpeg.c,v 1.2 2015/11/21 17:14:26 adam Exp $ | |
2 | 2 | |||
3 | Fix build with ffmpeg 0.11. gentoo patch from Brennan Shacklett | 3 | Fixes building against FFmpeg version >= 2.0.0 (gentoo patch). | |
4 | 4 | |||
5 | --- import/import_ffmpeg.c.orig 2011-11-19 16:50:27.000000000 +0000 | 5 | --- import/import_ffmpeg.c.orig 2011-11-19 16:50:27.000000000 +0000 | |
6 | +++ import/import_ffmpeg.c | 6 | +++ import/import_ffmpeg.c | |
7 | @@ -302,7 +302,7 @@ do_avi: | |||
8 | ||||
9 | // Set these to the expected values so that ffmpeg's decoder can | |||
10 | // properly detect interlaced input. | |||
11 | - lavc_dec_context = avcodec_alloc_context(); | |||
12 | + lavc_dec_context = avcodec_alloc_context3(lavc_dec_codec); | |||
13 | if (lavc_dec_context == NULL) { | |||
14 | tc_log_error(MOD_NAME, "Could not allocate enough memory."); | |||
15 | return TC_IMPORT_ERROR; | |||
7 | @@ -314,7 +314,7 @@ do_avi: | 16 | @@ -314,7 +314,7 @@ do_avi: | |
8 | #if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0) | 17 | #if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0) | |
9 | lavc_dec_context->error_resilience = 2; | 18 | lavc_dec_context->error_resilience = 2; | |
10 | #else | 19 | #else | |
11 | - lavc_dec_context->error_recognition = 2; | 20 | - lavc_dec_context->error_recognition = 2; | |
12 | + lavc_dec_context->err_recognition = 2; | 21 | + lavc_dec_context->err_recognition = 2; | |
13 | #endif | 22 | #endif | |
14 | lavc_dec_context->error_concealment = 3; | 23 | lavc_dec_context->error_concealment = 3; | |
15 | lavc_dec_context->workaround_bugs = FF_BUG_AUTODETECT; | 24 | lavc_dec_context->workaround_bugs = FF_BUG_AUTODETECT; | |
25 | @@ -344,7 +344,7 @@ do_avi: | |||
26 | } | |||
27 | ||||
28 | TC_LOCK_LIBAVCODEC; | |||
29 | - ret = avcodec_open(lavc_dec_context, lavc_dec_codec); | |||
30 | + ret = avcodec_open2(lavc_dec_context, lavc_dec_codec, NULL); | |||
31 | TC_UNLOCK_LIBAVCODEC; | |||
32 | if (ret < 0) { | |||
33 | tc_log_warn(MOD_NAME, "Could not initialize the '%s' codec.", |
@@ -1,17 +1,35 @@ | @@ -1,17 +1,35 @@ | |||
1 | $NetBSD: patch-import_probe_ffmpeg.c,v 1.1 2012/11/17 21:46:44 markd Exp $ | 1 | $NetBSD: patch-import_probe_ffmpeg.c,v 1.2 2015/11/21 17:14:26 adam Exp $ | |
2 | 2 | |||
3 | Fix build with ffmpeg 0.11. gentoo patch from Brennan Shacklett | 3 | Fixes building against FFmpeg version >= 2.0.0 (gentoo patch). | |
4 | 4 | |||
5 | --- import/probe_ffmpeg.c.orig 2011-11-19 16:50:27.000000000 +0000 | 5 | --- import/probe_ffmpeg.c.orig 2011-11-19 16:50:27.000000000 +0000 | |
6 | +++ import/probe_ffmpeg.c | 6 | +++ import/probe_ffmpeg.c | |
7 | @@ -99,8 +99,8 @@ void probe_ffmpeg(info_t *ipipe) | 7 | @@ -99,8 +99,8 @@ void probe_ffmpeg(info_t *ipipe) | |
8 | 8 | |||
9 | TC_INIT_LIBAVCODEC; | 9 | TC_INIT_LIBAVCODEC; | |
10 | 10 | |||
11 | - ret = av_open_input_file(&lavf_dmx_context, ipipe->name, | 11 | - ret = av_open_input_file(&lavf_dmx_context, ipipe->name, | |
12 | - NULL, 0, NULL); | 12 | - NULL, 0, NULL); | |
13 | + ret = avformat_open_input(&lavf_dmx_context, ipipe->name, | 13 | + ret = avformat_open_input(&lavf_dmx_context, ipipe->name, | |
14 | + NULL, NULL); | 14 | + NULL, NULL); | |
15 | if (ret != 0) { | 15 | if (ret != 0) { | |
16 | tc_log_error(__FILE__, "unable to open '%s'" | 16 | tc_log_error(__FILE__, "unable to open '%s'" | |
17 | " (libavformat failure)", | 17 | " (libavformat failure)", | |
18 | @@ -109,7 +109,7 @@ void probe_ffmpeg(info_t *ipipe) | |||
19 | return; | |||
20 | } | |||
21 | ||||
22 | - ret = av_find_stream_info(lavf_dmx_context); | |||
23 | + ret = avformat_find_stream_info(lavf_dmx_context, NULL); | |||
24 | if (ret < 0) { | |||
25 | tc_log_error(__FILE__, "unable to fetch informations from '%s'" | |||
26 | " (libavformat failure)", | |||
27 | @@ -120,7 +120,7 @@ void probe_ffmpeg(info_t *ipipe) | |||
28 | ||||
29 | translate_info(lavf_dmx_context, ipipe->probe_info); | |||
30 | ||||
31 | - av_close_input_file(lavf_dmx_context); | |||
32 | + avformat_close_input(&lavf_dmx_context); | |||
33 | return; | |||
34 | } | |||
35 |
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | $NetBSD: patch-libtc_tcavcodec.h,v 1.1 2012/11/17 21:46:44 markd Exp $ | 1 | $NetBSD: patch-libtc_tcavcodec.h,v 1.2 2015/11/21 17:14:26 adam Exp $ | |
2 | 2 | |||
3 | Fix build with ffmpeg 0.11. gentoo patch from Brennan Shacklett | 3 | Fixes building against FFmpeg version >= 2.0.0 (gentoo patch). | |
4 | 4 | |||
5 | --- libtc/tcavcodec.h.orig 2011-11-19 16:50:27.000000000 +0000 | 5 | --- libtc/tcavcodec.h.orig 2011-11-19 16:50:27.000000000 +0000 | |
6 | +++ libtc/tcavcodec.h | 6 | +++ libtc/tcavcodec.h | |
7 | @@ -53,7 +53,6 @@ extern pthread_mutex_t tc_libavcodec_mut | 7 | @@ -53,7 +53,6 @@ extern pthread_mutex_t tc_libavcodec_mut | |
8 | 8 | |||
9 | #define TC_INIT_LIBAVCODEC do { \ | 9 | #define TC_INIT_LIBAVCODEC do { \ | |
10 | TC_LOCK_LIBAVCODEC; \ | 10 | TC_LOCK_LIBAVCODEC; \ | |
11 | - avcodec_init(); \ | 11 | - avcodec_init(); \ | |
12 | avcodec_register_all(); \ | 12 | avcodec_register_all(); \ | |
13 | TC_UNLOCK_LIBAVCODEC; \ | 13 | TC_UNLOCK_LIBAVCODEC; \ | |
14 | } while (0) | 14 | } while (0) |