Gentoo Archives: gentoo-commits

From: "Alexis Ballier (aballier)" <aballier@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in app-cdr/k9copy/files: k9copy-2.3.8-includepaths.patch k9copy-2.3.8-ffmpeg-0.11.patch
Date: Sun, 03 Mar 2013 14:18:50
Message-Id: 20130303141845.D48002171E@flycatcher.gentoo.org
1 aballier 13/03/03 14:18:45
2
3 Added: k9copy-2.3.8-includepaths.patch
4 k9copy-2.3.8-ffmpeg-0.11.patch
5 Log:
6 Import slackware patch to build with recent ffmpeg versions and port the patch from backlite to properly include ffmpeg headers, bug #459980
7
8 (Portage version: 2.2.0_alpha164/cvs/Linux x86_64, signed Manifest commit with key 160F534A)
9
10 Revision Changes Path
11 1.1 app-cdr/k9copy/files/k9copy-2.3.8-includepaths.patch
12
13 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-cdr/k9copy/files/k9copy-2.3.8-includepaths.patch?rev=1.1&view=markup
14 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-cdr/k9copy/files/k9copy-2.3.8-includepaths.patch?rev=1.1&content-type=text/plain
15
16 Index: k9copy-2.3.8-includepaths.patch
17 ===================================================================
18 libavutil/time.h in recent ffmpeg versions pollute the includes.
19 include libav* headers correcly.
20 https://bugs.gentoo.org/show_bug.cgi?id=459980
21 same as for backlite
22
23 Index: k9copy-2.3.8-Source/cmake/FindAvcodec.cmake
24 ===================================================================
25 --- k9copy-2.3.8-Source.orig/cmake/FindAvcodec.cmake
26 +++ k9copy-2.3.8-Source/cmake/FindAvcodec.cmake
27 @@ -10,11 +10,11 @@ IF (AVCODEC_INCLUDE_DIR_FF)
28 ELSE (AVCODEC_INCLUDE_DIR_FF)
29 FIND_PATH(AVCODEC_INCLUDE_DIR_LAVC "libavcodec/avcodec.h" PATHS)
30 IF (AVCODEC_INCLUDE_DIR_LAVC)
31 - SET (AVCODEC_INCLUDE_DIR "${AVCODEC_INCLUDE_DIR_LAVC}/libavcodec")
32 + SET (AVCODEC_INCLUDE_DIR "${AVCODEC_INCLUDE_DIR_LAVC}")
33 ELSE (AVCODEC_INCLUDE_DIR_LAVC)
34 FIND_PATH(AVCODEC_INCLUDE_DIR_FF_LAVC "ffmpeg/libavcodec/avcodec.h" PATHS)
35 IF (AVCODEC_INCLUDE_DIR_FF_LAVC)
36 - SET (AVCODEC_INCLUDE_DIR "${AVCODEC_INCLUDE_DIR_FF_LAVC}/ffmpeg/libavcodec")
37 + SET (AVCODEC_INCLUDE_DIR "${AVCODEC_INCLUDE_DIR_FF_LAVC}/ffmpeg")
38 SET (FFMPEG_INCLUDE_DIR "${AVCODEC_INCLUDE_DIR_FF_LAVC}/ffmpeg")
39 ENDIF (AVCODEC_INCLUDE_DIR_FF_LAVC)
40 ENDIF (AVCODEC_INCLUDE_DIR_LAVC)
41 @@ -35,4 +35,4 @@ IF (INC_FOUND)
42 ELSE (INC_FOUND)
43 MESSAGE(FATAL_ERROR "Could not find ${_lib}")
44 ENDIF (INC_FOUND)
45 -ENDMACRO (FINDAVCODEC _lib )
46 \ No newline at end of file
47 +ENDMACRO (FINDAVCODEC _lib )
48 Index: k9copy-2.3.8-Source/cmake/FindAvformat.cmake
49 ===================================================================
50 --- k9copy-2.3.8-Source.orig/cmake/FindAvformat.cmake
51 +++ k9copy-2.3.8-Source/cmake/FindAvformat.cmake
52 @@ -6,11 +6,11 @@ IF (AVFORMAT_INCLUDE_DIR_FF)
53 ELSE (AVFORMAT_INCLUDE_DIR_FF)
54 FIND_PATH(AVFORMAT_INCLUDE_DIR_LAVC "libavformat/avformat.h" PATHS)
55 IF (AVFORMAT_INCLUDE_DIR_LAVC)
56 - SET (AVFORMAT_INCLUDE_DIR "${AVFORMAT_INCLUDE_DIR_LAVC}/libavformat")
57 + SET (AVFORMAT_INCLUDE_DIR "${AVFORMAT_INCLUDE_DIR_LAVC}")
58 ELSE (AVFORMAT_INCLUDE_DIR_LAVC)
59 FIND_PATH(AVFORMAT_INCLUDE_DIR_FF_LAVF "ffmpeg/libavformat/avformat.h" PATHS)
60 IF (AVFORMAT_INCLUDE_DIR_FF_LAVF)
61 - SET (AVFORMAT_INCLUDE_DIR "${AVFORMAT_INCLUDE_DIR_FF_LAVF}/ffmpeg/libavformat")
62 + SET (AVFORMAT_INCLUDE_DIR "${AVFORMAT_INCLUDE_DIR_FF_LAVF}/ffmpeg")
63 ENDIF (AVFORMAT_INCLUDE_DIR_FF_LAVF)
64 ENDIF (AVFORMAT_INCLUDE_DIR_LAVC)
65 ENDIF (AVFORMAT_INCLUDE_DIR_FF)
66 @@ -32,4 +32,4 @@ IF (INC_FOUND)
67 ELSE (INC_FOUND)
68 MESSAGE(FATAL_ERROR "Could not find ${_lib}")
69 ENDIF (INC_FOUND)
70 -ENDMACRO (FINDAVFORMAT _lib )
71 \ No newline at end of file
72 +ENDMACRO (FINDAVFORMAT _lib )
73 Index: k9copy-2.3.8-Source/cmake/FindAvutil.cmake
74 ===================================================================
75 --- k9copy-2.3.8-Source.orig/cmake/FindAvutil.cmake
76 +++ k9copy-2.3.8-Source/cmake/FindAvutil.cmake
77 @@ -6,11 +6,11 @@ IF (AVUTIL_INCLUDE_DIR_FF)
78 ELSE (AVUTIL_INCLUDE_DIR_FF)
79 FIND_PATH(AVUTIL_INCLUDE_DIR_LAVC "libavutil/avutil.h" PATHS)
80 IF (AVUTIL_INCLUDE_DIR_LAVC)
81 - SET (AVUTIL_INCLUDE_DIR "${AVUTIL_INCLUDE_DIR_LAVC}/libavutil")
82 + SET (AVUTIL_INCLUDE_DIR "${AVUTIL_INCLUDE_DIR_LAVC}")
83 ELSE (AVUTIL_INCLUDE_DIR_LAVC)
84 FIND_PATH(AVUTIL_INCLUDE_DIR_FF_LAVF "ffmpeg/libavutil/avutil.h" PATHS)
85 IF (AVUTIL_INCLUDE_DIR_FF_LAVF)
86 - SET (AVUTIL_INCLUDE_DIR "${AVUTIL_INCLUDE_DIR_FF_LAVF}/ffmpeg/libavutil")
87 + SET (AVUTIL_INCLUDE_DIR "${AVUTIL_INCLUDE_DIR_FF_LAVF}/ffmpeg")
88 ENDIF (AVUTIL_INCLUDE_DIR_FF_LAVF)
89 ENDIF (AVUTIL_INCLUDE_DIR_LAVC)
90 ENDIF (AVUTIL_INCLUDE_DIR_FF)
91 @@ -32,4 +32,4 @@ IF (INC_FOUND)
92 ELSE (INC_FOUND)
93 MESSAGE(FATAL_ERROR "Could not find ${_lib}")
94 ENDIF (INC_FOUND)
95 -ENDMACRO (FINDAVUTIL _lib )
96 \ No newline at end of file
97 +ENDMACRO (FINDAVUTIL _lib )
98 Index: k9copy-2.3.8-Source/cmake/FindFFmpegScale.cmake
99 ===================================================================
100 --- k9copy-2.3.8-Source.orig/cmake/FindFFmpegScale.cmake
101 +++ k9copy-2.3.8-Source/cmake/FindFFmpegScale.cmake
102 @@ -7,11 +7,11 @@ IF (FFMPEGSCALE_INCLUDE_DIR_FF)
103 ELSE (FFMPEGSCALE_INCLUDE_DIR_FF)
104 FIND_PATH(FFMPEGSCALE_INCLUDE_DIR_LAVC "libswscale/swscale.h" PATHS)
105 IF (FFMPEGSCALE_INCLUDE_DIR_LAVC)
106 - SET (FFMPEGSCALE_INCLUDE_DIR "${FFMPEGSCALE_INCLUDE_DIR_LAVC}/libswscale")
107 + SET (FFMPEGSCALE_INCLUDE_DIR "${FFMPEGSCALE_INCLUDE_DIR_LAVC}")
108 ELSE (FFMPEGSCALE_INCLUDE_DIR_LAVC)
109 FIND_PATH(FFMPEGSCALE_INCLUDE_DIR_FF_SCAL "ffmpeg/libswscale/swscale.h" PATHS)
110 IF (FFMPEGSCALE_INCLUDE_DIR_FF_SCAL)
111 - SET (FFMPEGSCALE_INCLUDE_DIR "${FFMPEGSCALE_INCLUDE_DIR_FF_SCAL}/ffmpeg/libswscale")
112 + SET (FFMPEGSCALE_INCLUDE_DIR "${FFMPEGSCALE_INCLUDE_DIR_FF_SCAL}/ffmpeg")
113 ENDIF (FFMPEGSCALE_INCLUDE_DIR_FF_SCAL)
114 ENDIF (FFMPEGSCALE_INCLUDE_DIR_LAVC)
115 ENDIF (FFMPEGSCALE_INCLUDE_DIR_FF)
116 @@ -34,4 +34,4 @@ ELSE (HAVE_SWSCALE)
117 MESSAGE(STATUS "k9copy will be built without swscale support")
118 #MESSAGE(FATAL_ERROR "Could not find ${_lib}")
119 ENDIF (HAVE_SWSCALE)
120 -ENDMACRO (FINDFFMPEGSCALE _lib )
121 \ No newline at end of file
122 +ENDMACRO (FINDFFMPEGSCALE _lib )
123 Index: k9copy-2.3.8-Source/src/import/k9avidecode.cpp
124 ===================================================================
125 --- k9copy-2.3.8-Source.orig/src/import/k9avidecode.cpp
126 +++ k9copy-2.3.8-Source/src/import/k9avidecode.cpp
127 @@ -10,14 +10,14 @@
128 //
129 //
130 #include "k9avidecode.h"
131 -#include <avcodec.h>
132 +#include <libavcodec/avcodec.h>
133 #include <qimage.h>
134 #include <dlfcn.h>
135 #include "k9common.h"
136
137 #ifdef HAVE_SWSCALE
138
139 -#include "swscale.h"
140 +#include <libswscale/swscale.h>
141
142 static int sws_flags = SWS_BICUBIC;
143
144 Index: k9copy-2.3.8-Source/src/import/k9avidecode.h
145 ===================================================================
146 --- k9copy-2.3.8-Source.orig/src/import/k9avidecode.h
147 +++ k9copy-2.3.8-Source/src/import/k9avidecode.h
148 @@ -14,13 +14,13 @@
149
150 #include "k9common.h"
151 #include <qobject.h>
152 -#include <avformat.h>
153 -#include <avutil.h>
154 +#include <libavformat/avformat.h>
155 +#include <libavutil/avutil.h>
156 #include <qimage.h>
157 #include <cstdlib>
158 #include <QObject>
159 #ifdef HAVE_SWSCALE
160 -#include <swscale.h>
161 +#include <libswscale/swscale.h>
162 #endif
163 /**
164 @author Jean-Michel PETIT <k9copy@××××.fr>
165 Index: k9copy-2.3.8-Source/src/vamps/k9ffmpeg.cpp
166 ===================================================================
167 --- k9copy-2.3.8-Source.orig/src/vamps/k9ffmpeg.cpp
168 +++ k9copy-2.3.8-Source/src/vamps/k9ffmpeg.cpp
169 @@ -12,7 +12,7 @@
170 #include "k9common.h"
171 #include "k9ffmpeg.h"
172 #ifdef HAVE_SWSCALE
173 -#include "swscale.h"
174 +#include <libswscale/swscale.h>
175 #endif
176 #include <dlfcn.h>
177 #include <klocale.h>
178 Index: k9copy-2.3.8-Source/src/vamps/k9ffmpeg.h
179 ===================================================================
180 --- k9copy-2.3.8-Source.orig/src/vamps/k9ffmpeg.h
181 +++ k9copy-2.3.8-Source/src/vamps/k9ffmpeg.h
182 @@ -13,12 +13,12 @@
183 #define K9FFMPEG_H
184
185 #include <QString>
186 -#include <avcodec.h>
187 -#include <avformat.h>
188 -#include <avutil.h>
189 -#include <avio.h>
190 +#include <libavcodec/avcodec.h>
191 +#include <libavformat/avformat.h>
192 +#include <libavutil/avutil.h>
193 +#include <libavformat/avio.h>
194 #ifdef HAVE_SWSCALE
195 -#include <swscale.h>
196 +#include <libswscale/swscale.h>
197 #endif
198 /**
199 @author Jean-Michel PETIT <k9copy@××××.fr>
200
201
202
203 1.1 app-cdr/k9copy/files/k9copy-2.3.8-ffmpeg-0.11.patch
204
205 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-cdr/k9copy/files/k9copy-2.3.8-ffmpeg-0.11.patch?rev=1.1&view=markup
206 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-cdr/k9copy/files/k9copy-2.3.8-ffmpeg-0.11.patch?rev=1.1&content-type=text/plain
207
208 Index: k9copy-2.3.8-ffmpeg-0.11.patch
209 ===================================================================
210 Fix build with ffmpeg-0.11 and later.
211
212 From slackware:
213 http://www.slackware.org.uk/slackbuilds.org/14.0/multimedia/k9copy/
214 https://bugs.gentoo.org/show_bug.cgi?id=459980
215
216 diff -Nru k9copy-2.3.8-Source.orig/CMakeLists.txt k9copy-2.3.8-Source/CMakeLists.txt
217 --- k9copy-2.3.8-Source.orig/CMakeLists.txt 2011-12-09 22:08:41.000000000 +0100
218 +++ k9copy-2.3.8-Source/CMakeLists.txt 2012-11-23 10:12:56.000000000 +0100
219 @@ -18,6 +18,7 @@
220 INCLUDE(FindXine)
221 INCLUDE(FindAvcodec)
222 INCLUDE(FindAvformat)
223 +INCLUDE(FindAvutil)
224 INCLUDE(FindFFmpegScale)
225 #INCLUDE(FindLibDvdread)
226
227 @@ -68,6 +69,7 @@
228
229 FINDAVFORMAT("avformat")
230 FINDAVCODEC("avcodec")
231 +FINDAVUTIL("avutil")
232
233 add_definitions( -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS)
234 add_subdirectory( src/dvdnav)
235 @@ -103,6 +105,7 @@
236 #${LIBDVDREAD_INCLUDE_DIR}/dvdread
237 ${AVCODEC_INCLUDE_DIR}
238 ${AVFORMAT_INCLUDE_DIR}
239 + ${AVUTIL_INCLUDE_DIR}
240 ${FFMPEGSCALE_INCLUDE_DIR}
241 ${FFMPEG_INCLUDE_DIR}
242 )
243 diff -Nru k9copy-2.3.8-Source.orig/cmake/FindAvutil.cmake k9copy-2.3.8-Source/cmake/FindAvutil.cmake
244 --- k9copy-2.3.8-Source.orig/cmake/FindAvutil.cmake 1970-01-01 01:00:00.000000000 +0100
245 +++ k9copy-2.3.8-Source/cmake/FindAvutil.cmake 2012-11-23 10:12:56.000000000 +0100
246 @@ -0,0 +1,35 @@
247 +MACRO (FINDAVUTIL _lib)
248 +
249 +FIND_PATH(AVUTIL_INCLUDE_DIR_FF "ffmpeg/avutil.h" PATHS)
250 +IF (AVUTIL_INCLUDE_DIR_FF)
251 + SET (AVUTIL_INCLUDE_DIR "${AVCODEC_INCLUDE_DIR_FF}/ffmpeg")
252 +ELSE (AVUTIL_INCLUDE_DIR_FF)
253 + FIND_PATH(AVUTIL_INCLUDE_DIR_LAVC "libavutil/avutil.h" PATHS)
254 + IF (AVUTIL_INCLUDE_DIR_LAVC)
255 + SET (AVUTIL_INCLUDE_DIR "${AVUTIL_INCLUDE_DIR_LAVC}/libavutil")
256 + ELSE (AVUTIL_INCLUDE_DIR_LAVC)
257 + FIND_PATH(AVUTIL_INCLUDE_DIR_FF_LAVF "ffmpeg/libavutil/avutil.h" PATHS)
258 + IF (AVUTIL_INCLUDE_DIR_FF_LAVF)
259 + SET (AVUTIL_INCLUDE_DIR "${AVUTIL_INCLUDE_DIR_FF_LAVF}/ffmpeg/libavutil")
260 + ENDIF (AVUTIL_INCLUDE_DIR_FF_LAVF)
261 + ENDIF (AVUTIL_INCLUDE_DIR_LAVC)
262 +ENDIF (AVUTIL_INCLUDE_DIR_FF)
263 +
264 +
265 +
266 +FIND_LIBRARY(AVUTIL_LIBRARY NAMES ${_lib} PATHS )
267 +
268 +IF (AVUTIL_INCLUDE_DIR AND AVUTIL_LIBRARY)
269 + SET(INC_FOUND TRUE)
270 +ELSE (AVUTIL_INCLUDE_DIR AND AVUTIL_LIBRARY)
271 + SET(INC_FOUND FALSE)
272 +ENDIF (AVUTIL_INCLUDE_DIR AND AVUTIL_LIBRARY)
273 +
274 +
275 +IF (INC_FOUND)
276 + MESSAGE(STATUS "Found include avutil.h: ${AVUTIL_INCLUDE_DIR}")
277 + MESSAGE(STATUS "Found library ${_lib}: ${AVUTIL_LIBRARY}")
278 +ELSE (INC_FOUND)
279 + MESSAGE(FATAL_ERROR "Could not find ${_lib}")
280 +ENDIF (INC_FOUND)
281 +ENDMACRO (FINDAVUTIL _lib )
282 \ No newline at end of file
283 diff -Nru k9copy-2.3.8-Source.orig/src/backup/k9mp4enc.cpp k9copy-2.3.8-Source/src/backup/k9mp4enc.cpp
284 --- k9copy-2.3.8-Source.orig/src/backup/k9mp4enc.cpp 2011-12-09 22:08:41.000000000 +0100
285 +++ k9copy-2.3.8-Source/src/backup/k9mp4enc.cpp 2012-12-11 09:37:02.558323776 +0100
286 @@ -619,7 +619,7 @@
287 // cmd << "-lavfopts" << "i_certify_that_my_video_stream_does_not_use_b_frames";
288 }
289 //synchronize audio
290 - cmd << "-async" << "1" ;
291 + cmd << "-async" << "44100" ;
292 cmd << "-y" << KShell::quoteArg(path);
293 cmd << slNewAudio;
294 // if (m_extractMkv) {
295 diff -Nru k9copy-2.3.8-Source.orig/src/core/k9audiocodecs.cpp k9copy-2.3.8-Source/src/core/k9audiocodecs.cpp
296 --- k9copy-2.3.8-Source.orig/src/core/k9audiocodecs.cpp 2011-12-09 22:08:42.000000000 +0100
297 +++ k9copy-2.3.8-Source/src/core/k9audiocodecs.cpp 2012-12-11 09:37:02.584323452 +0100
298 @@ -75,10 +75,10 @@
299 m_codecs[4]=_k9AudioCodec("sonic","-oac lavc -lavcopts acodec=sonic:abitrate=$AUDBR","mencoder");
300 m_codecs[5]=_k9AudioCodec("aac","-oac faac -faacopts br=$AUDBR","mencoder");
301 m_codecs[6]=_k9AudioCodec("mp3 (lame)","-oac mp3lame -lameopts abr:br=$AUDBR","mencoder");
302 - m_codecs[7]=_k9AudioCodec("copy","-acodec copy","ffmpeg","");
303 - m_codecs[8]=_k9AudioCodec("mp3","-acodec libmp3lame -ab $AUDBRk -ac 2","ffmpeg",".mp3");
304 - m_codecs[9]=_k9AudioCodec("vorbis","-acodec vorbis -ab $AUDBRk -ac 2","ffmpeg",".ogg");
305 - m_codecs[10]=_k9AudioCodec("aac","-acodec libfaac -ab $AUDBRk -ac 2","ffmpeg",".aac");
306 + m_codecs[7]=_k9AudioCodec("copy","-codec:a copy","ffmpeg","");
307 + m_codecs[8]=_k9AudioCodec("mp3","-codec:a libmp3lame -ab $AUDBRk -ac 2 -ar 44100","ffmpeg",".mp3");
308 + m_codecs[9]=_k9AudioCodec("vorbis","-codec:a vorbis -ab $AUDBRk -ac 2 -ar 44100","ffmpeg",".ogg");
309 + m_codecs[10]=_k9AudioCodec("aac","-codec:a libfaac -ab $AUDBRk -ac 2 -ar 44100","ffmpeg",".aac");
310
311 save();
312 }
313 diff -Nru k9copy-2.3.8-Source.orig/src/core/k9videocodecs.cpp k9copy-2.3.8-Source/src/core/k9videocodecs.cpp
314 --- k9copy-2.3.8-Source.orig/src/core/k9videocodecs.cpp 2011-12-09 22:08:42.000000000 +0100
315 +++ k9copy-2.3.8-Source/src/core/k9videocodecs.cpp 2012-12-11 09:37:02.607323163 +0100
316 @@ -98,12 +98,12 @@
317 m_codecs[18]=_k9VideoCodec("ASUS v1","","-ovc lavc -lavcopts vcodec=asv1:vhq:v4mv:vqmin=2:vbitrate=$VIDBR:aspect=$ASPECT -vf crop=$CROPWIDTH:$CROPHEIGHT:$CROPLEFT:$CROPTOP,scale=$WIDTH:$HEIGHT,dsize=$ASPECT","-ovc lavc -lavcopts vcodec=asv1:vhq:v4mv:vqmin=2:vbitrate=$VIDBR:aspect=$ASPECT:turbo:vpass=$PASS -vf crop=$CROPWIDTH:$CROPHEIGHT:$CROPLEFT:$CROPTOP,scale=$WIDTH:$HEIGHT,dsize=$ASPECT","-ovc lavc -lavcopts vcodec=asv1:vhq:v4mv:vqmin=2:vbitrate=$VIDBR:aspect=$ASPECT:turbo:vpass=$PASS -vf crop=$CROPWIDTH:$CROPHEIGHT:$CROPLEFT:$CROPTOP,scale=$WIDTH:$HEIGHT,dsize=$ASPECT","mencoder");
318 m_codecs[19]=_k9VideoCodec("ASUS v2","","-ovc lavc -lavcopts vcodec=asv2:vhq:v4mv:vqmin=2:vbitrate=$VIDBR:aspect=$ASPECT -vf crop=$CROPWIDTH:$CROPHEIGHT:$CROPLEFT:$CROPTOP,scale=$WIDTH:$HEIGHT,dsize=$ASPECT","-ovc lavc -lavcopts vcodec=asv2:vhq:v4mv:vqmin=2:vbitrate=$VIDBR:aspect=$ASPECT:turbo:vpass=$PASS -vf crop=$CROPWIDTH:$CROPHEIGHT:$CROPLEFT:$CROPTOP,scale=$WIDTH:$HEIGHT,dsize=$ASPECT","-ovc lavc -lavcopts vcodec=asv2:vhq:v4mv:vqmin=2:vbitrate=$VIDBR:aspect=$ASPECT:turbo:vpass=$PASS -vf crop=$CROPWIDTH:$CROPHEIGHT:$CROPLEFT:$CROPTOP,scale=$WIDTH:$HEIGHT,dsize=$ASPECT","mencoder");
319 m_codecs[20]=_k9VideoCodec("flv","","-ovc lavc -lavcopts vcodec=flv:vhq:v4mv:vqmin=2:vbitrate=$VIDBR:aspect=$ASPECT -vf crop=$CROPWIDTH:$CROPHEIGHT:$CROPLEFT:$CROPTOP,scale=$WIDTH:$HEIGHT,dsize=$ASPECT","-ovc lavc -lavcopts vcodec=flv:vhq:v4mv:vqmin=2:vbitrate=$VIDBR:aspect=$ASPECT:turbo:vpass=$PASS -vf crop=$CROPWIDTH:$CROPHEIGHT:$CROPLEFT:$CROPTOP,scale=$WIDTH:$HEIGHT,dsize=$ASPECT","-ovc lavc -lavcopts vcodec=flv:vhq:v4mv:vqmin=2:vbitrate=$VIDBR:aspect=$ASPECT:turbo:vpass=$PASS -vf crop=$CROPWIDTH:$CROPHEIGHT:$CROPLEFT:$CROPTOP,scale=$WIDTH:$HEIGHT,dsize=$ASPECT","mencoder");
320 - m_codecs[21]=_k9VideoCodec("copy","","-vcodec copy","-vcodec copy","-vcodec copy","ffmpeg");
321 - m_codecs[22]=_k9VideoCodec("x264","","-b $VIDBRk -s $WIDTHx$HEIGHT -vf crop=$CROPWIDTH:$CROPHEIGHT:$CROPLEFT:$CROPTOP -aspect $ASPECT -vcodec libx264 -level 30","-b $VIDBRk -s $WIDTHx$HEIGHT -croptop $CROPTOP -cropbottom $CROPBOTTOM -cropleft $CROPLEFT -cropright $CROPRIGHT -aspect $ASPECT -vcodec libx264 -pass $PASS -passlogfile $PASSLOGFILE -level 30","-b $VIDBRk -s $WIDTHx$HEIGHT -croptop $CROPTOP -cropbottom $CROPBOTTOM -cropleft $CROPLEFT -cropright $CROPRIGHT -aspect $ASPECT -vcodec libx264 -pass $PASS -passlogfile $PASSLOGFILE -level 30","ffmpeg");
322 - m_codecs[23]=_k9VideoCodec("x264 (high)","","-b $VIDBRk -s $WIDTHx$HEIGHT -vf crop=$CROPWIDTH:$CROPHEIGHT:$CROPLEFT:$CROPTOP -aspect $ASPECT -vcodec libx264 -level 30 -flags +loop+mv4 -cmp 256 -partitions +parti4x4+parti8x8+partp4x4+partp8x8+partb8x8 -me_method hex -subq 7 -trellis 1 -refs 5 -bf 3 -flags2 +bpyramid+wpred+mixed_refs+dct8x8 -coder 1 -me_range 16 -g 250 -keyint_min 25 -sc_threshold 40 -i_qfactor 0.71 -qmin 10 -qmax 51 -qdiff 4","-b $VIDBRk -s $WIDTHx$HEIGHT -croptop $CROPTOP -cropbottom $CROPBOTTOM -cropleft $CROPLEFT -cropright $CROPRIGHT -aspect $ASPECT -vcodec libx264 -level 30 -flags +loop+mv4 -cmp 256 -partitions +parti4x4+parti8x8+partp4x4+partp8x8+partb8x8 -me_method hex -subq 7 -trellis 1 -refs 5 -bf 3 -flags2 +bpyramid+wpred+mixed_refs+dct8x8 -coder 1 -me_range 16 -g 250 -keyint_min 25 -sc_threshold 40 -i_qfactor 0.71 -qmin 10 -qmax 51 -qdiff 4 -pass $PASS -passlogfile $PASSLOGFILE","-b $VIDBRk -s $WIDTHx$HEIGHT -croptop $CROPTOP -cropbottom $CROPBOTTOM
323 -cropleft $CROPLEFT -cropright $CROPRIGHT -aspect $ASPECT -vcodec libx264 -level 30 -flags +loop+mv4 -cmp 256 -partitions +parti4x4+parti8x8+partp4x4+partp8x8+partb8x8 -me_method hex -subq 7 -trellis 1 -refs 5 -bf 3 -flags2 +bpyramid+wpred+mixed_refs+dct8x8 -coder 1 -me_range 16 -g 250 -keyint_min 25 -sc_threshold 40 -i_qfactor 0.71 -qmin 10 -qmax 51 -qdiff 4 -pass $PASS -passlogfile $PASSLOGFILE","ffmpeg");
324 - m_codecs[24]=_k9VideoCodec("MPEG-4 ","","-b $VIDBRk -s $WIDTHx$HEIGHT -vf crop=$CROPWIDTH:$CROPHEIGHT:$CROPLEFT:$CROPTOP -aspect $ASPECT -vcodec mpeg4 ","-b $VIDBRk -s $WIDTHx$HEIGHT -croptop $CROPTOP -cropbottom $CROPBOTTOM -cropleft $CROPLEFT -cropright $CROPRIGHT -aspect $ASPECT -vcodec mpeg4 -pass $PASS -passlogfile $PASSLOGFILE","-b $VIDBRk -s $WIDTHx$HEIGHT -croptop $CROPTOP -cropbottom $CROPBOTTOM -cropleft $CROPLEFT -cropright $CROPRIGHT -aspect $ASPECT -vcodec mpeg4 -pass $PASS -passlogfile $PASSLOGFILE","ffmpeg");
325 - m_codecs[25]=_k9VideoCodec("Flash Video","","-b $VIDBRk -s $WIDTHx$HEIGHT -vf crop=$CROPWIDTH:$CROPHEIGHT:$CROPLEFT:$CROPTOP -aspect $ASPECT -vcodec flv ","-b $VIDBRk -s $WIDTHx$HEIGHT -croptop $CROPTOP -cropbottom $CROPBOTTOM -cropleft $CROPLEFT -cropright $CROPRIGHT -aspect $ASPECT -vcodec flv -pass $PASS -passlogfile $PASSLOGFILE","-b $VIDBRk -s $WIDTHx$HEIGHT -croptop $CROPTOP -cropbottom $CROPBOTTOM -cropleft $CROPLEFT -cropright $CROPRIGHT -aspect $ASPECT -vcodec flv -pass $PASS -passlogfile $PASSLOGFILE","ffmpeg");
326 - m_codecs[26]=_k9VideoCodec("Windows Media 8","","-b $VIDBRk -s $WIDTHx$HEIGHT -vf crop=$CROPWIDTH:$CROPHEIGHT:$CROPLEFT:$CROPTOP -aspect $ASPECT -vcodec wmv2","-b $VIDBRk -s $WIDTHx$HEIGHT -croptop $CROPTOP -cropbottom $CROPBOTTOM -cropleft $CROPLEFT -cropright $CROPRIGHT -aspect $ASPECT -vcodec wmv2 -pass $PASS -passlogfile $PASSLOGFILE","-b $VIDBRk -s $WIDTHx$HEIGHT -croptop $CROPTOP -cropbottom $CROPBOTTOM -cropleft $CROPLEFT -cropright $CROPRIGHT -aspect $ASPECT -vcodec wmv2 -pass $PASS -passlogfile $PASSLOGFILE","ffmpeg");
327 + m_codecs[21]=_k9VideoCodec("copy","","-codec:v copy","-codec:v copy","-codec:v copy","ffmpeg");
328 + m_codecs[22]=_k9VideoCodec("x264","","-b $VIDBRk -s $WIDTHx$HEIGHT -vf crop=$CROPWIDTH:$CROPHEIGHT:$CROPLEFT:$CROPTOP -aspect $ASPECT -codec:v libx264 -level 30","-b $VIDBRk -s $WIDTHx$HEIGHT -vf crop=$WIDTH-$CROPRIGHT-$CROPLEFT:$HEIGHT-$CROPTOP-$CROPBOTTOM:$CROPLEFT:$CROPTOP -aspect $ASPECT -codec:v libx264 -pass $PASS -passlogfile $PASSLOGFILE -level 30","-b $VIDBRk -s $WIDTHx$HEIGHT -vf crop=$WIDTH-$CROPRIGHT-$CROPLEFT:$HEIGHT-$CROPTOP-$CROPBOTTOM:$CROPLEFT:$CROPTOP -aspect $ASPECT -codec:v libx264 -pass $PASS -passlogfile $PASSLOGFILE -level 30","ffmpeg");
329 + m_codecs[23]=_k9VideoCodec("x264 (high)","","-b $VIDBRk -s $WIDTHx$HEIGHT -vf crop=$CROPWIDTH:$CROPHEIGHT:$CROPLEFT:$CROPTOP -aspect $ASPECT -codec:v libx264 -level 30 -flags +loop+mv4 -cmp 256 -partitions +parti4x4+parti8x8+partp4x4+partp8x8+partb8x8 -me_method hex -subq 7 -trellis 1 -refs 5 -bf 3 -b-pyramid normal -weightb 1 -mixed-refs 1 -8x8dct 1 -coder 1 -me_range 16 -g 250 -keyint_min 25 -sc_threshold 40 -i_qfactor 0.71 -qmin 10 -qmax 51 -qdiff 4","-b $VIDBRk -s $WIDTHx$HEIGHT -vf crop=$WIDTH-$CROPRIGHT-$CROPLEFT:$HEIGHT-$CROPTOP-$CROPBOTTOM:$CROPLEFT:$CROPTOP -aspect $ASPECT -codec:v libx264 -level 30 -flags +loop+mv4 -cmp 256 -partitions +parti4x4+parti8x8+partp4x4+partp8x8+partb8x8 -me_method hex -subq 7 -trellis 1 -refs 5 -bf 3 -b-pyramid normal -weightb 1 -mixed-refs 1 -8x8dct 1 -coder 1 -me_range 16 -g 250 -keyint_min 25 -sc_threshold 40 -i_qfactor 0.71 -qmin 10 -qmax 51 -qdiff 4 -pass $PASS -passlogfile $PASSLOGFILE","-b $VIDBRk -s $WIDTHx$HEIGHT -vf crop=$WIDTH-$
330 CROPRIGHT-$CROPLEFT:$HEIGHT-$CROPTOP-$CROPBOTTOM:$CROPLEFT:$CROPTOP -aspect $ASPECT -codec:v libx264 -level 30 -flags +loop+mv4 -cmp 256 -partitions +parti4x4+parti8x8+partp4x4+partp8x8+partb8x8 -me_method hex -subq 7 -trellis 1 -refs 5 -bf 3 -b-pyramid normal -weightb 1 -mixed-refs 1 -8x8dct 1 -coder 1 -me_range 16 -g 250 -keyint_min 25 -sc_threshold 40 -i_qfactor 0.71 -qmin 10 -qmax 51 -qdiff 4 -pass $PASS -passlogfile $PASSLOGFILE","ffmpeg");
331 + m_codecs[24]=_k9VideoCodec("MPEG-4 ","","-b $VIDBRk -s $WIDTHx$HEIGHT -vf crop=$CROPWIDTH:$CROPHEIGHT:$CROPLEFT:$CROPTOP -aspect $ASPECT -codec:v mpeg4 ","-b $VIDBRk -s $WIDTHx$HEIGHT -vf crop=$WIDTH-$CROPRIGHT-$CROPLEFT:$HEIGHT-$CROPTOP-$CROPBOTTOM:$CROPLEFT:$CROPTOP -aspect $ASPECT -codec:v mpeg4 -pass $PASS -passlogfile $PASSLOGFILE","-b $VIDBRk -s $WIDTHx$HEIGHT -vf crop=$WIDTH-$CROPRIGHT-$CROPLEFT:$HEIGHT-$CROPTOP-$CROPBOTTOM:$CROPLEFT:$CROPTOP -aspect $ASPECT -codec:v mpeg4 -pass $PASS -passlogfile $PASSLOGFILE","ffmpeg");
332 + m_codecs[25]=_k9VideoCodec("Flash Video","","-b $VIDBRk -s $WIDTHx$HEIGHT -vf crop=$CROPWIDTH:$CROPHEIGHT:$CROPLEFT:$CROPTOP -aspect $ASPECT -codec:v flv ","-b $VIDBRk -s $WIDTHx$HEIGHT -vf crop=$WIDTH-$CROPRIGHT-$CROPLEFT:$HEIGHT-$CROPTOP-$CROPBOTTOM:$CROPLEFT:$CROPTOP -aspect $ASPECT -codec:v flv -pass $PASS -passlogfile $PASSLOGFILE","-b $VIDBRk -s $WIDTHx$HEIGHT -vf crop=$WIDTH-$CROPRIGHT-$CROPLEFT:$HEIGHT-$CROPTOP-$CROPBOTTOM:$CROPLEFT:$CROPTOP -aspect $ASPECT -codec:v flv -pass $PASS -passlogfile $PASSLOGFILE","ffmpeg");
333 + m_codecs[26]=_k9VideoCodec("Windows Media 8","","-b $VIDBRk -s $WIDTHx$HEIGHT -vf crop=$CROPWIDTH:$CROPHEIGHT:$CROPLEFT:$CROPTOP -aspect $ASPECT -codec:v wmv2","-b $VIDBRk -s $WIDTHx$HEIGHT -vf crop=$WIDTH-$CROPRIGHT-$CROPLEFT:$HEIGHT-$CROPTOP-$CROPBOTTOM:$CROPLEFT:$CROPTOP -aspect $ASPECT -codec:v wmv2 -pass $PASS -passlogfile $PASSLOGFILE","-b $VIDBRk -s $WIDTHx$HEIGHT -vf crop=$WIDTH-$CROPRIGHT-$CROPLEFT:$HEIGHT-$CROPTOP-$CROPBOTTOM:$CROPLEFT:$CROPTOP -aspect $ASPECT -codec:v wmv2 -pass $PASS -passlogfile $PASSLOGFILE","ffmpeg");
334
335 save();
336
337 diff -Nru k9copy-2.3.8-Source.orig/src/import/k9avidecode.cpp k9copy-2.3.8-Source/src/import/k9avidecode.cpp
338 --- k9copy-2.3.8-Source.orig/src/import/k9avidecode.cpp 2011-12-09 22:08:41.000000000 +0100
339 +++ k9copy-2.3.8-Source/src/import/k9avidecode.cpp 2012-11-23 10:12:56.000000000 +0100
340 @@ -37,11 +37,13 @@
341 : QObject(parent) {
342 CodecHandle=0;
343 FormatHandle=0;
344 + UtilHandle=0;
345 SwscaleHandle=0;
346 glibref=0;
347 if (glibref==0) {
348 CodecHandle=dlopen("libavcodec.so",RTLD_LAZY ); //| RTLD_GLOBAL
349 FormatHandle=dlopen("libavformat.so",RTLD_LAZY);
350 + UtilHandle=dlopen("libavutil.so",RTLD_LAZY);
351 #ifdef HAVE_SWSCALE
352 SwscaleHandle=dlopen("libswscale.so",RTLD_LAZY);
353 if (SwscaleHandle==0)
354 @@ -56,6 +58,12 @@
355 if (!FormatHandle ) {
356 errs << i18n("Cannot open the library %1").arg("libavformat");
357 }
358 +# if LIBAVUTIL_VERSION_INT >= AV_VERSION_INT(51, 33, 0)
359 + if (!UtilHandle) {
360 + m_error =i18n("Cannot open then library %1").arg("libavutil");
361 + return;
362 + }
363 +# endif
364 #ifdef HAVE_SWSCALE
365 if (!SwscaleHandle) {
366 errs << i18n("Cannot open the library %1").arg("libswscale");
367 @@ -63,17 +71,32 @@
368 #endif
369
370 av_register_all = (av_register_all_t)dlsym(FormatHandle,"av_register_all");
371 +# if LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT(53, 2, 0)
372 + avformat_open_input = (avformat_open_input_t)dlsym(FormatHandle,"avformat_open_input");
373 +# else
374 av_open_input_file = (av_open_input_file_t)dlsym(FormatHandle,"av_open_input_file");
375 +# endif
376 +# if LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT(53, 6, 0)
377 + avformat_find_stream_info = (avformat_find_stream_info_t)dlsym(FormatHandle,"avformat_find_stream_info");
378 +# else
379 av_find_stream_info = (av_find_stream_info_t)dlsym(FormatHandle,"av_find_stream_info");
380 +# endif
381 avcodec_find_decoder =(avcodec_find_decoder_t) dlsym(CodecHandle,"avcodec_find_decoder");
382 +# if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(53, 8, 0)
383 + avcodec_open2 = (avcodec_open2_t)dlsym(CodecHandle,"avcodec_open2");
384 +# else
385 avcodec_open = (avcodec_open_t)dlsym(CodecHandle,"avcodec_open");
386 +# endif
387 avcodec_alloc_frame = (avcodec_alloc_frame_t)dlsym(CodecHandle,"avcodec_alloc_frame");
388 avpicture_get_size = (avpicture_get_size_t)dlsym(CodecHandle,"avpicture_get_size");
389 av_malloc = (av_malloc_t)dlsym(CodecHandle,"av_malloc");
390 avpicture_fill = (avpicture_fill_t)dlsym(CodecHandle,"avpicture_fill");
391 av_read_frame = (av_read_frame_t)dlsym(FormatHandle,"av_read_frame");
392 +# if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(52, 23, 0)
393 + avcodec_decode_video2 = (avcodec_decode_video2_t)dlsym(CodecHandle,"avcodec_decode_video2");
394 +# else
395 avcodec_decode_video = (avcodec_decode_video_t)dlsym(CodecHandle,"avcodec_decode_video");
396 - if (avcodec_decode_video==0) avcodec_decode_video=(avcodec_decode_video_t)dlsym(CodecHandle,"avcodec_decode_video2");
397 +# endif
398 #ifndef HAVE_SWSCALE
399 img_convert = (img_convert_t)dlsym(CodecHandle,"img_convert");
400 //if img_convert is null (deprecated in ffmpeg), we need libswscale
401 @@ -85,7 +108,11 @@
402 if (av_free_packet==0)
403 av_free_packet=av_free_packet_internal;
404 avcodec_close = (avcodec_close_t)dlsym(FormatHandle,"avcodec_close");
405 +# if LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT(53, 17, 0)
406 + avformat_close_input = (avformat_close_input_t)dlsym(FormatHandle,"avformat_close_input");
407 +# else
408 av_close_input_file = (av_close_input_file_t)dlsym(FormatHandle,"av_close_input_file");
409 +# endif
410 av_seek_frame=(av_seek_frame_t)dlsym(FormatHandle,"av_seek_frame");
411 av_rescale_q=(av_rescale_q_t)dlsym(FormatHandle,"av_rescale_q");
412 avcodec_flush_buffers=(avcodec_flush_buffers_t)dlsym(CodecHandle,"avcodec_flush_buffers");
413 @@ -94,7 +121,11 @@
414 sws_getContext=(sws_getContext_t)dlsym(SwscaleHandle,"sws_getContext");
415 sws_scale= (sws_scale_t)dlsym(SwscaleHandle,"sws_scale");
416 #endif
417 +# if LIBAVUTIL_VERSION_INT >= AV_VERSION_INT(51, 33, 0)
418 + av_gettime=(av_gettime_t)dlsym(UtilHandle,"av_gettime");
419 +# else
420 av_gettime=(av_gettime_t)dlsym(FormatHandle,"av_gettime");
421 +# endif
422
423 if (errs.count() >0) {
424 m_error=errs.join("\n");
425 @@ -118,6 +149,8 @@
426 dlclose(FormatHandle);
427 if (CodecHandle)
428 dlclose(CodecHandle);
429 + if(UtilHandle)
430 + dlclose(UtilHandle);
431 #ifdef HAVE_SWSCALE
432 if (SwscaleHandle)
433 dlclose(CodecHandle);
434 @@ -134,12 +167,24 @@
435 close();
436
437 // Open video file
438 - if (av_open_input_file(&m_FormatCtx, _fileName.toUtf8(), NULL, 0, NULL)!=0) {
439 + if (
440 +# if LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT(53, 2, 0)
441 + avformat_open_input(&m_FormatCtx, _fileName.toUtf8(), 0, 0)!=0
442 +# else
443 + av_open_input_file(&m_FormatCtx, _fileName.toUtf8(), NULL, 0, NULL)!=0
444 +# endif
445 + ) {
446 m_error=i18n("Couldn't open the file %1").arg(_fileName);
447 return false; // Couldn't open file}
448 }
449 // Retrieve stream information
450 - if (av_find_stream_info(m_FormatCtx)<0) {
451 + if (
452 +# if LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT(53, 6, 0)
453 + avformat_find_stream_info(m_FormatCtx, NULL)<0
454 +# else
455 + av_find_stream_info(m_FormatCtx)<0
456 +# endif
457 + ) {
458 m_error =i18n("Couldn't find stream information");
459 return false; // Couldn't find stream information
460 }
461 @@ -168,7 +213,13 @@
462 return false; // Codec not found
463 }
464 // Open codec
465 - if (avcodec_open(m_CodecCtx, m_Codec)<0) {
466 + if (
467 +# if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(53, 8, 0)
468 + avcodec_open2(m_CodecCtx, m_Codec, NULL)<0
469 +# else
470 + avcodec_open(m_CodecCtx, m_Codec)<0
471 +# endif
472 + ) {
473 m_error =i18n("Could'nt open the codec");
474 return false; // Could not open codec
475 }
476 @@ -245,15 +296,23 @@
477 // Is this a packet from the video stream?
478 if (packet.stream_index==m_videoStream) {
479 // Decode video frame
480 +# if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(52, 23, 0)
481 + avcodec_decode_video2(m_CodecCtx, m_Frame, &frameFinished, &packet);
482 +# else
483 avcodec_decode_video(m_CodecCtx, m_Frame, &frameFinished,
484 packet.data, packet.size);
485 +# endif
486
487 // Did we get a video frame?
488 if (frameFinished) {
489 // if (m_Frame->pts >=fspos)
490 int64_t cur_dts=fspos;
491 - if (m_FormatCtx->cur_st)
492 - cur_dts= m_FormatCtx->cur_st->cur_dts;
493 +# if LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT(54, 2, 0)
494 + cur_dts= packet.dts;
495 +# else
496 + if (m_FormatCtx->cur_st)
497 + cur_dts= m_FormatCtx->cur_st->cur_dts;
498 +# endif
499 if (cur_dts >=fspos) {
500 bFound=true;
501 #ifndef HAVE_SWSCALE
502 @@ -309,7 +368,11 @@
503 avcodec_close(m_CodecCtx);
504
505 // Close the video file
506 +# if LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT(53, 17, 0)
507 + avformat_close_input(&m_FormatCtx);
508 +# else
509 av_close_input_file(m_FormatCtx);
510 +# endif
511 m_opened=false;
512 }
513 }
514 diff -Nru k9copy-2.3.8-Source.orig/src/import/k9avidecode.h k9copy-2.3.8-Source/src/import/k9avidecode.h
515 --- k9copy-2.3.8-Source.orig/src/import/k9avidecode.h 2011-12-09 22:08:41.000000000 +0100
516 +++ k9copy-2.3.8-Source/src/import/k9avidecode.h 2012-11-23 10:12:56.000000000 +0100
517 @@ -15,6 +15,7 @@
518 #include "k9common.h"
519 #include <qobject.h>
520 #include <avformat.h>
521 +#include <avutil.h>
522 #include <qimage.h>
523 #include <cstdlib>
524 #include <QObject>
525 @@ -29,10 +30,22 @@
526 //typedef dvd_file_t * (*DVDOpenFile_t) ( dvd_reader_t *, int, dvd_read_domain_t );
527 typedef void (*av_register_all_t) (void);
528 typedef int64_t (*av_gettime_t) (void);
529 +#if LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT(53, 2, 0)
530 +typedef int (*avformat_open_input_t)(AVFormatContext **, const char *, AVInputFormat *, AVDictionary **);
531 +#else
532 typedef int (*av_open_input_file_t)(AVFormatContext **, const char *,AVInputFormat *,int, AVFormatParameters *);
533 +#endif
534 +#if LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT(53, 6, 0)
535 +typedef int (*avformat_find_stream_info_t)(AVFormatContext *, AVDictionary **);
536 +#else
537 typedef int (*av_find_stream_info_t)(AVFormatContext *);
538 +#endif
539 typedef AVCodec* (*avcodec_find_decoder_t)(enum CodecID);
540 +#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(53, 8, 0)
541 +typedef int (*avcodec_open2_t)(AVCodecContext *, AVCodec *, AVDictionary **);
542 +#else
543 typedef int (*avcodec_open_t)(AVCodecContext *, AVCodec *);
544 +#endif
545 typedef AVFrame * (*avcodec_alloc_frame_t)(void);
546
547 typedef int (*avpicture_get_size_t)(int , int , int );
548 @@ -40,11 +53,19 @@
549 typedef int (*avpicture_fill_t)(AVPicture *, uint8_t *,int , int , int);
550 typedef int (*av_read_frame_t)(AVFormatContext *, AVPacket *);
551
552 +#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(52, 23, 0)
553 +typedef int (*avcodec_decode_video2_t)(AVCodecContext *, AVFrame *, int *, AVPacket *);
554 +#else
555 typedef int (*avcodec_decode_video_t)(AVCodecContext *, AVFrame *,int *, uint8_t *, int );
556 +#endif
557 typedef int (*img_convert_t)(AVPicture *, int , const AVPicture *, int ,int, int);
558 typedef void (*av_free_t)(void *);
559 typedef int (*avcodec_close_t)(AVCodecContext *);
560 +#if LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT(53, 17, 0)
561 +typedef void (*avformat_close_input_t)(AVFormatContext **);
562 +#else
563 typedef void (*av_close_input_file_t)(AVFormatContext *);
564 +#endif
565 typedef int (*av_seek_frame_t)(AVFormatContext *,int,int64_t timestamp,int flags); typedef int64_t (*av_rescale_q_t)(int64_t , AVRational , AVRational ) ;
566 typedef void (*avcodec_flush_buffers_t)(AVCodecContext *);
567 typedef void (*av_free_packet_t)(AVPacket *);
568 @@ -77,21 +98,41 @@
569
570 private:
571 av_register_all_t av_register_all;
572 +# if LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT(53, 2, 0)
573 + avformat_open_input_t avformat_open_input;
574 +# else
575 av_open_input_file_t av_open_input_file;
576 +# endif
577 +# if LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT(53, 6, 0)
578 + avformat_find_stream_info_t avformat_find_stream_info;
579 +# else
580 av_find_stream_info_t av_find_stream_info;
581 +# endif
582 avcodec_find_decoder_t avcodec_find_decoder;
583 +# if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(53, 8, 0)
584 + avcodec_open2_t avcodec_open2;
585 +# else
586 avcodec_open_t avcodec_open;
587 +# endif
588 avcodec_alloc_frame_t avcodec_alloc_frame;
589 av_seek_frame_t av_seek_frame;
590 avpicture_get_size_t avpicture_get_size;
591 av_malloc_t av_malloc;
592 avpicture_fill_t avpicture_fill;
593 av_read_frame_t av_read_frame;
594 +# if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(52, 23, 0)
595 + avcodec_decode_video2_t avcodec_decode_video2;
596 +# else
597 avcodec_decode_video_t avcodec_decode_video;
598 +# endif
599 img_convert_t img_convert;
600 av_free_t av_free;
601 avcodec_close_t avcodec_close;
602 +# if LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT(53, 17, 0)
603 + avformat_close_input_t avformat_close_input;
604 +# else
605 av_close_input_file_t av_close_input_file;
606 +# endif
607 av_rescale_q_t av_rescale_q;
608 av_gettime_t av_gettime;
609 avcodec_flush_buffers_t avcodec_flush_buffers;
610 @@ -103,6 +144,7 @@
611 #endif
612 void *CodecHandle;
613 void *FormatHandle;
614 + void *UtilHandle;
615 void *SwscaleHandle;
616 int glibref;
617
618 diff -Nru k9copy-2.3.8-Source.orig/src/vamps/k9ffmpeg.cpp k9copy-2.3.8-Source/src/vamps/k9ffmpeg.cpp
619 --- k9copy-2.3.8-Source.orig/src/vamps/k9ffmpeg.cpp 2011-12-09 22:08:41.000000000 +0100
620 +++ k9copy-2.3.8-Source/src/vamps/k9ffmpeg.cpp 2012-11-23 10:12:56.000000000 +0100
621 @@ -50,20 +50,40 @@
622 avcodec_init =(avcodec_init_t)dlsym(CodecHandle,"avcodec_init");
623 av_register_all = (av_register_all_t)dlsym(FormatHandle,"av_register_all");
624 avcodec_alloc_context=(avcodec_alloc_context_t)dlsym(CodecHandle,"avcodec_alloc_context");
625 +# if LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT(53, 2, 0)
626 + avformat_open_input = (avformat_open_input_t)dlsym(FormatHandle,"avformat_open_input");
627 +# else
628 av_open_input_file = (av_open_input_file_t)dlsym(FormatHandle,"av_open_input_file");
629 +# endif
630 +# if LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT(53, 6, 0)
631 + avformat_find_stream_info = (avformat_find_stream_info_t)dlsym(FormatHandle,"avformat_find_stream_info");
632 +# else
633 av_find_stream_info = (av_find_stream_info_t)dlsym(FormatHandle,"av_find_stream_info");
634 +# endif
635 avcodec_find_decoder =(avcodec_find_decoder_t) dlsym(CodecHandle,"avcodec_find_decoder");
636 +# if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(53, 8, 0)
637 + avcodec_open2 = (avcodec_open2_t)dlsym(CodecHandle,"avcodec_open2");
638 +# else
639 avcodec_open = (avcodec_open_t)dlsym(CodecHandle,"avcodec_open");
640 +# endif
641 avcodec_alloc_frame = (avcodec_alloc_frame_t)dlsym(CodecHandle,"avcodec_alloc_frame");
642 avpicture_get_size = (avpicture_get_size_t)dlsym(CodecHandle,"avpicture_get_size");
643 av_malloc = (av_malloc_t)dlsym(CodecHandle,"av_malloc");
644 avpicture_fill = (avpicture_fill_t)dlsym(CodecHandle,"avpicture_fill");
645 av_read_frame = (av_read_frame_t)dlsym(FormatHandle,"av_read_frame");
646 +# if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(52, 23, 0)
647 + avcodec_decode_video2 = (avcodec_decode_video2_t)dlsym(CodecHandle,"avcodec_decode_video2");
648 +# else
649 avcodec_decode_video = (avcodec_decode_video_t)dlsym(CodecHandle,"avcodec_decode_video");
650 +# endif
651 img_convert = (img_convert_t)dlsym(CodecHandle,"img_convert");
652 av_free = (av_free_t)dlsym(CodecHandle,"av_free");
653 avcodec_close = (avcodec_close_t)dlsym(FormatHandle,"avcodec_close");
654 +# if LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT(53, 17, 0)
655 + avformat_close_input = (avformat_close_input_t)dlsym(FormatHandle,"avformat_close_input");
656 +# else
657 av_close_input_file = (av_close_input_file_t)dlsym(FormatHandle,"av_close_input_file");
658 +# endif
659 av_seek_frame=(av_seek_frame_t)dlsym(FormatHandle,"av_seek_frame");
660 av_rescale_q=(av_rescale_q_t)dlsym(FormatHandle,"av_rescale_q");
661 avcodec_flush_buffers=(avcodec_flush_buffers_t)dlsym(CodecHandle,"avcodec_flush_buffers");
662 @@ -73,7 +93,11 @@
663 sws_scale= (sws_scale_t)dlsym(SwscaleHandle,"sws_scale");
664 #endif
665
666 +# if LIBAVUTIL_VERSION_INT >= AV_VERSION_INT(51, 33, 0)
667 + av_gettime=(av_gettime_t)dlsym(UtilHandle,"av_gettime");
668 +# else
669 av_gettime=(av_gettime_t)dlsym(FormatHandle,"av_gettime");
670 +# endif
671 url_fopen=(url_fopen_t)dlsym(FormatHandle,"url_fopen");
672
673 audio_resample_init=(audio_resample_init_t)dlsym(CodecHandle,"audio_resample_init");
674 @@ -110,4 +134,4 @@
675 k9FFMpeg *k9FFMpeg::instance() {
676 return &_FFMpegInstance;
677
678 -}
679 \ No newline at end of file
680 +}
681 diff -Nru k9copy-2.3.8-Source.orig/src/vamps/k9ffmpeg.h k9copy-2.3.8-Source/src/vamps/k9ffmpeg.h
682 --- k9copy-2.3.8-Source.orig/src/vamps/k9ffmpeg.h 2011-12-09 22:08:41.000000000 +0100
683 +++ k9copy-2.3.8-Source/src/vamps/k9ffmpeg.h 2012-11-23 10:13:39.000000000 +0100
684 @@ -15,6 +15,7 @@
685 #include <QString>
686 #include <avcodec.h>
687 #include <avformat.h>
688 +#include <avutil.h>
689 #include <avio.h>
690 #ifdef HAVE_SWSCALE
691 #include <swscale.h>
692 @@ -28,10 +29,22 @@
693 typedef void (*av_register_all_t) (void);
694 typedef void (*avcodec_init_t)(void);
695 typedef int64_t (*av_gettime_t) (void);
696 +#if LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT(53, 2, 0)
697 +typedef int (*avformat_open_input_t)(AVFormatContext **, const char *, AVInputFormat *, AVDictionary **);
698 +#else
699 typedef int (*av_open_input_file_t)(AVFormatContext **, const char *,AVInputFormat *,int, AVFormatParameters *);
700 +#endif
701 +#if LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT(53, 6, 0)
702 +typedef int (*avformat_find_stream_info_t)(AVFormatContext *, AVDictionary **);
703 +#else
704 typedef int (*av_find_stream_info_t)(AVFormatContext *);
705 +#endif
706 typedef AVCodec* (*avcodec_find_decoder_t)(enum CodecID);
707 +#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(53, 8, 0)
708 +typedef int (*avcodec_open2_t)(AVCodecContext *, AVCodec *, AVDictionary **);
709 +#else
710 typedef int (*avcodec_open_t)(AVCodecContext *, AVCodec *);
711 +#endif
712 typedef AVFrame * (*avcodec_alloc_frame_t)(void);
713 typedef AVCodecContext * (*avcodec_alloc_context_t)(void);
714
715 @@ -40,13 +53,21 @@
716 typedef int (*avpicture_fill_t)(AVPicture *, uint8_t *,int , int , int);
717 typedef int (*av_read_frame_t)(AVFormatContext *, AVPacket *);
718
719 +#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(52, 23, 0)
720 +typedef int (*avcodec_decode_video2_t)(AVCodecContext *, AVFrame *, int *, AVPacket *);
721 +#else
722 typedef int (*avcodec_decode_video_t)(AVCodecContext *, AVFrame *,int *, uint8_t *, int );
723 +#endif
724 typedef int (*avcodec_encode_audio_t)(AVCodecContext *avctx, uint8_t *buf, int buf_size, const short *samples);
725
726 typedef int (*img_convert_t)(AVPicture *, int , const AVPicture *, int ,int, int);
727 typedef void (*av_free_t)(void *);
728 typedef int (*avcodec_close_t)(AVCodecContext *);
729 +#if LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT(53, 17, 0)
730 +typedef void (*avformat_close_input_t)(AVFormatContext **);
731 +#else
732 typedef void (*av_close_input_file_t)(AVFormatContext *);
733 +#endif
734 typedef int (*av_seek_frame_t)(AVFormatContext *,int,int64_t timestamp,int flags);
735 typedef int64_t (*av_rescale_q_t)(int64_t , AVRational , AVRational ) ;
736 typedef void (*avcodec_flush_buffers_t)(AVCodecContext *);
737 @@ -89,21 +110,41 @@
738 avcodec_init_t avcodec_init;
739 avcodec_alloc_context_t avcodec_alloc_context;
740 av_register_all_t av_register_all;
741 +# if LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT(53, 2, 0)
742 + avformat_open_input_t avformat_open_input;
743 +# else
744 av_open_input_file_t av_open_input_file;
745 +# endif
746 +# if LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT(53, 6, 0)
747 + avformat_find_stream_info_t avformat_find_stream_info;
748 +# else
749 av_find_stream_info_t av_find_stream_info;
750 +# endif
751 avcodec_find_decoder_t avcodec_find_decoder;
752 +# if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(53, 8, 0)
753 + avcodec_open2_t avcodec_open2;
754 +# else
755 avcodec_open_t avcodec_open;
756 +# endif
757 avcodec_alloc_frame_t avcodec_alloc_frame;
758 av_seek_frame_t av_seek_frame;
759 avpicture_get_size_t avpicture_get_size;
760 av_malloc_t av_malloc;
761 avpicture_fill_t avpicture_fill;
762 av_read_frame_t av_read_frame;
763 +# if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(52, 23, 0)
764 + avcodec_decode_video2_t avcodec_decode_video2;
765 +# else
766 avcodec_decode_video_t avcodec_decode_video;
767 +# endif
768 img_convert_t img_convert;
769 av_free_t av_free;
770 avcodec_close_t avcodec_close;
771 +# if LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT(53, 17, 0)
772 + avformat_close_input_t avformat_close_input;
773 +# else
774 av_close_input_file_t av_close_input_file;
775 +# endif
776 av_rescale_q_t av_rescale_q;
777 av_gettime_t av_gettime;
778 avcodec_flush_buffers_t avcodec_flush_buffers;