[opencv] 04/10: Remove disabled patches
Mattia Rizzolo
mattia at debian.org
Mon Apr 3 20:46:13 UTC 2017
This is an automated email from the git hooks/post-receive script.
mattia pushed a commit to branch master
in repository opencv.
commit b3c7f50b86415597f724d4e0b3f31c9dfb7ba086
Author: Mattia Rizzolo <mattia at debian.org>
Date: Mon Apr 3 21:51:20 2017 +0200
Remove disabled patches
Signed-off-by: Mattia Rizzolo <mattia at debian.org>
---
debian/patches/build-static-libs | 28 -
debian/patches/change_type_from_int_to_Atomic_word | 191 ------
debian/patches/drop_asm_types_h_kfreebsd | 25 -
debian/patches/ffmpeg_2.9.patch | 226 -------
debian/patches/fix_path_of_opencl_headers | 20 -
debian/patches/libav10.patch | 751 ---------------------
debian/patches/optimize_i586.patch | 22 -
debian/patches/pkg-config | 50 --
debian/patches/revert-Make-ts-always-static | 51 --
debian/patches/series | 9 -
10 files changed, 1373 deletions(-)
diff --git a/debian/patches/build-static-libs b/debian/patches/build-static-libs
deleted file mode 100644
index 74514ab..0000000
--- a/debian/patches/build-static-libs
+++ /dev/null
@@ -1,28 +0,0 @@
-Description: Support build static libraries
-Author: Nobuhiro Iwamatsu <iwamatsu at debian.org>
-Forwarded: no
-Last-Update: <2015-04-27>
-
-diff --git a/cmake/OpenCVModule.cmake b/cmake/OpenCVModule.cmake
-index a1a1b90..059fed3 100644
---- a/cmake/OpenCVModule.cmake
-+++ b/cmake/OpenCVModule.cmake
-@@ -133,6 +133,7 @@ macro(ocv_add_module _name)
- ocv_debug_message("ocv_add_module(" ${_name} ${ARGN} ")")
- string(TOLOWER "${_name}" name)
- set(the_module opencv_${name})
-+ set(the_module_s opencv_${name}_s)
-
- # the first pass - collect modules info, the second pass - create targets
- if(OPENCV_INITIAL_PASS)
-@@ -720,6 +721,10 @@ macro(_ocv_create_module)
- "${OPENCV_CONFIG_FILE_INCLUDE_DIR}/cvconfig.h" "${OPENCV_CONFIG_FILE_INCLUDE_DIR}/opencv2/opencv_modules.hpp"
- ${${the_module}_pch} ${sub_objs})
-
-+ add_library(${the_module_s} STATIC ${OPENCV_MODULE_${the_module}_HEADERS} ${OPENCV_MODULE_${the_module}_SOURCES}
-+ "${OPENCV_CONFIG_FILE_INCLUDE_DIR}/cvconfig.h" "${OPENCV_CONFIG_FILE_INCLUDE_DIR}/opencv2/opencv_modules.hpp"
-+ ${${the_module}_pch} ${sub_objs})
-+
- if (cuda_objs)
- target_link_libraries(${the_module} ${cuda_objs})
- endif()
diff --git a/debian/patches/change_type_from_int_to_Atomic_word b/debian/patches/change_type_from_int_to_Atomic_word
deleted file mode 100644
index 8775d84..0000000
--- a/debian/patches/change_type_from_int_to_Atomic_word
+++ /dev/null
@@ -1,191 +0,0 @@
-Description: Fix FTBFS on sparc64
-Author: Aurelien Jarno <aurel32 at debian.org>, David Mattli <dmm at mattli.us>
-Forwarded: not yet
-Debian-Bug: 714923
-Last-Update: <2016-02-08>
-
---- opencv-2.4.9.1+dfsg.orig/modules/core/include/opencv2/core/core.hpp
-+++ opencv-2.4.9.1+dfsg/modules/core/include/opencv2/core/core.hpp
-@@ -1300,7 +1300,7 @@ public:
- operator const _Tp*() const;
-
- _Tp* obj; //< the object pointer.
-- int* refcount; //< the associated reference counter
-+ _Atomic_word* refcount; //< the associated reference counter
- };
-
-
-@@ -1468,9 +1468,9 @@ class CV_EXPORTS MatAllocator
- public:
- MatAllocator() {}
- virtual ~MatAllocator() {}
-- virtual void allocate(int dims, const int* sizes, int type, int*& refcount,
-+ virtual void allocate(int dims, const int* sizes, int type, _Atomic_word*& refcount,
- uchar*& datastart, uchar*& data, size_t* step) = 0;
-- virtual void deallocate(int* refcount, uchar* datastart, uchar* data) = 0;
-+ virtual void deallocate(_Atomic_word* refcount, uchar* datastart, uchar* data) = 0;
- };
-
- /*!
-@@ -1965,7 +1965,7 @@ public:
-
- //! pointer to the reference counter;
- // when matrix points to user-allocated data, the pointer is NULL
-- int* refcount;
-+ _Atomic_word* refcount;
-
- //! helper fields used in locateROI and adjustROI
- uchar* datastart;
-@@ -3384,7 +3384,7 @@ public:
- {
- Hdr(int _dims, const int* _sizes, int _type);
- void clear();
-- int refcount;
-+ _Atomic_word refcount;
- int dims;
- int valueOffset;
- size_t nodeSize;
---- opencv-2.4.9.1+dfsg.orig/modules/core/include/opencv2/core/gpumat.hpp
-+++ opencv-2.4.9.1+dfsg/modules/core/include/opencv2/core/gpumat.hpp
-@@ -301,7 +301,7 @@ namespace cv { namespace gpu
-
- //! pointer to the reference counter;
- // when GpuMatrix points to user-allocated data, the pointer is NULL
-- int* refcount;
-+ _Atomic_word* refcount;
-
- //! helper fields used in locateROI and adjustROI
- uchar* datastart;
---- opencv-2.4.9.1+dfsg.orig/modules/core/include/opencv2/core/operations.hpp
-+++ opencv-2.4.9.1+dfsg/modules/core/include/opencv2/core/operations.hpp
-@@ -2281,7 +2281,7 @@ public:
- Hdr() : data(0), datastart(0), refcount(0), size(0), capacity(0) {};
- _Tp* data;
- _Tp* datastart;
-- int* refcount;
-+ _Atomic_word* refcount;
- size_t size;
- size_t capacity;
- };
-@@ -2588,7 +2588,7 @@ template<typename _Tp> inline Ptr<_Tp>::
- {
- if(obj)
- {
-- refcount = (int*)fastMalloc(sizeof(*refcount));
-+ refcount = (_Atomic_word*)fastMalloc(sizeof(*refcount));
- *refcount = 1;
- }
- else
-@@ -2625,7 +2625,7 @@ template<typename _Tp> inline Ptr<_Tp>::
-
- template<typename _Tp> inline Ptr<_Tp>& Ptr<_Tp>::operator = (const Ptr<_Tp>& _ptr)
- {
-- int* _refcount = _ptr.refcount;
-+ _Atomic_word* _refcount = _ptr.refcount;
- if( _refcount )
- CV_XADD(_refcount, 1);
- release();
---- opencv-2.4.9.1+dfsg.orig/modules/core/src/gpumat.cpp
-+++ opencv-2.4.9.1+dfsg/modules/core/src/gpumat.cpp
-@@ -716,7 +716,7 @@ void cv::gpu::GpuMat::create(int _rows,
- datastart = data = static_cast<uchar*>(devPtr);
- dataend = data + nettosize;
-
-- refcount = static_cast<int*>(fastMalloc(sizeof(*refcount)));
-+ refcount = static_cast<_Atomic_word*>(fastMalloc(sizeof(*refcount)));
- *refcount = 1;
- }
- }
---- opencv-2.4.9.1+dfsg.orig/modules/core/src/matrix.cpp
-+++ opencv-2.4.9.1+dfsg/modules/core/src/matrix.cpp
-@@ -213,7 +213,7 @@ void Mat::create(int d, const int* _size
- {
- size_t totalsize = alignSize(step.p[0]*size.p[0], (int)sizeof(*refcount));
- data = datastart = (uchar*)fastMalloc(totalsize + (int)sizeof(*refcount));
-- refcount = (int*)(data + totalsize);
-+ refcount = (_Atomic_word*)(data + totalsize);
- *refcount = 1;
- }
- else
---- opencv-2.4.9.1+dfsg.orig/modules/core/src/system.cpp
-+++ opencv-2.4.9.1+dfsg/modules/core/src/system.cpp
-@@ -903,7 +903,7 @@ struct Mutex::Impl
- void unlock() { pthread_spin_unlock(&sl); }
-
- pthread_spinlock_t sl;
-- int refcount;
-+ _Atomic_word refcount;
- };
-
- #else
---- opencv-2.4.9.1+dfsg.orig/modules/gpu/include/opencv2/gpu/gpu.hpp
-+++ opencv-2.4.9.1+dfsg/modules/gpu/include/opencv2/gpu/gpu.hpp
-@@ -125,7 +125,7 @@ public:
- size_t step;
-
- uchar* data;
-- int* refcount;
-+ _Atomic_word* refcount;
-
- uchar* datastart;
- uchar* dataend;
---- opencv-2.4.9.1+dfsg.orig/modules/ocl/include/opencv2/ocl/ocl.hpp
-+++ opencv-2.4.9.1+dfsg/modules/ocl/include/opencv2/ocl/ocl.hpp
-@@ -404,7 +404,7 @@ namespace cv
-
- //! pointer to the reference counter;
- // when oclMatrix points to user-allocated data, the pointer is NULL
-- int *refcount;
-+ _Atomic_word *refcount;
-
- //! helper fields used in locateROI and adjustROI
- //datastart and dataend are not used in current version
---- opencv-2.4.9.1+dfsg.orig/modules/ocl/src/matrix_operations.cpp
-+++ opencv-2.4.9.1+dfsg/modules/ocl/src/matrix_operations.cpp
-@@ -591,7 +591,7 @@ void cv::ocl::oclMat::createEx(int _rows
- datastart = data = (uchar *)dev_ptr;
- dataend = data + nettosize;
-
-- refcount = (int *)fastMalloc(sizeof(*refcount));
-+ refcount = (_Atomic_word *)fastMalloc(sizeof(*refcount));
- *refcount = 1;
- }
- }
---- opencv-2.4.9.1+dfsg.orig/modules/python/src2/cv2.cpp
-+++ opencv-2.4.9.1+dfsg/modules/python/src2/cv2.cpp
-@@ -157,14 +157,14 @@ static PyObject* failmsgp(const char *fm
- static size_t REFCOUNT_OFFSET = (size_t)&(((PyObject*)0)->ob_refcnt) +
- (0x12345678 != *(const size_t*)"\x78\x56\x34\x12\0\0\0\0\0")*sizeof(int);
-
--static inline PyObject* pyObjectFromRefcount(const int* refcount)
-+static inline PyObject* pyObjectFromRefcount(const _Atomic_word* refcount)
- {
- return (PyObject*)((size_t)refcount - REFCOUNT_OFFSET);
- }
-
--static inline int* refcountFromPyObject(const PyObject* obj)
-+static inline _Atomic_word* refcountFromPyObject(const PyObject* obj)
- {
-- return (int*)((size_t)obj + REFCOUNT_OFFSET);
-+ return (_Atomic_word*)((size_t)obj + REFCOUNT_OFFSET);
- }
-
- class NumpyAllocator : public MatAllocator
-@@ -173,7 +173,7 @@ public:
- NumpyAllocator() {}
- ~NumpyAllocator() {}
-
-- void allocate(int dims, const int* sizes, int type, int*& refcount,
-+ void allocate(int dims, const int* sizes, int type, _Atomic_word*& refcount,
- uchar*& datastart, uchar*& data, size_t* step)
- {
- PyEnsureGIL gil;
-@@ -206,7 +206,7 @@ public:
- datastart = data = (uchar*)PyArray_DATA((PyArrayObject*) o);
- }
-
-- void deallocate(int* refcount, uchar*, uchar*)
-+ void deallocate(_Atomic_word* refcount, uchar*, uchar*)
- {
- PyEnsureGIL gil;
- if( !refcount )
diff --git a/debian/patches/drop_asm_types_h_kfreebsd b/debian/patches/drop_asm_types_h_kfreebsd
deleted file mode 100644
index cc2e9d4..0000000
--- a/debian/patches/drop_asm_types_h_kfreebsd
+++ /dev/null
@@ -1,25 +0,0 @@
-Description: Fix FTBFS on kfreebsd
-Author: Nobuhiro Iwamatsu <iwamatsu at debian.org>
-Forwarded: no
-Last-Update: <2013-08-07>
-
---- a/modules/highgui/src/cap_libv4l.cpp
-+++ b/modules/highgui/src/cap_libv4l.cpp
-@@ -237,15 +237,16 @@ make & enjoy!
- #include <sys/mman.h>
- #include <string.h>
- #include <stdlib.h>
--#include <asm/types.h> /* for videodev2.h */
- #include <assert.h>
- #include <sys/stat.h>
- #include <sys/ioctl.h>
-
- #ifdef HAVE_CAMV4L
-+#include <asm/types.h> /* for videodev2.h */
- #include <linux/videodev.h>
- #endif
- #ifdef HAVE_CAMV4L2
-+#include <asm/types.h> /* for videodev2.h */
- #include <linux/videodev2.h>
- #endif
-
diff --git a/debian/patches/ffmpeg_2.9.patch b/debian/patches/ffmpeg_2.9.patch
deleted file mode 100644
index 63362b8..0000000
--- a/debian/patches/ffmpeg_2.9.patch
+++ /dev/null
@@ -1,226 +0,0 @@
-## Description: add some description
-## Origin/Author: add some origin or author
-## Bug: bug URL
-Description: Replace deprecated FFmpeg API
-Author: Andreas Cadhalpun <Andreas.Cadhalpun at googlemail.com>
-Last-Update: <2015-11-02>
-
-Index: opencv-3.0.0+dfsg/modules/videoio/src/cap_ffmpeg_impl.hpp
-===================================================================
---- opencv-3.0.0+dfsg.orig/modules/videoio/src/cap_ffmpeg_impl.hpp
-+++ opencv-3.0.0+dfsg/modules/videoio/src/cap_ffmpeg_impl.hpp
-@@ -127,9 +127,9 @@
- #define CV_WARN(message) fprintf(stderr, "warning: %s (%s:%d)\n", message, __FILE__, __LINE__)
- #endif
-
--/* PIX_FMT_RGBA32 macro changed in newer ffmpeg versions */
--#ifndef PIX_FMT_RGBA32
--#define PIX_FMT_RGBA32 PIX_FMT_RGB32
-+/* AV_PIX_FMT_RGBA32 macro changed in newer ffmpeg versions */
-+#ifndef AV_PIX_FMT_RGBA32
-+#define AV_PIX_FMT_RGBA32 AV_PIX_FMT_RGB32
- #endif
-
-
-@@ -318,7 +318,7 @@
- // FFmpeg and Libav added avcodec_free_frame in different versions.
- #if LIBAVCODEC_BUILD >= (LIBAVCODEC_VERSION_MICRO >= 100 \
- ? CALC_FFMPEG_VERSION(54, 59, 100) : CALC_FFMPEG_VERSION(54, 28, 0))
-- avcodec_free_frame(&picture);
-+ av_frame_free(&picture);
- #else
- av_free(picture);
- #endif
-@@ -633,13 +633,13 @@
-
- video_stream = i;
- video_st = ic->streams[i];
-- picture = avcodec_alloc_frame();
-+ picture = av_frame_alloc();
-
- rgb_picture.data[0] = (uint8_t*)malloc(
-- avpicture_get_size( PIX_FMT_BGR24,
-+ avpicture_get_size( AV_PIX_FMT_BGR24,
- enc->width, enc->height ));
- avpicture_fill( (AVPicture*)&rgb_picture, rgb_picture.data[0],
-- PIX_FMT_BGR24, enc->width, enc->height );
-+ AV_PIX_FMT_BGR24, enc->width, enc->height );
-
- frame.width = enc->width;
- frame.height = enc->height;
-@@ -739,7 +739,7 @@
- if( !video_st || !picture->data[0] )
- return false;
-
-- avpicture_fill((AVPicture*)&rgb_picture, rgb_picture.data[0], PIX_FMT_RGB24,
-+ avpicture_fill((AVPicture*)&rgb_picture, rgb_picture.data[0], AV_PIX_FMT_RGB24,
- video_st->codec->width, video_st->codec->height);
-
- if( img_convert_ctx == NULL ||
-@@ -757,7 +757,7 @@
- video_st->codec->width, video_st->codec->height,
- video_st->codec->pix_fmt,
- video_st->codec->width, video_st->codec->height,
-- PIX_FMT_BGR24,
-+ AV_PIX_FMT_BGR24,
- SWS_BICUBIC,
- NULL, NULL, NULL
- );
-@@ -1111,10 +1111,10 @@
- uint8_t * picture_buf;
- int size;
-
-- picture = avcodec_alloc_frame();
-+ picture = av_frame_alloc();
- if (!picture)
- return NULL;
-- size = avpicture_get_size( (PixelFormat) pix_fmt, width, height);
-+ size = avpicture_get_size( (AVPixelFormat) pix_fmt, width, height);
- if(alloc){
- picture_buf = (uint8_t *) malloc(size);
- if (!picture_buf)
-@@ -1123,7 +1123,7 @@
- return NULL;
- }
- avpicture_fill((AVPicture *)picture, picture_buf,
-- (PixelFormat) pix_fmt, width, height);
-+ (AVPixelFormat) pix_fmt, width, height);
- }
- else {
- }
-@@ -1231,7 +1231,7 @@
- #endif
-
- c->gop_size = 12; /* emit one intra frame every twelve frames at most */
-- c->pix_fmt = (PixelFormat) pixel_format;
-+ c->pix_fmt = (AVPixelFormat) pixel_format;
-
- if (c->codec_id == CV_CODEC(CODEC_ID_MPEG2VIDEO)) {
- c->max_b_frames = 2;
-@@ -1406,12 +1406,12 @@
- #endif
-
- // check parameters
-- if (input_pix_fmt == PIX_FMT_BGR24) {
-+ if (input_pix_fmt == AV_PIX_FMT_BGR24) {
- if (cn != 3) {
- return false;
- }
- }
-- else if (input_pix_fmt == PIX_FMT_GRAY8) {
-+ else if (input_pix_fmt == AV_PIX_FMT_GRAY8) {
- if (cn != 1) {
- return false;
- }
-@@ -1424,13 +1424,13 @@
- assert( input_picture );
- // let input_picture point to the raw data buffer of 'image'
- avpicture_fill((AVPicture *)input_picture, (uint8_t *) data,
-- (PixelFormat)input_pix_fmt, width, height);
-+ (AVPixelFormat)input_pix_fmt, width, height);
-
- if( !img_convert_ctx )
- {
- img_convert_ctx = sws_getContext(width,
- height,
-- (PixelFormat)input_pix_fmt,
-+ (AVPixelFormat)input_pix_fmt,
- c->width,
- c->height,
- c->pix_fmt,
-@@ -1448,7 +1448,7 @@
- }
- else{
- avpicture_fill((AVPicture *)picture, (uint8_t *) data,
-- (PixelFormat)input_pix_fmt, width, height);
-+ (AVPixelFormat)input_pix_fmt, width, height);
- }
-
- picture->pts = frame_idx;
-@@ -1605,10 +1605,10 @@
-
- /* determine optimal pixel format */
- if (is_color) {
-- input_pix_fmt = PIX_FMT_BGR24;
-+ input_pix_fmt = AV_PIX_FMT_BGR24;
- }
- else {
-- input_pix_fmt = PIX_FMT_GRAY8;
-+ input_pix_fmt = AV_PIX_FMT_GRAY8;
- }
-
- /* Lookup codec_id for given fourcc */
-@@ -1684,21 +1684,21 @@
- break;
- #endif
- case CV_CODEC(CODEC_ID_HUFFYUV):
-- codec_pix_fmt = PIX_FMT_YUV422P;
-+ codec_pix_fmt = AV_PIX_FMT_YUV422P;
- break;
- case CV_CODEC(CODEC_ID_MJPEG):
- case CV_CODEC(CODEC_ID_LJPEG):
-- codec_pix_fmt = PIX_FMT_YUVJ420P;
-+ codec_pix_fmt = AV_PIX_FMT_YUVJ420P;
- bitrate_scale = 3;
- break;
- case CV_CODEC(CODEC_ID_RAWVIDEO):
-- codec_pix_fmt = input_pix_fmt == PIX_FMT_GRAY8 ||
-- input_pix_fmt == PIX_FMT_GRAY16LE ||
-- input_pix_fmt == PIX_FMT_GRAY16BE ? input_pix_fmt : PIX_FMT_YUV420P;
-+ codec_pix_fmt = input_pix_fmt == AV_PIX_FMT_GRAY8 ||
-+ input_pix_fmt == AV_PIX_FMT_GRAY16LE ||
-+ input_pix_fmt == AV_PIX_FMT_GRAY16BE ? input_pix_fmt : AV_PIX_FMT_YUV420P;
- break;
- default:
- // good for lossy formats, MPEG, etc.
-- codec_pix_fmt = PIX_FMT_YUV420P;
-+ codec_pix_fmt = AV_PIX_FMT_YUV420P;
- break;
- }
-
-@@ -1923,7 +1923,7 @@
- void write(unsigned char* data, int size, int keyFrame);
-
- // add a video output stream to the container
-- static AVStream* addVideoStream(AVFormatContext *oc, CV_CODEC_ID codec_id, int w, int h, int bitrate, double fps, PixelFormat pixel_format);
-+ static AVStream* addVideoStream(AVFormatContext *oc, CV_CODEC_ID codec_id, int w, int h, int bitrate, double fps, AVPixelFormat pixel_format);
-
- AVOutputFormat* fmt_;
- AVFormatContext* oc_;
-@@ -1970,7 +1970,7 @@
- }
- }
-
--AVStream* OutputMediaStream_FFMPEG::addVideoStream(AVFormatContext *oc, CV_CODEC_ID codec_id, int w, int h, int bitrate, double fps, PixelFormat pixel_format)
-+AVStream* OutputMediaStream_FFMPEG::addVideoStream(AVFormatContext *oc, CV_CODEC_ID codec_id, int w, int h, int bitrate, double fps, AVPixelFormat pixel_format)
- {
- #if LIBAVFORMAT_BUILD >= CALC_FFMPEG_VERSION(53, 10, 0)
- AVStream* st = avformat_new_stream(oc, 0);
-@@ -2108,7 +2108,7 @@
- oc_->max_delay = (int)(0.7 * AV_TIME_BASE); // This reduces buffer underrun warnings with MPEG
-
- // set a few optimal pixel formats for lossless codecs of interest..
-- PixelFormat codec_pix_fmt = PIX_FMT_YUV420P;
-+ AVPixelFormat codec_pix_fmt = AV_PIX_FMT_YUV420P;
- int bitrate_scale = 64;
-
- // TODO -- safe to ignore output audio stream?
-@@ -2317,15 +2317,15 @@
-
- switch (enc->pix_fmt)
- {
-- case PIX_FMT_YUV420P:
-+ case AV_PIX_FMT_YUV420P:
- *chroma_format = ::VideoChromaFormat_YUV420;
- break;
-
-- case PIX_FMT_YUV422P:
-+ case AV_PIX_FMT_YUV422P:
- *chroma_format = ::VideoChromaFormat_YUV422;
- break;
-
-- case PIX_FMT_YUV444P:
-+ case AV_PIX_FMT_YUV444P:
- *chroma_format = ::VideoChromaFormat_YUV444;
- break;
-
diff --git a/debian/patches/fix_path_of_opencl_headers b/debian/patches/fix_path_of_opencl_headers
deleted file mode 100644
index 96dfd6e..0000000
--- a/debian/patches/fix_path_of_opencl_headers
+++ /dev/null
@@ -1,20 +0,0 @@
-Description: Fix path of opencl header file. This patch modified can be set
-by OPENCL_INCLUDE_DIR option for path of the header file of OpenCL.
-Bug: None
-Bug-Debian: None
-Author: Nobuhiro Iwamatsu
-Last-Update: 2014-01-07
-
-diff --git a/cmake/OpenCVDetectOpenCL.cmake b/cmake/OpenCVDetectOpenCL.cmake
-index f732546..3cc09ce 100644
---- a/cmake/OpenCVDetectOpenCL.cmake
-+++ b/cmake/OpenCVDetectOpenCL.cmake
-@@ -7,7 +7,7 @@ if(APPLE)
- else(APPLE)
- set(OPENCL_FOUND YES)
- set(HAVE_OPENCL_STATIC OFF)
-- set(OPENCL_INCLUDE_DIR "${OpenCV_SOURCE_DIR}/3rdparty/include/opencl/1.2")
-+ set(OPENCL_INCLUDE_DIR "" CACHE STRING "OpenCL include directory")
- endif(APPLE)
-
- if(OPENCL_FOUND)
diff --git a/debian/patches/libav10.patch b/debian/patches/libav10.patch
deleted file mode 100644
index b9326e1..0000000
--- a/debian/patches/libav10.patch
+++ /dev/null
@@ -1,751 +0,0 @@
-From: anton at khirnov.net
-Description: Support building with the upcoming Libav 10 release
-Origin: upstream, https://github.com/Itseez/opencv/pull/2293
-
-diff --git a/modules/highgui/src/cap_ffmpeg_impl.hpp b/modules/highgui/src/cap_ffmpeg_impl.hpp
-index e7a48d5..dbebaac 100644
---- a/modules/highgui/src/cap_ffmpeg_impl.hpp
-+++ b/modules/highgui/src/cap_ffmpeg_impl.hpp
-@@ -57,10 +57,28 @@
- extern "C" {
- #endif
-
--#include "ffmpeg_codecs.hpp"
-+#if !defined(WIN32) || defined(__MINGW32__)
-
-+#include <stdint.h>
-+
-+// some versions of FFMPEG assume a C99 compiler, and don't define INT64_C
-+#ifndef INT64_C
-+#define INT64_C(c) (c##LL)
-+#endif
-+
-+#ifndef UINT64_C
-+#define UINT64_C(c) (c##ULL)
-+#endif
-+
-+#include <errno.h>
-+
-+#endif
-+
-+#include <libavformat/avformat.h>
- #include <libavutil/mathematics.h>
-
-+#include <libavutil/opt.h>
-+
- #ifdef WIN32
- #define HAVE_FFMPEG_SWSCALE 1
- #include <libavcodec/avcodec.h>
-@@ -144,10 +162,6 @@ extern "C" {
- #define AV_NOPTS_VALUE_ ((int64_t)AV_NOPTS_VALUE)
- #endif
-
--#ifndef AVERROR_EOF
--#define AVERROR_EOF (-MKTAG( 'E','O','F',' '))
--#endif
--
- #if LIBAVCODEC_BUILD >= CALC_FFMPEG_VERSION(54,25,0)
- # define CV_CODEC_ID AVCodecID
- # define CV_CODEC(name) AV_##name
-@@ -158,9 +172,7 @@ extern "C" {
-
- static int get_number_of_cpus(void)
- {
--#if LIBAVFORMAT_BUILD < CALC_FFMPEG_VERSION(52, 111, 0)
-- return 1;
--#elif defined WIN32 || defined _WIN32
-+#if defined WIN32 || defined _WIN32
- SYSTEM_INFO sysinfo;
- GetSystemInfo( &sysinfo );
-
-@@ -312,25 +324,13 @@ void CvCapture_FFMPEG::close()
-
- if( video_st )
- {
--#if LIBAVFORMAT_BUILD > 4628
- avcodec_close( video_st->codec );
--
--#else
-- avcodec_close( &(video_st->codec) );
--
--#endif
- video_st = NULL;
- }
-
- if( ic )
- {
--#if LIBAVFORMAT_BUILD < CALC_FFMPEG_VERSION(53, 24, 2)
-- av_close_input_file(ic);
--#else
- avformat_close_input(&ic);
--#endif
--
-- ic = NULL;
- }
-
- if( rgb_picture.data[0] )
-@@ -523,9 +523,7 @@ public:
- _mutex.lock();
- if (!_initialized)
- {
-- #if LIBAVFORMAT_BUILD >= CALC_FFMPEG_VERSION(53, 13, 0)
- avformat_network_init();
-- #endif
-
- /* register all codecs, demux and protocols */
- av_register_all();
-@@ -556,12 +554,7 @@ bool CvCapture_FFMPEG::open( const char* _filename )
-
- close();
-
--#if LIBAVFORMAT_BUILD >= CALC_FFMPEG_VERSION(52, 111, 0)
-- av_dict_set(&dict, "rtsp_transport", "tcp", 0);
-- int err = avformat_open_input(&ic, _filename, NULL, &dict);
--#else
-- int err = av_open_input_file(&ic, _filename, NULL, 0, NULL);
--#endif
-+ int err = avformat_open_input(&ic, _filename, NULL, NULL);
-
- if (err < 0)
- {
-@@ -569,11 +562,7 @@ bool CvCapture_FFMPEG::open( const char* _filename )
- goto exit_func;
- }
- err =
--#if LIBAVFORMAT_BUILD >= CALC_FFMPEG_VERSION(53, 6, 0)
- avformat_find_stream_info(ic, NULL);
--#else
-- av_find_stream_info(ic);
--#endif
- if (err < 0)
- {
- CV_WARN("Could not find codec parameters");
-@@ -581,11 +570,7 @@ bool CvCapture_FFMPEG::open( const char* _filename )
- }
- for(i = 0; i < ic->nb_streams; i++)
- {
--#if LIBAVFORMAT_BUILD > 4628
- AVCodecContext *enc = ic->streams[i]->codec;
--#else
-- AVCodecContext *enc = &ic->streams[i]->codec;
--#endif
-
- //#ifdef FF_API_THREAD_INIT
- // avcodec_thread_init(enc, get_number_of_cpus());
-@@ -593,10 +578,6 @@ bool CvCapture_FFMPEG::open( const char* _filename )
- enc->thread_count = get_number_of_cpus();
- //#endif
-
--#if LIBAVFORMAT_BUILD < CALC_FFMPEG_VERSION(53, 2, 0)
--#define AVMEDIA_TYPE_VIDEO CODEC_TYPE_VIDEO
--#endif
--
- if( AVMEDIA_TYPE_VIDEO == enc->codec_type && video_stream < 0)
- {
- // backup encoder' width/height
-@@ -604,13 +585,7 @@ bool CvCapture_FFMPEG::open( const char* _filename )
- int enc_height = enc->height;
-
- AVCodec *codec = avcodec_find_decoder(enc->codec_id);
-- if (!codec ||
--#if LIBAVCODEC_VERSION_INT >= ((53<<16)+(8<<8)+0)
-- avcodec_open2(enc, codec, NULL)
--#else
-- avcodec_open(enc, codec)
--#endif
-- < 0)
-+ if (!codec || avcodec_open2(enc, codec, NULL) < 0)
- goto exit_func;
-
- // checking width/height (since decoder can sometimes alter it, eg. vp6f)
-@@ -683,17 +658,7 @@ bool CvCapture_FFMPEG::grabFrame()
- }
-
- // Decode video frame
-- #if LIBAVFORMAT_BUILD >= CALC_FFMPEG_VERSION(53, 2, 0)
- avcodec_decode_video2(video_st->codec, picture, &got_picture, &packet);
-- #elif LIBAVFORMAT_BUILD > 4628
-- avcodec_decode_video(video_st->codec,
-- picture, &got_picture,
-- packet.data, packet.size);
-- #else
-- avcodec_decode_video(&video_st->codec,
-- picture, &got_picture,
-- packet.data, packet.size);
-- #endif
-
- // Did we get a video frame?
- if(got_picture)
-@@ -792,18 +757,9 @@ double CvCapture_FFMPEG::getProperty( int property_id )
- case CV_FFMPEG_CAP_PROP_FRAME_HEIGHT:
- return (double)frame.height;
- case CV_FFMPEG_CAP_PROP_FPS:
--#if LIBAVCODEC_BUILD > 4753
-- return av_q2d(video_st->r_frame_rate);
--#else
-- return (double)video_st->codec.frame_rate
-- / (double)video_st->codec.frame_rate_base;
--#endif
-+ return av_q2d(video_st->avg_frame_rate);
- case CV_FFMPEG_CAP_PROP_FOURCC:
--#if LIBAVFORMAT_BUILD > 4628
- return (double)video_st->codec->codec_tag;
--#else
-- return (double)video_st->codec.codec_tag;
--#endif
- default:
- break;
- }
-@@ -840,14 +796,7 @@ int CvCapture_FFMPEG::get_bitrate()
-
- double CvCapture_FFMPEG::get_fps()
- {
-- double fps = r2d(ic->streams[video_stream]->r_frame_rate);
--
--#if LIBAVFORMAT_BUILD >= CALC_FFMPEG_VERSION(52, 111, 0)
-- if (fps < eps_zero)
-- {
-- fps = r2d(ic->streams[video_stream]->avg_frame_rate);
-- }
--#endif
-+ double fps = r2d(ic->streams[video_stream]->avg_frame_rate);
-
- if (fps < eps_zero)
- {
-@@ -1007,7 +956,6 @@ struct CvVideoWriter_FFMPEG
-
- static const char * icvFFMPEGErrStr(int err)
- {
--#if LIBAVFORMAT_BUILD >= CALC_FFMPEG_VERSION(53, 2, 0)
- switch(err) {
- case AVERROR_BSF_NOT_FOUND:
- return "Bitstream filter not found";
-@@ -1038,22 +986,6 @@ static const char * icvFFMPEGErrStr(int err)
- default:
- break;
- }
--#else
-- switch(err) {
-- case AVERROR_NUMEXPECTED:
-- return "Incorrect filename syntax";
-- case AVERROR_INVALIDDATA:
-- return "Invalid data in header";
-- case AVERROR_NOFMT:
-- return "Unknown format";
-- case AVERROR_IO:
-- return "I/O error occurred";
-- case AVERROR_NOMEM:
-- return "Memory allocation error";
-- default:
-- break;
-- }
--#endif
-
- return "Unspecified error";
- }
-@@ -1121,28 +1053,16 @@ static AVStream *icv_add_video_stream_FFMPEG(AVFormatContext *oc,
- 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;
- }
-
--#if LIBAVFORMAT_BUILD > 4628
- c = st->codec;
--#else
-- c = &(st->codec);
--#endif
-
--#if LIBAVFORMAT_BUILD > 4621
- c->codec_id = av_guess_codec(oc->oformat, NULL, oc->filename, NULL, AVMEDIA_TYPE_VIDEO);
--#else
-- c->codec_id = oc->oformat->video_codec;
--#endif
-
- if(codec_id != CV_CODEC(CODEC_ID_NONE)){
- c->codec_id = codec_id;
-@@ -1177,7 +1097,6 @@ static AVStream *icv_add_video_stream_FFMPEG(AVFormatContext *oc,
- frame_rate_base*=10;
- frame_rate=(int)(fps*frame_rate_base + 0.5);
- }
--#if LIBAVFORMAT_BUILD > 4752
- c->time_base.den = frame_rate;
- c->time_base.num = frame_rate_base;
- /* adjust time base for supported framerates */
-@@ -1197,10 +1116,6 @@ static AVStream *icv_add_video_stream_FFMPEG(AVFormatContext *oc,
- c->time_base.den= best->num;
- c->time_base.num= best->den;
- }
--#else
-- c->frame_rate = frame_rate;
-- c->frame_rate_base = frame_rate_base;
--#endif
-
- c->gop_size = 12; /* emit one intra frame every twelve frames at most */
- c->pix_fmt = (PixelFormat) pixel_format;
-@@ -1230,12 +1145,7 @@ static const int OPENCV_NO_FRAMES_WRITTEN_CODE = 1000;
-
- static int icv_av_write_frame_FFMPEG( AVFormatContext * oc, AVStream * video_st, uint8_t * outbuf, uint32_t outbuf_size, AVFrame * picture )
- {
--#if LIBAVFORMAT_BUILD > 4628
- AVCodecContext * c = video_st->codec;
--#else
-- AVCodecContext * c = &(video_st->codec);
--#endif
-- int out_size;
- int ret = 0;
-
- if (oc->oformat->flags & AVFMT_RAWPICTURE) {
-@@ -1255,24 +1165,39 @@ static int icv_av_write_frame_FFMPEG( AVFormatContext * oc, AVStream * video_st,
-
- ret = av_write_frame(oc, &pkt);
- } else {
-+ AVPacket pkt;
-+ int got_output;
-+
-+ av_init_packet(&pkt);
-+#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(54, 1, 0)
- /* encode the image */
-- out_size = avcodec_encode_video(c, outbuf, outbuf_size, picture);
-- /* if zero size, it means the image was buffered */
-- if (out_size > 0) {
-- AVPacket pkt;
-- av_init_packet(&pkt);
--
--#if LIBAVFORMAT_BUILD > 4752
-- if(c->coded_frame->pts != (int64_t)AV_NOPTS_VALUE)
-- pkt.pts = av_rescale_q(c->coded_frame->pts, c->time_base, video_st->time_base);
--#else
-+ int out_size = avcodec_encode_video(c, outbuf, outbuf_size, picture);
-+ got_output = out_size > 0;
-+ pkt.data = outbuf;
-+ pkt.size = out_size;
-+ if(c->coded_frame->pts != (int64_t)AV_NOPTS_VALUE)
- pkt.pts = c->coded_frame->pts;
-+ pkt.dts = AV_NOPTS_VALUE;
-+ if(c->coded_frame->key_frame)
-+ pkt.flags |= PKT_FLAG_KEY;
-+#else
-+ pkt.data = NULL;
-+ pkt.size = 0;
-+
-+ ret = avcodec_encode_video2(c, &pkt, picture, &got_output);
-+ if (ret < 0)
-+ got_output = 0;
- #endif
-- if(c->coded_frame->key_frame)
-- pkt.flags |= PKT_FLAG_KEY;
-+
-+ if (got_output) {
-+ if (pkt.pts != (int64_t)AV_NOPTS_VALUE)
-+ pkt.pts = av_rescale_q(pkt.pts, c->time_base, video_st->time_base);
-+ if (pkt.dts != (int64_t)AV_NOPTS_VALUE)
-+ pkt.dts = av_rescale_q(pkt.dts, c->time_base, video_st->time_base);
-+ if (pkt.duration)
-+ pkt.duration = av_rescale_q(pkt.duration, c->time_base, video_st->time_base);
-+
- pkt.stream_index= video_st->index;
-- pkt.data= outbuf;
-- pkt.size= out_size;
-
- /* write the compressed frame in the media file */
- ret = av_write_frame(oc, &pkt);
-@@ -1294,30 +1219,8 @@ bool CvVideoWriter_FFMPEG::writeFrame( const unsigned char* data, int step, int
- height = frame_height;
-
- // typecast from opaque data type to implemented struct
--#if LIBAVFORMAT_BUILD > 4628
- AVCodecContext *c = video_st->codec;
--#else
-- AVCodecContext *c = &(video_st->codec);
--#endif
-
--#if LIBAVFORMAT_BUILD < 5231
-- // It is not needed in the latest versions of the ffmpeg
-- if( c->codec_id == CV_CODEC(CODEC_ID_RAWVIDEO) && origin != 1 )
-- {
-- if( !temp_image.data )
-- {
-- temp_image.step = (width*cn + 3) & -4;
-- temp_image.width = width;
-- temp_image.height = height;
-- temp_image.cn = cn;
-- temp_image.data = (unsigned char*)malloc(temp_image.step*temp_image.height);
-- }
-- for( int y = 0; y < height; y++ )
-- memcpy(temp_image.data + y*temp_image.step, data + (height-1-y)*step, width*cn);
-- data = temp_image.data;
-- step = temp_image.step;
-- }
--#else
- if( width*cn != step )
- {
- if( !temp_image.data )
-@@ -1337,7 +1240,6 @@ bool CvVideoWriter_FFMPEG::writeFrame( const unsigned char* data, int step, int
- data = temp_image.data;
- step = temp_image.step;
- }
--#endif
-
- // check parameters
- if (input_pix_fmt == PIX_FMT_BGR24) {
-@@ -1424,11 +1326,7 @@ void CvVideoWriter_FFMPEG::close()
- }
-
- // free pictures
--#if LIBAVFORMAT_BUILD > 4628
- if( video_st->codec->pix_fmt != input_pix_fmt)
--#else
-- if( video_st->codec.pix_fmt != input_pix_fmt)
--#endif
- {
- if(picture->data[0])
- free(picture->data[0]);
-@@ -1440,11 +1338,7 @@ void CvVideoWriter_FFMPEG::close()
- av_free(input_picture);
-
- /* close codec */
--#if LIBAVFORMAT_BUILD > 4628
- avcodec_close(video_st->codec);
--#else
-- avcodec_close(&(video_st->codec));
--#endif
-
- av_free(outbuf);
-
-@@ -1452,15 +1346,7 @@ void CvVideoWriter_FFMPEG::close()
- {
- /* close the output file */
-
--#if LIBAVCODEC_VERSION_INT < ((52<<16)+(123<<8)+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
-
- }
-
-@@ -1502,11 +1388,7 @@ bool CvVideoWriter_FFMPEG::open( const char * filename, int fourcc,
-
- /* auto detect the output format from the name and fourcc code. */
-
--#if LIBAVFORMAT_BUILD >= CALC_FFMPEG_VERSION(53, 2, 0)
- fmt = av_guess_format(NULL, filename, NULL);
--#else
-- fmt = guess_format(NULL, filename, NULL);
--#endif
-
- if (!fmt)
- return false;
-@@ -1520,21 +1402,12 @@ bool CvVideoWriter_FFMPEG::open( const char * filename, int fourcc,
- }
-
- /* Lookup codec_id for given fourcc */
--#if LIBAVCODEC_VERSION_INT<((51<<16)+(49<<8)+0)
-- if( (codec_id = codec_get_bmp_id( fourcc )) == CV_CODEC(CODEC_ID_NONE) )
-- return false;
--#else
-- const struct AVCodecTag * tags[] = { codec_bmp_tags, NULL};
-+ const struct AVCodecTag * tags[] = { avformat_get_riff_video_tags(), NULL};
- if( (codec_id = av_codec_get_id(tags, fourcc)) == CV_CODEC(CODEC_ID_NONE) )
- return false;
--#endif
-
- // alloc memory for context
--#if LIBAVFORMAT_BUILD >= CALC_FFMPEG_VERSION(53, 2, 0)
- oc = avformat_alloc_context();
--#else
-- oc = av_alloc_format_context();
--#endif
- assert (oc);
-
- /* set file name */
-@@ -1546,12 +1419,10 @@ bool CvVideoWriter_FFMPEG::open( const char * filename, int fourcc,
-
- // set a few optimal pixel formats for lossless codecs of interest..
- switch (codec_id) {
--#if LIBAVCODEC_VERSION_INT>((50<<16)+(1<<8)+0)
- case CV_CODEC(CODEC_ID_JPEGLS):
- // BGR24 or GRAY8 depending on is_color...
- codec_pix_fmt = input_pix_fmt;
- break;
--#endif
- case CV_CODEC(CODEC_ID_HUFFYUV):
- codec_pix_fmt = PIX_FMT_YUV422P;
- break;
-@@ -1578,14 +1449,6 @@ bool CvVideoWriter_FFMPEG::open( const char * filename, int fourcc,
- width, height, (int)(bitrate + 0.5),
- fps, codec_pix_fmt);
-
-- /* 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 0
- #if FF_API_DUMP_FORMAT
- dump_format(oc, 0, filename, 1);
-@@ -1603,23 +1466,14 @@ bool CvVideoWriter_FFMPEG::open( const char * filename, int fourcc,
- AVCodec *codec;
- AVCodecContext *c;
-
--#if LIBAVFORMAT_BUILD > 4628
- c = (video_st->codec);
--#else
-- c = &(video_st->codec);
--#endif
-
- c->codec_tag = fourcc;
- /* find the video encoder */
- codec = avcodec_find_encoder(c->codec_id);
- if (!codec) {
- fprintf(stderr, "Could not find encoder for codec id %d: %s", c->codec_id, icvFFMPEGErrStr(
-- #if LIBAVFORMAT_BUILD >= CALC_FFMPEG_VERSION(53, 2, 0)
-- AVERROR_ENCODER_NOT_FOUND
-- #else
-- -1
-- #endif
-- ));
-+ AVERROR_ENCODER_NOT_FOUND));
- return false;
- }
-
-@@ -1630,13 +1484,7 @@ bool CvVideoWriter_FFMPEG::open( const char * filename, int fourcc,
- c->bit_rate = (int)lbit_rate;
-
- /* open the codec */
-- if ((err=
--#if LIBAVCODEC_VERSION_INT >= ((53<<16)+(8<<8)+0)
-- avcodec_open2(c, codec, NULL)
--#else
-- avcodec_open(c, codec)
--#endif
-- ) < 0) {
-+ if ((err = avcodec_open2(c, codec, NULL)) < 0) {
- fprintf(stderr, "Could not open codec '%s': %s", codec->name, icvFFMPEGErrStr(err));
- return false;
- }
-@@ -1672,22 +1520,14 @@ bool CvVideoWriter_FFMPEG::open( const char * filename, int fourcc,
-
- /* open the output file, if needed */
- if (!(fmt->flags & AVFMT_NOFILE)) {
--#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;
- }
- }
-
--#if LIBAVFORMAT_BUILD >= CALC_FFMPEG_VERSION(52, 111, 0)
- /* write the stream header, if any */
- err=avformat_write_header(oc, NULL);
--#else
-- err=av_write_header( oc );
--#endif
-
- if(err < 0)
- {
-@@ -1822,15 +1662,7 @@ void OutputMediaStream_FFMPEG::close()
- {
- // close the output file
-
-- #if LIBAVCODEC_VERSION_INT < ((52<<16)+(123<<8)+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
-+ avio_close(oc_->pb);
- }
-
- // free the stream
-@@ -1840,19 +1672,11 @@ void OutputMediaStream_FFMPEG::close()
-
- AVStream* OutputMediaStream_FFMPEG::addVideoStream(AVFormatContext *oc, CV_CODEC_ID codec_id, int w, int h, int bitrate, double fps, PixelFormat pixel_format)
- {
-- #if LIBAVFORMAT_BUILD >= CALC_FFMPEG_VERSION(53, 10, 0)
- AVStream* st = avformat_new_stream(oc, 0);
-- #else
-- AVStream* st = av_new_stream(oc, 0);
-- #endif
- if (!st)
- return 0;
-
-- #if LIBAVFORMAT_BUILD > 4628
- AVCodecContext* c = st->codec;
-- #else
-- AVCodecContext* c = &(st->codec);
-- #endif
-
- c->codec_id = codec_id;
- c->codec_type = AVMEDIA_TYPE_VIDEO;
-@@ -1888,7 +1712,6 @@ AVStream* OutputMediaStream_FFMPEG::addVideoStream(AVFormatContext *oc, CV_CODEC
- c->time_base.den = frame_rate;
- c->time_base.num = frame_rate_base;
-
-- #if LIBAVFORMAT_BUILD > 4752
- // adjust time base for supported framerates
- if (codec && codec->supported_framerates)
- {
-@@ -1913,7 +1736,6 @@ AVStream* OutputMediaStream_FFMPEG::addVideoStream(AVFormatContext *oc, CV_CODEC
- c->time_base.den= best->num;
- c->time_base.num= best->den;
- }
-- #endif
-
- c->gop_size = 12; // emit one intra frame every twelve frames at most
- c->pix_fmt = pixel_format;
-@@ -1932,13 +1754,11 @@ AVStream* OutputMediaStream_FFMPEG::addVideoStream(AVFormatContext *oc, CV_CODEC
- c->mb_decision = 2;
- }
-
-- #if LIBAVCODEC_VERSION_INT > 0x000409
- // some formats want stream headers to be seperate
- if (oc->oformat->flags & AVFMT_GLOBALHEADER)
- {
- c->flags |= CODEC_FLAG_GLOBAL_HEADER;
- }
-- #endif
-
- return st;
- }
-@@ -1950,22 +1770,14 @@ bool OutputMediaStream_FFMPEG::open(const char* fileName, int width, int height,
- video_st_ = 0;
-
- // auto detect the output format from the name and fourcc code
-- #if LIBAVFORMAT_BUILD >= CALC_FFMPEG_VERSION(53, 2, 0)
- fmt_ = av_guess_format(NULL, fileName, NULL);
-- #else
-- fmt_ = guess_format(NULL, fileName, NULL);
-- #endif
- if (!fmt_)
- return false;
-
- CV_CODEC_ID codec_id = CV_CODEC(CODEC_ID_H264);
-
- // alloc memory for context
-- #if LIBAVFORMAT_BUILD >= CALC_FFMPEG_VERSION(53, 2, 0)
- oc_ = avformat_alloc_context();
-- #else
-- oc_ = av_alloc_format_context();
-- #endif
- if (!oc_)
- return false;
-
-@@ -1984,20 +1796,10 @@ bool OutputMediaStream_FFMPEG::open(const char* fileName, int width, int height,
- if (!video_st_)
- return false;
-
-- // 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
--
- // now that all the parameters are set, we can open the audio and
- // video codecs and allocate the necessary encode buffers
-
-- #if LIBAVFORMAT_BUILD > 4628
- AVCodecContext* c = (video_st_->codec);
-- #else
-- AVCodecContext* c = &(video_st_->codec);
-- #endif
-
- c->codec_tag = MKTAG('H', '2', '6', '4');
- c->bit_rate_tolerance = c->bit_rate;
-@@ -2005,22 +1807,14 @@ bool OutputMediaStream_FFMPEG::open(const char* fileName, int width, int height,
- // open the output file, if needed
- if (!(fmt_->flags & AVFMT_NOFILE))
- {
-- #if LIBAVFORMAT_BUILD < CALC_FFMPEG_VERSION(53, 2, 0)
-- int err = url_fopen(&oc_->pb, fileName, URL_WRONLY);
-- #else
-- int err = avio_open(&oc_->pb, fileName, AVIO_FLAG_WRITE);
-- #endif
-+ int err = avio_open(&oc_->pb, fileName, AVIO_FLAG_WRITE);
-
- if (err != 0)
- return false;
- }
-
- // write the stream header, if any
-- #if LIBAVFORMAT_BUILD < CALC_FFMPEG_VERSION(53, 2, 0)
-- av_write_header(oc_);
-- #else
-- avformat_write_header(oc_, NULL);
-- #endif
-+ avformat_write_header(oc_, NULL);
-
- return true;
- }
-@@ -2125,33 +1919,19 @@ bool InputMediaStream_FFMPEG::open(const char* fileName, int* codec, int* chroma
- video_stream_id_ = -1;
- memset(&pkt_, 0, sizeof(AVPacket));
-
-- #if LIBAVFORMAT_BUILD >= CALC_FFMPEG_VERSION(53, 13, 0)
-- avformat_network_init();
-- #endif
-+ avformat_network_init();
-
-- #if LIBAVFORMAT_BUILD >= CALC_FFMPEG_VERSION(53, 6, 0)
-- err = avformat_open_input(&ctx_, fileName, 0, 0);
-- #else
-- err = av_open_input_file(&ctx_, fileName, 0, 0, 0);
-- #endif
-+ err = avformat_open_input(&ctx_, fileName, 0, 0);
- if (err < 0)
- return false;
-
-- #if LIBAVFORMAT_BUILD >= CALC_FFMPEG_VERSION(53, 6, 0)
-- err = avformat_find_stream_info(ctx_, 0);
-- #else
-- err = av_find_stream_info(ctx_);
-- #endif
-+ err = avformat_find_stream_info(ctx_, 0);
- if (err < 0)
- return false;
-
- for (unsigned int i = 0; i < ctx_->nb_streams; ++i)
- {
-- #if LIBAVFORMAT_BUILD > 4628
- AVCodecContext *enc = ctx_->streams[i]->codec;
-- #else
-- AVCodecContext *enc = &ctx_->streams[i]->codec;
-- #endif
-
- if (enc->codec_type == AVMEDIA_TYPE_VIDEO)
- {
-@@ -2220,11 +2000,7 @@ void InputMediaStream_FFMPEG::close()
- {
- if (ctx_)
- {
-- #if LIBAVFORMAT_BUILD >= CALC_FFMPEG_VERSION(53, 24, 2)
-- avformat_close_input(&ctx_);
-- #else
-- av_close_input_file(ctx_);
-- #endif
-+ avformat_close_input(&ctx_);
- }
-
- // free last packet if exist
diff --git a/debian/patches/optimize_i586.patch b/debian/patches/optimize_i586.patch
deleted file mode 100644
index c12759c..0000000
--- a/debian/patches/optimize_i586.patch
+++ /dev/null
@@ -1,22 +0,0 @@
-Description: Optimize of i386 changed from 686 to 586.
- Similar to the patch patches/0011_optimize_i486.patch in wheezy
- by Nobuhiro Iwamatsu.
- Upstream moved the location from CMakeLists.txt to cmake/OpenCVCompilerOptions.cmake.
-Author: Bernhard Übelacker <bernhardu at vr-web.de>
-Bug-Debian: https://bugs.debian.org/784647
-Origin: other, https://sources.debian.net/src/opencv/2.3.1-11%2Bdeb7u1/debian/patches/0011_optimize_i486.patch/
-Last-Update: 2016-01-07
-
-diff --git a/cmake/OpenCVCompilerOptions.cmake b/cmake/OpenCVCompilerOptions.cmake
-index 6c235eb..5ddf867 100644
---- a/cmake/OpenCVCompilerOptions.cmake
-+++ b/cmake/OpenCVCompilerOptions.cmake
-@@ -107,7 +107,7 @@ if(CMAKE_COMPILER_IS_GNUCXX)
- endif()
-
- if(X86 AND NOT MINGW64 AND NOT X86_64 AND NOT APPLE)
-- add_extra_compiler_option(-march=i686)
-+ add_extra_compiler_option(-march=i586)
- endif()
-
- if(APPLE)
diff --git a/debian/patches/pkg-config b/debian/patches/pkg-config
deleted file mode 100755
index 1384795..0000000
--- a/debian/patches/pkg-config
+++ /dev/null
@@ -1,50 +0,0 @@
-Description: pkg-config is broken in OpenCV-2.4.x
-Bug: http://code.opencv.org/issues/1925
-Bug-Debian: http://bugs.debian.org/721894, http://bugs.debian.org/678222
-Author: Ray Rashif
-Last-Update: 2013-11-23
-
-diff --git a/cmake/OpenCVGenPkgconfig.cmake b/cmake/OpenCVGenPkgconfig.cmake
-index a36b70e..a3733bc 100644
---- a/cmake/OpenCVGenPkgconfig.cmake
-+++ b/cmake/OpenCVGenPkgconfig.cmake
-@@ -10,7 +10,7 @@
- # -------------------------------------------------------------------------------------------
- set(prefix "${CMAKE_INSTALL_PREFIX}")
- set(exec_prefix "\${prefix}")
--set(libdir "") #TODO: need link paths for OpenCV_EXTRA_COMPONENTS
-+set(libdir "\${prefix}/${OPENCV_LIB_INSTALL_PATH}")
- set(includedir "\${prefix}/${OPENCV_INCLUDE_INSTALL_PATH}")
-
- if(CMAKE_BUILD_TYPE MATCHES "Release")
-@@ -35,10 +35,11 @@ ocv_list_reverse(OpenCV_LIB_COMPONENTS)
- ocv_list_reverse(OpenCV_EXTRA_COMPONENTS)
-
- #build the list of components
--set(OpenCV_LIB_COMPONENTS_ "")
-+set(OpenCV_LIB_COMPONENTS_ "-L\${libdir}")
- foreach(CVLib ${OpenCV_LIB_COMPONENTS})
- get_target_property(libpath ${CVLib} LOCATION_${CMAKE_BUILD_TYPE})
- get_filename_component(libname "${libpath}" NAME)
-+ get_filename_component(lname "${libpath}" NAME_WE)
-
- if(INSTALL_TO_MANGLED_PATHS)
- set(libname "${libname}.${OPENCV_VERSION}")
-@@ -52,6 +53,8 @@ foreach(CVLib ${OpenCV_LIB_COMPONENTS})
- endif()
-
- set(OpenCV_LIB_COMPONENTS_ "${OpenCV_LIB_COMPONENTS_} \${exec_prefix}/${installDir}/${libname}")
-+ string(REPLACE "libopencv" "-lopencv" lname "${lname}")
-+ set(OpenCV_LIB_COMPONENTS_ "${OpenCV_LIB_COMPONENTS_} ${lname}")
- endforeach()
-
- # add extra dependencies required for OpenCV
-@@ -67,6 +70,8 @@ if(OpenCV_EXTRA_COMPONENTS)
-
- set(OpenCV_LIB_COMPONENTS "${OpenCV_LIB_COMPONENTS} ${maybe_l_prefix}${extra_component}")
-
-+
-+
- endforeach()
- endif()
-
diff --git a/debian/patches/revert-Make-ts-always-static b/debian/patches/revert-Make-ts-always-static
deleted file mode 100644
index 3a2a59d..0000000
--- a/debian/patches/revert-Make-ts-always-static
+++ /dev/null
@@ -1,51 +0,0 @@
-Description: Revert commit 131458847bbf2fe971c6b5e40a8b59d0d48b0d0c
- This commit disable building shared library of TS.
-Author: Nobuhiro Iwamatsu <iwamatsu at debian.org>
-Forwarded: no
-Last-Update: <2014-01-14>
-
-diff --git a/modules/ts/include/opencv2/ts/ts.hpp b/modules/ts/include/opencv2/ts/ts.hpp
-index 8ea1ad9..3ac7db2 100644
---- a/modules/ts/include/opencv2/ts/ts.hpp
-+++ b/modules/ts/include/opencv2/ts/ts.hpp
-@@ -1,6 +1,13 @@
- #ifndef __OPENCV_GTESTCV_HPP__
- #define __OPENCV_GTESTCV_HPP__
-
-+#include "cvconfig.h"
-+#ifndef GTEST_CREATE_SHARED_LIBRARY
-+#ifdef BUILD_SHARED_LIBS
-+#define GTEST_LINKED_AS_SHARED_LIBRARY 1
-+#endif
-+#endif
-+
- #include <stdarg.h> // for va_list
-
- #ifdef HAVE_WINRT
-diff --git a/modules/ts/CMakeLists.txt b/modules/ts/CMakeLists.txt
-index bb56da2..38864a4 100644
---- a/modules/ts/CMakeLists.txt
-+++ b/modules/ts/CMakeLists.txt
-@@ -4,7 +4,10 @@ if(IOS)
- ocv_module_disable(ts)
- endif()
-
--set(OPENCV_MODULE_TYPE STATIC)
-+if(MINGW)
-+ set(OPENCV_MODULE_TYPE STATIC)
-+endif()
-+
- set(OPENCV_MODULE_IS_PART_OF_WORLD FALSE)
-
- ocv_warnings_disable(CMAKE_CXX_FLAGS -Wundef)
-@@ -15,4 +18,10 @@ ocv_glob_module_sources()
- ocv_module_include_directories()
- ocv_create_module()
-
-+if(BUILD_SHARED_LIBS AND NOT MINGW)
-+ add_definitions(-DGTEST_CREATE_SHARED_LIBRARY=1)
-+else()
-+ add_definitions(-DGTEST_CREATE_SHARED_LIBRARY=0)
-+endif()
-+
- ocv_add_precompiled_headers(${the_module})
diff --git a/debian/patches/series b/debian/patches/series
index 058e430..2162c9a 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,15 +1,6 @@
-# build-static-libs
-#drop_asm_types_h_kfreebsd
support_multiarch
#fix_ftbfs_on_non_linux
-# pkg-config
-#change_type_from_int_to_Atomic_word
-#revert-Make-ts-always-static
-#fix_path_of_opencl_headers
-#libav10.patch
-#optimize_i586.patch
support_x32
-# ffmpeg_2.9.patch
disable_opengl_test_build
mathjax
change_jquery.js_path
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/opencv.git
More information about the debian-science-commits
mailing list