Gentoo Archives: gentoo-commits

From: "Alexis Ballier (aballier)" <aballier@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in media-video/cinelerra/files: cinelerra-ffmpeg-0.11.patch
Date: Fri, 06 Jul 2012 14:42:47
Message-Id: 20120706144235.CAFF82004B@flycatcher.gentoo.org
1 aballier 12/07/06 14:42:35
2
3 Added: cinelerra-ffmpeg-0.11.patch
4 Log:
5 fix build with ffmpeg 0.11 and git master
6
7 (Portage version: 2.2.0_alpha116/cvs/Linux x86_64)
8
9 Revision Changes Path
10 1.1 media-video/cinelerra/files/cinelerra-ffmpeg-0.11.patch
11
12 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/media-video/cinelerra/files/cinelerra-ffmpeg-0.11.patch?rev=1.1&view=markup
13 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/media-video/cinelerra/files/cinelerra-ffmpeg-0.11.patch?rev=1.1&content-type=text/plain
14
15 Index: cinelerra-ffmpeg-0.11.patch
16 ===================================================================
17 Let it build with ffmpeg-0.11
18
19 Index: cinelerra-20111223/cinelerra/ffmpeg.C
20 ===================================================================
21 --- cinelerra-20111223.orig/cinelerra/ffmpeg.C
22 +++ cinelerra-20111223/cinelerra/ffmpeg.C
23 @@ -23,7 +23,6 @@ FFMPEG::FFMPEG(Asset *asset) {
24
25 int FFMPEG::init(char *codec_string) {
26
27 - avcodec_init();
28 avcodec_register_all();
29
30 CodecID id = codec_id(codec_string);
31 Index: cinelerra-20111223/cinelerra/fileac3.C
32 ===================================================================
33 --- cinelerra-20111223.orig/cinelerra/fileac3.C
34 +++ cinelerra-20111223/cinelerra/fileac3.C
35 @@ -84,7 +84,6 @@ int FileAC3::open_file(int rd, int wr)
36
37 if(wr)
38 {
39 - avcodec_init();
40 avcodec_register_all();
41 codec = avcodec_find_encoder(CODEC_ID_AC3);
42 if(!codec)
43 Index: cinelerra-20111223/configure.in
44 ===================================================================
45 --- cinelerra-20111223.orig/configure.in
46 +++ cinelerra-20111223/configure.in
47 @@ -338,7 +338,7 @@ AC_SUBST(CPU_CFLAGS)
48 AC_ARG_WITH([external-ffmpeg], AC_HELP_STRING([--with-external-ffmpeg], [use external ffmpeg library]))
49
50 if test "x$with_external_ffmpeg" = "xyes"; then
51 - PKG_CHECK_MODULES([FFMPEG_TEMP], [libavcodec libpostproc])
52 + PKG_CHECK_MODULES([FFMPEG_TEMP], [libavcodec libpostproc libavutil])
53 FFMPEG_FOLDER=""
54 FFMPEG_EXTERNALTEXT="External ffmpeg"
55
56 @@ -356,10 +356,10 @@ if test "x$with_external_ffmpeg" = "xyes
57 AC_MSG_RESULT($enable_ffmpeg_swscale)
58 if test x"$enable_ffmpeg_swscale" = xyes; then
59 dnl AC_DEFINE(HAVE_SWSCALER)
60 - PKG_CHECK_MODULES([FFMPEG], [libavcodec libpostproc libswscale])
61 + PKG_CHECK_MODULES([FFMPEG], [libavcodec libpostproc libswscale libavutil])
62 FFMPEG_CFLAGS="$FFMPEG_CFLAGS -I/usr/include/libavcodec -I/usr/include/libswscale -DHAVE_SWSCALER"
63 else
64 - PKG_CHECK_MODULES([FFMPEG], [libavcodec libpostproc])
65 + PKG_CHECK_MODULES([FFMPEG], [libavcodec libpostproc libavutil])
66 fi
67 FFMPEG_EXTERNALTEXT="External ffmpeg"
68 else
69 Index: cinelerra-20111223/quicktime/mpeg4.c
70 ===================================================================
71 --- cinelerra-20111223.orig/quicktime/mpeg4.c
72 +++ cinelerra-20111223/quicktime/mpeg4.c
73 @@ -8,6 +8,7 @@
74
75
76 #include "libavcodec/avcodec.h"
77 +#include "libavutil/dict.h"
78 #include "colormodels.h"
79 #include "funcprotos.h"
80 #include "qtffmpeg.h"
81 @@ -624,12 +625,12 @@ static int encode(quicktime_t *file, uns
82 else
83 // ffmpeg section
84 {
85 + AVDictionary ** opts = NULL;
86 static char *video_rc_eq="tex^qComp";
87 codec->encode_initialized[current_field] = 1;
88 if(!ffmpeg_initialized)
89 {
90 ffmpeg_initialized = 1;
91 - avcodec_init();
92 avcodec_register_all();
93 }
94
95 @@ -673,8 +674,10 @@ static int encode(quicktime_t *file, uns
96 context->b_quant_offset = 1.25;
97 #if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0)
98 context->error_resilience = FF_ER_CAREFUL;
99 -#else
100 +#elif LIBAVCODEC_VERSION_INT < ((54<<16)+(0<<8)+0)
101 context->error_recognition = FF_ER_CAREFUL;
102 +#else
103 + context->err_recognition |= AV_EF_CAREFUL;
104 #endif
105 context->error_concealment = 3;
106 context->frame_skip_cmp = FF_CMP_DCTMAX;
107 @@ -699,7 +702,7 @@ static int encode(quicktime_t *file, uns
108 context->profile= FF_PROFILE_UNKNOWN;
109 context->rc_buffer_aggressivity = 1.0;
110 context->level= FF_LEVEL_UNKNOWN;
111 - context->flags |= CODEC_FLAG_H263P_UMV;
112 + av_dict_set(opts, "umv", "1", 0);
113 context->flags |= CODEC_FLAG_AC_PRED;
114
115 // All the forbidden settings can be extracted from libavcodec/mpegvideo.c of ffmpeg...
116 @@ -717,10 +720,8 @@ static int encode(quicktime_t *file, uns
117 (codec->ffmpeg_id == CODEC_ID_MPEG4 ||
118 codec->ffmpeg_id == CODEC_ID_MPEG1VIDEO ||
119 codec->ffmpeg_id == CODEC_ID_MPEG2VIDEO ||
120 - codec->ffmpeg_id == CODEC_ID_H263P ||
121 - codec->ffmpeg_id == CODEC_FLAG_H263P_SLICE_STRUCT))
122 + codec->ffmpeg_id == CODEC_ID_H263P ))
123 {
124 - avcodec_thread_init(context, file->cpus);
125 context->thread_count = file->cpus;
126 }
127
128 @@ -740,7 +741,7 @@ static int encode(quicktime_t *file, uns
129 * codec->fix_bitrate,
130 * codec->quantizer);
131 */
132 - avcodec_open(context, codec->encoder[current_field]);
133 + avcodec_open2(context, codec->encoder[current_field], opts);
134
135 avcodec_get_frame_defaults(&codec->picture[current_field]);
136
137 Index: cinelerra-20111223/quicktime/qtffmpeg.c
138 ===================================================================
139 --- cinelerra-20111223.orig/quicktime/qtffmpeg.c
140 +++ cinelerra-20111223/quicktime/qtffmpeg.c
141 @@ -54,7 +54,6 @@ quicktime_ffmpeg_t* quicktime_new_ffmpeg
142 if(!ffmpeg_initialized)
143 {
144 ffmpeg_initialized = 1;
145 - avcodec_init();
146 avcodec_register_all();
147 }
148
149 @@ -90,10 +89,8 @@ quicktime_ffmpeg_t* quicktime_new_ffmpeg
150 (ffmpeg_id == CODEC_ID_MPEG4 ||
151 ffmpeg_id == CODEC_ID_MPEG1VIDEO ||
152 ffmpeg_id == CODEC_ID_MPEG2VIDEO ||
153 - ffmpeg_id == CODEC_ID_H263P ||
154 - ffmpeg_id == CODEC_FLAG_H263P_SLICE_STRUCT))
155 + ffmpeg_id == CODEC_ID_H263P ))
156 {
157 - avcodec_thread_init(context, cpus);
158 context->thread_count = cpus;
159 }
160 if(avcodec_open(context,
161 Index: cinelerra-20111223/quicktime/wma.c
162 ===================================================================
163 --- cinelerra-20111223.orig/quicktime/wma.c
164 +++ cinelerra-20111223/quicktime/wma.c
165 @@ -67,7 +67,6 @@ static int init_decode(quicktime_audio_m
166 if(!ffmpeg_initialized)
167 {
168 ffmpeg_initialized = 1;
169 - avcodec_init();
170 avcodec_register_all();
171 }