mirror of https://github.com/opencv/opencv.git
Merge pull request #1664 from SpecLad:merge-2.4
commit
7e1ded0ebd
159 changed files with 26997 additions and 9553 deletions
@ -1,2 +1,2 @@ |
||||
set path=c:\dev\msys32\bin;%path% & gcc -Wall -shared -o opencv_ffmpeg.dll -O2 -x c++ -I../include -I../include/ffmpeg_ -I../../modules/highgui/src ffopencv.c -L../lib -lavformat -lavcodec -lavdevice -lswscale -lavutil -lwsock32 |
||||
set path=c:\dev\msys64\bin;%path% & gcc -m64 -Wall -shared -o opencv_ffmpeg_64.dll -O2 -x c++ -I../include -I../include/ffmpeg_ -I../../modules/highgui/src ffopencv.c -L../lib -lavformat64 -lavcodec64 -lavdevice64 -lswscale64 -lavutil64 -lavcore64 -lwsock32 -lws2_32 |
||||
set path=c:\dev\msys32\bin;%path% & gcc -Wall -shared -o opencv_ffmpeg.dll -O2 -x c++ -I../include -I../include/ffmpeg_ -I../../modules/highgui/src ffopencv.c -L../lib -lavformat -lavcodec -lavdevice -lswscale -lavutil -liconv -lws2_32 |
||||
set path=c:\dev\msys64\bin;%path% & gcc -m64 -Wall -shared -o opencv_ffmpeg_64.dll -O2 -x c++ -I../include -I../include/ffmpeg_ -I../../modules/highgui/src ffopencv.c -L../lib -lavformat64 -lavcodec64 -lavdevice64 -lswscale64 -lavutil64 -lws2_32 |
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,397 @@ |
||||
/*
|
||||
* 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_OLD_CODEC_IDS_H |
||||
#define AVCODEC_OLD_CODEC_IDS_H |
||||
|
||||
#include "libavutil/common.h" |
||||
|
||||
/*
|
||||
* This header exists to prevent new codec IDs from being accidentally added to |
||||
* the deprecated list. |
||||
* Do not include it directly. It will be removed on next major bump |
||||
* |
||||
* Do not add new items to this list. Use the AVCodecID enum instead. |
||||
*/ |
||||
|
||||
CODEC_ID_NONE = AV_CODEC_ID_NONE, |
||||
|
||||
/* video codecs */ |
||||
CODEC_ID_MPEG1VIDEO, |
||||
CODEC_ID_MPEG2VIDEO, ///< preferred ID for MPEG-1/2 video decoding
|
||||
CODEC_ID_MPEG2VIDEO_XVMC, |
||||
CODEC_ID_H261, |
||||
CODEC_ID_H263, |
||||
CODEC_ID_RV10, |
||||
CODEC_ID_RV20, |
||||
CODEC_ID_MJPEG, |
||||
CODEC_ID_MJPEGB, |
||||
CODEC_ID_LJPEG, |
||||
CODEC_ID_SP5X, |
||||
CODEC_ID_JPEGLS, |
||||
CODEC_ID_MPEG4, |
||||
CODEC_ID_RAWVIDEO, |
||||
CODEC_ID_MSMPEG4V1, |
||||
CODEC_ID_MSMPEG4V2, |
||||
CODEC_ID_MSMPEG4V3, |
||||
CODEC_ID_WMV1, |
||||
CODEC_ID_WMV2, |
||||
CODEC_ID_H263P, |
||||
CODEC_ID_H263I, |
||||
CODEC_ID_FLV1, |
||||
CODEC_ID_SVQ1, |
||||
CODEC_ID_SVQ3, |
||||
CODEC_ID_DVVIDEO, |
||||
CODEC_ID_HUFFYUV, |
||||
CODEC_ID_CYUV, |
||||
CODEC_ID_H264, |
||||
CODEC_ID_INDEO3, |
||||
CODEC_ID_VP3, |
||||
CODEC_ID_THEORA, |
||||
CODEC_ID_ASV1, |
||||
CODEC_ID_ASV2, |
||||
CODEC_ID_FFV1, |
||||
CODEC_ID_4XM, |
||||
CODEC_ID_VCR1, |
||||
CODEC_ID_CLJR, |
||||
CODEC_ID_MDEC, |
||||
CODEC_ID_ROQ, |
||||
CODEC_ID_INTERPLAY_VIDEO, |
||||
CODEC_ID_XAN_WC3, |
||||
CODEC_ID_XAN_WC4, |
||||
CODEC_ID_RPZA, |
||||
CODEC_ID_CINEPAK, |
||||
CODEC_ID_WS_VQA, |
||||
CODEC_ID_MSRLE, |
||||
CODEC_ID_MSVIDEO1, |
||||
CODEC_ID_IDCIN, |
||||
CODEC_ID_8BPS, |
||||
CODEC_ID_SMC, |
||||
CODEC_ID_FLIC, |
||||
CODEC_ID_TRUEMOTION1, |
||||
CODEC_ID_VMDVIDEO, |
||||
CODEC_ID_MSZH, |
||||
CODEC_ID_ZLIB, |
||||
CODEC_ID_QTRLE, |
||||
CODEC_ID_TSCC, |
||||
CODEC_ID_ULTI, |
||||
CODEC_ID_QDRAW, |
||||
CODEC_ID_VIXL, |
||||
CODEC_ID_QPEG, |
||||
CODEC_ID_PNG, |
||||
CODEC_ID_PPM, |
||||
CODEC_ID_PBM, |
||||
CODEC_ID_PGM, |
||||
CODEC_ID_PGMYUV, |
||||
CODEC_ID_PAM, |
||||
CODEC_ID_FFVHUFF, |
||||
CODEC_ID_RV30, |
||||
CODEC_ID_RV40, |
||||
CODEC_ID_VC1, |
||||
CODEC_ID_WMV3, |
||||
CODEC_ID_LOCO, |
||||
CODEC_ID_WNV1, |
||||
CODEC_ID_AASC, |
||||
CODEC_ID_INDEO2, |
||||
CODEC_ID_FRAPS, |
||||
CODEC_ID_TRUEMOTION2, |
||||
CODEC_ID_BMP, |
||||
CODEC_ID_CSCD, |
||||
CODEC_ID_MMVIDEO, |
||||
CODEC_ID_ZMBV, |
||||
CODEC_ID_AVS, |
||||
CODEC_ID_SMACKVIDEO, |
||||
CODEC_ID_NUV, |
||||
CODEC_ID_KMVC, |
||||
CODEC_ID_FLASHSV, |
||||
CODEC_ID_CAVS, |
||||
CODEC_ID_JPEG2000, |
||||
CODEC_ID_VMNC, |
||||
CODEC_ID_VP5, |
||||
CODEC_ID_VP6, |
||||
CODEC_ID_VP6F, |
||||
CODEC_ID_TARGA, |
||||
CODEC_ID_DSICINVIDEO, |
||||
CODEC_ID_TIERTEXSEQVIDEO, |
||||
CODEC_ID_TIFF, |
||||
CODEC_ID_GIF, |
||||
CODEC_ID_DXA, |
||||
CODEC_ID_DNXHD, |
||||
CODEC_ID_THP, |
||||
CODEC_ID_SGI, |
||||
CODEC_ID_C93, |
||||
CODEC_ID_BETHSOFTVID, |
||||
CODEC_ID_PTX, |
||||
CODEC_ID_TXD, |
||||
CODEC_ID_VP6A, |
||||
CODEC_ID_AMV, |
||||
CODEC_ID_VB, |
||||
CODEC_ID_PCX, |
||||
CODEC_ID_SUNRAST, |
||||
CODEC_ID_INDEO4, |
||||
CODEC_ID_INDEO5, |
||||
CODEC_ID_MIMIC, |
||||
CODEC_ID_RL2, |
||||
CODEC_ID_ESCAPE124, |
||||
CODEC_ID_DIRAC, |
||||
CODEC_ID_BFI, |
||||
CODEC_ID_CMV, |
||||
CODEC_ID_MOTIONPIXELS, |
||||
CODEC_ID_TGV, |
||||
CODEC_ID_TGQ, |
||||
CODEC_ID_TQI, |
||||
CODEC_ID_AURA, |
||||
CODEC_ID_AURA2, |
||||
CODEC_ID_V210X, |
||||
CODEC_ID_TMV, |
||||
CODEC_ID_V210, |
||||
CODEC_ID_DPX, |
||||
CODEC_ID_MAD, |
||||
CODEC_ID_FRWU, |
||||
CODEC_ID_FLASHSV2, |
||||
CODEC_ID_CDGRAPHICS, |
||||
CODEC_ID_R210, |
||||
CODEC_ID_ANM, |
||||
CODEC_ID_BINKVIDEO, |
||||
CODEC_ID_IFF_ILBM, |
||||
CODEC_ID_IFF_BYTERUN1, |
||||
CODEC_ID_KGV1, |
||||
CODEC_ID_YOP, |
||||
CODEC_ID_VP8, |
||||
CODEC_ID_PICTOR, |
||||
CODEC_ID_ANSI, |
||||
CODEC_ID_A64_MULTI, |
||||
CODEC_ID_A64_MULTI5, |
||||
CODEC_ID_R10K, |
||||
CODEC_ID_MXPEG, |
||||
CODEC_ID_LAGARITH, |
||||
CODEC_ID_PRORES, |
||||
CODEC_ID_JV, |
||||
CODEC_ID_DFA, |
||||
CODEC_ID_WMV3IMAGE, |
||||
CODEC_ID_VC1IMAGE, |
||||
CODEC_ID_UTVIDEO, |
||||
CODEC_ID_BMV_VIDEO, |
||||
CODEC_ID_VBLE, |
||||
CODEC_ID_DXTORY, |
||||
CODEC_ID_V410, |
||||
CODEC_ID_XWD, |
||||
CODEC_ID_CDXL, |
||||
CODEC_ID_XBM, |
||||
CODEC_ID_ZEROCODEC, |
||||
CODEC_ID_MSS1, |
||||
CODEC_ID_MSA1, |
||||
CODEC_ID_TSCC2, |
||||
CODEC_ID_MTS2, |
||||
CODEC_ID_CLLC, |
||||
CODEC_ID_Y41P = MKBETAG('Y','4','1','P'), |
||||
CODEC_ID_ESCAPE130 = MKBETAG('E','1','3','0'), |
||||
CODEC_ID_EXR = MKBETAG('0','E','X','R'), |
||||
CODEC_ID_AVRP = MKBETAG('A','V','R','P'), |
||||
|
||||
CODEC_ID_G2M = MKBETAG( 0 ,'G','2','M'), |
||||
CODEC_ID_AVUI = MKBETAG('A','V','U','I'), |
||||
CODEC_ID_AYUV = MKBETAG('A','Y','U','V'), |
||||
CODEC_ID_V308 = MKBETAG('V','3','0','8'), |
||||
CODEC_ID_V408 = MKBETAG('V','4','0','8'), |
||||
CODEC_ID_YUV4 = MKBETAG('Y','U','V','4'), |
||||
CODEC_ID_SANM = MKBETAG('S','A','N','M'), |
||||
CODEC_ID_PAF_VIDEO = MKBETAG('P','A','F','V'), |
||||
CODEC_ID_SNOW = AV_CODEC_ID_SNOW, |
||||
|
||||
/* various PCM "codecs" */ |
||||
CODEC_ID_FIRST_AUDIO = 0x10000, ///< A dummy id pointing at the start of audio codecs
|
||||
CODEC_ID_PCM_S16LE = 0x10000, |
||||
CODEC_ID_PCM_S16BE, |
||||
CODEC_ID_PCM_U16LE, |
||||
CODEC_ID_PCM_U16BE, |
||||
CODEC_ID_PCM_S8, |
||||
CODEC_ID_PCM_U8, |
||||
CODEC_ID_PCM_MULAW, |
||||
CODEC_ID_PCM_ALAW, |
||||
CODEC_ID_PCM_S32LE, |
||||
CODEC_ID_PCM_S32BE, |
||||
CODEC_ID_PCM_U32LE, |
||||
CODEC_ID_PCM_U32BE, |
||||
CODEC_ID_PCM_S24LE, |
||||
CODEC_ID_PCM_S24BE, |
||||
CODEC_ID_PCM_U24LE, |
||||
CODEC_ID_PCM_U24BE, |
||||
CODEC_ID_PCM_S24DAUD, |
||||
CODEC_ID_PCM_ZORK, |
||||
CODEC_ID_PCM_S16LE_PLANAR, |
||||
CODEC_ID_PCM_DVD, |
||||
CODEC_ID_PCM_F32BE, |
||||
CODEC_ID_PCM_F32LE, |
||||
CODEC_ID_PCM_F64BE, |
||||
CODEC_ID_PCM_F64LE, |
||||
CODEC_ID_PCM_BLURAY, |
||||
CODEC_ID_PCM_LXF, |
||||
CODEC_ID_S302M, |
||||
CODEC_ID_PCM_S8_PLANAR, |
||||
|
||||
/* various ADPCM codecs */ |
||||
CODEC_ID_ADPCM_IMA_QT = 0x11000, |
||||
CODEC_ID_ADPCM_IMA_WAV, |
||||
CODEC_ID_ADPCM_IMA_DK3, |
||||
CODEC_ID_ADPCM_IMA_DK4, |
||||
CODEC_ID_ADPCM_IMA_WS, |
||||
CODEC_ID_ADPCM_IMA_SMJPEG, |
||||
CODEC_ID_ADPCM_MS, |
||||
CODEC_ID_ADPCM_4XM, |
||||
CODEC_ID_ADPCM_XA, |
||||
CODEC_ID_ADPCM_ADX, |
||||
CODEC_ID_ADPCM_EA, |
||||
CODEC_ID_ADPCM_G726, |
||||
CODEC_ID_ADPCM_CT, |
||||
CODEC_ID_ADPCM_SWF, |
||||
CODEC_ID_ADPCM_YAMAHA, |
||||
CODEC_ID_ADPCM_SBPRO_4, |
||||
CODEC_ID_ADPCM_SBPRO_3, |
||||
CODEC_ID_ADPCM_SBPRO_2, |
||||
CODEC_ID_ADPCM_THP, |
||||
CODEC_ID_ADPCM_IMA_AMV, |
||||
CODEC_ID_ADPCM_EA_R1, |
||||
CODEC_ID_ADPCM_EA_R3, |
||||
CODEC_ID_ADPCM_EA_R2, |
||||
CODEC_ID_ADPCM_IMA_EA_SEAD, |
||||
CODEC_ID_ADPCM_IMA_EA_EACS, |
||||
CODEC_ID_ADPCM_EA_XAS, |
||||
CODEC_ID_ADPCM_EA_MAXIS_XA, |
||||
CODEC_ID_ADPCM_IMA_ISS, |
||||
CODEC_ID_ADPCM_G722, |
||||
CODEC_ID_ADPCM_IMA_APC, |
||||
CODEC_ID_VIMA = MKBETAG('V','I','M','A'), |
||||
|
||||
/* AMR */ |
||||
CODEC_ID_AMR_NB = 0x12000, |
||||
CODEC_ID_AMR_WB, |
||||
|
||||
/* RealAudio codecs*/ |
||||
CODEC_ID_RA_144 = 0x13000, |
||||
CODEC_ID_RA_288, |
||||
|
||||
/* various DPCM codecs */ |
||||
CODEC_ID_ROQ_DPCM = 0x14000, |
||||
CODEC_ID_INTERPLAY_DPCM, |
||||
CODEC_ID_XAN_DPCM, |
||||
CODEC_ID_SOL_DPCM, |
||||
|
||||
/* audio codecs */ |
||||
CODEC_ID_MP2 = 0x15000, |
||||
CODEC_ID_MP3, ///< preferred ID for decoding MPEG audio layer 1, 2 or 3
|
||||
CODEC_ID_AAC, |
||||
CODEC_ID_AC3, |
||||
CODEC_ID_DTS, |
||||
CODEC_ID_VORBIS, |
||||
CODEC_ID_DVAUDIO, |
||||
CODEC_ID_WMAV1, |
||||
CODEC_ID_WMAV2, |
||||
CODEC_ID_MACE3, |
||||
CODEC_ID_MACE6, |
||||
CODEC_ID_VMDAUDIO, |
||||
CODEC_ID_FLAC, |
||||
CODEC_ID_MP3ADU, |
||||
CODEC_ID_MP3ON4, |
||||
CODEC_ID_SHORTEN, |
||||
CODEC_ID_ALAC, |
||||
CODEC_ID_WESTWOOD_SND1, |
||||
CODEC_ID_GSM, ///< as in Berlin toast format
|
||||
CODEC_ID_QDM2, |
||||
CODEC_ID_COOK, |
||||
CODEC_ID_TRUESPEECH, |
||||
CODEC_ID_TTA, |
||||
CODEC_ID_SMACKAUDIO, |
||||
CODEC_ID_QCELP, |
||||
CODEC_ID_WAVPACK, |
||||
CODEC_ID_DSICINAUDIO, |
||||
CODEC_ID_IMC, |
||||
CODEC_ID_MUSEPACK7, |
||||
CODEC_ID_MLP, |
||||
CODEC_ID_GSM_MS, /* as found in WAV */ |
||||
CODEC_ID_ATRAC3, |
||||
CODEC_ID_VOXWARE, |
||||
CODEC_ID_APE, |
||||
CODEC_ID_NELLYMOSER, |
||||
CODEC_ID_MUSEPACK8, |
||||
CODEC_ID_SPEEX, |
||||
CODEC_ID_WMAVOICE, |
||||
CODEC_ID_WMAPRO, |
||||
CODEC_ID_WMALOSSLESS, |
||||
CODEC_ID_ATRAC3P, |
||||
CODEC_ID_EAC3, |
||||
CODEC_ID_SIPR, |
||||
CODEC_ID_MP1, |
||||
CODEC_ID_TWINVQ, |
||||
CODEC_ID_TRUEHD, |
||||
CODEC_ID_MP4ALS, |
||||
CODEC_ID_ATRAC1, |
||||
CODEC_ID_BINKAUDIO_RDFT, |
||||
CODEC_ID_BINKAUDIO_DCT, |
||||
CODEC_ID_AAC_LATM, |
||||
CODEC_ID_QDMC, |
||||
CODEC_ID_CELT, |
||||
CODEC_ID_G723_1, |
||||
CODEC_ID_G729, |
||||
CODEC_ID_8SVX_EXP, |
||||
CODEC_ID_8SVX_FIB, |
||||
CODEC_ID_BMV_AUDIO, |
||||
CODEC_ID_RALF, |
||||
CODEC_ID_IAC, |
||||
CODEC_ID_ILBC, |
||||
CODEC_ID_FFWAVESYNTH = MKBETAG('F','F','W','S'), |
||||
CODEC_ID_SONIC = MKBETAG('S','O','N','C'), |
||||
CODEC_ID_SONIC_LS = MKBETAG('S','O','N','L'), |
||||
CODEC_ID_PAF_AUDIO = MKBETAG('P','A','F','A'), |
||||
CODEC_ID_OPUS = MKBETAG('O','P','U','S'), |
||||
|
||||
/* subtitle codecs */ |
||||
CODEC_ID_FIRST_SUBTITLE = 0x17000, ///< A dummy ID pointing at the start of subtitle codecs.
|
||||
CODEC_ID_DVD_SUBTITLE = 0x17000, |
||||
CODEC_ID_DVB_SUBTITLE, |
||||
CODEC_ID_TEXT, ///< raw UTF-8 text
|
||||
CODEC_ID_XSUB, |
||||
CODEC_ID_SSA, |
||||
CODEC_ID_MOV_TEXT, |
||||
CODEC_ID_HDMV_PGS_SUBTITLE, |
||||
CODEC_ID_DVB_TELETEXT, |
||||
CODEC_ID_SRT, |
||||
CODEC_ID_MICRODVD = MKBETAG('m','D','V','D'), |
||||
CODEC_ID_EIA_608 = MKBETAG('c','6','0','8'), |
||||
CODEC_ID_JACOSUB = MKBETAG('J','S','U','B'), |
||||
CODEC_ID_SAMI = MKBETAG('S','A','M','I'), |
||||
CODEC_ID_REALTEXT = MKBETAG('R','T','X','T'), |
||||
CODEC_ID_SUBVIEWER = MKBETAG('S','u','b','V'), |
||||
|
||||
/* other specific kind of codecs (generally used for attachments) */ |
||||
CODEC_ID_FIRST_UNKNOWN = 0x18000, ///< A dummy ID pointing at the start of various fake codecs.
|
||||
CODEC_ID_TTF = 0x18000, |
||||
CODEC_ID_BINTEXT = MKBETAG('B','T','X','T'), |
||||
CODEC_ID_XBIN = MKBETAG('X','B','I','N'), |
||||
CODEC_ID_IDF = MKBETAG( 0 ,'I','D','F'), |
||||
CODEC_ID_OTF = MKBETAG( 0 ,'O','T','F'), |
||||
|
||||
CODEC_ID_PROBE = 0x19000, ///< codec_id is not known (like CODEC_ID_NONE) but lavf should attempt to identify it
|
||||
|
||||
CODEC_ID_MPEG2TS = 0x20000, /**< _FAKE_ codec to indicate a raw MPEG-2 TS
|
||||
* stream (only used by libavformat) */ |
||||
CODEC_ID_MPEG4SYSTEMS = 0x20001, /**< _FAKE_ codec to indicate a MPEG-4 Systems
|
||||
* stream (only used by libavformat) */ |
||||
CODEC_ID_FFMETADATA = 0x21000, ///< Dummy codec for streams containing only metadata information.
|
||||
|
||||
#endif /* AVCODEC_OLD_CODEC_IDS_H */ |
@ -1,34 +0,0 @@ |
||||
/*
|
||||
* 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 |
||||
*/ |
||||
|
||||
/**
|
||||
* @file |
||||
* This header is provided for compatibility only and will be removed |
||||
* on next major bump |
||||
*/ |
||||
|
||||
#ifndef AVCODEC_OPT_H |
||||
#define AVCODEC_OPT_H |
||||
|
||||
#include "libavcodec/version.h" |
||||
|
||||
#if FF_API_OPT_H |
||||
#include "libavutil/opt.h" |
||||
#endif |
||||
|
||||
#endif /* AVCODEC_OPT_H */ |
@ -0,0 +1,50 @@ |
||||
/*
|
||||
* 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 AVDEVICE_VERSION_H |
||||
#define AVDEVICE_VERSION_H |
||||
|
||||
/**
|
||||
* @file |
||||
* @ingroup lavd |
||||
* Libavdevice version macros |
||||
*/ |
||||
|
||||
#include "libavutil/avutil.h" |
||||
|
||||
#define LIBAVDEVICE_VERSION_MAJOR 55 |
||||
#define LIBAVDEVICE_VERSION_MINOR 3 |
||||
#define LIBAVDEVICE_VERSION_MICRO 100 |
||||
|
||||
#define LIBAVDEVICE_VERSION_INT AV_VERSION_INT(LIBAVDEVICE_VERSION_MAJOR, \ |
||||
LIBAVDEVICE_VERSION_MINOR, \
|
||||
LIBAVDEVICE_VERSION_MICRO) |
||||
#define LIBAVDEVICE_VERSION AV_VERSION(LIBAVDEVICE_VERSION_MAJOR, \ |
||||
LIBAVDEVICE_VERSION_MINOR, \
|
||||
LIBAVDEVICE_VERSION_MICRO) |
||||
#define LIBAVDEVICE_BUILD LIBAVDEVICE_VERSION_INT |
||||
|
||||
#define LIBAVDEVICE_IDENT "Lavd" AV_STRINGIFY(LIBAVDEVICE_VERSION) |
||||
|
||||
/**
|
||||
* FF_API_* defines may be placed below to indicate public API that will be |
||||
* dropped at a future version bump. The defines themselves are not part of |
||||
* the public API and may change, break or disappear at any time. |
||||
*/ |
||||
|
||||
#endif /* AVDEVICE_VERSION_H */ |
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,149 @@ |
||||
/*
|
||||
* Audio FIFO |
||||
* Copyright (c) 2012 Justin Ruggles <justin.ruggles@gmail.com> |
||||
* |
||||
* 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 |
||||
*/ |
||||
|
||||
/**
|
||||
* @file |
||||
* Audio FIFO Buffer |
||||
*/ |
||||
|
||||
#ifndef AVUTIL_AUDIO_FIFO_H |
||||
#define AVUTIL_AUDIO_FIFO_H |
||||
|
||||
#include "avutil.h" |
||||
#include "fifo.h" |
||||
#include "samplefmt.h" |
||||
|
||||
/**
|
||||
* @addtogroup lavu_audio |
||||
* @{ |
||||
*/ |
||||
|
||||
/**
|
||||
* Context for an Audio FIFO Buffer. |
||||
* |
||||
* - Operates at the sample level rather than the byte level. |
||||
* - Supports multiple channels with either planar or packed sample format. |
||||
* - Automatic reallocation when writing to a full buffer. |
||||
*/ |
||||
typedef struct AVAudioFifo AVAudioFifo; |
||||
|
||||
/**
|
||||
* Free an AVAudioFifo. |
||||
* |
||||
* @param af AVAudioFifo to free |
||||
*/ |
||||
void av_audio_fifo_free(AVAudioFifo *af); |
||||
|
||||
/**
|
||||
* Allocate an AVAudioFifo. |
||||
* |
||||
* @param sample_fmt sample format |
||||
* @param channels number of channels |
||||
* @param nb_samples initial allocation size, in samples |
||||
* @return newly allocated AVAudioFifo, or NULL on error |
||||
*/ |
||||
AVAudioFifo *av_audio_fifo_alloc(enum AVSampleFormat sample_fmt, int channels, |
||||
int nb_samples); |
||||
|
||||
/**
|
||||
* Reallocate an AVAudioFifo. |
||||
* |
||||
* @param af AVAudioFifo to reallocate |
||||
* @param nb_samples new allocation size, in samples |
||||
* @return 0 if OK, or negative AVERROR code on failure |
||||
*/ |
||||
int av_audio_fifo_realloc(AVAudioFifo *af, int nb_samples); |
||||
|
||||
/**
|
||||
* Write data to an AVAudioFifo. |
||||
* |
||||
* The AVAudioFifo will be reallocated automatically if the available space |
||||
* is less than nb_samples. |
||||
* |
||||
* @see enum AVSampleFormat |
||||
* The documentation for AVSampleFormat describes the data layout. |
||||
* |
||||
* @param af AVAudioFifo to write to |
||||
* @param data audio data plane pointers |
||||
* @param nb_samples number of samples to write |
||||
* @return number of samples actually written, or negative AVERROR |
||||
* code on failure. If successful, the number of samples |
||||
* actually written will always be nb_samples. |
||||
*/ |
||||
int av_audio_fifo_write(AVAudioFifo *af, void **data, int nb_samples); |
||||
|
||||
/**
|
||||
* Read data from an AVAudioFifo. |
||||
* |
||||
* @see enum AVSampleFormat |
||||
* The documentation for AVSampleFormat describes the data layout. |
||||
* |
||||
* @param af AVAudioFifo to read from |
||||
* @param data audio data plane pointers |
||||
* @param nb_samples number of samples to read |
||||
* @return number of samples actually read, or negative AVERROR code |
||||
* on failure. The number of samples actually read will not |
||||
* be greater than nb_samples, and will only be less than |
||||
* nb_samples if av_audio_fifo_size is less than nb_samples. |
||||
*/ |
||||
int av_audio_fifo_read(AVAudioFifo *af, void **data, int nb_samples); |
||||
|
||||
/**
|
||||
* Drain data from an AVAudioFifo. |
||||
* |
||||
* Removes the data without reading it. |
||||
* |
||||
* @param af AVAudioFifo to drain |
||||
* @param nb_samples number of samples to drain |
||||
* @return 0 if OK, or negative AVERROR code on failure |
||||
*/ |
||||
int av_audio_fifo_drain(AVAudioFifo *af, int nb_samples); |
||||
|
||||
/**
|
||||
* Reset the AVAudioFifo buffer. |
||||
* |
||||
* This empties all data in the buffer. |
||||
* |
||||
* @param af AVAudioFifo to reset |
||||
*/ |
||||
void av_audio_fifo_reset(AVAudioFifo *af); |
||||
|
||||
/**
|
||||
* Get the current number of samples in the AVAudioFifo available for reading. |
||||
* |
||||
* @param af the AVAudioFifo to query |
||||
* @return number of samples available for reading |
||||
*/ |
||||
int av_audio_fifo_size(AVAudioFifo *af); |
||||
|
||||
/**
|
||||
* Get the current number of samples in the AVAudioFifo available for writing. |
||||
* |
||||
* @param af the AVAudioFifo to query |
||||
* @return number of samples available for writing |
||||
*/ |
||||
int av_audio_fifo_space(AVAudioFifo *af); |
||||
|
||||
/**
|
||||
* @} |
||||
*/ |
||||
|
||||
#endif /* AVUTIL_AUDIO_FIFO_H */ |
@ -1,147 +1,6 @@ |
||||
/*
|
||||
* Copyright (c) 2006 Michael Niedermayer <michaelni@gmx.at> |
||||
* Copyright (c) 2008 Peter Ross |
||||
* |
||||
* 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 AVUTIL_AUDIOCONVERT_H |
||||
#define AVUTIL_AUDIOCONVERT_H |
||||
#include "version.h" |
||||
|
||||
#include <stdint.h> |
||||
|
||||
/**
|
||||
* @file |
||||
* audio conversion routines |
||||
*/ |
||||
|
||||
/**
|
||||
* @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 |
||||
#define AV_CH_LOW_FREQUENCY 0x00000008 |
||||
#define AV_CH_BACK_LEFT 0x00000010 |
||||
#define AV_CH_BACK_RIGHT 0x00000020 |
||||
#define AV_CH_FRONT_LEFT_OF_CENTER 0x00000040 |
||||
#define AV_CH_FRONT_RIGHT_OF_CENTER 0x00000080 |
||||
#define AV_CH_BACK_CENTER 0x00000100 |
||||
#define AV_CH_SIDE_LEFT 0x00000200 |
||||
#define AV_CH_SIDE_RIGHT 0x00000400 |
||||
#define AV_CH_TOP_CENTER 0x00000800 |
||||
#define AV_CH_TOP_FRONT_LEFT 0x00001000 |
||||
#define AV_CH_TOP_FRONT_CENTER 0x00002000 |
||||
#define AV_CH_TOP_FRONT_RIGHT 0x00004000 |
||||
#define AV_CH_TOP_BACK_LEFT 0x00008000 |
||||
#define AV_CH_TOP_BACK_CENTER 0x00010000 |
||||
#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 0x8000000000000000ULL |
||||
|
||||
/**
|
||||
* @} |
||||
* @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|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. |
||||
* 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. |
||||
* If nb_channels is <= 0, it is guessed from the channel_layout. |
||||
* |
||||
* @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, uint64_t channel_layout); |
||||
|
||||
/**
|
||||
* Return the number of channels in the 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 */ |
||||
#if FF_API_AUDIOCONVERT |
||||
#include "channel_layout.h" |
||||
#endif |
||||
|
@ -0,0 +1,77 @@ |
||||
/*
|
||||
* Blowfish algorithm |
||||
* Copyright (c) 2012 Samuel Pitoiset |
||||
* |
||||
* 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 AVUTIL_BLOWFISH_H |
||||
#define AVUTIL_BLOWFISH_H |
||||
|
||||
#include <stdint.h> |
||||
|
||||
/**
|
||||
* @defgroup lavu_blowfish Blowfish |
||||
* @ingroup lavu_crypto |
||||
* @{ |
||||
*/ |
||||
|
||||
#define AV_BF_ROUNDS 16 |
||||
|
||||
typedef struct AVBlowfish { |
||||
uint32_t p[AV_BF_ROUNDS + 2]; |
||||
uint32_t s[4][256]; |
||||
} AVBlowfish; |
||||
|
||||
/**
|
||||
* Initialize an AVBlowfish context. |
||||
* |
||||
* @param ctx an AVBlowfish context |
||||
* @param key a key |
||||
* @param key_len length of the key |
||||
*/ |
||||
void av_blowfish_init(struct AVBlowfish *ctx, const uint8_t *key, int key_len); |
||||
|
||||
/**
|
||||
* Encrypt or decrypt a buffer using a previously initialized context. |
||||
* |
||||
* @param ctx an AVBlowfish context |
||||
* @param xl left four bytes halves of input to be encrypted |
||||
* @param xr right four bytes halves of input to be encrypted |
||||
* @param decrypt 0 for encryption, 1 for decryption |
||||
*/ |
||||
void av_blowfish_crypt_ecb(struct AVBlowfish *ctx, uint32_t *xl, uint32_t *xr, |
||||
int decrypt); |
||||
|
||||
/**
|
||||
* Encrypt or decrypt a buffer using a previously initialized context. |
||||
* |
||||
* @param ctx an AVBlowfish context |
||||
* @param dst destination array, can be equal to src |
||||
* @param src source array, can be equal to dst |
||||
* @param count number of 8 byte blocks |
||||
* @param iv initialization vector for CBC mode, if NULL ECB will be used |
||||
* @param decrypt 0 for encryption, 1 for decryption |
||||
*/ |
||||
void av_blowfish_crypt(struct AVBlowfish *ctx, uint8_t *dst, const uint8_t *src, |
||||
int count, uint8_t *iv, int decrypt); |
||||
|
||||
/**
|
||||
* @} |
||||
*/ |
||||
|
||||
#endif /* AVUTIL_BLOWFISH_H */ |
@ -0,0 +1,200 @@ |
||||
/*
|
||||
* Copyright (c) 2012 Nicolas George |
||||
* |
||||
* 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 AVUTIL_BPRINT_H |
||||
#define AVUTIL_BPRINT_H |
||||
|
||||
#include "attributes.h" |
||||
#include "avstring.h" |
||||
|
||||
/**
|
||||
* Define a structure with extra padding to a fixed size |
||||
* This helps ensuring binary compatibility with future versions. |
||||
*/ |
||||
#define FF_PAD_STRUCTURE(size, ...) \ |
||||
__VA_ARGS__ \
|
||||
char reserved_padding[size - sizeof(struct { __VA_ARGS__ })]; |
||||
|
||||
/**
|
||||
* Buffer to print data progressively |
||||
* |
||||
* The string buffer grows as necessary and is always 0-terminated. |
||||
* The content of the string is never accessed, and thus is |
||||
* encoding-agnostic and can even hold binary data. |
||||
* |
||||
* Small buffers are kept in the structure itself, and thus require no |
||||
* memory allocation at all (unless the contents of the buffer is needed |
||||
* after the structure goes out of scope). This is almost as lightweight as |
||||
* declaring a local "char buf[512]". |
||||
* |
||||
* The length of the string can go beyond the allocated size: the buffer is |
||||
* then truncated, but the functions still keep account of the actual total |
||||
* length. |
||||
* |
||||
* In other words, buf->len can be greater than buf->size and records the |
||||
* total length of what would have been to the buffer if there had been |
||||
* enough memory. |
||||
* |
||||
* Append operations do not need to be tested for failure: if a memory |
||||
* allocation fails, data stop being appended to the buffer, but the length |
||||
* is still updated. This situation can be tested with |
||||
* av_bprint_is_complete(). |
||||
* |
||||
* The size_max field determines several possible behaviours: |
||||
* |
||||
* size_max = -1 (= UINT_MAX) or any large value will let the buffer be |
||||
* reallocated as necessary, with an amortized linear cost. |
||||
* |
||||
* size_max = 0 prevents writing anything to the buffer: only the total |
||||
* length is computed. The write operations can then possibly be repeated in |
||||
* a buffer with exactly the necessary size |
||||
* (using size_init = size_max = len + 1). |
||||
* |
||||
* size_max = 1 is automatically replaced by the exact size available in the |
||||
* structure itself, thus ensuring no dynamic memory allocation. The |
||||
* internal buffer is large enough to hold a reasonable paragraph of text, |
||||
* such as the current paragraph. |
||||
*/ |
||||
typedef struct AVBPrint { |
||||
FF_PAD_STRUCTURE(1024, |
||||
char *str; /**< string so far */ |
||||
unsigned len; /**< length so far */ |
||||
unsigned size; /**< allocated memory */ |
||||
unsigned size_max; /**< maximum allocated memory */ |
||||
char reserved_internal_buffer[1]; |
||||
) |
||||
} AVBPrint; |
||||
|
||||
/**
|
||||
* Convenience macros for special values for av_bprint_init() size_max |
||||
* parameter. |
||||
*/ |
||||
#define AV_BPRINT_SIZE_UNLIMITED ((unsigned)-1) |
||||
#define AV_BPRINT_SIZE_AUTOMATIC 1 |
||||
#define AV_BPRINT_SIZE_COUNT_ONLY 0 |
||||
|
||||
/**
|
||||
* Init a print buffer. |
||||
* |
||||
* @param buf buffer to init |
||||
* @param size_init initial size (including the final 0) |
||||
* @param size_max maximum size; |
||||
* 0 means do not write anything, just count the length; |
||||
* 1 is replaced by the maximum value for automatic storage; |
||||
* any large value means that the internal buffer will be |
||||
* reallocated as needed up to that limit; -1 is converted to |
||||
* UINT_MAX, the largest limit possible. |
||||
* Check also AV_BPRINT_SIZE_* macros. |
||||
*/ |
||||
void av_bprint_init(AVBPrint *buf, unsigned size_init, unsigned size_max); |
||||
|
||||
/**
|
||||
* Init a print buffer using a pre-existing buffer. |
||||
* |
||||
* The buffer will not be reallocated. |
||||
* |
||||
* @param buf buffer structure to init |
||||
* @param buffer byte buffer to use for the string data |
||||
* @param size size of buffer |
||||
*/ |
||||
void av_bprint_init_for_buffer(AVBPrint *buf, char *buffer, unsigned size); |
||||
|
||||
/**
|
||||
* Append a formatted string to a print buffer. |
||||
*/ |
||||
void av_bprintf(AVBPrint *buf, const char *fmt, ...) av_printf_format(2, 3); |
||||
|
||||
/**
|
||||
* Append char c n times to a print buffer. |
||||
*/ |
||||
void av_bprint_chars(AVBPrint *buf, char c, unsigned n); |
||||
|
||||
struct tm; |
||||
/**
|
||||
* Append a formatted date and time to a print buffer. |
||||
* |
||||
* param buf bprint buffer to use |
||||
* param fmt date and time format string, see strftime() |
||||
* param tm broken-down time structure to translate |
||||
* |
||||
* @note due to poor design of the standard strftime function, it may |
||||
* produce poor results if the format string expands to a very long text and |
||||
* the bprint buffer is near the limit stated by the size_max option. |
||||
*/ |
||||
void av_bprint_strftime(AVBPrint *buf, const char *fmt, const struct tm *tm); |
||||
|
||||
/**
|
||||
* Allocate bytes in the buffer for external use. |
||||
* |
||||
* @param[in] buf buffer structure |
||||
* @param[in] size required size |
||||
* @param[out] mem pointer to the memory area |
||||
* @param[out] actual_size size of the memory area after allocation; |
||||
* can be larger or smaller than size |
||||
*/ |
||||
void av_bprint_get_buffer(AVBPrint *buf, unsigned size, |
||||
unsigned char **mem, unsigned *actual_size); |
||||
|
||||
/**
|
||||
* Reset the string to "" but keep internal allocated data. |
||||
*/ |
||||
void av_bprint_clear(AVBPrint *buf); |
||||
|
||||
/**
|
||||
* Test if the print buffer is complete (not truncated). |
||||
* |
||||
* It may have been truncated due to a memory allocation failure |
||||
* or the size_max limit (compare size and size_max if necessary). |
||||
*/ |
||||
static inline int av_bprint_is_complete(AVBPrint *buf) |
||||
{ |
||||
return buf->len < buf->size; |
||||
} |
||||
|
||||
/**
|
||||
* Finalize a print buffer. |
||||
* |
||||
* The print buffer can no longer be used afterwards, |
||||
* but the len and size fields are still valid. |
||||
* |
||||
* @arg[out] ret_str if not NULL, used to return a permanent copy of the |
||||
* buffer contents, or NULL if memory allocation fails; |
||||
* if NULL, the buffer is discarded and freed |
||||
* @return 0 for success or error code (probably AVERROR(ENOMEM)) |
||||
*/ |
||||
int av_bprint_finalize(AVBPrint *buf, char **ret_str); |
||||
|
||||
/**
|
||||
* Escape the content in src and append it to dstbuf. |
||||
* |
||||
* @param dstbuf already inited destination bprint buffer |
||||
* @param src string containing the text to escape |
||||
* @param special_chars string containing the special characters which |
||||
* need to be escaped, can be NULL |
||||
* @param mode escape mode to employ, see AV_ESCAPE_MODE_* macros. |
||||
* Any unknown value for mode will be considered equivalent to |
||||
* AV_ESCAPE_MODE_BACKSLASH, but this behaviour can change without |
||||
* notice. |
||||
* @param flags flags which control how to escape, see AV_ESCAPE_FLAG_* macros |
||||
*/ |
||||
void av_bprint_escape(AVBPrint *dstbuf, const char *src, const char *special_chars, |
||||
enum AVEscapeMode mode, int flags); |
||||
|
||||
#endif /* AVUTIL_BPRINT_H */ |
@ -0,0 +1,274 @@ |
||||
/*
|
||||
* 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 |
||||
*/ |
||||
|
||||
/**
|
||||
* @file |
||||
* @ingroup lavu_buffer |
||||
* refcounted data buffer API |
||||
*/ |
||||
|
||||
#ifndef AVUTIL_BUFFER_H |
||||
#define AVUTIL_BUFFER_H |
||||
|
||||
#include <stdint.h> |
||||
|
||||
/**
|
||||
* @defgroup lavu_buffer AVBuffer |
||||
* @ingroup lavu_data |
||||
* |
||||
* @{ |
||||
* AVBuffer is an API for reference-counted data buffers. |
||||
* |
||||
* There are two core objects in this API -- AVBuffer and AVBufferRef. AVBuffer |
||||
* represents the data buffer itself; it is opaque and not meant to be accessed |
||||
* by the caller directly, but only through AVBufferRef. However, the caller may |
||||
* e.g. compare two AVBuffer pointers to check whether two different references |
||||
* are describing the same data buffer. AVBufferRef represents a single |
||||
* reference to an AVBuffer and it is the object that may be manipulated by the |
||||
* caller directly. |
||||
* |
||||
* There are two functions provided for creating a new AVBuffer with a single |
||||
* reference -- av_buffer_alloc() to just allocate a new buffer, and |
||||
* av_buffer_create() to wrap an existing array in an AVBuffer. From an existing |
||||
* reference, additional references may be created with av_buffer_ref(). |
||||
* Use av_buffer_unref() to free a reference (this will automatically free the |
||||
* data once all the references are freed). |
||||
* |
||||
* The convention throughout this API and the rest of FFmpeg is such that the |
||||
* buffer is considered writable if there exists only one reference to it (and |
||||
* it has not been marked as read-only). The av_buffer_is_writable() function is |
||||
* provided to check whether this is true and av_buffer_make_writable() will |
||||
* automatically create a new writable buffer when necessary. |
||||
* Of course nothing prevents the calling code from violating this convention, |
||||
* however that is safe only when all the existing references are under its |
||||
* control. |
||||
* |
||||
* @note Referencing and unreferencing the buffers is thread-safe and thus |
||||
* may be done from multiple threads simultaneously without any need for |
||||
* additional locking. |
||||
* |
||||
* @note Two different references to the same buffer can point to different |
||||
* parts of the buffer (i.e. their AVBufferRef.data will not be equal). |
||||
*/ |
||||
|
||||
/**
|
||||
* A reference counted buffer type. It is opaque and is meant to be used through |
||||
* references (AVBufferRef). |
||||
*/ |
||||
typedef struct AVBuffer AVBuffer; |
||||
|
||||
/**
|
||||
* A reference to a data buffer. |
||||
* |
||||
* The size of this struct is not a part of the public ABI and it is not meant |
||||
* to be allocated directly. |
||||
*/ |
||||
typedef struct AVBufferRef { |
||||
AVBuffer *buffer; |
||||
|
||||
/**
|
||||
* The data buffer. It is considered writable if and only if |
||||
* this is the only reference to the buffer, in which case |
||||
* av_buffer_is_writable() returns 1. |
||||
*/ |
||||
uint8_t *data; |
||||
/**
|
||||
* Size of data in bytes. |
||||
*/ |
||||
int size; |
||||
} AVBufferRef; |
||||
|
||||
/**
|
||||
* Allocate an AVBuffer of the given size using av_malloc(). |
||||
* |
||||
* @return an AVBufferRef of given size or NULL when out of memory |
||||
*/ |
||||
AVBufferRef *av_buffer_alloc(int size); |
||||
|
||||
/**
|
||||
* Same as av_buffer_alloc(), except the returned buffer will be initialized |
||||
* to zero. |
||||
*/ |
||||
AVBufferRef *av_buffer_allocz(int size); |
||||
|
||||
/**
|
||||
* Always treat the buffer as read-only, even when it has only one |
||||
* reference. |
||||
*/ |
||||
#define AV_BUFFER_FLAG_READONLY (1 << 0) |
||||
|
||||
/**
|
||||
* Create an AVBuffer from an existing array. |
||||
* |
||||
* If this function is successful, data is owned by the AVBuffer. The caller may |
||||
* only access data through the returned AVBufferRef and references derived from |
||||
* it. |
||||
* If this function fails, data is left untouched. |
||||
* @param data data array |
||||
* @param size size of data in bytes |
||||
* @param free a callback for freeing this buffer's data |
||||
* @param opaque parameter to be got for processing or passed to free |
||||
* @param flags a combination of AV_BUFFER_FLAG_* |
||||
* |
||||
* @return an AVBufferRef referring to data on success, NULL on failure. |
||||
*/ |
||||
AVBufferRef *av_buffer_create(uint8_t *data, int size, |
||||
void (*free)(void *opaque, uint8_t *data), |
||||
void *opaque, int flags); |
||||
|
||||
/**
|
||||
* Default free callback, which calls av_free() on the buffer data. |
||||
* This function is meant to be passed to av_buffer_create(), not called |
||||
* directly. |
||||
*/ |
||||
void av_buffer_default_free(void *opaque, uint8_t *data); |
||||
|
||||
/**
|
||||
* Create a new reference to an AVBuffer. |
||||
* |
||||
* @return a new AVBufferRef referring to the same AVBuffer as buf or NULL on |
||||
* failure. |
||||
*/ |
||||
AVBufferRef *av_buffer_ref(AVBufferRef *buf); |
||||
|
||||
/**
|
||||
* Free a given reference and automatically free the buffer if there are no more |
||||
* references to it. |
||||
* |
||||
* @param buf the reference to be freed. The pointer is set to NULL on return. |
||||
*/ |
||||
void av_buffer_unref(AVBufferRef **buf); |
||||
|
||||
/**
|
||||
* @return 1 if the caller may write to the data referred to by buf (which is |
||||
* true if and only if buf is the only reference to the underlying AVBuffer). |
||||
* Return 0 otherwise. |
||||
* A positive answer is valid until av_buffer_ref() is called on buf. |
||||
*/ |
||||
int av_buffer_is_writable(const AVBufferRef *buf); |
||||
|
||||
/**
|
||||
* @return the opaque parameter set by av_buffer_create. |
||||
*/ |
||||
void *av_buffer_get_opaque(const AVBufferRef *buf); |
||||
|
||||
int av_buffer_get_ref_count(const AVBufferRef *buf); |
||||
|
||||
/**
|
||||
* Create a writable reference from a given buffer reference, avoiding data copy |
||||
* if possible. |
||||
* |
||||
* @param buf buffer reference to make writable. On success, buf is either left |
||||
* untouched, or it is unreferenced and a new writable AVBufferRef is |
||||
* written in its place. On failure, buf is left untouched. |
||||
* @return 0 on success, a negative AVERROR on failure. |
||||
*/ |
||||
int av_buffer_make_writable(AVBufferRef **buf); |
||||
|
||||
/**
|
||||
* Reallocate a given buffer. |
||||
* |
||||
* @param buf a buffer reference to reallocate. On success, buf will be |
||||
* unreferenced and a new reference with the required size will be |
||||
* written in its place. On failure buf will be left untouched. *buf |
||||
* may be NULL, then a new buffer is allocated. |
||||
* @param size required new buffer size. |
||||
* @return 0 on success, a negative AVERROR on failure. |
||||
* |
||||
* @note the buffer is actually reallocated with av_realloc() only if it was |
||||
* initially allocated through av_buffer_realloc(NULL) and there is only one |
||||
* reference to it (i.e. the one passed to this function). In all other cases |
||||
* a new buffer is allocated and the data is copied. |
||||
*/ |
||||
int av_buffer_realloc(AVBufferRef **buf, int size); |
||||
|
||||
/**
|
||||
* @} |
||||
*/ |
||||
|
||||
/**
|
||||
* @defgroup lavu_bufferpool AVBufferPool |
||||
* @ingroup lavu_data |
||||
* |
||||
* @{ |
||||
* AVBufferPool is an API for a lock-free thread-safe pool of AVBuffers. |
||||
* |
||||
* Frequently allocating and freeing large buffers may be slow. AVBufferPool is |
||||
* meant to solve this in cases when the caller needs a set of buffers of the |
||||
* same size (the most obvious use case being buffers for raw video or audio |
||||
* frames). |
||||
* |
||||
* At the beginning, the user must call av_buffer_pool_init() to create the |
||||
* buffer pool. Then whenever a buffer is needed, call av_buffer_pool_get() to |
||||
* get a reference to a new buffer, similar to av_buffer_alloc(). This new |
||||
* reference works in all aspects the same way as the one created by |
||||
* av_buffer_alloc(). However, when the last reference to this buffer is |
||||
* unreferenced, it is returned to the pool instead of being freed and will be |
||||
* reused for subsequent av_buffer_pool_get() calls. |
||||
* |
||||
* When the caller is done with the pool and no longer needs to allocate any new |
||||
* buffers, av_buffer_pool_uninit() must be called to mark the pool as freeable. |
||||
* Once all the buffers are released, it will automatically be freed. |
||||
* |
||||
* Allocating and releasing buffers with this API is thread-safe as long as |
||||
* either the default alloc callback is used, or the user-supplied one is |
||||
* thread-safe. |
||||
*/ |
||||
|
||||
/**
|
||||
* The buffer pool. This structure is opaque and not meant to be accessed |
||||
* directly. It is allocated with av_buffer_pool_init() and freed with |
||||
* av_buffer_pool_uninit(). |
||||
*/ |
||||
typedef struct AVBufferPool AVBufferPool; |
||||
|
||||
/**
|
||||
* Allocate and initialize a buffer pool. |
||||
* |
||||
* @param size size of each buffer in this pool |
||||
* @param alloc a function that will be used to allocate new buffers when the |
||||
* pool is empty. May be NULL, then the default allocator will be used |
||||
* (av_buffer_alloc()). |
||||
* @return newly created buffer pool on success, NULL on error. |
||||
*/ |
||||
AVBufferPool *av_buffer_pool_init(int size, AVBufferRef* (*alloc)(int size)); |
||||
|
||||
/**
|
||||
* Mark the pool as being available for freeing. It will actually be freed only |
||||
* once all the allocated buffers associated with the pool are released. Thus it |
||||
* is safe to call this function while some of the allocated buffers are still |
||||
* in use. |
||||
* |
||||
* @param pool pointer to the pool to be freed. It will be set to NULL. |
||||
* @see av_buffer_pool_can_uninit() |
||||
*/ |
||||
void av_buffer_pool_uninit(AVBufferPool **pool); |
||||
|
||||
/**
|
||||
* Allocate a new AVBuffer, reusing an old buffer from the pool when available. |
||||
* This function may be called simultaneously from multiple threads. |
||||
* |
||||
* @return a reference to the new buffer on success, NULL on error. |
||||
*/ |
||||
AVBufferRef *av_buffer_pool_get(AVBufferPool *pool); |
||||
|
||||
/**
|
||||
* @} |
||||
*/ |
||||
|
||||
#endif /* AVUTIL_BUFFER_H */ |
@ -0,0 +1,216 @@ |
||||
/*
|
||||
* Copyright (c) 2006 Michael Niedermayer <michaelni@gmx.at> |
||||
* Copyright (c) 2008 Peter Ross |
||||
* |
||||
* 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 AVUTIL_CHANNEL_LAYOUT_H |
||||
#define AVUTIL_CHANNEL_LAYOUT_H |
||||
|
||||
#include <stdint.h> |
||||
|
||||
/**
|
||||
* @file |
||||
* audio channel layout utility functions |
||||
*/ |
||||
|
||||
/**
|
||||
* @addtogroup lavu_audio |
||||
* @{ |
||||
*/ |
||||
|
||||
/**
|
||||
* @defgroup channel_masks Audio channel masks |
||||
* |
||||
* A channel layout is a 64-bits integer with a bit set for every channel. |
||||
* The number of bits set must be equal to the number of channels. |
||||
* The value 0 means that the channel layout is not known. |
||||
* @note this data structure is not powerful enough to handle channels |
||||
* combinations that have the same channel multiple times, such as |
||||
* dual-mono. |
||||
* |
||||
* @{ |
||||
*/ |
||||
#define AV_CH_FRONT_LEFT 0x00000001 |
||||
#define AV_CH_FRONT_RIGHT 0x00000002 |
||||
#define AV_CH_FRONT_CENTER 0x00000004 |
||||
#define AV_CH_LOW_FREQUENCY 0x00000008 |
||||
#define AV_CH_BACK_LEFT 0x00000010 |
||||
#define AV_CH_BACK_RIGHT 0x00000020 |
||||
#define AV_CH_FRONT_LEFT_OF_CENTER 0x00000040 |
||||
#define AV_CH_FRONT_RIGHT_OF_CENTER 0x00000080 |
||||
#define AV_CH_BACK_CENTER 0x00000100 |
||||
#define AV_CH_SIDE_LEFT 0x00000200 |
||||
#define AV_CH_SIDE_RIGHT 0x00000400 |
||||
#define AV_CH_TOP_CENTER 0x00000800 |
||||
#define AV_CH_TOP_FRONT_LEFT 0x00001000 |
||||
#define AV_CH_TOP_FRONT_CENTER 0x00002000 |
||||
#define AV_CH_TOP_FRONT_RIGHT 0x00004000 |
||||
#define AV_CH_TOP_BACK_LEFT 0x00008000 |
||||
#define AV_CH_TOP_BACK_CENTER 0x00010000 |
||||
#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 |
||||
#define AV_CH_LOW_FREQUENCY_2 0x0000000800000000ULL |
||||
|
||||
/** 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 0x8000000000000000ULL |
||||
|
||||
/**
|
||||
* @} |
||||
* @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|AV_CH_FRONT_LEFT_OF_CENTER|AV_CH_FRONT_RIGHT_OF_CENTER) |
||||
#define AV_CH_LAYOUT_7POINT1_WIDE_BACK (AV_CH_LAYOUT_5POINT1_BACK|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) |
||||
|
||||
enum AVMatrixEncoding { |
||||
AV_MATRIX_ENCODING_NONE, |
||||
AV_MATRIX_ENCODING_DOLBY, |
||||
AV_MATRIX_ENCODING_DPLII, |
||||
AV_MATRIX_ENCODING_NB |
||||
}; |
||||
|
||||
/**
|
||||
* @} |
||||
*/ |
||||
|
||||
/**
|
||||
* Return a channel layout id that matches name, or 0 if no match is found. |
||||
* |
||||
* 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, optionally 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. |
||||
* If nb_channels is <= 0, it is guessed from the channel_layout. |
||||
* |
||||
* @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, uint64_t channel_layout); |
||||
|
||||
struct AVBPrint; |
||||
/**
|
||||
* Append a description of a channel layout to a bprint buffer. |
||||
*/ |
||||
void av_bprint_channel_layout(struct AVBPrint *bp, int nb_channels, uint64_t channel_layout); |
||||
|
||||
/**
|
||||
* Return the number of channels in the 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); |
||||
|
||||
/**
|
||||
* Get the index of a channel in channel_layout. |
||||
* |
||||
* @param channel a channel layout describing exactly one channel which must be |
||||
* present in channel_layout. |
||||
* |
||||
* @return index of channel in channel_layout on success, a negative AVERROR |
||||
* on error. |
||||
*/ |
||||
int av_get_channel_layout_channel_index(uint64_t channel_layout, |
||||
uint64_t channel); |
||||
|
||||
/**
|
||||
* Get the channel with the given index in channel_layout. |
||||
*/ |
||||
uint64_t av_channel_layout_extract_channel(uint64_t channel_layout, int index); |
||||
|
||||
/**
|
||||
* Get the name of a given channel. |
||||
* |
||||
* @return channel name on success, NULL on error. |
||||
*/ |
||||
const char *av_get_channel_name(uint64_t channel); |
||||
|
||||
/**
|
||||
* Get the description of a given channel. |
||||
* |
||||
* @param channel a channel layout with a single channel |
||||
* @return channel description on success, NULL on error |
||||
*/ |
||||
const char *av_get_channel_description(uint64_t channel); |
||||
|
||||
/**
|
||||
* Get the value and name of a standard channel layout. |
||||
* |
||||
* @param[in] index index in an internal list, starting at 0 |
||||
* @param[out] layout channel layout mask |
||||
* @param[out] name name of the layout |
||||
* @return 0 if the layout exists, |
||||
* <0 if index is beyond the limits |
||||
*/ |
||||
int av_get_standard_channel_layout(unsigned index, uint64_t *layout, |
||||
const char **name); |
||||
|
||||
/**
|
||||
* @} |
||||
*/ |
||||
|
||||
#endif /* AVUTIL_CHANNEL_LAYOUT_H */ |
@ -0,0 +1,607 @@ |
||||
/*
|
||||
* |
||||
* 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 AVUTIL_FRAME_H |
||||
#define AVUTIL_FRAME_H |
||||
|
||||
#include <stdint.h> |
||||
|
||||
#include "libavcodec/version.h" |
||||
|
||||
#include "avutil.h" |
||||
#include "buffer.h" |
||||
#include "dict.h" |
||||
#include "rational.h" |
||||
#include "samplefmt.h" |
||||
|
||||
enum AVFrameSideDataType { |
||||
/**
|
||||
* The data is the AVPanScan struct defined in libavcodec. |
||||
*/ |
||||
AV_FRAME_DATA_PANSCAN, |
||||
}; |
||||
|
||||
typedef struct AVFrameSideData { |
||||
enum AVFrameSideDataType type; |
||||
uint8_t *data; |
||||
int size; |
||||
AVDictionary *metadata; |
||||
} AVFrameSideData; |
||||
|
||||
/**
|
||||
* This structure describes decoded (raw) audio or video data. |
||||
* |
||||
* AVFrame must be allocated using av_frame_alloc(). Note that this only |
||||
* allocates the AVFrame itself, the buffers for the data must be managed |
||||
* through other means (see below). |
||||
* AVFrame must be freed with av_frame_free(). |
||||
* |
||||
* AVFrame is typically allocated once and then reused multiple times to hold |
||||
* different data (e.g. a single AVFrame to hold frames received from a |
||||
* decoder). In such a case, av_frame_unref() will free any references held by |
||||
* the frame and reset it to its original clean state before it |
||||
* is reused again. |
||||
* |
||||
* The data described by an AVFrame is usually reference counted through the |
||||
* AVBuffer API. The underlying buffer references are stored in AVFrame.buf / |
||||
* AVFrame.extended_buf. An AVFrame is considered to be reference counted if at |
||||
* least one reference is set, i.e. if AVFrame.buf[0] != NULL. In such a case, |
||||
* every single data plane must be contained in one of the buffers in |
||||
* AVFrame.buf or AVFrame.extended_buf. |
||||
* There may be a single buffer for all the data, or one separate buffer for |
||||
* each plane, or anything in between. |
||||
* |
||||
* sizeof(AVFrame) is not a part of the public ABI, so new fields may be added |
||||
* to the end with a minor bump. |
||||
* Similarly fields that are marked as to be only accessed by |
||||
* av_opt_ptr() can be reordered. This allows 2 forks to add fields |
||||
* without breaking compatibility with each other. |
||||
*/ |
||||
typedef struct AVFrame { |
||||
#define AV_NUM_DATA_POINTERS 8 |
||||
/**
|
||||
* pointer to the picture/channel planes. |
||||
* This might be different from the first allocated byte |
||||
* |
||||
* Some decoders access areas outside 0,0 - width,height, please |
||||
* see avcodec_align_dimensions2(). Some filters and swscale can read |
||||
* up to 16 bytes beyond the planes, if these filters are to be used, |
||||
* then 16 extra bytes must be allocated. |
||||
*/ |
||||
uint8_t *data[AV_NUM_DATA_POINTERS]; |
||||
|
||||
/**
|
||||
* For video, size in bytes of each picture line. |
||||
* For audio, size in bytes of each plane. |
||||
* |
||||
* For audio, only linesize[0] may be set. For planar audio, each channel |
||||
* plane must be the same size. |
||||
* |
||||
* For video the linesizes should be multiplies of the CPUs alignment |
||||
* preference, this is 16 or 32 for modern desktop CPUs. |
||||
* Some code requires such alignment other code can be slower without |
||||
* correct alignment, for yet other it makes no difference. |
||||
*/ |
||||
int linesize[AV_NUM_DATA_POINTERS]; |
||||
|
||||
/**
|
||||
* pointers to the data planes/channels. |
||||
* |
||||
* For video, this should simply point to data[]. |
||||
* |
||||
* For planar audio, each channel has a separate data pointer, and |
||||
* linesize[0] contains the size of each channel buffer. |
||||
* For packed audio, there is just one data pointer, and linesize[0] |
||||
* contains the total size of the buffer for all channels. |
||||
* |
||||
* Note: Both data and extended_data should always be set in a valid frame, |
||||
* but for planar audio with more channels that can fit in data, |
||||
* extended_data must be used in order to access all channels. |
||||
*/ |
||||
uint8_t **extended_data; |
||||
|
||||
/**
|
||||
* width and height of the video frame |
||||
*/ |
||||
int width, height; |
||||
|
||||
/**
|
||||
* number of audio samples (per channel) described by this frame |
||||
*/ |
||||
int nb_samples; |
||||
|
||||
/**
|
||||
* format of the frame, -1 if unknown or unset |
||||
* Values correspond to enum AVPixelFormat for video frames, |
||||
* enum AVSampleFormat for audio) |
||||
*/ |
||||
int format; |
||||
|
||||
/**
|
||||
* 1 -> keyframe, 0-> not |
||||
*/ |
||||
int key_frame; |
||||
|
||||
/**
|
||||
* Picture type of the frame. |
||||
*/ |
||||
enum AVPictureType pict_type; |
||||
|
||||
#if FF_API_AVFRAME_LAVC |
||||
attribute_deprecated |
||||
uint8_t *base[AV_NUM_DATA_POINTERS]; |
||||
#endif |
||||
|
||||
/**
|
||||
* Sample aspect ratio for the video frame, 0/1 if unknown/unspecified. |
||||
*/ |
||||
AVRational sample_aspect_ratio; |
||||
|
||||
/**
|
||||
* Presentation timestamp in time_base units (time when frame should be shown to user). |
||||
*/ |
||||
int64_t pts; |
||||
|
||||
/**
|
||||
* PTS copied from the AVPacket that was decoded to produce this frame. |
||||
*/ |
||||
int64_t pkt_pts; |
||||
|
||||
/**
|
||||
* DTS copied from the AVPacket that triggered returning this frame. (if frame threading isnt used) |
||||
* This is also the Presentation time of this AVFrame calculated from |
||||
* only AVPacket.dts values without pts values. |
||||
*/ |
||||
int64_t pkt_dts; |
||||
|
||||
/**
|
||||
* picture number in bitstream order |
||||
*/ |
||||
int coded_picture_number; |
||||
/**
|
||||
* picture number in display order |
||||
*/ |
||||
int display_picture_number; |
||||
|
||||
/**
|
||||
* quality (between 1 (good) and FF_LAMBDA_MAX (bad)) |
||||
*/ |
||||
int quality; |
||||
|
||||
#if FF_API_AVFRAME_LAVC |
||||
attribute_deprecated |
||||
int reference; |
||||
|
||||
/**
|
||||
* QP table |
||||
*/ |
||||
attribute_deprecated |
||||
int8_t *qscale_table; |
||||
/**
|
||||
* QP store stride |
||||
*/ |
||||
attribute_deprecated |
||||
int qstride; |
||||
|
||||
attribute_deprecated |
||||
int qscale_type; |
||||
|
||||
/**
|
||||
* mbskip_table[mb]>=1 if MB didn't change |
||||
* stride= mb_width = (width+15)>>4 |
||||
*/ |
||||
attribute_deprecated |
||||
uint8_t *mbskip_table; |
||||
|
||||
/**
|
||||
* motion vector table |
||||
* @code |
||||
* example: |
||||
* int mv_sample_log2= 4 - motion_subsample_log2; |
||||
* int mb_width= (width+15)>>4; |
||||
* int mv_stride= (mb_width << mv_sample_log2) + 1; |
||||
* motion_val[direction][x + y*mv_stride][0->mv_x, 1->mv_y]; |
||||
* @endcode |
||||
*/ |
||||
attribute_deprecated |
||||
int16_t (*motion_val[2])[2]; |
||||
|
||||
/**
|
||||
* macroblock type table |
||||
* mb_type_base + mb_width + 2 |
||||
*/ |
||||
attribute_deprecated |
||||
uint32_t *mb_type; |
||||
|
||||
/**
|
||||
* DCT coefficients |
||||
*/ |
||||
attribute_deprecated |
||||
short *dct_coeff; |
||||
|
||||
/**
|
||||
* motion reference frame index |
||||
* the order in which these are stored can depend on the codec. |
||||
*/ |
||||
attribute_deprecated |
||||
int8_t *ref_index[2]; |
||||
#endif |
||||
|
||||
/**
|
||||
* for some private data of the user |
||||
*/ |
||||
void *opaque; |
||||
|
||||
/**
|
||||
* error |
||||
*/ |
||||
uint64_t error[AV_NUM_DATA_POINTERS]; |
||||
|
||||
#if FF_API_AVFRAME_LAVC |
||||
attribute_deprecated |
||||
int type; |
||||
#endif |
||||
|
||||
/**
|
||||
* When decoding, this signals how much the picture must be delayed. |
||||
* extra_delay = repeat_pict / (2*fps) |
||||
*/ |
||||
int repeat_pict; |
||||
|
||||
/**
|
||||
* The content of the picture is interlaced. |
||||
*/ |
||||
int interlaced_frame; |
||||
|
||||
/**
|
||||
* If the content is interlaced, is top field displayed first. |
||||
*/ |
||||
int top_field_first; |
||||
|
||||
/**
|
||||
* Tell user application that palette has changed from previous frame. |
||||
*/ |
||||
int palette_has_changed; |
||||
|
||||
#if FF_API_AVFRAME_LAVC |
||||
attribute_deprecated |
||||
int buffer_hints; |
||||
|
||||
/**
|
||||
* Pan scan. |
||||
*/ |
||||
attribute_deprecated |
||||
struct AVPanScan *pan_scan; |
||||
#endif |
||||
|
||||
/**
|
||||
* reordered opaque 64bit (generally an integer or a double precision float |
||||
* PTS but can be anything). |
||||
* The user sets AVCodecContext.reordered_opaque to represent the input at |
||||
* that time, |
||||
* the decoder reorders values as needed and sets AVFrame.reordered_opaque |
||||
* to exactly one of the values provided by the user through AVCodecContext.reordered_opaque |
||||
* @deprecated in favor of pkt_pts |
||||
*/ |
||||
int64_t reordered_opaque; |
||||
|
||||
#if FF_API_AVFRAME_LAVC |
||||
/**
|
||||
* @deprecated this field is unused |
||||
*/ |
||||
attribute_deprecated void *hwaccel_picture_private; |
||||
|
||||
attribute_deprecated |
||||
struct AVCodecContext *owner; |
||||
attribute_deprecated |
||||
void *thread_opaque; |
||||
|
||||
/**
|
||||
* log2 of the size of the block which a single vector in motion_val represents: |
||||
* (4->16x16, 3->8x8, 2-> 4x4, 1-> 2x2) |
||||
*/ |
||||
attribute_deprecated |
||||
uint8_t motion_subsample_log2; |
||||
#endif |
||||
|
||||
/**
|
||||
* Sample rate of the audio data. |
||||
*/ |
||||
int sample_rate; |
||||
|
||||
/**
|
||||
* Channel layout of the audio data. |
||||
*/ |
||||
uint64_t channel_layout; |
||||
|
||||
/**
|
||||
* AVBuffer references backing the data for this frame. If all elements of |
||||
* this array are NULL, then this frame is not reference counted. |
||||
* |
||||
* There may be at most one AVBuffer per data plane, so for video this array |
||||
* always contains all the references. For planar audio with more than |
||||
* AV_NUM_DATA_POINTERS channels, there may be more buffers than can fit in |
||||
* this array. Then the extra AVBufferRef pointers are stored in the |
||||
* extended_buf array. |
||||
*/ |
||||
AVBufferRef *buf[AV_NUM_DATA_POINTERS]; |
||||
|
||||
/**
|
||||
* For planar audio which requires more than AV_NUM_DATA_POINTERS |
||||
* AVBufferRef pointers, this array will hold all the references which |
||||
* cannot fit into AVFrame.buf. |
||||
* |
||||
* Note that this is different from AVFrame.extended_data, which always |
||||
* contains all the pointers. This array only contains the extra pointers, |
||||
* which cannot fit into AVFrame.buf. |
||||
* |
||||
* This array is always allocated using av_malloc() by whoever constructs |
||||
* the frame. It is freed in av_frame_unref(). |
||||
*/ |
||||
AVBufferRef **extended_buf; |
||||
/**
|
||||
* Number of elements in extended_buf. |
||||
*/ |
||||
int nb_extended_buf; |
||||
|
||||
AVFrameSideData **side_data; |
||||
int nb_side_data; |
||||
|
||||
/**
|
||||
* frame timestamp estimated using various heuristics, in stream time base |
||||
* Code outside libavcodec should access this field using: |
||||
* av_frame_get_best_effort_timestamp(frame) |
||||
* - encoding: unused |
||||
* - decoding: set by libavcodec, read by user. |
||||
*/ |
||||
int64_t best_effort_timestamp; |
||||
|
||||
/**
|
||||
* reordered pos from the last AVPacket that has been input into the decoder |
||||
* Code outside libavcodec should access this field using: |
||||
* av_frame_get_pkt_pos(frame) |
||||
* - encoding: unused |
||||
* - decoding: Read by user. |
||||
*/ |
||||
int64_t pkt_pos; |
||||
|
||||
/**
|
||||
* duration of the corresponding packet, expressed in |
||||
* AVStream->time_base units, 0 if unknown. |
||||
* Code outside libavcodec should access this field using: |
||||
* av_frame_get_pkt_duration(frame) |
||||
* - encoding: unused |
||||
* - decoding: Read by user. |
||||
*/ |
||||
int64_t pkt_duration; |
||||
|
||||
/**
|
||||
* metadata. |
||||
* Code outside libavcodec should access this field using: |
||||
* av_frame_get_metadata(frame) |
||||
* - encoding: Set by user. |
||||
* - decoding: Set by libavcodec. |
||||
*/ |
||||
AVDictionary *metadata; |
||||
|
||||
/**
|
||||
* decode error flags of the frame, set to a combination of |
||||
* FF_DECODE_ERROR_xxx flags if the decoder produced a frame, but there |
||||
* were errors during the decoding. |
||||
* Code outside libavcodec should access this field using: |
||||
* av_frame_get_decode_error_flags(frame) |
||||
* - encoding: unused |
||||
* - decoding: set by libavcodec, read by user. |
||||
*/ |
||||
int decode_error_flags; |
||||
#define FF_DECODE_ERROR_INVALID_BITSTREAM 1 |
||||
#define FF_DECODE_ERROR_MISSING_REFERENCE 2 |
||||
|
||||
/**
|
||||
* number of audio channels, only used for audio. |
||||
* Code outside libavcodec should access this field using: |
||||
* av_frame_get_channels(frame) |
||||
* - encoding: unused |
||||
* - decoding: Read by user. |
||||
*/ |
||||
int channels; |
||||
|
||||
/**
|
||||
* size of the corresponding packet containing the compressed |
||||
* frame. It must be accessed using av_frame_get_pkt_size() and |
||||
* av_frame_set_pkt_size(). |
||||
* It is set to a negative value if unknown. |
||||
* - encoding: unused |
||||
* - decoding: set by libavcodec, read by user. |
||||
*/ |
||||
int pkt_size; |
||||
|
||||
/**
|
||||
* Not to be accessed directly from outside libavutil |
||||
*/ |
||||
AVBufferRef *qp_table_buf; |
||||
} AVFrame; |
||||
|
||||
/**
|
||||
* Accessors for some AVFrame fields. |
||||
* The position of these field in the structure is not part of the ABI, |
||||
* they should not be accessed directly outside libavcodec. |
||||
*/ |
||||
int64_t av_frame_get_best_effort_timestamp(const AVFrame *frame); |
||||
void av_frame_set_best_effort_timestamp(AVFrame *frame, int64_t val); |
||||
int64_t av_frame_get_pkt_duration (const AVFrame *frame); |
||||
void av_frame_set_pkt_duration (AVFrame *frame, int64_t val); |
||||
int64_t av_frame_get_pkt_pos (const AVFrame *frame); |
||||
void av_frame_set_pkt_pos (AVFrame *frame, int64_t val); |
||||
int64_t av_frame_get_channel_layout (const AVFrame *frame); |
||||
void av_frame_set_channel_layout (AVFrame *frame, int64_t val); |
||||
int av_frame_get_channels (const AVFrame *frame); |
||||
void av_frame_set_channels (AVFrame *frame, int val); |
||||
int av_frame_get_sample_rate (const AVFrame *frame); |
||||
void av_frame_set_sample_rate (AVFrame *frame, int val); |
||||
AVDictionary *av_frame_get_metadata (const AVFrame *frame); |
||||
void av_frame_set_metadata (AVFrame *frame, AVDictionary *val); |
||||
int av_frame_get_decode_error_flags (const AVFrame *frame); |
||||
void av_frame_set_decode_error_flags (AVFrame *frame, int val); |
||||
int av_frame_get_pkt_size(const AVFrame *frame); |
||||
void av_frame_set_pkt_size(AVFrame *frame, int val); |
||||
AVDictionary **avpriv_frame_get_metadatap(AVFrame *frame); |
||||
int8_t *av_frame_get_qp_table(AVFrame *f, int *stride, int *type); |
||||
int av_frame_set_qp_table(AVFrame *f, AVBufferRef *buf, int stride, int type); |
||||
|
||||
/**
|
||||
* Allocate an AVFrame and set its fields to default values. The resulting |
||||
* struct must be freed using av_frame_free(). |
||||
* |
||||
* @return An AVFrame filled with default values or NULL on failure. |
||||
* |
||||
* @note this only allocates the AVFrame itself, not the data buffers. Those |
||||
* must be allocated through other means, e.g. with av_frame_get_buffer() or |
||||
* manually. |
||||
*/ |
||||
AVFrame *av_frame_alloc(void); |
||||
|
||||
/**
|
||||
* Free the frame and any dynamically allocated objects in it, |
||||
* e.g. extended_data. If the frame is reference counted, it will be |
||||
* unreferenced first. |
||||
* |
||||
* @param frame frame to be freed. The pointer will be set to NULL. |
||||
*/ |
||||
void av_frame_free(AVFrame **frame); |
||||
|
||||
/**
|
||||
* Setup a new reference to the data described by an given frame. |
||||
* |
||||
* Copy frame properties from src to dst and create a new reference for each |
||||
* AVBufferRef from src. |
||||
* |
||||
* If src is not reference counted, new buffers are allocated and the data is |
||||
* copied. |
||||
* |
||||
* @return 0 on success, a negative AVERROR on error |
||||
*/ |
||||
int av_frame_ref(AVFrame *dst, AVFrame *src); |
||||
|
||||
/**
|
||||
* Create a new frame that references the same data as src. |
||||
* |
||||
* This is a shortcut for av_frame_alloc()+av_frame_ref(). |
||||
* |
||||
* @return newly created AVFrame on success, NULL on error. |
||||
*/ |
||||
AVFrame *av_frame_clone(AVFrame *src); |
||||
|
||||
/**
|
||||
* Unreference all the buffers referenced by frame and reset the frame fields. |
||||
*/ |
||||
void av_frame_unref(AVFrame *frame); |
||||
|
||||
/**
|
||||
* Move everythnig contained in src to dst and reset src. |
||||
*/ |
||||
void av_frame_move_ref(AVFrame *dst, AVFrame *src); |
||||
|
||||
/**
|
||||
* Allocate new buffer(s) for audio or video data. |
||||
* |
||||
* The following fields must be set on frame before calling this function: |
||||
* - format (pixel format for video, sample format for audio) |
||||
* - width and height for video |
||||
* - nb_samples and channel_layout for audio |
||||
* |
||||
* This function will fill AVFrame.data and AVFrame.buf arrays and, if |
||||
* necessary, allocate and fill AVFrame.extended_data and AVFrame.extended_buf. |
||||
* For planar formats, one buffer will be allocated for each plane. |
||||
* |
||||
* @param frame frame in which to store the new buffers. |
||||
* @param align required buffer size alignment |
||||
* |
||||
* @return 0 on success, a negative AVERROR on error. |
||||
*/ |
||||
int av_frame_get_buffer(AVFrame *frame, int align); |
||||
|
||||
/**
|
||||
* Check if the frame data is writable. |
||||
* |
||||
* @return A positive value if the frame data is writable (which is true if and |
||||
* only if each of the underlying buffers has only one reference, namely the one |
||||
* stored in this frame). Return 0 otherwise. |
||||
* |
||||
* If 1 is returned the answer is valid until av_buffer_ref() is called on any |
||||
* of the underlying AVBufferRefs (e.g. through av_frame_ref() or directly). |
||||
* |
||||
* @see av_frame_make_writable(), av_buffer_is_writable() |
||||
*/ |
||||
int av_frame_is_writable(AVFrame *frame); |
||||
|
||||
/**
|
||||
* Ensure that the frame data is writable, avoiding data copy if possible. |
||||
* |
||||
* Do nothing if the frame is writable, allocate new buffers and copy the data |
||||
* if it is not. |
||||
* |
||||
* @return 0 on success, a negative AVERROR on error. |
||||
* |
||||
* @see av_frame_is_writable(), av_buffer_is_writable(), |
||||
* av_buffer_make_writable() |
||||
*/ |
||||
int av_frame_make_writable(AVFrame *frame); |
||||
|
||||
/**
|
||||
* Copy only "metadata" fields from src to dst. |
||||
* |
||||
* Metadata for the purpose of this function are those fields that do not affect |
||||
* the data layout in the buffers. E.g. pts, sample rate (for audio) or sample |
||||
* aspect ratio (for video), but not width/height or channel layout. |
||||
* Side data is also copied. |
||||
*/ |
||||
int av_frame_copy_props(AVFrame *dst, const AVFrame *src); |
||||
|
||||
/**
|
||||
* Get the buffer reference a given data plane is stored in. |
||||
* |
||||
* @param plane index of the data plane of interest in frame->extended_data. |
||||
* |
||||
* @return the buffer reference that contains the plane or NULL if the input |
||||
* frame is not valid. |
||||
*/ |
||||
AVBufferRef *av_frame_get_plane_buffer(AVFrame *frame, int plane); |
||||
|
||||
/**
|
||||
* Add a new side data to a frame. |
||||
* |
||||
* @param frame a frame to which the side data should be added |
||||
* @param type type of the added side data |
||||
* @param size size of the side data |
||||
* |
||||
* @return newly added side data on success, NULL on error |
||||
*/ |
||||
AVFrameSideData *av_frame_new_side_data(AVFrame *frame, |
||||
enum AVFrameSideDataType type, |
||||
int size); |
||||
|
||||
/**
|
||||
* @return a pointer to the side data of a given type on success, NULL if there |
||||
* is no side data with such type in this frame. |
||||
*/ |
||||
AVFrameSideData *av_frame_get_side_data(AVFrame *frame, |
||||
enum AVFrameSideDataType type); |
||||
|
||||
#endif /* AVUTIL_FRAME_H */ |
@ -0,0 +1,99 @@ |
||||
/*
|
||||
* Copyright (C) 2012 Martin Storsjo |
||||
* |
||||
* 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 AVUTIL_HMAC_H |
||||
#define AVUTIL_HMAC_H |
||||
|
||||
#include <stdint.h> |
||||
|
||||
/**
|
||||
* @defgroup lavu_hmac HMAC |
||||
* @ingroup lavu_crypto |
||||
* @{ |
||||
*/ |
||||
|
||||
enum AVHMACType { |
||||
AV_HMAC_MD5, |
||||
AV_HMAC_SHA1, |
||||
AV_HMAC_SHA224 = 10, |
||||
AV_HMAC_SHA256, |
||||
AV_HMAC_SHA384, |
||||
AV_HMAC_SHA512, |
||||
}; |
||||
|
||||
typedef struct AVHMAC AVHMAC; |
||||
|
||||
/**
|
||||
* Allocate an AVHMAC context. |
||||
* @param type The hash function used for the HMAC. |
||||
*/ |
||||
AVHMAC *av_hmac_alloc(enum AVHMACType type); |
||||
|
||||
/**
|
||||
* Free an AVHMAC context. |
||||
* @param ctx The context to free, may be NULL |
||||
*/ |
||||
void av_hmac_free(AVHMAC *ctx); |
||||
|
||||
/**
|
||||
* Initialize an AVHMAC context with an authentication key. |
||||
* @param ctx The HMAC context |
||||
* @param key The authentication key |
||||
* @param keylen The length of the key, in bytes |
||||
*/ |
||||
void av_hmac_init(AVHMAC *ctx, const uint8_t *key, unsigned int keylen); |
||||
|
||||
/**
|
||||
* Hash data with the HMAC. |
||||
* @param ctx The HMAC context |
||||
* @param data The data to hash |
||||
* @param len The length of the data, in bytes |
||||
*/ |
||||
void av_hmac_update(AVHMAC *ctx, const uint8_t *data, unsigned int len); |
||||
|
||||
/**
|
||||
* Finish hashing and output the HMAC digest. |
||||
* @param ctx The HMAC context |
||||
* @param out The output buffer to write the digest into |
||||
* @param outlen The length of the out buffer, in bytes |
||||
* @return The number of bytes written to out, or a negative error code. |
||||
*/ |
||||
int av_hmac_final(AVHMAC *ctx, uint8_t *out, unsigned int outlen); |
||||
|
||||
/**
|
||||
* Hash an array of data with a key. |
||||
* @param ctx The HMAC context |
||||
* @param data The data to hash |
||||
* @param len The length of the data, in bytes |
||||
* @param key The authentication key |
||||
* @param keylen The length of the key, in bytes |
||||
* @param out The output buffer to write the digest into |
||||
* @param outlen The length of the out buffer, in bytes |
||||
* @return The number of bytes written to out, or a negative error code. |
||||
*/ |
||||
int av_hmac_calc(AVHMAC *ctx, const uint8_t *data, unsigned int len, |
||||
const uint8_t *key, unsigned int keylen, |
||||
uint8_t *out, unsigned int outlen); |
||||
|
||||
/**
|
||||
* @} |
||||
*/ |
||||
|
||||
#endif /* AVUTIL_HMAC_H */ |
@ -0,0 +1,32 @@ |
||||
/*
|
||||
* Copyright (C) 2013 Reimar Döffinger <Reimar.Doeffinger@gmx.de> |
||||
* |
||||
* 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 AVUTIL_MURMUR3_H |
||||
#define AVUTIL_MURMUR3_H |
||||
|
||||
#include <stdint.h> |
||||
|
||||
struct AVMurMur3 *av_murmur3_alloc(void); |
||||
void av_murmur3_init_seeded(struct AVMurMur3 *c, uint64_t seed); |
||||
void av_murmur3_init(struct AVMurMur3 *c); |
||||
void av_murmur3_update(struct AVMurMur3 *c, const uint8_t *src, int len); |
||||
void av_murmur3_final(struct AVMurMur3 *c, uint8_t dst[16]); |
||||
|
||||
#endif /* AVUTIL_MURMUR3_H */ |
@ -0,0 +1,171 @@ |
||||
/*
|
||||
* copyright (c) 2006-2012 Michael Niedermayer <michaelni@gmx.at> |
||||
* |
||||
* 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 AVUTIL_OLD_PIX_FMTS_H |
||||
#define AVUTIL_OLD_PIX_FMTS_H |
||||
|
||||
/*
|
||||
* This header exists to prevent new pixel formats from being accidentally added |
||||
* to the deprecated list. |
||||
* Do not include it directly. It will be removed on next major bump |
||||
* |
||||
* Do not add new items to this list. Use the AVPixelFormat enum instead. |
||||
*/ |
||||
PIX_FMT_NONE = AV_PIX_FMT_NONE, |
||||
PIX_FMT_YUV420P, ///< planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
|
||||
PIX_FMT_YUYV422, ///< packed YUV 4:2:2, 16bpp, Y0 Cb Y1 Cr
|
||||
PIX_FMT_RGB24, ///< packed RGB 8:8:8, 24bpp, RGBRGB...
|
||||
PIX_FMT_BGR24, ///< packed RGB 8:8:8, 24bpp, BGRBGR...
|
||||
PIX_FMT_YUV422P, ///< planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
|
||||
PIX_FMT_YUV444P, ///< planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
|
||||
PIX_FMT_YUV410P, ///< planar YUV 4:1:0, 9bpp, (1 Cr & Cb sample per 4x4 Y samples)
|
||||
PIX_FMT_YUV411P, ///< planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples)
|
||||
PIX_FMT_GRAY8, ///< Y , 8bpp
|
||||
PIX_FMT_MONOWHITE, ///< Y , 1bpp, 0 is white, 1 is black, in each byte pixels are ordered from the msb to the lsb
|
||||
PIX_FMT_MONOBLACK, ///< Y , 1bpp, 0 is black, 1 is white, in each byte pixels are ordered from the msb to the lsb
|
||||
PIX_FMT_PAL8, ///< 8 bit with PIX_FMT_RGB32 palette
|
||||
PIX_FMT_YUVJ420P, ///< planar YUV 4:2:0, 12bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV420P and setting color_range
|
||||
PIX_FMT_YUVJ422P, ///< planar YUV 4:2:2, 16bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV422P and setting color_range
|
||||
PIX_FMT_YUVJ444P, ///< planar YUV 4:4:4, 24bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV444P and setting color_range
|
||||
PIX_FMT_XVMC_MPEG2_MC,///< XVideo Motion Acceleration via common packet passing
|
||||
PIX_FMT_XVMC_MPEG2_IDCT, |
||||
PIX_FMT_UYVY422, ///< packed YUV 4:2:2, 16bpp, Cb Y0 Cr Y1
|
||||
PIX_FMT_UYYVYY411, ///< packed YUV 4:1:1, 12bpp, Cb Y0 Y1 Cr Y2 Y3
|
||||
PIX_FMT_BGR8, ///< packed RGB 3:3:2, 8bpp, (msb)2B 3G 3R(lsb)
|
||||
PIX_FMT_BGR4, ///< packed RGB 1:2:1 bitstream, 4bpp, (msb)1B 2G 1R(lsb), a byte contains two pixels, the first pixel in the byte is the one composed by the 4 msb bits
|
||||
PIX_FMT_BGR4_BYTE, ///< packed RGB 1:2:1, 8bpp, (msb)1B 2G 1R(lsb)
|
||||
PIX_FMT_RGB8, ///< packed RGB 3:3:2, 8bpp, (msb)2R 3G 3B(lsb)
|
||||
PIX_FMT_RGB4, ///< packed RGB 1:2:1 bitstream, 4bpp, (msb)1R 2G 1B(lsb), a byte contains two pixels, the first pixel in the byte is the one composed by the 4 msb bits
|
||||
PIX_FMT_RGB4_BYTE, ///< packed RGB 1:2:1, 8bpp, (msb)1R 2G 1B(lsb)
|
||||
PIX_FMT_NV12, ///< planar YUV 4:2:0, 12bpp, 1 plane for Y and 1 plane for the UV components, which are interleaved (first byte U and the following byte V)
|
||||
PIX_FMT_NV21, ///< as above, but U and V bytes are swapped
|
||||
|
||||
PIX_FMT_ARGB, ///< packed ARGB 8:8:8:8, 32bpp, ARGBARGB...
|
||||
PIX_FMT_RGBA, ///< packed RGBA 8:8:8:8, 32bpp, RGBARGBA...
|
||||
PIX_FMT_ABGR, ///< packed ABGR 8:8:8:8, 32bpp, ABGRABGR...
|
||||
PIX_FMT_BGRA, ///< packed BGRA 8:8:8:8, 32bpp, BGRABGRA...
|
||||
|
||||
PIX_FMT_GRAY16BE, ///< Y , 16bpp, big-endian
|
||||
PIX_FMT_GRAY16LE, ///< Y , 16bpp, little-endian
|
||||
PIX_FMT_YUV440P, ///< planar YUV 4:4:0 (1 Cr & Cb sample per 1x2 Y samples)
|
||||
PIX_FMT_YUVJ440P, ///< planar YUV 4:4:0 full scale (JPEG), deprecated in favor of PIX_FMT_YUV440P and setting color_range
|
||||
PIX_FMT_YUVA420P, ///< planar YUV 4:2:0, 20bpp, (1 Cr & Cb sample per 2x2 Y & A samples)
|
||||
PIX_FMT_VDPAU_H264,///< H.264 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
|
||||
PIX_FMT_VDPAU_MPEG1,///< MPEG-1 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
|
||||
PIX_FMT_VDPAU_MPEG2,///< MPEG-2 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
|
||||
PIX_FMT_VDPAU_WMV3,///< WMV3 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
|
||||
PIX_FMT_VDPAU_VC1, ///< VC-1 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
|
||||
PIX_FMT_RGB48BE, ///< packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as big-endian
|
||||
PIX_FMT_RGB48LE, ///< packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as little-endian
|
||||
|
||||
PIX_FMT_RGB565BE, ///< packed RGB 5:6:5, 16bpp, (msb) 5R 6G 5B(lsb), big-endian
|
||||
PIX_FMT_RGB565LE, ///< packed RGB 5:6:5, 16bpp, (msb) 5R 6G 5B(lsb), little-endian
|
||||
PIX_FMT_RGB555BE, ///< packed RGB 5:5:5, 16bpp, (msb)1A 5R 5G 5B(lsb), big-endian, most significant bit to 0
|
||||
PIX_FMT_RGB555LE, ///< packed RGB 5:5:5, 16bpp, (msb)1A 5R 5G 5B(lsb), little-endian, most significant bit to 0
|
||||
|
||||
PIX_FMT_BGR565BE, ///< packed BGR 5:6:5, 16bpp, (msb) 5B 6G 5R(lsb), big-endian
|
||||
PIX_FMT_BGR565LE, ///< packed BGR 5:6:5, 16bpp, (msb) 5B 6G 5R(lsb), little-endian
|
||||
PIX_FMT_BGR555BE, ///< packed BGR 5:5:5, 16bpp, (msb)1A 5B 5G 5R(lsb), big-endian, most significant bit to 1
|
||||
PIX_FMT_BGR555LE, ///< packed BGR 5:5:5, 16bpp, (msb)1A 5B 5G 5R(lsb), little-endian, most significant bit to 1
|
||||
|
||||
PIX_FMT_VAAPI_MOCO, ///< HW acceleration through VA API at motion compensation entry-point, Picture.data[3] contains a vaapi_render_state struct which contains macroblocks as well as various fields extracted from headers
|
||||
PIX_FMT_VAAPI_IDCT, ///< HW acceleration through VA API at IDCT entry-point, Picture.data[3] contains a vaapi_render_state struct which contains fields extracted from headers
|
||||
PIX_FMT_VAAPI_VLD, ///< HW decoding through VA API, Picture.data[3] contains a vaapi_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
|
||||
|
||||
PIX_FMT_YUV420P16LE, ///< planar YUV 4:2:0, 24bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
|
||||
PIX_FMT_YUV420P16BE, ///< planar YUV 4:2:0, 24bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
|
||||
PIX_FMT_YUV422P16LE, ///< planar YUV 4:2:2, 32bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
|
||||
PIX_FMT_YUV422P16BE, ///< planar YUV 4:2:2, 32bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
|
||||
PIX_FMT_YUV444P16LE, ///< planar YUV 4:4:4, 48bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
|
||||
PIX_FMT_YUV444P16BE, ///< planar YUV 4:4:4, 48bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
|
||||
PIX_FMT_VDPAU_MPEG4, ///< MPEG4 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
|
||||
PIX_FMT_DXVA2_VLD, ///< HW decoding through DXVA2, Picture.data[3] contains a LPDIRECT3DSURFACE9 pointer
|
||||
|
||||
PIX_FMT_RGB444LE, ///< packed RGB 4:4:4, 16bpp, (msb)4A 4R 4G 4B(lsb), little-endian, most significant bits to 0
|
||||
PIX_FMT_RGB444BE, ///< packed RGB 4:4:4, 16bpp, (msb)4A 4R 4G 4B(lsb), big-endian, most significant bits to 0
|
||||
PIX_FMT_BGR444LE, ///< packed BGR 4:4:4, 16bpp, (msb)4A 4B 4G 4R(lsb), little-endian, most significant bits to 1
|
||||
PIX_FMT_BGR444BE, ///< packed BGR 4:4:4, 16bpp, (msb)4A 4B 4G 4R(lsb), big-endian, most significant bits to 1
|
||||
PIX_FMT_GRAY8A, ///< 8bit gray, 8bit alpha
|
||||
PIX_FMT_BGR48BE, ///< packed RGB 16:16:16, 48bpp, 16B, 16G, 16R, the 2-byte value for each R/G/B component is stored as big-endian
|
||||
PIX_FMT_BGR48LE, ///< packed RGB 16:16:16, 48bpp, 16B, 16G, 16R, the 2-byte value for each R/G/B component is stored as little-endian
|
||||
|
||||
//the following 10 formats have the disadvantage of needing 1 format for each bit depth, thus
|
||||
//If you want to support multiple bit depths, then using PIX_FMT_YUV420P16* with the bpp stored separately
|
||||
//is better
|
||||
PIX_FMT_YUV420P9BE, ///< planar YUV 4:2:0, 13.5bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
|
||||
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), 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_YUVA444P, ///< planar YUV 4:4:4 32bpp, (1 Cr & Cb sample per 1x1 Y & A samples)
|
||||
PIX_FMT_YUVA422P, ///< planar YUV 4:2:2 24bpp, (1 Cr & Cb sample per 2x1 Y & A samples)
|
||||
|
||||
PIX_FMT_YUV420P12BE, ///< planar YUV 4:2:0,18bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
|
||||
PIX_FMT_YUV420P12LE, ///< planar YUV 4:2:0,18bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
|
||||
PIX_FMT_YUV420P14BE, ///< planar YUV 4:2:0,21bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
|
||||
PIX_FMT_YUV420P14LE, ///< planar YUV 4:2:0,21bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
|
||||
PIX_FMT_YUV422P12BE, ///< planar YUV 4:2:2,24bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
|
||||
PIX_FMT_YUV422P12LE, ///< planar YUV 4:2:2,24bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
|
||||
PIX_FMT_YUV422P14BE, ///< planar YUV 4:2:2,28bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
|
||||
PIX_FMT_YUV422P14LE, ///< planar YUV 4:2:2,28bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
|
||||
PIX_FMT_YUV444P12BE, ///< planar YUV 4:4:4,36bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
|
||||
PIX_FMT_YUV444P12LE, ///< planar YUV 4:4:4,36bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
|
||||
PIX_FMT_YUV444P14BE, ///< planar YUV 4:4:4,42bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
|
||||
PIX_FMT_YUV444P14LE, ///< planar YUV 4:4:4,42bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
|
||||
PIX_FMT_GBRP12BE, ///< planar GBR 4:4:4 36bpp, big endian
|
||||
PIX_FMT_GBRP12LE, ///< planar GBR 4:4:4 36bpp, little endian
|
||||
PIX_FMT_GBRP14BE, ///< planar GBR 4:4:4 42bpp, big endian
|
||||
PIX_FMT_GBRP14LE, ///< planar GBR 4:4:4 42bpp, little endian
|
||||
|
||||
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
|
||||
#endif /* AVUTIL_OLD_PIX_FMTS_H */ |
@ -0,0 +1,75 @@ |
||||
/*
|
||||
* Copyright (C) 2007 Michael Niedermayer <michaelni@gmx.at> |
||||
* Copyright (C) 2013 James Almer <jamrial@gmail.com> |
||||
* |
||||
* 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 AVUTIL_RIPEMD_H |
||||
#define AVUTIL_RIPEMD_H |
||||
|
||||
#include <stdint.h> |
||||
|
||||
#include "attributes.h" |
||||
#include "version.h" |
||||
|
||||
/**
|
||||
* @defgroup lavu_ripemd RIPEMD |
||||
* @ingroup lavu_crypto |
||||
* @{ |
||||
*/ |
||||
|
||||
extern const int av_ripemd_size; |
||||
|
||||
struct AVRIPEMD; |
||||
|
||||
/**
|
||||
* Allocate an AVRIPEMD context. |
||||
*/ |
||||
struct AVRIPEMD *av_ripemd_alloc(void); |
||||
|
||||
/**
|
||||
* Initialize RIPEMD hashing. |
||||
* |
||||
* @param context pointer to the function context (of size av_ripemd_size) |
||||
* @param bits number of bits in digest (128, 160, 256 or 320 bits) |
||||
* @return zero if initialization succeeded, -1 otherwise |
||||
*/ |
||||
int av_ripemd_init(struct AVRIPEMD* context, int bits); |
||||
|
||||
/**
|
||||
* Update hash value. |
||||
* |
||||
* @param context hash function context |
||||
* @param data input data to update hash with |
||||
* @param len input data length |
||||
*/ |
||||
void av_ripemd_update(struct AVRIPEMD* context, const uint8_t* data, unsigned int len); |
||||
|
||||
/**
|
||||
* Finish hashing and output digest value. |
||||
* |
||||
* @param context hash function context |
||||
* @param digest buffer where output digest value is stored |
||||
*/ |
||||
void av_ripemd_final(struct AVRIPEMD* context, uint8_t *digest); |
||||
|
||||
/**
|
||||
* @} |
||||
*/ |
||||
|
||||
#endif /* AVUTIL_RIPEMD_H */ |
@ -0,0 +1,41 @@ |
||||
/*
|
||||
* Copyright (c) 2000-2003 Fabrice Bellard |
||||
* |
||||
* 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 AVUTIL_TIME_H |
||||
#define AVUTIL_TIME_H |
||||
|
||||
#include <stdint.h> |
||||
|
||||
/**
|
||||
* Get the current time in microseconds. |
||||
*/ |
||||
int64_t av_gettime(void); |
||||
|
||||
/**
|
||||
* Sleep for a period of time. Although the duration is expressed in |
||||
* microseconds, the actual delay may be rounded to the precision of the |
||||
* system timer. |
||||
* |
||||
* @param usec Number of microseconds to sleep. |
||||
* @return zero on success or (negative) error code. |
||||
*/ |
||||
int av_usleep(unsigned usec); |
||||
|
||||
#endif /* AVUTIL_TIME_H */ |
@ -0,0 +1,140 @@ |
||||
/*
|
||||
* Copyright (c) 2006 Smartjog S.A.S, Baptiste Coudurier <baptiste.coudurier@gmail.com> |
||||
* Copyright (c) 2011-2012 Smartjog S.A.S, Clément Bœsch <clement.boesch@smartjog.com> |
||||
* |
||||
* 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 |
||||
*/ |
||||
|
||||
/**
|
||||
* @file |
||||
* Timecode helpers header |
||||
*/ |
||||
|
||||
#ifndef AVUTIL_TIMECODE_H |
||||
#define AVUTIL_TIMECODE_H |
||||
|
||||
#include <stdint.h> |
||||
#include "rational.h" |
||||
|
||||
#define AV_TIMECODE_STR_SIZE 16 |
||||
|
||||
enum AVTimecodeFlag { |
||||
AV_TIMECODE_FLAG_DROPFRAME = 1<<0, ///< timecode is drop frame
|
||||
AV_TIMECODE_FLAG_24HOURSMAX = 1<<1, ///< timecode wraps after 24 hours
|
||||
AV_TIMECODE_FLAG_ALLOWNEGATIVE = 1<<2, ///< negative time values are allowed
|
||||
}; |
||||
|
||||
typedef struct { |
||||
int start; ///< timecode frame start (first base frame number)
|
||||
uint32_t flags; ///< flags such as drop frame, +24 hours support, ...
|
||||
AVRational rate; ///< frame rate in rational form
|
||||
unsigned fps; ///< frame per second; must be consistent with the rate field
|
||||
} AVTimecode; |
||||
|
||||
/**
|
||||
* Adjust frame number for NTSC drop frame time code. |
||||
* |
||||
* @param framenum frame number to adjust |
||||
* @param fps frame per second, 30 or 60 |
||||
* @return adjusted frame number |
||||
* @warning adjustment is only valid in NTSC 29.97 and 59.94 |
||||
*/ |
||||
int av_timecode_adjust_ntsc_framenum2(int framenum, int fps); |
||||
|
||||
/**
|
||||
* Convert frame number to SMPTE 12M binary representation. |
||||
* |
||||
* @param tc timecode data correctly initialized |
||||
* @param framenum frame number |
||||
* @return the SMPTE binary representation |
||||
* |
||||
* @note Frame number adjustment is automatically done in case of drop timecode, |
||||
* you do NOT have to call av_timecode_adjust_ntsc_framenum2(). |
||||
* @note The frame number is relative to tc->start. |
||||
* @note Color frame (CF), binary group flags (BGF) and biphase mark polarity |
||||
* correction (PC) bits are set to zero. |
||||
*/ |
||||
uint32_t av_timecode_get_smpte_from_framenum(const AVTimecode *tc, int framenum); |
||||
|
||||
/**
|
||||
* Load timecode string in buf. |
||||
* |
||||
* @param buf destination buffer, must be at least AV_TIMECODE_STR_SIZE long |
||||
* @param tc timecode data correctly initialized |
||||
* @param framenum frame number |
||||
* @return the buf parameter |
||||
* |
||||
* @note Timecode representation can be a negative timecode and have more than |
||||
* 24 hours, but will only be honored if the flags are correctly set. |
||||
* @note The frame number is relative to tc->start. |
||||
*/ |
||||
char *av_timecode_make_string(const AVTimecode *tc, char *buf, int framenum); |
||||
|
||||
/**
|
||||
* Get the timecode string from the SMPTE timecode format. |
||||
* |
||||
* @param buf destination buffer, must be at least AV_TIMECODE_STR_SIZE long |
||||
* @param tcsmpte the 32-bit SMPTE timecode |
||||
* @param prevent_df prevent the use of a drop flag when it is known the DF bit |
||||
* is arbitrary |
||||
* @return the buf parameter |
||||
*/ |
||||
char *av_timecode_make_smpte_tc_string(char *buf, uint32_t tcsmpte, int prevent_df); |
||||
|
||||
/**
|
||||
* Get the timecode string from the 25-bit timecode format (MPEG GOP format). |
||||
* |
||||
* @param buf destination buffer, must be at least AV_TIMECODE_STR_SIZE long |
||||
* @param tc25bit the 25-bits timecode |
||||
* @return the buf parameter |
||||
*/ |
||||
char *av_timecode_make_mpeg_tc_string(char *buf, uint32_t tc25bit); |
||||
|
||||
/**
|
||||
* Init a timecode struct with the passed parameters. |
||||
* |
||||
* @param log_ctx a pointer to an arbitrary struct of which the first field |
||||
* is a pointer to an AVClass struct (used for av_log) |
||||
* @param tc pointer to an allocated AVTimecode |
||||
* @param rate frame rate in rational form |
||||
* @param flags miscellaneous flags such as drop frame, +24 hours, ... |
||||
* (see AVTimecodeFlag) |
||||
* @param frame_start the first frame number |
||||
* @return 0 on success, AVERROR otherwise |
||||
*/ |
||||
int av_timecode_init(AVTimecode *tc, AVRational rate, int flags, int frame_start, void *log_ctx); |
||||
|
||||
/**
|
||||
* Parse timecode representation (hh:mm:ss[:;.]ff). |
||||
* |
||||
* @param log_ctx a pointer to an arbitrary struct of which the first field is a |
||||
* pointer to an AVClass struct (used for av_log). |
||||
* @param tc pointer to an allocated AVTimecode |
||||
* @param rate frame rate in rational form |
||||
* @param str timecode string which will determine the frame start |
||||
* @return 0 on success, AVERROR otherwise |
||||
*/ |
||||
int av_timecode_init_from_string(AVTimecode *tc, AVRational rate, const char *str, void *log_ctx); |
||||
|
||||
/**
|
||||
* Check if the timecode feature is available for the given frame rate |
||||
* |
||||
* @return 0 if supported, <0 otherwise |
||||
*/ |
||||
int av_timecode_check_frame_rate(AVRational rate); |
||||
|
||||
#endif /* AVUTIL_TIMECODE_H */ |
@ -0,0 +1,74 @@ |
||||
/*
|
||||
* 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 |
||||
*/ |
||||
|
||||
/**
|
||||
* @file |
||||
* timestamp utils, mostly useful for debugging/logging purposes |
||||
*/ |
||||
|
||||
#ifndef AVUTIL_TIMESTAMP_H |
||||
#define AVUTIL_TIMESTAMP_H |
||||
|
||||
#include "common.h" |
||||
|
||||
#define AV_TS_MAX_STRING_SIZE 32 |
||||
|
||||
/**
|
||||
* Fill the provided buffer with a string containing a timestamp |
||||
* representation. |
||||
* |
||||
* @param buf a buffer with size in bytes of at least AV_TS_MAX_STRING_SIZE |
||||
* @param ts the timestamp to represent |
||||
* @return the buffer in input |
||||
*/ |
||||
static inline char *av_ts_make_string(char *buf, int64_t ts) |
||||
{ |
||||
if (ts == AV_NOPTS_VALUE) snprintf(buf, AV_TS_MAX_STRING_SIZE, "NOPTS"); |
||||
else snprintf(buf, AV_TS_MAX_STRING_SIZE, "%"PRId64, ts); |
||||
return buf; |
||||
} |
||||
|
||||
/**
|
||||
* Convenience macro, the return value should be used only directly in |
||||
* function arguments but never stand-alone. |
||||
*/ |
||||
#define av_ts2str(ts) av_ts_make_string((char[AV_TS_MAX_STRING_SIZE]){0}, ts) |
||||
|
||||
/**
|
||||
* Fill the provided buffer with a string containing a timestamp time |
||||
* representation. |
||||
* |
||||
* @param buf a buffer with size in bytes of at least AV_TS_MAX_STRING_SIZE |
||||
* @param ts the timestamp to represent |
||||
* @param tb the timebase of the timestamp |
||||
* @return the buffer in input |
||||
*/ |
||||
static inline char *av_ts_make_time_string(char *buf, int64_t ts, AVRational *tb) |
||||
{ |
||||
if (ts == AV_NOPTS_VALUE) snprintf(buf, AV_TS_MAX_STRING_SIZE, "NOPTS"); |
||||
else snprintf(buf, AV_TS_MAX_STRING_SIZE, "%.6g", av_q2d(*tb) * ts); |
||||
return buf; |
||||
} |
||||
|
||||
/**
|
||||
* Convenience macro, the return value should be used only directly in |
||||
* function arguments but never stand-alone. |
||||
*/ |
||||
#define av_ts2timestr(ts, tb) av_ts_make_time_string((char[AV_TS_MAX_STRING_SIZE]){0}, ts, tb) |
||||
|
||||
#endif /* AVUTIL_TIMESTAMP_H */ |
@ -0,0 +1,144 @@ |
||||
/*
|
||||
* copyright (c) 2003 Fabrice Bellard |
||||
* |
||||
* 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 AVUTIL_VERSION_H |
||||
#define AVUTIL_VERSION_H |
||||
|
||||
/**
|
||||
* @defgroup preproc_misc Preprocessor String Macros |
||||
* |
||||
* String manipulation macros |
||||
* |
||||
* @{ |
||||
*/ |
||||
|
||||
#define AV_STRINGIFY(s) AV_TOSTRING(s) |
||||
#define AV_TOSTRING(s) #s |
||||
|
||||
#define AV_GLUE(a, b) a ## b |
||||
#define AV_JOIN(a, b) AV_GLUE(a, b) |
||||
|
||||
#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) |
||||
|
||||
/**
|
||||
* @} |
||||
*/ |
||||
|
||||
|
||||
/**
|
||||
* @file |
||||
* @ingroup lavu |
||||
* Libavutil version macros |
||||
*/ |
||||
|
||||
/**
|
||||
* @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 52 |
||||
#define LIBAVUTIL_VERSION_MINOR 38 |
||||
#define LIBAVUTIL_VERSION_MICRO 100 |
||||
|
||||
#define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \ |
||||
LIBAVUTIL_VERSION_MINOR, \
|
||||
LIBAVUTIL_VERSION_MICRO) |
||||
#define LIBAVUTIL_VERSION AV_VERSION(LIBAVUTIL_VERSION_MAJOR, \ |
||||
LIBAVUTIL_VERSION_MINOR, \
|
||||
LIBAVUTIL_VERSION_MICRO) |
||||
#define LIBAVUTIL_BUILD LIBAVUTIL_VERSION_INT |
||||
|
||||
#define LIBAVUTIL_IDENT "Lavu" AV_STRINGIFY(LIBAVUTIL_VERSION) |
||||
|
||||
/**
|
||||
* @} |
||||
* |
||||
* @defgroup depr_guards Deprecation guards |
||||
* FF_API_* defines may be placed below to indicate public API that will be |
||||
* dropped at a future version bump. The defines themselves are not part of |
||||
* the public API and may change, break or disappear at any time. |
||||
* |
||||
* @{ |
||||
*/ |
||||
|
||||
#ifndef FF_API_GET_BITS_PER_SAMPLE_FMT |
||||
#define FF_API_GET_BITS_PER_SAMPLE_FMT (LIBAVUTIL_VERSION_MAJOR < 53) |
||||
#endif |
||||
#ifndef FF_API_FIND_OPT |
||||
#define FF_API_FIND_OPT (LIBAVUTIL_VERSION_MAJOR < 53) |
||||
#endif |
||||
#ifndef FF_API_OLD_AVOPTIONS |
||||
#define FF_API_OLD_AVOPTIONS (LIBAVUTIL_VERSION_MAJOR < 53) |
||||
#endif |
||||
#ifndef FF_API_PIX_FMT |
||||
#define FF_API_PIX_FMT (LIBAVUTIL_VERSION_MAJOR < 53) |
||||
#endif |
||||
#ifndef FF_API_CONTEXT_SIZE |
||||
#define FF_API_CONTEXT_SIZE (LIBAVUTIL_VERSION_MAJOR < 53) |
||||
#endif |
||||
#ifndef FF_API_PIX_FMT_DESC |
||||
#define FF_API_PIX_FMT_DESC (LIBAVUTIL_VERSION_MAJOR < 53) |
||||
#endif |
||||
#ifndef FF_API_AV_REVERSE |
||||
#define FF_API_AV_REVERSE (LIBAVUTIL_VERSION_MAJOR < 53) |
||||
#endif |
||||
#ifndef FF_API_AUDIOCONVERT |
||||
#define FF_API_AUDIOCONVERT (LIBAVUTIL_VERSION_MAJOR < 53) |
||||
#endif |
||||
#ifndef FF_API_CPU_FLAG_MMX2 |
||||
#define FF_API_CPU_FLAG_MMX2 (LIBAVUTIL_VERSION_MAJOR < 53) |
||||
#endif |
||||
#ifndef FF_API_SAMPLES_UTILS_RETURN_ZERO |
||||
#define FF_API_SAMPLES_UTILS_RETURN_ZERO (LIBAVUTIL_VERSION_MAJOR < 53) |
||||
#endif |
||||
#ifndef FF_API_LLS_PRIVATE |
||||
#define FF_API_LLS_PRIVATE (LIBAVUTIL_VERSION_MAJOR < 53) |
||||
#endif |
||||
#ifndef FF_API_AVFRAME_LAVC |
||||
#define FF_API_AVFRAME_LAVC (LIBAVUTIL_VERSION_MAJOR < 53) |
||||
#endif |
||||
|
||||
/**
|
||||
* @} |
||||
*/ |
||||
|
||||
#endif /* AVUTIL_VERSION_H */ |
||||
|
@ -0,0 +1,62 @@ |
||||
/*
|
||||
* A 32-bit implementation of the XTEA algorithm |
||||
* Copyright (c) 2012 Samuel Pitoiset |
||||
* |
||||
* 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 AVUTIL_XTEA_H |
||||
#define AVUTIL_XTEA_H |
||||
|
||||
#include <stdint.h> |
||||
|
||||
/**
|
||||
* @defgroup lavu_xtea XTEA |
||||
* @ingroup lavu_crypto |
||||
* @{ |
||||
*/ |
||||
|
||||
typedef struct AVXTEA { |
||||
uint32_t key[16]; |
||||
} AVXTEA; |
||||
|
||||
/**
|
||||
* Initialize an AVXTEA context. |
||||
* |
||||
* @param ctx an AVXTEA context |
||||
* @param key a key of 16 bytes used for encryption/decryption |
||||
*/ |
||||
void av_xtea_init(struct AVXTEA *ctx, const uint8_t key[16]); |
||||
|
||||
/**
|
||||
* Encrypt or decrypt a buffer using a previously initialized context. |
||||
* |
||||
* @param ctx an AVXTEA context |
||||
* @param dst destination array, can be equal to src |
||||
* @param src source array, can be equal to dst |
||||
* @param count number of 8 byte blocks |
||||
* @param iv initialization vector for CBC mode, if NULL then ECB will be used |
||||
* @param decrypt 0 for encryption, 1 for decryption |
||||
*/ |
||||
void av_xtea_crypt(struct AVXTEA *ctx, uint8_t *dst, const uint8_t *src, |
||||
int count, uint8_t *iv, int decrypt); |
||||
|
||||
/**
|
||||
* @} |
||||
*/ |
||||
|
||||
#endif /* AVUTIL_XTEA_H */ |
@ -0,0 +1,59 @@ |
||||
/*
|
||||
* 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 SWSCALE_VERSION_H |
||||
#define SWSCALE_VERSION_H |
||||
|
||||
/**
|
||||
* @file |
||||
* swscale version macros |
||||
*/ |
||||
|
||||
#include "libavutil/avutil.h" |
||||
|
||||
#define LIBSWSCALE_VERSION_MAJOR 2 |
||||
#define LIBSWSCALE_VERSION_MINOR 3 |
||||
#define LIBSWSCALE_VERSION_MICRO 100 |
||||
|
||||
#define LIBSWSCALE_VERSION_INT AV_VERSION_INT(LIBSWSCALE_VERSION_MAJOR, \ |
||||
LIBSWSCALE_VERSION_MINOR, \
|
||||
LIBSWSCALE_VERSION_MICRO) |
||||
#define LIBSWSCALE_VERSION AV_VERSION(LIBSWSCALE_VERSION_MAJOR, \ |
||||
LIBSWSCALE_VERSION_MINOR, \
|
||||
LIBSWSCALE_VERSION_MICRO) |
||||
#define LIBSWSCALE_BUILD LIBSWSCALE_VERSION_INT |
||||
|
||||
#define LIBSWSCALE_IDENT "SwS" AV_STRINGIFY(LIBSWSCALE_VERSION) |
||||
|
||||
/**
|
||||
* FF_API_* defines may be placed below to indicate public API that will be |
||||
* dropped at a future version bump. The defines themselves are not part of |
||||
* the public API and may change, break or disappear at any time. |
||||
*/ |
||||
|
||||
#ifndef FF_API_SWS_GETCONTEXT |
||||
#define FF_API_SWS_GETCONTEXT (LIBSWSCALE_VERSION_MAJOR < 3) |
||||
#endif |
||||
#ifndef FF_API_SWS_CPU_CAPS |
||||
#define FF_API_SWS_CPU_CAPS (LIBSWSCALE_VERSION_MAJOR < 3) |
||||
#endif |
||||
#ifndef FF_API_SWS_FORMAT_NAME |
||||
#define FF_API_SWS_FORMAT_NAME (LIBSWSCALE_VERSION_MAJOR < 3) |
||||
#endif |
||||
|
||||
#endif /* SWSCALE_VERSION_H */ |
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,126 @@ |
||||
/**********************************************************************************
|
||||
* Copyright (c) 2008-2012 The Khronos Group Inc. |
||||
* |
||||
* Permission is hereby granted, free of charge, to any person obtaining a |
||||
* copy of this software and/or associated documentation files (the |
||||
* "Materials"), to deal in the Materials without restriction, including |
||||
* without limitation the rights to use, copy, modify, merge, publish, |
||||
* distribute, sublicense, and/or sell copies of the Materials, and to |
||||
* permit persons to whom the Materials are furnished to do so, subject to |
||||
* the following conditions: |
||||
* |
||||
* The above copyright notice and this permission notice shall be included |
||||
* in all copies or substantial portions of the Materials. |
||||
* |
||||
* THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
||||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. |
||||
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY |
||||
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, |
||||
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE |
||||
* MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. |
||||
**********************************************************************************/ |
||||
|
||||
/* $Revision: 11708 $ on $Date: 2010-06-13 23:36:24 -0700 (Sun, 13 Jun 2010) $ */ |
||||
|
||||
#ifndef __OPENCL_CL_D3D10_H |
||||
#define __OPENCL_CL_D3D10_H |
||||
|
||||
#include <d3d10.h> |
||||
#include <CL/cl.h> |
||||
#include <CL/cl_platform.h> |
||||
|
||||
#ifdef __cplusplus |
||||
extern "C" { |
||||
#endif |
||||
|
||||
/******************************************************************************
|
||||
* cl_khr_d3d10_sharing */ |
||||
#define cl_khr_d3d10_sharing 1 |
||||
|
||||
typedef cl_uint cl_d3d10_device_source_khr; |
||||
typedef cl_uint cl_d3d10_device_set_khr; |
||||
|
||||
/******************************************************************************/ |
||||
|
||||
// Error Codes
|
||||
#define CL_INVALID_D3D10_DEVICE_KHR -1002 |
||||
#define CL_INVALID_D3D10_RESOURCE_KHR -1003 |
||||
#define CL_D3D10_RESOURCE_ALREADY_ACQUIRED_KHR -1004 |
||||
#define CL_D3D10_RESOURCE_NOT_ACQUIRED_KHR -1005 |
||||
|
||||
// cl_d3d10_device_source_nv
|
||||
#define CL_D3D10_DEVICE_KHR 0x4010 |
||||
#define CL_D3D10_DXGI_ADAPTER_KHR 0x4011 |
||||
|
||||
// cl_d3d10_device_set_nv
|
||||
#define CL_PREFERRED_DEVICES_FOR_D3D10_KHR 0x4012 |
||||
#define CL_ALL_DEVICES_FOR_D3D10_KHR 0x4013 |
||||
|
||||
// cl_context_info
|
||||
#define CL_CONTEXT_D3D10_DEVICE_KHR 0x4014 |
||||
#define CL_CONTEXT_D3D10_PREFER_SHARED_RESOURCES_KHR 0x402C |
||||
|
||||
// cl_mem_info
|
||||
#define CL_MEM_D3D10_RESOURCE_KHR 0x4015 |
||||
|
||||
// cl_image_info
|
||||
#define CL_IMAGE_D3D10_SUBRESOURCE_KHR 0x4016 |
||||
|
||||
// cl_command_type
|
||||
#define CL_COMMAND_ACQUIRE_D3D10_OBJECTS_KHR 0x4017 |
||||
#define CL_COMMAND_RELEASE_D3D10_OBJECTS_KHR 0x4018 |
||||
|
||||
/******************************************************************************/ |
||||
|
||||
typedef CL_API_ENTRY cl_int (CL_API_CALL *clGetDeviceIDsFromD3D10KHR_fn)( |
||||
cl_platform_id platform, |
||||
cl_d3d10_device_source_khr d3d_device_source, |
||||
void * d3d_object, |
||||
cl_d3d10_device_set_khr d3d_device_set, |
||||
cl_uint num_entries, |
||||
cl_device_id * devices, |
||||
cl_uint * num_devices) CL_API_SUFFIX__VERSION_1_0; |
||||
|
||||
typedef CL_API_ENTRY cl_mem (CL_API_CALL *clCreateFromD3D10BufferKHR_fn)( |
||||
cl_context context, |
||||
cl_mem_flags flags, |
||||
ID3D10Buffer * resource, |
||||
cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_0; |
||||
|
||||
typedef CL_API_ENTRY cl_mem (CL_API_CALL *clCreateFromD3D10Texture2DKHR_fn)( |
||||
cl_context context, |
||||
cl_mem_flags flags, |
||||
ID3D10Texture2D * resource, |
||||
UINT subresource, |
||||
cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_0; |
||||
|
||||
typedef CL_API_ENTRY cl_mem (CL_API_CALL *clCreateFromD3D10Texture3DKHR_fn)( |
||||
cl_context context, |
||||
cl_mem_flags flags, |
||||
ID3D10Texture3D * resource, |
||||
UINT subresource, |
||||
cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_0; |
||||
|
||||
typedef CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueAcquireD3D10ObjectsKHR_fn)( |
||||
cl_command_queue command_queue, |
||||
cl_uint num_objects, |
||||
const cl_mem * mem_objects, |
||||
cl_uint num_events_in_wait_list, |
||||
const cl_event * event_wait_list, |
||||
cl_event * event) CL_API_SUFFIX__VERSION_1_0; |
||||
|
||||
typedef CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueReleaseD3D10ObjectsKHR_fn)( |
||||
cl_command_queue command_queue, |
||||
cl_uint num_objects, |
||||
const cl_mem * mem_objects, |
||||
cl_uint num_events_in_wait_list, |
||||
const cl_event * event_wait_list, |
||||
cl_event * event) CL_API_SUFFIX__VERSION_1_0; |
||||
|
||||
#ifdef __cplusplus |
||||
} |
||||
#endif |
||||
|
||||
#endif // __OPENCL_CL_D3D10_H
|
||||
|
@ -0,0 +1,126 @@ |
||||
/**********************************************************************************
|
||||
* Copyright (c) 2008-2012 The Khronos Group Inc. |
||||
* |
||||
* Permission is hereby granted, free of charge, to any person obtaining a |
||||
* copy of this software and/or associated documentation files (the |
||||
* "Materials"), to deal in the Materials without restriction, including |
||||
* without limitation the rights to use, copy, modify, merge, publish, |
||||
* distribute, sublicense, and/or sell copies of the Materials, and to |
||||
* permit persons to whom the Materials are furnished to do so, subject to |
||||
* the following conditions: |
||||
* |
||||
* The above copyright notice and this permission notice shall be included |
||||
* in all copies or substantial portions of the Materials. |
||||
* |
||||
* THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
||||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. |
||||
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY |
||||
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, |
||||
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE |
||||
* MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. |
||||
**********************************************************************************/ |
||||
|
||||
/* $Revision: 11708 $ on $Date: 2010-06-13 23:36:24 -0700 (Sun, 13 Jun 2010) $ */ |
||||
|
||||
#ifndef __OPENCL_CL_D3D11_H |
||||
#define __OPENCL_CL_D3D11_H |
||||
|
||||
#include <d3d11.h> |
||||
#include <CL/cl.h> |
||||
#include <CL/cl_platform.h> |
||||
|
||||
#ifdef __cplusplus |
||||
extern "C" { |
||||
#endif |
||||
|
||||
/******************************************************************************
|
||||
* cl_khr_d3d11_sharing */ |
||||
#define cl_khr_d3d11_sharing 1 |
||||
|
||||
typedef cl_uint cl_d3d11_device_source_khr; |
||||
typedef cl_uint cl_d3d11_device_set_khr; |
||||
|
||||
/******************************************************************************/ |
||||
|
||||
// Error Codes
|
||||
#define CL_INVALID_D3D11_DEVICE_KHR -1006 |
||||
#define CL_INVALID_D3D11_RESOURCE_KHR -1007 |
||||
#define CL_D3D11_RESOURCE_ALREADY_ACQUIRED_KHR -1008 |
||||
#define CL_D3D11_RESOURCE_NOT_ACQUIRED_KHR -1009 |
||||
|
||||
// cl_d3d11_device_source
|
||||
#define CL_D3D11_DEVICE_KHR 0x4019 |
||||
#define CL_D3D11_DXGI_ADAPTER_KHR 0x401A |
||||
|
||||
// cl_d3d11_device_set
|
||||
#define CL_PREFERRED_DEVICES_FOR_D3D11_KHR 0x401B |
||||
#define CL_ALL_DEVICES_FOR_D3D11_KHR 0x401C |
||||
|
||||
// cl_context_info
|
||||
#define CL_CONTEXT_D3D11_DEVICE_KHR 0x401D |
||||
#define CL_CONTEXT_D3D11_PREFER_SHARED_RESOURCES_KHR 0x402D |
||||
|
||||
// cl_mem_info
|
||||
#define CL_MEM_D3D11_RESOURCE_KHR 0x401E |
||||
|
||||
// cl_image_info
|
||||
#define CL_IMAGE_D3D11_SUBRESOURCE_KHR 0x401F |
||||
|
||||
// cl_command_type
|
||||
#define CL_COMMAND_ACQUIRE_D3D11_OBJECTS_KHR 0x4020 |
||||
#define CL_COMMAND_RELEASE_D3D11_OBJECTS_KHR 0x4021 |
||||
|
||||
/******************************************************************************/ |
||||
|
||||
typedef CL_API_ENTRY cl_int (CL_API_CALL *clGetDeviceIDsFromD3D11KHR_fn)( |
||||
cl_platform_id platform, |
||||
cl_d3d11_device_source_khr d3d_device_source, |
||||
void * d3d_object, |
||||
cl_d3d11_device_set_khr d3d_device_set, |
||||
cl_uint num_entries, |
||||
cl_device_id * devices, |
||||
cl_uint * num_devices) CL_API_SUFFIX__VERSION_1_2; |
||||
|
||||
typedef CL_API_ENTRY cl_mem (CL_API_CALL *clCreateFromD3D11BufferKHR_fn)( |
||||
cl_context context, |
||||
cl_mem_flags flags, |
||||
ID3D11Buffer * resource, |
||||
cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_2; |
||||
|
||||
typedef CL_API_ENTRY cl_mem (CL_API_CALL *clCreateFromD3D11Texture2DKHR_fn)( |
||||
cl_context context, |
||||
cl_mem_flags flags, |
||||
ID3D11Texture2D * resource, |
||||
UINT subresource, |
||||
cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_2; |
||||
|
||||
typedef CL_API_ENTRY cl_mem (CL_API_CALL *clCreateFromD3D11Texture3DKHR_fn)( |
||||
cl_context context, |
||||
cl_mem_flags flags, |
||||
ID3D11Texture3D * resource, |
||||
UINT subresource, |
||||
cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_2; |
||||
|
||||
typedef CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueAcquireD3D11ObjectsKHR_fn)( |
||||
cl_command_queue command_queue, |
||||
cl_uint num_objects, |
||||
const cl_mem * mem_objects, |
||||
cl_uint num_events_in_wait_list, |
||||
const cl_event * event_wait_list, |
||||
cl_event * event) CL_API_SUFFIX__VERSION_1_2; |
||||
|
||||
typedef CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueReleaseD3D11ObjectsKHR_fn)( |
||||
cl_command_queue command_queue, |
||||
cl_uint num_objects, |
||||
const cl_mem * mem_objects, |
||||
cl_uint num_events_in_wait_list, |
||||
const cl_event * event_wait_list, |
||||
cl_event * event) CL_API_SUFFIX__VERSION_1_2; |
||||
|
||||
#ifdef __cplusplus |
||||
} |
||||
#endif |
||||
|
||||
#endif // __OPENCL_CL_D3D11_H
|
||||
|
@ -0,0 +1,127 @@ |
||||
/**********************************************************************************
|
||||
* Copyright (c) 2008-2012 The Khronos Group Inc. |
||||
* |
||||
* Permission is hereby granted, free of charge, to any person obtaining a |
||||
* copy of this software and/or associated documentation files (the |
||||
* "Materials"), to deal in the Materials without restriction, including |
||||
* without limitation the rights to use, copy, modify, merge, publish, |
||||
* distribute, sublicense, and/or sell copies of the Materials, and to |
||||
* permit persons to whom the Materials are furnished to do so, subject to |
||||
* the following conditions: |
||||
* |
||||
* The above copyright notice and this permission notice shall be included |
||||
* in all copies or substantial portions of the Materials. |
||||
* |
||||
* THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
||||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. |
||||
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY |
||||
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, |
||||
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE |
||||
* MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. |
||||
**********************************************************************************/ |
||||
|
||||
/* $Revision: 11708 $ on $Date: 2010-06-13 23:36:24 -0700 (Sun, 13 Jun 2010) $ */ |
||||
|
||||
#ifndef __OPENCL_CL_DX9_MEDIA_SHARING_H |
||||
#define __OPENCL_CL_DX9_MEDIA_SHARING_H |
||||
|
||||
#include <CL/cl.h> |
||||
#include <CL/cl_platform.h> |
||||
|
||||
#ifdef __cplusplus |
||||
extern "C" { |
||||
#endif |
||||
|
||||
/******************************************************************************
|
||||
/* cl_khr_dx9_media_sharing */ |
||||
#define cl_khr_dx9_media_sharing 1 |
||||
|
||||
typedef cl_uint cl_dx9_media_adapter_type_khr; |
||||
typedef cl_uint cl_dx9_media_adapter_set_khr; |
||||
|
||||
#if defined(_WIN32) |
||||
#include <d3d9.h> |
||||
typedef struct _cl_dx9_surface_info_khr |
||||
{ |
||||
IDirect3DSurface9 *resource; |
||||
HANDLE shared_handle; |
||||
} cl_dx9_surface_info_khr; |
||||
#endif |
||||
|
||||
|
||||
/******************************************************************************/ |
||||
|
||||
// Error Codes
|
||||
#define CL_INVALID_DX9_MEDIA_ADAPTER_KHR -1010 |
||||
#define CL_INVALID_DX9_MEDIA_SURFACE_KHR -1011 |
||||
#define CL_DX9_MEDIA_SURFACE_ALREADY_ACQUIRED_KHR -1012 |
||||
#define CL_DX9_MEDIA_SURFACE_NOT_ACQUIRED_KHR -1013 |
||||
|
||||
// cl_media_adapter_type_khr
|
||||
#define CL_ADAPTER_D3D9_KHR 0x2020 |
||||
#define CL_ADAPTER_D3D9EX_KHR 0x2021 |
||||
#define CL_ADAPTER_DXVA_KHR 0x2022 |
||||
|
||||
// cl_media_adapter_set_khr
|
||||
#define CL_PREFERRED_DEVICES_FOR_DX9_MEDIA_ADAPTER_KHR 0x2023 |
||||
#define CL_ALL_DEVICES_FOR_DX9_MEDIA_ADAPTER_KHR 0x2024 |
||||
|
||||
// cl_context_info
|
||||
#define CL_CONTEXT_ADAPTER_D3D9_KHR 0x2025 |
||||
#define CL_CONTEXT_ADAPTER_D3D9EX_KHR 0x2026 |
||||
#define CL_CONTEXT_ADAPTER_DXVA_KHR 0x2027 |
||||
|
||||
// cl_mem_info
|
||||
#define CL_MEM_DX9_MEDIA_ADAPTER_TYPE_KHR 0x2028 |
||||
#define CL_MEM_DX9_MEDIA_SURFACE_INFO_KHR 0x2029 |
||||
|
||||
// cl_image_info
|
||||
#define CL_IMAGE_DX9_MEDIA_PLANE_KHR 0x202A |
||||
|
||||
// cl_command_type
|
||||
#define CL_COMMAND_ACQUIRE_DX9_MEDIA_SURFACES_KHR 0x202B |
||||
#define CL_COMMAND_RELEASE_DX9_MEDIA_SURFACES_KHR 0x202C |
||||
|
||||
/******************************************************************************/ |
||||
|
||||
typedef CL_API_ENTRY cl_int (CL_API_CALL *clGetDeviceIDsFromDX9MediaAdapterKHR_fn)( |
||||
cl_platform_id platform, |
||||
cl_uint num_media_adapters, |
||||
cl_dx9_media_adapter_type_khr * media_adapter_type, |
||||
void * media_adapters, |
||||
cl_dx9_media_adapter_set_khr media_adapter_set, |
||||
cl_uint num_entries, |
||||
cl_device_id * devices, |
||||
cl_uint * num_devices) CL_API_SUFFIX__VERSION_1_2; |
||||
|
||||
typedef CL_API_ENTRY cl_mem (CL_API_CALL *clCreateFromDX9MediaSurfaceKHR_fn)( |
||||
cl_context context, |
||||
cl_mem_flags flags, |
||||
cl_dx9_media_adapter_type_khr adapter_type, |
||||
void * surface_info, |
||||
cl_uint plane,
|
||||
cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_2; |
||||
|
||||
typedef CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueAcquireDX9MediaSurfacesKHR_fn)( |
||||
cl_command_queue command_queue, |
||||
cl_uint num_objects, |
||||
const cl_mem * mem_objects, |
||||
cl_uint num_events_in_wait_list, |
||||
const cl_event * event_wait_list, |
||||
cl_event * event) CL_API_SUFFIX__VERSION_1_2; |
||||
|
||||
typedef CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueReleaseDX9MediaSurfacesKHR_fn)( |
||||
cl_command_queue command_queue, |
||||
cl_uint num_objects, |
||||
const cl_mem * mem_objects, |
||||
cl_uint num_events_in_wait_list, |
||||
const cl_event * event_wait_list, |
||||
cl_event * event) CL_API_SUFFIX__VERSION_1_2; |
||||
|
||||
#ifdef __cplusplus |
||||
} |
||||
#endif |
||||
|
||||
#endif // __OPENCL_CL_DX9_MEDIA_SHARING_H
|
||||
|
@ -0,0 +1,131 @@ |
||||
/*******************************************************************************
|
||||
* Copyright (c) 2008-2010 The Khronos Group Inc. |
||||
* |
||||
* Permission is hereby granted, free of charge, to any person obtaining a |
||||
* copy of this software and/or associated documentation files (the |
||||
* "Materials"), to deal in the Materials without restriction, including |
||||
* without limitation the rights to use, copy, modify, merge, publish, |
||||
* distribute, sublicense, and/or sell copies of the Materials, and to |
||||
* permit persons to whom the Materials are furnished to do so, subject to |
||||
* the following conditions: |
||||
* |
||||
* The above copyright notice and this permission notice shall be included |
||||
* in all copies or substantial portions of the Materials. |
||||
* |
||||
* THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
||||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. |
||||
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY |
||||
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, |
||||
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE |
||||
* MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. |
||||
******************************************************************************/ |
||||
|
||||
#ifndef __OPENCL_CL_EGL_H |
||||
#define __OPENCL_CL_EGL_H |
||||
|
||||
#ifdef __APPLE__ |
||||
|
||||
#else |
||||
#include <CL/cl.h> |
||||
#include <EGL/egl.h> |
||||
#include <EGL/eglext.h> |
||||
#endif |
||||
|
||||
#ifdef __cplusplus |
||||
extern "C" { |
||||
#endif |
||||
|
||||
|
||||
/* Command type for events created with clEnqueueAcquireEGLObjectsKHR */ |
||||
#define CL_COMMAND_EGL_FENCE_SYNC_OBJECT_KHR 0x202F |
||||
#define CL_COMMAND_ACQUIRE_EGL_OBJECTS_KHR 0x202D |
||||
#define CL_COMMAND_RELEASE_EGL_OBJECTS_KHR 0x202E |
||||
|
||||
/* Error type for clCreateFromEGLImageKHR */ |
||||
#define CL_INVALID_EGL_OBJECT_KHR -1093 |
||||
#define CL_EGL_RESOURCE_NOT_ACQUIRED_KHR -1092 |
||||
|
||||
/* CLeglImageKHR is an opaque handle to an EGLImage */ |
||||
typedef void* CLeglImageKHR; |
||||
|
||||
/* CLeglDisplayKHR is an opaque handle to an EGLDisplay */ |
||||
typedef void* CLeglDisplayKHR; |
||||
|
||||
/* properties passed to clCreateFromEGLImageKHR */ |
||||
typedef intptr_t cl_egl_image_properties_khr; |
||||
|
||||
|
||||
#define cl_khr_egl_image 1 |
||||
|
||||
extern CL_API_ENTRY cl_mem CL_API_CALL |
||||
clCreateFromEGLImageKHR(cl_context /* context */, |
||||
CLeglDisplayKHR /* egldisplay */, |
||||
CLeglImageKHR /* eglimage */, |
||||
cl_mem_flags /* flags */, |
||||
const cl_egl_image_properties_khr * /* properties */, |
||||
cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0; |
||||
|
||||
typedef CL_API_ENTRY cl_mem (CL_API_CALL *clCreateFromEGLImageKHR_fn)( |
||||
cl_context context, |
||||
CLeglDisplayKHR egldisplay, |
||||
CLeglImageKHR eglimage, |
||||
cl_mem_flags flags, |
||||
const cl_egl_image_properties_khr * properties, |
||||
cl_int * errcode_ret); |
||||
|
||||
|
||||
extern CL_API_ENTRY cl_int CL_API_CALL |
||||
clEnqueueAcquireEGLObjectsKHR(cl_command_queue /* command_queue */, |
||||
cl_uint /* num_objects */, |
||||
const cl_mem * /* mem_objects */, |
||||
cl_uint /* num_events_in_wait_list */, |
||||
const cl_event * /* event_wait_list */, |
||||
cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0; |
||||
|
||||
typedef CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueAcquireEGLObjectsKHR_fn)( |
||||
cl_command_queue command_queue, |
||||
cl_uint num_objects, |
||||
const cl_mem * mem_objects, |
||||
cl_uint num_events_in_wait_list, |
||||
const cl_event * event_wait_list, |
||||
cl_event * event); |
||||
|
||||
|
||||
extern CL_API_ENTRY cl_int CL_API_CALL |
||||
clEnqueueReleaseEGLObjectsKHR(cl_command_queue /* command_queue */, |
||||
cl_uint /* num_objects */, |
||||
const cl_mem * /* mem_objects */, |
||||
cl_uint /* num_events_in_wait_list */, |
||||
const cl_event * /* event_wait_list */, |
||||
cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0; |
||||
|
||||
typedef CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueReleaseEGLObjectsKHR_fn)( |
||||
cl_command_queue command_queue, |
||||
cl_uint num_objects, |
||||
const cl_mem * mem_objects, |
||||
cl_uint num_events_in_wait_list, |
||||
const cl_event * event_wait_list, |
||||
cl_event * event); |
||||
|
||||
|
||||
#define cl_khr_egl_event 1 |
||||
|
||||
extern CL_API_ENTRY cl_event CL_API_CALL |
||||
clCreateEventFromEGLSyncKHR(cl_context /* context */, |
||||
EGLSyncKHR /* sync */, |
||||
EGLDisplay /* display */, |
||||
cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0; |
||||
|
||||
typedef CL_API_ENTRY cl_event (CL_API_CALL *clCreateEventFromEGLSyncKHR_fn)( |
||||
cl_context context, |
||||
EGLSyncKHR sync, |
||||
EGLDisplay display, |
||||
cl_int * errcode_ret); |
||||
|
||||
|
||||
#ifdef __cplusplus |
||||
} |
||||
#endif |
||||
|
||||
#endif /* __OPENCL_CL_EGL_H */ |
@ -0,0 +1,306 @@ |
||||
/*******************************************************************************
|
||||
* Copyright (c) 2008-2013 The Khronos Group Inc. |
||||
* |
||||
* Permission is hereby granted, free of charge, to any person obtaining a |
||||
* copy of this software and/or associated documentation files (the |
||||
* "Materials"), to deal in the Materials without restriction, including |
||||
* without limitation the rights to use, copy, modify, merge, publish, |
||||
* distribute, sublicense, and/or sell copies of the Materials, and to |
||||
* permit persons to whom the Materials are furnished to do so, subject to |
||||
* the following conditions: |
||||
* |
||||
* The above copyright notice and this permission notice shall be included |
||||
* in all copies or substantial portions of the Materials. |
||||
* |
||||
* THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
||||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. |
||||
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY |
||||
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, |
||||
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE |
||||
* MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. |
||||
******************************************************************************/ |
||||
|
||||
/* $Revision: 11928 $ on $Date: 2010-07-13 09:04:56 -0700 (Tue, 13 Jul 2010) $ */ |
||||
|
||||
/* cl_ext.h contains OpenCL extensions which don't have external */ |
||||
/* (OpenGL, D3D) dependencies. */ |
||||
|
||||
#ifndef __CL_EXT_H |
||||
#define __CL_EXT_H |
||||
|
||||
#ifdef __cplusplus |
||||
extern "C" { |
||||
#endif |
||||
|
||||
#ifdef __APPLE__ |
||||
#include <OpenCL/cl.h> |
||||
#include <AvailabilityMacros.h> |
||||
#else |
||||
#include <CL/cl.h> |
||||
#endif |
||||
|
||||
/* cl_khr_fp16 extension - no extension #define since it has no functions */ |
||||
#define CL_DEVICE_HALF_FP_CONFIG 0x1033 |
||||
|
||||
/* Memory object destruction
|
||||
* |
||||
* Apple extension for use to manage externally allocated buffers used with cl_mem objects with CL_MEM_USE_HOST_PTR |
||||
* |
||||
* Registers a user callback function that will be called when the memory object is deleted and its resources
|
||||
* freed. Each call to clSetMemObjectCallbackFn registers the specified user callback function on a callback
|
||||
* stack associated with memobj. The registered user callback functions are called in the reverse order in
|
||||
* which they were registered. The user callback functions are called and then the memory object is deleted
|
||||
* and its resources freed. This provides a mechanism for the application (and libraries) using memobj to be
|
||||
* notified when the memory referenced by host_ptr, specified when the memory object is created and used as
|
||||
* the storage bits for the memory object, can be reused or freed. |
||||
* |
||||
* The application may not call CL api's with the cl_mem object passed to the pfn_notify. |
||||
* |
||||
* Please check for the "cl_APPLE_SetMemObjectDestructor" extension using clGetDeviceInfo(CL_DEVICE_EXTENSIONS) |
||||
* before using. |
||||
*/ |
||||
#define cl_APPLE_SetMemObjectDestructor 1 |
||||
cl_int CL_API_ENTRY clSetMemObjectDestructorAPPLE( cl_mem /* memobj */,
|
||||
void (* /*pfn_notify*/)( cl_mem /* memobj */, void* /*user_data*/),
|
||||
void * /*user_data */ ) CL_EXT_SUFFIX__VERSION_1_0;
|
||||
|
||||
|
||||
/* Context Logging Functions
|
||||
* |
||||
* The next three convenience functions are intended to be used as the pfn_notify parameter to clCreateContext(). |
||||
* Please check for the "cl_APPLE_ContextLoggingFunctions" extension using clGetDeviceInfo(CL_DEVICE_EXTENSIONS) |
||||
* before using. |
||||
* |
||||
* clLogMessagesToSystemLog fowards on all log messages to the Apple System Logger
|
||||
*/ |
||||
#define cl_APPLE_ContextLoggingFunctions 1 |
||||
extern void CL_API_ENTRY clLogMessagesToSystemLogAPPLE( const char * /* errstr */,
|
||||
const void * /* private_info */,
|
||||
size_t /* cb */,
|
||||
void * /* user_data */ ) CL_EXT_SUFFIX__VERSION_1_0; |
||||
|
||||
/* clLogMessagesToStdout sends all log messages to the file descriptor stdout */ |
||||
extern void CL_API_ENTRY clLogMessagesToStdoutAPPLE( const char * /* errstr */,
|
||||
const void * /* private_info */,
|
||||
size_t /* cb */,
|
||||
void * /* user_data */ ) CL_EXT_SUFFIX__VERSION_1_0; |
||||
|
||||
/* clLogMessagesToStderr sends all log messages to the file descriptor stderr */ |
||||
extern void CL_API_ENTRY clLogMessagesToStderrAPPLE( const char * /* errstr */,
|
||||
const void * /* private_info */,
|
||||
size_t /* cb */,
|
||||
void * /* user_data */ ) CL_EXT_SUFFIX__VERSION_1_0; |
||||
|
||||
|
||||
/************************
|
||||
* cl_khr_icd extension *
|
||||
************************/ |
||||
#define cl_khr_icd 1 |
||||
|
||||
/* cl_platform_info */ |
||||
#define CL_PLATFORM_ICD_SUFFIX_KHR 0x0920 |
||||
|
||||
/* Additional Error Codes */ |
||||
#define CL_PLATFORM_NOT_FOUND_KHR -1001 |
||||
|
||||
extern CL_API_ENTRY cl_int CL_API_CALL |
||||
clIcdGetPlatformIDsKHR(cl_uint /* num_entries */, |
||||
cl_platform_id * /* platforms */, |
||||
cl_uint * /* num_platforms */); |
||||
|
||||
typedef CL_API_ENTRY cl_int (CL_API_CALL *clIcdGetPlatformIDsKHR_fn)( |
||||
cl_uint /* num_entries */, |
||||
cl_platform_id * /* platforms */, |
||||
cl_uint * /* num_platforms */); |
||||
|
||||
|
||||
/* Extension: cl_khr_image2D_buffer
|
||||
* |
||||
* This extension allows a 2D image to be created from a cl_mem buffer without a copy. |
||||
* The type associated with a 2D image created from a buffer in an OpenCL program is image2d_t. |
||||
* Both the sampler and sampler-less read_image built-in functions are supported for 2D images |
||||
* and 2D images created from a buffer. Similarly, the write_image built-ins are also supported |
||||
* for 2D images created from a buffer. |
||||
* |
||||
* When the 2D image from buffer is created, the client must specify the width, |
||||
* height, image format (i.e. channel order and channel data type) and optionally the row pitch |
||||
* |
||||
* The pitch specified must be a multiple of CL_DEVICE_IMAGE_PITCH_ALIGNMENT pixels. |
||||
* The base address of the buffer must be aligned to CL_DEVICE_IMAGE_BASE_ADDRESS_ALIGNMENT pixels. |
||||
*/ |
||||
|
||||
/*************************************
|
||||
* cl_khr_initalize_memory extension * |
||||
*************************************/ |
||||
|
||||
#define CL_CONTEXT_MEMORY_INITIALIZE_KHR 0x200E |
||||
|
||||
|
||||
/**************************************
|
||||
* cl_khr_terminate_context extension * |
||||
**************************************/ |
||||
|
||||
#define CL_DEVICE_TERMINATE_CAPABILITY_KHR 0x200F |
||||
#define CL_CONTEXT_TERMINATE_KHR 0x2010 |
||||
|
||||
#define cl_khr_terminate_context 1 |
||||
extern CL_API_ENTRY cl_int CL_API_CALL clTerminateContextKHR(cl_context /* context */) CL_EXT_SUFFIX__VERSION_1_2; |
||||
|
||||
typedef CL_API_ENTRY cl_int (CL_API_CALL *clTerminateContextKHR_fn)(cl_context /* context */) CL_EXT_SUFFIX__VERSION_1_2; |
||||
|
||||
|
||||
/*
|
||||
* Extension: cl_khr_spir |
||||
* |
||||
* This extension adds support to create an OpenCL program object from a
|
||||
* Standard Portable Intermediate Representation (SPIR) instance |
||||
*/ |
||||
|
||||
/******************************************
|
||||
* cl_nv_device_attribute_query extension * |
||||
******************************************/ |
||||
/* cl_nv_device_attribute_query extension - no extension #define since it has no functions */ |
||||
#define CL_DEVICE_COMPUTE_CAPABILITY_MAJOR_NV 0x4000 |
||||
#define CL_DEVICE_COMPUTE_CAPABILITY_MINOR_NV 0x4001 |
||||
#define CL_DEVICE_REGISTERS_PER_BLOCK_NV 0x4002 |
||||
#define CL_DEVICE_WARP_SIZE_NV 0x4003 |
||||
#define CL_DEVICE_GPU_OVERLAP_NV 0x4004 |
||||
#define CL_DEVICE_KERNEL_EXEC_TIMEOUT_NV 0x4005 |
||||
#define CL_DEVICE_INTEGRATED_MEMORY_NV 0x4006 |
||||
|
||||
/*********************************
|
||||
* cl_amd_device_attribute_query * |
||||
*********************************/ |
||||
#define CL_DEVICE_PROFILING_TIMER_OFFSET_AMD 0x4036 |
||||
|
||||
#ifdef CL_VERSION_1_1 |
||||
/***********************************
|
||||
* cl_ext_device_fission extension * |
||||
***********************************/ |
||||
#define cl_ext_device_fission 1 |
||||
|
||||
extern CL_API_ENTRY cl_int CL_API_CALL |
||||
clReleaseDeviceEXT( cl_device_id /*device*/ ) CL_EXT_SUFFIX__VERSION_1_1;
|
||||
|
||||
typedef CL_API_ENTRY cl_int
|
||||
(CL_API_CALL *clReleaseDeviceEXT_fn)( cl_device_id /*device*/ ) CL_EXT_SUFFIX__VERSION_1_1; |
||||
|
||||
extern CL_API_ENTRY cl_int CL_API_CALL |
||||
clRetainDeviceEXT( cl_device_id /*device*/ ) CL_EXT_SUFFIX__VERSION_1_1;
|
||||
|
||||
typedef CL_API_ENTRY cl_int
|
||||
(CL_API_CALL *clRetainDeviceEXT_fn)( cl_device_id /*device*/ ) CL_EXT_SUFFIX__VERSION_1_1; |
||||
|
||||
typedef cl_ulong cl_device_partition_property_ext; |
||||
extern CL_API_ENTRY cl_int CL_API_CALL |
||||
clCreateSubDevicesEXT( cl_device_id /*in_device*/, |
||||
const cl_device_partition_property_ext * /* properties */, |
||||
cl_uint /*num_entries*/, |
||||
cl_device_id * /*out_devices*/, |
||||
cl_uint * /*num_devices*/ ) CL_EXT_SUFFIX__VERSION_1_1; |
||||
|
||||
typedef CL_API_ENTRY cl_int
|
||||
( CL_API_CALL * clCreateSubDevicesEXT_fn)( cl_device_id /*in_device*/, |
||||
const cl_device_partition_property_ext * /* properties */, |
||||
cl_uint /*num_entries*/, |
||||
cl_device_id * /*out_devices*/, |
||||
cl_uint * /*num_devices*/ ) CL_EXT_SUFFIX__VERSION_1_1; |
||||
|
||||
/* cl_device_partition_property_ext */ |
||||
#define CL_DEVICE_PARTITION_EQUALLY_EXT 0x4050 |
||||
#define CL_DEVICE_PARTITION_BY_COUNTS_EXT 0x4051 |
||||
#define CL_DEVICE_PARTITION_BY_NAMES_EXT 0x4052 |
||||
#define CL_DEVICE_PARTITION_BY_AFFINITY_DOMAIN_EXT 0x4053 |
||||
|
||||
/* clDeviceGetInfo selectors */ |
||||
#define CL_DEVICE_PARENT_DEVICE_EXT 0x4054 |
||||
#define CL_DEVICE_PARTITION_TYPES_EXT 0x4055 |
||||
#define CL_DEVICE_AFFINITY_DOMAINS_EXT 0x4056 |
||||
#define CL_DEVICE_REFERENCE_COUNT_EXT 0x4057 |
||||
#define CL_DEVICE_PARTITION_STYLE_EXT 0x4058 |
||||
|
||||
/* error codes */ |
||||
#define CL_DEVICE_PARTITION_FAILED_EXT -1057 |
||||
#define CL_INVALID_PARTITION_COUNT_EXT -1058 |
||||
#define CL_INVALID_PARTITION_NAME_EXT -1059 |
||||
|
||||
/* CL_AFFINITY_DOMAINs */ |
||||
#define CL_AFFINITY_DOMAIN_L1_CACHE_EXT 0x1 |
||||
#define CL_AFFINITY_DOMAIN_L2_CACHE_EXT 0x2 |
||||
#define CL_AFFINITY_DOMAIN_L3_CACHE_EXT 0x3 |
||||
#define CL_AFFINITY_DOMAIN_L4_CACHE_EXT 0x4 |
||||
#define CL_AFFINITY_DOMAIN_NUMA_EXT 0x10 |
||||
#define CL_AFFINITY_DOMAIN_NEXT_FISSIONABLE_EXT 0x100 |
||||
|
||||
/* cl_device_partition_property_ext list terminators */ |
||||
#define CL_PROPERTIES_LIST_END_EXT ((cl_device_partition_property_ext) 0) |
||||
#define CL_PARTITION_BY_COUNTS_LIST_END_EXT ((cl_device_partition_property_ext) 0) |
||||
#define CL_PARTITION_BY_NAMES_LIST_END_EXT ((cl_device_partition_property_ext) 0 - 1) |
||||
|
||||
/*********************************
|
||||
* cl_qcom_ext_host_ptr extension |
||||
*********************************/ |
||||
|
||||
#define CL_MEM_EXT_HOST_PTR_QCOM (1 << 29) |
||||
|
||||
#define CL_DEVICE_EXT_MEM_PADDING_IN_BYTES_QCOM 0x40A0 |
||||
#define CL_DEVICE_PAGE_SIZE_QCOM 0x40A1 |
||||
#define CL_IMAGE_ROW_ALIGNMENT_QCOM 0x40A2 |
||||
#define CL_IMAGE_SLICE_ALIGNMENT_QCOM 0x40A3 |
||||
#define CL_MEM_HOST_UNCACHED_QCOM 0x40A4 |
||||
#define CL_MEM_HOST_WRITEBACK_QCOM 0x40A5 |
||||
#define CL_MEM_HOST_WRITETHROUGH_QCOM 0x40A6 |
||||
#define CL_MEM_HOST_WRITE_COMBINING_QCOM 0x40A7 |
||||
|
||||
typedef cl_uint cl_image_pitch_info_qcom; |
||||
|
||||
extern CL_API_ENTRY cl_int CL_API_CALL |
||||
clGetDeviceImageInfoQCOM(cl_device_id device, |
||||
size_t image_width, |
||||
size_t image_height, |
||||
const cl_image_format *image_format, |
||||
cl_image_pitch_info_qcom param_name, |
||||
size_t param_value_size, |
||||
void *param_value, |
||||
size_t *param_value_size_ret); |
||||
|
||||
typedef struct _cl_mem_ext_host_ptr |
||||
{ |
||||
// Type of external memory allocation.
|
||||
// Legal values will be defined in layered extensions.
|
||||
cl_uint allocation_type; |
||||
|
||||
// Host cache policy for this external memory allocation.
|
||||
cl_uint host_cache_policy; |
||||
|
||||
} cl_mem_ext_host_ptr; |
||||
|
||||
/*********************************
|
||||
* cl_qcom_ion_host_ptr extension |
||||
*********************************/ |
||||
|
||||
#define CL_MEM_ION_HOST_PTR_QCOM 0x40A8 |
||||
|
||||
typedef struct _cl_mem_ion_host_ptr |
||||
{ |
||||
// Type of external memory allocation.
|
||||
// Must be CL_MEM_ION_HOST_PTR_QCOM for ION allocations.
|
||||
cl_mem_ext_host_ptr ext_host_ptr; |
||||
|
||||
// ION file descriptor
|
||||
int ion_filedesc; |
||||
|
||||
// Host pointer to the ION allocated memory
|
||||
void* ion_hostptr; |
||||
|
||||
} cl_mem_ion_host_ptr; |
||||
|
||||
#endif /* CL_VERSION_1_1 */ |
||||
|
||||
#ifdef __cplusplus |
||||
} |
||||
#endif |
||||
|
||||
|
||||
#endif /* __CL_EXT_H */ |
@ -0,0 +1,162 @@ |
||||
/**********************************************************************************
|
||||
* Copyright (c) 2008 - 2012 The Khronos Group Inc. |
||||
* |
||||
* Permission is hereby granted, free of charge, to any person obtaining a |
||||
* copy of this software and/or associated documentation files (the |
||||
* "Materials"), to deal in the Materials without restriction, including |
||||
* without limitation the rights to use, copy, modify, merge, publish, |
||||
* distribute, sublicense, and/or sell copies of the Materials, and to |
||||
* permit persons to whom the Materials are furnished to do so, subject to |
||||
* the following conditions: |
||||
* |
||||
* The above copyright notice and this permission notice shall be included |
||||
* in all copies or substantial portions of the Materials. |
||||
* |
||||
* THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
||||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. |
||||
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY |
||||
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, |
||||
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE |
||||
* MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. |
||||
**********************************************************************************/ |
||||
|
||||
#ifndef __OPENCL_CL_GL_H |
||||
#define __OPENCL_CL_GL_H |
||||
|
||||
#ifdef __APPLE__ |
||||
#include <OpenCL/cl.h> |
||||
#else |
||||
#include <CL/cl.h> |
||||
#endif |
||||
|
||||
#ifdef __cplusplus |
||||
extern "C" { |
||||
#endif |
||||
|
||||
typedef cl_uint cl_gl_object_type; |
||||
typedef cl_uint cl_gl_texture_info; |
||||
typedef cl_uint cl_gl_platform_info; |
||||
typedef struct __GLsync *cl_GLsync; |
||||
|
||||
/* cl_gl_object_type = 0x2000 - 0x200F enum values are currently taken */ |
||||
#define CL_GL_OBJECT_BUFFER 0x2000 |
||||
#define CL_GL_OBJECT_TEXTURE2D 0x2001 |
||||
#define CL_GL_OBJECT_TEXTURE3D 0x2002 |
||||
#define CL_GL_OBJECT_RENDERBUFFER 0x2003 |
||||
#define CL_GL_OBJECT_TEXTURE2D_ARRAY 0x200E |
||||
#define CL_GL_OBJECT_TEXTURE1D 0x200F |
||||
#define CL_GL_OBJECT_TEXTURE1D_ARRAY 0x2010 |
||||
#define CL_GL_OBJECT_TEXTURE_BUFFER 0x2011 |
||||
|
||||
/* cl_gl_texture_info */ |
||||
#define CL_GL_TEXTURE_TARGET 0x2004 |
||||
#define CL_GL_MIPMAP_LEVEL 0x2005 |
||||
#define CL_GL_NUM_SAMPLES 0x2012 |
||||
|
||||
|
||||
extern CL_API_ENTRY cl_mem CL_API_CALL |
||||
clCreateFromGLBuffer(cl_context /* context */, |
||||
cl_mem_flags /* flags */, |
||||
cl_GLuint /* bufobj */, |
||||
int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0; |
||||
|
||||
extern CL_API_ENTRY cl_mem CL_API_CALL |
||||
clCreateFromGLTexture(cl_context /* context */, |
||||
cl_mem_flags /* flags */, |
||||
cl_GLenum /* target */, |
||||
cl_GLint /* miplevel */, |
||||
cl_GLuint /* texture */, |
||||
cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_2; |
||||
|
||||
extern CL_API_ENTRY cl_mem CL_API_CALL |
||||
clCreateFromGLRenderbuffer(cl_context /* context */, |
||||
cl_mem_flags /* flags */, |
||||
cl_GLuint /* renderbuffer */, |
||||
cl_int * /* errcode_ret */) CL_API_SUFFIX__VERSION_1_0; |
||||
|
||||
extern CL_API_ENTRY cl_int CL_API_CALL |
||||
clGetGLObjectInfo(cl_mem /* memobj */, |
||||
cl_gl_object_type * /* gl_object_type */, |
||||
cl_GLuint * /* gl_object_name */) CL_API_SUFFIX__VERSION_1_0; |
||||
|
||||
extern CL_API_ENTRY cl_int CL_API_CALL |
||||
clGetGLTextureInfo(cl_mem /* memobj */, |
||||
cl_gl_texture_info /* param_name */, |
||||
size_t /* param_value_size */, |
||||
void * /* param_value */, |
||||
size_t * /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0; |
||||
|
||||
extern CL_API_ENTRY cl_int CL_API_CALL |
||||
clEnqueueAcquireGLObjects(cl_command_queue /* command_queue */, |
||||
cl_uint /* num_objects */, |
||||
const cl_mem * /* mem_objects */, |
||||
cl_uint /* num_events_in_wait_list */, |
||||
const cl_event * /* event_wait_list */, |
||||
cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0; |
||||
|
||||
extern CL_API_ENTRY cl_int CL_API_CALL |
||||
clEnqueueReleaseGLObjects(cl_command_queue /* command_queue */, |
||||
cl_uint /* num_objects */, |
||||
const cl_mem * /* mem_objects */, |
||||
cl_uint /* num_events_in_wait_list */, |
||||
const cl_event * /* event_wait_list */, |
||||
cl_event * /* event */) CL_API_SUFFIX__VERSION_1_0; |
||||
|
||||
|
||||
// Deprecated OpenCL 1.1 APIs
|
||||
extern CL_API_ENTRY CL_EXT_PREFIX__VERSION_1_1_DEPRECATED cl_mem CL_API_CALL |
||||
clCreateFromGLTexture2D(cl_context /* context */, |
||||
cl_mem_flags /* flags */, |
||||
cl_GLenum /* target */, |
||||
cl_GLint /* miplevel */, |
||||
cl_GLuint /* texture */, |
||||
cl_int * /* errcode_ret */) CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED; |
||||
|
||||
extern CL_API_ENTRY CL_EXT_PREFIX__VERSION_1_1_DEPRECATED cl_mem CL_API_CALL |
||||
clCreateFromGLTexture3D(cl_context /* context */, |
||||
cl_mem_flags /* flags */, |
||||
cl_GLenum /* target */, |
||||
cl_GLint /* miplevel */, |
||||
cl_GLuint /* texture */, |
||||
cl_int * /* errcode_ret */) CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED; |
||||
|
||||
/* cl_khr_gl_sharing extension */ |
||||
|
||||
#define cl_khr_gl_sharing 1 |
||||
|
||||
typedef cl_uint cl_gl_context_info; |
||||
|
||||
/* Additional Error Codes */ |
||||
#define CL_INVALID_GL_SHAREGROUP_REFERENCE_KHR -1000 |
||||
|
||||
/* cl_gl_context_info */ |
||||
#define CL_CURRENT_DEVICE_FOR_GL_CONTEXT_KHR 0x2006 |
||||
#define CL_DEVICES_FOR_GL_CONTEXT_KHR 0x2007 |
||||
|
||||
/* Additional cl_context_properties */ |
||||
#define CL_GL_CONTEXT_KHR 0x2008 |
||||
#define CL_EGL_DISPLAY_KHR 0x2009 |
||||
#define CL_GLX_DISPLAY_KHR 0x200A |
||||
#define CL_WGL_HDC_KHR 0x200B |
||||
#define CL_CGL_SHAREGROUP_KHR 0x200C |
||||
|
||||
extern CL_API_ENTRY cl_int CL_API_CALL |
||||
clGetGLContextInfoKHR(const cl_context_properties * /* properties */, |
||||
cl_gl_context_info /* param_name */, |
||||
size_t /* param_value_size */, |
||||
void * /* param_value */, |
||||
size_t * /* param_value_size_ret */) CL_API_SUFFIX__VERSION_1_0; |
||||
|
||||
typedef CL_API_ENTRY cl_int (CL_API_CALL *clGetGLContextInfoKHR_fn)( |
||||
const cl_context_properties * properties, |
||||
cl_gl_context_info param_name, |
||||
size_t param_value_size, |
||||
void * param_value, |
||||
size_t * param_value_size_ret); |
||||
|
||||
#ifdef __cplusplus |
||||
} |
||||
#endif |
||||
|
||||
#endif /* __OPENCL_CL_GL_H */ |
@ -0,0 +1,69 @@ |
||||
/**********************************************************************************
|
||||
* Copyright (c) 2008-2012 The Khronos Group Inc. |
||||
* |
||||
* Permission is hereby granted, free of charge, to any person obtaining a |
||||
* copy of this software and/or associated documentation files (the |
||||
* "Materials"), to deal in the Materials without restriction, including |
||||
* without limitation the rights to use, copy, modify, merge, publish, |
||||
* distribute, sublicense, and/or sell copies of the Materials, and to |
||||
* permit persons to whom the Materials are furnished to do so, subject to |
||||
* the following conditions: |
||||
* |
||||
* The above copyright notice and this permission notice shall be included |
||||
* in all copies or substantial portions of the Materials. |
||||
* |
||||
* THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
||||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. |
||||
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY |
||||
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, |
||||
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE |
||||
* MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. |
||||
**********************************************************************************/ |
||||
|
||||
/* $Revision: 11708 $ on $Date: 2010-06-13 23:36:24 -0700 (Sun, 13 Jun 2010) $ */ |
||||
|
||||
/* cl_gl_ext.h contains vendor (non-KHR) OpenCL extensions which have */ |
||||
/* OpenGL dependencies. */ |
||||
|
||||
#ifndef __OPENCL_CL_GL_EXT_H |
||||
#define __OPENCL_CL_GL_EXT_H |
||||
|
||||
#ifdef __cplusplus |
||||
extern "C" { |
||||
#endif |
||||
|
||||
#ifdef __APPLE__ |
||||
#include <OpenCL/cl_gl.h> |
||||
#else |
||||
#include <CL/cl_gl.h> |
||||
#endif |
||||
|
||||
/*
|
||||
* For each extension, follow this template |
||||
* cl_VEN_extname extension */ |
||||
/* #define cl_VEN_extname 1
|
||||
* ... define new types, if any |
||||
* ... define new tokens, if any |
||||
* ... define new APIs, if any |
||||
* |
||||
* If you need GLtypes here, mirror them with a cl_GLtype, rather than including a GL header |
||||
* This allows us to avoid having to decide whether to include GL headers or GLES here. |
||||
*/ |
||||
|
||||
/*
|
||||
* cl_khr_gl_event extension |
||||
* See section 9.9 in the OpenCL 1.1 spec for more information |
||||
*/ |
||||
#define CL_COMMAND_GL_FENCE_SYNC_OBJECT_KHR 0x200D |
||||
|
||||
extern CL_API_ENTRY cl_event CL_API_CALL |
||||
clCreateEventFromGLsyncKHR(cl_context /* context */, |
||||
cl_GLsync /* cl_GLsync */, |
||||
cl_int * /* errcode_ret */) CL_EXT_SUFFIX__VERSION_1_1; |
||||
|
||||
#ifdef __cplusplus |
||||
} |
||||
#endif |
||||
|
||||
#endif /* __OPENCL_CL_GL_EXT_H */ |
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,54 @@ |
||||
/*******************************************************************************
|
||||
* Copyright (c) 2008-2012 The Khronos Group Inc. |
||||
* |
||||
* Permission is hereby granted, free of charge, to any person obtaining a |
||||
* copy of this software and/or associated documentation files (the |
||||
* "Materials"), to deal in the Materials without restriction, including |
||||
* without limitation the rights to use, copy, modify, merge, publish, |
||||
* distribute, sublicense, and/or sell copies of the Materials, and to |
||||
* permit persons to whom the Materials are furnished to do so, subject to |
||||
* the following conditions: |
||||
* |
||||
* The above copyright notice and this permission notice shall be included |
||||
* in all copies or substantial portions of the Materials. |
||||
* |
||||
* THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
||||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. |
||||
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY |
||||
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, |
||||
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE |
||||
* MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. |
||||
******************************************************************************/ |
||||
|
||||
/* $Revision: 11708 $ on $Date: 2010-06-13 23:36:24 -0700 (Sun, 13 Jun 2010) $ */ |
||||
|
||||
#ifndef __OPENCL_H |
||||
#define __OPENCL_H |
||||
|
||||
#ifdef __cplusplus |
||||
extern "C" { |
||||
#endif |
||||
|
||||
#ifdef __APPLE__ |
||||
|
||||
#include <OpenCL/cl.h> |
||||
#include <OpenCL/cl_gl.h> |
||||
#include <OpenCL/cl_gl_ext.h> |
||||
#include <OpenCL/cl_ext.h> |
||||
|
||||
#else |
||||
|
||||
#include <CL/cl.h> |
||||
#include <CL/cl_gl.h> |
||||
#include <CL/cl_gl_ext.h> |
||||
#include <CL/cl_ext.h> |
||||
|
||||
#endif |
||||
|
||||
#ifdef __cplusplus |
||||
} |
||||
#endif |
||||
|
||||
#endif /* __OPENCL_H */ |
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,24 @@ |
||||
#if defined __APPLE__ |
||||
#include <OpenCL/cl.h> |
||||
#else |
||||
#include <CL/cl.h> |
||||
#endif |
||||
|
||||
#ifndef _MSC_VER |
||||
#ifdef CL_VERSION_1_2 |
||||
#error OpenCL is valid |
||||
#else |
||||
#error OpenCL check failed |
||||
#endif |
||||
#else |
||||
#ifdef CL_VERSION_1_2 |
||||
#pragma message ("OpenCL is valid") |
||||
#else |
||||
#pragma message ("OpenCL check failed") |
||||
#endif |
||||
#endif |
||||
|
||||
int main(int /*argc*/, char** /*argv*/) |
||||
{ |
||||
return 0; |
||||
} |
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue