On 2013-09-04 00:46:32, Sebastian Ramacher wrote:
> Control: tags -1 + patch
> 
> On 2013-08-17 07:38:03, Daniel Schepler wrote:
> >  10%] Building CXX object 
> > modules/highgui/CMakeFiles/opencv_highgui.dir/src/cap_ffmpeg.o              
> >                                                          
> > cd /tmp/buildd/opencv-2.3.1/obj-x86_64-linux-gnu/modules/highgui && 
> > /usr/bin/c++   -DCVAPI_EXPORTS -DHAVE_CVCONFIG_H -DHAVE_JASPER -DHAVE_JPEG 
> > -DHAVE_OPENEXR -DHAVE_PNG -DHAVE_TIFF -DHIGHGUI_EXPORTS 
> > -Dopencv_highgui_EXPORTS -Wall -Wno-long-long -pthread -ffunction-sections  
> > -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat 
> > -Werror=format-security  -fomit-frame-pointer -ffast-math -msse -msse2 
> > -DNDEBUG  -fPIC -I/usr/lib/pymodules/python2.7/numpy/core/include 
> > -I/tmp/buildd/opencv-2.3.1/. 
> > -I/tmp/buildd/opencv-2.3.1/obj-x86_64-linux-gnu 
> > -I/tmp/buildd/opencv-2.3.1/include 
> > -I/tmp/buildd/opencv-2.3.1/include/opencv -I/usr/include/OpenEXR 
> > -I/usr/include/gtk-2.0 -I/usr/lib/x86_64-linux-gnu/gtk-2.0/include 
> > -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 
> > -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0 
> > -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include 
> > -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 
> > -I/usr/include/libdrm -I/usr/include/harfbuzz 
> > -I/tmp/buildd/opencv-2.3.1/modules/highgui/include 
> > -I/tmp/buildd/opencv-2.3.1/modules/highgui/../core/include 
> > -I/tmp/buildd/opencv-2.3.1/modules/highgui/../imgproc/include 
> > -I/tmp/buildd/opencv-2.3.1/modules/highgui/src 
> > -I/tmp/buildd/opencv-2.3.1/obj-x86_64-linux-gnu/modules/highgui    -D 
> > PYTHON_USE_NUMPY=1 -o CMakeFiles/opencv_highgui.dir/src/cap_ffmpeg.o -c 
> > /tmp/buildd/opencv-2.3.1/modules/highgui/src/cap_ffmpeg.cpp
> > In file included from 
> > /tmp/buildd/opencv-2.3.1/modules/highgui/src/cap_ffmpeg.cpp:45:0:
> > /tmp/buildd/opencv-2.3.1/modules/highgui/src/cap_ffmpeg_impl.hpp: In member 
> > function 'void CvCapture_FFMPEG::close()':
> > /tmp/buildd/opencv-2.3.1/modules/highgui/src/cap_ffmpeg_impl.hpp:458:9: 
> > warning: 'void av_close_input_file(AVFormatContext*)' is deprecated 
> > (declared at /usr/include/libavformat/avformat.h:1397) 
> > [-Wdeprecated-declarations]
> >          av_close_input_file(ic);
> >          ^
> > /tmp/buildd/opencv-2.3.1/modules/highgui/src/cap_ffmpeg_impl.hpp:458:31: 
> > warning: 'void av_close_input_file(AVFormatContext*)' is deprecated 
> > (declared at /usr/include/libavformat/avformat.h:1397) 
> > [-Wdeprecated-declarations]
> >          av_close_input_file(ic);
> >                                ^
> > /tmp/buildd/opencv-2.3.1/modules/highgui/src/cap_ffmpeg_impl.hpp: In member 
> > function 'bool CvCapture_FFMPEG::reopen()':
> > /tmp/buildd/opencv-2.3.1/modules/highgui/src/cap_ffmpeg_impl.hpp:489:5: 
> > warning: 'void av_close_input_file(AVFormatContext*)' is deprecated 
> > (declared at /usr/include/libavformat/avformat.h:1397) 
> > [-Wdeprecated-declarations]
> >      av_close_input_file(ic);
> >      ^
> > /tmp/buildd/opencv-2.3.1/modules/highgui/src/cap_ffmpeg_impl.hpp:489:27: 
> > warning: 'void av_close_input_file(AVFormatContext*)' is deprecated 
> > (declared at /usr/include/libavformat/avformat.h:1397) 
> > [-Wdeprecated-declarations]
> >      av_close_input_file(ic);
> >                            ^
> > /tmp/buildd/opencv-2.3.1/modules/highgui/src/cap_ffmpeg_impl.hpp:492:52: 
> > error: 'av_open_input_file' was not declared in this scope
> >      av_open_input_file(&ic, filename, NULL, 0, NULL);
> >                                                     ^
> > /tmp/buildd/opencv-2.3.1/modules/highgui/src/cap_ffmpeg_impl.hpp:493:27: 
> > error: 'av_find_stream_info' was not declared in this scope
> >      av_find_stream_info(ic);
> >                            ^
> > /tmp/buildd/opencv-2.3.1/modules/highgui/src/cap_ffmpeg_impl.hpp:500:50: 
> > error: 'avcodec_thread_init' was not declared in this scope
> >      avcodec_thread_init(enc, get_number_of_cpus());
> >                                                   ^
> > /tmp/buildd/opencv-2.3.1/modules/highgui/src/cap_ffmpeg_impl.hpp:503:28: 
> > error: 'avcodec_open' was not declared in this scope
> >      avcodec_open(enc, codec);
> >                             ^
> > /tmp/buildd/opencv-2.3.1/modules/highgui/src/cap_ffmpeg_impl.hpp: In member 
> > function 'bool CvCapture_FFMPEG::open(const char*)':
> > /tmp/buildd/opencv-2.3.1/modules/highgui/src/cap_ffmpeg_impl.hpp:530:63: 
> > error: 'av_open_input_file' was not declared in this scope
> >      int err = av_open_input_file(&ic, _filename, NULL, 0, NULL);
> >                                                                ^
> > /tmp/buildd/opencv-2.3.1/modules/highgui/src/cap_ffmpeg_impl.hpp:535:33: 
> > error: 'av_find_stream_info' was not declared in this scope
> >      err = av_find_stream_info(ic);
> >                                  ^
> > /tmp/buildd/opencv-2.3.1/modules/highgui/src/cap_ffmpeg_impl.hpp:547:54: 
> > error: 'avcodec_thread_init' was not declared in this scope
> >          avcodec_thread_init(enc, get_number_of_cpus());
> >                                                       ^
> > /tmp/buildd/opencv-2.3.1/modules/highgui/src/cap_ffmpeg_impl.hpp:552:36: 
> > error: 'avcodec_open' was not declared in this scope
> >              avcodec_open(enc, codec) < 0)
> >                                     ^
> > /tmp/buildd/opencv-2.3.1/modules/highgui/src/cap_ffmpeg_impl.hpp: In 
> > function 'AVStream* icv_add_video_stream_FFMPEG(AVFormatContext*, 
> > AVCodecID, int, int, int, double, int)':
> > /tmp/buildd/opencv-2.3.1/modules/highgui/src/cap_ffmpeg_impl.hpp:1032:26: 
> > error: 'av_new_stream' was not declared in this scope
> >   st = av_new_stream(oc, 0);
> >                           ^
> > In file included from 
> > /tmp/buildd/opencv-2.3.1/modules/highgui/src/cap_ffmpeg.cpp:45:0:
> > /tmp/buildd/opencv-2.3.1/modules/highgui/src/cap_ffmpeg_impl.hpp: In 
> > function 'int icv_av_write_frame_FFMPEG(AVFormatContext*, AVStream*, 
> > uint8_t*, uint32_t, AVFrame*)':
> > /tmp/buildd/opencv-2.3.1/modules/highgui/src/cap_ffmpeg_impl.hpp:1150:20: 
> > warning: 'int avcodec_encode_video(AVCodecContext*, uint8_t*, int, const 
> > AVFrame*)' is deprecated (declared at 
> > /usr/include/libavcodec/avcodec.h:4030) [-Wdeprecated-declarations]
> >          out_size = avcodec_encode_video(c, outbuf, outbuf_size, picture);
> >                     ^
> > /tmp/buildd/opencv-2.3.1/modules/highgui/src/cap_ffmpeg_impl.hpp:1150:72: 
> > warning: 'int avcodec_encode_video(AVCodecContext*, uint8_t*, int, const 
> > AVFrame*)' is deprecated (declared at 
> > /usr/include/libavcodec/avcodec.h:4030) [-Wdeprecated-declarations]
> >          out_size = avcodec_encode_video(c, outbuf, outbuf_size, picture);
> >                                                                         ^
> > /tmp/buildd/opencv-2.3.1/modules/highgui/src/cap_ffmpeg_impl.hpp: In member 
> > function 'void CvVideoWriter_FFMPEG::close()':
> > /tmp/buildd/opencv-2.3.1/modules/highgui/src/cap_ffmpeg_impl.hpp:1327:20: 
> > error: 'url_fclose' was not declared in this scope
> >    url_fclose(oc->pb);
> >                     ^
> > /tmp/buildd/opencv-2.3.1/modules/highgui/src/cap_ffmpeg_impl.hpp: In member 
> > function 'bool CvVideoWriter_FFMPEG::open(const char*, int, double, int, 
> > int, bool)':
> > /tmp/buildd/opencv-2.3.1/modules/highgui/src/cap_ffmpeg_impl.hpp:1440:35: 
> > error: 'av_set_parameters' was not declared in this scope
> >      if (av_set_parameters(oc, NULL) < 0) {
> >                                    ^
> > /tmp/buildd/opencv-2.3.1/modules/highgui/src/cap_ffmpeg_impl.hpp:1444:35: 
> > error: 'dump_format' was not declared in this scope
> >      dump_format(oc, 0, filename, 1);
> >                                    ^
> > /tmp/buildd/opencv-2.3.1/modules/highgui/src/cap_ffmpeg_impl.hpp:1471:36: 
> > error: 'avcodec_open' was not declared in this scope
> >      if ( (err=avcodec_open(c, codec)) < 0) {
> >                                     ^
> > /tmp/buildd/opencv-2.3.1/modules/highgui/src/cap_ffmpeg_impl.hpp:1508:42: 
> > error: 'URL_WRONLY' was not declared in this scope
> >          if (url_fopen(&oc->pb, filename, URL_WRONLY) < 0) {
> >                                           ^
> > /tmp/buildd/opencv-2.3.1/modules/highgui/src/cap_ffmpeg_impl.hpp:1508:52: 
> > error: 'url_fopen' was not declared in this scope
> >          if (url_fopen(&oc->pb, filename, URL_WRONLY) < 0) {
> >                                                     ^
> > /tmp/buildd/opencv-2.3.1/modules/highgui/src/cap_ffmpeg_impl.hpp:1514:25: 
> > error: 'av_write_header' was not declared in this scope
> >      av_write_header( oc );
> >                          ^
> > make[3]: *** 
> > [modules/highgui/CMakeFiles/opencv_highgui.dir/src/cap_ffmpeg.o] Error 1
> 
> The attached patch backports the fixes for libav 9 from opencv 2.4.6.

Now with the patch really attached.

Regards
-- 
Sebastian Ramacher
diff -Nru opencv-2.3.1/debian/changelog opencv-2.3.1/debian/changelog
--- opencv-2.3.1/debian/changelog	2013-07-14 00:36:55.000000000 +0200
+++ opencv-2.3.1/debian/changelog	2013-09-04 00:40:42.000000000 +0200
@@ -1,3 +1,11 @@
+opencv (2.3.1-12.1) UNRELEASED; urgency=low
+
+  * Non-maintainer upload.
+  * debian/patches/libav9: Backport libav 9 fixes from 2.4.6. (Closes:
+    #719998)
+
+ -- Sebastian Ramacher <sramac...@debian.org>  Tue, 03 Sep 2013 23:42:18 +0200
+
 opencv (2.3.1-12) unstable; urgency=low
 
   * Fix FTBFS on sparc64. (Closes: #714923)
diff -Nru opencv-2.3.1/debian/patches/libav9 opencv-2.3.1/debian/patches/libav9
--- opencv-2.3.1/debian/patches/libav9	1970-01-01 01:00:00.000000000 +0100
+++ opencv-2.3.1/debian/patches/libav9	2013-09-04 00:40:07.000000000 +0200
@@ -0,0 +1,192 @@
+Description: Backport fixes for libav 9 from opencv 2.4.6
+Origin: backport
+Bug-Debian: http://bugs.debian.org/719998
+Last-Update: 2013-09-04
+
+--- a/modules/highgui/src/cap_ffmpeg_impl.hpp
++++ b/modules/highgui/src/cap_ffmpeg_impl.hpp
+@@ -455,7 +455,11 @@
+ 
+     if( ic )
+     {
++#if LIBAVFORMAT_BUILD < CALC_FFMPEG_VERSION(53, 24, 2)
+         av_close_input_file(ic);
++#else
++        avformat_close_input(&ic);
++#endif
+         ic = NULL;
+     }
+ 
+@@ -486,21 +490,41 @@
+ #else
+     avcodec_close( &video_st->codec );
+ #endif
++#if LIBAVFORMAT_BUILD < CALC_FFMPEG_VERSION(53, 24, 2)
+     av_close_input_file(ic);
++#else
++    avformat_close_input(&ic);
++#endif
+ 
+     // reopen video
++#if LIBAVFORMAT_BUILD < CALC_FFMPEG_VERSION(52, 111, 0)
+     av_open_input_file(&ic, filename, NULL, 0, NULL);
++#else
++    avformat_open_input(&ic, filename, NULL, NULL);
++#endif
++#if LIBAVFORMAT_BUILD >= CALC_FFMPEG_VERSION(53, 3, 0)
++    avformat_find_stream_info(ic, NULL);
++#else
+     av_find_stream_info(ic);
++#endif
+ #if LIBAVFORMAT_BUILD > 4628
+     AVCodecContext *enc = ic->streams[video_stream]->codec;
+ #else
+     AVCodecContext *enc = &ic->streams[video_stream]->codec;
+ #endif
+ 
++#ifdef FF_API_THREAD_INIT
+     avcodec_thread_init(enc, get_number_of_cpus());
++#else
++    enc->thread_count = get_number_of_cpus();
++#endif
+ 
+     AVCodec *codec = avcodec_find_decoder(enc->codec_id);
++#if LIBAVCODEC_VERSION_INT < CALC_FFMPEG_VERSION(53, 8, 0)
+     avcodec_open(enc, codec);
++#else
++    avcodec_open2(enc, codec, NULL);
++#endif
+     video_st = ic->streams[video_stream];
+ 
+     // reset framenumber to zero
+@@ -527,12 +551,20 @@
+     // av_log_level = AV_LOG_QUIET;
+ #endif
+ 
+-    int err = av_open_input_file(&ic, _filename, NULL, 0, NULL);
++#if LIBAVFORMAT_BUILD < CALC_FFMPEG_VERSION(52, 111, 0)
++    int err = av_open_input_file(&ic, filename, NULL, 0, NULL);
++#else
++    int err = avformat_open_input(&ic, _filename, NULL, NULL);
++#endif
+     if (err < 0) {
+ 	    CV_WARN("Error opening file");
+ 	    goto exit_func;
+     }
++#if LIBAVFORMAT_BUILD >= CALC_FFMPEG_VERSION(53, 3, 0)
++    err = avformat_find_stream_info(ic, NULL);
++#else
+     err = av_find_stream_info(ic);
++#endif
+     if (err < 0) {
+ 	    CV_WARN("Could not find codec parameters");
+ 	    goto exit_func;
+@@ -544,12 +576,21 @@
+         AVCodecContext *enc = &ic->streams[i]->codec;
+ #endif
+ 
++#ifdef FF_API_THREAD_INIT
+         avcodec_thread_init(enc, get_number_of_cpus());
++#else
++        enc->thread_count = get_number_of_cpus();
++#endif
+ 
+         if( AVMEDIA_TYPE_VIDEO == enc->codec_type && video_stream < 0) {
+             AVCodec *codec = avcodec_find_decoder(enc->codec_id);
+             if (!codec ||
+-            avcodec_open(enc, codec) < 0)
++#if LIBAVCODEC_VERSION_INT >= CALC_FFMPEG_VERSION(53, 8, 0)
++                avcodec_open2(enc, codec, NULL)
++#else
++                avcodec_open(enc, codec)
++#endif
++                < 0)
+             goto exit_func;
+             video_stream = i;
+             video_st = ic->streams[i];
+@@ -1028,8 +1069,11 @@
+ 	int frame_rate, frame_rate_base;
+ 	AVCodec *codec;
+ 
+-
++#if LIBAVFORMAT_BUILD >= CALC_FFMPEG_VERSION(53, 10, 0)
++	st = avformat_new_stream(oc, 0);
++#else
+ 	st = av_new_stream(oc, 0);
++#endif
+ 	if (!st) {
+ 		CV_WARN("Could not allocate stream");
+ 		return NULL;
+@@ -1323,11 +1367,15 @@
+ 		/* close the output file */
+ 
+ 
++#if LIBAVCODEC_VERSION_INT < CALC_FFMPEG_VERSION(52, 123, 0)
+ #if LIBAVCODEC_VERSION_INT >= ((51<<16)+(49<<8)+0)
+ 		url_fclose(oc->pb);
+ #else
+ 		url_fclose(&oc->pb);
+ #endif
++#else
++    avio_close(oc->pb);
++#endif
+ 
+ 	}
+ 
+@@ -1437,11 +1485,17 @@
+ 
+ 	/* set the output parameters (must be done even if no
+        parameters). */
++#if LIBAVFORMAT_BUILD < CALC_FFMPEG_VERSION(53, 2, 0)
+     if (av_set_parameters(oc, NULL) < 0) {
+         return false;
+     }
++#endif
+ 
++#if FF_API_DUMP_FORMAT
+     dump_format(oc, 0, filename, 1);
++#else
++    av_dump_format(oc, 0, filename, 1);
++#endif
+ 
+     /* now that all the parameters are set, we can open the audio and
+        video codecs and allocate the necessary encode buffers */
+@@ -1468,7 +1522,13 @@
+ 	c->bit_rate_tolerance = c->bit_rate;
+ 
+     /* open the codec */
+-    if ( (err=avcodec_open(c, codec)) < 0) {
++    if ( (err=
++#if LIBAVCODEC_VERSION_INT >= CALC_FFMPEG_VERSION(53, 8, 0)
++          avcodec_open2(c, codec, NULL)
++#else
++          avcodec_open(c, codec)
++#endif
++          ) < 0) {
+ 		char errtext[256];
+ 		sprintf(errtext, "Could not open codec '%s': %s", codec->name, icvFFMPEGErrStr(err));
+ 		return false;
+@@ -1505,13 +1565,22 @@
+ 
+ 	/* open the output file, if needed */
+     if (!(fmt->flags & AVFMT_NOFILE)) {
+-        if (url_fopen(&oc->pb, filename, URL_WRONLY) < 0) {
++#if LIBAVFORMAT_BUILD < CALC_FFMPEG_VERSION(53, 2, 0)
++        if (url_fopen(&oc->pb, filename, URL_WRONLY) < 0)
++#else
++        if (avio_open(&oc->pb, filename, AVIO_FLAG_WRITE) < 0)
++#endif
++        {
+             return false;
+         }
+     }
+ 
+     /* write the stream header, if any */
++#if LIBAVFORMAT_BUILD >= CALC_FFMPEG_VERSION(52, 111, 0)
++    avformat_write_header(oc, NULL);
++#else
+     av_write_header( oc );
++#endif
+ 
+ 	return true;
+ }
diff -Nru opencv-2.3.1/debian/patches/series opencv-2.3.1/debian/patches/series
--- opencv-2.3.1/debian/patches/series	2013-07-14 00:35:48.000000000 +0200
+++ opencv-2.3.1/debian/patches/series	2013-09-04 00:03:13.000000000 +0200
@@ -5,3 +5,4 @@
 0013_drop_asm_types_h_kfreebsd.patch
 0014_fix_ftbfs_libav0.8.patch
 change_type_from_int_to_Atomic_word
+libav9

Attachment: signature.asc
Description: Digital signature

Reply via email to