merged all the latest changes from 2.4 to trunk
This commit is contained in:
parent
020f9a6047
commit
2fd1e2ea57
11
3rdparty/ffmpeg/ffmpeg_version.cmake
vendored
Normal file
11
3rdparty/ffmpeg/ffmpeg_version.cmake
vendored
Normal file
@ -0,0 +1,11 @@
|
||||
set(NEW_FFMPEG 1)
|
||||
set(HAVE_FFMPEG_CODEC 1)
|
||||
set(HAVE_FFMPEG_FORMAT 1)
|
||||
set(HAVE_FFMPEG_UTIL 1)
|
||||
set(HAVE_FFMPEG_SWSCALE 1)
|
||||
set(HAVE_GENTOO_FFMPEG 1)
|
||||
|
||||
set(ALIASOF_libavcodec_VERSION 53.61.100)
|
||||
set(ALIASOF_libavformat_VERSION 53.32.100)
|
||||
set(ALIASOF_libavutil_VERSION 51.35.100)
|
||||
set(ALIASOF_libswscale_VERSION 2.1.100)
|
2
3rdparty/ffmpeg/ffopencv.c
vendored
2
3rdparty/ffmpeg/ffopencv.c
vendored
@ -1 +1 @@
|
||||
#include "cap_ffmpeg_impl.hpp"
|
||||
#include "cap_ffmpeg_impl_v2.hpp"
|
||||
|
1522
3rdparty/include/ffmpeg_/libavcodec/avcodec.h
vendored
1522
3rdparty/include/ffmpeg_/libavcodec/avcodec.h
vendored
File diff suppressed because it is too large
Load Diff
3
3rdparty/include/ffmpeg_/libavcodec/dxva2.h
vendored
3
3rdparty/include/ffmpeg_/libavcodec/dxva2.h
vendored
@ -25,8 +25,11 @@
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include <d3d9.h>
|
||||
#include <dxva2api.h>
|
||||
|
||||
#define FF_DXVA2_WORKAROUND_SCALING_LIST_ZIGZAG 1 ///< Work around for DXVA2 and old UVD/UVD+ ATI video cards
|
||||
|
||||
/**
|
||||
* This structure is used to provides the necessary configurations and data
|
||||
* to the DXVA2 FFmpeg HWAccel implementation.
|
||||
|
4
3rdparty/include/ffmpeg_/libavcodec/vaapi.h
vendored
4
3rdparty/include/ffmpeg_/libavcodec/vaapi.h
vendored
@ -27,8 +27,8 @@
|
||||
#include <stdint.h>
|
||||
|
||||
/**
|
||||
* \defgroup VAAPI_Decoding VA API Decoding
|
||||
* \ingroup Decoder
|
||||
* @defgroup VAAPI_Decoding VA API Decoding
|
||||
* @ingroup Decoder
|
||||
* @{
|
||||
*/
|
||||
|
||||
|
168
3rdparty/include/ffmpeg_/libavcodec/vda.h
vendored
Normal file
168
3rdparty/include/ffmpeg_/libavcodec/vda.h
vendored
Normal file
@ -0,0 +1,168 @@
|
||||
/*
|
||||
* VDA HW acceleration
|
||||
*
|
||||
* copyright (c) 2011 Sebastien Zwickert
|
||||
*
|
||||
* This file is part of FFmpeg.
|
||||
*
|
||||
* FFmpeg is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* FFmpeg is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with FFmpeg; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#ifndef AVCODEC_VDA_H
|
||||
#define AVCODEC_VDA_H
|
||||
|
||||
#include <pthread.h>
|
||||
#include <stdint.h>
|
||||
|
||||
// emmintrin.h is unable to compile with -std=c99 -Werror=missing-prototypes
|
||||
// http://openradar.appspot.com/8026390
|
||||
#undef __GNUC_STDC_INLINE__
|
||||
|
||||
#define Picture QuickdrawPicture
|
||||
#include <VideoDecodeAcceleration/VDADecoder.h>
|
||||
#undef Picture
|
||||
|
||||
/**
|
||||
* This structure is used to store a decoded frame information and data.
|
||||
*/
|
||||
typedef struct {
|
||||
/**
|
||||
* The PTS of the frame.
|
||||
*
|
||||
* - encoding: unused
|
||||
* - decoding: Set/Unset by libavcodec.
|
||||
*/
|
||||
int64_t pts;
|
||||
|
||||
/**
|
||||
* The CoreVideo buffer that contains the decoded data.
|
||||
*
|
||||
* - encoding: unused
|
||||
* - decoding: Set/Unset by libavcodec.
|
||||
*/
|
||||
CVPixelBufferRef cv_buffer;
|
||||
|
||||
/**
|
||||
* A pointer to the next frame.
|
||||
*
|
||||
* - encoding: unused
|
||||
* - decoding: Set/Unset by libavcodec.
|
||||
*/
|
||||
struct vda_frame *next_frame;
|
||||
} vda_frame;
|
||||
|
||||
/**
|
||||
* This structure is used to provide the necessary configurations and data
|
||||
* to the VDA FFmpeg HWAccel implementation.
|
||||
*
|
||||
* The application must make it available as AVCodecContext.hwaccel_context.
|
||||
*/
|
||||
struct vda_context {
|
||||
/**
|
||||
* VDA decoder object.
|
||||
*
|
||||
* - encoding: unused
|
||||
* - decoding: Set/Unset by libavcodec.
|
||||
*/
|
||||
VDADecoder decoder;
|
||||
|
||||
/**
|
||||
* VDA frames queue ordered by presentation timestamp.
|
||||
*
|
||||
* - encoding: unused
|
||||
* - decoding: Set/Unset by libavcodec.
|
||||
*/
|
||||
vda_frame *queue;
|
||||
|
||||
/**
|
||||
* Mutex for locking queue operations.
|
||||
*
|
||||
* - encoding: unused
|
||||
* - decoding: Set/Unset by libavcodec.
|
||||
*/
|
||||
pthread_mutex_t queue_mutex;
|
||||
|
||||
/**
|
||||
* The frame width.
|
||||
*
|
||||
* - encoding: unused
|
||||
* - decoding: Set/Unset by user.
|
||||
*/
|
||||
int width;
|
||||
|
||||
/**
|
||||
* The frame height.
|
||||
*
|
||||
* - encoding: unused
|
||||
* - decoding: Set/Unset by user.
|
||||
*/
|
||||
int height;
|
||||
|
||||
/**
|
||||
* The frame format.
|
||||
*
|
||||
* - encoding: unused
|
||||
* - decoding: Set/Unset by user.
|
||||
*/
|
||||
int format;
|
||||
|
||||
/**
|
||||
* The pixel format for output image buffers.
|
||||
*
|
||||
* - encoding: unused
|
||||
* - decoding: Set/Unset by user.
|
||||
*/
|
||||
OSType cv_pix_fmt_type;
|
||||
|
||||
/**
|
||||
* The current bitstream buffer.
|
||||
*
|
||||
* - encoding: unused
|
||||
* - decoding: Set/Unset by libavcodec.
|
||||
*/
|
||||
uint8_t *bitstream;
|
||||
|
||||
/**
|
||||
* The current size of the bitstream.
|
||||
*
|
||||
* - encoding: unused
|
||||
* - decoding: Set/Unset by libavcodec.
|
||||
*/
|
||||
int bitstream_size;
|
||||
|
||||
/**
|
||||
* The reference size used for fast reallocation.
|
||||
*
|
||||
* - encoding: unused
|
||||
* - decoding: Set/Unset by libavcodec.
|
||||
*/
|
||||
int ref_size;
|
||||
};
|
||||
|
||||
/** Create the video decoder. */
|
||||
int ff_vda_create_decoder(struct vda_context *vda_ctx,
|
||||
uint8_t *extradata,
|
||||
int extradata_size);
|
||||
|
||||
/** Destroy the video decoder. */
|
||||
int ff_vda_destroy_decoder(struct vda_context *vda_ctx);
|
||||
|
||||
/** Return the top frame of the queue. */
|
||||
vda_frame *ff_vda_queue_pop(struct vda_context *vda_ctx);
|
||||
|
||||
/** Release the given frame. */
|
||||
void ff_vda_release_vda_frame(vda_frame *frame);
|
||||
|
||||
#endif /* AVCODEC_VDA_H */
|
12
3rdparty/include/ffmpeg_/libavcodec/vdpau.h
vendored
12
3rdparty/include/ffmpeg_/libavcodec/vdpau.h
vendored
@ -25,7 +25,7 @@
|
||||
#define AVCODEC_VDPAU_H
|
||||
|
||||
/**
|
||||
* \defgroup Decoder VDPAU Decoder and Renderer
|
||||
* @defgroup Decoder VDPAU Decoder and Renderer
|
||||
*
|
||||
* VDPAU hardware acceleration has two modules
|
||||
* - VDPAU decoding
|
||||
@ -38,25 +38,25 @@
|
||||
* and rendering (API calls) are done as part of the VDPAU
|
||||
* presentation (vo_vdpau.c) module.
|
||||
*
|
||||
* \defgroup VDPAU_Decoding VDPAU Decoding
|
||||
* \ingroup Decoder
|
||||
* @defgroup VDPAU_Decoding VDPAU Decoding
|
||||
* @ingroup Decoder
|
||||
* @{
|
||||
*/
|
||||
|
||||
#include <vdpau/vdpau.h>
|
||||
#include <vdpau/vdpau_x11.h>
|
||||
|
||||
/** \brief The videoSurface is used for rendering. */
|
||||
/** @brief The videoSurface is used for rendering. */
|
||||
#define FF_VDPAU_STATE_USED_FOR_RENDER 1
|
||||
|
||||
/**
|
||||
* \brief The videoSurface is needed for reference/prediction.
|
||||
* @brief The videoSurface is needed for reference/prediction.
|
||||
* The codec manipulates this.
|
||||
*/
|
||||
#define FF_VDPAU_STATE_USED_FOR_REFERENCE 2
|
||||
|
||||
/**
|
||||
* \brief This structure is used as a callback between the FFmpeg
|
||||
* @brief This structure is used as a callback between the FFmpeg
|
||||
* decoder (vd_) and presentation (vo_) module.
|
||||
* This is used for defining a video frame containing surface,
|
||||
* picture parameter, bitstream information etc which are passed
|
||||
|
64
3rdparty/include/ffmpeg_/libavcodec/version.h
vendored
64
3rdparty/include/ffmpeg_/libavcodec/version.h
vendored
@ -21,8 +21,8 @@
|
||||
#define AVCODEC_VERSION_H
|
||||
|
||||
#define LIBAVCODEC_VERSION_MAJOR 53
|
||||
#define LIBAVCODEC_VERSION_MINOR 7
|
||||
#define LIBAVCODEC_VERSION_MICRO 0
|
||||
#define LIBAVCODEC_VERSION_MINOR 61
|
||||
#define LIBAVCODEC_VERSION_MICRO 100
|
||||
|
||||
#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
|
||||
LIBAVCODEC_VERSION_MINOR, \
|
||||
@ -51,7 +51,7 @@
|
||||
#define FF_API_ANTIALIAS_ALGO (LIBAVCODEC_VERSION_MAJOR < 54)
|
||||
#endif
|
||||
#ifndef FF_API_REQUEST_CHANNELS
|
||||
#define FF_API_REQUEST_CHANNELS (LIBAVCODEC_VERSION_MAJOR < 54)
|
||||
#define FF_API_REQUEST_CHANNELS (LIBAVCODEC_VERSION_MAJOR < 55)
|
||||
#endif
|
||||
#ifndef FF_API_OPT_H
|
||||
#define FF_API_OPT_H (LIBAVCODEC_VERSION_MAJOR < 54)
|
||||
@ -68,5 +68,63 @@
|
||||
#ifndef FF_API_GET_PIX_FMT_NAME
|
||||
#define FF_API_GET_PIX_FMT_NAME (LIBAVCODEC_VERSION_MAJOR < 54)
|
||||
#endif
|
||||
#ifndef FF_API_ALLOC_CONTEXT
|
||||
#define FF_API_ALLOC_CONTEXT (LIBAVCODEC_VERSION_MAJOR < 54)
|
||||
#endif
|
||||
#ifndef FF_API_AVCODEC_OPEN
|
||||
#define FF_API_AVCODEC_OPEN (LIBAVCODEC_VERSION_MAJOR < 54)
|
||||
#endif
|
||||
#ifndef FF_API_DRC_SCALE
|
||||
#define FF_API_DRC_SCALE (LIBAVCODEC_VERSION_MAJOR < 54)
|
||||
#endif
|
||||
#ifndef FF_API_ER
|
||||
#define FF_API_ER (LIBAVCODEC_VERSION_MAJOR < 54)
|
||||
#endif
|
||||
#ifndef FF_API_AVCODEC_INIT
|
||||
#define FF_API_AVCODEC_INIT (LIBAVCODEC_VERSION_MAJOR < 54)
|
||||
#endif
|
||||
#ifndef FF_API_X264_GLOBAL_OPTS
|
||||
#define FF_API_X264_GLOBAL_OPTS (LIBAVCODEC_VERSION_MAJOR < 54)
|
||||
#endif
|
||||
#ifndef FF_API_MPEGVIDEO_GLOBAL_OPTS
|
||||
#define FF_API_MPEGVIDEO_GLOBAL_OPTS (LIBAVCODEC_VERSION_MAJOR < 54)
|
||||
#endif
|
||||
#ifndef FF_API_LAME_GLOBAL_OPTS
|
||||
#define FF_API_LAME_GLOBAL_OPTS (LIBAVCODEC_VERSION_MAJOR < 54)
|
||||
#endif
|
||||
#ifndef FF_API_SNOW_GLOBAL_OPTS
|
||||
#define FF_API_SNOW_GLOBAL_OPTS (LIBAVCODEC_VERSION_MAJOR < 54)
|
||||
#endif
|
||||
#ifndef FF_API_MJPEG_GLOBAL_OPTS
|
||||
#define FF_API_MJPEG_GLOBAL_OPTS (LIBAVCODEC_VERSION_MAJOR < 54)
|
||||
#endif
|
||||
#ifndef FF_API_GET_ALPHA_INFO
|
||||
#define FF_API_GET_ALPHA_INFO (LIBAVCODEC_VERSION_MAJOR < 54)
|
||||
#endif
|
||||
#ifndef FF_API_PARSE_FRAME
|
||||
#define FF_API_PARSE_FRAME (LIBAVCODEC_VERSION_MAJOR < 54)
|
||||
#endif
|
||||
#ifndef FF_API_INTERNAL_CONTEXT
|
||||
#define FF_API_INTERNAL_CONTEXT (LIBAVCODEC_VERSION_MAJOR < 54)
|
||||
#endif
|
||||
#ifndef FF_API_TIFFENC_COMPLEVEL
|
||||
#define FF_API_TIFFENC_COMPLEVEL (LIBAVCODEC_VERSION_MAJOR < 54)
|
||||
#endif
|
||||
#ifndef FF_API_DATA_POINTERS
|
||||
#define FF_API_DATA_POINTERS (LIBAVCODEC_VERSION_MAJOR < 54)
|
||||
#endif
|
||||
#ifndef FF_API_OLD_DECODE_AUDIO
|
||||
#define FF_API_OLD_DECODE_AUDIO (LIBAVCODEC_VERSION_MAJOR < 55)
|
||||
#endif
|
||||
#ifndef FF_API_OLD_TIMECODE
|
||||
#define FF_API_OLD_TIMECODE (LIBAVCODEC_VERSION_MAJOR < 54)
|
||||
#endif
|
||||
|
||||
#ifndef FF_API_AVFRAME_AGE
|
||||
#define FF_API_AVFRAME_AGE (LIBAVCODEC_VERSION_MAJOR < 54)
|
||||
#endif
|
||||
#ifndef FF_API_OLD_ENCODE_AUDIO
|
||||
#define FF_API_OLD_ENCODE_AUDIO (LIBAVCODEC_VERSION_MAJOR < 55)
|
||||
#endif
|
||||
|
||||
#endif /* AVCODEC_VERSION_H */
|
||||
|
30
3rdparty/include/ffmpeg_/libavdevice/avdevice.h
vendored
30
3rdparty/include/ffmpeg_/libavdevice/avdevice.h
vendored
@ -19,12 +19,34 @@
|
||||
#ifndef AVDEVICE_AVDEVICE_H
|
||||
#define AVDEVICE_AVDEVICE_H
|
||||
|
||||
/**
|
||||
* @file
|
||||
* @ingroup lavd
|
||||
* Main libavdevice API header
|
||||
*/
|
||||
|
||||
/**
|
||||
* @defgroup lavd Special devices muxing/demuxing library
|
||||
* @{
|
||||
* Libavdevice is a complementary library to @ref libavf "libavformat". It
|
||||
* provides various "special" platform-specific muxers and demuxers, e.g. for
|
||||
* grabbing devices, audio capture and playback etc. As a consequence, the
|
||||
* (de)muxers in libavdevice are of the AVFMT_NOFILE type (they use their own
|
||||
* I/O functions). The filename passed to avformat_open_input() often does not
|
||||
* refer to an actually existing file, but has some special device-specific
|
||||
* meaning - e.g. for the x11grab device it is the display name.
|
||||
*
|
||||
* To use libavdevice, simply call avdevice_register_all() to register all
|
||||
* compiled muxers and demuxers. They all use standard libavformat API.
|
||||
* @}
|
||||
*/
|
||||
|
||||
#include "libavutil/avutil.h"
|
||||
#include "libavformat/avformat.h"
|
||||
|
||||
#define LIBAVDEVICE_VERSION_MAJOR 53
|
||||
#define LIBAVDEVICE_VERSION_MINOR 1
|
||||
#define LIBAVDEVICE_VERSION_MICRO 1
|
||||
#define LIBAVDEVICE_VERSION_MINOR 4
|
||||
#define LIBAVDEVICE_VERSION_MICRO 100
|
||||
|
||||
#define LIBAVDEVICE_VERSION_INT AV_VERSION_INT(LIBAVDEVICE_VERSION_MAJOR, \
|
||||
LIBAVDEVICE_VERSION_MINOR, \
|
||||
@ -34,10 +56,6 @@
|
||||
LIBAVDEVICE_VERSION_MICRO)
|
||||
#define LIBAVDEVICE_BUILD LIBAVDEVICE_VERSION_INT
|
||||
|
||||
#ifndef FF_API_V4L
|
||||
#define FF_API_V4L (LIBAVDEVICE_VERSION_MAJOR < 54)
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Return the LIBAVDEVICE_VERSION_INT constant.
|
||||
*/
|
||||
|
1102
3rdparty/include/ffmpeg_/libavformat/avformat.h
vendored
1102
3rdparty/include/ffmpeg_/libavformat/avformat.h
vendored
File diff suppressed because it is too large
Load Diff
88
3rdparty/include/ffmpeg_/libavformat/avio.h
vendored
88
3rdparty/include/ffmpeg_/libavformat/avio.h
vendored
@ -22,12 +22,14 @@
|
||||
|
||||
/**
|
||||
* @file
|
||||
* @ingroup lavf_io
|
||||
* Buffered I/O operations
|
||||
*/
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include "libavutil/common.h"
|
||||
#include "libavutil/dict.h"
|
||||
#include "libavutil/log.h"
|
||||
|
||||
#include "libavformat/version.h"
|
||||
@ -35,6 +37,22 @@
|
||||
|
||||
#define AVIO_SEEKABLE_NORMAL 0x0001 /**< Seeking works like for a local file */
|
||||
|
||||
/**
|
||||
* Callback for checking whether to abort blocking functions.
|
||||
* AVERROR_EXIT is returned in this case by the interrupted
|
||||
* function. During blocking operations, callback is called with
|
||||
* opaque as parameter. If the callback returns 1, the
|
||||
* blocking operation will be aborted.
|
||||
*
|
||||
* No members can be added to this struct without a major bump, if
|
||||
* new elements have been added after this struct in AVFormatContext
|
||||
* or AVIOContext.
|
||||
*/
|
||||
typedef struct {
|
||||
int (*callback)(void*);
|
||||
void *opaque;
|
||||
} AVIOInterruptCB;
|
||||
|
||||
/**
|
||||
* Bytestream IO Context.
|
||||
* New fields can be added to the end with minor version bumps.
|
||||
@ -48,6 +66,21 @@
|
||||
* function pointers specified in avio_alloc_context()
|
||||
*/
|
||||
typedef struct {
|
||||
#if !FF_API_OLD_AVIO
|
||||
/**
|
||||
* A class for private options.
|
||||
*
|
||||
* If this AVIOContext is created by avio_open2(), av_class is set and
|
||||
* passes the options down to protocols.
|
||||
*
|
||||
* If this AVIOContext is manually allocated, then av_class may be set by
|
||||
* the caller.
|
||||
*
|
||||
* warning -- this field can be NULL, be sure to not pass this AVIOContext
|
||||
* to any av_opt_* functions in that case.
|
||||
*/
|
||||
AVClass *av_class;
|
||||
#endif
|
||||
unsigned char *buffer; /**< Start of the buffer. */
|
||||
int buffer_size; /**< Maximum buffer size */
|
||||
unsigned char *buf_ptr; /**< Current position in the buffer */
|
||||
@ -87,6 +120,12 @@ typedef struct {
|
||||
* A combination of AVIO_SEEKABLE_ flags or 0 when the stream is not seekable.
|
||||
*/
|
||||
int seekable;
|
||||
|
||||
/**
|
||||
* max filesize, used to limit allocations
|
||||
* This field is internal to libavformat and access from outside is not allowed.
|
||||
*/
|
||||
int64_t maxsize;
|
||||
} AVIOContext;
|
||||
|
||||
/* unbuffered I/O */
|
||||
@ -109,9 +148,11 @@ typedef struct URLContext {
|
||||
void *priv_data;
|
||||
char *filename; /**< specified URL */
|
||||
int is_connected;
|
||||
AVIOInterruptCB interrupt_callback;
|
||||
} URLContext;
|
||||
|
||||
#define URL_PROTOCOL_FLAG_NESTED_SCHEME 1 /*< The protocol name can be the first part of a nested protocol scheme */
|
||||
#define URL_PROTOCOL_FLAG_NETWORK 2 /*< The protocol uses network */
|
||||
|
||||
/**
|
||||
* @deprecated This struct is to be made private. Use the higher-level
|
||||
@ -169,7 +210,7 @@ attribute_deprecated int url_poll(URLPollEntry *poll_table, int n, int timeout);
|
||||
* Warning: non-blocking protocols is work-in-progress; this flag may be
|
||||
* silently ignored.
|
||||
*/
|
||||
#define URL_FLAG_NONBLOCK 4
|
||||
#define URL_FLAG_NONBLOCK 8
|
||||
|
||||
typedef int URLInterruptCB(void);
|
||||
extern URLInterruptCB *url_interrupt_cb;
|
||||
@ -178,6 +219,7 @@ extern URLInterruptCB *url_interrupt_cb;
|
||||
* @defgroup old_url_funcs Old url_* functions
|
||||
* The following functions are deprecated. Use the buffered API based on #AVIOContext instead.
|
||||
* @{
|
||||
* @ingroup lavf_io
|
||||
*/
|
||||
attribute_deprecated int url_open_protocol (URLContext **puc, struct URLProtocol *up,
|
||||
const char *url, int flags);
|
||||
@ -238,6 +280,7 @@ attribute_deprecated AVIOContext *av_alloc_put_byte(
|
||||
* @defgroup old_avio_funcs Old put_/get_*() functions
|
||||
* The following functions are deprecated. Use the "avio_"-prefixed functions instead.
|
||||
* @{
|
||||
* @ingroup lavf_io
|
||||
*/
|
||||
attribute_deprecated int get_buffer(AVIOContext *s, unsigned char *buf, int size);
|
||||
attribute_deprecated int get_partial_buffer(AVIOContext *s, unsigned char *buf, int size);
|
||||
@ -275,6 +318,7 @@ attribute_deprecated int64_t av_url_read_fseek (AVIOContext *h, int stream_in
|
||||
* @defgroup old_url_f_funcs Old url_f* functions
|
||||
* The following functions are deprecated, use the "avio_"-prefixed functions instead.
|
||||
* @{
|
||||
* @ingroup lavf_io
|
||||
*/
|
||||
attribute_deprecated int url_fopen( AVIOContext **s, const char *url, int flags);
|
||||
attribute_deprecated int url_fclose(AVIOContext *s);
|
||||
@ -285,11 +329,7 @@ attribute_deprecated int64_t url_fsize(AVIOContext *s);
|
||||
#define URL_EOF (-1)
|
||||
attribute_deprecated int url_fgetc(AVIOContext *s);
|
||||
attribute_deprecated int url_setbufsize(AVIOContext *s, int buf_size);
|
||||
#ifdef __GNUC__
|
||||
attribute_deprecated int url_fprintf(AVIOContext *s, const char *fmt, ...) __attribute__ ((__format__ (__printf__, 2, 3)));
|
||||
#else
|
||||
attribute_deprecated int url_fprintf(AVIOContext *s, const char *fmt, ...);
|
||||
#endif
|
||||
attribute_deprecated int url_fprintf(AVIOContext *s, const char *fmt, ...) av_printf_format(2, 3);
|
||||
attribute_deprecated void put_flush_packet(AVIOContext *s);
|
||||
attribute_deprecated int url_open_dyn_buf(AVIOContext **s);
|
||||
attribute_deprecated int url_open_dyn_packet_buf(AVIOContext **s, int max_packet_size);
|
||||
@ -357,13 +397,17 @@ attribute_deprecated int url_exist(const char *url);
|
||||
*/
|
||||
int avio_check(const char *url, int flags);
|
||||
|
||||
#if FF_API_OLD_INTERRUPT_CB
|
||||
/**
|
||||
* The callback is called in blocking functions to test regulary if
|
||||
* asynchronous interruption is needed. AVERROR_EXIT is returned
|
||||
* in this case by the interrupted function. 'NULL' means no interrupt
|
||||
* callback is given.
|
||||
* @deprecated Use interrupt_callback in AVFormatContext/avio_open2
|
||||
* instead.
|
||||
*/
|
||||
void avio_set_interrupt_cb(int (*interrupt_cb)(void));
|
||||
attribute_deprecated void avio_set_interrupt_cb(int (*interrupt_cb)(void));
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Allocate and initialize an AVIOContext for buffered I/O. It must be later
|
||||
@ -463,11 +507,7 @@ int64_t avio_size(AVIOContext *s);
|
||||
int url_feof(AVIOContext *s);
|
||||
|
||||
/** @warning currently size is limited */
|
||||
#ifdef __GNUC__
|
||||
int avio_printf(AVIOContext *s, const char *fmt, ...) __attribute__ ((__format__ (__printf__, 2, 3)));
|
||||
#else
|
||||
int avio_printf(AVIOContext *s, const char *fmt, ...);
|
||||
#endif
|
||||
int avio_printf(AVIOContext *s, const char *fmt, ...) av_printf_format(2, 3);
|
||||
|
||||
void avio_flush(AVIOContext *s);
|
||||
|
||||
@ -564,6 +604,26 @@ int avio_get_str16be(AVIOContext *pb, int maxlen, char *buf, int buflen);
|
||||
*/
|
||||
int avio_open(AVIOContext **s, const char *url, int flags);
|
||||
|
||||
/**
|
||||
* Create and initialize a AVIOContext for accessing the
|
||||
* resource indicated by url.
|
||||
* @note When the resource indicated by url has been opened in
|
||||
* read+write mode, the AVIOContext can be used only for writing.
|
||||
*
|
||||
* @param s Used to return the pointer to the created AVIOContext.
|
||||
* In case of failure the pointed to value is set to NULL.
|
||||
* @param flags flags which control how the resource indicated by url
|
||||
* is to be opened
|
||||
* @param int_cb an interrupt callback to be used at the protocols level
|
||||
* @param options A dictionary filled with protocol-private options. On return
|
||||
* this parameter will be destroyed and replaced with a dict containing options
|
||||
* that were not found. May be NULL.
|
||||
* @return 0 in case of success, a negative value corresponding to an
|
||||
* AVERROR code in case of failure
|
||||
*/
|
||||
int avio_open2(AVIOContext **s, const char *url, int flags,
|
||||
const AVIOInterruptCB *int_cb, AVDictionary **options);
|
||||
|
||||
/**
|
||||
* Close the resource accessed by the AVIOContext s and free it.
|
||||
* This function can only be used if s was opened by avio_open().
|
||||
@ -619,13 +679,13 @@ int avio_pause(AVIOContext *h, int pause);
|
||||
* If stream_index is (-1) the timestamp should be in AV_TIME_BASE
|
||||
* units from the beginning of the presentation.
|
||||
* If a stream_index >= 0 is used and the protocol does not support
|
||||
* seeking based on component streams, the call will fail with ENOTSUP.
|
||||
* seeking based on component streams, the call will fail.
|
||||
* @param timestamp timestamp in AVStream.time_base units
|
||||
* or if there is no stream specified then in AV_TIME_BASE units.
|
||||
* @param flags Optional combination of AVSEEK_FLAG_BACKWARD, AVSEEK_FLAG_BYTE
|
||||
* and AVSEEK_FLAG_ANY. The protocol may silently ignore
|
||||
* AVSEEK_FLAG_BACKWARD and AVSEEK_FLAG_ANY, but AVSEEK_FLAG_BYTE will
|
||||
* fail with ENOTSUP if used and not supported.
|
||||
* fail if used and not supported.
|
||||
* @return >= 0 on success
|
||||
* @see AVInputFormat::read_seek
|
||||
*/
|
||||
|
58
3rdparty/include/ffmpeg_/libavformat/version.h
vendored
58
3rdparty/include/ffmpeg_/libavformat/version.h
vendored
@ -21,11 +21,17 @@
|
||||
#ifndef AVFORMAT_VERSION_H
|
||||
#define AVFORMAT_VERSION_H
|
||||
|
||||
/**
|
||||
* @file
|
||||
* @ingroup libavf
|
||||
* Libavformat version macros
|
||||
*/
|
||||
|
||||
#include "libavutil/avutil.h"
|
||||
|
||||
#define LIBAVFORMAT_VERSION_MAJOR 53
|
||||
#define LIBAVFORMAT_VERSION_MINOR 4
|
||||
#define LIBAVFORMAT_VERSION_MICRO 0
|
||||
#define LIBAVFORMAT_VERSION_MINOR 32
|
||||
#define LIBAVFORMAT_VERSION_MICRO 100
|
||||
|
||||
#define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
|
||||
LIBAVFORMAT_VERSION_MINOR, \
|
||||
@ -44,9 +50,6 @@
|
||||
#ifndef FF_API_OLD_METADATA2
|
||||
#define FF_API_OLD_METADATA2 (LIBAVFORMAT_VERSION_MAJOR < 54)
|
||||
#endif
|
||||
#ifndef FF_API_READ_SEEK
|
||||
#define FF_API_READ_SEEK (LIBAVFORMAT_VERSION_MAJOR < 54)
|
||||
#endif
|
||||
#ifndef FF_API_OLD_AVIO
|
||||
#define FF_API_OLD_AVIO (LIBAVFORMAT_VERSION_MAJOR < 54)
|
||||
#endif
|
||||
@ -77,5 +80,50 @@
|
||||
#ifndef FF_API_FLAG_RTP_HINT
|
||||
#define FF_API_FLAG_RTP_HINT (LIBAVFORMAT_VERSION_MAJOR < 54)
|
||||
#endif
|
||||
#ifndef FF_API_AVSTREAM_QUALITY
|
||||
#define FF_API_AVSTREAM_QUALITY (LIBAVFORMAT_VERSION_MAJOR < 54)
|
||||
#endif
|
||||
#ifndef FF_API_LOOP_INPUT
|
||||
#define FF_API_LOOP_INPUT (LIBAVFORMAT_VERSION_MAJOR < 54)
|
||||
#endif
|
||||
#ifndef FF_API_LOOP_OUTPUT
|
||||
#define FF_API_LOOP_OUTPUT (LIBAVFORMAT_VERSION_MAJOR < 54)
|
||||
#endif
|
||||
#ifndef FF_API_TIMESTAMP
|
||||
#define FF_API_TIMESTAMP (LIBAVFORMAT_VERSION_MAJOR < 54)
|
||||
#endif
|
||||
#ifndef FF_API_FILESIZE
|
||||
#define FF_API_FILESIZE (LIBAVFORMAT_VERSION_MAJOR < 54)
|
||||
#endif
|
||||
#ifndef FF_API_MUXRATE
|
||||
#define FF_API_MUXRATE (LIBAVFORMAT_VERSION_MAJOR < 54)
|
||||
#endif
|
||||
#ifndef FF_API_RTSP_URL_OPTIONS
|
||||
#define FF_API_RTSP_URL_OPTIONS (LIBAVFORMAT_VERSION_MAJOR < 54)
|
||||
#endif
|
||||
#ifndef FF_API_NEW_STREAM
|
||||
#define FF_API_NEW_STREAM (LIBAVFORMAT_VERSION_MAJOR < 54)
|
||||
#endif
|
||||
#ifndef FF_API_PRELOAD
|
||||
#define FF_API_PRELOAD (LIBAVFORMAT_VERSION_MAJOR < 54)
|
||||
#endif
|
||||
#ifndef FF_API_STREAM_COPY
|
||||
#define FF_API_STREAM_COPY (LIBAVFORMAT_VERSION_MAJOR < 54)
|
||||
#endif
|
||||
#ifndef FF_API_SEEK_PUBLIC
|
||||
#define FF_API_SEEK_PUBLIC (LIBAVFORMAT_VERSION_MAJOR < 54)
|
||||
#endif
|
||||
#ifndef FF_API_REORDER_PRIVATE
|
||||
#define FF_API_REORDER_PRIVATE (LIBAVFORMAT_VERSION_MAJOR < 54)
|
||||
#endif
|
||||
#ifndef FF_API_OLD_INTERRUPT_CB
|
||||
#define FF_API_OLD_INTERRUPT_CB (LIBAVFORMAT_VERSION_MAJOR < 54)
|
||||
#endif
|
||||
#ifndef FF_API_SET_PTS_INFO
|
||||
#define FF_API_SET_PTS_INFO (LIBAVFORMAT_VERSION_MAJOR < 54)
|
||||
#endif
|
||||
#ifndef FF_API_CLOSE_INPUT_FILE
|
||||
#define FF_API_CLOSE_INPUT_FILE (LIBAVFORMAT_VERSION_MAJOR < 55)
|
||||
#endif
|
||||
|
||||
#endif /* AVFORMAT_VERSION_H */
|
||||
|
1
3rdparty/include/ffmpeg_/libavutil/adler32.h
vendored
1
3rdparty/include/ffmpeg_/libavutil/adler32.h
vendored
@ -25,6 +25,7 @@
|
||||
#include "attributes.h"
|
||||
|
||||
/**
|
||||
* @ingroup lavu_crypto
|
||||
* Calculate the Adler32 checksum of a buffer.
|
||||
*
|
||||
* Passing the return value to a subsequent av_adler32_update() call
|
||||
|
10
3rdparty/include/ffmpeg_/libavutil/aes.h
vendored
10
3rdparty/include/ffmpeg_/libavutil/aes.h
vendored
@ -23,6 +23,12 @@
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
/**
|
||||
* @defgroup lavu_aes AES
|
||||
* @ingroup lavu_crypto
|
||||
* @{
|
||||
*/
|
||||
|
||||
extern const int av_aes_size;
|
||||
|
||||
struct AVAES;
|
||||
@ -44,4 +50,8 @@ int av_aes_init(struct AVAES *a, const uint8_t *key, int key_bits, int decrypt);
|
||||
*/
|
||||
void av_aes_crypt(struct AVAES *a, uint8_t *dst, const uint8_t *src, int count, uint8_t *iv, int decrypt);
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#endif /* AVUTIL_AES_H */
|
||||
|
28
3rdparty/include/ffmpeg_/libavutil/attributes.h
vendored
28
3rdparty/include/ffmpeg_/libavutil/attributes.h
vendored
@ -40,6 +40,14 @@
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef av_noreturn
|
||||
#if AV_GCC_VERSION_AT_LEAST(2,5)
|
||||
# define av_noreturn __attribute__((noreturn))
|
||||
#else
|
||||
# define av_noreturn
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef av_noinline
|
||||
#if AV_GCC_VERSION_AT_LEAST(3,1)
|
||||
# define av_noinline __attribute__((noinline))
|
||||
@ -88,6 +96,24 @@
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Disable warnings about deprecated features
|
||||
* This is useful for sections of code kept for backward compatibility and
|
||||
* scheduled for removal.
|
||||
*/
|
||||
#ifndef AV_NOWARN_DEPRECATED
|
||||
#if AV_GCC_VERSION_AT_LEAST(4,6)
|
||||
# define AV_NOWARN_DEPRECATED(code) \
|
||||
_Pragma("GCC diagnostic push") \
|
||||
_Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"") \
|
||||
code \
|
||||
_Pragma("GCC diagnostic pop")
|
||||
#else
|
||||
# define AV_NOWARN_DEPRECATED(code) code
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef av_unused
|
||||
#if defined(__GNUC__)
|
||||
# define av_unused __attribute__((unused))
|
||||
@ -127,8 +153,10 @@
|
||||
|
||||
#ifdef __GNUC__
|
||||
# define av_builtin_constant_p __builtin_constant_p
|
||||
# define av_printf_format(fmtpos, attrpos) __attribute__((__format__(__printf__, fmtpos, attrpos)))
|
||||
#else
|
||||
# define av_builtin_constant_p(x) 0
|
||||
# define av_printf_format(fmtpos, attrpos)
|
||||
#endif
|
||||
|
||||
#endif /* AVUTIL_ATTRIBUTES_H */
|
||||
|
@ -29,7 +29,15 @@
|
||||
* audio conversion routines
|
||||
*/
|
||||
|
||||
/* Audio channel masks */
|
||||
/**
|
||||
* @addtogroup lavu_audio
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @defgroup channel_masks Audio channel masks
|
||||
* @{
|
||||
*/
|
||||
#define AV_CH_FRONT_LEFT 0x00000001
|
||||
#define AV_CH_FRONT_RIGHT 0x00000002
|
||||
#define AV_CH_FRONT_CENTER 0x00000004
|
||||
@ -50,33 +58,68 @@
|
||||
#define AV_CH_TOP_BACK_RIGHT 0x00020000
|
||||
#define AV_CH_STEREO_LEFT 0x20000000 ///< Stereo downmix.
|
||||
#define AV_CH_STEREO_RIGHT 0x40000000 ///< See AV_CH_STEREO_LEFT.
|
||||
#define AV_CH_WIDE_LEFT 0x0000000080000000ULL
|
||||
#define AV_CH_WIDE_RIGHT 0x0000000100000000ULL
|
||||
#define AV_CH_SURROUND_DIRECT_LEFT 0x0000000200000000ULL
|
||||
#define AV_CH_SURROUND_DIRECT_RIGHT 0x0000000400000000ULL
|
||||
|
||||
/** Channel mask value used for AVCodecContext.request_channel_layout
|
||||
to indicate that the user requests the channel order of the decoder output
|
||||
to be the native codec channel order. */
|
||||
#define AV_CH_LAYOUT_NATIVE 0x8000000000000000LL
|
||||
#define AV_CH_LAYOUT_NATIVE 0x8000000000000000ULL
|
||||
|
||||
/* Audio channel convenience macros */
|
||||
/**
|
||||
* @}
|
||||
* @defgroup channel_mask_c Audio channel convenience macros
|
||||
* @{
|
||||
* */
|
||||
#define AV_CH_LAYOUT_MONO (AV_CH_FRONT_CENTER)
|
||||
#define AV_CH_LAYOUT_STEREO (AV_CH_FRONT_LEFT|AV_CH_FRONT_RIGHT)
|
||||
#define AV_CH_LAYOUT_2POINT1 (AV_CH_LAYOUT_STEREO|AV_CH_LOW_FREQUENCY)
|
||||
#define AV_CH_LAYOUT_2_1 (AV_CH_LAYOUT_STEREO|AV_CH_BACK_CENTER)
|
||||
#define AV_CH_LAYOUT_SURROUND (AV_CH_LAYOUT_STEREO|AV_CH_FRONT_CENTER)
|
||||
#define AV_CH_LAYOUT_3POINT1 (AV_CH_LAYOUT_SURROUND|AV_CH_LOW_FREQUENCY)
|
||||
#define AV_CH_LAYOUT_4POINT0 (AV_CH_LAYOUT_SURROUND|AV_CH_BACK_CENTER)
|
||||
#define AV_CH_LAYOUT_4POINT1 (AV_CH_LAYOUT_4POINT0|AV_CH_LOW_FREQUENCY)
|
||||
#define AV_CH_LAYOUT_2_2 (AV_CH_LAYOUT_STEREO|AV_CH_SIDE_LEFT|AV_CH_SIDE_RIGHT)
|
||||
#define AV_CH_LAYOUT_QUAD (AV_CH_LAYOUT_STEREO|AV_CH_BACK_LEFT|AV_CH_BACK_RIGHT)
|
||||
#define AV_CH_LAYOUT_5POINT0 (AV_CH_LAYOUT_SURROUND|AV_CH_SIDE_LEFT|AV_CH_SIDE_RIGHT)
|
||||
#define AV_CH_LAYOUT_5POINT1 (AV_CH_LAYOUT_5POINT0|AV_CH_LOW_FREQUENCY)
|
||||
#define AV_CH_LAYOUT_5POINT0_BACK (AV_CH_LAYOUT_SURROUND|AV_CH_BACK_LEFT|AV_CH_BACK_RIGHT)
|
||||
#define AV_CH_LAYOUT_5POINT1_BACK (AV_CH_LAYOUT_5POINT0_BACK|AV_CH_LOW_FREQUENCY)
|
||||
#define AV_CH_LAYOUT_6POINT0 (AV_CH_LAYOUT_5POINT0|AV_CH_BACK_CENTER)
|
||||
#define AV_CH_LAYOUT_6POINT0_FRONT (AV_CH_LAYOUT_2_2|AV_CH_FRONT_LEFT_OF_CENTER|AV_CH_FRONT_RIGHT_OF_CENTER)
|
||||
#define AV_CH_LAYOUT_HEXAGONAL (AV_CH_LAYOUT_5POINT0_BACK|AV_CH_BACK_CENTER)
|
||||
#define AV_CH_LAYOUT_6POINT1 (AV_CH_LAYOUT_5POINT1|AV_CH_BACK_CENTER)
|
||||
#define AV_CH_LAYOUT_6POINT1_BACK (AV_CH_LAYOUT_5POINT1_BACK|AV_CH_BACK_CENTER)
|
||||
#define AV_CH_LAYOUT_6POINT1_FRONT (AV_CH_LAYOUT_6POINT0_FRONT|AV_CH_LOW_FREQUENCY)
|
||||
#define AV_CH_LAYOUT_7POINT0 (AV_CH_LAYOUT_5POINT0|AV_CH_BACK_LEFT|AV_CH_BACK_RIGHT)
|
||||
#define AV_CH_LAYOUT_7POINT0_FRONT (AV_CH_LAYOUT_5POINT0|AV_CH_FRONT_LEFT_OF_CENTER|AV_CH_FRONT_RIGHT_OF_CENTER)
|
||||
#define AV_CH_LAYOUT_7POINT1 (AV_CH_LAYOUT_5POINT1|AV_CH_BACK_LEFT|AV_CH_BACK_RIGHT)
|
||||
#define AV_CH_LAYOUT_7POINT1_WIDE (AV_CH_LAYOUT_5POINT1_BACK|AV_CH_FRONT_LEFT_OF_CENTER|AV_CH_FRONT_RIGHT_OF_CENTER)
|
||||
#define AV_CH_LAYOUT_7POINT1_WIDE (AV_CH_LAYOUT_5POINT1|AV_CH_FRONT_LEFT_OF_CENTER|AV_CH_FRONT_RIGHT_OF_CENTER)
|
||||
#define AV_CH_LAYOUT_OCTAGONAL (AV_CH_LAYOUT_5POINT0|AV_CH_BACK_LEFT|AV_CH_BACK_CENTER|AV_CH_BACK_RIGHT)
|
||||
#define AV_CH_LAYOUT_STEREO_DOWNMIX (AV_CH_STEREO_LEFT|AV_CH_STEREO_RIGHT)
|
||||
|
||||
/**
|
||||
* Return a channel layout id that matches name, 0 if no match.
|
||||
* @}
|
||||
*/
|
||||
int64_t av_get_channel_layout(const char *name);
|
||||
|
||||
/**
|
||||
* Return a channel layout id that matches name, 0 if no match.
|
||||
* name can be one or several of the following notations,
|
||||
* separated by '+' or '|':
|
||||
* - the name of an usual channel layout (mono, stereo, 4.0, quad, 5.0,
|
||||
* 5.0(side), 5.1, 5.1(side), 7.1, 7.1(wide), downmix);
|
||||
* - the name of a single channel (FL, FR, FC, LFE, BL, BR, FLC, FRC, BC,
|
||||
* SL, SR, TC, TFL, TFC, TFR, TBL, TBC, TBR, DL, DR);
|
||||
* - a number of channels, in decimal, optionnally followed by 'c', yielding
|
||||
* the default channel layout for that number of channels (@see
|
||||
* av_get_default_channel_layout);
|
||||
* - a channel layout mask, in hexadecimal starting with "0x" (see the
|
||||
* AV_CH_* macros).
|
||||
+ Example: "stereo+FC" = "2+FC" = "2c+1c" = "0x7"
|
||||
*/
|
||||
uint64_t av_get_channel_layout(const char *name);
|
||||
|
||||
/**
|
||||
* Return a description of a channel layout.
|
||||
@ -85,11 +128,20 @@ int64_t av_get_channel_layout(const char *name);
|
||||
* @param buf put here the string containing the channel layout
|
||||
* @param buf_size size in bytes of the buffer
|
||||
*/
|
||||
void av_get_channel_layout_string(char *buf, int buf_size, int nb_channels, int64_t channel_layout);
|
||||
void av_get_channel_layout_string(char *buf, int buf_size, int nb_channels, uint64_t channel_layout);
|
||||
|
||||
/**
|
||||
* Return the number of channels in the channel layout.
|
||||
*/
|
||||
int av_get_channel_layout_nb_channels(int64_t channel_layout);
|
||||
int av_get_channel_layout_nb_channels(uint64_t channel_layout);
|
||||
|
||||
/**
|
||||
* Return default channel layout for a given number of channels.
|
||||
*/
|
||||
int64_t av_get_default_channel_layout(int nb_channels);
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#endif /* AVUTIL_AUDIOCONVERT_H */
|
||||
|
86
3rdparty/include/ffmpeg_/libavutil/avstring.h
vendored
86
3rdparty/include/ffmpeg_/libavutil/avstring.h
vendored
@ -22,6 +22,12 @@
|
||||
#define AVUTIL_AVSTRING_H
|
||||
|
||||
#include <stddef.h>
|
||||
#include "attributes.h"
|
||||
|
||||
/**
|
||||
* @addtogroup lavu_string
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* Return non-zero if pfx is a prefix of str. If it is, *ptr is set to
|
||||
@ -71,7 +77,7 @@ char *av_stristr(const char *haystack, const char *needle);
|
||||
* @param size size of destination buffer
|
||||
* @return the length of src
|
||||
*
|
||||
* WARNING: since the return value is the length of src, src absolutely
|
||||
* @warning since the return value is the length of src, src absolutely
|
||||
* _must_ be a properly 0-terminated string, otherwise this will read beyond
|
||||
* the end of the buffer and possibly crash.
|
||||
*/
|
||||
@ -89,9 +95,9 @@ size_t av_strlcpy(char *dst, const char *src, size_t size);
|
||||
* @param size size of destination buffer
|
||||
* @return the total length of src and dst
|
||||
*
|
||||
* WARNING: since the return value use the length of src and dst, these absolutely
|
||||
* _must_ be a properly 0-terminated strings, otherwise this will read beyond
|
||||
* the end of the buffer and possibly crash.
|
||||
* @warning since the return value use the length of src and dst, these
|
||||
* absolutely _must_ be a properly 0-terminated strings, otherwise this
|
||||
* will read beyond the end of the buffer and possibly crash.
|
||||
*/
|
||||
size_t av_strlcat(char *dst, const char *src, size_t size);
|
||||
|
||||
@ -107,7 +113,17 @@ size_t av_strlcat(char *dst, const char *src, size_t size);
|
||||
* @return the length of the string that would have been generated
|
||||
* if enough space had been available
|
||||
*/
|
||||
size_t av_strlcatf(char *dst, size_t size, const char *fmt, ...);
|
||||
size_t av_strlcatf(char *dst, size_t size, const char *fmt, ...) av_printf_format(3, 4);
|
||||
|
||||
/**
|
||||
* Print arguments following specified format into a large enough auto
|
||||
* allocated buffer. It is similar to GNU asprintf().
|
||||
* @param fmt printf-compatible format string, specifying how the
|
||||
* following parameters are used.
|
||||
* @return the allocated string
|
||||
* @note You have to free the string yourself with av_free().
|
||||
*/
|
||||
char *av_asprintf(const char *fmt, ...) av_printf_format(1, 2);
|
||||
|
||||
/**
|
||||
* Convert a number to a av_malloced string.
|
||||
@ -130,4 +146,64 @@ char *av_d2str(double d);
|
||||
*/
|
||||
char *av_get_token(const char **buf, const char *term);
|
||||
|
||||
/**
|
||||
* Split the string into several tokens which can be accessed by
|
||||
* successive calls to av_strtok().
|
||||
*
|
||||
* A token is defined as a sequence of characters not belonging to the
|
||||
* set specified in delim.
|
||||
*
|
||||
* On the first call to av_strtok(), s should point to the string to
|
||||
* parse, and the value of saveptr is ignored. In subsequent calls, s
|
||||
* should be NULL, and saveptr should be unchanged since the previous
|
||||
* call.
|
||||
*
|
||||
* This function is similar to strtok_r() defined in POSIX.1.
|
||||
*
|
||||
* @param s the string to parse, may be NULL
|
||||
* @param delim 0-terminated list of token delimiters, must be non-NULL
|
||||
* @param saveptr user-provided pointer which points to stored
|
||||
* information necessary for av_strtok() to continue scanning the same
|
||||
* string. saveptr is updated to point to the next character after the
|
||||
* first delimiter found, or to NULL if the string was terminated
|
||||
* @return the found token, or NULL when no token is found
|
||||
*/
|
||||
char *av_strtok(char *s, const char *delim, char **saveptr);
|
||||
|
||||
/**
|
||||
* Locale-independent conversion of ASCII characters to uppercase.
|
||||
*/
|
||||
static inline int av_toupper(int c)
|
||||
{
|
||||
if (c >= 'a' && c <= 'z')
|
||||
c ^= 0x20;
|
||||
return c;
|
||||
}
|
||||
|
||||
/**
|
||||
* Locale-independent conversion of ASCII characters to lowercase.
|
||||
*/
|
||||
static inline int av_tolower(int c)
|
||||
{
|
||||
if (c >= 'A' && c <= 'Z')
|
||||
c ^= 0x20;
|
||||
return c;
|
||||
}
|
||||
|
||||
/**
|
||||
* Locale-independent case-insensitive compare.
|
||||
* @note This means only ASCII-range characters are case-insensitive
|
||||
*/
|
||||
int av_strcasecmp(const char *a, const char *b);
|
||||
|
||||
/**
|
||||
* Locale-independent case-insensitive compare.
|
||||
* @note This means only ASCII-range characters are case-insensitive
|
||||
*/
|
||||
int av_strncasecmp(const char *a, const char *b, size_t n);
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#endif /* AVUTIL_AVSTRING_H */
|
||||
|
225
3rdparty/include/ffmpeg_/libavutil/avutil.h
vendored
225
3rdparty/include/ffmpeg_/libavutil/avutil.h
vendored
@ -26,6 +26,96 @@
|
||||
* external API header
|
||||
*/
|
||||
|
||||
/**
|
||||
* @mainpage
|
||||
*
|
||||
* @section libav_intro Introduction
|
||||
*
|
||||
* This document describe the usage of the different libraries
|
||||
* provided by FFmpeg.
|
||||
*
|
||||
* @li @ref libavc "libavcodec" encoding/decoding library
|
||||
* @li @subpage libavfilter graph based frame editing library
|
||||
* @li @ref libavf "libavformat" I/O and muxing/demuxing library
|
||||
* @li @ref lavd "libavdevice" special devices muxing/demuxing library
|
||||
* @li @ref lavu "libavutil" common utility library
|
||||
* @li @subpage libpostproc post processing library
|
||||
* @li @subpage libswscale color conversion and scaling library
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* @defgroup lavu Common utility functions
|
||||
*
|
||||
* @brief
|
||||
* libavutil contains the code shared across all the other FFmpeg
|
||||
* libraries
|
||||
*
|
||||
* @note In order to use the functions provided by avutil you must include
|
||||
* the specific header.
|
||||
*
|
||||
* @{
|
||||
*
|
||||
* @defgroup lavu_crypto Crypto and Hashing
|
||||
*
|
||||
* @{
|
||||
* @}
|
||||
*
|
||||
* @defgroup lavu_math Maths
|
||||
* @{
|
||||
*
|
||||
* @}
|
||||
*
|
||||
* @defgroup lavu_string String Manipulation
|
||||
*
|
||||
* @{
|
||||
*
|
||||
* @}
|
||||
*
|
||||
* @defgroup lavu_mem Memory Management
|
||||
*
|
||||
* @{
|
||||
*
|
||||
* @}
|
||||
*
|
||||
* @defgroup lavu_data Data Structures
|
||||
* @{
|
||||
*
|
||||
* @}
|
||||
*
|
||||
* @defgroup lavu_audio Audio related
|
||||
*
|
||||
* @{
|
||||
*
|
||||
* @}
|
||||
*
|
||||
* @defgroup lavu_error Error Codes
|
||||
*
|
||||
* @{
|
||||
*
|
||||
* @}
|
||||
*
|
||||
* @defgroup lavu_misc Other
|
||||
*
|
||||
* @{
|
||||
*
|
||||
* @defgroup lavu_internal Internal
|
||||
*
|
||||
* Not exported functions, for internal usage only
|
||||
*
|
||||
* @{
|
||||
*
|
||||
* @}
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* @defgroup preproc_misc Preprocessor String Macros
|
||||
*
|
||||
* String manipulation macros
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
|
||||
#define AV_STRINGIFY(s) AV_TOSTRING(s)
|
||||
#define AV_TOSTRING(s) #s
|
||||
@ -35,13 +125,37 @@
|
||||
|
||||
#define AV_PRAGMA(s) _Pragma(#s)
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @defgroup version_utils Library Version Macros
|
||||
*
|
||||
* Useful to check and match library version in order to maintain
|
||||
* backward compatibility.
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
|
||||
#define AV_VERSION_INT(a, b, c) (a<<16 | b<<8 | c)
|
||||
#define AV_VERSION_DOT(a, b, c) a ##.## b ##.## c
|
||||
#define AV_VERSION(a, b, c) AV_VERSION_DOT(a, b, c)
|
||||
|
||||
/**
|
||||
* @}
|
||||
*
|
||||
* @defgroup lavu_ver Version and Build diagnostics
|
||||
*
|
||||
* Macros and function useful to check at compiletime and at runtime
|
||||
* which version of libavutil is in use.
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
|
||||
#define LIBAVUTIL_VERSION_MAJOR 51
|
||||
#define LIBAVUTIL_VERSION_MINOR 9
|
||||
#define LIBAVUTIL_VERSION_MICRO 1
|
||||
#define LIBAVUTIL_VERSION_MINOR 35
|
||||
#define LIBAVUTIL_VERSION_MICRO 100
|
||||
|
||||
#define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
|
||||
LIBAVUTIL_VERSION_MINOR, \
|
||||
@ -54,8 +168,16 @@
|
||||
#define LIBAVUTIL_IDENT "Lavu" AV_STRINGIFY(LIBAVUTIL_VERSION)
|
||||
|
||||
/**
|
||||
* @}
|
||||
*
|
||||
* @defgroup depr_guards Deprecation guards
|
||||
* Those FF_API_* defines are not part of public API.
|
||||
* They may change, break or disappear at any time.
|
||||
*
|
||||
* They are used mostly internally to mark code that will be removed
|
||||
* on the next major version.
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
#ifndef FF_API_OLD_EVAL_NAMES
|
||||
#define FF_API_OLD_EVAL_NAMES (LIBAVUTIL_VERSION_MAJOR < 52)
|
||||
@ -66,6 +188,21 @@
|
||||
#ifndef FF_API_FIND_OPT
|
||||
#define FF_API_FIND_OPT (LIBAVUTIL_VERSION_MAJOR < 52)
|
||||
#endif
|
||||
#ifndef FF_API_AV_FIFO_PEEK
|
||||
#define FF_API_AV_FIFO_PEEK (LIBAVUTIL_VERSION_MAJOR < 52)
|
||||
#endif
|
||||
#ifndef FF_API_OLD_AVOPTIONS
|
||||
#define FF_API_OLD_AVOPTIONS (LIBAVUTIL_VERSION_MAJOR < 52)
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @addtogroup lavu_ver
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* Return the LIBAVUTIL_VERSION_INT constant.
|
||||
@ -82,16 +219,41 @@ const char *avutil_configuration(void);
|
||||
*/
|
||||
const char *avutil_license(void);
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @addtogroup lavu_media Media Type
|
||||
* @brief Media Type
|
||||
*/
|
||||
|
||||
enum AVMediaType {
|
||||
AVMEDIA_TYPE_UNKNOWN = -1,
|
||||
AVMEDIA_TYPE_UNKNOWN = -1, ///< Usually treated as AVMEDIA_TYPE_DATA
|
||||
AVMEDIA_TYPE_VIDEO,
|
||||
AVMEDIA_TYPE_AUDIO,
|
||||
AVMEDIA_TYPE_DATA,
|
||||
AVMEDIA_TYPE_DATA, ///< Opaque data information usually continuous
|
||||
AVMEDIA_TYPE_SUBTITLE,
|
||||
AVMEDIA_TYPE_ATTACHMENT,
|
||||
AVMEDIA_TYPE_ATTACHMENT, ///< Opaque data information usually sparse
|
||||
AVMEDIA_TYPE_NB
|
||||
};
|
||||
|
||||
/**
|
||||
* Return a string describing the media_type enum, NULL if media_type
|
||||
* is unknown.
|
||||
*/
|
||||
const char *av_get_media_type_string(enum AVMediaType media_type);
|
||||
|
||||
/**
|
||||
* @defgroup lavu_const Constants
|
||||
* @{
|
||||
*
|
||||
* @defgroup lavu_enc Encoding specific
|
||||
*
|
||||
* @note those definition should move to avcodec
|
||||
* @{
|
||||
*/
|
||||
|
||||
#define FF_LAMBDA_SHIFT 7
|
||||
#define FF_LAMBDA_SCALE (1<<FF_LAMBDA_SHIFT)
|
||||
#define FF_QP2LAMBDA 118 ///< factor to convert from H.263 QP to lambda
|
||||
@ -99,10 +261,46 @@ enum AVMediaType {
|
||||
|
||||
#define FF_QUALITY_SCALE FF_LAMBDA_SCALE //FIXME maybe remove
|
||||
|
||||
/**
|
||||
* @}
|
||||
* @defgroup lavu_time Timestamp specific
|
||||
*
|
||||
* FFmpeg internal timebase and timestamp definitions
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief Undefined timestamp value
|
||||
*
|
||||
* Usually reported by demuxer that work on containers that do not provide
|
||||
* either pts or dts.
|
||||
*/
|
||||
|
||||
#define AV_NOPTS_VALUE INT64_C(0x8000000000000000)
|
||||
|
||||
/**
|
||||
* Internal time base represented as integer
|
||||
*/
|
||||
|
||||
#define AV_TIME_BASE 1000000
|
||||
|
||||
/**
|
||||
* Internal time base represented as fractional value
|
||||
*/
|
||||
|
||||
#define AV_TIME_BASE_Q (AVRational){1, AV_TIME_BASE}
|
||||
|
||||
/**
|
||||
* @}
|
||||
* @}
|
||||
* @defgroup lavu_picture Image related
|
||||
*
|
||||
* AVPicture types, pixel formats and basic image planes manipulation.
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
|
||||
enum AVPictureType {
|
||||
AV_PICTURE_TYPE_NONE = 0, ///< Undefined
|
||||
AV_PICTURE_TYPE_I, ///< Intra
|
||||
@ -123,6 +321,10 @@ enum AVPictureType {
|
||||
*/
|
||||
char av_get_picture_type_char(enum AVPictureType pict_type);
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#include "common.h"
|
||||
#include "error.h"
|
||||
#include "mathematics.h"
|
||||
@ -131,4 +333,17 @@ char av_get_picture_type_char(enum AVPictureType pict_type);
|
||||
#include "log.h"
|
||||
#include "pixfmt.h"
|
||||
|
||||
/**
|
||||
* Return x default pointer in case p is NULL.
|
||||
*/
|
||||
static inline void *av_x_if_null(const void *p, const void *x)
|
||||
{
|
||||
return (void *)(intptr_t)(p ? p : x);
|
||||
}
|
||||
|
||||
/**
|
||||
* @}
|
||||
* @}
|
||||
*/
|
||||
|
||||
#endif /* AVUTIL_AVUTIL_H */
|
||||
|
11
3rdparty/include/ffmpeg_/libavutil/base64.h
vendored
11
3rdparty/include/ffmpeg_/libavutil/base64.h
vendored
@ -23,6 +23,13 @@
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
/**
|
||||
* @defgroup lavu_base64 Base64
|
||||
* @ingroup lavu_crypto
|
||||
* @{
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* Decode a base64-encoded string.
|
||||
*
|
||||
@ -51,4 +58,8 @@ char *av_base64_encode(char *out, int out_size, const uint8_t *in, int in_size);
|
||||
*/
|
||||
#define AV_BASE64_SIZE(x) (((x)+2) / 3 * 4 + 1)
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#endif /* AVUTIL_BASE64_H */
|
||||
|
19
3rdparty/include/ffmpeg_/libavutil/bswap.h
vendored
19
3rdparty/include/ffmpeg_/libavutil/bswap.h
vendored
@ -65,29 +65,14 @@ static av_always_inline av_const uint16_t av_bswap16(uint16_t x)
|
||||
#ifndef av_bswap32
|
||||
static av_always_inline av_const uint32_t av_bswap32(uint32_t x)
|
||||
{
|
||||
x= ((x<<8)&0xFF00FF00) | ((x>>8)&0x00FF00FF);
|
||||
x= (x>>16) | (x<<16);
|
||||
return x;
|
||||
return AV_BSWAP32C(x);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef av_bswap64
|
||||
static inline uint64_t av_const av_bswap64(uint64_t x)
|
||||
{
|
||||
#if 0
|
||||
x= ((x<< 8)&0xFF00FF00FF00FF00ULL) | ((x>> 8)&0x00FF00FF00FF00FFULL);
|
||||
x= ((x<<16)&0xFFFF0000FFFF0000ULL) | ((x>>16)&0x0000FFFF0000FFFFULL);
|
||||
return (x>>32) | (x<<32);
|
||||
#else
|
||||
union {
|
||||
uint64_t ll;
|
||||
uint32_t l[2];
|
||||
} w, r;
|
||||
w.ll = x;
|
||||
r.l[0] = av_bswap32 (w.l[1]);
|
||||
r.l[1] = av_bswap32 (w.l[0]);
|
||||
return r.ll;
|
||||
#endif
|
||||
return (uint64_t)av_bswap32(x) << 32 | av_bswap32(x >> 32);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
37
3rdparty/include/ffmpeg_/libavutil/common.h
vendored
37
3rdparty/include/ffmpeg_/libavutil/common.h
vendored
@ -220,8 +220,18 @@ static av_always_inline av_const int av_popcount_c(uint32_t x)
|
||||
return (x + (x >> 16)) & 0x3F;
|
||||
}
|
||||
|
||||
#define MKTAG(a,b,c,d) ((a) | ((b) << 8) | ((c) << 16) | ((d) << 24))
|
||||
#define MKBETAG(a,b,c,d) ((d) | ((c) << 8) | ((b) << 16) | ((a) << 24))
|
||||
/**
|
||||
* Count number of bits set to one in x
|
||||
* @param x value to count bits of
|
||||
* @return the number of bits set to one in x
|
||||
*/
|
||||
static av_always_inline av_const int av_popcount64_c(uint64_t x)
|
||||
{
|
||||
return av_popcount(x) + av_popcount(x >> 32);
|
||||
}
|
||||
|
||||
#define MKTAG(a,b,c,d) ((a) | ((b) << 8) | ((c) << 16) | ((unsigned)(d) << 24))
|
||||
#define MKBETAG(a,b,c,d) ((d) | ((c) << 8) | ((b) << 16) | ((unsigned)(a) << 24))
|
||||
|
||||
/**
|
||||
* Convert a UTF-8 character (up to 4 bytes) to its 32-bit UCS-4 encoded form.
|
||||
@ -270,16 +280,16 @@ static av_always_inline av_const int av_popcount_c(uint32_t x)
|
||||
}\
|
||||
}\
|
||||
|
||||
/*!
|
||||
* \def PUT_UTF8(val, tmp, PUT_BYTE)
|
||||
/**
|
||||
* @def PUT_UTF8(val, tmp, PUT_BYTE)
|
||||
* Convert a 32-bit Unicode character to its UTF-8 encoded form (up to 4 bytes long).
|
||||
* \param val is an input-only argument and should be of type uint32_t. It holds
|
||||
* @param val is an input-only argument and should be of type uint32_t. It holds
|
||||
* a UCS-4 encoded Unicode character that is to be converted to UTF-8. If
|
||||
* val is given as a function it is executed only once.
|
||||
* \param tmp is a temporary variable and should be of type uint8_t. It
|
||||
* @param tmp is a temporary variable and should be of type uint8_t. It
|
||||
* represents an intermediate value during conversion that is to be
|
||||
* output by PUT_BYTE.
|
||||
* \param PUT_BYTE writes the converted UTF-8 bytes to any proper destination.
|
||||
* @param PUT_BYTE writes the converted UTF-8 bytes to any proper destination.
|
||||
* It could be a function or a statement, and uses tmp as the input byte.
|
||||
* For example, PUT_BYTE could be "*output++ = tmp;" PUT_BYTE will be
|
||||
* executed up to 4 times for values in the valid UTF-8 range and up to
|
||||
@ -306,16 +316,16 @@ static av_always_inline av_const int av_popcount_c(uint32_t x)
|
||||
}\
|
||||
}
|
||||
|
||||
/*!
|
||||
* \def PUT_UTF16(val, tmp, PUT_16BIT)
|
||||
/**
|
||||
* @def PUT_UTF16(val, tmp, PUT_16BIT)
|
||||
* Convert a 32-bit Unicode character to its UTF-16 encoded form (2 or 4 bytes).
|
||||
* \param val is an input-only argument and should be of type uint32_t. It holds
|
||||
* @param val is an input-only argument and should be of type uint32_t. It holds
|
||||
* a UCS-4 encoded Unicode character that is to be converted to UTF-16. If
|
||||
* val is given as a function it is executed only once.
|
||||
* \param tmp is a temporary variable and should be of type uint16_t. It
|
||||
* @param tmp is a temporary variable and should be of type uint16_t. It
|
||||
* represents an intermediate value during conversion that is to be
|
||||
* output by PUT_16BIT.
|
||||
* \param PUT_16BIT writes the converted UTF-16 data to any proper destination
|
||||
* @param PUT_16BIT writes the converted UTF-16 data to any proper destination
|
||||
* in desired endianness. It could be a function or a statement, and uses tmp
|
||||
* as the input byte. For example, PUT_BYTE could be "*output++ = tmp;"
|
||||
* PUT_BYTE will be executed 1 or 2 times depending on input character.
|
||||
@ -385,3 +395,6 @@ static av_always_inline av_const int av_popcount_c(uint32_t x)
|
||||
#ifndef av_popcount
|
||||
# define av_popcount av_popcount_c
|
||||
#endif
|
||||
#ifndef av_popcount64
|
||||
# define av_popcount64 av_popcount64_c
|
||||
#endif
|
||||
|
2
3rdparty/include/ffmpeg_/libavutil/cpu.h
vendored
2
3rdparty/include/ffmpeg_/libavutil/cpu.h
vendored
@ -38,6 +38,8 @@
|
||||
#define AV_CPU_FLAG_SSE4 0x0100 ///< Penryn SSE4.1 functions
|
||||
#define AV_CPU_FLAG_SSE42 0x0200 ///< Nehalem SSE4.2 functions
|
||||
#define AV_CPU_FLAG_AVX 0x4000 ///< AVX functions: requires OS support even if YMM registers aren't used
|
||||
#define AV_CPU_FLAG_XOP 0x0400 ///< Bulldozer XOP functions
|
||||
#define AV_CPU_FLAG_FMA4 0x0800 ///< Bulldozer FMA4 functions
|
||||
#define AV_CPU_FLAG_IWMMXT 0x0100 ///< XScale IWMMXT
|
||||
#define AV_CPU_FLAG_ALTIVEC 0x0001 ///< standard
|
||||
|
||||
|
52
3rdparty/include/ffmpeg_/libavutil/dict.h
vendored
52
3rdparty/include/ffmpeg_/libavutil/dict.h
vendored
@ -20,15 +20,56 @@
|
||||
/**
|
||||
* @file
|
||||
* Public dictionary API.
|
||||
* @deprecated
|
||||
* AVDictionary is provided for compatibility with libav. It is both in
|
||||
* implementation as well as API inefficient. It does not scale and is
|
||||
* extremely slow with large dictionaries.
|
||||
* It is recommended that new code uses our tree container from tree.c/h
|
||||
* where applicable, which uses AVL trees to achieve O(log n) performance.
|
||||
*/
|
||||
|
||||
#ifndef AVUTIL_DICT_H
|
||||
#define AVUTIL_DICT_H
|
||||
|
||||
/**
|
||||
* @addtogroup lavu_dict AVDictionary
|
||||
* @ingroup lavu_data
|
||||
*
|
||||
* @brief Simple key:value store
|
||||
*
|
||||
* @{
|
||||
* Dictionaries are used for storing key:value pairs. To create
|
||||
* an AVDictionary, simply pass an address of a NULL pointer to
|
||||
* av_dict_set(). NULL can be used as an empty dictionary wherever
|
||||
* a pointer to an AVDictionary is required.
|
||||
* Use av_dict_get() to retrieve an entry or iterate over all
|
||||
* entries and finally av_dict_free() to free the dictionary
|
||||
* and all its contents.
|
||||
*
|
||||
* @code
|
||||
* AVDictionary *d = NULL; // "create" an empty dictionary
|
||||
* av_dict_set(&d, "foo", "bar", 0); // add an entry
|
||||
*
|
||||
* char *k = av_strdup("key"); // if your strings are already allocated,
|
||||
* char *v = av_strdup("value"); // you can avoid copying them like this
|
||||
* av_dict_set(&d, k, v, AV_DICT_DONT_STRDUP_KEY | AV_DICT_DONT_STRDUP_VAL);
|
||||
*
|
||||
* AVDictionaryEntry *t = NULL;
|
||||
* while (t = av_dict_get(d, "", t, AV_DICT_IGNORE_SUFFIX)) {
|
||||
* <....> // iterate over all entries in d
|
||||
* }
|
||||
*
|
||||
* av_dict_free(&d);
|
||||
* @endcode
|
||||
*
|
||||
*/
|
||||
|
||||
#define AV_DICT_MATCH_CASE 1
|
||||
#define AV_DICT_IGNORE_SUFFIX 2
|
||||
#define AV_DICT_DONT_STRDUP_KEY 4
|
||||
#define AV_DICT_DONT_STRDUP_VAL 8
|
||||
#define AV_DICT_DONT_STRDUP_KEY 4 /**< Take ownership of a key that's been
|
||||
allocated with av_malloc() and children. */
|
||||
#define AV_DICT_DONT_STRDUP_VAL 8 /**< Take ownership of a value that's been
|
||||
allocated with av_malloc() and chilren. */
|
||||
#define AV_DICT_DONT_OVERWRITE 16 ///< Don't overwrite existing entries.
|
||||
#define AV_DICT_APPEND 32 /**< If the entry already exists, append to it. Note that no
|
||||
delimiter is added, the strings are simply concatenated. */
|
||||
@ -74,8 +115,13 @@ int av_dict_set(AVDictionary **pm, const char *key, const char *value, int flags
|
||||
void av_dict_copy(AVDictionary **dst, AVDictionary *src, int flags);
|
||||
|
||||
/**
|
||||
* Free all the memory allocated for an AVDictionary struct.
|
||||
* Free all the memory allocated for an AVDictionary struct
|
||||
* and all keys and values.
|
||||
*/
|
||||
void av_dict_free(AVDictionary **m);
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#endif // AVUTIL_DICT_H
|
||||
|
19
3rdparty/include/ffmpeg_/libavutil/error.h
vendored
19
3rdparty/include/ffmpeg_/libavutil/error.h
vendored
@ -27,6 +27,13 @@
|
||||
#include <errno.h>
|
||||
#include "avutil.h"
|
||||
|
||||
/**
|
||||
* @addtogroup lavu_error
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
|
||||
|
||||
/* error handling */
|
||||
#if EDOM > 0
|
||||
#define AVERROR(e) (-(e)) ///< Returns a negative error code from a POSIX error code, to return from library functions.
|
||||
@ -38,6 +45,7 @@
|
||||
#endif
|
||||
|
||||
#define AVERROR_BSF_NOT_FOUND (-MKTAG(0xF8,'B','S','F')) ///< Bitstream filter not found
|
||||
#define AVERROR_BUG (-MKTAG( 'B','U','G','!')) ///< Internal bug, also see AVERROR_BUG2
|
||||
#define AVERROR_DECODER_NOT_FOUND (-MKTAG(0xF8,'D','E','C')) ///< Decoder not found
|
||||
#define AVERROR_DEMUXER_NOT_FOUND (-MKTAG(0xF8,'D','E','M')) ///< Demuxer not found
|
||||
#define AVERROR_ENCODER_NOT_FOUND (-MKTAG(0xF8,'E','N','C')) ///< Encoder not found
|
||||
@ -51,6 +59,13 @@
|
||||
#define AVERROR_PROTOCOL_NOT_FOUND (-MKTAG(0xF8,'P','R','O')) ///< Protocol not found
|
||||
#define AVERROR_STREAM_NOT_FOUND (-MKTAG(0xF8,'S','T','R')) ///< Stream not found
|
||||
|
||||
/**
|
||||
* This is semantically identical to AVERROR_BUG
|
||||
* it has been introduced in Libav after our AVERROR_BUG and with a modified value.
|
||||
*/
|
||||
#define AVERROR_BUG2 (-MKTAG( 'B','U','G',' '))
|
||||
#define AVERROR_UNKNOWN (-MKTAG( 'U','N','K','N')) ///< Unknown error, typically from an external library
|
||||
|
||||
/**
|
||||
* Put a description of the AVERROR code errnum in errbuf.
|
||||
* In case of failure the global variable errno is set to indicate the
|
||||
@ -65,4 +80,8 @@
|
||||
*/
|
||||
int av_strerror(int errnum, char *errbuf, size_t errbuf_size);
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#endif /* AVUTIL_ERROR_H */
|
||||
|
2
3rdparty/include/ffmpeg_/libavutil/eval.h
vendored
2
3rdparty/include/ffmpeg_/libavutil/eval.h
vendored
@ -58,7 +58,7 @@ int av_expr_parse_and_eval(double *res, const char *s,
|
||||
* Parse an expression.
|
||||
*
|
||||
* @param expr a pointer where is put an AVExpr containing the parsed
|
||||
* value in case of successfull parsing, or NULL otherwise.
|
||||
* value in case of successful parsing, or NULL otherwise.
|
||||
* The pointed to AVExpr must be freed with av_expr_free() by the user
|
||||
* when it is not needed anymore.
|
||||
* @param s expression as a zero terminated string, for example "1+2^3+5*5+sin(2/3)"
|
||||
|
57
3rdparty/include/ffmpeg_/libavutil/fifo.h
vendored
57
3rdparty/include/ffmpeg_/libavutil/fifo.h
vendored
@ -25,6 +25,7 @@
|
||||
#define AVUTIL_FIFO_H
|
||||
|
||||
#include <stdint.h>
|
||||
#include "avutil.h"
|
||||
|
||||
typedef struct AVFifoBuffer {
|
||||
uint8_t *buffer;
|
||||
@ -41,20 +42,20 @@ AVFifoBuffer *av_fifo_alloc(unsigned int size);
|
||||
|
||||
/**
|
||||
* Free an AVFifoBuffer.
|
||||
* @param *f AVFifoBuffer to free
|
||||
* @param f AVFifoBuffer to free
|
||||
*/
|
||||
void av_fifo_free(AVFifoBuffer *f);
|
||||
|
||||
/**
|
||||
* Reset the AVFifoBuffer to the state right after av_fifo_alloc, in particular it is emptied.
|
||||
* @param *f AVFifoBuffer to reset
|
||||
* @param f AVFifoBuffer to reset
|
||||
*/
|
||||
void av_fifo_reset(AVFifoBuffer *f);
|
||||
|
||||
/**
|
||||
* Return the amount of data in bytes in the AVFifoBuffer, that is the
|
||||
* amount of data you can read from it.
|
||||
* @param *f AVFifoBuffer to read from
|
||||
* @param f AVFifoBuffer to read from
|
||||
* @return size
|
||||
*/
|
||||
int av_fifo_size(AVFifoBuffer *f);
|
||||
@ -62,27 +63,27 @@ int av_fifo_size(AVFifoBuffer *f);
|
||||
/**
|
||||
* Return the amount of space in bytes in the AVFifoBuffer, that is the
|
||||
* amount of data you can write into it.
|
||||
* @param *f AVFifoBuffer to write into
|
||||
* @param f AVFifoBuffer to write into
|
||||
* @return size
|
||||
*/
|
||||
int av_fifo_space(AVFifoBuffer *f);
|
||||
|
||||
/**
|
||||
* Feed data from an AVFifoBuffer to a user-supplied callback.
|
||||
* @param *f AVFifoBuffer to read from
|
||||
* @param f AVFifoBuffer to read from
|
||||
* @param buf_size number of bytes to read
|
||||
* @param *func generic read function
|
||||
* @param *dest data destination
|
||||
* @param func generic read function
|
||||
* @param dest data destination
|
||||
*/
|
||||
int av_fifo_generic_read(AVFifoBuffer *f, void *dest, int buf_size, void (*func)(void*, void*, int));
|
||||
|
||||
/**
|
||||
* Feed data from a user-supplied callback to an AVFifoBuffer.
|
||||
* @param *f AVFifoBuffer to write to
|
||||
* @param *src data source; non-const since it may be used as a
|
||||
* @param f AVFifoBuffer to write to
|
||||
* @param src data source; non-const since it may be used as a
|
||||
* modifiable context by the function defined in func
|
||||
* @param size number of bytes to write
|
||||
* @param *func generic write function; the first parameter is src,
|
||||
* @param func generic write function; the first parameter is src,
|
||||
* the second is dest_buf, the third is dest_buf_size.
|
||||
* func must return the number of bytes written to dest_buf, or <= 0 to
|
||||
* indicate no more data available to write.
|
||||
@ -93,7 +94,9 @@ int av_fifo_generic_write(AVFifoBuffer *f, void *src, int size, int (*func)(void
|
||||
|
||||
/**
|
||||
* Resize an AVFifoBuffer.
|
||||
* @param *f AVFifoBuffer to resize
|
||||
* In case of reallocation failure, the old FIFO is kept unchanged.
|
||||
*
|
||||
* @param f AVFifoBuffer to resize
|
||||
* @param size new AVFifoBuffer size in bytes
|
||||
* @return <0 for failure, >=0 otherwise
|
||||
*/
|
||||
@ -101,16 +104,40 @@ int av_fifo_realloc2(AVFifoBuffer *f, unsigned int size);
|
||||
|
||||
/**
|
||||
* Read and discard the specified amount of data from an AVFifoBuffer.
|
||||
* @param *f AVFifoBuffer to read from
|
||||
* @param f AVFifoBuffer to read from
|
||||
* @param size amount of data to read in bytes
|
||||
*/
|
||||
void av_fifo_drain(AVFifoBuffer *f, int size);
|
||||
|
||||
static inline uint8_t av_fifo_peek(AVFifoBuffer *f, int offs)
|
||||
/**
|
||||
* Return a pointer to the data stored in a FIFO buffer at a certain offset.
|
||||
* The FIFO buffer is not modified.
|
||||
*
|
||||
* @param f AVFifoBuffer to peek at, f must be non-NULL
|
||||
* @param offs an offset in bytes, its absolute value must be less
|
||||
* than the used buffer size or the returned pointer will
|
||||
* point outside to the buffer data.
|
||||
* The used buffer size can be checked with av_fifo_size().
|
||||
*/
|
||||
static inline uint8_t *av_fifo_peek2(const AVFifoBuffer *f, int offs)
|
||||
{
|
||||
uint8_t *ptr = f->rptr + offs;
|
||||
if (ptr >= f->end)
|
||||
ptr -= f->end - f->buffer;
|
||||
return *ptr;
|
||||
ptr = f->buffer + (ptr - f->end);
|
||||
else if (ptr < f->buffer)
|
||||
ptr = f->end - (f->buffer - ptr);
|
||||
return ptr;
|
||||
}
|
||||
|
||||
#if FF_API_AV_FIFO_PEEK
|
||||
/**
|
||||
* @deprecated Use av_fifo_peek2() instead.
|
||||
*/
|
||||
attribute_deprecated
|
||||
static inline uint8_t av_fifo_peek(AVFifoBuffer *f, int offs)
|
||||
{
|
||||
return *av_fifo_peek2(f, offs);
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* AVUTIL_FIFO_H */
|
||||
|
9
3rdparty/include/ffmpeg_/libavutil/file.h
vendored
9
3rdparty/include/ffmpeg_/libavutil/file.h
vendored
@ -49,4 +49,13 @@ int av_file_map(const char *filename, uint8_t **bufptr, size_t *size,
|
||||
*/
|
||||
void av_file_unmap(uint8_t *bufptr, size_t size);
|
||||
|
||||
/**
|
||||
* Wrapper to work around the lack of mkstemp() on mingw.
|
||||
* Also, tries to create file in /tmp first, if possible.
|
||||
* *prefix can be a character constant; *filename will be allocated internally.
|
||||
* @return file descriptor of opened file (or -1 on error)
|
||||
* and opened file name in **filename.
|
||||
*/
|
||||
int av_tempfile(const char *prefix, char **filename, int log_offset, void *log_ctx);
|
||||
|
||||
#endif /* AVUTIL_FILE_H */
|
||||
|
12
3rdparty/include/ffmpeg_/libavutil/imgutils.h
vendored
12
3rdparty/include/ffmpeg_/libavutil/imgutils.h
vendored
@ -22,6 +22,9 @@
|
||||
/**
|
||||
* @file
|
||||
* misc image utilities
|
||||
*
|
||||
* @addtogroup lavu_picture
|
||||
* @{
|
||||
*/
|
||||
|
||||
#include "avutil.h"
|
||||
@ -106,8 +109,8 @@ void av_image_copy_plane(uint8_t *dst, int dst_linesize,
|
||||
/**
|
||||
* Copy image in src_data to dst_data.
|
||||
*
|
||||
* @param dst_linesize linesizes for the image in dst_data
|
||||
* @param src_linesize linesizes for the image in src_data
|
||||
* @param dst_linesizes linesizes for the image in dst_data
|
||||
* @param src_linesizes linesizes for the image in src_data
|
||||
*/
|
||||
void av_image_copy(uint8_t *dst_data[4], int dst_linesizes[4],
|
||||
const uint8_t *src_data[4], const int src_linesizes[4],
|
||||
@ -127,4 +130,9 @@ int av_image_check_size(unsigned int w, unsigned int h, int log_offset, void *lo
|
||||
|
||||
int ff_set_systematic_pal2(uint32_t pal[256], enum PixelFormat pix_fmt);
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
|
||||
#endif /* AVUTIL_IMGUTILS_H */
|
||||
|
73
3rdparty/include/ffmpeg_/libavutil/intfloat.h
vendored
Normal file
73
3rdparty/include/ffmpeg_/libavutil/intfloat.h
vendored
Normal file
@ -0,0 +1,73 @@
|
||||
/*
|
||||
* Copyright (c) 2011 Mans Rullgard
|
||||
*
|
||||
* This file is part of Libav.
|
||||
*
|
||||
* Libav is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* Libav is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with Libav; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#ifndef AVUTIL_INTFLOAT_H
|
||||
#define AVUTIL_INTFLOAT_H
|
||||
|
||||
#include <stdint.h>
|
||||
#include "attributes.h"
|
||||
|
||||
union av_intfloat32 {
|
||||
uint32_t i;
|
||||
float f;
|
||||
};
|
||||
|
||||
union av_intfloat64 {
|
||||
uint64_t i;
|
||||
double f;
|
||||
};
|
||||
|
||||
/**
|
||||
* Reinterpret a 32-bit integer as a float.
|
||||
*/
|
||||
static av_always_inline float av_int2float(uint32_t i)
|
||||
{
|
||||
union av_intfloat32 v = { .i = i };
|
||||
return v.f;
|
||||
}
|
||||
|
||||
/**
|
||||
* Reinterpret a float as a 32-bit integer.
|
||||
*/
|
||||
static av_always_inline uint32_t av_float2int(float f)
|
||||
{
|
||||
union av_intfloat32 v = { .f = f };
|
||||
return v.i;
|
||||
}
|
||||
|
||||
/**
|
||||
* Reinterpret a 64-bit integer as a double.
|
||||
*/
|
||||
static av_always_inline double av_int2double(uint64_t i)
|
||||
{
|
||||
union av_intfloat64 v = { .i = i };
|
||||
return v.f;
|
||||
}
|
||||
|
||||
/**
|
||||
* Reinterpret a double as a 64-bit integer.
|
||||
*/
|
||||
static av_always_inline uint64_t av_double2int(double f)
|
||||
{
|
||||
union av_intfloat64 v = { .f = f };
|
||||
return v.i;
|
||||
}
|
||||
|
||||
#endif /* AVUTIL_INTFLOAT_H */
|
@ -30,11 +30,11 @@ typedef struct AVExtFloat {
|
||||
uint8_t mantissa[8];
|
||||
} AVExtFloat;
|
||||
|
||||
double av_int2dbl(int64_t v) av_const;
|
||||
float av_int2flt(int32_t v) av_const;
|
||||
double av_ext2dbl(const AVExtFloat ext) av_const;
|
||||
int64_t av_dbl2int(double d) av_const;
|
||||
int32_t av_flt2int(float d) av_const;
|
||||
AVExtFloat av_dbl2ext(double d) av_const;
|
||||
attribute_deprecated double av_int2dbl(int64_t v) av_const;
|
||||
attribute_deprecated float av_int2flt(int32_t v) av_const;
|
||||
attribute_deprecated double av_ext2dbl(const AVExtFloat ext) av_const;
|
||||
attribute_deprecated int64_t av_dbl2int(double d) av_const;
|
||||
attribute_deprecated int32_t av_flt2int(float d) av_const;
|
||||
attribute_deprecated AVExtFloat av_dbl2ext(double d) av_const;
|
||||
|
||||
#endif /* AVUTIL_INTFLOAT_READWRITE_H */
|
||||
|
35
3rdparty/include/ffmpeg_/libavutil/log.h
vendored
35
3rdparty/include/ffmpeg_/libavutil/log.h
vendored
@ -23,13 +23,14 @@
|
||||
|
||||
#include <stdarg.h>
|
||||
#include "avutil.h"
|
||||
#include "attributes.h"
|
||||
|
||||
/**
|
||||
* Describe the class of an AVClass context structure. That is an
|
||||
* arbitrary struct of which the first field is a pointer to an
|
||||
* AVClass struct (e.g. AVCodecContext, AVFormatContext etc.).
|
||||
*/
|
||||
typedef struct {
|
||||
typedef struct AVClass {
|
||||
/**
|
||||
* The name of the class; usually it is the same name as the
|
||||
* context structure type to which the AVClass is associated.
|
||||
@ -72,11 +73,19 @@ typedef struct {
|
||||
int parent_log_context_offset;
|
||||
|
||||
/**
|
||||
* A function for extended searching, e.g. in possible
|
||||
* children objects.
|
||||
* Return next AVOptions-enabled child or NULL
|
||||
*/
|
||||
const struct AVOption* (*opt_find)(void *obj, const char *name, const char *unit,
|
||||
int opt_flags, int search_flags);
|
||||
void* (*child_next)(void *obj, void *prev);
|
||||
|
||||
/**
|
||||
* Return an AVClass corresponding to next potential
|
||||
* AVOptions-enabled child.
|
||||
*
|
||||
* The difference between child_next and this is that
|
||||
* child_next iterates over _already existing_ objects, while
|
||||
* child_class_next iterates over _all possible_ children.
|
||||
*/
|
||||
const struct AVClass* (*child_class_next)(const struct AVClass *prev);
|
||||
} AVClass;
|
||||
|
||||
/* av_log API */
|
||||
@ -129,11 +138,7 @@ typedef struct {
|
||||
* subsequent arguments are converted to output.
|
||||
* @see av_vlog
|
||||
*/
|
||||
#ifdef __GNUC__
|
||||
void av_log(void *avcl, int level, const char *fmt, ...) __attribute__ ((__format__ (__printf__, 3, 4)));
|
||||
#else
|
||||
void av_log(void *avcl, int level, const char *fmt, ...);
|
||||
#endif
|
||||
void av_log(void *avcl, int level, const char *fmt, ...) av_printf_format(3, 4);
|
||||
|
||||
void av_vlog(void *avcl, int level, const char *fmt, va_list);
|
||||
int av_log_get_level(void);
|
||||
@ -142,6 +147,16 @@ void av_log_set_callback(void (*)(void*, int, const char*, va_list));
|
||||
void av_log_default_callback(void* ptr, int level, const char* fmt, va_list vl);
|
||||
const char* av_default_item_name(void* ctx);
|
||||
|
||||
/**
|
||||
* Format a line of log the same way as the default callback.
|
||||
* @param line buffer to receive the formated line
|
||||
* @param line_size size of the buffer
|
||||
* @param print_prefix used to store whether the prefix must be printed;
|
||||
* must point to a persistent integer initially set to 1
|
||||
*/
|
||||
void av_log_format_line(void *ptr, int level, const char *fmt, va_list vl,
|
||||
char *line, int line_size, int *print_prefix);
|
||||
|
||||
/**
|
||||
* av_dlog macros
|
||||
* Useful to print debug messages that shouldn't get compiled in normally.
|
||||
|
43
3rdparty/include/ffmpeg_/libavutil/lzo.h
vendored
43
3rdparty/include/ffmpeg_/libavutil/lzo.h
vendored
@ -22,30 +22,37 @@
|
||||
#ifndef AVUTIL_LZO_H
|
||||
#define AVUTIL_LZO_H
|
||||
|
||||
/**
|
||||
* @defgroup lavu_lzo LZO
|
||||
* @ingroup lavu_crypto
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
/** @name Error flags returned by av_lzo1x_decode
|
||||
* \{ */
|
||||
//! end of the input buffer reached before decoding finished
|
||||
* @{ */
|
||||
/// end of the input buffer reached before decoding finished
|
||||
#define AV_LZO_INPUT_DEPLETED 1
|
||||
//! decoded data did not fit into output buffer
|
||||
/// decoded data did not fit into output buffer
|
||||
#define AV_LZO_OUTPUT_FULL 2
|
||||
//! a reference to previously decoded data was wrong
|
||||
/// a reference to previously decoded data was wrong
|
||||
#define AV_LZO_INVALID_BACKPTR 4
|
||||
//! a non-specific error in the compressed bitstream
|
||||
/// a non-specific error in the compressed bitstream
|
||||
#define AV_LZO_ERROR 8
|
||||
/** \} */
|
||||
/** @} */
|
||||
|
||||
#define AV_LZO_INPUT_PADDING 8
|
||||
#define AV_LZO_OUTPUT_PADDING 12
|
||||
|
||||
/**
|
||||
* \brief Decodes LZO 1x compressed data.
|
||||
* \param out output buffer
|
||||
* \param outlen size of output buffer, number of bytes left are returned here
|
||||
* \param in input buffer
|
||||
* \param inlen size of input buffer, number of bytes left are returned here
|
||||
* \return 0 on success, otherwise a combination of the error flags above
|
||||
* @brief Decodes LZO 1x compressed data.
|
||||
* @param out output buffer
|
||||
* @param outlen size of output buffer, number of bytes left are returned here
|
||||
* @param in input buffer
|
||||
* @param inlen size of input buffer, number of bytes left are returned here
|
||||
* @return 0 on success, otherwise a combination of the error flags above
|
||||
*
|
||||
* Make sure all buffers are appropriately padded, in must provide
|
||||
* AV_LZO_INPUT_PADDING, out must provide AV_LZO_OUTPUT_PADDING additional bytes.
|
||||
@ -53,14 +60,18 @@
|
||||
int av_lzo1x_decode(void *out, int *outlen, const void *in, int *inlen);
|
||||
|
||||
/**
|
||||
* \brief deliberately overlapping memcpy implementation
|
||||
* \param dst destination buffer; must be padded with 12 additional bytes
|
||||
* \param back how many bytes back we start (the initial size of the overlapping window)
|
||||
* \param cnt number of bytes to copy, must be >= 0
|
||||
* @brief deliberately overlapping memcpy implementation
|
||||
* @param dst destination buffer; must be padded with 12 additional bytes
|
||||
* @param back how many bytes back we start (the initial size of the overlapping window), must be > 0
|
||||
* @param cnt number of bytes to copy, must be >= 0
|
||||
*
|
||||
* cnt > back is valid, this will copy the bytes we just copied,
|
||||
* thus creating a repeating pattern with a period length of back.
|
||||
*/
|
||||
void av_memcpy_backptr(uint8_t *dst, int back, int cnt);
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#endif /* AVUTIL_LZO_H */
|
||||
|
10
3rdparty/include/ffmpeg_/libavutil/mathematics.h
vendored
10
3rdparty/include/ffmpeg_/libavutil/mathematics.h
vendored
@ -57,6 +57,12 @@
|
||||
#define INFINITY (1.0/0.0)
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @addtogroup lavu_math
|
||||
* @{
|
||||
*/
|
||||
|
||||
|
||||
enum AVRounding {
|
||||
AV_ROUND_ZERO = 0, ///< Round toward zero.
|
||||
AV_ROUND_INF = 1, ///< Round away from zero.
|
||||
@ -109,4 +115,8 @@ int av_compare_ts(int64_t ts_a, AVRational tb_a, int64_t ts_b, AVRational tb_b);
|
||||
*/
|
||||
int64_t av_compare_mod(uint64_t a, uint64_t b, uint64_t mod);
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#endif /* AVUTIL_MATHEMATICS_H */
|
||||
|
10
3rdparty/include/ffmpeg_/libavutil/md5.h
vendored
10
3rdparty/include/ffmpeg_/libavutil/md5.h
vendored
@ -23,6 +23,12 @@
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
/**
|
||||
* @defgroup lavu_md5 MD5
|
||||
* @ingroup lavu_crypto
|
||||
* @{
|
||||
*/
|
||||
|
||||
extern const int av_md5_size;
|
||||
|
||||
struct AVMD5;
|
||||
@ -32,5 +38,9 @@ void av_md5_update(struct AVMD5 *ctx, const uint8_t *src, const int len);
|
||||
void av_md5_final(struct AVMD5 *ctx, uint8_t *dst);
|
||||
void av_md5_sum(uint8_t *dst, const uint8_t *src, const int len);
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#endif /* AVUTIL_MD5_H */
|
||||
|
||||
|
57
3rdparty/include/ffmpeg_/libavutil/mem.h
vendored
57
3rdparty/include/ffmpeg_/libavutil/mem.h
vendored
@ -27,8 +27,15 @@
|
||||
#define AVUTIL_MEM_H
|
||||
|
||||
#include "attributes.h"
|
||||
#include "error.h"
|
||||
#include "avutil.h"
|
||||
|
||||
/**
|
||||
* @addtogroup lavu_mem
|
||||
* @{
|
||||
*/
|
||||
|
||||
|
||||
#if defined(__INTEL_COMPILER) && __INTEL_COMPILER < 1110 || defined(__SUNPRO_C)
|
||||
#define DECLARE_ALIGNED(n,t,v) t __attribute__ ((aligned (n))) v
|
||||
#define DECLARE_ASM_CONST(n,t,v) const t __attribute__ ((aligned (n))) v
|
||||
@ -76,16 +83,26 @@ void *av_malloc(size_t size) av_malloc_attrib av_alloc_size(1);
|
||||
* Allocate or reallocate a block of memory.
|
||||
* If ptr is NULL and size > 0, allocate a new block. If
|
||||
* size is zero, free the memory block pointed to by ptr.
|
||||
* @param size Size in bytes for the memory block to be allocated or
|
||||
* reallocated.
|
||||
* @param ptr Pointer to a memory block already allocated with
|
||||
* av_malloc(z)() or av_realloc() or NULL.
|
||||
* @param size Size in bytes for the memory block to be allocated or
|
||||
* reallocated.
|
||||
* @return Pointer to a newly reallocated block or NULL if the block
|
||||
* cannot be reallocated or the function is used to free the memory block.
|
||||
* @see av_fast_realloc()
|
||||
*/
|
||||
void *av_realloc(void *ptr, size_t size) av_alloc_size(2);
|
||||
|
||||
/**
|
||||
* Allocate or reallocate a block of memory.
|
||||
* This function does the same thing as av_realloc, except:
|
||||
* - It takes two arguments and checks the result of the multiplication for
|
||||
* integer overflow.
|
||||
* - It frees the input block in case of failure, thus avoiding the memory
|
||||
* leak with the classic "buf = realloc(buf); if (!buf) return -1;".
|
||||
*/
|
||||
void *av_realloc_f(void *ptr, size_t nelem, size_t elsize);
|
||||
|
||||
/**
|
||||
* Free a memory block which has been allocated with av_malloc(z)() or
|
||||
* av_realloc().
|
||||
@ -106,6 +123,18 @@ void av_free(void *ptr);
|
||||
*/
|
||||
void *av_mallocz(size_t size) av_malloc_attrib av_alloc_size(1);
|
||||
|
||||
/**
|
||||
* Allocate a block of nmemb * size bytes with alignment suitable for all
|
||||
* memory accesses (including vectors if available on the CPU) and
|
||||
* zero all the bytes of the block.
|
||||
* The allocation will fail if nmemb * size is greater than or equal
|
||||
* to INT_MAX.
|
||||
* @param nmemb
|
||||
* @param size
|
||||
* @return Pointer to the allocated block, NULL if it cannot be allocated.
|
||||
*/
|
||||
void *av_calloc(size_t nmemb, size_t size) av_malloc_attrib;
|
||||
|
||||
/**
|
||||
* Duplicate the string s.
|
||||
* @param s string to be duplicated
|
||||
@ -132,4 +161,28 @@ void av_freep(void *ptr);
|
||||
*/
|
||||
void av_dynarray_add(void *tab_ptr, int *nb_ptr, void *elem);
|
||||
|
||||
/**
|
||||
* Multiply two size_t values checking for overflow.
|
||||
* @return 0 if success, AVERROR(EINVAL) if overflow.
|
||||
*/
|
||||
static inline int av_size_mult(size_t a, size_t b, size_t *r)
|
||||
{
|
||||
size_t t = a * b;
|
||||
/* Hack inspired from glibc: only try the division if nelem and elsize
|
||||
* are both greater than sqrt(SIZE_MAX). */
|
||||
if ((a | b) >= ((size_t)1 << (sizeof(size_t) * 4)) && a && t / a != b)
|
||||
return AVERROR(EINVAL);
|
||||
*r = t;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the maximum size that may me allocated in one block.
|
||||
*/
|
||||
void av_max_alloc(size_t max);
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#endif /* AVUTIL_MEM_H */
|
||||
|
380
3rdparty/include/ffmpeg_/libavutil/opt.h
vendored
380
3rdparty/include/ffmpeg_/libavutil/opt.h
vendored
@ -30,9 +30,203 @@
|
||||
#include "rational.h"
|
||||
#include "avutil.h"
|
||||
#include "dict.h"
|
||||
#include "log.h"
|
||||
|
||||
/**
|
||||
* @defgroup avoptions AVOptions
|
||||
* @ingroup lavu_data
|
||||
* @{
|
||||
* AVOptions provide a generic system to declare options on arbitrary structs
|
||||
* ("objects"). An option can have a help text, a type and a range of possible
|
||||
* values. Options may then be enumerated, read and written to.
|
||||
*
|
||||
* @section avoptions_implement Implementing AVOptions
|
||||
* This section describes how to add AVOptions capabilities to a struct.
|
||||
*
|
||||
* All AVOptions-related information is stored in an AVClass. Therefore
|
||||
* the first member of the struct must be a pointer to an AVClass describing it.
|
||||
* The option field of the AVClass must be set to a NULL-terminated static array
|
||||
* of AVOptions. Each AVOption must have a non-empty name, a type, a default
|
||||
* value and for number-type AVOptions also a range of allowed values. It must
|
||||
* also declare an offset in bytes from the start of the struct, where the field
|
||||
* associated with this AVOption is located. Other fields in the AVOption struct
|
||||
* should also be set when applicable, but are not required.
|
||||
*
|
||||
* The following example illustrates an AVOptions-enabled struct:
|
||||
* @code
|
||||
* typedef struct test_struct {
|
||||
* AVClass *class;
|
||||
* int int_opt;
|
||||
* char *str_opt;
|
||||
* uint8_t *bin_opt;
|
||||
* int bin_len;
|
||||
* } test_struct;
|
||||
*
|
||||
* static const AVOption options[] = {
|
||||
* { "test_int", "This is a test option of int type.", offsetof(test_struct, int_opt),
|
||||
* AV_OPT_TYPE_INT, { -1 }, INT_MIN, INT_MAX },
|
||||
* { "test_str", "This is a test option of string type.", offsetof(test_struct, str_opt),
|
||||
* AV_OPT_TYPE_STRING },
|
||||
* { "test_bin", "This is a test option of binary type.", offsetof(test_struct, bin_opt),
|
||||
* AV_OPT_TYPE_BINARY },
|
||||
* { NULL },
|
||||
* };
|
||||
*
|
||||
* static const AVClass test_class = {
|
||||
* .class_name = "test class",
|
||||
* .item_name = av_default_item_name,
|
||||
* .option = options,
|
||||
* .version = LIBAVUTIL_VERSION_INT,
|
||||
* };
|
||||
* @endcode
|
||||
*
|
||||
* Next, when allocating your struct, you must ensure that the AVClass pointer
|
||||
* is set to the correct value. Then, av_opt_set_defaults() must be called to
|
||||
* initialize defaults. After that the struct is ready to be used with the
|
||||
* AVOptions API.
|
||||
*
|
||||
* When cleaning up, you may use the av_opt_free() function to automatically
|
||||
* free all the allocated string and binary options.
|
||||
*
|
||||
* Continuing with the above example:
|
||||
*
|
||||
* @code
|
||||
* test_struct *alloc_test_struct(void)
|
||||
* {
|
||||
* test_struct *ret = av_malloc(sizeof(*ret));
|
||||
* ret->class = &test_class;
|
||||
* av_opt_set_defaults(ret);
|
||||
* return ret;
|
||||
* }
|
||||
* void free_test_struct(test_struct **foo)
|
||||
* {
|
||||
* av_opt_free(*foo);
|
||||
* av_freep(foo);
|
||||
* }
|
||||
* @endcode
|
||||
*
|
||||
* @subsection avoptions_implement_nesting Nesting
|
||||
* It may happen that an AVOptions-enabled struct contains another
|
||||
* AVOptions-enabled struct as a member (e.g. AVCodecContext in
|
||||
* libavcodec exports generic options, while its priv_data field exports
|
||||
* codec-specific options). In such a case, it is possible to set up the
|
||||
* parent struct to export a child's options. To do that, simply
|
||||
* implement AVClass.child_next() and AVClass.child_class_next() in the
|
||||
* parent struct's AVClass.
|
||||
* Assuming that the test_struct from above now also contains a
|
||||
* child_struct field:
|
||||
*
|
||||
* @code
|
||||
* typedef struct child_struct {
|
||||
* AVClass *class;
|
||||
* int flags_opt;
|
||||
* } child_struct;
|
||||
* static const AVOption child_opts[] = {
|
||||
* { "test_flags", "This is a test option of flags type.",
|
||||
* offsetof(child_struct, flags_opt), AV_OPT_TYPE_FLAGS, { 0 }, INT_MIN, INT_MAX },
|
||||
* { NULL },
|
||||
* };
|
||||
* static const AVClass child_class = {
|
||||
* .class_name = "child class",
|
||||
* .item_name = av_default_item_name,
|
||||
* .option = child_opts,
|
||||
* .version = LIBAVUTIL_VERSION_INT,
|
||||
* };
|
||||
*
|
||||
* void *child_next(void *obj, void *prev)
|
||||
* {
|
||||
* test_struct *t = obj;
|
||||
* if (!prev && t->child_struct)
|
||||
* return t->child_struct;
|
||||
* return NULL
|
||||
* }
|
||||
* const AVClass child_class_next(const AVClass *prev)
|
||||
* {
|
||||
* return prev ? NULL : &child_class;
|
||||
* }
|
||||
* @endcode
|
||||
* Putting child_next() and child_class_next() as defined above into
|
||||
* test_class will now make child_struct's options accessible through
|
||||
* test_struct (again, proper setup as described above needs to be done on
|
||||
* child_struct right after it is created).
|
||||
*
|
||||
* From the above example it might not be clear why both child_next()
|
||||
* and child_class_next() are needed. The distinction is that child_next()
|
||||
* iterates over actually existing objects, while child_class_next()
|
||||
* iterates over all possible child classes. E.g. if an AVCodecContext
|
||||
* was initialized to use a codec which has private options, then its
|
||||
* child_next() will return AVCodecContext.priv_data and finish
|
||||
* iterating. OTOH child_class_next() on AVCodecContext.av_class will
|
||||
* iterate over all available codecs with private options.
|
||||
*
|
||||
* @subsection avoptions_implement_named_constants Named constants
|
||||
* It is possible to create named constants for options. Simply set the unit
|
||||
* field of the option the constants should apply to to a string and
|
||||
* create the constants themselves as options of type AV_OPT_TYPE_CONST
|
||||
* with their unit field set to the same string.
|
||||
* Their default_val field should contain the value of the named
|
||||
* constant.
|
||||
* For example, to add some named constants for the test_flags option
|
||||
* above, put the following into the child_opts array:
|
||||
* @code
|
||||
* { "test_flags", "This is a test option of flags type.",
|
||||
* offsetof(child_struct, flags_opt), AV_OPT_TYPE_FLAGS, { 0 }, INT_MIN, INT_MAX, "test_unit" },
|
||||
* { "flag1", "This is a flag with value 16", 0, AV_OPT_TYPE_CONST, { 16 }, 0, 0, "test_unit" },
|
||||
* @endcode
|
||||
*
|
||||
* @section avoptions_use Using AVOptions
|
||||
* This section deals with accessing options in an AVOptions-enabled struct.
|
||||
* Such structs in FFmpeg are e.g. AVCodecContext in libavcodec or
|
||||
* AVFormatContext in libavformat.
|
||||
*
|
||||
* @subsection avoptions_use_examine Examining AVOptions
|
||||
* The basic functions for examining options are av_opt_next(), which iterates
|
||||
* over all options defined for one object, and av_opt_find(), which searches
|
||||
* for an option with the given name.
|
||||
*
|
||||
* The situation is more complicated with nesting. An AVOptions-enabled struct
|
||||
* may have AVOptions-enabled children. Passing the AV_OPT_SEARCH_CHILDREN flag
|
||||
* to av_opt_find() will make the function search children recursively.
|
||||
*
|
||||
* For enumerating there are basically two cases. The first is when you want to
|
||||
* get all options that may potentially exist on the struct and its children
|
||||
* (e.g. when constructing documentation). In that case you should call
|
||||
* av_opt_child_class_next() recursively on the parent struct's AVClass. The
|
||||
* second case is when you have an already initialized struct with all its
|
||||
* children and you want to get all options that can be actually written or read
|
||||
* from it. In that case you should call av_opt_child_next() recursively (and
|
||||
* av_opt_next() on each result).
|
||||
*
|
||||
* @subsection avoptions_use_get_set Reading and writing AVOptions
|
||||
* When setting options, you often have a string read directly from the
|
||||
* user. In such a case, simply passing it to av_opt_set() is enough. For
|
||||
* non-string type options, av_opt_set() will parse the string according to the
|
||||
* option type.
|
||||
*
|
||||
* Similarly av_opt_get() will read any option type and convert it to a string
|
||||
* which will be returned. Do not forget that the string is allocated, so you
|
||||
* have to free it with av_free().
|
||||
*
|
||||
* In some cases it may be more convenient to put all options into an
|
||||
* AVDictionary and call av_opt_set_dict() on it. A specific case of this
|
||||
* are the format/codec open functions in lavf/lavc which take a dictionary
|
||||
* filled with option as a parameter. This allows to set some options
|
||||
* that cannot be set otherwise, since e.g. the input file format is not known
|
||||
* before the file is actually opened.
|
||||
*/
|
||||
|
||||
enum AVOptionType{
|
||||
FF_OPT_TYPE_FLAGS,
|
||||
AV_OPT_TYPE_FLAGS,
|
||||
AV_OPT_TYPE_INT,
|
||||
AV_OPT_TYPE_INT64,
|
||||
AV_OPT_TYPE_DOUBLE,
|
||||
AV_OPT_TYPE_FLOAT,
|
||||
AV_OPT_TYPE_STRING,
|
||||
AV_OPT_TYPE_RATIONAL,
|
||||
AV_OPT_TYPE_BINARY, ///< offset must point to a pointer immediately followed by an int for the length
|
||||
AV_OPT_TYPE_CONST = 128,
|
||||
#if FF_API_OLD_AVOPTIONS
|
||||
FF_OPT_TYPE_FLAGS = 0,
|
||||
FF_OPT_TYPE_INT,
|
||||
FF_OPT_TYPE_INT64,
|
||||
FF_OPT_TYPE_DOUBLE,
|
||||
@ -41,6 +235,7 @@ enum AVOptionType{
|
||||
FF_OPT_TYPE_RATIONAL,
|
||||
FF_OPT_TYPE_BINARY, ///< offset must point to a pointer immediately followed by an int for the length
|
||||
FF_OPT_TYPE_CONST=128,
|
||||
#endif
|
||||
};
|
||||
|
||||
/**
|
||||
@ -111,6 +306,7 @@ attribute_deprecated
|
||||
const AVOption *av_find_opt(void *obj, const char *name, const char *unit, int mask, int flags);
|
||||
#endif
|
||||
|
||||
#if FF_API_OLD_AVOPTIONS
|
||||
/**
|
||||
* Set the field of obj with the given name to value.
|
||||
*
|
||||
@ -129,25 +325,27 @@ const AVOption *av_find_opt(void *obj, const char *name, const char *unit, int m
|
||||
* similarly, '-' unsets a flag.
|
||||
* @param[out] o_out if non-NULL put here a pointer to the AVOption
|
||||
* found
|
||||
* @param alloc when 1 then the old value will be av_freed() and the
|
||||
* new av_strduped()
|
||||
* when 0 then no av_free() nor av_strdup() will be used
|
||||
* @param alloc this parameter is currently ignored
|
||||
* @return 0 if the value has been set, or an AVERROR code in case of
|
||||
* error:
|
||||
* AVERROR(ENOENT) if no matching option exists
|
||||
* AVERROR_OPTION_NOT_FOUND if no matching option exists
|
||||
* AVERROR(ERANGE) if the value is out of range
|
||||
* AVERROR(EINVAL) if the value is not valid
|
||||
* @deprecated use av_opt_set()
|
||||
*/
|
||||
attribute_deprecated
|
||||
int av_set_string3(void *obj, const char *name, const char *val, int alloc, const AVOption **o_out);
|
||||
|
||||
const AVOption *av_set_double(void *obj, const char *name, double n);
|
||||
const AVOption *av_set_q(void *obj, const char *name, AVRational n);
|
||||
const AVOption *av_set_int(void *obj, const char *name, int64_t n);
|
||||
attribute_deprecated const AVOption *av_set_double(void *obj, const char *name, double n);
|
||||
attribute_deprecated const AVOption *av_set_q(void *obj, const char *name, AVRational n);
|
||||
attribute_deprecated const AVOption *av_set_int(void *obj, const char *name, int64_t n);
|
||||
|
||||
double av_get_double(void *obj, const char *name, const AVOption **o_out);
|
||||
AVRational av_get_q(void *obj, const char *name, const AVOption **o_out);
|
||||
int64_t av_get_int(void *obj, const char *name, const AVOption **o_out);
|
||||
const char *av_get_string(void *obj, const char *name, const AVOption **o_out, char *buf, int buf_len);
|
||||
const AVOption *av_next_option(void *obj, const AVOption *last);
|
||||
attribute_deprecated const char *av_get_string(void *obj, const char *name, const AVOption **o_out, char *buf, int buf_len);
|
||||
attribute_deprecated const AVOption *av_next_option(void *obj, const AVOption *last);
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Show the obj options.
|
||||
@ -160,8 +358,17 @@ const AVOption *av_next_option(void *obj, const AVOption *last);
|
||||
*/
|
||||
int av_opt_show2(void *obj, void *av_log_obj, int req_flags, int rej_flags);
|
||||
|
||||
/**
|
||||
* Set the values of all AVOption fields to their default values.
|
||||
*
|
||||
* @param s an AVOption-enabled struct (its first member must be a pointer to AVClass)
|
||||
*/
|
||||
void av_opt_set_defaults(void *s);
|
||||
|
||||
#if FF_API_OLD_AVOPTIONS
|
||||
attribute_deprecated
|
||||
void av_opt_set_defaults2(void *s, int mask, int flags);
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Parse the key/value pairs list in opts. For each key/value pair
|
||||
@ -214,8 +421,39 @@ int av_opt_flag_is_set(void *obj, const char *field_name, const char *flag_name)
|
||||
*/
|
||||
int av_opt_set_dict(void *obj, struct AVDictionary **options);
|
||||
|
||||
/**
|
||||
* @defgroup opt_eval_funcs Evaluating option strings
|
||||
* @{
|
||||
* This group of functions can be used to evaluate option strings
|
||||
* and get numbers out of them. They do the same thing as av_opt_set(),
|
||||
* except the result is written into the caller-supplied pointer.
|
||||
*
|
||||
* @param obj a struct whose first element is a pointer to AVClass.
|
||||
* @param o an option for which the string is to be evaluated.
|
||||
* @param val string to be evaluated.
|
||||
* @param *_out value of the string will be written here.
|
||||
*
|
||||
* @return 0 on success, a negative number on failure.
|
||||
*/
|
||||
int av_opt_eval_flags (void *obj, const AVOption *o, const char *val, int *flags_out);
|
||||
int av_opt_eval_int (void *obj, const AVOption *o, const char *val, int *int_out);
|
||||
int av_opt_eval_int64 (void *obj, const AVOption *o, const char *val, int64_t *int64_out);
|
||||
int av_opt_eval_float (void *obj, const AVOption *o, const char *val, float *float_out);
|
||||
int av_opt_eval_double(void *obj, const AVOption *o, const char *val, double *double_out);
|
||||
int av_opt_eval_q (void *obj, const AVOption *o, const char *val, AVRational *q_out);
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#define AV_OPT_SEARCH_CHILDREN 0x0001 /**< Search in possible children of the
|
||||
given object first. */
|
||||
/**
|
||||
* The obj passed to av_opt_find() is fake -- only a double pointer to AVClass
|
||||
* instead of a required pointer to a struct containing AVClass. This is
|
||||
* useful for searching for options without needing to allocate the corresponding
|
||||
* object.
|
||||
*/
|
||||
#define AV_OPT_SEARCH_FAKE_OBJ 0x0002
|
||||
|
||||
/**
|
||||
* Look for an option in an object. Consider only options which
|
||||
@ -223,6 +461,8 @@ int av_opt_set_dict(void *obj, struct AVDictionary **options);
|
||||
*
|
||||
* @param[in] obj A pointer to a struct whose first element is a
|
||||
* pointer to an AVClass.
|
||||
* Alternatively a double pointer to an AVClass, if
|
||||
* AV_OPT_SEARCH_FAKE_OBJ search flag is set.
|
||||
* @param[in] name The name of the option to look for.
|
||||
* @param[in] unit When searching for named constants, name of the unit
|
||||
* it belongs to.
|
||||
@ -240,4 +480,124 @@ int av_opt_set_dict(void *obj, struct AVDictionary **options);
|
||||
const AVOption *av_opt_find(void *obj, const char *name, const char *unit,
|
||||
int opt_flags, int search_flags);
|
||||
|
||||
/**
|
||||
* Look for an option in an object. Consider only options which
|
||||
* have all the specified flags set.
|
||||
*
|
||||
* @param[in] obj A pointer to a struct whose first element is a
|
||||
* pointer to an AVClass.
|
||||
* Alternatively a double pointer to an AVClass, if
|
||||
* AV_OPT_SEARCH_FAKE_OBJ search flag is set.
|
||||
* @param[in] name The name of the option to look for.
|
||||
* @param[in] unit When searching for named constants, name of the unit
|
||||
* it belongs to.
|
||||
* @param opt_flags Find only options with all the specified flags set (AV_OPT_FLAG).
|
||||
* @param search_flags A combination of AV_OPT_SEARCH_*.
|
||||
* @param[out] target_obj if non-NULL, an object to which the option belongs will be
|
||||
* written here. It may be different from obj if AV_OPT_SEARCH_CHILDREN is present
|
||||
* in search_flags. This parameter is ignored if search_flags contain
|
||||
* AV_OPT_SEARCH_FAKE_OBJ.
|
||||
*
|
||||
* @return A pointer to the option found, or NULL if no option
|
||||
* was found.
|
||||
*/
|
||||
const AVOption *av_opt_find2(void *obj, const char *name, const char *unit,
|
||||
int opt_flags, int search_flags, void **target_obj);
|
||||
|
||||
/**
|
||||
* Iterate over all AVOptions belonging to obj.
|
||||
*
|
||||
* @param obj an AVOptions-enabled struct or a double pointer to an
|
||||
* AVClass describing it.
|
||||
* @param prev result of the previous call to av_opt_next() on this object
|
||||
* or NULL
|
||||
* @return next AVOption or NULL
|
||||
*/
|
||||
const AVOption *av_opt_next(void *obj, const AVOption *prev);
|
||||
|
||||
/**
|
||||
* Iterate over AVOptions-enabled children of obj.
|
||||
*
|
||||
* @param prev result of a previous call to this function or NULL
|
||||
* @return next AVOptions-enabled child or NULL
|
||||
*/
|
||||
void *av_opt_child_next(void *obj, void *prev);
|
||||
|
||||
/**
|
||||
* Iterate over potential AVOptions-enabled children of parent.
|
||||
*
|
||||
* @param prev result of a previous call to this function or NULL
|
||||
* @return AVClass corresponding to next potential child or NULL
|
||||
*/
|
||||
const AVClass *av_opt_child_class_next(const AVClass *parent, const AVClass *prev);
|
||||
|
||||
/**
|
||||
* @defgroup opt_set_funcs Option setting functions
|
||||
* @{
|
||||
* Those functions set the field of obj with the given name to value.
|
||||
*
|
||||
* @param[in] obj A struct whose first element is a pointer to an AVClass.
|
||||
* @param[in] name the name of the field to set
|
||||
* @param[in] val The value to set. In case of av_opt_set() if the field is not
|
||||
* of a string type, then the given string is parsed.
|
||||
* SI postfixes and some named scalars are supported.
|
||||
* If the field is of a numeric type, it has to be a numeric or named
|
||||
* scalar. Behavior with more than one scalar and +- infix operators
|
||||
* is undefined.
|
||||
* If the field is of a flags type, it has to be a sequence of numeric
|
||||
* scalars or named flags separated by '+' or '-'. Prefixing a flag
|
||||
* with '+' causes it to be set without affecting the other flags;
|
||||
* similarly, '-' unsets a flag.
|
||||
* @param search_flags flags passed to av_opt_find2. I.e. if AV_OPT_SEARCH_CHILDREN
|
||||
* is passed here, then the option may be set on a child of obj.
|
||||
*
|
||||
* @return 0 if the value has been set, or an AVERROR code in case of
|
||||
* error:
|
||||
* AVERROR_OPTION_NOT_FOUND if no matching option exists
|
||||
* AVERROR(ERANGE) if the value is out of range
|
||||
* AVERROR(EINVAL) if the value is not valid
|
||||
*/
|
||||
int av_opt_set (void *obj, const char *name, const char *val, int search_flags);
|
||||
int av_opt_set_int (void *obj, const char *name, int64_t val, int search_flags);
|
||||
int av_opt_set_double(void *obj, const char *name, double val, int search_flags);
|
||||
int av_opt_set_q (void *obj, const char *name, AVRational val, int search_flags);
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @defgroup opt_get_funcs Option getting functions
|
||||
* @{
|
||||
* Those functions get a value of the option with the given name from an object.
|
||||
*
|
||||
* @param[in] obj a struct whose first element is a pointer to an AVClass.
|
||||
* @param[in] name name of the option to get.
|
||||
* @param[in] search_flags flags passed to av_opt_find2. I.e. if AV_OPT_SEARCH_CHILDREN
|
||||
* is passed here, then the option may be found in a child of obj.
|
||||
* @param[out] out_val value of the option will be written here
|
||||
* @return 0 on success, a negative error code otherwise
|
||||
*/
|
||||
/**
|
||||
* @note the returned string will av_malloc()ed and must be av_free()ed by the caller
|
||||
*/
|
||||
int av_opt_get (void *obj, const char *name, int search_flags, uint8_t **out_val);
|
||||
int av_opt_get_int (void *obj, const char *name, int search_flags, int64_t *out_val);
|
||||
int av_opt_get_double(void *obj, const char *name, int search_flags, double *out_val);
|
||||
int av_opt_get_q (void *obj, const char *name, int search_flags, AVRational *out_val);
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
/**
|
||||
* Gets a pointer to the requested field in a struct.
|
||||
* This function allows accessing a struct even when its fields are moved or
|
||||
* renamed since the application making the access has been compiled,
|
||||
*
|
||||
* @returns a pointer to the field, it can be cast to the correct type and read
|
||||
* or written to.
|
||||
*/
|
||||
void *av_opt_ptr(const AVClass *avclass, void *obj, const char *name);
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#endif /* AVUTIL_OPT_H */
|
||||
|
11
3rdparty/include/ffmpeg_/libavutil/parseutils.h
vendored
11
3rdparty/include/ffmpeg_/libavutil/parseutils.h
vendored
@ -19,6 +19,8 @@
|
||||
#ifndef AVUTIL_PARSEUTILS_H
|
||||
#define AVUTIL_PARSEUTILS_H
|
||||
|
||||
#include <time.h>
|
||||
|
||||
#include "rational.h"
|
||||
|
||||
/**
|
||||
@ -73,7 +75,7 @@ int av_parse_color(uint8_t *rgba_color, const char *color_string, int slen,
|
||||
void *log_ctx);
|
||||
|
||||
/**
|
||||
* Parses timestr and returns in *time a corresponding number of
|
||||
* Parse timestr and return in *time a corresponding number of
|
||||
* microseconds.
|
||||
*
|
||||
* @param timeval puts here the number of microseconds corresponding
|
||||
@ -83,7 +85,7 @@ int av_parse_color(uint8_t *rgba_color, const char *color_string, int slen,
|
||||
* January, 1970 up to the time of the parsed date. If timestr cannot
|
||||
* be successfully parsed, set *time to INT64_MIN.
|
||||
|
||||
* @param datestr a string representing a date or a duration.
|
||||
* @param timestr a string representing a date or a duration.
|
||||
* - If a date the syntax is:
|
||||
* @code
|
||||
* [{YYYY-MM-DD|YYYYMMDD}[T|t| ]]{{HH[:MM[:SS[.m...]]]}|{HH[MM[SS[.m...]]]}}[Z]
|
||||
@ -114,4 +116,9 @@ int av_parse_time(int64_t *timeval, const char *timestr, int duration);
|
||||
*/
|
||||
int av_find_info_tag(char *arg, int arg_size, const char *tag1, const char *info);
|
||||
|
||||
/**
|
||||
* Convert the decomposed UTC time in tm to a time_t value.
|
||||
*/
|
||||
time_t av_timegm(struct tm *tm);
|
||||
|
||||
#endif /* AVUTIL_PARSEUTILS_H */
|
||||
|
2
3rdparty/include/ffmpeg_/libavutil/pixdesc.h
vendored
2
3rdparty/include/ffmpeg_/libavutil/pixdesc.h
vendored
@ -87,6 +87,8 @@ typedef struct AVPixFmtDescriptor{
|
||||
#define PIX_FMT_PAL 2 ///< Pixel format has a palette in data[1], values are indexes in this palette.
|
||||
#define PIX_FMT_BITSTREAM 4 ///< All values of a component are bit-wise packed end to end.
|
||||
#define PIX_FMT_HWACCEL 8 ///< Pixel format is an HW accelerated format.
|
||||
#define PIX_FMT_PLANAR 16 ///< At least one pixel component is not in the first data plane
|
||||
#define PIX_FMT_RGB 32 ///< The pixel format contains RGB-like data (as opposed to YUV/grayscale)
|
||||
|
||||
/**
|
||||
* The array of all the pixel format descriptors.
|
||||
|
63
3rdparty/include/ffmpeg_/libavutil/pixfmt.h
vendored
63
3rdparty/include/ffmpeg_/libavutil/pixfmt.h
vendored
@ -25,21 +25,21 @@
|
||||
* @file
|
||||
* pixel format definitions
|
||||
*
|
||||
* @warning This file has to be considered an internal but installed
|
||||
* header, so it should not be directly included in your projects.
|
||||
*/
|
||||
|
||||
#include "libavutil/avconfig.h"
|
||||
|
||||
/**
|
||||
* Pixel format. Notes:
|
||||
* Pixel format.
|
||||
*
|
||||
* @note
|
||||
* PIX_FMT_RGB32 is handled in an endian-specific manner. An RGBA
|
||||
* color is put together as:
|
||||
* (A << 24) | (R << 16) | (G << 8) | B
|
||||
* This is stored as BGRA on little-endian CPU architectures and ARGB on
|
||||
* big-endian CPUs.
|
||||
*
|
||||
* @par
|
||||
* When the pixel format is palettized RGB (PIX_FMT_PAL8), the palettized
|
||||
* image data is stored in AVFrame.data[0]. The palette is transported in
|
||||
* AVFrame.data[1], is 1024 bytes long (256 4-byte entries) and is
|
||||
@ -49,13 +49,15 @@
|
||||
* This is important as many custom PAL8 video codecs that were designed
|
||||
* to run on the IBM VGA graphics adapter use 6-bit palette components.
|
||||
*
|
||||
* @par
|
||||
* For all the 8bit per pixel formats, an RGB32 palette is in data[1] like
|
||||
* for pal8. This palette is filled in automatically by the function
|
||||
* allocating the picture.
|
||||
*
|
||||
* Note, make sure that all newly added big endian formats have pix_fmt&1==1
|
||||
* and that all newly added little endian formats have pix_fmt&1==0
|
||||
* this allows simpler detection of big vs little endian.
|
||||
* @note
|
||||
* make sure that all newly added big endian formats have pix_fmt&1==1
|
||||
* and that all newly added little endian formats have pix_fmt&1==0
|
||||
* this allows simpler detection of big vs little endian.
|
||||
*/
|
||||
enum PixelFormat {
|
||||
PIX_FMT_NONE= -1,
|
||||
@ -143,17 +145,45 @@ enum PixelFormat {
|
||||
PIX_FMT_YUV420P9LE, ///< planar YUV 4:2:0, 13.5bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
|
||||
PIX_FMT_YUV420P10BE,///< planar YUV 4:2:0, 15bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
|
||||
PIX_FMT_YUV420P10LE,///< planar YUV 4:2:0, 15bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
|
||||
PIX_FMT_YUV422P10BE,///< planar YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
|
||||
PIX_FMT_YUV422P10LE,///< planar YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
|
||||
PIX_FMT_YUV444P9BE, ///< planar YUV 4:4:4, 27bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
|
||||
PIX_FMT_YUV444P9LE, ///< planar YUV 4:4:4, 27bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
|
||||
PIX_FMT_YUV444P10BE,///< planar YUV 4:4:4, 30bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
|
||||
PIX_FMT_YUV444P10LE,///< planar YUV 4:4:4, 30bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
|
||||
PIX_FMT_YUV422P10BE,///< planar YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
|
||||
PIX_FMT_YUV422P10LE,///< planar YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
|
||||
PIX_FMT_YUV444P9BE, ///< planar YUV 4:4:4, 27bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
|
||||
PIX_FMT_YUV444P9LE, ///< planar YUV 4:4:4, 27bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
|
||||
PIX_FMT_YUV444P10BE,///< planar YUV 4:4:4, 30bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
|
||||
PIX_FMT_YUV444P10LE,///< planar YUV 4:4:4, 30bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
|
||||
PIX_FMT_YUV422P9BE, ///< planar YUV 4:2:2, 18bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
|
||||
PIX_FMT_YUV422P9LE, ///< planar YUV 4:2:2, 18bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
|
||||
PIX_FMT_VDA_VLD, ///< hardware decoding through VDA
|
||||
|
||||
#ifdef AV_PIX_FMT_ABI_GIT_MASTER
|
||||
PIX_FMT_RGBA64BE, ///< packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is stored as big-endian
|
||||
PIX_FMT_RGBA64LE, ///< packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is stored as little-endian
|
||||
PIX_FMT_BGRA64BE, ///< packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, the 2-byte value for each R/G/B/A component is stored as big-endian
|
||||
PIX_FMT_BGRA64LE, ///< packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, the 2-byte value for each R/G/B/A component is stored as little-endian
|
||||
#endif
|
||||
PIX_FMT_GBRP, ///< planar GBR 4:4:4 24bpp
|
||||
PIX_FMT_GBRP9BE, ///< planar GBR 4:4:4 27bpp, big endian
|
||||
PIX_FMT_GBRP9LE, ///< planar GBR 4:4:4 27bpp, little endian
|
||||
PIX_FMT_GBRP10BE, ///< planar GBR 4:4:4 30bpp, big endian
|
||||
PIX_FMT_GBRP10LE, ///< planar GBR 4:4:4 30bpp, little endian
|
||||
PIX_FMT_GBRP16BE, ///< planar GBR 4:4:4 48bpp, big endian
|
||||
PIX_FMT_GBRP16LE, ///< planar GBR 4:4:4 48bpp, little endian
|
||||
|
||||
#ifndef AV_PIX_FMT_ABI_GIT_MASTER
|
||||
PIX_FMT_RGBA64BE=0x123, ///< packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is stored as big-endian
|
||||
PIX_FMT_RGBA64LE, ///< packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is stored as little-endian
|
||||
PIX_FMT_BGRA64BE, ///< packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, the 2-byte value for each R/G/B/A component is stored as big-endian
|
||||
PIX_FMT_BGRA64LE, ///< packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, the 2-byte value for each R/G/B/A component is stored as little-endian
|
||||
#endif
|
||||
PIX_FMT_0RGB=0x123+4, ///< packed RGB 8:8:8, 32bpp, 0RGB0RGB...
|
||||
PIX_FMT_RGB0, ///< packed RGB 8:8:8, 32bpp, RGB0RGB0...
|
||||
PIX_FMT_0BGR, ///< packed BGR 8:8:8, 32bpp, 0BGR0BGR...
|
||||
PIX_FMT_BGR0, ///< packed BGR 8:8:8, 32bpp, BGR0BGR0...
|
||||
PIX_FMT_NB, ///< number of pixel formats, DO NOT USE THIS if you want to link with shared libav* because the number of formats might differ between versions
|
||||
};
|
||||
|
||||
#define PIX_FMT_Y400A PIX_FMT_GRAY8A
|
||||
#define PIX_FMT_GBR24P PIX_FMT_GBRP
|
||||
|
||||
#if AV_HAVE_BIGENDIAN
|
||||
# define PIX_FMT_NE(be, le) PIX_FMT_##be
|
||||
@ -165,6 +195,8 @@ enum PixelFormat {
|
||||
#define PIX_FMT_RGB32_1 PIX_FMT_NE(RGBA, ABGR)
|
||||
#define PIX_FMT_BGR32 PIX_FMT_NE(ABGR, RGBA)
|
||||
#define PIX_FMT_BGR32_1 PIX_FMT_NE(BGRA, ARGB)
|
||||
#define PIX_FMT_0RGB32 PIX_FMT_NE(0RGB, BGR0)
|
||||
#define PIX_FMT_0BGR32 PIX_FMT_NE(0BGR, RGB0)
|
||||
|
||||
#define PIX_FMT_GRAY16 PIX_FMT_NE(GRAY16BE, GRAY16LE)
|
||||
#define PIX_FMT_RGB48 PIX_FMT_NE(RGB48BE, RGB48LE)
|
||||
@ -177,6 +209,7 @@ enum PixelFormat {
|
||||
#define PIX_FMT_BGR444 PIX_FMT_NE(BGR444BE, BGR444LE)
|
||||
|
||||
#define PIX_FMT_YUV420P9 PIX_FMT_NE(YUV420P9BE , YUV420P9LE)
|
||||
#define PIX_FMT_YUV422P9 PIX_FMT_NE(YUV422P9BE , YUV422P9LE)
|
||||
#define PIX_FMT_YUV444P9 PIX_FMT_NE(YUV444P9BE , YUV444P9LE)
|
||||
#define PIX_FMT_YUV420P10 PIX_FMT_NE(YUV420P10BE, YUV420P10LE)
|
||||
#define PIX_FMT_YUV422P10 PIX_FMT_NE(YUV422P10BE, YUV422P10LE)
|
||||
@ -185,4 +218,10 @@ enum PixelFormat {
|
||||
#define PIX_FMT_YUV422P16 PIX_FMT_NE(YUV422P16BE, YUV422P16LE)
|
||||
#define PIX_FMT_YUV444P16 PIX_FMT_NE(YUV444P16BE, YUV444P16LE)
|
||||
|
||||
#define PIX_FMT_RGBA64 PIX_FMT_NE(RGBA64BE, RGBA64LE)
|
||||
#define PIX_FMT_BGRA64 PIX_FMT_NE(BGRA64BE, BGRA64LE)
|
||||
#define PIX_FMT_GBRP9 PIX_FMT_NE(GBRP9BE , GBRP9LE)
|
||||
#define PIX_FMT_GBRP10 PIX_FMT_NE(GBRP10BE, GBRP10LE)
|
||||
#define PIX_FMT_GBRP16 PIX_FMT_NE(GBRP16BE, GBRP16LE)
|
||||
|
||||
#endif /* AVUTIL_PIXFMT_H */
|
||||
|
12
3rdparty/include/ffmpeg_/libavutil/random_seed.h
vendored
12
3rdparty/include/ffmpeg_/libavutil/random_seed.h
vendored
@ -22,10 +22,22 @@
|
||||
#define AVUTIL_RANDOM_SEED_H
|
||||
|
||||
#include <stdint.h>
|
||||
/**
|
||||
* @addtogroup lavu_crypto
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* Get a seed to use in conjunction with random functions.
|
||||
* This function tries to provide a good seed at a best effort bases.
|
||||
* Its possible to call this function multiple times if more bits are needed.
|
||||
* It can be quite slow, which is why it should only be used as seed for a faster
|
||||
* PRNG. The quality of the seed depends on the platform.
|
||||
*/
|
||||
uint32_t av_get_random_seed(void);
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#endif /* AVUTIL_RANDOM_SEED_H */
|
||||
|
@ -32,6 +32,11 @@
|
||||
#include <limits.h>
|
||||
#include "attributes.h"
|
||||
|
||||
/**
|
||||
* @addtogroup lavu_math
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* rational number numerator/denominator
|
||||
*/
|
||||
@ -132,4 +137,8 @@ int av_nearer_q(AVRational q, AVRational q1, AVRational q2);
|
||||
*/
|
||||
int av_find_nearest_q_idx(AVRational q, const AVRational* q_list);
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#endif /* AVUTIL_RATIONAL_H */
|
||||
|
95
3rdparty/include/ffmpeg_/libavutil/samplefmt.h
vendored
95
3rdparty/include/ffmpeg_/libavutil/samplefmt.h
vendored
@ -31,6 +31,13 @@ enum AVSampleFormat {
|
||||
AV_SAMPLE_FMT_S32, ///< signed 32 bits
|
||||
AV_SAMPLE_FMT_FLT, ///< float
|
||||
AV_SAMPLE_FMT_DBL, ///< double
|
||||
|
||||
AV_SAMPLE_FMT_U8P, ///< unsigned 8 bits, planar
|
||||
AV_SAMPLE_FMT_S16P, ///< signed 16 bits, planar
|
||||
AV_SAMPLE_FMT_S32P, ///< signed 32 bits, planar
|
||||
AV_SAMPLE_FMT_FLTP, ///< float, planar
|
||||
AV_SAMPLE_FMT_DBLP, ///< double, planar
|
||||
|
||||
AV_SAMPLE_FMT_NB ///< Number of sample formats. DO NOT USE if linking dynamically
|
||||
};
|
||||
|
||||
@ -46,6 +53,14 @@ const char *av_get_sample_fmt_name(enum AVSampleFormat sample_fmt);
|
||||
*/
|
||||
enum AVSampleFormat av_get_sample_fmt(const char *name);
|
||||
|
||||
/**
|
||||
* Return the planar<->packed alternative form of the given sample format, or
|
||||
* AV_SAMPLE_FMT_NONE on error. If the passed sample_fmt is already in the
|
||||
* requested planar/packed format, the format returned is the same as the
|
||||
* input.
|
||||
*/
|
||||
enum AVSampleFormat av_get_alt_sample_fmt(enum AVSampleFormat sample_fmt, int planar);
|
||||
|
||||
/**
|
||||
* Generate a string corresponding to the sample format with
|
||||
* sample_fmt, or a header if sample_fmt is negative.
|
||||
@ -78,48 +93,64 @@ int av_get_bits_per_sample_fmt(enum AVSampleFormat sample_fmt);
|
||||
int av_get_bytes_per_sample(enum AVSampleFormat sample_fmt);
|
||||
|
||||
/**
|
||||
* Fill channel data pointers and linesizes for samples with sample
|
||||
* Check if the sample format is planar.
|
||||
*
|
||||
* @param sample_fmt the sample format to inspect
|
||||
* @return 1 if the sample format is planar, 0 if it is interleaved
|
||||
*/
|
||||
int av_sample_fmt_is_planar(enum AVSampleFormat sample_fmt);
|
||||
|
||||
/**
|
||||
* Get the required buffer size for the given audio parameters.
|
||||
*
|
||||
* @param[out] linesize calculated linesize, may be NULL
|
||||
* @param nb_channels the number of channels
|
||||
* @param nb_samples the number of samples in a single channel
|
||||
* @param sample_fmt the sample format
|
||||
* @return required buffer size, or negative error code on failure
|
||||
*/
|
||||
int av_samples_get_buffer_size(int *linesize, int nb_channels, int nb_samples,
|
||||
enum AVSampleFormat sample_fmt, int align);
|
||||
|
||||
/**
|
||||
* Fill channel data pointers and linesize for samples with sample
|
||||
* format sample_fmt.
|
||||
*
|
||||
* The pointers array is filled with the pointers to the samples data:
|
||||
* for planar, set the start point of each plane's data within the buffer,
|
||||
* for planar, set the start point of each channel's data within the buffer,
|
||||
* for packed, set the start point of the entire buffer only.
|
||||
*
|
||||
* The linesize array is filled with the aligned size of each samples
|
||||
* plane, that is linesize[i] will contain the linesize of the plane i,
|
||||
* and will be zero for all the unused planes. All linesize values are
|
||||
* equal.
|
||||
* The linesize array is filled with the aligned size of each channel's data
|
||||
* buffer for planar layout, or the aligned size of the buffer for all channels
|
||||
* for packed layout.
|
||||
*
|
||||
* @param pointers array to be filled with the pointer for each plane, may be NULL
|
||||
* @param linesizes array to be filled with the linesize, may be NULL
|
||||
* @param buf the pointer to a buffer containing the samples
|
||||
* @param nb_samples the number of samples in a single channel
|
||||
* @param planar 1 if the samples layout is planar, 0 if it is packed
|
||||
* @param nb_channels the number of channels
|
||||
* @return the total size of the buffer, a negative
|
||||
* error code in case of failure
|
||||
* @param[out] audio_data array to be filled with the pointer for each channel
|
||||
* @param[out] linesize calculated linesize
|
||||
* @param buf the pointer to a buffer containing the samples
|
||||
* @param nb_channels the number of channels
|
||||
* @param nb_samples the number of samples in a single channel
|
||||
* @param sample_fmt the sample format
|
||||
* @param align buffer size alignment (1 = no alignment required)
|
||||
* @return 0 on success or a negative error code on failure
|
||||
*/
|
||||
int av_samples_fill_arrays(uint8_t *pointers[8], int linesizes[8],
|
||||
uint8_t *buf, int nb_channels, int nb_samples,
|
||||
enum AVSampleFormat sample_fmt, int planar, int align);
|
||||
int av_samples_fill_arrays(uint8_t **audio_data, int *linesize, uint8_t *buf,
|
||||
int nb_channels, int nb_samples,
|
||||
enum AVSampleFormat sample_fmt, int align);
|
||||
|
||||
/**
|
||||
* Allocate a samples buffer for nb_samples samples, and
|
||||
* fill pointers and linesizes accordingly.
|
||||
* The allocated samples buffer has to be freed by using
|
||||
* av_freep(&pointers[0]).
|
||||
* Allocate a samples buffer for nb_samples samples, and fill data pointers and
|
||||
* linesize accordingly.
|
||||
* The allocated samples buffer can be freed by using av_freep(&audio_data[0])
|
||||
*
|
||||
* @param nb_channels number of audio channels
|
||||
* @param nb_samples number of samples per channel
|
||||
* @param planar 1 if the samples layout is planar, 0 if packed,
|
||||
* @param align the value to use for buffer size alignment
|
||||
* @return the size in bytes required for the samples buffer, a negative
|
||||
* error code in case of failure
|
||||
* @param[out] audio_data array to be filled with the pointer for each channel
|
||||
* @param[out] linesize aligned size for audio buffer(s)
|
||||
* @param nb_channels number of audio channels
|
||||
* @param nb_samples number of samples per channel
|
||||
* @param align buffer size alignment (1 = no alignment required)
|
||||
* @return 0 on success or a negative error code on failure
|
||||
* @see av_samples_fill_arrays()
|
||||
*/
|
||||
int av_samples_alloc(uint8_t *pointers[8], int linesizes[8],
|
||||
int nb_channels, int nb_samples,
|
||||
enum AVSampleFormat sample_fmt, int planar,
|
||||
int align);
|
||||
int av_samples_alloc(uint8_t **audio_data, int *linesize, int nb_channels,
|
||||
int nb_samples, enum AVSampleFormat sample_fmt, int align);
|
||||
|
||||
#endif /* AVCORE_SAMPLEFMT_H */
|
||||
#endif /* AVUTIL_SAMPLEFMT_H */
|
||||
|
10
3rdparty/include/ffmpeg_/libavutil/sha.h
vendored
10
3rdparty/include/ffmpeg_/libavutil/sha.h
vendored
@ -23,6 +23,12 @@
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
/**
|
||||
* @defgroup lavu_sha SHA
|
||||
* @ingroup lavu_crypto
|
||||
* @{
|
||||
*/
|
||||
|
||||
extern const int av_sha_size;
|
||||
|
||||
struct AVSHA;
|
||||
@ -53,4 +59,8 @@ void av_sha_update(struct AVSHA* context, const uint8_t* data, unsigned int len)
|
||||
*/
|
||||
void av_sha_final(struct AVSHA* context, uint8_t *digest);
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#endif /* AVUTIL_SHA_H */
|
||||
|
86
3rdparty/include/ffmpeg_/libswscale/swscale.h
vendored
86
3rdparty/include/ffmpeg_/libswscale/swscale.h
vendored
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2001-2003 Michael Niedermayer <michaelni@gmx.at>
|
||||
* Copyright (C) 2001-2011 Michael Niedermayer <michaelni@gmx.at>
|
||||
*
|
||||
* This file is part of FFmpeg.
|
||||
*
|
||||
@ -28,10 +28,12 @@
|
||||
*/
|
||||
|
||||
#include "libavutil/avutil.h"
|
||||
#include "libavutil/log.h"
|
||||
#include "libavutil/pixfmt.h"
|
||||
|
||||
#define LIBSWSCALE_VERSION_MAJOR 2
|
||||
#define LIBSWSCALE_VERSION_MINOR 0
|
||||
#define LIBSWSCALE_VERSION_MICRO 0
|
||||
#define LIBSWSCALE_VERSION_MINOR 1
|
||||
#define LIBSWSCALE_VERSION_MICRO 100
|
||||
|
||||
#define LIBSWSCALE_VERSION_INT AV_VERSION_INT(LIBSWSCALE_VERSION_MAJOR, \
|
||||
LIBSWSCALE_VERSION_MINOR, \
|
||||
@ -58,17 +60,17 @@
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Returns the LIBSWSCALE_VERSION_INT constant.
|
||||
* Return the LIBSWSCALE_VERSION_INT constant.
|
||||
*/
|
||||
unsigned swscale_version(void);
|
||||
|
||||
/**
|
||||
* Returns the libswscale build-time configuration.
|
||||
* Return the libswscale build-time configuration.
|
||||
*/
|
||||
const char *swscale_configuration(void);
|
||||
|
||||
/**
|
||||
* Returns the libswscale license.
|
||||
* Return the libswscale license.
|
||||
*/
|
||||
const char *swscale_license(void);
|
||||
|
||||
@ -125,7 +127,7 @@ const char *swscale_license(void);
|
||||
#define SWS_CS_DEFAULT 5
|
||||
|
||||
/**
|
||||
* Returns a pointer to yuv<->rgb coefficients for the given colorspace
|
||||
* Return a pointer to yuv<->rgb coefficients for the given colorspace
|
||||
* suitable for sws_setColorspaceDetails().
|
||||
*
|
||||
* @param colorspace One of the SWS_CS_* macros. If invalid,
|
||||
@ -133,7 +135,6 @@ const char *swscale_license(void);
|
||||
*/
|
||||
const int *sws_getCoefficients(int colorspace);
|
||||
|
||||
|
||||
// when used for filters they must have an odd number of elements
|
||||
// coeffs cannot be shared between vectors
|
||||
typedef struct {
|
||||
@ -152,26 +153,26 @@ typedef struct {
|
||||
struct SwsContext;
|
||||
|
||||
/**
|
||||
* Returns a positive value if pix_fmt is a supported input format, 0
|
||||
* Return a positive value if pix_fmt is a supported input format, 0
|
||||
* otherwise.
|
||||
*/
|
||||
int sws_isSupportedInput(enum PixelFormat pix_fmt);
|
||||
|
||||
/**
|
||||
* Returns a positive value if pix_fmt is a supported output format, 0
|
||||
* Return a positive value if pix_fmt is a supported output format, 0
|
||||
* otherwise.
|
||||
*/
|
||||
int sws_isSupportedOutput(enum PixelFormat pix_fmt);
|
||||
|
||||
/**
|
||||
* Allocates an empty SwsContext. This must be filled and passed to
|
||||
* Allocate an empty SwsContext. This must be filled and passed to
|
||||
* sws_init_context(). For filling see AVOptions, options.c and
|
||||
* sws_setColorspaceDetails().
|
||||
*/
|
||||
struct SwsContext *sws_alloc_context(void);
|
||||
|
||||
/**
|
||||
* Initializes the swscaler context sws_context.
|
||||
* Initialize the swscaler context sws_context.
|
||||
*
|
||||
* @return zero or positive value on success, a negative value on
|
||||
* error
|
||||
@ -179,14 +180,14 @@ struct SwsContext *sws_alloc_context(void);
|
||||
int sws_init_context(struct SwsContext *sws_context, SwsFilter *srcFilter, SwsFilter *dstFilter);
|
||||
|
||||
/**
|
||||
* Frees the swscaler context swsContext.
|
||||
* Free the swscaler context swsContext.
|
||||
* If swsContext is NULL, then does nothing.
|
||||
*/
|
||||
void sws_freeContext(struct SwsContext *swsContext);
|
||||
|
||||
#if FF_API_SWS_GETCONTEXT
|
||||
/**
|
||||
* Allocates and returns a SwsContext. You need it to perform
|
||||
* Allocate and return an SwsContext. You need it to perform
|
||||
* scaling/conversion operations using sws_scale().
|
||||
*
|
||||
* @param srcW the width of the source image
|
||||
@ -208,7 +209,7 @@ struct SwsContext *sws_getContext(int srcW, int srcH, enum PixelFormat srcFormat
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Scales the image slice in srcSlice and puts the resulting scaled
|
||||
* Scale the image slice in srcSlice and put the resulting scaled
|
||||
* slice in the image in dst. A slice is a sequence of consecutive
|
||||
* rows in an image.
|
||||
*
|
||||
@ -216,7 +217,7 @@ struct SwsContext *sws_getContext(int srcW, int srcH, enum PixelFormat srcFormat
|
||||
* top-bottom or bottom-top order. If slices are provided in
|
||||
* non-sequential order the behavior of the function is undefined.
|
||||
*
|
||||
* @param context the scaling context previously created with
|
||||
* @param c the scaling context previously created with
|
||||
* sws_getContext()
|
||||
* @param srcSlice the array containing the pointers to the planes of
|
||||
* the source slice
|
||||
@ -233,17 +234,9 @@ struct SwsContext *sws_getContext(int srcW, int srcH, enum PixelFormat srcFormat
|
||||
* the destination image
|
||||
* @return the height of the output slice
|
||||
*/
|
||||
int sws_scale(struct SwsContext *context, const uint8_t* const srcSlice[], const int srcStride[],
|
||||
int srcSliceY, int srcSliceH, uint8_t* const dst[], const int dstStride[]);
|
||||
|
||||
#if LIBSWSCALE_VERSION_MAJOR < 1
|
||||
/**
|
||||
* @deprecated Use sws_scale() instead.
|
||||
*/
|
||||
int sws_scale_ordered(struct SwsContext *context, const uint8_t* const src[],
|
||||
int srcStride[], int srcSliceY, int srcSliceH,
|
||||
uint8_t* dst[], int dstStride[]) attribute_deprecated;
|
||||
#endif
|
||||
int sws_scale(struct SwsContext *c, const uint8_t *const srcSlice[],
|
||||
const int srcStride[], int srcSliceY, int srcSliceH,
|
||||
uint8_t *const dst[], const int dstStride[]);
|
||||
|
||||
/**
|
||||
* @param inv_table the yuv2rgb coefficients, normally ff_yuv2rgb_coeffs[x]
|
||||
@ -261,35 +254,35 @@ int sws_getColorspaceDetails(struct SwsContext *c, int **inv_table,
|
||||
int *brightness, int *contrast, int *saturation);
|
||||
|
||||
/**
|
||||
* Allocates and returns an uninitialized vector with length coefficients.
|
||||
* Allocate and return an uninitialized vector with length coefficients.
|
||||
*/
|
||||
SwsVector *sws_allocVec(int length);
|
||||
|
||||
/**
|
||||
* Returns a normalized Gaussian curve used to filter stuff
|
||||
* quality=3 is high quality, lower is lower quality.
|
||||
* Return a normalized Gaussian curve used to filter stuff
|
||||
* quality = 3 is high quality, lower is lower quality.
|
||||
*/
|
||||
SwsVector *sws_getGaussianVec(double variance, double quality);
|
||||
|
||||
/**
|
||||
* Allocates and returns a vector with length coefficients, all
|
||||
* Allocate and return a vector with length coefficients, all
|
||||
* with the same value c.
|
||||
*/
|
||||
SwsVector *sws_getConstVec(double c, int length);
|
||||
|
||||
/**
|
||||
* Allocates and returns a vector with just one coefficient, with
|
||||
* Allocate and return a vector with just one coefficient, with
|
||||
* value 1.0.
|
||||
*/
|
||||
SwsVector *sws_getIdentityVec(void);
|
||||
|
||||
/**
|
||||
* Scales all the coefficients of a by the scalar value.
|
||||
* Scale all the coefficients of a by the scalar value.
|
||||
*/
|
||||
void sws_scaleVec(SwsVector *a, double scalar);
|
||||
|
||||
/**
|
||||
* Scales all the coefficients of a so that their sum equals height.
|
||||
* Scale all the coefficients of a so that their sum equals height.
|
||||
*/
|
||||
void sws_normalizeVec(SwsVector *a, double height);
|
||||
void sws_convVec(SwsVector *a, SwsVector *b);
|
||||
@ -298,20 +291,13 @@ void sws_subVec(SwsVector *a, SwsVector *b);
|
||||
void sws_shiftVec(SwsVector *a, int shift);
|
||||
|
||||
/**
|
||||
* Allocates and returns a clone of the vector a, that is a vector
|
||||
* Allocate and return a clone of the vector a, that is a vector
|
||||
* with the same coefficients as a.
|
||||
*/
|
||||
SwsVector *sws_cloneVec(SwsVector *a);
|
||||
|
||||
#if LIBSWSCALE_VERSION_MAJOR < 1
|
||||
/**
|
||||
* @deprecated Use sws_printVec2() instead.
|
||||
*/
|
||||
attribute_deprecated void sws_printVec(SwsVector *a);
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Prints with av_log() a textual representation of the vector a
|
||||
* Print with av_log() a textual representation of the vector a
|
||||
* if log_level <= av_log_level.
|
||||
*/
|
||||
void sws_printVec2(SwsVector *a, AVClass *log_ctx, int log_level);
|
||||
@ -325,8 +311,7 @@ SwsFilter *sws_getDefaultFilter(float lumaGBlur, float chromaGBlur,
|
||||
void sws_freeFilter(SwsFilter *filter);
|
||||
|
||||
/**
|
||||
* Checks if context can be reused, otherwise reallocates a new
|
||||
* one.
|
||||
* Check if context can be reused, otherwise reallocate a new one.
|
||||
*
|
||||
* If context is NULL, just calls sws_getContext() to get a new
|
||||
* context. Otherwise, checks if the parameters are the ones already
|
||||
@ -344,7 +329,7 @@ struct SwsContext *sws_getCachedContext(struct SwsContext *context,
|
||||
SwsFilter *dstFilter, const double *param);
|
||||
|
||||
/**
|
||||
* Converts an 8bit paletted frame into a frame with a color depth of 32-bits.
|
||||
* Convert an 8-bit paletted frame into a frame with a color depth of 32 bits.
|
||||
*
|
||||
* The output frame will have the same packed format as the palette.
|
||||
*
|
||||
@ -356,7 +341,7 @@ struct SwsContext *sws_getCachedContext(struct SwsContext *context,
|
||||
void sws_convertPalette8ToPacked32(const uint8_t *src, uint8_t *dst, int num_pixels, const uint8_t *palette);
|
||||
|
||||
/**
|
||||
* Converts an 8bit paletted frame into a frame with a color depth of 24 bits.
|
||||
* Convert an 8-bit paletted frame into a frame with a color depth of 24 bits.
|
||||
*
|
||||
* With the palette format "ABCD", the destination frame ends up with the format "ABC".
|
||||
*
|
||||
@ -367,5 +352,12 @@ void sws_convertPalette8ToPacked32(const uint8_t *src, uint8_t *dst, int num_pix
|
||||
*/
|
||||
void sws_convertPalette8ToPacked24(const uint8_t *src, uint8_t *dst, int num_pixels, const uint8_t *palette);
|
||||
|
||||
/**
|
||||
* Get the AVClass for swsContext. It can be used in combination with
|
||||
* AV_OPT_SEARCH_FAKE_OBJ for examining options.
|
||||
*
|
||||
* @see av_opt_find().
|
||||
*/
|
||||
const AVClass *sws_get_class(void);
|
||||
|
||||
#endif /* SWSCALE_SWSCALE_H */
|
||||
|
BIN
3rdparty/lib/armeabi-v7a/libnative_camera_r2.2.0.so
vendored
BIN
3rdparty/lib/armeabi-v7a/libnative_camera_r2.2.0.so
vendored
Binary file not shown.
BIN
3rdparty/lib/armeabi-v7a/libnative_camera_r2.3.3.so
vendored
BIN
3rdparty/lib/armeabi-v7a/libnative_camera_r2.3.3.so
vendored
Binary file not shown.
BIN
3rdparty/lib/armeabi-v7a/libnative_camera_r3.0.1.so
vendored
BIN
3rdparty/lib/armeabi-v7a/libnative_camera_r3.0.1.so
vendored
Binary file not shown.
BIN
3rdparty/lib/armeabi-v7a/libnative_camera_r4.0.0.so
vendored
BIN
3rdparty/lib/armeabi-v7a/libnative_camera_r4.0.0.so
vendored
Binary file not shown.
BIN
3rdparty/lib/armeabi-v7a/libnative_camera_r4.0.3.so
vendored
BIN
3rdparty/lib/armeabi-v7a/libnative_camera_r4.0.3.so
vendored
Binary file not shown.
BIN
3rdparty/lib/armeabi/libnative_camera_r2.2.0.so
vendored
BIN
3rdparty/lib/armeabi/libnative_camera_r2.2.0.so
vendored
Binary file not shown.
BIN
3rdparty/lib/armeabi/libnative_camera_r2.3.3.so
vendored
BIN
3rdparty/lib/armeabi/libnative_camera_r2.3.3.so
vendored
Binary file not shown.
BIN
3rdparty/lib/armeabi/libnative_camera_r3.0.1.so
vendored
BIN
3rdparty/lib/armeabi/libnative_camera_r3.0.1.so
vendored
Binary file not shown.
BIN
3rdparty/lib/armeabi/libnative_camera_r4.0.0.so
vendored
BIN
3rdparty/lib/armeabi/libnative_camera_r4.0.0.so
vendored
Binary file not shown.
BIN
3rdparty/lib/armeabi/libnative_camera_r4.0.3.so
vendored
BIN
3rdparty/lib/armeabi/libnative_camera_r4.0.3.so
vendored
Binary file not shown.
BIN
3rdparty/lib/libavcodec.a
vendored
BIN
3rdparty/lib/libavcodec.a
vendored
Binary file not shown.
BIN
3rdparty/lib/libavcodec64.a
vendored
BIN
3rdparty/lib/libavcodec64.a
vendored
Binary file not shown.
BIN
3rdparty/lib/libavdevice.a
vendored
BIN
3rdparty/lib/libavdevice.a
vendored
Binary file not shown.
BIN
3rdparty/lib/libavdevice64.a
vendored
BIN
3rdparty/lib/libavdevice64.a
vendored
Binary file not shown.
BIN
3rdparty/lib/libavformat.a
vendored
BIN
3rdparty/lib/libavformat.a
vendored
Binary file not shown.
BIN
3rdparty/lib/libavformat64.a
vendored
BIN
3rdparty/lib/libavformat64.a
vendored
Binary file not shown.
BIN
3rdparty/lib/libavutil.a
vendored
BIN
3rdparty/lib/libavutil.a
vendored
Binary file not shown.
BIN
3rdparty/lib/libavutil64.a
vendored
BIN
3rdparty/lib/libavutil64.a
vendored
Binary file not shown.
BIN
3rdparty/lib/libswscale.a
vendored
BIN
3rdparty/lib/libswscale.a
vendored
Binary file not shown.
BIN
3rdparty/lib/libswscale64.a
vendored
BIN
3rdparty/lib/libswscale64.a
vendored
Binary file not shown.
BIN
3rdparty/lib/x86/libnative_camera_r2.3.3.so
vendored
Executable file
BIN
3rdparty/lib/x86/libnative_camera_r2.3.3.so
vendored
Executable file
Binary file not shown.
BIN
3rdparty/lib/x86/libnative_camera_r3.0.1.so
vendored
Executable file
BIN
3rdparty/lib/x86/libnative_camera_r3.0.1.so
vendored
Executable file
Binary file not shown.
BIN
3rdparty/lib/x86/libnative_camera_r4.0.3.so
vendored
Executable file
BIN
3rdparty/lib/x86/libnative_camera_r4.0.3.so
vendored
Executable file
Binary file not shown.
12
3rdparty/libjasper/CMakeLists.txt
vendored
12
3rdparty/libjasper/CMakeLists.txt
vendored
@ -22,18 +22,24 @@ file(GLOB lib_ext_hdrs jasper/*.h)
|
||||
add_library(${JASPER_LIBRARY} STATIC ${lib_srcs} ${lib_hdrs} ${lib_ext_hdrs})
|
||||
|
||||
if(MSVC)
|
||||
string(REPLACE "/W3" "/W0" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
|
||||
string(REPLACE "/W4" "/W0" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
|
||||
if(NOT ENABLE_NOISY_WARNINGS)
|
||||
string(REPLACE "/W3" "/W0" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
|
||||
string(REPLACE "/W4" "/W0" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
|
||||
endif()
|
||||
add_definitions(-DJAS_WIN_MSVC_BUILD)
|
||||
endif()
|
||||
|
||||
if(CMAKE_COMPILER_IS_GNUCXX)
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-uninitialized")
|
||||
endif()
|
||||
|
||||
if(UNIX)
|
||||
if(CMAKE_COMPILER_IS_GNUCXX OR CV_ICC)
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(CMAKE_COMPILER_IS_GNUCXX)
|
||||
if(CMAKE_COMPILER_IS_GNUCXX AND NOT ENABLE_NOISY_WARNINGS)
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-implicit-function-declaration -Wno-unused")
|
||||
endif()
|
||||
|
||||
|
5
3rdparty/libtiff/CMakeLists.txt
vendored
5
3rdparty/libtiff/CMakeLists.txt
vendored
@ -82,8 +82,7 @@ set(lib_srcs
|
||||
|
||||
if(UNIX)
|
||||
list(APPEND lib_srcs tif_unix.c)
|
||||
if(CMAKE_COMPILER_IS_GNUCXX)
|
||||
#set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-strict-aliasing -Wno-int-to-pointer-cast")
|
||||
if(CMAKE_COMPILER_IS_GNUCXX AND NOT ENABLE_NOISY_WARNINGS)
|
||||
set_source_files_properties(tif_unix.c PROPERTIES COMPILE_FLAGS "-w")
|
||||
endif()
|
||||
endif()
|
||||
@ -92,7 +91,7 @@ if(WIN32)
|
||||
list(APPEND lib_srcs tif_win32.c)
|
||||
endif(WIN32)
|
||||
|
||||
if(MSVC)
|
||||
if(MSVC AND NOT ENABLE_NOISY_WARNINGS)
|
||||
string(REPLACE "/W4" "/W0" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
|
||||
string(REPLACE "/W4" "/W0" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
|
||||
endif()
|
||||
|
4
3rdparty/tbb/CMakeLists.txt
vendored
4
3rdparty/tbb/CMakeLists.txt
vendored
@ -119,3 +119,7 @@ endif()
|
||||
if(NOT BUILD_SHARED_LIBS)
|
||||
install(TARGETS tbb ARCHIVE DESTINATION share/OpenCV/3rdparty/${OPENCV_LIB_INSTALL_PATH} COMPONENT main)
|
||||
endif()
|
||||
|
||||
# get TBB version
|
||||
ocv_parse_header("${tbb_src_dir}/include/tbb/tbb_stddef.h" TBB_VERSION_LINES TBB_VERSION_MAJOR TBB_VERSION_MINOR TBB_INTERFACE_VERSION CACHE)
|
||||
|
||||
|
5
3rdparty/zlib/CMakeLists.txt
vendored
5
3rdparty/zlib/CMakeLists.txt
vendored
@ -82,7 +82,7 @@ if(UNIX)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(MSVC)
|
||||
if(MSVC AND NOT ENABLE_NOISY_WARNINGS)
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /wd4013")
|
||||
endif()
|
||||
|
||||
@ -99,3 +99,6 @@ endif()
|
||||
if(NOT BUILD_SHARED_LIBS)
|
||||
install(TARGETS ${ZLIB_LIBRARY} ARCHIVE DESTINATION share/OpenCV/3rdparty/${OPENCV_LIB_INSTALL_PATH} COMPONENT main)
|
||||
endif()
|
||||
|
||||
ocv_parse_header2(ZLIB "${CMAKE_CURRENT_SOURCE_DIR}/zlib.h" ZLIB_VERSION PARENT_SCOPE)
|
||||
|
||||
|
204
CMakeLists.txt
204
CMakeLists.txt
@ -104,7 +104,7 @@ OCV_OPTION(WITH_CUBLAS "Include NVidia Cuda Basic Linear Algebra Subprog
|
||||
OCV_OPTION(WITH_CUDA "Include NVidia Cuda Runtime support" ON IF (CMAKE_VERSION VERSION_GREATER "2.8" AND NOT ANDROID AND NOT IOS) )
|
||||
OCV_OPTION(WITH_CUFFT "Include NVidia Cuda Fast Fourier Transform (FFT) library support" ON IF (CMAKE_VERSION VERSION_GREATER "2.8" AND NOT ANDROID AND NOT IOS) )
|
||||
OCV_OPTION(WITH_EIGEN "Include Eigen2/Eigen3 support" ON)
|
||||
OCV_OPTION(WITH_FFMPEG "Include FFMPEG support" ON IF (UNIX AND NOT ANDROID AND NOT IOS) )
|
||||
OCV_OPTION(WITH_FFMPEG "Include FFMPEG support" ON IF (NOT ANDROID AND NOT IOS) )
|
||||
OCV_OPTION(WITH_GSTREAMER "Include Gstreamer support" ON IF (UNIX AND NOT APPLE AND NOT ANDROID AND NOT IOS) )
|
||||
OCV_OPTION(WITH_GTK "Include GTK support" ON IF (UNIX AND NOT APPLE AND NOT ANDROID AND NOT IOS) )
|
||||
OCV_OPTION(WITH_IPP "Include Intel IPP support" OFF IF (MSVC OR X86 OR X86_64) )
|
||||
@ -167,6 +167,7 @@ OCV_OPTION(ENABLE_SSE3 "Enable SSE3 instructions"
|
||||
OCV_OPTION(ENABLE_SSSE3 "Enable SSSE3 instructions" OFF IF (CMAKE_COMPILER_IS_GNUCXX AND (X86 OR X86_64)) )
|
||||
OCV_OPTION(ENABLE_SSE41 "Enable SSE4.1 instructions" OFF IF (CV_ICC OR CMAKE_COMPILER_IS_GNUCXX AND (X86 OR X86_64)) )
|
||||
OCV_OPTION(ENABLE_SSE42 "Enable SSE4.2 instructions" OFF IF (CMAKE_COMPILER_IS_GNUCXX AND (X86 OR X86_64)) )
|
||||
OCV_OPTION(ENABLE_NOISY_WARNINGS "Show all warnings even if they are too noisy" OFF )
|
||||
OCV_OPTION(OPENCV_WARNINGS_ARE_ERRORS "Treat warnings as errors" OFF )
|
||||
|
||||
# uncategorized options
|
||||
@ -241,15 +242,6 @@ add_definitions(-DHAVE_CVCONFIG_H)
|
||||
ocv_include_directories(${OPENCV_CONFIG_FILE_INCLUDE_DIR})
|
||||
|
||||
|
||||
# ----------------------------------------------------------------------------
|
||||
# Use statically or dynamically linked CRT?
|
||||
# Default: dynamic
|
||||
# ----------------------------------------------------------------------------
|
||||
if(MSVC)
|
||||
include(cmake/OpenCVCRTLinkage.cmake REQUIRED)
|
||||
endif(MSVC)
|
||||
|
||||
|
||||
# ----------------------------------------------------------------------------
|
||||
# Autodetect if we are in a SVN repository
|
||||
# ----------------------------------------------------------------------------
|
||||
@ -284,6 +276,15 @@ if(CMAKE_GENERATOR MATCHES "Makefiles" AND "${CMAKE_BUILD_TYPE}" STREQUAL "")
|
||||
endif()
|
||||
|
||||
|
||||
# ----------------------------------------------------------------------------
|
||||
# Use statically or dynamically linked CRT?
|
||||
# Default: dynamic
|
||||
# ----------------------------------------------------------------------------
|
||||
if(MSVC)
|
||||
include(cmake/OpenCVCRTLinkage.cmake REQUIRED)
|
||||
endif(MSVC)
|
||||
|
||||
|
||||
# ----------------------------------------------------------------------------
|
||||
# CHECK FOR SYSTEM LIBRARIES, OPTIONS, ETC..
|
||||
# ----------------------------------------------------------------------------
|
||||
@ -381,7 +382,9 @@ if(UNIX)
|
||||
endif()
|
||||
|
||||
if(HAVE_FFMPEG)
|
||||
CHECK_MODULE(libavformat>=52.111.0 NEW_FFMPEG)
|
||||
if(NOT ALIASOF_libavformat_VERSION VERSION_LESS "52.111.0")
|
||||
set(NEW_FFMPEG ON)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(WITH_1394)
|
||||
@ -427,6 +430,42 @@ if(UNIX)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(APPLE AND WITH_FFMPEG)
|
||||
set(FFMPEG_DEFAULT_INCLUDE_DIRS "/usr/local/include/" "/usr/include/" "opt/include/")
|
||||
|
||||
find_path(FFMPEG_INCLUDE_DIR "libavformat/avformat.h" PATHS ${FFMPEG_DEFAULT_INCLUDE_DIRS} DOC "The path to FFMPEG headers")
|
||||
if(FFMPEG_INCLUDE_DIR)
|
||||
set(HAVE_GENTOO_FFMPEG 1)
|
||||
set(FFMPEG_LIB_DIR "${FFMPEG_INCLUDE_DIR}/../lib" CACHE PATH "Full path of FFMPEG library directory")
|
||||
if(EXISTS "${FFMPEG_LIB_DIR}/libavcodec.a")
|
||||
set(HAVE_FFMPEG_CODEC 1)
|
||||
set(ALIASOF_libavcodec_VERSION "Unknown")
|
||||
if(EXISTS "${FFMPEG_LIB_DIR}/libavformat.a")
|
||||
set(HAVE_FFMPEG_FORMAT 1)
|
||||
set(ALIASOF_libavformat_VERSION "Unknown")
|
||||
if(EXISTS "${FFMPEG_LIB_DIR}/libavutil.a")
|
||||
set(HAVE_FFMPEG_UTIL 1)
|
||||
set(ALIASOF_libavutil_VERSION "Unknown")
|
||||
if(EXISTS "${FFMPEG_LIB_DIR}/libswscale.a")
|
||||
ocv_include_directories(${FFMPEG_INCLUDE_DIR})
|
||||
set(HAVE_FFMPEG_SWSCALE 1)
|
||||
set(ALIASOF_libswscale_VERSION "Unknown")
|
||||
set(HIGHGUI_LIBRARIES ${HIGHGUI_LIBRARIES} "${FFMPEG_LIB_DIR}/libavcodec.a"
|
||||
"${FFMPEG_LIB_DIR}/libavformat.a" "${FFMPEG_LIB_DIR}/libavutil.a"
|
||||
"${FFMPEG_LIB_DIR}/libswscale.a")
|
||||
set(HAVE_FFMPEG 1)
|
||||
set(NEW_FFMPEG 1)
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(WIN32 AND WITH_FFMPEG)
|
||||
include(3rdparty/ffmpeg/ffmpeg_version.cmake REQUIRED)
|
||||
endif()
|
||||
|
||||
#################### LATEX for dpf documentation ##################
|
||||
if(BUILD_DOCS)
|
||||
include(cmake/OpenCVFindLATEX.cmake REQUIRED)
|
||||
@ -524,6 +563,7 @@ if(WITH_EIGEN)
|
||||
DOC "The path to Eigen2/Eigen3 headers")
|
||||
if(EIGEN_INCLUDE_PATH)
|
||||
ocv_include_directories(${EIGEN_INCLUDE_PATH})
|
||||
ocv_parse_header("${EIGEN_INCLUDE_PATH}/Eigen/src/Core/util/Macros.h" EIGEN_VERSION_LINES EIGEN_WORLD_VERSION EIGEN_MAJOR_VERSION EIGEN_MINOR_VERSION)
|
||||
set(HAVE_EIGEN 1)
|
||||
endif()
|
||||
endif()
|
||||
@ -646,12 +686,17 @@ include(cmake/OpenCVGenConfig.cmake REQUIRED)
|
||||
# ----------------------------------------------------------------------------
|
||||
status("")
|
||||
status("General configuration for OpenCV ${OPENCV_VERSION} =====================================")
|
||||
if(OPENCV_SVNVERSION)
|
||||
status("Version control:" ${OPENCV_SVNVERSION})
|
||||
endif()
|
||||
|
||||
#build platform
|
||||
status("")
|
||||
status(" Platform:")
|
||||
status(" Host:" ${CMAKE_HOST_SYSTEM_NAME} ${CMAKE_HOST_SYSTEM_VERSION} ${CMAKE_HOST_SYSTEM_PROCESSOR})
|
||||
status(" Target:" ${CMAKE_SYSTEM_NAME} ${CMAKE_SYSTEM_VERSION} ${CMAKE_SYSTEM_PROCESSOR})
|
||||
if(CMAKE_CROSSCOMPILING)
|
||||
status(" Target:" ${CMAKE_SYSTEM_NAME} ${CMAKE_SYSTEM_VERSION} ${CMAKE_SYSTEM_PROCESSOR})
|
||||
endif()
|
||||
status(" CMake:" ${CMAKE_VERSION})
|
||||
status(" CMake generator:" ${CMAKE_GENERATOR})
|
||||
status(" CMake build tool:" ${CMAKE_BUILD_TOOL})
|
||||
@ -664,11 +709,14 @@ endif()
|
||||
|
||||
# C/C++ options
|
||||
status("")
|
||||
status(" C++:")
|
||||
status(" C/C++:")
|
||||
status(" Built as dynamic libs?:" BUILD_SHARED_LIBS THEN YES ELSE NO)
|
||||
status(" C++ Compiler:" CMAKE_COMPILER THEN "${CMAKE_COMPILER}" ELSE "${CMAKE_CXX_COMPILER}")
|
||||
status(" C++ Compiler:" CMAKE_COMPILER_IS_GNUCXX THEN "${CMAKE_CXX_COMPILER} (ver ${CMAKE_GCC_REGEX_VERSION})" ELSE "${CMAKE_CXX_COMPILER}" )
|
||||
status(" C++ flags (Release):" ${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_RELEASE})
|
||||
status(" C++ flags (Debug):" ${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_DEBUG})
|
||||
status(" C Compiler:" ${CMAKE_C_COMPILER})
|
||||
status(" C flags (Release):" ${CMAKE_C_FLAGS} ${CMAKE_C_FLAGS_RELEASE})
|
||||
status(" C flags (Debug):" ${CMAKE_C_FLAGS} ${CMAKE_C_FLAGS_DEBUG})
|
||||
if(WIN32)
|
||||
status(" Linker flags (Release):" ${CMAKE_EXE_LINKER_FLAGS} ${CMAKE_EXE_LINKER_FLAGS_RELEASE})
|
||||
status(" Linker flags (Debug):" ${CMAKE_EXE_LINKER_FLAGS} ${CMAKE_EXE_LINKER_FLAGS_DEBUG})
|
||||
@ -721,8 +769,8 @@ status("")
|
||||
status(" GUI: ")
|
||||
|
||||
if (HAVE_QT)
|
||||
status(" QT 4.x:" HAVE_QT THEN YES ELSE NO)
|
||||
status(" QT OpenGL support:" HAVE_QT_OPENGL THEN YES ELSE NO)
|
||||
status(" QT 4.x:" HAVE_QT THEN "YES (ver ${QT_VERSION_MAJOR}.${QT_VERSION_MINOR}.${QT_VERSION_PATCH} ${QT_EDITION})" ELSE NO)
|
||||
status(" QT OpenGL support:" HAVE_QT_OPENGL THEN "YES (${QT_QTOPENGL_LIBRARY})" ELSE NO)
|
||||
else()
|
||||
if(WIN32)
|
||||
status(" Win32 UI:" YES)
|
||||
@ -734,45 +782,45 @@ else()
|
||||
status(" Cocoa:" YES)
|
||||
endif()
|
||||
else()
|
||||
status(" GTK+ 2.x:" HAVE_GTK THEN YES ELSE NO)
|
||||
status(" GThread :" HAVE_GTHREAD THEN YES ELSE NO)
|
||||
status(" GtkGlExt:" HAVE_GTKGLEXT THEN YES ELSE NO)
|
||||
status(" GTK+ 2.x:" HAVE_GTK THEN "YES (ver ${ALIASOF_gtk+-2.0_VERSION})" ELSE NO)
|
||||
status(" GThread :" HAVE_GTHREAD THEN "YES (ver ${ALIASOF_gthread-2.0_VERSION})" ELSE NO)
|
||||
status(" GtkGlExt:" HAVE_GTKGLEXT THEN "YES (ver ${ALIASOF_gtkglext-1.0_VERSION})" ELSE NO)
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
status(" OpenGL support:" HAVE_OPENGL THEN YES ELSE NO)
|
||||
status(" OpenGL support:" HAVE_OPENGL THEN "YES (${OPENGL_LIBRARIES})" ELSE NO)
|
||||
|
||||
# media
|
||||
status("")
|
||||
status(" Media I/O: ")
|
||||
status(" ZLib:" ZLIB_FOUND THEN "${ZLIB_LIBRARY}" ELSE build)
|
||||
status(" ZLib:" BUILD_ZLIB THEN "build (ver ${ZLIB_VERSION_STRING})" ELSE "${ZLIB_LIBRARY} (ver ${ZLIB_VERSION_STRING})")
|
||||
|
||||
if(WITH_JPEG)
|
||||
status(" JPEG:" JPEG_FOUND THEN "${JPEG_LIBRARY}" ELSE build)
|
||||
status(" JPEG:" JPEG_FOUND THEN "${JPEG_LIBRARY} (ver ${JPEG_LIB_VERSION})" ELSE "build (ver ${JPEG_LIB_VERSION})")
|
||||
else()
|
||||
status(" JPEG:" "NO")
|
||||
endif()
|
||||
if(WITH_PNG)
|
||||
status(" PNG:" PNG_FOUND THEN "${PNG_LIBRARY}" ELSE build)
|
||||
status(" PNG:" PNG_FOUND THEN "${PNG_LIBRARY} (ver ${PNG_VERSION})" ELSE "build (ver ${PNG_VERSION})")
|
||||
else()
|
||||
status(" PNG:" "NO")
|
||||
endif()
|
||||
if(WITH_TIFF)
|
||||
status(" TIFF:" TIFF_FOUND THEN "${TIFF_LIBRARY}" ELSE build)
|
||||
status(" TIFF:" TIFF_FOUND THEN "${TIFF_LIBRARY} (ver ${TIFF_VERSION})" ELSE "build (ver ${TIFF_VERSION})")
|
||||
else()
|
||||
status(" TIFF:" "NO")
|
||||
endif()
|
||||
if(WITH_JASPER)
|
||||
status(" JPEG 2000:" JASPER_FOUND THEN "${JASPER_LIBRARY}" ELSE build)
|
||||
status(" JPEG 2000:" JASPER_FOUND THEN "${JASPER_LIBRARY} (ver ${JASPER_VERSION_STRING})" ELSE "build (ver ${JASPER_VERSION_STRING})")
|
||||
else()
|
||||
status(" JPEG 2000:" "NO")
|
||||
endif()
|
||||
|
||||
status(" OpenEXR:" WITH_OPENEXR AND OPENEXR_FOUND THEN YES ELSE NO)
|
||||
status(" OpenNI:" HAVE_OPENNI THEN YES ELSE NO)
|
||||
status(" OpenEXR:" WITH_OPENEXR AND OPENEXR_FOUND THEN "${OPENEXR_LIBRARIES} (ver ${OPENEXR_VERSION})" ELSE NO)
|
||||
status(" OpenNI:" HAVE_OPENNI THEN "YES (ver ${OPENNI_VERSION_STRING}, build ${OPENNI_VERSION_BUILD})" ELSE NO)
|
||||
status(" OpenNI PrimeSensor Modules:"
|
||||
HAVE_OPENNI_PRIME_SENSOR_MODULE THEN YES ELSE NO)
|
||||
HAVE_OPENNI_PRIME_SENSOR_MODULE THEN "YES (${OPENNI_PRIME_SENSOR_MODULE})" ELSE NO)
|
||||
if(WIN32)
|
||||
status(" XIMEA:" HAVE_XIMEA THEN YES ELSE NO)
|
||||
endif()
|
||||
@ -781,19 +829,29 @@ endif()
|
||||
status("")
|
||||
if(UNIX AND NOT APPLE)
|
||||
status(" Video I/O:")
|
||||
status(" DC1394 1.x:" HAVE_DC1394 THEN YES ELSE NO)
|
||||
status(" DC1394 2.x:" HAVE_DC1394_2 THEN YES ELSE NO)
|
||||
status(" FFMPEG:" HAVE_FFMPEG THEN YES ELSE NO)
|
||||
status(" codec:" HAVE_FFMPEG_CODEC THEN YES ELSE NO)
|
||||
status(" format:" HAVE_FFMPEG_FORMAT THEN YES ELSE NO)
|
||||
status(" util:" HAVE_FFMPEG_UTIL THEN YES ELSE NO)
|
||||
status(" swscale:" HAVE_FFMPEG_SWSCALE THEN YES ELSE NO)
|
||||
status(" gentoo-style:" HAVE_GENTOO_FFMPEG THEN YES ELSE NO)
|
||||
status(" GStreamer:" HAVE_GSTREAMER THEN YES ELSE NO)
|
||||
status(" UniCap:" HAVE_UNICAP THEN YES ELSE NO)
|
||||
status(" DC1394 1.x:" HAVE_DC1394 THEN "YES (ver ${ALIASOF_libdc1394_VERSION})" ELSE NO)
|
||||
status(" DC1394 2.x:" HAVE_DC1394_2 THEN "YES (ver ${ALIASOF_libdc1394-2_VERSION})" ELSE NO)
|
||||
status(" GStreamer:" HAVE_GSTREAMER THEN "" ELSE NO)
|
||||
if(HAVE_GSTREAMER)
|
||||
status(" base:" "YES (ver ${ALIASOF_gstreamer-base-0.10_VERSION})")
|
||||
status(" app:" "YES (ver ${ALIASOF_gstreamer-app-0.10_VERSION})")
|
||||
status(" video:" "YES (ver ${ALIASOF_gstreamer-video-0.10_VERSION})")
|
||||
endif()
|
||||
status(" UniCap:" HAVE_UNICAP THEN "YES (ver ${ALIASOF_libunicap_VERSION})" ELSE NO)
|
||||
status(" UniCap ucil:" HAVE_UNICAP_UCIL THEN "YES (ver ${ALIASOF_libucil_VERSION})" ELSE NO)
|
||||
status(" PvAPI:" HAVE_PVAPI THEN YES ELSE NO)
|
||||
status(" V4L/V4L2:" HAVE_LIBV4L THEN "Using libv4l" ELSE ${HAVE_CAMV4L}/${HAVE_CAMV4L2})
|
||||
status(" Xine:" HAVE_XINE THEN YES ELSE NO)
|
||||
if(HAVE_CAMV4L)
|
||||
set(HAVE_CAMV4L_STR "YES")
|
||||
else()
|
||||
set(HAVE_CAMV4L_STR "NO")
|
||||
endif()
|
||||
if(HAVE_CAMV4L2)
|
||||
set(HAVE_CAMV4L2_STR "YES")
|
||||
else()
|
||||
set(HAVE_CAMV4L2_STR "NO")
|
||||
endif()
|
||||
status(" V4L/V4L2:" HAVE_LIBV4L THEN "Using libv4l (ver ${ALIASOF_libv4l1_VERSION})" ELSE "${HAVE_CAMV4L_STR}/${HAVE_CAMV4L2_STR}")
|
||||
status(" Xine:" HAVE_XINE THEN "YES (ver ${ALIASOF_libxine_VERSION})" ELSE NO)
|
||||
|
||||
if(ANDROID)
|
||||
if(HAVE_opencv_androidcamera)
|
||||
@ -809,9 +867,20 @@ elseif(APPLE)
|
||||
status(" Video I/O: AVFoundation")
|
||||
endif()
|
||||
elseif(WIN32)
|
||||
status(" Video I/O:" HAVE_VIDEOINPUT THEN DirectShow ELSE NO)
|
||||
status(" Video I/O:" HAVE_VIDEOINPUT THEN DirectShow ELSE NO)
|
||||
endif()
|
||||
|
||||
if(WIN32)
|
||||
status(" FFMPEG:" WITH_FFMPEG THEN "YES (prebuilt binaries)" ELSE NO)
|
||||
else()
|
||||
status(" FFMPEG:" HAVE_FFMPEG THEN YES ELSE NO)
|
||||
endif()
|
||||
status(" codec:" HAVE_FFMPEG_CODEC THEN "YES (ver ${ALIASOF_libavcodec_VERSION})" ELSE NO)
|
||||
status(" format:" HAVE_FFMPEG_FORMAT THEN "YES (ver ${ALIASOF_libavformat_VERSION})" ELSE NO)
|
||||
status(" util:" HAVE_FFMPEG_UTIL THEN "YES (ver ${ALIASOF_libavutil_VERSION})" ELSE NO)
|
||||
status(" swscale:" HAVE_FFMPEG_SWSCALE THEN "YES (ver ${ALIASOF_libswscale_VERSION})" ELSE NO)
|
||||
status(" gentoo-style:" HAVE_GENTOO_FFMPEG THEN YES ELSE NO)
|
||||
|
||||
# Other third-party libraries
|
||||
status("")
|
||||
status(" Other third-party libraries:")
|
||||
@ -823,31 +892,48 @@ else()
|
||||
status(" Use IPP:" WITH_IPP AND NOT IPP_FOUND THEN "IPP not found" ELSE NO)
|
||||
endif()
|
||||
|
||||
status(" Use TBB:" HAVE_TBB THEN YES ELSE NO)
|
||||
status(" Use Cuda:" HAVE_CUDA THEN YES ELSE NO)
|
||||
status(" Use Eigen:" HAVE_EIGEN THEN YES ELSE NO)
|
||||
status(" Use TBB:" HAVE_TBB THEN "YES (ver ${TBB_VERSION_MAJOR}.${TBB_VERSION_MINOR} interface ${TBB_INTERFACE_VERSION})" ELSE NO)
|
||||
status(" Use Cuda:" HAVE_CUDA THEN "YES (ver ${CUDA_VERSION_STRING})" ELSE NO)
|
||||
status(" Use Eigen:" HAVE_EIGEN THEN "YES (ver ${EIGEN_WORLD_VERSION}.${EIGEN_MAJOR_VERSION}.${EIGEN_MINOR_VERSION})" ELSE NO)
|
||||
status(" Use Clp:" HAVE_CLP THEN YES ELSE NO)
|
||||
|
||||
status("")
|
||||
status(" Python interpreter:" PYTHON_EXECUTABLE THEN "${PYTHON_EXECUTABLE} (ver ${PYTHON_VERSION_MAJOR_MINOR})" ELSE NO)
|
||||
if(HAVE_CUDA)
|
||||
status("")
|
||||
status(" NVIDIA CUDA:")
|
||||
|
||||
status(" Use CUFFT:" HAVE_CUFFT THEN YES ELSE NO)
|
||||
status(" Use CUBLAS:" HAVE_CUBLAS THEN YES ELSE NO)
|
||||
status(" NVIDIA GPU arch:" ${OPENCV_CUDA_ARCH_BIN})
|
||||
status(" NVIDIA PTX archs:" ${OPENCV_CUDA_ARCH_BIN})
|
||||
status(" NVIDIA GPU features:" ${OPENCV_CUDA_ARCH_FEATURES})
|
||||
endif()
|
||||
|
||||
# interfaces to other languages
|
||||
status("")
|
||||
status(" Interfaces:")
|
||||
status(" Python:" HAVE_opencv_python THEN YES ELSE NO)
|
||||
status(" Python numpy:" PYTHON_USE_NUMPY THEN YES ELSE "NO (Python wrappers can not be generated)")
|
||||
if(ANDROID)
|
||||
status(" Java:" HAVE_opencv_java THEN YES ELSE NO)
|
||||
status(" Python:")
|
||||
status(" Interpreter:" PYTHON_EXECUTABLE THEN "${PYTHON_EXECUTABLE} (ver ${PYTHON_VERSION_FULL})" ELSE NO)
|
||||
if(BUILD_opencv_python)
|
||||
status(" Libraries:" HAVE_opencv_python THEN ${PYTHON_LIBRARIES} ELSE NO)
|
||||
status(" numpy:" PYTHON_USE_NUMPY THEN "${PYTHON_NUMPY_INCLUDE_DIR} (ver ${PYTHON_NUMPY_VERSION})" ELSE "NO (Python wrappers can not be generated)")
|
||||
status(" packages path:" PYTHON_EXECUTABLE THEN "${PYTHON_PACKAGES_PATH}" ELSE "-")
|
||||
endif()
|
||||
|
||||
if(BUILD_opencv_java)
|
||||
status("")
|
||||
status(" Java:" HAVE_opencv_java THEN YES ELSE NO)
|
||||
endif()
|
||||
|
||||
# documentation
|
||||
status("")
|
||||
status(" Documentation:")
|
||||
status(" Sphinx:" HAVE_SPHINX THEN "${SPHINX_BUILD} (ver ${SPHINX_VERSION})" ELSE NO)
|
||||
status(" PdfLaTeX compiler:" PDFLATEX_COMPILER THEN "${PDFLATEX_COMPILER}" ELSE NO)
|
||||
if(BUILD_DOCS AND HAVE_SPHINX)
|
||||
status(" Build Documentation:" PDFLATEX_COMPILER THEN YES ELSE "YES (only HTML without math expressions)")
|
||||
else()
|
||||
status(" Build Documentation:" NO)
|
||||
if(BUILD_DOCS)
|
||||
status("")
|
||||
status(" Documentation:")
|
||||
if(HAVE_SPHINX)
|
||||
status(" Build Documentation:" PDFLATEX_COMPILER THEN YES ELSE "YES (only HTML and without math expressions)")
|
||||
else()
|
||||
status(" Build Documentation:" NO)
|
||||
endif()
|
||||
status(" Sphinx:" HAVE_SPHINX THEN "${SPHINX_BUILD} (ver ${SPHINX_VERSION})" ELSE NO)
|
||||
status(" PdfLaTeX compiler:" PDFLATEX_COMPILER THEN "${PDFLATEX_COMPILER}" ELSE NO)
|
||||
endif()
|
||||
|
||||
# samples and tests
|
||||
|
@ -170,6 +170,8 @@
|
||||
# [+] improved toolchain loading speed
|
||||
# [+] added assembler language support (.S)
|
||||
# [+] allowed preset search paths and extra search suffixes
|
||||
# - modified April 2012 Andrey Kamaev andrey.kamaev@itseez.com
|
||||
# [+] updated for NDK r7c
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
cmake_minimum_required( VERSION 2.6.3 )
|
||||
@ -188,7 +190,7 @@ set( CMAKE_SYSTEM_NAME Linux )
|
||||
#this one not so much
|
||||
set( CMAKE_SYSTEM_VERSION 1 )
|
||||
|
||||
set( ANDROID_SUPPORTED_NDK_VERSIONS ${ANDROID_EXTRA_NDK_VERSIONS} -r7b -r7 -r6b -r6 -r5c -r5b -r5 "" )
|
||||
set( ANDROID_SUPPORTED_NDK_VERSIONS ${ANDROID_EXTRA_NDK_VERSIONS} -r7c -r7b -r7 -r6b -r6 -r5c -r5b -r5 "" )
|
||||
if(NOT DEFINED ANDROID_NDK_SEARCH_PATHS)
|
||||
if( CMAKE_HOST_WIN32 )
|
||||
file( TO_CMAKE_PATH "$ENV{PROGRAMFILES}" ANDROID_NDK_SEARCH_PATHS )
|
||||
|
@ -3390,6 +3390,7 @@ CvClassifier* cvCreateBtClassifierFromFile( const char* filename )
|
||||
int num_features;
|
||||
int num_classes;
|
||||
int type;
|
||||
int values_read = -1;
|
||||
|
||||
CV_ASSERT( filename != NULL );
|
||||
|
||||
@ -3400,7 +3401,8 @@ CvClassifier* cvCreateBtClassifierFromFile( const char* filename )
|
||||
CV_ERROR( CV_StsError, "Unable to open file" );
|
||||
}
|
||||
|
||||
fscanf( file, "%d %d %d %d", &type, &num_classes, &num_features, &num_classifiers );
|
||||
values_read = fscanf( file, "%d %d %d %d", &type, &num_classes, &num_features, &num_classifiers );
|
||||
CV_Assert(values_read == 4);
|
||||
|
||||
CV_ASSERT( type >= (int) CV_DABCLASS && type <= (int) CV_MREG );
|
||||
CV_ASSERT( num_features > 0 );
|
||||
@ -3418,7 +3420,8 @@ CvClassifier* cvCreateBtClassifierFromFile( const char* filename )
|
||||
int count;
|
||||
CvCARTClassifier* tree;
|
||||
|
||||
fscanf( file, "%d", &count );
|
||||
values_read = fscanf( file, "%d", &count );
|
||||
CV_Assert(values_read == 1);
|
||||
|
||||
data_size = sizeof( *tree )
|
||||
+ count * ( sizeof( *(tree->compidx) ) + sizeof( *(tree->threshold) ) +
|
||||
@ -3439,14 +3442,16 @@ CvClassifier* cvCreateBtClassifierFromFile( const char* filename )
|
||||
tree->count = count;
|
||||
for( j = 0; j < tree->count; j++ )
|
||||
{
|
||||
fscanf( file, "%d %g %d %d", &(tree->compidx[j]),
|
||||
values_read = fscanf( file, "%d %g %d %d", &(tree->compidx[j]),
|
||||
&(tree->threshold[j]),
|
||||
&(tree->left[j]),
|
||||
&(tree->right[j]) );
|
||||
CV_Assert(values_read == 4);
|
||||
}
|
||||
for( j = 0; j <= tree->count; j++ )
|
||||
{
|
||||
fscanf( file, "%g", &(tree->val[j]) );
|
||||
values_read = fscanf( file, "%g", &(tree->val[j]) );
|
||||
CV_Assert(values_read == 1);
|
||||
}
|
||||
ptr->trees[i] = tree;
|
||||
}
|
||||
@ -3553,6 +3558,7 @@ void cvReadTrainData( const char* filename, int flags,
|
||||
int m, n;
|
||||
int i, j;
|
||||
float val;
|
||||
int values_read = -1;
|
||||
|
||||
if( filename == NULL )
|
||||
{
|
||||
@ -3575,7 +3581,8 @@ void cvReadTrainData( const char* filename, int flags,
|
||||
CV_ERROR( CV_StsError, "Unable to open file" );
|
||||
}
|
||||
|
||||
fscanf( file, "%d %d", &m, &n );
|
||||
values_read = fscanf( file, "%d %d", &m, &n );
|
||||
CV_Assert(values_read == 2);
|
||||
|
||||
if( CV_IS_ROW_SAMPLE( flags ) )
|
||||
{
|
||||
@ -3592,7 +3599,8 @@ void cvReadTrainData( const char* filename, int flags,
|
||||
{
|
||||
for( j = 0; j < n; j++ )
|
||||
{
|
||||
fscanf( file, "%f", &val );
|
||||
values_read = fscanf( file, "%f", &val );
|
||||
CV_Assert(values_read == 1);
|
||||
if( CV_IS_ROW_SAMPLE( flags ) )
|
||||
{
|
||||
CV_MAT_ELEM( **trainData, float, i, j ) = val;
|
||||
@ -3602,7 +3610,8 @@ void cvReadTrainData( const char* filename, int flags,
|
||||
CV_MAT_ELEM( **trainData, float, j, i ) = val;
|
||||
}
|
||||
}
|
||||
fscanf( file, "%f", &val );
|
||||
values_read = fscanf( file, "%f", &val );
|
||||
CV_Assert(values_read == 2);
|
||||
CV_MAT_ELEM( **trainClasses, float, 0, i ) = val;
|
||||
}
|
||||
|
||||
|
@ -285,18 +285,20 @@ void icvLoadHaarFeature( CvTHaarFeature* feature, FILE* file )
|
||||
int weight;
|
||||
|
||||
nrect = 0;
|
||||
fscanf( file, "%d", &nrect );
|
||||
int values_read = fscanf( file, "%d", &nrect );
|
||||
CV_Assert(values_read == 1);
|
||||
|
||||
assert( nrect <= CV_HAAR_FEATURE_MAX );
|
||||
|
||||
for( j = 0; j < nrect; j++ )
|
||||
{
|
||||
fscanf( file, "%d %d %d %d %d %d",
|
||||
values_read = fscanf( file, "%d %d %d %d %d %d",
|
||||
&(feature->rect[j].r.x),
|
||||
&(feature->rect[j].r.y),
|
||||
&(feature->rect[j].r.width),
|
||||
&(feature->rect[j].r.height),
|
||||
&tmp, &weight );
|
||||
CV_Assert(values_read == 6);
|
||||
feature->rect[j].weight = (float) weight;
|
||||
}
|
||||
for( j = nrect; j < CV_HAAR_FEATURE_MAX; j++ )
|
||||
@ -307,7 +309,8 @@ void icvLoadHaarFeature( CvTHaarFeature* feature, FILE* file )
|
||||
feature->rect[j].r.height = 0;
|
||||
feature->rect[j].weight = 0.0f;
|
||||
}
|
||||
fscanf( file, "%s", &(feature->desc[0]) );
|
||||
values_read = fscanf( file, "%s", &(feature->desc[0]) );
|
||||
CV_Assert(values_read == 1);
|
||||
feature->tilted = ( feature->desc[0] == 't' );
|
||||
}
|
||||
|
||||
@ -342,19 +345,23 @@ CvIntHaarClassifier* icvLoadCARTHaarClassifier( FILE* file, int step )
|
||||
int count;
|
||||
|
||||
ptr = NULL;
|
||||
fscanf( file, "%d", &count );
|
||||
int values_read = fscanf( file, "%d", &count );
|
||||
CV_Assert(values_read == 1);
|
||||
|
||||
if( count > 0 )
|
||||
{
|
||||
ptr = (CvCARTHaarClassifier*) icvCreateCARTHaarClassifier( count );
|
||||
for( i = 0; i < count; i++ )
|
||||
{
|
||||
icvLoadHaarFeature( &(ptr->feature[i]), file );
|
||||
fscanf( file, "%f %d %d", &(ptr->threshold[i]), &(ptr->left[i]),
|
||||
values_read = fscanf( file, "%f %d %d", &(ptr->threshold[i]), &(ptr->left[i]),
|
||||
&(ptr->right[i]) );
|
||||
CV_Assert(values_read == 3);
|
||||
}
|
||||
for( i = 0; i <= count; i++ )
|
||||
{
|
||||
fscanf( file, "%f", &(ptr->val[i]) );
|
||||
values_read = fscanf( file, "%f", &(ptr->val[i]) );
|
||||
CV_Assert(values_read == 1);
|
||||
}
|
||||
icvConvertToFastHaarFeature( ptr->feature, ptr->fastfeature, ptr->count, step );
|
||||
}
|
||||
@ -402,7 +409,8 @@ CvIntHaarClassifier* icvLoadCARTStageHaarClassifierF( FILE* file, int step )
|
||||
float threshold;
|
||||
|
||||
count = 0;
|
||||
fscanf( file, "%d", &count );
|
||||
int values_read = fscanf( file, "%d", &count );
|
||||
CV_Assert(values_read == 1);
|
||||
if( count > 0 )
|
||||
{
|
||||
ptr = (CvStageHaarClassifier*) icvCreateStageHaarClassifier( count, 0.0F );
|
||||
@ -411,7 +419,8 @@ CvIntHaarClassifier* icvLoadCARTStageHaarClassifierF( FILE* file, int step )
|
||||
ptr->classifier[i] = icvLoadCARTHaarClassifier( file, step );
|
||||
}
|
||||
|
||||
fscanf( file, "%f", &threshold );
|
||||
values_read = fscanf( file, "%f", &threshold );
|
||||
CV_Assert(values_read == 1);
|
||||
|
||||
ptr->threshold = threshold;
|
||||
/* to be compatible with the previous implementation */
|
||||
|
@ -1854,9 +1854,11 @@ int icvGetHaarTraininDataFromVecCallback( CvMat* img, void* userdata )
|
||||
|
||||
assert( img->rows * img->cols == ((CvVecFile*) userdata)->vecsize );
|
||||
|
||||
fread( &tmp, sizeof( tmp ), 1, ((CvVecFile*) userdata)->input );
|
||||
fread( ((CvVecFile*) userdata)->vector, sizeof( short ),
|
||||
size_t elements_read = fread( &tmp, sizeof( tmp ), 1, ((CvVecFile*) userdata)->input );
|
||||
CV_Assert(elements_read == 1);
|
||||
elements_read = fread( ((CvVecFile*) userdata)->vector, sizeof( short ),
|
||||
((CvVecFile*) userdata)->vecsize, ((CvVecFile*) userdata)->input );
|
||||
CV_Assert(elements_read == (size_t)((CvVecFile*) userdata)->vecsize);
|
||||
|
||||
if( feof( ((CvVecFile*) userdata)->input ) ||
|
||||
(((CvVecFile*) userdata)->last)++ >= ((CvVecFile*) userdata)->count )
|
||||
@ -1919,10 +1921,12 @@ int icvGetHaarTrainingDataFromVec( CvHaarTrainingData* data, int first, int coun
|
||||
|
||||
if( file.input != NULL )
|
||||
{
|
||||
fread( &file.count, sizeof( file.count ), 1, file.input );
|
||||
fread( &file.vecsize, sizeof( file.vecsize ), 1, file.input );
|
||||
fread( &tmp, sizeof( tmp ), 1, file.input );
|
||||
fread( &tmp, sizeof( tmp ), 1, file.input );
|
||||
size_t elements_read1 = fread( &file.count, sizeof( file.count ), 1, file.input );
|
||||
size_t elements_read2 = fread( &file.vecsize, sizeof( file.vecsize ), 1, file.input );
|
||||
size_t elements_read3 = fread( &tmp, sizeof( tmp ), 1, file.input );
|
||||
size_t elements_read4 = fread( &tmp, sizeof( tmp ), 1, file.input );
|
||||
CV_Assert(elements_read1 == 1 && elements_read2 == 1 && elements_read3 == 1 && elements_read4 == 1);
|
||||
|
||||
if( !feof( file.input ) )
|
||||
{
|
||||
if( file.vecsize != data->winsize.width * data->winsize.height )
|
||||
@ -1970,10 +1974,11 @@ int icvGetHaarTrainingDataFromBG( CvHaarTrainingData* data, int first, int count
|
||||
|
||||
if( file.input != NULL )
|
||||
{
|
||||
fread( &file.count, sizeof( file.count ), 1, file.input );
|
||||
fread( &file.vecsize, sizeof( file.vecsize ), 1, file.input );
|
||||
fread( &tmp, sizeof( tmp ), 1, file.input );
|
||||
fread( &tmp, sizeof( tmp ), 1, file.input );
|
||||
size_t elements_read1 = fread( &file.count, sizeof( file.count ), 1, file.input );
|
||||
size_t elements_read2 = fread( &file.vecsize, sizeof( file.vecsize ), 1, file.input );
|
||||
size_t elements_read3 = fread( &tmp, sizeof( tmp ), 1, file.input );
|
||||
size_t elements_read4 = fread( &tmp, sizeof( tmp ), 1, file.input );
|
||||
CV_Assert(elements_read1 == 1 && elements_read2 == 1 && elements_read3 == 1 && elements_read4 == 1);
|
||||
if( !feof( file.input ) )
|
||||
{
|
||||
if( file.vecsize != data->winsize.width * data->winsize.height )
|
||||
|
@ -884,10 +884,11 @@ void cvShowVecSamples( const char* filename, int winwidth, int winheight,
|
||||
|
||||
if( file.input != NULL )
|
||||
{
|
||||
fread( &file.count, sizeof( file.count ), 1, file.input );
|
||||
fread( &file.vecsize, sizeof( file.vecsize ), 1, file.input );
|
||||
fread( &tmp, sizeof( tmp ), 1, file.input );
|
||||
fread( &tmp, sizeof( tmp ), 1, file.input );
|
||||
size_t elements_read1 = fread( &file.count, sizeof( file.count ), 1, file.input );
|
||||
size_t elements_read2 = fread( &file.vecsize, sizeof( file.vecsize ), 1, file.input );
|
||||
size_t elements_read3 = fread( &tmp, sizeof( tmp ), 1, file.input );
|
||||
size_t elements_read4 = fread( &tmp, sizeof( tmp ), 1, file.input );
|
||||
CV_Assert(elements_read1 == 1 && elements_read2 == 1 && elements_read3 == 1 && elements_read4 == 1);
|
||||
|
||||
if( file.vecsize != winwidth * winheight )
|
||||
{
|
||||
|
@ -150,8 +150,10 @@ bool CvCascadeImageReader::PosReader::get( Mat &_img )
|
||||
{
|
||||
CV_Assert( _img.rows * _img.cols == vecSize );
|
||||
uchar tmp = 0;
|
||||
fread( &tmp, sizeof( tmp ), 1, file );
|
||||
fread( vec, sizeof( vec[0] ), vecSize, file );
|
||||
size_t elements_read = fread( &tmp, sizeof( tmp ), 1, file );
|
||||
CV_Assert(elements_read == 1);
|
||||
elements_read = fread( vec, sizeof( vec[0] ), vecSize, file );
|
||||
CV_Assert(elements_read == (size_t)(vecSize));
|
||||
|
||||
if( feof( file ) || last++ >= count )
|
||||
return false;
|
||||
|
@ -1,5 +1,13 @@
|
||||
if (WIN32 AND CMAKE_GENERATOR MATCHES "(MinGW)|(MSYS)")
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "-O2 -DNDEBUG" CACHE STRING "")
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "-O2 -DNDEBUG" CACHE STRING "")
|
||||
endif()
|
||||
|
||||
if(MSVC)
|
||||
if(CMAKE_CXX_FLAGS STREQUAL CMAKE_CXX_FLAGS_INIT)
|
||||
# override cmake default exception handling option
|
||||
string(REPLACE "/EHsc" "/EHa" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}" CACHE STRING "Flags used by the compiler during all build types." FORCE)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set(OPENCV_EXTRA_C_FLAGS "")
|
||||
@ -10,143 +18,142 @@ set(OPENCV_EXTRA_EXE_LINKER_FLAGS_RELEASE "")
|
||||
set(OPENCV_EXTRA_EXE_LINKER_FLAGS_DEBUG "")
|
||||
|
||||
if(MSVC)
|
||||
set(OPENCV_EXTRA_C_FLAGS "${OPENCV_EXTRA_C_FLAGS} /D _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE /D _SCL_SECURE_NO_WARNINGS")
|
||||
# 64-bit portability warnings, in MSVC8
|
||||
if(MSVC80)
|
||||
set(OPENCV_EXTRA_C_FLAGS "${OPENCV_EXTRA_C_FLAGS} /Wp64")
|
||||
endif()
|
||||
#if(MSVC90)
|
||||
# set(OPENCV_EXTRA_C_FLAGS "${OPENCV_EXTRA_C_FLAGS} /D _BIND_TO_CURRENT_CRT_VERSION=1 /D _BIND_TO_CURRENT_VCLIBS_VERSION=1")
|
||||
#endif()
|
||||
set(OPENCV_EXTRA_C_FLAGS "${OPENCV_EXTRA_C_FLAGS} /D _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE /D _SCL_SECURE_NO_WARNINGS")
|
||||
# 64-bit portability warnings, in MSVC80
|
||||
if(MSVC80)
|
||||
set(OPENCV_EXTRA_C_FLAGS "${OPENCV_EXTRA_C_FLAGS} /Wp64")
|
||||
endif()
|
||||
|
||||
if(BUILD_WITH_DEBUG_INFO)
|
||||
set(OPENCV_EXTRA_EXE_LINKER_FLAGS_RELEASE "${OPENCV_EXTRA_EXE_LINKER_FLAGS_RELEASE} /debug")
|
||||
endif()
|
||||
if(BUILD_WITH_DEBUG_INFO)
|
||||
set(OPENCV_EXTRA_EXE_LINKER_FLAGS_RELEASE "${OPENCV_EXTRA_EXE_LINKER_FLAGS_RELEASE} /debug")
|
||||
endif()
|
||||
|
||||
# Remove unreferenced functions: function level linking
|
||||
set(OPENCV_EXTRA_C_FLAGS "${OPENCV_EXTRA_C_FLAGS} /Gy")
|
||||
set(OPENCV_EXTRA_C_FLAGS_DEBUG "${OPENCV_EXTRA_C_FLAGS_DEBUG} /bigobj")
|
||||
if(BUILD_WITH_DEBUG_INFO)
|
||||
set(OPENCV_EXTRA_C_FLAGS_RELEASE "${OPENCV_EXTRA_C_FLAGS_RELEASE} /Zi")
|
||||
endif()
|
||||
# Remove unreferenced functions: function level linking
|
||||
set(OPENCV_EXTRA_C_FLAGS "${OPENCV_EXTRA_C_FLAGS} /Gy")
|
||||
if(NOT MSVC_VERSION LESS 1400)
|
||||
set(OPENCV_EXTRA_C_FLAGS "${OPENCV_EXTRA_C_FLAGS} /bigobj")
|
||||
endif()
|
||||
if(BUILD_WITH_DEBUG_INFO)
|
||||
set(OPENCV_EXTRA_C_FLAGS_RELEASE "${OPENCV_EXTRA_C_FLAGS_RELEASE} /Zi")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(CMAKE_COMPILER_IS_GNUCXX)
|
||||
# High level of warnings.
|
||||
set(OPENCV_EXTRA_C_FLAGS "${OPENCV_EXTRA_C_FLAGS} -Wall")
|
||||
# High level of warnings.
|
||||
set(OPENCV_EXTRA_C_FLAGS "${OPENCV_EXTRA_C_FLAGS} -Wall")
|
||||
|
||||
# The -Wno-long-long is required in 64bit systems when including sytem headers.
|
||||
if(X86_64)
|
||||
set(OPENCV_EXTRA_C_FLAGS "${OPENCV_EXTRA_C_FLAGS} -Wno-long-long")
|
||||
# The -Wno-long-long is required in 64bit systems when including sytem headers.
|
||||
if(X86_64)
|
||||
set(OPENCV_EXTRA_C_FLAGS "${OPENCV_EXTRA_C_FLAGS} -Wno-long-long")
|
||||
endif()
|
||||
|
||||
# We need pthread's
|
||||
if(UNIX AND NOT ANDROID)
|
||||
set(OPENCV_EXTRA_C_FLAGS "${OPENCV_EXTRA_C_FLAGS} -pthread")
|
||||
endif()
|
||||
|
||||
if(OPENCV_WARNINGS_ARE_ERRORS)
|
||||
set(OPENCV_EXTRA_C_FLAGS "${OPENCV_EXTRA_C_FLAGS} -Werror")
|
||||
endif()
|
||||
|
||||
if(X86 AND NOT MINGW64 AND NOT X86_64 AND NOT APPLE)
|
||||
set(OPENCV_EXTRA_C_FLAGS "${OPENCV_EXTRA_C_FLAGS} -march=i686")
|
||||
endif()
|
||||
|
||||
# Other optimizations
|
||||
if(ENABLE_OMIT_FRAME_POINTER)
|
||||
set(OPENCV_EXTRA_C_FLAGS_RELEASE "${OPENCV_EXTRA_C_FLAGS_RELEASE} -fomit-frame-pointer")
|
||||
else()
|
||||
set(OPENCV_EXTRA_C_FLAGS_RELEASE "${OPENCV_EXTRA_C_FLAGS_RELEASE} -fno-omit-frame-pointer")
|
||||
endif()
|
||||
if(ENABLE_FAST_MATH)
|
||||
set(OPENCV_EXTRA_C_FLAGS_RELEASE "${OPENCV_EXTRA_C_FLAGS_RELEASE} -ffast-math")
|
||||
endif()
|
||||
if(ENABLE_POWERPC)
|
||||
set(OPENCV_EXTRA_C_FLAGS_RELEASE "${OPENCV_EXTRA_C_FLAGS_RELEASE} -mcpu=G3 -mtune=G5")
|
||||
endif()
|
||||
if(ENABLE_SSE)
|
||||
set(OPENCV_EXTRA_C_FLAGS_RELEASE "${OPENCV_EXTRA_C_FLAGS_RELEASE} -msse")
|
||||
endif()
|
||||
if(ENABLE_SSE2)
|
||||
set(OPENCV_EXTRA_C_FLAGS_RELEASE "${OPENCV_EXTRA_C_FLAGS_RELEASE} -msse2")
|
||||
endif()
|
||||
|
||||
# SSE3 and further should be disabled under MingW because it generates compiler errors
|
||||
if(NOT MINGW)
|
||||
if(ENABLE_SSE3)
|
||||
set(OPENCV_EXTRA_C_FLAGS_RELEASE "${OPENCV_EXTRA_C_FLAGS_RELEASE} -msse3")
|
||||
endif()
|
||||
|
||||
# We need pthread's
|
||||
if(UNIX AND NOT ANDROID)
|
||||
set(OPENCV_EXTRA_C_FLAGS "${OPENCV_EXTRA_C_FLAGS} -pthread")
|
||||
if(${CMAKE_OPENCV_GCC_VERSION_NUM} GREATER 402)
|
||||
set(HAVE_GCC43_OR_NEWER 1)
|
||||
endif()
|
||||
if(${CMAKE_OPENCV_GCC_VERSION_NUM} GREATER 401)
|
||||
set(HAVE_GCC42_OR_NEWER 1)
|
||||
endif()
|
||||
|
||||
if(OPENCV_WARNINGS_ARE_ERRORS)
|
||||
set(OPENCV_EXTRA_C_FLAGS "${OPENCV_EXTRA_C_FLAGS} -Werror")
|
||||
endif()
|
||||
|
||||
if(X86 AND NOT MINGW64 AND NOT X86_64 AND NOT APPLE)
|
||||
set(OPENCV_EXTRA_C_FLAGS "${OPENCV_EXTRA_C_FLAGS} -march=i686")
|
||||
endif()
|
||||
|
||||
# Other optimizations
|
||||
if(ENABLE_OMIT_FRAME_POINTER)
|
||||
set(OPENCV_EXTRA_C_FLAGS_RELEASE "${OPENCV_EXTRA_C_FLAGS_RELEASE} -fomit-frame-pointer")
|
||||
else()
|
||||
set(OPENCV_EXTRA_C_FLAGS_RELEASE "${OPENCV_EXTRA_C_FLAGS_RELEASE} -fno-omit-frame-pointer")
|
||||
endif()
|
||||
if(ENABLE_FAST_MATH)
|
||||
set(OPENCV_EXTRA_C_FLAGS_RELEASE "${OPENCV_EXTRA_C_FLAGS_RELEASE} -ffast-math")
|
||||
endif()
|
||||
if(ENABLE_POWERPC)
|
||||
set(OPENCV_EXTRA_C_FLAGS_RELEASE "${OPENCV_EXTRA_C_FLAGS_RELEASE} -mcpu=G3 -mtune=G5")
|
||||
endif()
|
||||
if(ENABLE_SSE)
|
||||
set(OPENCV_EXTRA_C_FLAGS_RELEASE "${OPENCV_EXTRA_C_FLAGS_RELEASE} -msse")
|
||||
endif()
|
||||
if(ENABLE_SSE2)
|
||||
set(OPENCV_EXTRA_C_FLAGS_RELEASE "${OPENCV_EXTRA_C_FLAGS_RELEASE} -msse2")
|
||||
endif()
|
||||
|
||||
# SSE3 and further should be disabled under MingW because it generates compiler errors
|
||||
if(NOT MINGW)
|
||||
if(ENABLE_SSE3)
|
||||
set(OPENCV_EXTRA_C_FLAGS_RELEASE "${OPENCV_EXTRA_C_FLAGS_RELEASE} -msse3")
|
||||
if(HAVE_GCC42_OR_NEWER OR APPLE)
|
||||
if(ENABLE_SSSE3)
|
||||
set(OPENCV_EXTRA_C_FLAGS_RELEASE "${OPENCV_EXTRA_C_FLAGS_RELEASE} -mssse3")
|
||||
endif()
|
||||
if(HAVE_GCC43_OR_NEWER)
|
||||
if(ENABLE_SSE41)
|
||||
set(OPENCV_EXTRA_C_FLAGS_RELEASE "${OPENCV_EXTRA_C_FLAGS_RELEASE} -msse4.1")
|
||||
endif()
|
||||
|
||||
if(${CMAKE_OPENCV_GCC_VERSION_NUM} GREATER 402)
|
||||
set(HAVE_GCC43_OR_NEWER 1)
|
||||
endif()
|
||||
if(${CMAKE_OPENCV_GCC_VERSION_NUM} GREATER 401)
|
||||
set(HAVE_GCC42_OR_NEWER 1)
|
||||
endif()
|
||||
|
||||
if(HAVE_GCC42_OR_NEWER OR APPLE)
|
||||
if(ENABLE_SSSE3)
|
||||
set(OPENCV_EXTRA_C_FLAGS_RELEASE "${OPENCV_EXTRA_C_FLAGS_RELEASE} -mssse3")
|
||||
endif()
|
||||
if(HAVE_GCC43_OR_NEWER)
|
||||
if(ENABLE_SSE41)
|
||||
set(OPENCV_EXTRA_C_FLAGS_RELEASE "${OPENCV_EXTRA_C_FLAGS_RELEASE} -msse4.1")
|
||||
endif()
|
||||
if(ENABLE_SSE42)
|
||||
set(OPENCV_EXTRA_C_FLAGS_RELEASE "${OPENCV_EXTRA_C_FLAGS_RELEASE} -msse4.2")
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
endif(NOT MINGW)
|
||||
|
||||
if(X86 OR X86_64)
|
||||
if(NOT APPLE AND CMAKE_SIZEOF_VOID_P EQUAL 4)
|
||||
set(OPENCV_EXTRA_C_FLAGS_RELEASE "${OPENCV_EXTRA_C_FLAGS_RELEASE} -mfpmath=387")
|
||||
if(ENABLE_SSE42)
|
||||
set(OPENCV_EXTRA_C_FLAGS_RELEASE "${OPENCV_EXTRA_C_FLAGS_RELEASE} -msse4.2")
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
endif(NOT MINGW)
|
||||
|
||||
# Profiling?
|
||||
if(ENABLE_PROFILING)
|
||||
set(OPENCV_EXTRA_C_FLAGS_RELEASE "${OPENCV_EXTRA_C_FLAGS_RELEASE} -pg -g")
|
||||
elseif(NOT APPLE AND NOT ANDROID)
|
||||
# Remove unreferenced functions: function level linking
|
||||
set(OPENCV_EXTRA_C_FLAGS "${OPENCV_EXTRA_C_FLAGS} -ffunction-sections")
|
||||
if(X86 OR X86_64)
|
||||
if(NOT APPLE AND CMAKE_SIZEOF_VOID_P EQUAL 4)
|
||||
set(OPENCV_EXTRA_C_FLAGS_RELEASE "${OPENCV_EXTRA_C_FLAGS_RELEASE} -mfpmath=387")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set(OPENCV_EXTRA_C_FLAGS_RELEASE "${OPENCV_EXTRA_C_FLAGS_RELEASE} -DNDEBUG")
|
||||
set(OPENCV_EXTRA_C_FLAGS_DEBUG "${OPENCV_EXTRA_C_FLAGS_DEBUG} -O0 -DDEBUG -D_DEBUG")
|
||||
if(BUILD_WITH_DEBUG_INFO)
|
||||
set(OPENCV_EXTRA_C_FLAGS_DEBUG "${OPENCV_EXTRA_C_FLAGS_DEBUG} -ggdb3")
|
||||
endif()
|
||||
# Profiling?
|
||||
if(ENABLE_PROFILING)
|
||||
set(OPENCV_EXTRA_C_FLAGS_RELEASE "${OPENCV_EXTRA_C_FLAGS_RELEASE} -pg -g")
|
||||
elseif(NOT APPLE AND NOT ANDROID)
|
||||
# Remove unreferenced functions: function level linking
|
||||
set(OPENCV_EXTRA_C_FLAGS "${OPENCV_EXTRA_C_FLAGS} -ffunction-sections")
|
||||
endif()
|
||||
|
||||
set(OPENCV_EXTRA_C_FLAGS_RELEASE "${OPENCV_EXTRA_C_FLAGS_RELEASE} -DNDEBUG")
|
||||
set(OPENCV_EXTRA_C_FLAGS_DEBUG "${OPENCV_EXTRA_C_FLAGS_DEBUG} -O0 -DDEBUG -D_DEBUG")
|
||||
if(BUILD_WITH_DEBUG_INFO)
|
||||
set(OPENCV_EXTRA_C_FLAGS_DEBUG "${OPENCV_EXTRA_C_FLAGS_DEBUG} -ggdb3")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(MSVC)
|
||||
# 64-bit MSVC compiler uses SSE/SSE2 by default
|
||||
if(NOT MSVC64)
|
||||
if(ENABLE_SSE)
|
||||
set(OPENCV_EXTRA_C_FLAGS_RELEASE "${OPENCV_EXTRA_C_FLAGS_RELEASE} /arch:SSE")
|
||||
endif()
|
||||
if(ENABLE_SSE2)
|
||||
set(OPENCV_EXTRA_C_FLAGS_RELEASE "${OPENCV_EXTRA_C_FLAGS_RELEASE} /arch:SSE2")
|
||||
endif()
|
||||
# 64-bit MSVC compiler uses SSE/SSE2 by default
|
||||
if(NOT MSVC64)
|
||||
if(ENABLE_SSE)
|
||||
set(OPENCV_EXTRA_C_FLAGS_RELEASE "${OPENCV_EXTRA_C_FLAGS_RELEASE} /arch:SSE")
|
||||
endif()
|
||||
if(ENABLE_SSE3)
|
||||
set(OPENCV_EXTRA_C_FLAGS_RELEASE "${OPENCV_EXTRA_C_FLAGS_RELEASE} /arch:SSE3")
|
||||
endif()
|
||||
if(ENABLE_SSE4_1)
|
||||
set(OPENCV_EXTRA_C_FLAGS_RELEASE "${OPENCV_EXTRA_C_FLAGS_RELEASE} /arch:SSE4.1")
|
||||
endif()
|
||||
if (ENABLE_SSE OR ENABLE_SSE2 OR ENABLE_SSE3 OR ENABLE_SSE4_1)
|
||||
set(OPENCV_EXTRA_C_FLAGS_RELEASE "${OPENCV_EXTRA_C_FLAGS_RELEASE} /Oi")
|
||||
if(ENABLE_SSE2)
|
||||
set(OPENCV_EXTRA_C_FLAGS_RELEASE "${OPENCV_EXTRA_C_FLAGS_RELEASE} /arch:SSE2")
|
||||
endif()
|
||||
endif()
|
||||
if(ENABLE_SSE3)
|
||||
set(OPENCV_EXTRA_C_FLAGS_RELEASE "${OPENCV_EXTRA_C_FLAGS_RELEASE} /arch:SSE3")
|
||||
endif()
|
||||
if(ENABLE_SSE4_1)
|
||||
set(OPENCV_EXTRA_C_FLAGS_RELEASE "${OPENCV_EXTRA_C_FLAGS_RELEASE} /arch:SSE4.1")
|
||||
endif()
|
||||
if(ENABLE_SSE OR ENABLE_SSE2 OR ENABLE_SSE3 OR ENABLE_SSE4_1)
|
||||
set(OPENCV_EXTRA_C_FLAGS_RELEASE "${OPENCV_EXTRA_C_FLAGS_RELEASE} /Oi")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Extra link libs if the user selects building static libs:
|
||||
if(NOT BUILD_SHARED_LIBS AND CMAKE_COMPILER_IS_GNUCXX AND NOT ANDROID)
|
||||
# Android does not need these settings because they are already set by toolchain file
|
||||
set(OPENCV_LINKER_LIBS ${OPENCV_LINKER_LIBS} stdc++)
|
||||
set(OPENCV_EXTRA_C_FLAGS "-fPIC ${OPENCV_EXTRA_C_FLAGS}")
|
||||
# Android does not need these settings because they are already set by toolchain file
|
||||
set(OPENCV_LINKER_LIBS ${OPENCV_LINKER_LIBS} stdc++)
|
||||
set(OPENCV_EXTRA_C_FLAGS "-fPIC ${OPENCV_EXTRA_C_FLAGS}")
|
||||
endif()
|
||||
|
||||
# Add user supplied extra options (optimization, etc...)
|
||||
@ -169,23 +176,24 @@ set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${OPENCV_EXTRA_EXE_LINKER_
|
||||
set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} ${OPENCV_EXTRA_EXE_LINKER_FLAGS_RELEASE}")
|
||||
set(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} ${OPENCV_EXTRA_EXE_LINKER_FLAGS_DEBUG}")
|
||||
|
||||
if (WIN32 AND MSVC)
|
||||
# avoid warnings from MSVC about overriding the /W* option
|
||||
# we replace /W3 with /W4 only for C++ files,
|
||||
# since all the 3rd-party libraries OpenCV uses are in C,
|
||||
# and we do not care about their warnings.
|
||||
string(REPLACE "/W3" "/W4" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
|
||||
string(REPLACE "/W3" "/W4" CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}")
|
||||
string(REPLACE "/W3" "/W4" CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}")
|
||||
if(MSVC)
|
||||
# avoid warnings from MSVC about overriding the /W* option
|
||||
# we replace /W3 with /W4 only for C++ files,
|
||||
# since all the 3rd-party libraries OpenCV uses are in C,
|
||||
# and we do not care about their warnings.
|
||||
string(REPLACE "/W3" "/W4" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
|
||||
string(REPLACE "/W3" "/W4" CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}")
|
||||
string(REPLACE "/W3" "/W4" CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}")
|
||||
|
||||
# allow extern "C" functions throw exceptions
|
||||
string(REPLACE "/EHsc" "/EHsc-" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
|
||||
string(REPLACE "/EHsc" "/EHsc-" CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE}")
|
||||
string(REPLACE "/EHsc" "/EHsc-" CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG}")
|
||||
string(REPLACE "/EHsc" "/EHsc-" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
|
||||
string(REPLACE "/EHsc" "/EHsc-" CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}")
|
||||
string(REPLACE "/EHsc" "/EHsc-" CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}")
|
||||
# allow extern "C" functions throw exceptions
|
||||
foreach(flags CMAKE_C_FLAGS CMAKE_C_FLAGS_RELEASE CMAKE_C_FLAGS_RELEASE CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_RELEASE CMAKE_CXX_FLAGS_DEBUG)
|
||||
string(REPLACE "/EHsc-" "/EHs" ${flags} "${${flags}}")
|
||||
string(REPLACE "/EHsc" "/EHs" ${flags} "${${flags}}")
|
||||
|
||||
string(REPLACE "/Zm1000" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
|
||||
string(REPLACE "/Zm1000" " " CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
|
||||
string(REPLACE "/Zm1000" "" ${flags} "${${flags}}")
|
||||
endforeach()
|
||||
|
||||
if(NOT ENABLE_NOISY_WARNINGS)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4251") #class 'std::XXX' needs to have dll-interface to be used by clients of YYY
|
||||
endif()
|
||||
endif()
|
||||
|
@ -127,7 +127,6 @@ if(ANDROID_EXECUTABLE)
|
||||
if(ANDROID_SDK_TARGETS AND CMAKE_VERSION VERSION_GREATER "2.8")
|
||||
set_property( CACHE ANDROID_SDK_TARGET PROPERTY STRINGS ${ANDROID_SDK_TARGETS} )
|
||||
endif()
|
||||
|
||||
endif(ANDROID_EXECUTABLE)
|
||||
|
||||
# finds minimal installed SDK target compatible with provided names or API levels
|
||||
@ -136,7 +135,7 @@ endif(ANDROID_EXECUTABLE)
|
||||
macro(android_get_compatible_target VAR)
|
||||
set(${VAR} "${VAR}-NOTFOUND")
|
||||
if(ANDROID_SDK_TARGETS)
|
||||
list(GET ANDROID_SDK_TARGETS 1 __lvl)
|
||||
list(GET ANDROID_SDK_TARGETS 0 __lvl)
|
||||
string(REGEX MATCH "[0-9]+$" __lvl "${__lvl}")
|
||||
|
||||
#find minimal level mathing to all provided levels
|
||||
|
@ -1,11 +1,19 @@
|
||||
file(TO_CMAKE_PATH "$ENV{ANT_DIR}" ANT_DIR_ENV_PATH)
|
||||
file(TO_CMAKE_PATH "$ENV{ProgramFiles}" ProgramFiles_ENV_PATH)
|
||||
|
||||
find_host_program(ANT_EXECUTABLE NAMES ant.bat ant
|
||||
PATHS "${ANT_DIR_ENV_PATH}/bin"
|
||||
"${ProgramFiles_ENV_PATH}/apache-ant/bin"
|
||||
if(CMAKE_HOST_WIN32)
|
||||
set(ANT_NAME ant.bat)
|
||||
else()
|
||||
set(ANT_NAME ant)
|
||||
endif()
|
||||
|
||||
find_host_program(ANT_EXECUTABLE NAMES ${ANT_NAME}
|
||||
PATHS "${ANT_DIR_ENV_PATH}/bin" "${ProgramFiles_ENV_PATH}/apache-ant/bin"
|
||||
NO_DEFAULT_PATH
|
||||
)
|
||||
|
||||
find_host_program(ANT_EXECUTABLE NAMES ${ANT_NAME})
|
||||
|
||||
if(ANT_EXECUTABLE)
|
||||
execute_process(COMMAND ${ANT_EXECUTABLE} -version
|
||||
OUTPUT_VARIABLE ANT_VERSION_FULL
|
||||
|
@ -48,6 +48,9 @@ if(CMAKE_COMPILER_IS_GNUCXX)
|
||||
# Typical output in CMAKE_OPENCV_GCC_VERSION_FULL: "c+//0 (whatever) 4.2.3 (...)"
|
||||
# Look for the version number
|
||||
string(REGEX MATCH "[0-9]+.[0-9]+.[0-9]+" CMAKE_GCC_REGEX_VERSION "${CMAKE_OPENCV_GCC_VERSION_FULL}")
|
||||
if(NOT CMAKE_GCC_REGEX_VERSION)
|
||||
string(REGEX MATCH "[0-9]+.[0-9]+" CMAKE_GCC_REGEX_VERSION "${CMAKE_OPENCV_GCC_VERSION_FULL}")
|
||||
endif()
|
||||
|
||||
# Split the three parts:
|
||||
string(REGEX MATCHALL "[0-9]+" CMAKE_OPENCV_GCC_VERSIONS "${CMAKE_GCC_REGEX_VERSION}")
|
||||
|
@ -1,7 +1,18 @@
|
||||
if(MSVC AND NOT PYTHON_EXECUTABLE)
|
||||
# search for executable with the same bitness as resulting binaries
|
||||
# standard FindPythonInterp always prefers executable from system path
|
||||
foreach(_CURRENT_VERSION ${Python_ADDITIONAL_VERSIONS} 2.7 2.6 2.5 2.4 2.3 2.2 2.1 2.0 1.6 1.5)
|
||||
find_host_program(PYTHON_EXECUTABLE
|
||||
NAMES python${_CURRENT_VERSION} python
|
||||
PATHS [HKEY_LOCAL_MACHINE\\\\SOFTWARE\\\\Python\\\\PythonCore\\\\${_CURRENT_VERSION}\\\\InstallPath]
|
||||
NO_SYSTEM_ENVIRONMENT_PATH
|
||||
)
|
||||
endforeach()
|
||||
endif()
|
||||
find_host_package(PythonInterp)
|
||||
|
||||
set(PYTHON_USE_NUMPY 0)
|
||||
set(HAVE_SPHINX 0)
|
||||
unset(PYTHON_USE_NUMPY CACHE)
|
||||
unset(HAVE_SPHINX CACHE)
|
||||
|
||||
if(PYTHON_EXECUTABLE)
|
||||
if(NOT ANDROID AND NOT IOS)
|
||||
@ -14,9 +25,10 @@ if(PYTHON_EXECUTABLE)
|
||||
|
||||
execute_process(COMMAND ${PYTHON_EXECUTABLE} --version
|
||||
ERROR_VARIABLE PYTHON_VERSION_FULL
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
ERROR_STRIP_TRAILING_WHITESPACE)
|
||||
|
||||
string(REGEX MATCH "[0-9]+.[0-9]+" PYTHON_VERSION_MAJOR_MINOR "${PYTHON_VERSION_FULL}")
|
||||
string(REGEX MATCH "[0-9]+.[0-9]+.[0-9]+" PYTHON_VERSION_FULL "${PYTHON_VERSION_FULL}")
|
||||
|
||||
if(NOT ANDROID AND NOT IOS)
|
||||
if(CMAKE_HOST_UNIX)
|
||||
@ -46,18 +58,25 @@ if(PYTHON_EXECUTABLE)
|
||||
set(PYTHON_PACKAGES_PATH "${PYTHON_PATH}/Lib/site-packages")
|
||||
endif()
|
||||
|
||||
# Attempt to discover the NumPy include directory. If this succeeds, then build python API with NumPy
|
||||
execute_process(COMMAND ${PYTHON_EXECUTABLE} -c "import os; os.environ['DISTUTILS_USE_SDK']='1'; import numpy.distutils; print numpy.distutils.misc_util.get_numpy_include_dirs()[0]"
|
||||
RESULT_VARIABLE PYTHON_NUMPY_PROCESS
|
||||
OUTPUT_VARIABLE PYTHON_NUMPY_INCLUDE_DIRS
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
if(NOT PYTHON_NUMPY_INCLUDE_DIR)
|
||||
# Attempt to discover the NumPy include directory. If this succeeds, then build python API with NumPy
|
||||
execute_process(COMMAND ${PYTHON_EXECUTABLE} -c "import os; os.environ['DISTUTILS_USE_SDK']='1'; import numpy.distutils; print numpy.distutils.misc_util.get_numpy_include_dirs()[0]"
|
||||
RESULT_VARIABLE PYTHON_NUMPY_PROCESS
|
||||
OUTPUT_VARIABLE PYTHON_NUMPY_INCLUDE_DIR
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
|
||||
if(PYTHON_NUMPY_PROCESS EQUAL 0)
|
||||
set(PYTHON_USE_NUMPY 1)
|
||||
add_definitions(-DPYTHON_USE_NUMPY=1)
|
||||
file(TO_CMAKE_PATH "${PYTHON_NUMPY_INCLUDE_DIRS}" PYTHON_NUMPY_INCLUDE_DIRS)
|
||||
ocv_include_directories(${PYTHON_NUMPY_INCLUDE_DIRS})
|
||||
message(STATUS " Use NumPy headers from: ${PYTHON_NUMPY_INCLUDE_DIRS}")
|
||||
if(PYTHON_NUMPY_PROCESS EQUAL 0)
|
||||
file(TO_CMAKE_PATH "${PYTHON_NUMPY_INCLUDE_DIR}" PYTHON_NUMPY_INCLUDE_DIR)
|
||||
set(PYTHON_NUMPY_INCLUDE_DIR ${PYTHON_NUMPY_INCLUDE_DIR} CACHE PATH "Path to numpy headers")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(PYTHON_NUMPY_INCLUDE_DIR)
|
||||
set(PYTHON_USE_NUMPY TRUE)
|
||||
execute_process(COMMAND ${PYTHON_EXECUTABLE} -c "import numpy; print numpy.version.version"
|
||||
RESULT_VARIABLE PYTHON_NUMPY_PROCESS
|
||||
OUTPUT_VARIABLE PYTHON_NUMPY_VERSION
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
endif()
|
||||
endif(NOT ANDROID AND NOT IOS)
|
||||
|
||||
@ -73,7 +92,7 @@ if(PYTHON_EXECUTABLE)
|
||||
find_host_program(SPHINX_BUILD sphinx-build)
|
||||
if(SPHINX_BUILD)
|
||||
set(HAVE_SPHINX 1)
|
||||
message(STATUS " Found Sphinx ${SPHINX_VERSION}: ${SPHINX_BUILD}")
|
||||
message(STATUS " Found Sphinx ${SPHINX_VERSION}: ${SPHINX_BUILD}")
|
||||
endif()
|
||||
endif()
|
||||
endif(BUILD_DOCS)
|
||||
|
@ -20,10 +20,10 @@ endif()
|
||||
if(NOT HAVE_TBB)
|
||||
set(TBB_DEFAULT_INCLUDE_DIRS "/opt/intel/tbb" "/usr/local/include" "/usr/include" "C:/Program Files/Intel/TBB" "C:/Program Files (x86)/Intel/TBB" "C:/Program Files (x86)/TBB" "${CMAKE_INSTALL_PREFIX}/include")
|
||||
|
||||
find_path(TBB_INCLUDE_DIR "tbb/tbb.h" PATHS ${TBB_DEFAULT_INCLUDE_DIRS} DOC "The path to TBB headers")
|
||||
if(TBB_INCLUDE_DIR)
|
||||
find_path(TBB_INCLUDE_DIRS "tbb/tbb.h" PATHS ${TBB_INCLUDE_DIR} ${TBB_DEFAULT_INCLUDE_DIRS} DOC "The path to TBB headers")
|
||||
if(TBB_INCLUDE_DIRS)
|
||||
if(UNIX)
|
||||
set(TBB_LIB_DIR "${TBB_INCLUDE_DIR}/../lib" CACHE PATH "Full path of TBB library directory")
|
||||
set(TBB_LIB_DIR "${TBB_INCLUDE_DIRS}/../lib" CACHE PATH "Full path of TBB library directory")
|
||||
link_directories("${TBB_LIB_DIR}")
|
||||
endif()
|
||||
if(APPLE)
|
||||
@ -35,11 +35,11 @@ if(NOT HAVE_TBB)
|
||||
set(OPENCV_LINKER_LIBS ${OPENCV_LINKER_LIBS} tbb)
|
||||
elseif (WIN32)
|
||||
if(CMAKE_COMPILER_IS_GNUCXX)
|
||||
set(TBB_LIB_DIR "${TBB_INCLUDE_DIR}/../lib" CACHE PATH "Full path of TBB library directory")
|
||||
set(TBB_LIB_DIR "${TBB_INCLUDE_DIRS}/../lib" CACHE PATH "Full path of TBB library directory")
|
||||
link_directories("${TBB_LIB_DIR}")
|
||||
set(OPENCV_LINKER_LIBS ${OPENCV_LINKER_LIBS} tbb)
|
||||
else()
|
||||
get_filename_component(_TBB_LIB_PATH "${TBB_INCLUDE_DIR}/../lib" ABSOLUTE)
|
||||
get_filename_component(_TBB_LIB_PATH "${TBB_INCLUDE_DIRS}/../lib" ABSOLUTE)
|
||||
|
||||
if(CMAKE_SYSTEM_PROCESSOR MATCHES amd64*|x86_64* OR MSVC64)
|
||||
set(_TBB_LIB_PATH "${_TBB_LIB_PATH}/intel64")
|
||||
@ -62,8 +62,20 @@ if(NOT HAVE_TBB)
|
||||
endif()
|
||||
|
||||
set(HAVE_TBB 1)
|
||||
if(NOT "${TBB_INCLUDE_DIR}" STREQUAL "")
|
||||
ocv_include_directories("${TBB_INCLUDE_DIR}")
|
||||
if(NOT "${TBB_INCLUDE_DIRS}" STREQUAL "")
|
||||
ocv_include_directories("${TBB_INCLUDE_DIRS}")
|
||||
endif()
|
||||
endif(TBB_INCLUDE_DIR)
|
||||
endif(TBB_INCLUDE_DIRS)
|
||||
endif(NOT HAVE_TBB)
|
||||
|
||||
# get TBB version
|
||||
if(HAVE_TBB)
|
||||
find_file(TBB_STDDEF_PATH tbb/tbb_stddef.h "${TBB_INCLUDE_DIRS}")
|
||||
endif()
|
||||
if(HAVE_TBB AND TBB_STDDEF_PATH)
|
||||
ocv_parse_header("${TBB_STDDEF_PATH}" TBB_VERSION_LINES TBB_VERSION_MAJOR TBB_VERSION_MINOR TBB_INTERFACE_VERSION)
|
||||
else()
|
||||
unset(TBB_VERSION_MAJOR)
|
||||
unset(TBB_VERSION_MINOR)
|
||||
unset(TBB_INTERFACE_VERSION)
|
||||
endif()
|
||||
|
@ -113,17 +113,17 @@ function(set_ipp_old_libraries)
|
||||
endif()
|
||||
|
||||
set(IPP_LIBRARIES
|
||||
${IPP_LIB_PREFIX}${IPP_PREFIX}${IPPVM}${IPP_MRGD}${IPP_ARCH}${IPP_LIB_SUFFIX }
|
||||
${IPP_LIB_PREFIX}${IPP_PREFIX}${IPPVM}${IPP_DISP}${IPP_ARCH}${IPP_LIB_SUFFIX }
|
||||
${IPP_LIB_PREFIX}${IPP_PREFIX}${IPPCC}${IPP_MRGD}${IPP_ARCH}${IPP_LIB_SUFFIX }
|
||||
${IPP_LIB_PREFIX}${IPP_PREFIX}${IPPCC}${IPP_DISP}${IPP_ARCH}${IPP_LIB_SUFFIX }
|
||||
${IPP_LIB_PREFIX}${IPP_PREFIX}${IPPCV}${IPP_MRGD}${IPP_ARCH}${IPP_LIB_SUFFIX }
|
||||
${IPP_LIB_PREFIX}${IPP_PREFIX}${IPPCV}${IPP_DISP}${IPP_ARCH}${IPP_LIB_SUFFIX }
|
||||
${IPP_LIB_PREFIX}${IPP_PREFIX}${IPPIP}${IPP_MRGD}${IPP_ARCH}${IPP_LIB_SUFFIX }
|
||||
${IPP_LIB_PREFIX}${IPP_PREFIX}${IPPIP}${IPP_DISP}${IPP_ARCH}${IPP_LIB_SUFFIX }
|
||||
${IPP_LIB_PREFIX}${IPP_PREFIX}${IPPSP}${IPP_MRGD}${IPP_ARCH}${IPP_LIB_SUFFIX }
|
||||
${IPP_LIB_PREFIX}${IPP_PREFIX}${IPPSP}${IPP_DISP}${IPP_ARCH}${IPP_LIB_SUFFIX }
|
||||
${IPP_LIB_PREFIX}${IPP_PREFIX}${IPPCORE}${IPP_ARCH}${IPP_SUFFIX}${IPP_LIB_SUFFIX }
|
||||
${IPP_LIB_PREFIX}${IPP_PREFIX}${IPPVM}${IPP_MRGD}${IPP_ARCH}${IPP_LIB_SUFFIX}
|
||||
${IPP_LIB_PREFIX}${IPP_PREFIX}${IPPVM}${IPP_DISP}${IPP_ARCH}${IPP_LIB_SUFFIX}
|
||||
${IPP_LIB_PREFIX}${IPP_PREFIX}${IPPCC}${IPP_MRGD}${IPP_ARCH}${IPP_LIB_SUFFIX}
|
||||
${IPP_LIB_PREFIX}${IPP_PREFIX}${IPPCC}${IPP_DISP}${IPP_ARCH}${IPP_LIB_SUFFIX}
|
||||
${IPP_LIB_PREFIX}${IPP_PREFIX}${IPPCV}${IPP_MRGD}${IPP_ARCH}${IPP_LIB_SUFFIX}
|
||||
${IPP_LIB_PREFIX}${IPP_PREFIX}${IPPCV}${IPP_DISP}${IPP_ARCH}${IPP_LIB_SUFFIX}
|
||||
${IPP_LIB_PREFIX}${IPP_PREFIX}${IPPIP}${IPP_MRGD}${IPP_ARCH}${IPP_LIB_SUFFIX}
|
||||
${IPP_LIB_PREFIX}${IPP_PREFIX}${IPPIP}${IPP_DISP}${IPP_ARCH}${IPP_LIB_SUFFIX}
|
||||
${IPP_LIB_PREFIX}${IPP_PREFIX}${IPPSP}${IPP_MRGD}${IPP_ARCH}${IPP_LIB_SUFFIX}
|
||||
${IPP_LIB_PREFIX}${IPP_PREFIX}${IPPSP}${IPP_DISP}${IPP_ARCH}${IPP_LIB_SUFFIX}
|
||||
${IPP_LIB_PREFIX}${IPP_PREFIX}${IPPCORE}${IPP_ARCH}${IPP_SUFFIX}${IPP_LIB_SUFFIX}
|
||||
PARENT_SCOPE)
|
||||
|
||||
return()
|
||||
@ -147,12 +147,12 @@ function(set_ipp_new_libraries)
|
||||
set(IPPVM "vm") # vector math
|
||||
|
||||
set(IPP_LIBRARIES
|
||||
${IPP_LIB_PREFIX}${IPP_PREFIX}${IPPVM}${IPP_SUFFIX}${IPP_LIB_SUFFIX }
|
||||
${IPP_LIB_PREFIX}${IPP_PREFIX}${IPPCC}${IPP_SUFFIX}${IPP_LIB_SUFFIX }
|
||||
${IPP_LIB_PREFIX}${IPP_PREFIX}${IPPCV}${IPP_SUFFIX}${IPP_LIB_SUFFIX }
|
||||
${IPP_LIB_PREFIX}${IPP_PREFIX}${IPPI}${IPP_SUFFIX}${IPP_LIB_SUFFIX }
|
||||
${IPP_LIB_PREFIX}${IPP_PREFIX}${IPPS}${IPP_SUFFIX}${IPP_LIB_SUFFIX }
|
||||
${IPP_LIB_PREFIX}${IPP_PREFIX}${IPPCORE}${IPP_SUFFIX}${IPP_LIB_SUFFIX }
|
||||
${IPP_LIB_PREFIX}${IPP_PREFIX}${IPPVM}${IPP_SUFFIX}${IPP_LIB_SUFFIX}
|
||||
${IPP_LIB_PREFIX}${IPP_PREFIX}${IPPCC}${IPP_SUFFIX}${IPP_LIB_SUFFIX}
|
||||
${IPP_LIB_PREFIX}${IPP_PREFIX}${IPPCV}${IPP_SUFFIX}${IPP_LIB_SUFFIX}
|
||||
${IPP_LIB_PREFIX}${IPP_PREFIX}${IPPI}${IPP_SUFFIX}${IPP_LIB_SUFFIX}
|
||||
${IPP_LIB_PREFIX}${IPP_PREFIX}${IPPS}${IPP_SUFFIX}${IPP_LIB_SUFFIX}
|
||||
${IPP_LIB_PREFIX}${IPP_PREFIX}${IPPCORE}${IPP_SUFFIX}${IPP_LIB_SUFFIX}
|
||||
PARENT_SCOPE)
|
||||
|
||||
return()
|
||||
|
@ -74,13 +74,28 @@ IF (OPENEXR_INCLUDE_PATH AND OPENEXR_IMATH_LIBRARY AND OPENEXR_ILMIMF_LIBRARY AN
|
||||
ENDIF ()
|
||||
|
||||
IF(OPENEXR_FOUND)
|
||||
IF(NOT OPENEXR_FIND_QUIETLY)
|
||||
MESSAGE(STATUS "Found OpenEXR: ${OPENEXR_ILMIMF_LIBRARY}")
|
||||
ENDIF()
|
||||
IF(NOT OPENEXR_FIND_QUIETLY)
|
||||
MESSAGE(STATUS "Found OpenEXR: ${OPENEXR_ILMIMF_LIBRARY}")
|
||||
ENDIF()
|
||||
if(PKG_CONFIG_FOUND AND NOT OPENEXR_VERSION)
|
||||
get_filename_component(OPENEXR_LIB_PATH "${OPENEXR_ILMIMF_LIBRARY}" PATH)
|
||||
if(EXISTS "${OPENEXR_LIB_PATH}/pkgconfig/OpenEXR.pc")
|
||||
execute_process(COMMAND ${PKG_CONFIG_EXECUTABLE} --modversion "${OPENEXR_LIB_PATH}/pkgconfig/OpenEXR.pc"
|
||||
RESULT_VARIABLE PKG_CONFIG_PROCESS
|
||||
OUTPUT_VARIABLE OPENEXR_VERSION
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_QUIET)
|
||||
if(NOT PKG_CONFIG_PROCESS EQUAL 0)
|
||||
SET(OPENEXR_VERSION "Unknown")
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
if(NOT OPENEXR_VERSION)
|
||||
SET(OPENEXR_VERSION "Unknown")
|
||||
endif()
|
||||
ELSE()
|
||||
IF(OPENEXR_FIND_REQUIRED)
|
||||
MESSAGE(FATAL_ERROR "Could not find OpenEXR library")
|
||||
ENDIF()
|
||||
IF(OPENEXR_FIND_REQUIRED)
|
||||
MESSAGE(FATAL_ERROR "Could not find OpenEXR library")
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
MARK_AS_ADVANCED(
|
||||
|
@ -48,9 +48,15 @@ if(OPENNI_LIBRARY AND OPENNI_INCLUDES)
|
||||
endif()
|
||||
endif() #if(OPENNI_LIBRARY AND OPENNI_INCLUDES)
|
||||
|
||||
get_filename_component(OPENNI_LIB_DIR "${OPENNI_LIBRARY}" PATH CACHE)
|
||||
get_filename_component(OPENNI_INCLUDE_DIR ${OPENNI_INCLUDES} PATH CACHE)
|
||||
get_filename_component(OPENNI_PRIME_SENSOR_MODULE_BIN_DIR "${OPENNI_PRIME_SENSOR_MODULE}" PATH CACHE)
|
||||
get_filename_component(OPENNI_LIB_DIR "${OPENNI_LIBRARY}" PATH)
|
||||
get_filename_component(OPENNI_INCLUDE_DIR ${OPENNI_INCLUDES} PATH)
|
||||
get_filename_component(OPENNI_PRIME_SENSOR_MODULE_BIN_DIR "${OPENNI_PRIME_SENSOR_MODULE}" PATH)
|
||||
|
||||
if(HAVE_OPENNI)
|
||||
set(OPENNI_LIB_DIR "${OPENNI_LIB_DIR}" CACHE PATH "Path to OpenNI libraries" FORCE)
|
||||
set(OPENNI_INCLUDE_DIR "${OPENNI_INCLUDE_DIR}" CACHE PATH "Path to OpenNI headers" FORCE)
|
||||
set(OPENNI_PRIME_SENSOR_MODULE_BIN_DIR "${OPENNI_PRIME_SENSOR_MODULE_BIN_DIR}" CACHE PATH "Path to OpenNI PrimeSensor Module binaries" FORCE)
|
||||
endif()
|
||||
|
||||
if(OPENNI_LIBRARY)
|
||||
set(OPENNI_LIB_DIR_INTERNAL "${OPENNI_LIB_DIR}" CACHE INTERNAL "This is the value of the last time OPENNI_LIB_DIR was set successfully." FORCE)
|
||||
@ -73,3 +79,11 @@ endif()
|
||||
mark_as_advanced(FORCE OPENNI_PRIME_SENSOR_MODULE)
|
||||
mark_as_advanced(FORCE OPENNI_LIBRARY)
|
||||
mark_as_advanced(FORCE OPENNI_INCLUDES)
|
||||
|
||||
if(HAVE_OPENNI)
|
||||
ocv_parse_header("${OPENNI_INCLUDE_DIR}/XnVersion.h" OPENNI_VERSION_LINES XN_MAJOR_VERSION XN_MINOR_VERSION XN_MAINTENANCE_VERSION XN_BUILD_VERSION)
|
||||
if(XN_MAJOR_VERSION)
|
||||
set(OPENNI_VERSION_STRING ${XN_MAJOR_VERSION}.${XN_MINOR_VERSION}.${XN_MAINTENANCE_VERSION} CACHE INTERNAL "OpenNI version")
|
||||
set(OPENNI_VERSION_BUILD ${XN_BUILD_VERSION} CACHE INTERNAL "OpenNI build version")
|
||||
endif()
|
||||
endif()
|
||||
|
@ -13,8 +13,12 @@ else()
|
||||
set(ZLIB_LIBRARY z)
|
||||
set(ZLIB_LIBRARIES ${ZLIB_LIBRARY})
|
||||
set(ZLIB_INCLUDE_DIR "")
|
||||
ocv_parse_header2(ZLIB "${ANDROID_SYSROOT}/usr/include/zlib.h" ZLIB_VERSION "")
|
||||
else()
|
||||
include(FindZLIB)
|
||||
if(NOT ZLIB_VERSION_STRING)
|
||||
ocv_parse_header2(ZLIB "${ZLIB_INCLUDE_DIR}/zlib.h" ZLIB_VERSION "")
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
@ -33,6 +37,9 @@ if(WITH_TIFF)
|
||||
unset_all(TIFF_FOUND)
|
||||
else()
|
||||
include(FindTIFF)
|
||||
if(TIFF_FOUND)
|
||||
ocv_parse_header("${TIFF_INCLUDE_DIR}/tiff.h" TIFF_VERSION_LINES TIFF_VERSION_CLASSIC TIFF_VERSION_BIG TIFF_VERSION TIFF_BIGTIFF_VERSION)
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
@ -43,6 +50,15 @@ if(WITH_TIFF AND NOT TIFF_FOUND)
|
||||
set(TIFF_LIBRARIES ${TIFF_LIBRARY})
|
||||
add_subdirectory("${OpenCV_SOURCE_DIR}/3rdparty/libtiff")
|
||||
set(TIFF_INCLUDE_DIR "${${TIFF_LIBRARY}_SOURCE_DIR}" "${${TIFF_LIBRARY}_BINARY_DIR}")
|
||||
ocv_parse_header("${${TIFF_LIBRARY}_SOURCE_DIR}/tiff.h" TIFF_VERSION_LINES TIFF_VERSION_CLASSIC TIFF_VERSION_BIG TIFF_VERSION TIFF_BIGTIFF_VERSION)
|
||||
endif()
|
||||
|
||||
if(TIFF_VERSION_CLASSIC AND NOT TIFF_VERSION)
|
||||
set(TIFF_VERSION ${TIFF_VERSION_CLASSIC})
|
||||
endif()
|
||||
|
||||
if(TIFF_BIGTIFF_VERSION AND NOT TIFF_VERSION_BIG)
|
||||
set(TIFF_VERSION_BIG ${TIFF_BIGTIFF_VERSION})
|
||||
endif()
|
||||
|
||||
################### libjpeg - optional
|
||||
@ -63,6 +79,9 @@ if(WITH_JPEG AND NOT JPEG_FOUND)
|
||||
set(JPEG_INCLUDE_DIR "${${JPEG_LIBRARY}_SOURCE_DIR}")
|
||||
endif()
|
||||
|
||||
ocv_parse_header("${JPEG_INCLUDE_DIR}/jpeglib.h" JPEG_VERSION_LINES JPEG_LIB_VERSION)
|
||||
|
||||
|
||||
################### libjasper - optional (should be searched after libjpeg)
|
||||
if(WITH_JASPER)
|
||||
if(BUILD_JASPER)
|
||||
@ -81,6 +100,8 @@ if(WITH_JASPER AND NOT JASPER_FOUND)
|
||||
set(JASPER_INCLUDE_DIR "${${JASPER_LIBRARY}_SOURCE_DIR}")
|
||||
endif()
|
||||
|
||||
ocv_parse_header2(JASPER "${JASPER_INCLUDE_DIR}/jasper/jas_config.h" JAS_VERSION "")
|
||||
|
||||
################### libpng - optional (should be searched after zlib)
|
||||
if(WITH_PNG)
|
||||
if(BUILD_PNG)
|
||||
@ -88,8 +109,13 @@ if(WITH_PNG)
|
||||
else()
|
||||
include(FindPNG)
|
||||
if(PNG_FOUND)
|
||||
check_include_file(${PNG_PNG_INCLUDE_DIR}/png.h HAVE_PNG_H)
|
||||
check_include_file(${PNG_PNG_INCLUDE_DIR}/libpng/png.h HAVE_LIBPNG_PNG_H)
|
||||
check_include_file("${PNG_PNG_INCLUDE_DIR}/png.h" HAVE_PNG_H)
|
||||
check_include_file("${PNG_PNG_INCLUDE_DIR}/libpng/png.h" HAVE_LIBPNG_PNG_H)
|
||||
if(HAVE_PNG_H)
|
||||
ocv_parse_header("${PNG_PNG_INCLUDE_DIR}/png.h" PNG_VERSION_LINES PNG_LIBPNG_VER_MAJOR PNG_LIBPNG_VER_MINOR PNG_LIBPNG_VER_RELEASE)
|
||||
elseif(HAVE_LIBPNG_PNG_H)
|
||||
ocv_parse_header("${PNG_PNG_INCLUDE_DIR}/libpng/png.h" PNG_VERSION_LINES PNG_LIBPNG_VER_MAJOR PNG_LIBPNG_VER_MINOR PNG_LIBPNG_VER_RELEASE)
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
@ -102,8 +128,11 @@ if(WITH_PNG AND NOT PNG_FOUND)
|
||||
add_subdirectory("${OpenCV_SOURCE_DIR}/3rdparty/libpng")
|
||||
set(PNG_INCLUDE_DIR "${${PNG_LIBRARY}_SOURCE_DIR}")
|
||||
set(PNG_DEFINITIONS "")
|
||||
ocv_parse_header("${PNG_INCLUDE_DIR}/png.h" PNG_VERSION_LINES PNG_LIBPNG_VER_MAJOR PNG_LIBPNG_VER_MINOR PNG_LIBPNG_VER_RELEASE)
|
||||
endif()
|
||||
|
||||
set(PNG_VERSION "${PNG_LIBPNG_VER_MAJOR}.${PNG_LIBPNG_VER_MINOR}.${PNG_LIBPNG_VER_RELEASE}")
|
||||
|
||||
################### OpenEXR - optional
|
||||
if(WITH_OPENEXR)
|
||||
include("${OpenCV_SOURCE_DIR}/cmake/OpenCVFindOpenEXR.cmake")
|
||||
|
@ -476,13 +476,13 @@ macro(ocv_create_module)
|
||||
RUNTIME DESTINATION bin COMPONENT main
|
||||
LIBRARY DESTINATION ${OPENCV_LIB_INSTALL_PATH} COMPONENT main
|
||||
ARCHIVE DESTINATION ${OPENCV_LIB_INSTALL_PATH} COMPONENT main
|
||||
|
||||
)
|
||||
|
||||
# only "public" headers need to be installed
|
||||
if(OPENCV_MODULE_${the_module}_HEADERS AND OPENCV_MODULES_PUBLIC MATCHES "(^|;)${the_module}(;|$)")
|
||||
foreach(hdr ${OPENCV_MODULE_${the_module}_HEADERS})
|
||||
if(hdr MATCHES "(opencv2/.*)/[^/]+.h(..)?$")
|
||||
string(REGEX REPLACE "^.*opencv2/" "opencv2/" hdr2 "${hdr}")
|
||||
if(hdr2 MATCHES "^(opencv2/.*)/[^/]+.h(..)?$")
|
||||
install(FILES ${hdr} DESTINATION "${OPENCV_INCLUDE_PREFIX}/${CMAKE_MATCH_1}" COMPONENT main)
|
||||
endif()
|
||||
endforeach()
|
||||
|
@ -104,6 +104,15 @@ macro(CHECK_MODULE module_name define)
|
||||
endmacro()
|
||||
|
||||
|
||||
set(OPENCV_BUILD_INFO_FILE "${OpenCV_BINARY_DIR}/version_string.tmp")
|
||||
file(REMOVE "${OPENCV_BUILD_INFO_FILE}")
|
||||
function(ocv_output_status msg)
|
||||
message(STATUS "${msg}")
|
||||
string(REPLACE "\\" "\\\\" msg "${msg}")
|
||||
string(REPLACE "\"" "\\\"" msg "${msg}")
|
||||
file(APPEND "${OPENCV_BUILD_INFO_FILE}" "\"${msg}\\n\"\n")
|
||||
endfunction()
|
||||
|
||||
# Status report function.
|
||||
# Automatically align right column and selects text based on condition.
|
||||
# Usage:
|
||||
@ -133,7 +142,7 @@ function(status text)
|
||||
if(status_text_length LESS status_placeholder_length)
|
||||
string(SUBSTRING "${text}${status_placeholder}" 0 ${status_placeholder_length} status_text)
|
||||
elseif(DEFINED status_then OR DEFINED status_else)
|
||||
message(STATUS "${text}")
|
||||
ocv_output_status("${text}")
|
||||
set(status_text "${status_placeholder}")
|
||||
else()
|
||||
set(status_text "${text}")
|
||||
@ -142,17 +151,20 @@ function(status text)
|
||||
if(DEFINED status_then OR DEFINED status_else)
|
||||
if(${status_cond})
|
||||
string(REPLACE ";" " " status_then "${status_then}")
|
||||
message(STATUS "${status_text}" "${status_then}")
|
||||
string(REGEX REPLACE "^[ \t]+" "" status_then "${status_then}")
|
||||
ocv_output_status("${status_text} ${status_then}")
|
||||
else()
|
||||
string(REPLACE ";" " " status_else "${status_else}")
|
||||
message(STATUS "${status_text}" "${status_else}")
|
||||
string(REGEX REPLACE "^[ \t]+" "" status_else "${status_else}")
|
||||
ocv_output_status("${status_text} ${status_else}")
|
||||
endif()
|
||||
else()
|
||||
string(REPLACE ";" " " status_cond "${status_cond}")
|
||||
message(STATUS "${status_text}" "${status_cond}")
|
||||
string(REGEX REPLACE "^[ \t]+" "" status_cond "${status_cond}")
|
||||
ocv_output_status("${status_text} ${status_cond}")
|
||||
endif()
|
||||
else()
|
||||
message(STATUS "${text}")
|
||||
ocv_output_status("${text}")
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
@ -266,3 +278,75 @@ macro(ocv_to_full_paths VAR)
|
||||
unset(__tmp)
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
|
||||
# read set of version defines from the header file
|
||||
macro(ocv_parse_header FILENAME FILE_VAR)
|
||||
set(vars_regex "")
|
||||
set(__parnet_scope OFF)
|
||||
set(__add_cache OFF)
|
||||
foreach(name ${ARGN})
|
||||
if("${name}" STREQUAL "PARENT_SCOPE")
|
||||
set(__parnet_scope ON)
|
||||
elseif("${name}" STREQUAL "CACHE")
|
||||
set(__add_cache ON)
|
||||
elseif(vars_regex)
|
||||
set(vars_regex "${vars_regex}|${name}")
|
||||
else()
|
||||
set(vars_regex "${name}")
|
||||
endif()
|
||||
endforeach()
|
||||
if(EXISTS "${FILENAME}")
|
||||
file(STRINGS "${FILENAME}" ${FILE_VAR} REGEX "#define[ \t]+(${vars_regex})[ \t]+[0-9]+" )
|
||||
else()
|
||||
unset(${FILE_VAR})
|
||||
endif()
|
||||
foreach(name ${ARGN})
|
||||
if(NOT "${name}" STREQUAL "PARENT_SCOPE" AND NOT "${name}" STREQUAL "CACHE")
|
||||
if(${FILE_VAR})
|
||||
if(${FILE_VAR} MATCHES ".+[ \t]${name}[ \t]+([0-9]+).*")
|
||||
string(REGEX REPLACE ".+[ \t]${name}[ \t]+([0-9]+).*" "\\1" ${name} "${${FILE_VAR}}")
|
||||
else()
|
||||
set(${name} "")
|
||||
endif()
|
||||
if(__add_cache)
|
||||
set(${name} ${${name}} CACHE INTERNAL "${name} parsed from ${FILENAME}" FORCE)
|
||||
elseif(__parnet_scope)
|
||||
set(${name} "${${name}}" PARENT_SCOPE)
|
||||
endif()
|
||||
else()
|
||||
unset(${name} CACHE)
|
||||
endif()
|
||||
endif()
|
||||
endforeach()
|
||||
endmacro()
|
||||
|
||||
# read single version define from the header file
|
||||
macro(ocv_parse_header2 LIBNAME HDR_PATH VARNAME SCOPE)
|
||||
set(${LIBNAME}_H "")
|
||||
if(EXISTS "${HDR_PATH}")
|
||||
file(STRINGS "${HDR_PATH}" ${LIBNAME}_H REGEX "^#define[ \t]+${VARNAME}[ \t]+\"[^\"]*\".*$" LIMIT_COUNT 1)
|
||||
endif()
|
||||
if(${LIBNAME}_H)
|
||||
string(REGEX REPLACE "^.*[ \t]${VARNAME}[ \t]+\"([0-9]+).*$" "\\1" ${LIBNAME}_VERSION_MAJOR "${${LIBNAME}_H}")
|
||||
string(REGEX REPLACE "^.*[ \t]${VARNAME}[ \t]+\"[0-9]+\\.([0-9]+).*$" "\\1" ${LIBNAME}_VERSION_MINOR "${${LIBNAME}_H}")
|
||||
string(REGEX REPLACE "^.*[ \t]${VARNAME}[ \t]+\"[0-9]+\\.[0-9]+\\.([0-9]+).*$" "\\1" ${LIBNAME}_VERSION_PATCH "${${LIBNAME}_H}")
|
||||
set(${LIBNAME}_VERSION_MAJOR ${${LIBNAME}_VERSION_MAJOR} ${SCOPE})
|
||||
set(${LIBNAME}_VERSION_MINOR ${${LIBNAME}_VERSION_MINOR} ${SCOPE})
|
||||
set(${LIBNAME}_VERSION_PATCH ${${LIBNAME}_VERSION_PATCH} ${SCOPE})
|
||||
set(${LIBNAME}_VERSION_STRING "${${LIBNAME}_VERSION_MAJOR}.${${LIBNAME}_VERSION_MINOR}.${${LIBNAME}_VERSION_PATCH}" ${SCOPE})
|
||||
|
||||
# append a TWEAK version if it exists:
|
||||
set(${LIBNAME}_VERSION_TWEAK "")
|
||||
if("${${LIBNAME}_H}" MATCHES "^.*[ \t]${VARNAME}[ \t]+\"[0-9]+\\.[0-9]+\\.[0-9]+\\.([0-9]+).*$")
|
||||
set(${LIBNAME}_VERSION_TWEAK "${CMAKE_MATCH_1}" ${SCOPE})
|
||||
set(${LIBNAME}_VERSION_STRING "${${LIBNAME}_VERSION_STRING}.${${LIBNAME}_VERSION_TWEAK}" ${SCOPE})
|
||||
endif()
|
||||
else()
|
||||
unset(${LIBNAME}_VERSION_MAJOR CACHE)
|
||||
unset(${LIBNAME}_VERSION_MINOR CACHE)
|
||||
unset(${LIBNAME}_VERSION_PATCH CACHE)
|
||||
unset(${LIBNAME}_VERSION_TWEAK CACHE)
|
||||
unset(${LIBNAME}_VERSION_STRING CACHE)
|
||||
endif()
|
||||
endmacro()
|
||||
|
@ -40,6 +40,9 @@
|
||||
/* FFMpeg video library */
|
||||
#cmakedefine HAVE_FFMPEG
|
||||
|
||||
/* FFMpeg version flag */
|
||||
#cmakedefine NEW_FFMPEG
|
||||
|
||||
/* ffmpeg's libswscale */
|
||||
#cmakedefine HAVE_FFMPEG_SWSCALE
|
||||
|
||||
|
21
doc/_themes/blue/searchbox.html
vendored
Normal file
21
doc/_themes/blue/searchbox.html
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
{#
|
||||
basic/searchbox.html
|
||||
~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Sphinx sidebar template: quick search box.
|
||||
|
||||
:copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS.
|
||||
:license: BSD, see LICENSE for details.
|
||||
#}
|
||||
{%- if pagename != "search" %}
|
||||
<div id="searchbox" style="display: none">
|
||||
<form class="search" action="{{ pathto('search') }}" method="get">
|
||||
<input type="text" name="q" size="18" />
|
||||
<input type="submit" value="{{ _('Search') }}" />
|
||||
<input type="hidden" name="check_keywords" value="yes" />
|
||||
<input type="hidden" name="area" value="default" />
|
||||
</p>
|
||||
</form>
|
||||
</div>
|
||||
<script type="text/javascript">$('#searchbox').show(0);</script>
|
||||
{%- endif %}
|
1
doc/_themes/blue/static/default.css_t
vendored
1
doc/_themes/blue/static/default.css_t
vendored
@ -85,6 +85,7 @@ div.related a {
|
||||
|
||||
div.sphinxsidebar {
|
||||
word-wrap: break-word;
|
||||
width: 240px;
|
||||
{%- if theme_stickysidebar|tobool %}
|
||||
top: 30px;
|
||||
margin: 0;
|
||||
|
@ -134,7 +134,7 @@
|
||||
\setlength{\columnsep}{2pt}
|
||||
|
||||
\begin{center}
|
||||
\Large{\textbf{OpenCV 2.3 Cheat Sheet (C++)}} \\
|
||||
\Large{\textbf{OpenCV 2.4 Cheat Sheet (C++)}} \\
|
||||
\end{center}
|
||||
\newlength{\MyLen}
|
||||
\settowidth{\MyLen}{\texttt{letterpaper}/\texttt{a4paper} \ }
|
||||
|
@ -100,7 +100,7 @@ You need the following tools to be installed:
|
||||
|
||||
Check the `Android SDK System Requirements
|
||||
<http://developer.android.com/sdk/requirements.html>`_ document for a list of Eclipse versions that are compatible with the Android SDK.
|
||||
For OpenCV 2.3.1 we recommend Eclipse 3.7 (Indigo) or Eclipse 3.6 (Helios). They work well for OpenCV under both Windows and Linux.
|
||||
For OpenCV 2.4.0 we recommend Eclipse 3.6 (Helios) or later versions. They work well for OpenCV under both Windows and Linux.
|
||||
|
||||
If you have no Eclipse installed, you can download it from this location:
|
||||
|
||||
@ -154,12 +154,12 @@ Get the OpenCV package for Android development
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
tar -jxvf ~/Downloads/OpenCV-2.3.1-android-bin.tar.bz2
|
||||
tar -jxvf ~/Downloads/OpenCV-2.4.0-android-bin.tar.bz2
|
||||
|
||||
For this tutorial I have unpacked OpenCV to the :file:`C:\\Work\\android-opencv\\` directory.
|
||||
|
||||
.. |opencv_android_bin_pack| replace:: OpenCV-2.3.1-android-bin.tar.bz2
|
||||
.. _opencv_android_bin_pack_url: http://sourceforge.net/projects/opencvlibrary/files/opencv-android/2.3.1/OpenCV-2.3.1-android-bin.tar.bz2/download
|
||||
.. |opencv_android_bin_pack| replace:: OpenCV-2.4.0-android-bin.tar.bz2
|
||||
.. _opencv_android_bin_pack_url: http://sourceforge.net/projects/opencvlibrary/files/opencv-android/2.4.0/OpenCV-2.4.0-android-bin.tar.bz2/download
|
||||
.. |opencv_android_bin_pack_url| replace:: |opencv_android_bin_pack|
|
||||
.. |seven_zip| replace:: 7-Zip
|
||||
.. _seven_zip: http://www.7-zip.org/
|
||||
|
@ -7,7 +7,7 @@ These steps have been tested for Ubuntu 10.04 but should work with other distros
|
||||
Required packages
|
||||
==================
|
||||
|
||||
* GCC 4.x or later. This can be installed with
|
||||
* GCC 4.4.x or later. This can be installed with
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
@ -15,13 +15,12 @@ Required packages
|
||||
|
||||
* CMake 2.6 or higher
|
||||
* Subversion (SVN) client
|
||||
* GTK+2.x or higher, including headers
|
||||
* GTK+2.x or higher, including headers (libgtk2.0-dev)
|
||||
* pkgconfig
|
||||
* libpng, zlib, libjpeg, libtiff, libjasper with development files (e.g. libpjeg-dev)
|
||||
* Python 2.3 or later with developer packages (e.g. python-dev)
|
||||
* SWIG 1.3.30 or later (only for versions prior to OpenCV 2.3)
|
||||
* libavcodec
|
||||
* libdc1394 2.x
|
||||
* Python 2.6 or later and Numpy 1.5 or later with developer packages (python-dev, python-numpy)
|
||||
* ffmpeg or libav development packages: libavcodec-dev, libavformat-dev, libswscale-dev
|
||||
* [optional] libdc1394 2.x
|
||||
* [optional] libjpeg-dev, libpng-dev, libtiff-dev, libjasper-dev.
|
||||
|
||||
All the libraries above can be installed via Terminal or by using Synaptic Manager
|
||||
|
||||
|
@ -16,7 +16,7 @@ Installation by using the pre-built libraries
|
||||
|
||||
1. Open up a web browser and go to: http://sourceforge.net/projects/opencvlibrary/files/opencv-win/
|
||||
|
||||
#. Open the folder for the latest version (currently this is 2.3).
|
||||
#. Open the folder for the latest version (currently this is 2.4).
|
||||
|
||||
#. Choose a build you want to use and download it. The naming conventions used will show what kind of support they offer. For example:
|
||||
|
||||
@ -60,7 +60,7 @@ If you are building your own libraries you can take either the source files from
|
||||
|
||||
.. container:: enumeratevisibleitemswithsquare
|
||||
|
||||
+ stable and tested build - http://code.opencv.org/svn/opencv/branches/2.3 (the number at the end will change with every new realease, so change it to that)
|
||||
+ stable and tested build - http://code.opencv.org/svn/opencv/branches/2.4 (the number at the end will change with every new realease, so change it to that)
|
||||
+ development build - http://code.opencv.org/svn/opencv/trunk/
|
||||
|
||||
While the later one may contain a couple of new and experimental algorithms, performance increases and interface improvements, be aware, that it may also contain many-many bugs. Using the first one is recommended in most of the cases. That is unless you are extending the OpenCV library itself or really need to most up to date version of it.
|
||||
@ -347,7 +347,7 @@ Set the OpenCV enviroment variable and add it to the systems path
|
||||
|
||||
First we set an enviroment variable to make easier our work. This will hold the install directory of our OpenCV library that we use in our projects. Start up a command window and enter:
|
||||
|
||||
.. code-block:: bash
|
||||
::
|
||||
|
||||
setx -m OPENCV_DIR D:\OpenCV\Build\Install
|
||||
|
||||
@ -355,7 +355,7 @@ Here the directory is where you have your OpenCV binaries (*installed* or *built
|
||||
|
||||
If you built static libraries then you are done. Otherwise, you need to add the *bin* folders path to the systems path.This is cause you will use the OpenCV library in form of *\"Dynamic-link libraries\"* (also known as **DLL**). Inside these are stored all the algorithms and information the OpenCV library contains. The operating system will load them only on demand, during runtime. However, to do this he needs to know where they are. The systems **PATH** contains a list of folders where DLLs can be found. Add the OpenCV library path to this and the OS will know where to look if he ever needs the OpenCV binaries. Otherwise, you will need to copy the used DLLs right beside the applications executable file (*exe*) for the OS to find it, which is highly unpleasent if you work on many projects. To do this start up again the |PathEditor|_ and add the following new entry (right click in the application to bring up the menu):
|
||||
|
||||
.. code-block:: bash
|
||||
::
|
||||
|
||||
%OPENCV_DIR%\bin
|
||||
|
||||
|
@ -35,25 +35,29 @@ Accessing pixel intensity values
|
||||
|
||||
In order to get pixel intensity value, you have to know the type of an image and the number of channels. Here is an example for a single channel grey scale image (type 8UC1) and pixel coordinates x and y: ::
|
||||
|
||||
Scalar intensity = img.at<uchar>(x, y);
|
||||
Scalar intensity = img.at<uchar>(y, x);
|
||||
|
||||
``intensity.val[0]`` contains a value from 0 to 255. Now let us consider a 3 channel image with ``BGR`` color ordering (the default format returned by ``imread``): ::
|
||||
``intensity.val[0]`` contains a value from 0 to 255. Note the ordering of ``x`` and ``y``. Since in OpenCV images are represented by the same structure as matrices, we use the same convention for both cases - the 0-based row index (or y-coordinate) goes first and the 0-based column index (or x-coordinate) follows it. Alternatively, you can use the following notation: ::
|
||||
|
||||
Vec3b intensity = img.at<Vec3b>(x, y);
|
||||
Scalar intensity = img.at<uchar>(Point(x, y));
|
||||
|
||||
Now let us consider a 3 channel image with ``BGR`` color ordering (the default format returned by ``imread``): ::
|
||||
|
||||
Vec3b intensity = img.at<Vec3b>(y, x);
|
||||
uchar blue = intensity.val[0];
|
||||
uchar green = intensity.val[1];
|
||||
uchar red = intensity.val[2];
|
||||
|
||||
You can use the same method for floating-point images (for example, you can get such an image by running Sobel on a 3 channel image): ::
|
||||
|
||||
Vec3f intensity = img.at<Vec3f>(x, y);
|
||||
Vec3f intensity = img.at<Vec3f>(y, x);
|
||||
float blue = intensity.val[0];
|
||||
float green = intensity.val[1];
|
||||
float red = intensity.val[2];
|
||||
|
||||
The same method can be used to change pixel intensities: ::
|
||||
|
||||
img.at<uchar>(x, y) = 128;
|
||||
img.at<uchar>(y, x) = 128;
|
||||
|
||||
There are functions in OpenCV, especially from calib3d module, such as ``projectPoints``, that take an array of 2D or 3D points in the form of ``Mat``. Matrix should contain exactly one column, each row corresponds to a point, matrix type should be 32FC2 or 32FC3 correspondingly. Such a matrix can be easily constructed from ``std::vector``: ::
|
||||
|
||||
|
@ -17,5 +17,4 @@ Indices and tables
|
||||
==================
|
||||
|
||||
* :ref:`genindex`
|
||||
* :ref:`modindex`
|
||||
* :ref:`search`
|
||||
|
@ -11,6 +11,13 @@ include (CMakeForceCompiler)
|
||||
CMAKE_FORCE_C_COMPILER (gcc gcc)
|
||||
CMAKE_FORCE_CXX_COMPILER (g++ g++)
|
||||
|
||||
set (CMAKE_C_SIZEOF_DATA_PTR 4)
|
||||
set (CMAKE_C_HAS_ISYSROOT 1)
|
||||
set (CMAKE_C_COMPILER_ABI ELF)
|
||||
set (CMAKE_CXX_SIZEOF_DATA_PTR 4)
|
||||
set (CMAKE_CXX_HAS_ISYSROOT 1)
|
||||
set (CMAKE_CXX_COMPILER_ABI ELF)
|
||||
|
||||
# Skip the platform compiler checks for cross compiling
|
||||
set (CMAKE_CXX_COMPILER_WORKS TRUE)
|
||||
set (CMAKE_C_COMPILER_WORKS TRUE)
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user