├── .gitattributes ├── .gitignore ├── README.md ├── ffmpeg ├── bin │ ├── avcodec-55.dll │ ├── avdevice-54.dll │ ├── avdevice-55.dll │ ├── avfilter-3.dll │ ├── avformat-55.dll │ ├── avutil-52.dll │ ├── postproc-52.dll │ ├── swresample-0.dll │ └── swscale-2.dll ├── include │ ├── inttypes.h │ ├── libavcodec │ │ ├── avcodec.h │ │ ├── avfft.h │ │ ├── dxva2.h │ │ ├── old_codec_ids.h │ │ ├── vaapi.h │ │ ├── vda.h │ │ ├── vdpau.h │ │ ├── version.h │ │ └── xvmc.h │ ├── libavdevice │ │ ├── avdevice.h │ │ └── version.h │ ├── libavfilter │ │ ├── asrc_abuffer.h │ │ ├── avcodec.h │ │ ├── avfilter.h │ │ ├── avfiltergraph.h │ │ ├── buffersink.h │ │ ├── buffersrc.h │ │ └── version.h │ ├── libavformat │ │ ├── avformat.h │ │ ├── avio.h │ │ └── version.h │ ├── libavresample │ │ ├── avresample.h │ │ └── version.h │ ├── libavutil │ │ ├── adler32.h │ │ ├── aes.h │ │ ├── attributes.h │ │ ├── audio_fifo.h │ │ ├── audioconvert.h │ │ ├── avassert.h │ │ ├── avconfig.h │ │ ├── avstring.h │ │ ├── avutil.h │ │ ├── base64.h │ │ ├── blowfish.h │ │ ├── bprint.h │ │ ├── bswap.h │ │ ├── buffer.h │ │ ├── channel_layout.h │ │ ├── common.h │ │ ├── cpu.h │ │ ├── crc.h │ │ ├── dict.h │ │ ├── error.h │ │ ├── eval.h │ │ ├── fifo.h │ │ ├── file.h │ │ ├── frame.h │ │ ├── hmac.h │ │ ├── imgutils.h │ │ ├── intfloat.h │ │ ├── intfloat_readwrite.h │ │ ├── intreadwrite.h │ │ ├── lfg.h │ │ ├── log.h │ │ ├── lzo.h │ │ ├── mathematics.h │ │ ├── md5.h │ │ ├── mem.h │ │ ├── old_pix_fmts.h │ │ ├── opt.h │ │ ├── parseutils.h │ │ ├── pixdesc.h │ │ ├── pixfmt.h │ │ ├── random_seed.h │ │ ├── rational.h │ │ ├── samplefmt.h │ │ ├── sha.h │ │ ├── time.h │ │ ├── timecode.h │ │ ├── timestamp.h │ │ ├── version.h │ │ └── xtea.h │ ├── libpostproc │ │ ├── postprocess.h │ │ └── version.h │ ├── libswresample │ │ ├── swresample.h │ │ └── version.h │ ├── libswscale │ │ ├── swscale.h │ │ └── version.h │ ├── pthread.h │ ├── semaphore.h │ └── stdint.h └── lib │ ├── avcodec.lib │ ├── avdevice.lib │ ├── avformat.lib │ ├── avutil.lib │ └── swscale.lib ├── ffmpegEncoder.sln └── ffmpegEncoder ├── Settings.h ├── VideoEncoder.cpp ├── VideoEncoder.h ├── ffmpegEncoder.vcproj ├── ffmpegInclude.h ├── main.cpp ├── stdafx.cpp ├── stdafx.h ├── stdint.h └── targetver.h /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | 4 | # Custom for Visual Studio 5 | *.cs diff=csharp 6 | 7 | # Standard to msysgit 8 | *.doc diff=astextplain 9 | *.DOC diff=astextplain 10 | *.docx diff=astextplain 11 | *.DOCX diff=astextplain 12 | *.dot diff=astextplain 13 | *.DOT diff=astextplain 14 | *.pdf diff=astextplain 15 | *.PDF diff=astextplain 16 | *.rtf diff=astextplain 17 | *.RTF diff=astextplain 18 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Windows image file caches 2 | Thumbs.db 3 | ehthumbs.db 4 | 5 | # Folder config file 6 | Desktop.ini 7 | 8 | # Recycle Bin used on file shares 9 | $RECYCLE.BIN/ 10 | 11 | # Windows Installer files 12 | *.cab 13 | *.msi 14 | *.msm 15 | *.msp 16 | 17 | # Windows shortcuts 18 | *.lnk 19 | 20 | # ========================= 21 | # Operating System Files 22 | # ========================= 23 | 24 | # OSX 25 | # ========================= 26 | 27 | .DS_Store 28 | .AppleDouble 29 | .LSOverride 30 | 31 | # Thumbnails 32 | ._* 33 | 34 | # Files that might appear on external disk 35 | .Spotlight-V100 36 | .Trashes 37 | 38 | # Directories potentially created on remote AFP share 39 | .AppleDB 40 | .AppleDesktop 41 | Network Trash Folder 42 | Temporary Items 43 | .apdisk 44 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # FFMpeg-encode-example 2 | 3 | Example how to use ffmpeg to decode video file. Link to article about [encode with FFMpeg](http://unick-soft.ru/article.php?id=57). [Russian Article](http://unick-soft.ru/article.php?id=20) 4 | 5 | Program creates video with sound. Here is example settings: 6 | 7 |
 8 | // Frame size.
 9 | #define W_VIDEO 320
10 | #define H_VIDEO 240
11 | // Output file name.
12 | #define FILE_NAME          "c:\\temp\\1.avi"
13 | // Cound of frames in output file.
14 | #define FRAME_COUNT        150
15 | // Container.
16 | #define CONTAINER          "auto"
17 | 
18 | 19 | CONTAINER - which container will we use. "auto" - use file extention. Another value is: "avi", "mp4", "mpeg", "wmv", "mov". 20 | -------------------------------------------------------------------------------- /ffmpeg/bin/avcodec-55.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UnickSoft/FFmpeg-encode-example/be7f2a49fbd67e62b29f78ae456d92cf71df446e/ffmpeg/bin/avcodec-55.dll -------------------------------------------------------------------------------- /ffmpeg/bin/avdevice-54.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UnickSoft/FFmpeg-encode-example/be7f2a49fbd67e62b29f78ae456d92cf71df446e/ffmpeg/bin/avdevice-54.dll -------------------------------------------------------------------------------- /ffmpeg/bin/avdevice-55.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UnickSoft/FFmpeg-encode-example/be7f2a49fbd67e62b29f78ae456d92cf71df446e/ffmpeg/bin/avdevice-55.dll -------------------------------------------------------------------------------- /ffmpeg/bin/avfilter-3.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UnickSoft/FFmpeg-encode-example/be7f2a49fbd67e62b29f78ae456d92cf71df446e/ffmpeg/bin/avfilter-3.dll -------------------------------------------------------------------------------- /ffmpeg/bin/avformat-55.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UnickSoft/FFmpeg-encode-example/be7f2a49fbd67e62b29f78ae456d92cf71df446e/ffmpeg/bin/avformat-55.dll -------------------------------------------------------------------------------- /ffmpeg/bin/avutil-52.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UnickSoft/FFmpeg-encode-example/be7f2a49fbd67e62b29f78ae456d92cf71df446e/ffmpeg/bin/avutil-52.dll -------------------------------------------------------------------------------- /ffmpeg/bin/postproc-52.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UnickSoft/FFmpeg-encode-example/be7f2a49fbd67e62b29f78ae456d92cf71df446e/ffmpeg/bin/postproc-52.dll -------------------------------------------------------------------------------- /ffmpeg/bin/swresample-0.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UnickSoft/FFmpeg-encode-example/be7f2a49fbd67e62b29f78ae456d92cf71df446e/ffmpeg/bin/swresample-0.dll -------------------------------------------------------------------------------- /ffmpeg/bin/swscale-2.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UnickSoft/FFmpeg-encode-example/be7f2a49fbd67e62b29f78ae456d92cf71df446e/ffmpeg/bin/swscale-2.dll -------------------------------------------------------------------------------- /ffmpeg/include/libavcodec/avfft.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of Libav. 3 | * 4 | * Libav is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2.1 of the License, or (at your option) any later version. 8 | * 9 | * Libav is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with Libav; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | */ 18 | 19 | #ifndef AVCODEC_AVFFT_H 20 | #define AVCODEC_AVFFT_H 21 | 22 | /** 23 | * @file 24 | * @ingroup lavc_fft 25 | * FFT functions 26 | */ 27 | 28 | /** 29 | * @defgroup lavc_fft FFT functions 30 | * @ingroup lavc_misc 31 | * 32 | * @{ 33 | */ 34 | 35 | typedef float FFTSample; 36 | 37 | typedef struct FFTComplex { 38 | FFTSample re, im; 39 | } FFTComplex; 40 | 41 | typedef struct FFTContext FFTContext; 42 | 43 | /** 44 | * Set up a complex FFT. 45 | * @param nbits log2 of the length of the input array 46 | * @param inverse if 0 perform the forward transform, if 1 perform the inverse 47 | */ 48 | FFTContext *av_fft_init(int nbits, int inverse); 49 | 50 | /** 51 | * Do the permutation needed BEFORE calling ff_fft_calc(). 52 | */ 53 | void av_fft_permute(FFTContext *s, FFTComplex *z); 54 | 55 | /** 56 | * Do a complex FFT with the parameters defined in av_fft_init(). The 57 | * input data must be permuted before. No 1.0/sqrt(n) normalization is done. 58 | */ 59 | void av_fft_calc(FFTContext *s, FFTComplex *z); 60 | 61 | void av_fft_end(FFTContext *s); 62 | 63 | FFTContext *av_mdct_init(int nbits, int inverse, double scale); 64 | void av_imdct_calc(FFTContext *s, FFTSample *output, const FFTSample *input); 65 | void av_imdct_half(FFTContext *s, FFTSample *output, const FFTSample *input); 66 | void av_mdct_calc(FFTContext *s, FFTSample *output, const FFTSample *input); 67 | void av_mdct_end(FFTContext *s); 68 | 69 | /* Real Discrete Fourier Transform */ 70 | 71 | enum RDFTransformType { 72 | DFT_R2C, 73 | IDFT_C2R, 74 | IDFT_R2C, 75 | DFT_C2R, 76 | }; 77 | 78 | typedef struct RDFTContext RDFTContext; 79 | 80 | /** 81 | * Set up a real FFT. 82 | * @param nbits log2 of the length of the input array 83 | * @param trans the type of transform 84 | */ 85 | RDFTContext *av_rdft_init(int nbits, enum RDFTransformType trans); 86 | void av_rdft_calc(RDFTContext *s, FFTSample *data); 87 | void av_rdft_end(RDFTContext *s); 88 | 89 | /* Discrete Cosine Transform */ 90 | 91 | typedef struct DCTContext DCTContext; 92 | 93 | enum DCTTransformType { 94 | DCT_II = 0, 95 | DCT_III, 96 | DCT_I, 97 | DST_I, 98 | }; 99 | 100 | /** 101 | * Set up DCT. 102 | * @param nbits size of the input array: 103 | * (1 << nbits) for DCT-II, DCT-III and DST-I 104 | * (1 << nbits) + 1 for DCT-I 105 | * 106 | * @note the first element of the input of DST-I is ignored 107 | */ 108 | DCTContext *av_dct_init(int nbits, enum DCTTransformType type); 109 | void av_dct_calc(DCTContext *s, FFTSample *data); 110 | void av_dct_end (DCTContext *s); 111 | 112 | /** 113 | * @} 114 | */ 115 | 116 | #endif /* AVCODEC_AVFFT_H */ 117 | -------------------------------------------------------------------------------- /ffmpeg/include/libavcodec/dxva2.h: -------------------------------------------------------------------------------- 1 | /* 2 | * DXVA2 HW acceleration 3 | * 4 | * copyright (c) 2009 Laurent Aimar 5 | * 6 | * This file is part of Libav. 7 | * 8 | * Libav is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU Lesser General Public 10 | * License as published by the Free Software Foundation; either 11 | * version 2.1 of the License, or (at your option) any later version. 12 | * 13 | * Libav is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | * Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public 19 | * License along with Libav; if not, write to the Free Software 20 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 21 | */ 22 | 23 | #ifndef AVCODEC_DXVA_H 24 | #define AVCODEC_DXVA_H 25 | 26 | /** 27 | * @file 28 | * @ingroup lavc_codec_hwaccel_dxva2 29 | * Public libavcodec DXVA2 header. 30 | */ 31 | 32 | #define _WIN32_WINNT 0x0600 33 | #include 34 | #include 35 | #include 36 | 37 | /** 38 | * @defgroup lavc_codec_hwaccel_dxva2 DXVA2 39 | * @ingroup lavc_codec_hwaccel 40 | * 41 | * @{ 42 | */ 43 | 44 | #define FF_DXVA2_WORKAROUND_SCALING_LIST_ZIGZAG 1 ///< Work around for DXVA2 and old UVD/UVD+ ATI video cards 45 | 46 | /** 47 | * This structure is used to provides the necessary configurations and data 48 | * to the DXVA2 Libav HWAccel implementation. 49 | * 50 | * The application must make it available as AVCodecContext.hwaccel_context. 51 | */ 52 | struct dxva_context { 53 | /** 54 | * DXVA2 decoder object 55 | */ 56 | IDirectXVideoDecoder *decoder; 57 | 58 | /** 59 | * DXVA2 configuration used to create the decoder 60 | */ 61 | const DXVA2_ConfigPictureDecode *cfg; 62 | 63 | /** 64 | * The number of surface in the surface array 65 | */ 66 | unsigned surface_count; 67 | 68 | /** 69 | * The array of Direct3D surfaces used to create the decoder 70 | */ 71 | LPDIRECT3DSURFACE9 *surface; 72 | 73 | /** 74 | * A bit field configuring the workarounds needed for using the decoder 75 | */ 76 | uint64_t workaround; 77 | 78 | /** 79 | * Private to the Libav AVHWAccel implementation 80 | */ 81 | unsigned report_id; 82 | }; 83 | 84 | /** 85 | * @} 86 | */ 87 | 88 | #endif /* AVCODEC_DXVA_H */ 89 | -------------------------------------------------------------------------------- /ffmpeg/include/libavcodec/vaapi.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Video Acceleration API (shared data between Libav and the video player) 3 | * HW decode acceleration for MPEG-2, MPEG-4, H.264 and VC-1 4 | * 5 | * Copyright (C) 2008-2009 Splitted-Desktop Systems 6 | * 7 | * This file is part of Libav. 8 | * 9 | * Libav is free software; you can redistribute it and/or 10 | * modify it under the terms of the GNU Lesser General Public 11 | * License as published by the Free Software Foundation; either 12 | * version 2.1 of the License, or (at your option) any later version. 13 | * 14 | * Libav is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17 | * Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public 20 | * License along with Libav; if not, write to the Free Software 21 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 22 | */ 23 | 24 | #ifndef AVCODEC_VAAPI_H 25 | #define AVCODEC_VAAPI_H 26 | 27 | /** 28 | * @file 29 | * @ingroup lavc_codec_hwaccel_vaapi 30 | * Public libavcodec VA API header. 31 | */ 32 | 33 | #include 34 | 35 | /** 36 | * @defgroup lavc_codec_hwaccel_vaapi VA API Decoding 37 | * @ingroup lavc_codec_hwaccel 38 | * @{ 39 | */ 40 | 41 | /** 42 | * This structure is used to share data between the Libav library and 43 | * the client video application. 44 | * This shall be zero-allocated and available as 45 | * AVCodecContext.hwaccel_context. All user members can be set once 46 | * during initialization or through each AVCodecContext.get_buffer() 47 | * function call. In any case, they must be valid prior to calling 48 | * decoding functions. 49 | */ 50 | struct vaapi_context { 51 | /** 52 | * Window system dependent data 53 | * 54 | * - encoding: unused 55 | * - decoding: Set by user 56 | */ 57 | void *display; 58 | 59 | /** 60 | * Configuration ID 61 | * 62 | * - encoding: unused 63 | * - decoding: Set by user 64 | */ 65 | uint32_t config_id; 66 | 67 | /** 68 | * Context ID (video decode pipeline) 69 | * 70 | * - encoding: unused 71 | * - decoding: Set by user 72 | */ 73 | uint32_t context_id; 74 | 75 | /** 76 | * VAPictureParameterBuffer ID 77 | * 78 | * - encoding: unused 79 | * - decoding: Set by libavcodec 80 | */ 81 | uint32_t pic_param_buf_id; 82 | 83 | /** 84 | * VAIQMatrixBuffer ID 85 | * 86 | * - encoding: unused 87 | * - decoding: Set by libavcodec 88 | */ 89 | uint32_t iq_matrix_buf_id; 90 | 91 | /** 92 | * VABitPlaneBuffer ID (for VC-1 decoding) 93 | * 94 | * - encoding: unused 95 | * - decoding: Set by libavcodec 96 | */ 97 | uint32_t bitplane_buf_id; 98 | 99 | /** 100 | * Slice parameter/data buffer IDs 101 | * 102 | * - encoding: unused 103 | * - decoding: Set by libavcodec 104 | */ 105 | uint32_t *slice_buf_ids; 106 | 107 | /** 108 | * Number of effective slice buffer IDs to send to the HW 109 | * 110 | * - encoding: unused 111 | * - decoding: Set by libavcodec 112 | */ 113 | unsigned int n_slice_buf_ids; 114 | 115 | /** 116 | * Size of pre-allocated slice_buf_ids 117 | * 118 | * - encoding: unused 119 | * - decoding: Set by libavcodec 120 | */ 121 | unsigned int slice_buf_ids_alloc; 122 | 123 | /** 124 | * Pointer to VASliceParameterBuffers 125 | * 126 | * - encoding: unused 127 | * - decoding: Set by libavcodec 128 | */ 129 | void *slice_params; 130 | 131 | /** 132 | * Size of a VASliceParameterBuffer element 133 | * 134 | * - encoding: unused 135 | * - decoding: Set by libavcodec 136 | */ 137 | unsigned int slice_param_size; 138 | 139 | /** 140 | * Size of pre-allocated slice_params 141 | * 142 | * - encoding: unused 143 | * - decoding: Set by libavcodec 144 | */ 145 | unsigned int slice_params_alloc; 146 | 147 | /** 148 | * Number of slices currently filled in 149 | * 150 | * - encoding: unused 151 | * - decoding: Set by libavcodec 152 | */ 153 | unsigned int slice_count; 154 | 155 | /** 156 | * Pointer to slice data buffer base 157 | * - encoding: unused 158 | * - decoding: Set by libavcodec 159 | */ 160 | const uint8_t *slice_data; 161 | 162 | /** 163 | * Current size of slice data 164 | * 165 | * - encoding: unused 166 | * - decoding: Set by libavcodec 167 | */ 168 | uint32_t slice_data_size; 169 | }; 170 | 171 | /* @} */ 172 | 173 | #endif /* AVCODEC_VAAPI_H */ 174 | -------------------------------------------------------------------------------- /ffmpeg/include/libavcodec/vda.h: -------------------------------------------------------------------------------- 1 | /* 2 | * VDA HW acceleration 3 | * 4 | * copyright (c) 2011 Sebastien Zwickert 5 | * 6 | * This file is part of Libav. 7 | * 8 | * Libav is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU Lesser General Public 10 | * License as published by the Free Software Foundation; either 11 | * version 2.1 of the License, or (at your option) any later version. 12 | * 13 | * Libav is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | * Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public 19 | * License along with Libav; if not, write to the Free Software 20 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 21 | */ 22 | 23 | #ifndef AVCODEC_VDA_H 24 | #define AVCODEC_VDA_H 25 | 26 | /** 27 | * @file 28 | * @ingroup lavc_codec_hwaccel_vda 29 | * Public libavcodec VDA header. 30 | */ 31 | 32 | #include "libavcodec/version.h" 33 | 34 | #include 35 | 36 | // emmintrin.h is unable to compile with -std=c99 -Werror=missing-prototypes 37 | // http://openradar.appspot.com/8026390 38 | #undef __GNUC_STDC_INLINE__ 39 | 40 | #define Picture QuickdrawPicture 41 | #include 42 | #undef Picture 43 | 44 | /** 45 | * @defgroup lavc_codec_hwaccel_vda VDA 46 | * @ingroup lavc_codec_hwaccel 47 | * 48 | * @{ 49 | */ 50 | 51 | /** 52 | * This structure is used to provide the necessary configurations and data 53 | * to the VDA Libav HWAccel implementation. 54 | * 55 | * The application must make it available as AVCodecContext.hwaccel_context. 56 | */ 57 | struct vda_context { 58 | /** 59 | * VDA decoder object. 60 | * 61 | * - encoding: unused 62 | * - decoding: Set/Unset by libavcodec. 63 | */ 64 | VDADecoder decoder; 65 | 66 | /** 67 | * The Core Video pixel buffer that contains the current image data. 68 | * 69 | * encoding: unused 70 | * decoding: Set by libavcodec. Unset by user. 71 | */ 72 | CVPixelBufferRef cv_buffer; 73 | 74 | /** 75 | * Use the hardware decoder in synchronous mode. 76 | * 77 | * encoding: unused 78 | * decoding: Set by user. 79 | */ 80 | int use_sync_decoding; 81 | 82 | /** 83 | * The frame width. 84 | * 85 | * - encoding: unused 86 | * - decoding: Set/Unset by user. 87 | */ 88 | int width; 89 | 90 | /** 91 | * The frame height. 92 | * 93 | * - encoding: unused 94 | * - decoding: Set/Unset by user. 95 | */ 96 | int height; 97 | 98 | /** 99 | * The frame format. 100 | * 101 | * - encoding: unused 102 | * - decoding: Set/Unset by user. 103 | */ 104 | int format; 105 | 106 | /** 107 | * The pixel format for output image buffers. 108 | * 109 | * - encoding: unused 110 | * - decoding: Set/Unset by user. 111 | */ 112 | OSType cv_pix_fmt_type; 113 | 114 | /** 115 | * The current bitstream buffer. 116 | */ 117 | uint8_t *priv_bitstream; 118 | 119 | /** 120 | * The current size of the bitstream. 121 | */ 122 | int priv_bitstream_size; 123 | 124 | /** 125 | * The reference size used for fast reallocation. 126 | */ 127 | int priv_allocated_size; 128 | }; 129 | 130 | /** Create the video decoder. */ 131 | int ff_vda_create_decoder(struct vda_context *vda_ctx, 132 | uint8_t *extradata, 133 | int extradata_size); 134 | 135 | /** Destroy the video decoder. */ 136 | int ff_vda_destroy_decoder(struct vda_context *vda_ctx); 137 | 138 | /** 139 | * @} 140 | */ 141 | 142 | #endif /* AVCODEC_VDA_H */ 143 | -------------------------------------------------------------------------------- /ffmpeg/include/libavcodec/vdpau.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The Video Decode and Presentation API for UNIX (VDPAU) is used for 3 | * hardware-accelerated decoding of MPEG-1/2, H.264 and VC-1. 4 | * 5 | * Copyright (C) 2008 NVIDIA 6 | * 7 | * This file is part of Libav. 8 | * 9 | * Libav is free software; you can redistribute it and/or 10 | * modify it under the terms of the GNU Lesser General Public 11 | * License as published by the Free Software Foundation; either 12 | * version 2.1 of the License, or (at your option) any later version. 13 | * 14 | * Libav is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17 | * Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public 20 | * License along with Libav; if not, write to the Free Software 21 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 22 | */ 23 | 24 | #ifndef AVCODEC_VDPAU_H 25 | #define AVCODEC_VDPAU_H 26 | 27 | /** 28 | * @file 29 | * @ingroup lavc_codec_hwaccel_vdpau 30 | * Public libavcodec VDPAU header. 31 | */ 32 | 33 | 34 | /** 35 | * @defgroup lavc_codec_hwaccel_vdpau VDPAU Decoder and Renderer 36 | * @ingroup lavc_codec_hwaccel 37 | * 38 | * VDPAU hardware acceleration has two modules 39 | * - VDPAU decoding 40 | * - VDPAU presentation 41 | * 42 | * The VDPAU decoding module parses all headers using Libav 43 | * parsing mechanisms and uses VDPAU for the actual decoding. 44 | * 45 | * As per the current implementation, the actual decoding 46 | * and rendering (API calls) are done as part of the VDPAU 47 | * presentation (vo_vdpau.c) module. 48 | * 49 | * @{ 50 | */ 51 | 52 | #include 53 | #include 54 | 55 | union VdpPictureInfo { 56 | VdpPictureInfoH264 h264; 57 | VdpPictureInfoMPEG1Or2 mpeg; 58 | VdpPictureInfoVC1 vc1; 59 | VdpPictureInfoMPEG4Part2 mpeg4; 60 | }; 61 | 62 | /** 63 | * This structure is used to share data between the libavcodec library and 64 | * the client video application. 65 | * The user shall zero-allocate the structure and make it available as 66 | * AVCodecContext.hwaccel_context. Members can be set by the user once 67 | * during initialization or through each AVCodecContext.get_buffer() 68 | * function call. In any case, they must be valid prior to calling 69 | * decoding functions. 70 | */ 71 | typedef struct AVVDPAUContext { 72 | /** 73 | * VDPAU decoder handle 74 | * 75 | * Set by user. 76 | */ 77 | VdpDecoder decoder; 78 | 79 | /** 80 | * VDPAU decoder render callback 81 | * 82 | * Set by the user. 83 | */ 84 | VdpDecoderRender *render; 85 | 86 | /** 87 | * VDPAU picture information 88 | * 89 | * Set by libavcodec. 90 | */ 91 | union VdpPictureInfo info; 92 | 93 | /** 94 | * Allocated size of the bitstream_buffers table. 95 | * 96 | * Set by libavcodec. 97 | */ 98 | int bitstream_buffers_allocated; 99 | 100 | /** 101 | * Useful bitstream buffers in the bitstream buffers table. 102 | * 103 | * Set by libavcodec. 104 | */ 105 | int bitstream_buffers_used; 106 | 107 | /** 108 | * Table of bitstream buffers. 109 | * The user is responsible for freeing this buffer using av_freep(). 110 | * 111 | * Set by libavcodec. 112 | */ 113 | VdpBitstreamBuffer *bitstream_buffers; 114 | } AVVDPAUContext; 115 | 116 | 117 | /** @brief The videoSurface is used for rendering. */ 118 | #define FF_VDPAU_STATE_USED_FOR_RENDER 1 119 | 120 | /** 121 | * @brief The videoSurface is needed for reference/prediction. 122 | * The codec manipulates this. 123 | */ 124 | #define FF_VDPAU_STATE_USED_FOR_REFERENCE 2 125 | 126 | /** 127 | * @brief This structure is used as a callback between the Libav 128 | * decoder (vd_) and presentation (vo_) module. 129 | * This is used for defining a video frame containing surface, 130 | * picture parameter, bitstream information etc which are passed 131 | * between the Libav decoder and its clients. 132 | */ 133 | struct vdpau_render_state { 134 | VdpVideoSurface surface; ///< Used as rendered surface, never changed. 135 | 136 | int state; ///< Holds FF_VDPAU_STATE_* values. 137 | 138 | /** picture parameter information for all supported codecs */ 139 | union VdpPictureInfo info; 140 | 141 | /** Describe size/location of the compressed video data. 142 | Set to 0 when freeing bitstream_buffers. */ 143 | int bitstream_buffers_allocated; 144 | int bitstream_buffers_used; 145 | /** The user is responsible for freeing this buffer using av_freep(). */ 146 | VdpBitstreamBuffer *bitstream_buffers; 147 | }; 148 | 149 | /* @}*/ 150 | 151 | #endif /* AVCODEC_VDPAU_H */ 152 | -------------------------------------------------------------------------------- /ffmpeg/include/libavcodec/version.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * This file is part of Libav. 4 | * 5 | * Libav is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 2.1 of the License, or (at your option) any later version. 9 | * 10 | * Libav is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with Libav; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 18 | */ 19 | 20 | #ifndef AVCODEC_VERSION_H 21 | #define AVCODEC_VERSION_H 22 | 23 | /** 24 | * @file 25 | * @ingroup libavc 26 | * Libavcodec version macros. 27 | */ 28 | 29 | #define LIBAVCODEC_VERSION_MAJOR 55 30 | #define LIBAVCODEC_VERSION_MINOR 7 31 | #define LIBAVCODEC_VERSION_MICRO 0 32 | 33 | #define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \ 34 | LIBAVCODEC_VERSION_MINOR, \ 35 | LIBAVCODEC_VERSION_MICRO) 36 | #define LIBAVCODEC_VERSION AV_VERSION(LIBAVCODEC_VERSION_MAJOR, \ 37 | LIBAVCODEC_VERSION_MINOR, \ 38 | LIBAVCODEC_VERSION_MICRO) 39 | #define LIBAVCODEC_BUILD LIBAVCODEC_VERSION_INT 40 | 41 | #define LIBAVCODEC_IDENT "Lavc" AV_STRINGIFY(LIBAVCODEC_VERSION) 42 | 43 | /** 44 | * FF_API_* defines may be placed below to indicate public API that will be 45 | * dropped at a future version bump. The defines themselves are not part of 46 | * the public API and may change, break or disappear at any time. 47 | */ 48 | 49 | #ifndef FF_API_REQUEST_CHANNELS 50 | #define FF_API_REQUEST_CHANNELS (LIBAVCODEC_VERSION_MAJOR < 56) 51 | #endif 52 | #ifndef FF_API_DEINTERLACE 53 | #define FF_API_DEINTERLACE (LIBAVCODEC_VERSION_MAJOR < 56) 54 | #endif 55 | #ifndef FF_API_DESTRUCT_PACKET 56 | #define FF_API_DESTRUCT_PACKET (LIBAVCODEC_VERSION_MAJOR < 56) 57 | #endif 58 | #ifndef FF_API_GET_BUFFER 59 | #define FF_API_GET_BUFFER (LIBAVCODEC_VERSION_MAJOR < 56) 60 | #endif 61 | #ifndef FF_API_MISSING_SAMPLE 62 | #define FF_API_MISSING_SAMPLE (LIBAVCODEC_VERSION_MAJOR < 56) 63 | #endif 64 | #ifndef FF_API_LOWRES 65 | #define FF_API_LOWRES (LIBAVCODEC_VERSION_MAJOR < 56) 66 | #endif 67 | 68 | #endif /* AVCODEC_VERSION_H */ 69 | -------------------------------------------------------------------------------- /ffmpeg/include/libavcodec/xvmc.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003 Ivan Kalvachev 3 | * 4 | * This file is part of Libav. 5 | * 6 | * Libav is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * Libav is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with Libav; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | #ifndef AVCODEC_XVMC_H 22 | #define AVCODEC_XVMC_H 23 | 24 | /** 25 | * @file 26 | * @ingroup lavc_codec_hwaccel_xvmc 27 | * Public libavcodec XvMC header. 28 | */ 29 | 30 | #include 31 | 32 | #include "avcodec.h" 33 | 34 | /** 35 | * @defgroup lavc_codec_hwaccel_xvmc XvMC 36 | * @ingroup lavc_codec_hwaccel 37 | * 38 | * @{ 39 | */ 40 | 41 | #define AV_XVMC_ID 0x1DC711C0 /**< special value to ensure that regular pixel routines haven't corrupted the struct 42 | the number is 1337 speak for the letters IDCT MCo (motion compensation) */ 43 | 44 | struct xvmc_pix_fmt { 45 | /** The field contains the special constant value AV_XVMC_ID. 46 | It is used as a test that the application correctly uses the API, 47 | and that there is no corruption caused by pixel routines. 48 | - application - set during initialization 49 | - libavcodec - unchanged 50 | */ 51 | int xvmc_id; 52 | 53 | /** Pointer to the block array allocated by XvMCCreateBlocks(). 54 | The array has to be freed by XvMCDestroyBlocks(). 55 | Each group of 64 values represents one data block of differential 56 | pixel information (in MoCo mode) or coefficients for IDCT. 57 | - application - set the pointer during initialization 58 | - libavcodec - fills coefficients/pixel data into the array 59 | */ 60 | short* data_blocks; 61 | 62 | /** Pointer to the macroblock description array allocated by 63 | XvMCCreateMacroBlocks() and freed by XvMCDestroyMacroBlocks(). 64 | - application - set the pointer during initialization 65 | - libavcodec - fills description data into the array 66 | */ 67 | XvMCMacroBlock* mv_blocks; 68 | 69 | /** Number of macroblock descriptions that can be stored in the mv_blocks 70 | array. 71 | - application - set during initialization 72 | - libavcodec - unchanged 73 | */ 74 | int allocated_mv_blocks; 75 | 76 | /** Number of blocks that can be stored at once in the data_blocks array. 77 | - application - set during initialization 78 | - libavcodec - unchanged 79 | */ 80 | int allocated_data_blocks; 81 | 82 | /** Indicate that the hardware would interpret data_blocks as IDCT 83 | coefficients and perform IDCT on them. 84 | - application - set during initialization 85 | - libavcodec - unchanged 86 | */ 87 | int idct; 88 | 89 | /** In MoCo mode it indicates that intra macroblocks are assumed to be in 90 | unsigned format; same as the XVMC_INTRA_UNSIGNED flag. 91 | - application - set during initialization 92 | - libavcodec - unchanged 93 | */ 94 | int unsigned_intra; 95 | 96 | /** Pointer to the surface allocated by XvMCCreateSurface(). 97 | It has to be freed by XvMCDestroySurface() on application exit. 98 | It identifies the frame and its state on the video hardware. 99 | - application - set during initialization 100 | - libavcodec - unchanged 101 | */ 102 | XvMCSurface* p_surface; 103 | 104 | /** Set by the decoder before calling ff_draw_horiz_band(), 105 | needed by the XvMCRenderSurface function. */ 106 | //@{ 107 | /** Pointer to the surface used as past reference 108 | - application - unchanged 109 | - libavcodec - set 110 | */ 111 | XvMCSurface* p_past_surface; 112 | 113 | /** Pointer to the surface used as future reference 114 | - application - unchanged 115 | - libavcodec - set 116 | */ 117 | XvMCSurface* p_future_surface; 118 | 119 | /** top/bottom field or frame 120 | - application - unchanged 121 | - libavcodec - set 122 | */ 123 | unsigned int picture_structure; 124 | 125 | /** XVMC_SECOND_FIELD - 1st or 2nd field in the sequence 126 | - application - unchanged 127 | - libavcodec - set 128 | */ 129 | unsigned int flags; 130 | //}@ 131 | 132 | /** Number of macroblock descriptions in the mv_blocks array 133 | that have already been passed to the hardware. 134 | - application - zeroes it on get_buffer(). 135 | A successful ff_draw_horiz_band() may increment it 136 | with filled_mb_block_num or zero both. 137 | - libavcodec - unchanged 138 | */ 139 | int start_mv_blocks_num; 140 | 141 | /** Number of new macroblock descriptions in the mv_blocks array (after 142 | start_mv_blocks_num) that are filled by libavcodec and have to be 143 | passed to the hardware. 144 | - application - zeroes it on get_buffer() or after successful 145 | ff_draw_horiz_band(). 146 | - libavcodec - increment with one of each stored MB 147 | */ 148 | int filled_mv_blocks_num; 149 | 150 | /** Number of the next free data block; one data block consists of 151 | 64 short values in the data_blocks array. 152 | All blocks before this one have already been claimed by placing their 153 | position into the corresponding block description structure field, 154 | that are part of the mv_blocks array. 155 | - application - zeroes it on get_buffer(). 156 | A successful ff_draw_horiz_band() may zero it together 157 | with start_mb_blocks_num. 158 | - libavcodec - each decoded macroblock increases it by the number 159 | of coded blocks it contains. 160 | */ 161 | int next_free_data_block_num; 162 | }; 163 | 164 | /** 165 | * @} 166 | */ 167 | 168 | #endif /* AVCODEC_XVMC_H */ 169 | -------------------------------------------------------------------------------- /ffmpeg/include/libavdevice/avdevice.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of Libav. 3 | * 4 | * Libav is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2.1 of the License, or (at your option) any later version. 8 | * 9 | * Libav is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with Libav; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | */ 18 | 19 | #ifndef AVDEVICE_AVDEVICE_H 20 | #define AVDEVICE_AVDEVICE_H 21 | 22 | #include "version.h" 23 | 24 | /** 25 | * @file 26 | * @ingroup lavd 27 | * Main libavdevice API header 28 | */ 29 | 30 | /** 31 | * @defgroup lavd Special devices muxing/demuxing library 32 | * @{ 33 | * Libavdevice is a complementary library to @ref libavf "libavformat". It 34 | * provides various "special" platform-specific muxers and demuxers, e.g. for 35 | * grabbing devices, audio capture and playback etc. As a consequence, the 36 | * (de)muxers in libavdevice are of the AVFMT_NOFILE type (they use their own 37 | * I/O functions). The filename passed to avformat_open_input() often does not 38 | * refer to an actually existing file, but has some special device-specific 39 | * meaning - e.g. for x11grab it is the display name. 40 | * 41 | * To use libavdevice, simply call avdevice_register_all() to register all 42 | * compiled muxers and demuxers. They all use standard libavformat API. 43 | * @} 44 | */ 45 | 46 | /** 47 | * Return the LIBAVDEVICE_VERSION_INT constant. 48 | */ 49 | unsigned avdevice_version(void); 50 | 51 | /** 52 | * Return the libavdevice build-time configuration. 53 | */ 54 | const char *avdevice_configuration(void); 55 | 56 | /** 57 | * Return the libavdevice license. 58 | */ 59 | const char *avdevice_license(void); 60 | 61 | /** 62 | * Initialize libavdevice and register all the input and output devices. 63 | * @warning This function is not thread safe. 64 | */ 65 | void avdevice_register_all(void); 66 | 67 | #endif /* AVDEVICE_AVDEVICE_H */ 68 | -------------------------------------------------------------------------------- /ffmpeg/include/libavdevice/version.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of Libav. 3 | * 4 | * Libav is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2.1 of the License, or (at your option) any later version. 8 | * 9 | * Libav is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with Libav; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | */ 18 | 19 | #ifndef AVDEVICE_VERSION_H 20 | #define AVDEVICE_VERSION_H 21 | 22 | /** 23 | * @file 24 | * @ingroup lavd 25 | * Libavdevice version macros 26 | */ 27 | 28 | #include "libavutil/avutil.h" 29 | 30 | #define LIBAVDEVICE_VERSION_MAJOR 54 31 | #define LIBAVDEVICE_VERSION_MINOR 0 32 | #define LIBAVDEVICE_VERSION_MICRO 0 33 | 34 | #define LIBAVDEVICE_VERSION_INT AV_VERSION_INT(LIBAVDEVICE_VERSION_MAJOR, \ 35 | LIBAVDEVICE_VERSION_MINOR, \ 36 | LIBAVDEVICE_VERSION_MICRO) 37 | #define LIBAVDEVICE_VERSION AV_VERSION(LIBAVDEVICE_VERSION_MAJOR, \ 38 | LIBAVDEVICE_VERSION_MINOR, \ 39 | LIBAVDEVICE_VERSION_MICRO) 40 | #define LIBAVDEVICE_BUILD LIBAVDEVICE_VERSION_INT 41 | 42 | /** 43 | * FF_API_* defines may be placed below to indicate public API that will be 44 | * dropped at a future version bump. The defines themselves are not part of 45 | * the public API and may change, break or disappear at any time. 46 | */ 47 | 48 | #endif /* AVDEVICE_VERSION_H */ 49 | -------------------------------------------------------------------------------- /ffmpeg/include/libavfilter/asrc_abuffer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of FFmpeg. 3 | * 4 | * FFmpeg is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2.1 of the License, or (at your option) any later version. 8 | * 9 | * FFmpeg is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with FFmpeg; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | */ 18 | 19 | #ifndef AVFILTER_ASRC_ABUFFER_H 20 | #define AVFILTER_ASRC_ABUFFER_H 21 | 22 | #include "avfilter.h" 23 | 24 | /** 25 | * @file 26 | * memory buffer source for audio 27 | * 28 | * @deprecated use buffersrc.h instead. 29 | */ 30 | 31 | /** 32 | * Queue an audio buffer to the audio buffer source. 33 | * 34 | * @param abuffersrc audio source buffer context 35 | * @param data pointers to the samples planes 36 | * @param linesize linesizes of each audio buffer plane 37 | * @param nb_samples number of samples per channel 38 | * @param sample_fmt sample format of the audio data 39 | * @param ch_layout channel layout of the audio data 40 | * @param planar flag to indicate if audio data is planar or packed 41 | * @param pts presentation timestamp of the audio buffer 42 | * @param flags unused 43 | * 44 | * @deprecated use av_buffersrc_add_ref() instead. 45 | */ 46 | attribute_deprecated 47 | int av_asrc_buffer_add_samples(AVFilterContext *abuffersrc, 48 | uint8_t *data[8], int linesize[8], 49 | int nb_samples, int sample_rate, 50 | int sample_fmt, int64_t ch_layout, int planar, 51 | int64_t pts, int av_unused flags); 52 | 53 | /** 54 | * Queue an audio buffer to the audio buffer source. 55 | * 56 | * This is similar to av_asrc_buffer_add_samples(), but the samples 57 | * are stored in a buffer with known size. 58 | * 59 | * @param abuffersrc audio source buffer context 60 | * @param buf pointer to the samples data, packed is assumed 61 | * @param size the size in bytes of the buffer, it must contain an 62 | * integer number of samples 63 | * @param sample_fmt sample format of the audio data 64 | * @param ch_layout channel layout of the audio data 65 | * @param pts presentation timestamp of the audio buffer 66 | * @param flags unused 67 | * 68 | * @deprecated use av_buffersrc_add_ref() instead. 69 | */ 70 | attribute_deprecated 71 | int av_asrc_buffer_add_buffer(AVFilterContext *abuffersrc, 72 | uint8_t *buf, int buf_size, 73 | int sample_rate, 74 | int sample_fmt, int64_t ch_layout, int planar, 75 | int64_t pts, int av_unused flags); 76 | 77 | /** 78 | * Queue an audio buffer to the audio buffer source. 79 | * 80 | * @param abuffersrc audio source buffer context 81 | * @param samplesref buffer ref to queue 82 | * @param flags unused 83 | * 84 | * @deprecated use av_buffersrc_add_ref() instead. 85 | */ 86 | attribute_deprecated 87 | int av_asrc_buffer_add_audio_buffer_ref(AVFilterContext *abuffersrc, 88 | AVFilterBufferRef *samplesref, 89 | int av_unused flags); 90 | 91 | #endif /* AVFILTER_ASRC_ABUFFER_H */ 92 | -------------------------------------------------------------------------------- /ffmpeg/include/libavfilter/avcodec.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of FFmpeg. 3 | * 4 | * FFmpeg is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2.1 of the License, or (at your option) any later version. 8 | * 9 | * FFmpeg is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with FFmpeg; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | */ 18 | 19 | #ifndef AVFILTER_AVCODEC_H 20 | #define AVFILTER_AVCODEC_H 21 | 22 | /** 23 | * @file 24 | * libavcodec/libavfilter gluing utilities 25 | * 26 | * This should be included in an application ONLY if the installed 27 | * libavfilter has been compiled with libavcodec support, otherwise 28 | * symbols defined below will not be available. 29 | */ 30 | 31 | #include "avfilter.h" 32 | 33 | #if FF_API_AVFILTERBUFFER 34 | /** 35 | * Create and return a picref reference from the data and properties 36 | * contained in frame. 37 | * 38 | * @param perms permissions to assign to the new buffer reference 39 | * @deprecated avfilter APIs work natively with AVFrame instead. 40 | */ 41 | attribute_deprecated 42 | AVFilterBufferRef *avfilter_get_video_buffer_ref_from_frame(const AVFrame *frame, int perms); 43 | 44 | 45 | /** 46 | * Create and return a picref reference from the data and properties 47 | * contained in frame. 48 | * 49 | * @param perms permissions to assign to the new buffer reference 50 | * @deprecated avfilter APIs work natively with AVFrame instead. 51 | */ 52 | attribute_deprecated 53 | AVFilterBufferRef *avfilter_get_audio_buffer_ref_from_frame(const AVFrame *frame, 54 | int perms); 55 | 56 | /** 57 | * Create and return a buffer reference from the data and properties 58 | * contained in frame. 59 | * 60 | * @param perms permissions to assign to the new buffer reference 61 | * @deprecated avfilter APIs work natively with AVFrame instead. 62 | */ 63 | attribute_deprecated 64 | AVFilterBufferRef *avfilter_get_buffer_ref_from_frame(enum AVMediaType type, 65 | const AVFrame *frame, 66 | int perms); 67 | #endif 68 | 69 | #if FF_API_FILL_FRAME 70 | /** 71 | * Fill an AVFrame with the information stored in samplesref. 72 | * 73 | * @param frame an already allocated AVFrame 74 | * @param samplesref an audio buffer reference 75 | * @return 0 in case of success, a negative AVERROR code in case of 76 | * failure 77 | * @deprecated Use avfilter_copy_buf_props() instead. 78 | */ 79 | attribute_deprecated 80 | int avfilter_fill_frame_from_audio_buffer_ref(AVFrame *frame, 81 | const AVFilterBufferRef *samplesref); 82 | 83 | /** 84 | * Fill an AVFrame with the information stored in picref. 85 | * 86 | * @param frame an already allocated AVFrame 87 | * @param picref a video buffer reference 88 | * @return 0 in case of success, a negative AVERROR code in case of 89 | * failure 90 | * @deprecated Use avfilter_copy_buf_props() instead. 91 | */ 92 | attribute_deprecated 93 | int avfilter_fill_frame_from_video_buffer_ref(AVFrame *frame, 94 | const AVFilterBufferRef *picref); 95 | 96 | /** 97 | * Fill an AVFrame with information stored in ref. 98 | * 99 | * @param frame an already allocated AVFrame 100 | * @param ref a video or audio buffer reference 101 | * @return 0 in case of success, a negative AVERROR code in case of 102 | * failure 103 | * @deprecated Use avfilter_copy_buf_props() instead. 104 | */ 105 | attribute_deprecated 106 | int avfilter_fill_frame_from_buffer_ref(AVFrame *frame, 107 | const AVFilterBufferRef *ref); 108 | #endif 109 | 110 | #endif /* AVFILTER_AVCODEC_H */ 111 | -------------------------------------------------------------------------------- /ffmpeg/include/libavfilter/avfiltergraph.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Filter graphs 3 | * copyright (c) 2007 Bobby Bingham 4 | * 5 | * This file is part of Libav. 6 | * 7 | * Libav is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public 9 | * License as published by the Free Software Foundation; either 10 | * version 2.1 of the License, or (at your option) any later version. 11 | * 12 | * Libav is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public 18 | * License along with Libav; if not, write to the Free Software 19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 20 | */ 21 | 22 | #ifndef AVFILTER_AVFILTERGRAPH_H 23 | #define AVFILTER_AVFILTERGRAPH_H 24 | 25 | #include "avfilter.h" 26 | #include "libavutil/log.h" 27 | 28 | 29 | #endif /* AVFILTER_AVFILTERGRAPH_H */ 30 | -------------------------------------------------------------------------------- /ffmpeg/include/libavfilter/buffersink.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of Libav. 3 | * 4 | * Libav is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2.1 of the License, or (at your option) any later version. 8 | * 9 | * Libav is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with Libav; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | */ 18 | 19 | #ifndef AVFILTER_BUFFERSINK_H 20 | #define AVFILTER_BUFFERSINK_H 21 | 22 | /** 23 | * @file 24 | * memory buffer sink API 25 | */ 26 | 27 | #include "avfilter.h" 28 | 29 | #if FF_API_AVFILTERBUFFER 30 | /** 31 | * Get a buffer with filtered data from sink and put it in buf. 32 | * 33 | * @param ctx pointer to a context of a buffersink or abuffersink AVFilter. 34 | * @param buf pointer to the buffer will be written here if buf is non-NULL. buf 35 | * must be freed by the caller using avfilter_unref_buffer(). 36 | * Buf may also be NULL to query whether a buffer is ready to be 37 | * output. 38 | * 39 | * @return >= 0 in case of success, a negative AVERROR code in case of 40 | * failure. 41 | */ 42 | attribute_deprecated 43 | int av_buffersink_read(AVFilterContext *ctx, AVFilterBufferRef **buf); 44 | 45 | /** 46 | * Same as av_buffersink_read, but with the ability to specify the number of 47 | * samples read. This function is less efficient than av_buffersink_read(), 48 | * because it copies the data around. 49 | * 50 | * @param ctx pointer to a context of the abuffersink AVFilter. 51 | * @param buf pointer to the buffer will be written here if buf is non-NULL. buf 52 | * must be freed by the caller using avfilter_unref_buffer(). buf 53 | * will contain exactly nb_samples audio samples, except at the end 54 | * of stream, when it can contain less than nb_samples. 55 | * Buf may also be NULL to query whether a buffer is ready to be 56 | * output. 57 | * 58 | * @warning do not mix this function with av_buffersink_read(). Use only one or 59 | * the other with a single sink, not both. 60 | */ 61 | attribute_deprecated 62 | int av_buffersink_read_samples(AVFilterContext *ctx, AVFilterBufferRef **buf, 63 | int nb_samples); 64 | #endif 65 | 66 | /** 67 | * Get a frame with filtered data from sink and put it in frame. 68 | * 69 | * @param ctx pointer to a context of a buffersink or abuffersink AVFilter. 70 | * @param frame pointer to an allocated frame that will be filled with data. 71 | * The data must be freed using av_frame_unref() / av_frame_free() 72 | * 73 | * @return >= 0 in case of success, a negative AVERROR code in case of 74 | * failure. 75 | */ 76 | int av_buffersink_get_frame(AVFilterContext *ctx, AVFrame *frame); 77 | 78 | /** 79 | * Same as av_buffersink_get_frame(), but with the ability to specify the number 80 | * of samples read. This function is less efficient than 81 | * av_buffersink_get_frame(), because it copies the data around. 82 | * 83 | * @param ctx pointer to a context of the abuffersink AVFilter. 84 | * @param frame pointer to an allocated frame that will be filled with data. 85 | * The data must be freed using av_frame_unref() / av_frame_free() 86 | * frame will contain exactly nb_samples audio samples, except at 87 | * the end of stream, when it can contain less than nb_samples. 88 | * 89 | * @warning do not mix this function with av_buffersink_get_frame(). Use only one or 90 | * the other with a single sink, not both. 91 | */ 92 | int av_buffersink_get_samples(AVFilterContext *ctx, AVFrame *frame, int nb_samples); 93 | 94 | #endif /* AVFILTER_BUFFERSINK_H */ 95 | -------------------------------------------------------------------------------- /ffmpeg/include/libavfilter/buffersrc.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * This file is part of Libav. 4 | * 5 | * Libav is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 2.1 of the License, or (at your option) any later version. 9 | * 10 | * Libav is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with Libav; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 18 | */ 19 | 20 | #ifndef AVFILTER_BUFFERSRC_H 21 | #define AVFILTER_BUFFERSRC_H 22 | 23 | /** 24 | * @file 25 | * Memory buffer source API. 26 | */ 27 | 28 | #include "avfilter.h" 29 | 30 | #if FF_API_AVFILTERBUFFER 31 | /** 32 | * Add a buffer to the filtergraph s. 33 | * 34 | * @param buf buffer containing frame data to be passed down the filtergraph. 35 | * This function will take ownership of buf, the user must not free it. 36 | * A NULL buf signals EOF -- i.e. no more frames will be sent to this filter. 37 | * 38 | * @deprecated use av_buffersrc_write_frame() or av_buffersrc_add_frame() 39 | */ 40 | attribute_deprecated 41 | int av_buffersrc_buffer(AVFilterContext *s, AVFilterBufferRef *buf); 42 | #endif 43 | 44 | /** 45 | * Add a frame to the buffer source. 46 | * 47 | * @param s an instance of the buffersrc filter. 48 | * @param frame frame to be added. If the frame is reference counted, this 49 | * function will make a new reference to it. Otherwise the frame data will be 50 | * copied. 51 | * 52 | * @return 0 on success, a negative AVERROR on error 53 | */ 54 | int av_buffersrc_write_frame(AVFilterContext *s, const AVFrame *frame); 55 | 56 | /** 57 | * Add a frame to the buffer source. 58 | * 59 | * @param s an instance of the buffersrc filter. 60 | * @param frame frame to be added. If the frame is reference counted, this 61 | * function will take ownership of the reference(s) and reset the frame. 62 | * Otherwise the frame data will be copied. If this function returns an error, 63 | * the input frame is not touched. 64 | * 65 | * @return 0 on success, a negative AVERROR on error. 66 | * 67 | * @note the difference between this function and av_buffersrc_write_frame() is 68 | * that av_buffersrc_write_frame() creates a new reference to the input frame, 69 | * while this function takes ownership of the reference passed to it. 70 | */ 71 | int av_buffersrc_add_frame(AVFilterContext *ctx, AVFrame *frame); 72 | 73 | #endif /* AVFILTER_BUFFERSRC_H */ 74 | -------------------------------------------------------------------------------- /ffmpeg/include/libavfilter/version.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Version macros. 3 | * 4 | * This file is part of Libav. 5 | * 6 | * Libav is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * Libav is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with Libav; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | #ifndef AVFILTER_VERSION_H 22 | #define AVFILTER_VERSION_H 23 | 24 | /** 25 | * @file 26 | * @ingroup lavfi 27 | * Libavfilter version macros 28 | */ 29 | 30 | #include "libavutil/avutil.h" 31 | 32 | #define LIBAVFILTER_VERSION_MAJOR 3 33 | #define LIBAVFILTER_VERSION_MINOR 10 34 | #define LIBAVFILTER_VERSION_MICRO 0 35 | 36 | #define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \ 37 | LIBAVFILTER_VERSION_MINOR, \ 38 | LIBAVFILTER_VERSION_MICRO) 39 | #define LIBAVFILTER_VERSION AV_VERSION(LIBAVFILTER_VERSION_MAJOR, \ 40 | LIBAVFILTER_VERSION_MINOR, \ 41 | LIBAVFILTER_VERSION_MICRO) 42 | #define LIBAVFILTER_BUILD LIBAVFILTER_VERSION_INT 43 | 44 | /** 45 | * FF_API_* defines may be placed below to indicate public API that will be 46 | * dropped at a future version bump. The defines themselves are not part of 47 | * the public API and may change, break or disappear at any time. 48 | */ 49 | 50 | #ifndef FF_API_AVFILTERPAD_PUBLIC 51 | #define FF_API_AVFILTERPAD_PUBLIC (LIBAVFILTER_VERSION_MAJOR < 4) 52 | #endif 53 | #ifndef FF_API_FOO_COUNT 54 | #define FF_API_FOO_COUNT (LIBAVFILTER_VERSION_MAJOR < 4) 55 | #endif 56 | #ifndef FF_API_AVFILTERBUFFER 57 | #define FF_API_AVFILTERBUFFER (LIBAVFILTER_VERSION_MAJOR < 4) 58 | #endif 59 | #ifndef FF_API_OLD_FILTER_OPTS 60 | #define FF_API_OLD_FILTER_OPTS (LIBAVFILTER_VERSION_MAJOR < 4) 61 | #endif 62 | #ifndef FF_API_AVFILTER_OPEN 63 | #define FF_API_AVFILTER_OPEN (LIBAVFILTER_VERSION_MAJOR < 4) 64 | #endif 65 | #ifndef FF_API_AVFILTER_INIT_FILTER 66 | #define FF_API_AVFILTER_INIT_FILTER (LIBAVFILTER_VERSION_MAJOR < 4) 67 | #endif 68 | #ifndef FF_API_OLD_FILTER_REGISTER 69 | #define FF_API_OLD_FILTER_REGISTER (LIBAVFILTER_VERSION_MAJOR < 4) 70 | #endif 71 | 72 | #endif /* AVFILTER_VERSION_H */ 73 | -------------------------------------------------------------------------------- /ffmpeg/include/libavformat/version.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Version macros. 3 | * 4 | * This file is part of Libav. 5 | * 6 | * Libav is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * Libav is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with Libav; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | #ifndef AVFORMAT_VERSION_H 22 | #define AVFORMAT_VERSION_H 23 | 24 | /** 25 | * @file 26 | * @ingroup libavf 27 | * Libavformat version macros 28 | */ 29 | 30 | #include "libavutil/avutil.h" 31 | 32 | #define LIBAVFORMAT_VERSION_MAJOR 55 33 | #define LIBAVFORMAT_VERSION_MINOR 0 34 | #define LIBAVFORMAT_VERSION_MICRO 1 35 | 36 | #define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \ 37 | LIBAVFORMAT_VERSION_MINOR, \ 38 | LIBAVFORMAT_VERSION_MICRO) 39 | #define LIBAVFORMAT_VERSION AV_VERSION(LIBAVFORMAT_VERSION_MAJOR, \ 40 | LIBAVFORMAT_VERSION_MINOR, \ 41 | LIBAVFORMAT_VERSION_MICRO) 42 | #define LIBAVFORMAT_BUILD LIBAVFORMAT_VERSION_INT 43 | 44 | #define LIBAVFORMAT_IDENT "Lavf" AV_STRINGIFY(LIBAVFORMAT_VERSION) 45 | 46 | /** 47 | * FF_API_* defines may be placed below to indicate public API that will be 48 | * dropped at a future version bump. The defines themselves are not part of 49 | * the public API and may change, break or disappear at any time. 50 | */ 51 | 52 | #endif /* AVFORMAT_VERSION_H */ 53 | -------------------------------------------------------------------------------- /ffmpeg/include/libavresample/version.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of Libav. 3 | * 4 | * Libav is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2.1 of the License, or (at your option) any later version. 8 | * 9 | * Libav is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with Libav; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | */ 18 | 19 | #ifndef AVRESAMPLE_VERSION_H 20 | #define AVRESAMPLE_VERSION_H 21 | 22 | /** 23 | * @file 24 | * @ingroup lavr 25 | * Libavresample version macros. 26 | */ 27 | 28 | #define LIBAVRESAMPLE_VERSION_MAJOR 1 29 | #define LIBAVRESAMPLE_VERSION_MINOR 1 30 | #define LIBAVRESAMPLE_VERSION_MICRO 0 31 | 32 | #define LIBAVRESAMPLE_VERSION_INT AV_VERSION_INT(LIBAVRESAMPLE_VERSION_MAJOR, \ 33 | LIBAVRESAMPLE_VERSION_MINOR, \ 34 | LIBAVRESAMPLE_VERSION_MICRO) 35 | #define LIBAVRESAMPLE_VERSION AV_VERSION(LIBAVRESAMPLE_VERSION_MAJOR, \ 36 | LIBAVRESAMPLE_VERSION_MINOR, \ 37 | LIBAVRESAMPLE_VERSION_MICRO) 38 | #define LIBAVRESAMPLE_BUILD LIBAVRESAMPLE_VERSION_INT 39 | 40 | #define LIBAVRESAMPLE_IDENT "Lavr" AV_STRINGIFY(LIBAVRESAMPLE_VERSION) 41 | 42 | /** 43 | * FF_API_* defines may be placed below to indicate public API that will be 44 | * dropped at a future version bump. The defines themselves are not part of 45 | * the public API and may change, break or disappear at any time. 46 | */ 47 | 48 | #ifndef FF_API_RESAMPLE_CLOSE_OPEN 49 | #define FF_API_RESAMPLE_CLOSE_OPEN (LIBAVRESAMPLE_VERSION_MAJOR < 2) 50 | #endif 51 | 52 | #endif /* AVRESAMPLE_VERSION_H */ 53 | -------------------------------------------------------------------------------- /ffmpeg/include/libavutil/adler32.h: -------------------------------------------------------------------------------- 1 | /* 2 | * copyright (c) 2006 Mans Rullgard 3 | * 4 | * This file is part of Libav. 5 | * 6 | * Libav is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * Libav is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with Libav; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | #ifndef AVUTIL_ADLER32_H 22 | #define AVUTIL_ADLER32_H 23 | 24 | #include 25 | #include "attributes.h" 26 | 27 | /** 28 | * @ingroup lavu_crypto 29 | * Calculate the Adler32 checksum of a buffer. 30 | * 31 | * Passing the return value to a subsequent av_adler32_update() call 32 | * allows the checksum of multiple buffers to be calculated as though 33 | * they were concatenated. 34 | * 35 | * @param adler initial checksum value 36 | * @param buf pointer to input buffer 37 | * @param len size of input buffer 38 | * @return updated checksum 39 | */ 40 | unsigned long av_adler32_update(unsigned long adler, const uint8_t *buf, 41 | unsigned int len) av_pure; 42 | 43 | #endif /* AVUTIL_ADLER32_H */ 44 | -------------------------------------------------------------------------------- /ffmpeg/include/libavutil/aes.h: -------------------------------------------------------------------------------- 1 | /* 2 | * copyright (c) 2007 Michael Niedermayer 3 | * 4 | * This file is part of Libav. 5 | * 6 | * Libav is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * Libav is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with Libav; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | #ifndef AVUTIL_AES_H 22 | #define AVUTIL_AES_H 23 | 24 | #include 25 | 26 | #include "attributes.h" 27 | #include "version.h" 28 | 29 | /** 30 | * @defgroup lavu_aes AES 31 | * @ingroup lavu_crypto 32 | * @{ 33 | */ 34 | 35 | #if FF_API_CONTEXT_SIZE 36 | extern attribute_deprecated const int av_aes_size; 37 | #endif 38 | 39 | struct AVAES; 40 | 41 | /** 42 | * Allocate an AVAES context. 43 | */ 44 | struct AVAES *av_aes_alloc(void); 45 | 46 | /** 47 | * Initialize an AVAES context. 48 | * @param key_bits 128, 192 or 256 49 | * @param decrypt 0 for encryption, 1 for decryption 50 | */ 51 | int av_aes_init(struct AVAES *a, const uint8_t *key, int key_bits, int decrypt); 52 | 53 | /** 54 | * Encrypt or decrypt a buffer using a previously initialized context. 55 | * @param count number of 16 byte blocks 56 | * @param dst destination array, can be equal to src 57 | * @param src source array, can be equal to dst 58 | * @param iv initialization vector for CBC mode, if NULL then ECB will be used 59 | * @param decrypt 0 for encryption, 1 for decryption 60 | */ 61 | void av_aes_crypt(struct AVAES *a, uint8_t *dst, const uint8_t *src, int count, uint8_t *iv, int decrypt); 62 | 63 | /** 64 | * @} 65 | */ 66 | 67 | #endif /* AVUTIL_AES_H */ 68 | -------------------------------------------------------------------------------- /ffmpeg/include/libavutil/attributes.h: -------------------------------------------------------------------------------- 1 | /* 2 | * copyright (c) 2006 Michael Niedermayer 3 | * 4 | * This file is part of Libav. 5 | * 6 | * Libav is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * Libav is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with Libav; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | /** 22 | * @file 23 | * Macro definitions for various function/variable attributes 24 | */ 25 | 26 | #ifndef AVUTIL_ATTRIBUTES_H 27 | #define AVUTIL_ATTRIBUTES_H 28 | 29 | #ifdef __GNUC__ 30 | # define AV_GCC_VERSION_AT_LEAST(x,y) (__GNUC__ > x || __GNUC__ == x && __GNUC_MINOR__ >= y) 31 | #else 32 | # define AV_GCC_VERSION_AT_LEAST(x,y) 0 33 | #endif 34 | 35 | #if AV_GCC_VERSION_AT_LEAST(3,1) 36 | # define av_always_inline __attribute__((always_inline)) inline 37 | #elif defined(_MSC_VER) 38 | # define av_always_inline __forceinline 39 | #else 40 | # define av_always_inline inline 41 | #endif 42 | 43 | #if AV_GCC_VERSION_AT_LEAST(3,1) 44 | # define av_noinline __attribute__((noinline)) 45 | #else 46 | # define av_noinline 47 | #endif 48 | 49 | #if AV_GCC_VERSION_AT_LEAST(3,1) 50 | # define av_pure __attribute__((pure)) 51 | #else 52 | # define av_pure 53 | #endif 54 | 55 | #if AV_GCC_VERSION_AT_LEAST(2,6) 56 | # define av_const __attribute__((const)) 57 | #else 58 | # define av_const 59 | #endif 60 | 61 | #if AV_GCC_VERSION_AT_LEAST(4,3) 62 | # define av_cold __attribute__((cold)) 63 | #else 64 | # define av_cold 65 | #endif 66 | 67 | #if AV_GCC_VERSION_AT_LEAST(4,1) 68 | # define av_flatten __attribute__((flatten)) 69 | #else 70 | # define av_flatten 71 | #endif 72 | 73 | #if AV_GCC_VERSION_AT_LEAST(3,1) 74 | # define attribute_deprecated __attribute__((deprecated)) 75 | #else 76 | # define attribute_deprecated 77 | #endif 78 | 79 | #if defined(__GNUC__) 80 | # define av_unused __attribute__((unused)) 81 | #else 82 | # define av_unused 83 | #endif 84 | 85 | /** 86 | * Mark a variable as used and prevent the compiler from optimizing it 87 | * away. This is useful for variables accessed only from inline 88 | * assembler without the compiler being aware. 89 | */ 90 | #if AV_GCC_VERSION_AT_LEAST(3,1) 91 | # define av_used __attribute__((used)) 92 | #else 93 | # define av_used 94 | #endif 95 | 96 | #if AV_GCC_VERSION_AT_LEAST(3,3) 97 | # define av_alias __attribute__((may_alias)) 98 | #else 99 | # define av_alias 100 | #endif 101 | 102 | #if defined(__GNUC__) && !defined(__ICC) 103 | # define av_uninit(x) x=x 104 | #else 105 | # define av_uninit(x) x 106 | #endif 107 | 108 | #ifdef __GNUC__ 109 | # define av_builtin_constant_p __builtin_constant_p 110 | # define av_printf_format(fmtpos, attrpos) __attribute__((__format__(__printf__, fmtpos, attrpos))) 111 | #else 112 | # define av_builtin_constant_p(x) 0 113 | # define av_printf_format(fmtpos, attrpos) 114 | #endif 115 | 116 | #if AV_GCC_VERSION_AT_LEAST(2,5) 117 | # define av_noreturn __attribute__((noreturn)) 118 | #else 119 | # define av_noreturn 120 | #endif 121 | 122 | #endif /* AVUTIL_ATTRIBUTES_H */ 123 | -------------------------------------------------------------------------------- /ffmpeg/include/libavutil/audio_fifo.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Audio FIFO 3 | * Copyright (c) 2012 Justin Ruggles 4 | * 5 | * This file is part of Libav. 6 | * 7 | * Libav is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public 9 | * License as published by the Free Software Foundation; either 10 | * version 2.1 of the License, or (at your option) any later version. 11 | * 12 | * Libav is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public 18 | * License along with Libav; if not, write to the Free Software 19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 20 | */ 21 | 22 | /** 23 | * @file 24 | * Audio FIFO Buffer 25 | */ 26 | 27 | #ifndef AVUTIL_AUDIO_FIFO_H 28 | #define AVUTIL_AUDIO_FIFO_H 29 | 30 | #include "avutil.h" 31 | #include "fifo.h" 32 | #include "samplefmt.h" 33 | 34 | /** 35 | * @addtogroup lavu_audio 36 | * @{ 37 | */ 38 | 39 | /** 40 | * Context for an Audio FIFO Buffer. 41 | * 42 | * - Operates at the sample level rather than the byte level. 43 | * - Supports multiple channels with either planar or packed sample format. 44 | * - Automatic reallocation when writing to a full buffer. 45 | */ 46 | typedef struct AVAudioFifo AVAudioFifo; 47 | 48 | /** 49 | * Free an AVAudioFifo. 50 | * 51 | * @param af AVAudioFifo to free 52 | */ 53 | void av_audio_fifo_free(AVAudioFifo *af); 54 | 55 | /** 56 | * Allocate an AVAudioFifo. 57 | * 58 | * @param sample_fmt sample format 59 | * @param channels number of channels 60 | * @param nb_samples initial allocation size, in samples 61 | * @return newly allocated AVAudioFifo, or NULL on error 62 | */ 63 | AVAudioFifo *av_audio_fifo_alloc(enum AVSampleFormat sample_fmt, int channels, 64 | int nb_samples); 65 | 66 | /** 67 | * Reallocate an AVAudioFifo. 68 | * 69 | * @param af AVAudioFifo to reallocate 70 | * @param nb_samples new allocation size, in samples 71 | * @return 0 if OK, or negative AVERROR code on failure 72 | */ 73 | int av_audio_fifo_realloc(AVAudioFifo *af, int nb_samples); 74 | 75 | /** 76 | * Write data to an AVAudioFifo. 77 | * 78 | * The AVAudioFifo will be reallocated automatically if the available space 79 | * is less than nb_samples. 80 | * 81 | * @see enum AVSampleFormat 82 | * The documentation for AVSampleFormat describes the data layout. 83 | * 84 | * @param af AVAudioFifo to write to 85 | * @param data audio data plane pointers 86 | * @param nb_samples number of samples to write 87 | * @return number of samples actually written, or negative AVERROR 88 | * code on failure. 89 | */ 90 | int av_audio_fifo_write(AVAudioFifo *af, void **data, int nb_samples); 91 | 92 | /** 93 | * Read data from an AVAudioFifo. 94 | * 95 | * @see enum AVSampleFormat 96 | * The documentation for AVSampleFormat describes the data layout. 97 | * 98 | * @param af AVAudioFifo to read from 99 | * @param data audio data plane pointers 100 | * @param nb_samples number of samples to read 101 | * @return number of samples actually read, or negative AVERROR code 102 | * on failure. 103 | */ 104 | int av_audio_fifo_read(AVAudioFifo *af, void **data, int nb_samples); 105 | 106 | /** 107 | * Drain data from an AVAudioFifo. 108 | * 109 | * Removes the data without reading it. 110 | * 111 | * @param af AVAudioFifo to drain 112 | * @param nb_samples number of samples to drain 113 | * @return 0 if OK, or negative AVERROR code on failure 114 | */ 115 | int av_audio_fifo_drain(AVAudioFifo *af, int nb_samples); 116 | 117 | /** 118 | * Reset the AVAudioFifo buffer. 119 | * 120 | * This empties all data in the buffer. 121 | * 122 | * @param af AVAudioFifo to reset 123 | */ 124 | void av_audio_fifo_reset(AVAudioFifo *af); 125 | 126 | /** 127 | * Get the current number of samples in the AVAudioFifo available for reading. 128 | * 129 | * @param af the AVAudioFifo to query 130 | * @return number of samples available for reading 131 | */ 132 | int av_audio_fifo_size(AVAudioFifo *af); 133 | 134 | /** 135 | * Get the current number of samples in the AVAudioFifo available for writing. 136 | * 137 | * @param af the AVAudioFifo to query 138 | * @return number of samples available for writing 139 | */ 140 | int av_audio_fifo_space(AVAudioFifo *af); 141 | 142 | /** 143 | * @} 144 | */ 145 | 146 | #endif /* AVUTIL_AUDIO_FIFO_H */ 147 | -------------------------------------------------------------------------------- /ffmpeg/include/libavutil/audioconvert.h: -------------------------------------------------------------------------------- 1 | 2 | #include "version.h" 3 | 4 | #if FF_API_AUDIOCONVERT 5 | #include "channel_layout.h" 6 | #endif 7 | -------------------------------------------------------------------------------- /ffmpeg/include/libavutil/avassert.h: -------------------------------------------------------------------------------- 1 | /* 2 | * copyright (c) 2010 Michael Niedermayer 3 | * 4 | * This file is part of Libav. 5 | * 6 | * Libav is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * Libav is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with Libav; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | /** 22 | * @file 23 | * simple assert() macros that are a bit more flexible than ISO C assert(). 24 | * @author Michael Niedermayer 25 | */ 26 | 27 | #ifndef AVUTIL_AVASSERT_H 28 | #define AVUTIL_AVASSERT_H 29 | 30 | #include 31 | #include "avutil.h" 32 | #include "log.h" 33 | 34 | /** 35 | * assert() equivalent, that is always enabled. 36 | */ 37 | #define av_assert0(cond) do { \ 38 | if (!(cond)) { \ 39 | av_log(NULL, AV_LOG_FATAL, "Assertion %s failed at %s:%d\n", \ 40 | AV_STRINGIFY(cond), __FILE__, __LINE__); \ 41 | abort(); \ 42 | } \ 43 | } while (0) 44 | 45 | 46 | /** 47 | * assert() equivalent, that does not lie in speed critical code. 48 | * These asserts() thus can be enabled without fearing speedloss. 49 | */ 50 | #if defined(ASSERT_LEVEL) && ASSERT_LEVEL > 0 51 | #define av_assert1(cond) av_assert0(cond) 52 | #else 53 | #define av_assert1(cond) ((void)0) 54 | #endif 55 | 56 | 57 | /** 58 | * assert() equivalent, that does lie in speed critical code. 59 | */ 60 | #if defined(ASSERT_LEVEL) && ASSERT_LEVEL > 1 61 | #define av_assert2(cond) av_assert0(cond) 62 | #else 63 | #define av_assert2(cond) ((void)0) 64 | #endif 65 | 66 | #endif /* AVUTIL_AVASSERT_H */ 67 | -------------------------------------------------------------------------------- /ffmpeg/include/libavutil/avconfig.h: -------------------------------------------------------------------------------- 1 | /* Generated by ffconf */ 2 | #ifndef AVUTIL_AVCONFIG_H 3 | #define AVUTIL_AVCONFIG_H 4 | #define AV_HAVE_BIGENDIAN 0 5 | #define AV_HAVE_FAST_UNALIGNED 1 6 | #endif /* AVUTIL_AVCONFIG_H */ 7 | -------------------------------------------------------------------------------- /ffmpeg/include/libavutil/avstring.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2007 Mans Rullgard 3 | * 4 | * This file is part of Libav. 5 | * 6 | * Libav is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * Libav is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with Libav; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | #ifndef AVUTIL_AVSTRING_H 22 | #define AVUTIL_AVSTRING_H 23 | 24 | #include 25 | #include "attributes.h" 26 | 27 | /** 28 | * @addtogroup lavu_string 29 | * @{ 30 | */ 31 | 32 | /** 33 | * Return non-zero if pfx is a prefix of str. If it is, *ptr is set to 34 | * the address of the first character in str after the prefix. 35 | * 36 | * @param str input string 37 | * @param pfx prefix to test 38 | * @param ptr updated if the prefix is matched inside str 39 | * @return non-zero if the prefix matches, zero otherwise 40 | */ 41 | int av_strstart(const char *str, const char *pfx, const char **ptr); 42 | 43 | /** 44 | * Return non-zero if pfx is a prefix of str independent of case. If 45 | * it is, *ptr is set to the address of the first character in str 46 | * after the prefix. 47 | * 48 | * @param str input string 49 | * @param pfx prefix to test 50 | * @param ptr updated if the prefix is matched inside str 51 | * @return non-zero if the prefix matches, zero otherwise 52 | */ 53 | int av_stristart(const char *str, const char *pfx, const char **ptr); 54 | 55 | /** 56 | * Locate the first case-independent occurrence in the string haystack 57 | * of the string needle. A zero-length string needle is considered to 58 | * match at the start of haystack. 59 | * 60 | * This function is a case-insensitive version of the standard strstr(). 61 | * 62 | * @param haystack string to search in 63 | * @param needle string to search for 64 | * @return pointer to the located match within haystack 65 | * or a null pointer if no match 66 | */ 67 | char *av_stristr(const char *haystack, const char *needle); 68 | 69 | /** 70 | * Locate the first occurrence of the string needle in the string haystack 71 | * where not more than hay_length characters are searched. A zero-length 72 | * string needle is considered to match at the start of haystack. 73 | * 74 | * This function is a length-limited version of the standard strstr(). 75 | * 76 | * @param haystack string to search in 77 | * @param needle string to search for 78 | * @param hay_length length of string to search in 79 | * @return pointer to the located match within haystack 80 | * or a null pointer if no match 81 | */ 82 | char *av_strnstr(const char *haystack, const char *needle, size_t hay_length); 83 | 84 | /** 85 | * Copy the string src to dst, but no more than size - 1 bytes, and 86 | * null-terminate dst. 87 | * 88 | * This function is the same as BSD strlcpy(). 89 | * 90 | * @param dst destination buffer 91 | * @param src source string 92 | * @param size size of destination buffer 93 | * @return the length of src 94 | * 95 | * @warning since the return value is the length of src, src absolutely 96 | * _must_ be a properly 0-terminated string, otherwise this will read beyond 97 | * the end of the buffer and possibly crash. 98 | */ 99 | size_t av_strlcpy(char *dst, const char *src, size_t size); 100 | 101 | /** 102 | * Append the string src to the string dst, but to a total length of 103 | * no more than size - 1 bytes, and null-terminate dst. 104 | * 105 | * This function is similar to BSD strlcat(), but differs when 106 | * size <= strlen(dst). 107 | * 108 | * @param dst destination buffer 109 | * @param src source string 110 | * @param size size of destination buffer 111 | * @return the total length of src and dst 112 | * 113 | * @warning since the return value use the length of src and dst, these 114 | * absolutely _must_ be a properly 0-terminated strings, otherwise this 115 | * will read beyond the end of the buffer and possibly crash. 116 | */ 117 | size_t av_strlcat(char *dst, const char *src, size_t size); 118 | 119 | /** 120 | * Append output to a string, according to a format. Never write out of 121 | * the destination buffer, and always put a terminating 0 within 122 | * the buffer. 123 | * @param dst destination buffer (string to which the output is 124 | * appended) 125 | * @param size total size of the destination buffer 126 | * @param fmt printf-compatible format string, specifying how the 127 | * following parameters are used 128 | * @return the length of the string that would have been generated 129 | * if enough space had been available 130 | */ 131 | size_t av_strlcatf(char *dst, size_t size, const char *fmt, ...) av_printf_format(3, 4); 132 | 133 | /** 134 | * Convert a number to a av_malloced string. 135 | */ 136 | char *av_d2str(double d); 137 | 138 | /** 139 | * Unescape the given string until a non escaped terminating char, 140 | * and return the token corresponding to the unescaped string. 141 | * 142 | * The normal \ and ' escaping is supported. Leading and trailing 143 | * whitespaces are removed, unless they are escaped with '\' or are 144 | * enclosed between ''. 145 | * 146 | * @param buf the buffer to parse, buf will be updated to point to the 147 | * terminating char 148 | * @param term a 0-terminated list of terminating chars 149 | * @return the malloced unescaped string, which must be av_freed by 150 | * the user, NULL in case of allocation failure 151 | */ 152 | char *av_get_token(const char **buf, const char *term); 153 | 154 | /** 155 | * Locale-independent conversion of ASCII isdigit. 156 | */ 157 | int av_isdigit(int c); 158 | 159 | /** 160 | * Locale-independent conversion of ASCII isgraph. 161 | */ 162 | int av_isgraph(int c); 163 | 164 | /** 165 | * Locale-independent conversion of ASCII isspace. 166 | */ 167 | int av_isspace(int c); 168 | 169 | /** 170 | * Locale-independent conversion of ASCII characters to uppercase. 171 | */ 172 | static inline int av_toupper(int c) 173 | { 174 | if (c >= 'a' && c <= 'z') 175 | c ^= 0x20; 176 | return c; 177 | } 178 | 179 | /** 180 | * Locale-independent conversion of ASCII characters to lowercase. 181 | */ 182 | static inline int av_tolower(int c) 183 | { 184 | if (c >= 'A' && c <= 'Z') 185 | c ^= 0x20; 186 | return c; 187 | } 188 | 189 | /** 190 | * Locale-independent conversion of ASCII isxdigit. 191 | */ 192 | int av_isxdigit(int c); 193 | 194 | /* 195 | * Locale-independent case-insensitive compare. 196 | * @note This means only ASCII-range characters are case-insensitive 197 | */ 198 | int av_strcasecmp(const char *a, const char *b); 199 | 200 | /** 201 | * Locale-independent case-insensitive compare. 202 | * @note This means only ASCII-range characters are case-insensitive 203 | */ 204 | int av_strncasecmp(const char *a, const char *b, size_t n); 205 | 206 | 207 | /** 208 | * Thread safe basename. 209 | * @param path the path, on DOS both \ and / are considered separators. 210 | * @return pointer to the basename substring. 211 | */ 212 | const char *av_basename(const char *path); 213 | 214 | /** 215 | * Thread safe dirname. 216 | * @param path the path, on DOS both \ and / are considered separators. 217 | * @return the path with the separator replaced by the string terminator or ".". 218 | * @note the function may change the input string. 219 | */ 220 | const char *av_dirname(char *path); 221 | 222 | /** 223 | * @} 224 | */ 225 | 226 | #endif /* AVUTIL_AVSTRING_H */ 227 | -------------------------------------------------------------------------------- /ffmpeg/include/libavutil/base64.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2006 Ryan Martell. (rdm4@martellventures.com) 3 | * 4 | * This file is part of Libav. 5 | * 6 | * Libav is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * Libav is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with Libav; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | #ifndef AVUTIL_BASE64_H 22 | #define AVUTIL_BASE64_H 23 | 24 | #include 25 | 26 | /** 27 | * @defgroup lavu_base64 Base64 28 | * @ingroup lavu_crypto 29 | * @{ 30 | */ 31 | 32 | 33 | /** 34 | * Decode a base64-encoded string. 35 | * 36 | * @param out buffer for decoded data 37 | * @param in null-terminated input string 38 | * @param out_size size in bytes of the out buffer, must be at 39 | * least 3/4 of the length of in 40 | * @return number of bytes written, or a negative value in case of 41 | * invalid input 42 | */ 43 | int av_base64_decode(uint8_t *out, const char *in, int out_size); 44 | 45 | /** 46 | * Encode data to base64 and null-terminate. 47 | * 48 | * @param out buffer for encoded data 49 | * @param out_size size in bytes of the output buffer, must be at 50 | * least AV_BASE64_SIZE(in_size) 51 | * @param in_size size in bytes of the 'in' buffer 52 | * @return 'out' or NULL in case of error 53 | */ 54 | char *av_base64_encode(char *out, int out_size, const uint8_t *in, int in_size); 55 | 56 | /** 57 | * Calculate the output size needed to base64-encode x bytes. 58 | */ 59 | #define AV_BASE64_SIZE(x) (((x)+2) / 3 * 4 + 1) 60 | 61 | /** 62 | * @} 63 | */ 64 | 65 | #endif /* AVUTIL_BASE64_H */ 66 | -------------------------------------------------------------------------------- /ffmpeg/include/libavutil/blowfish.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Blowfish algorithm 3 | * 4 | * This file is part of Libav. 5 | * 6 | * Libav is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * Libav is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with Libav; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | #ifndef AVUTIL_BLOWFISH_H 22 | #define AVUTIL_BLOWFISH_H 23 | 24 | #include 25 | 26 | /** 27 | * @defgroup lavu_blowfish Blowfish 28 | * @ingroup lavu_crypto 29 | * @{ 30 | */ 31 | 32 | #define AV_BF_ROUNDS 16 33 | 34 | typedef struct AVBlowfish { 35 | uint32_t p[AV_BF_ROUNDS + 2]; 36 | uint32_t s[4][256]; 37 | } AVBlowfish; 38 | 39 | /** 40 | * Initialize an AVBlowfish context. 41 | * 42 | * @param ctx an AVBlowfish context 43 | * @param key a key 44 | * @param key_len length of the key 45 | */ 46 | void av_blowfish_init(struct AVBlowfish *ctx, const uint8_t *key, int key_len); 47 | 48 | /** 49 | * Encrypt or decrypt a buffer using a previously initialized context. 50 | * 51 | * @param ctx an AVBlowfish context 52 | * @param xl left four bytes halves of input to be encrypted 53 | * @param xr right four bytes halves of input to be encrypted 54 | * @param decrypt 0 for encryption, 1 for decryption 55 | */ 56 | void av_blowfish_crypt_ecb(struct AVBlowfish *ctx, uint32_t *xl, uint32_t *xr, 57 | int decrypt); 58 | 59 | /** 60 | * Encrypt or decrypt a buffer using a previously initialized context. 61 | * 62 | * @param ctx an AVBlowfish context 63 | * @param dst destination array, can be equal to src 64 | * @param src source array, can be equal to dst 65 | * @param count number of 8 byte blocks 66 | * @param iv initialization vector for CBC mode, if NULL ECB will be used 67 | * @param decrypt 0 for encryption, 1 for decryption 68 | */ 69 | void av_blowfish_crypt(struct AVBlowfish *ctx, uint8_t *dst, const uint8_t *src, 70 | int count, uint8_t *iv, int decrypt); 71 | 72 | /** 73 | * @} 74 | */ 75 | 76 | #endif /* AVUTIL_BLOWFISH_H */ 77 | -------------------------------------------------------------------------------- /ffmpeg/include/libavutil/bswap.h: -------------------------------------------------------------------------------- 1 | /* 2 | * copyright (c) 2006 Michael Niedermayer 3 | * 4 | * This file is part of Libav. 5 | * 6 | * Libav is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * Libav is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with Libav; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | /** 22 | * @file 23 | * byte swapping routines 24 | */ 25 | 26 | #ifndef AVUTIL_BSWAP_H 27 | #define AVUTIL_BSWAP_H 28 | 29 | #include 30 | #include "libavutil/avconfig.h" 31 | #include "attributes.h" 32 | 33 | #ifdef HAVE_AV_CONFIG_H 34 | 35 | #include "config.h" 36 | 37 | #if ARCH_ARM 38 | # include "arm/bswap.h" 39 | #elif ARCH_AVR32 40 | # include "avr32/bswap.h" 41 | #elif ARCH_BFIN 42 | # include "bfin/bswap.h" 43 | #elif ARCH_SH4 44 | # include "sh4/bswap.h" 45 | #elif ARCH_X86 46 | # include "x86/bswap.h" 47 | #endif 48 | 49 | #endif /* HAVE_AV_CONFIG_H */ 50 | 51 | #define AV_BSWAP16C(x) (((x) << 8 & 0xff00) | ((x) >> 8 & 0x00ff)) 52 | #define AV_BSWAP32C(x) (AV_BSWAP16C(x) << 16 | AV_BSWAP16C((x) >> 16)) 53 | #define AV_BSWAP64C(x) (AV_BSWAP32C(x) << 32 | AV_BSWAP32C((x) >> 32)) 54 | 55 | #define AV_BSWAPC(s, x) AV_BSWAP##s##C(x) 56 | 57 | #ifndef av_bswap16 58 | static av_always_inline av_const uint16_t av_bswap16(uint16_t x) 59 | { 60 | x= (x>>8) | (x<<8); 61 | return x; 62 | } 63 | #endif 64 | 65 | #ifndef av_bswap32 66 | static av_always_inline av_const uint32_t av_bswap32(uint32_t x) 67 | { 68 | return AV_BSWAP32C(x); 69 | } 70 | #endif 71 | 72 | #ifndef av_bswap64 73 | static inline uint64_t av_const av_bswap64(uint64_t x) 74 | { 75 | return (uint64_t)av_bswap32(x) << 32 | av_bswap32(x >> 32); 76 | } 77 | #endif 78 | 79 | // be2ne ... big-endian to native-endian 80 | // le2ne ... little-endian to native-endian 81 | 82 | #if AV_HAVE_BIGENDIAN 83 | #define av_be2ne16(x) (x) 84 | #define av_be2ne32(x) (x) 85 | #define av_be2ne64(x) (x) 86 | #define av_le2ne16(x) av_bswap16(x) 87 | #define av_le2ne32(x) av_bswap32(x) 88 | #define av_le2ne64(x) av_bswap64(x) 89 | #define AV_BE2NEC(s, x) (x) 90 | #define AV_LE2NEC(s, x) AV_BSWAPC(s, x) 91 | #else 92 | #define av_be2ne16(x) av_bswap16(x) 93 | #define av_be2ne32(x) av_bswap32(x) 94 | #define av_be2ne64(x) av_bswap64(x) 95 | #define av_le2ne16(x) (x) 96 | #define av_le2ne32(x) (x) 97 | #define av_le2ne64(x) (x) 98 | #define AV_BE2NEC(s, x) AV_BSWAPC(s, x) 99 | #define AV_LE2NEC(s, x) (x) 100 | #endif 101 | 102 | #define AV_BE2NE16C(x) AV_BE2NEC(16, x) 103 | #define AV_BE2NE32C(x) AV_BE2NEC(32, x) 104 | #define AV_BE2NE64C(x) AV_BE2NEC(64, x) 105 | #define AV_LE2NE16C(x) AV_LE2NEC(16, x) 106 | #define AV_LE2NE32C(x) AV_LE2NEC(32, x) 107 | #define AV_LE2NE64C(x) AV_LE2NEC(64, x) 108 | 109 | #endif /* AVUTIL_BSWAP_H */ 110 | -------------------------------------------------------------------------------- /ffmpeg/include/libavutil/cpu.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2000, 2001, 2002 Fabrice Bellard 3 | * 4 | * This file is part of Libav. 5 | * 6 | * Libav is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * Libav is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with Libav; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | #ifndef AVUTIL_CPU_H 22 | #define AVUTIL_CPU_H 23 | 24 | #include "version.h" 25 | 26 | #define AV_CPU_FLAG_FORCE 0x80000000 /* force usage of selected flags (OR) */ 27 | 28 | /* lower 16 bits - CPU features */ 29 | #define AV_CPU_FLAG_MMX 0x0001 ///< standard MMX 30 | #define AV_CPU_FLAG_MMXEXT 0x0002 ///< SSE integer functions or AMD MMX ext 31 | #if FF_API_CPU_FLAG_MMX2 32 | #define AV_CPU_FLAG_MMX2 0x0002 ///< SSE integer functions or AMD MMX ext 33 | #endif 34 | #define AV_CPU_FLAG_3DNOW 0x0004 ///< AMD 3DNOW 35 | #define AV_CPU_FLAG_SSE 0x0008 ///< SSE functions 36 | #define AV_CPU_FLAG_SSE2 0x0010 ///< PIV SSE2 functions 37 | #define AV_CPU_FLAG_SSE2SLOW 0x40000000 ///< SSE2 supported, but usually not faster 38 | #define AV_CPU_FLAG_3DNOWEXT 0x0020 ///< AMD 3DNowExt 39 | #define AV_CPU_FLAG_SSE3 0x0040 ///< Prescott SSE3 functions 40 | #define AV_CPU_FLAG_SSE3SLOW 0x20000000 ///< SSE3 supported, but usually not faster 41 | #define AV_CPU_FLAG_SSSE3 0x0080 ///< Conroe SSSE3 functions 42 | #define AV_CPU_FLAG_ATOM 0x10000000 ///< Atom processor, some SSSE3 instructions are slower 43 | #define AV_CPU_FLAG_SSE4 0x0100 ///< Penryn SSE4.1 functions 44 | #define AV_CPU_FLAG_SSE42 0x0200 ///< Nehalem SSE4.2 functions 45 | #define AV_CPU_FLAG_AVX 0x4000 ///< AVX functions: requires OS support even if YMM registers aren't used 46 | #define AV_CPU_FLAG_XOP 0x0400 ///< Bulldozer XOP functions 47 | #define AV_CPU_FLAG_FMA4 0x0800 ///< Bulldozer FMA4 functions 48 | #define AV_CPU_FLAG_CMOV 0x1000 ///< i686 cmov 49 | 50 | #define AV_CPU_FLAG_ALTIVEC 0x0001 ///< standard 51 | 52 | #define AV_CPU_FLAG_ARMV5TE (1 << 0) 53 | #define AV_CPU_FLAG_ARMV6 (1 << 1) 54 | #define AV_CPU_FLAG_ARMV6T2 (1 << 2) 55 | #define AV_CPU_FLAG_VFP (1 << 3) 56 | #define AV_CPU_FLAG_VFPV3 (1 << 4) 57 | #define AV_CPU_FLAG_NEON (1 << 5) 58 | 59 | /** 60 | * Return the flags which specify extensions supported by the CPU. 61 | */ 62 | int av_get_cpu_flags(void); 63 | 64 | /** 65 | * Set a mask on flags returned by av_get_cpu_flags(). 66 | * This function is mainly useful for testing. 67 | * 68 | * @warning this function is not thread safe. 69 | */ 70 | void av_set_cpu_flags_mask(int mask); 71 | 72 | /** 73 | * Parse CPU flags from a string. 74 | * 75 | * @return a combination of AV_CPU_* flags, negative on error. 76 | */ 77 | int av_parse_cpu_flags(const char *s); 78 | 79 | /** 80 | * @return the number of logical CPU cores present. 81 | */ 82 | int av_cpu_count(void); 83 | 84 | /* The following CPU-specific functions shall not be called directly. */ 85 | int ff_get_cpu_flags_arm(void); 86 | int ff_get_cpu_flags_ppc(void); 87 | int ff_get_cpu_flags_x86(void); 88 | 89 | #endif /* AVUTIL_CPU_H */ 90 | -------------------------------------------------------------------------------- /ffmpeg/include/libavutil/crc.h: -------------------------------------------------------------------------------- 1 | /* 2 | * copyright (c) 2006 Michael Niedermayer 3 | * 4 | * This file is part of Libav. 5 | * 6 | * Libav is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * Libav is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with Libav; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | #ifndef AVUTIL_CRC_H 22 | #define AVUTIL_CRC_H 23 | 24 | #include 25 | #include 26 | #include "attributes.h" 27 | 28 | typedef uint32_t AVCRC; 29 | 30 | typedef enum { 31 | AV_CRC_8_ATM, 32 | AV_CRC_16_ANSI, 33 | AV_CRC_16_CCITT, 34 | AV_CRC_32_IEEE, 35 | AV_CRC_32_IEEE_LE, /*< reversed bitorder version of AV_CRC_32_IEEE */ 36 | AV_CRC_MAX, /*< Not part of public API! Do not use outside libavutil. */ 37 | }AVCRCId; 38 | 39 | /** 40 | * Initialize a CRC table. 41 | * @param ctx must be an array of size sizeof(AVCRC)*257 or sizeof(AVCRC)*1024 42 | * @param le If 1, the lowest bit represents the coefficient for the highest 43 | * exponent of the corresponding polynomial (both for poly and 44 | * actual CRC). 45 | * If 0, you must swap the CRC parameter and the result of av_crc 46 | * if you need the standard representation (can be simplified in 47 | * most cases to e.g. bswap16): 48 | * av_bswap32(crc << (32-bits)) 49 | * @param bits number of bits for the CRC 50 | * @param poly generator polynomial without the x**bits coefficient, in the 51 | * representation as specified by le 52 | * @param ctx_size size of ctx in bytes 53 | * @return <0 on failure 54 | */ 55 | int av_crc_init(AVCRC *ctx, int le, int bits, uint32_t poly, int ctx_size); 56 | 57 | /** 58 | * Get an initialized standard CRC table. 59 | * @param crc_id ID of a standard CRC 60 | * @return a pointer to the CRC table or NULL on failure 61 | */ 62 | const AVCRC *av_crc_get_table(AVCRCId crc_id); 63 | 64 | /** 65 | * Calculate the CRC of a block. 66 | * @param crc CRC of previous blocks if any or initial value for CRC 67 | * @return CRC updated with the data from the given block 68 | * 69 | * @see av_crc_init() "le" parameter 70 | */ 71 | uint32_t av_crc(const AVCRC *ctx, uint32_t crc, 72 | const uint8_t *buffer, size_t length) av_pure; 73 | 74 | #endif /* AVUTIL_CRC_H */ 75 | -------------------------------------------------------------------------------- /ffmpeg/include/libavutil/dict.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * This file is part of Libav. 4 | * 5 | * Libav is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 2.1 of the License, or (at your option) any later version. 9 | * 10 | * Libav is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with Libav; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 18 | */ 19 | 20 | /** 21 | * @file 22 | * Public dictionary API. 23 | */ 24 | 25 | #ifndef AVUTIL_DICT_H 26 | #define AVUTIL_DICT_H 27 | 28 | /** 29 | * @addtogroup lavu_dict AVDictionary 30 | * @ingroup lavu_data 31 | * 32 | * @brief Simple key:value store 33 | * 34 | * @{ 35 | * Dictionaries are used for storing key:value pairs. To create 36 | * an AVDictionary, simply pass an address of a NULL pointer to 37 | * av_dict_set(). NULL can be used as an empty dictionary wherever 38 | * a pointer to an AVDictionary is required. 39 | * Use av_dict_get() to retrieve an entry or iterate over all 40 | * entries and finally av_dict_free() to free the dictionary 41 | * and all its contents. 42 | * 43 | * @code 44 | * AVDictionary *d = NULL; // "create" an empty dictionary 45 | * av_dict_set(&d, "foo", "bar", 0); // add an entry 46 | * 47 | * char *k = av_strdup("key"); // if your strings are already allocated, 48 | * char *v = av_strdup("value"); // you can avoid copying them like this 49 | * av_dict_set(&d, k, v, AV_DICT_DONT_STRDUP_KEY | AV_DICT_DONT_STRDUP_VAL); 50 | * 51 | * AVDictionaryEntry *t = NULL; 52 | * while (t = av_dict_get(d, "", t, AV_DICT_IGNORE_SUFFIX)) { 53 | * <....> // iterate over all entries in d 54 | * } 55 | * 56 | * av_dict_free(&d); 57 | * @endcode 58 | * 59 | */ 60 | 61 | #define AV_DICT_MATCH_CASE 1 62 | #define AV_DICT_IGNORE_SUFFIX 2 63 | #define AV_DICT_DONT_STRDUP_KEY 4 /**< Take ownership of a key that's been 64 | allocated with av_malloc() and children. */ 65 | #define AV_DICT_DONT_STRDUP_VAL 8 /**< Take ownership of a value that's been 66 | allocated with av_malloc() and chilren. */ 67 | #define AV_DICT_DONT_OVERWRITE 16 ///< Don't overwrite existing entries. 68 | #define AV_DICT_APPEND 32 /**< If the entry already exists, append to it. Note that no 69 | delimiter is added, the strings are simply concatenated. */ 70 | 71 | typedef struct AVDictionaryEntry { 72 | char *key; 73 | char *value; 74 | } AVDictionaryEntry; 75 | 76 | typedef struct AVDictionary AVDictionary; 77 | 78 | /** 79 | * Get a dictionary entry with matching key. 80 | * 81 | * @param prev Set to the previous matching element to find the next. 82 | * If set to NULL the first matching element is returned. 83 | * @param flags Allows case as well as suffix-insensitive comparisons. 84 | * @return Found entry or NULL, changing key or value leads to undefined behavior. 85 | */ 86 | AVDictionaryEntry * 87 | av_dict_get(AVDictionary *m, const char *key, const AVDictionaryEntry *prev, int flags); 88 | 89 | /** 90 | * Get number of entries in dictionary. 91 | * 92 | * @param m dictionary 93 | * @return number of entries in dictionary 94 | */ 95 | int av_dict_count(const AVDictionary *m); 96 | 97 | /** 98 | * Set the given entry in *pm, overwriting an existing entry. 99 | * 100 | * @param pm pointer to a pointer to a dictionary struct. If *pm is NULL 101 | * a dictionary struct is allocated and put in *pm. 102 | * @param key entry key to add to *pm (will be av_strduped depending on flags) 103 | * @param value entry value to add to *pm (will be av_strduped depending on flags). 104 | * Passing a NULL value will cause an existing entry to be deleted. 105 | * @return >= 0 on success otherwise an error code <0 106 | */ 107 | int av_dict_set(AVDictionary **pm, const char *key, const char *value, int flags); 108 | 109 | /** 110 | * Parse the key/value pairs list and add to a dictionary. 111 | * 112 | * @param key_val_sep a 0-terminated list of characters used to separate 113 | * key from value 114 | * @param pairs_sep a 0-terminated list of characters used to separate 115 | * two pairs from each other 116 | * @param flags flags to use when adding to dictionary. 117 | * AV_DICT_DONT_STRDUP_KEY and AV_DICT_DONT_STRDUP_VAL 118 | * are ignored since the key/value tokens will always 119 | * be duplicated. 120 | * @return 0 on success, negative AVERROR code on failure 121 | */ 122 | int av_dict_parse_string(AVDictionary **pm, const char *str, 123 | const char *key_val_sep, const char *pairs_sep, 124 | int flags); 125 | 126 | /** 127 | * Copy entries from one AVDictionary struct into another. 128 | * @param dst pointer to a pointer to a AVDictionary struct. If *dst is NULL, 129 | * this function will allocate a struct for you and put it in *dst 130 | * @param src pointer to source AVDictionary struct 131 | * @param flags flags to use when setting entries in *dst 132 | * @note metadata is read using the AV_DICT_IGNORE_SUFFIX flag 133 | */ 134 | void av_dict_copy(AVDictionary **dst, AVDictionary *src, int flags); 135 | 136 | /** 137 | * Free all the memory allocated for an AVDictionary struct 138 | * and all keys and values. 139 | */ 140 | void av_dict_free(AVDictionary **m); 141 | 142 | /** 143 | * @} 144 | */ 145 | 146 | #endif /* AVUTIL_DICT_H */ 147 | -------------------------------------------------------------------------------- /ffmpeg/include/libavutil/error.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of Libav. 3 | * 4 | * Libav is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2.1 of the License, or (at your option) any later version. 8 | * 9 | * Libav is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with Libav; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | */ 18 | 19 | /** 20 | * @file 21 | * error code definitions 22 | */ 23 | 24 | #ifndef AVUTIL_ERROR_H 25 | #define AVUTIL_ERROR_H 26 | 27 | #include 28 | #include 29 | #include "avutil.h" 30 | 31 | /** 32 | * @addtogroup lavu_error 33 | * 34 | * @{ 35 | */ 36 | 37 | 38 | /* error handling */ 39 | #if EDOM > 0 40 | #define AVERROR(e) (-(e)) ///< Returns a negative error code from a POSIX error code, to return from library functions. 41 | #define AVUNERROR(e) (-(e)) ///< Returns a POSIX error code from a library function error return value. 42 | #else 43 | /* Some platforms have E* and errno already negated. */ 44 | #define AVERROR(e) (e) 45 | #define AVUNERROR(e) (e) 46 | #endif 47 | 48 | #define AVERROR_BSF_NOT_FOUND (-0x39acbd08) ///< Bitstream filter not found 49 | #define AVERROR_DECODER_NOT_FOUND (-0x3cbabb08) ///< Decoder not found 50 | #define AVERROR_DEMUXER_NOT_FOUND (-0x32babb08) ///< Demuxer not found 51 | #define AVERROR_ENCODER_NOT_FOUND (-0x3cb1ba08) ///< Encoder not found 52 | #define AVERROR_EOF (-0x5fb9b0bb) ///< End of file 53 | #define AVERROR_EXIT (-0x2bb6a7bb) ///< Immediate exit was requested; the called function should not be restarted 54 | #define AVERROR_FILTER_NOT_FOUND (-0x33b6b908) ///< Filter not found 55 | #define AVERROR_INVALIDDATA (-0x3ebbb1b7) ///< Invalid data found when processing input 56 | #define AVERROR_MUXER_NOT_FOUND (-0x27aab208) ///< Muxer not found 57 | #define AVERROR_OPTION_NOT_FOUND (-0x2bafb008) ///< Option not found 58 | #define AVERROR_PATCHWELCOME (-0x3aa8beb0) ///< Not yet implemented in Libav, patches welcome 59 | #define AVERROR_PROTOCOL_NOT_FOUND (-0x30adaf08) ///< Protocol not found 60 | #define AVERROR_STREAM_NOT_FOUND (-0x2dabac08) ///< Stream not found 61 | #define AVERROR_BUG (-0x5fb8aabe) ///< Bug detected, please report the issue 62 | #define AVERROR_UNKNOWN (-0x31b4b1ab) ///< Unknown error, typically from an external library 63 | #define AVERROR_EXPERIMENTAL (-0x2bb2afa8) ///< Requested feature is flagged experimental. Set strict_std_compliance if you really want to use it. 64 | 65 | /** 66 | * Put a description of the AVERROR code errnum in errbuf. 67 | * In case of failure the global variable errno is set to indicate the 68 | * error. Even in case of failure av_strerror() will print a generic 69 | * error message indicating the errnum provided to errbuf. 70 | * 71 | * @param errnum error code to describe 72 | * @param errbuf buffer to which description is written 73 | * @param errbuf_size the size in bytes of errbuf 74 | * @return 0 on success, a negative value if a description for errnum 75 | * cannot be found 76 | */ 77 | int av_strerror(int errnum, char *errbuf, size_t errbuf_size); 78 | 79 | /** 80 | * @} 81 | */ 82 | 83 | #endif /* AVUTIL_ERROR_H */ 84 | -------------------------------------------------------------------------------- /ffmpeg/include/libavutil/eval.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2002 Michael Niedermayer 3 | * 4 | * This file is part of Libav. 5 | * 6 | * Libav is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * Libav is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with Libav; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | /** 22 | * @file 23 | * simple arithmetic expression evaluator 24 | */ 25 | 26 | #ifndef AVUTIL_EVAL_H 27 | #define AVUTIL_EVAL_H 28 | 29 | #include "avutil.h" 30 | 31 | typedef struct AVExpr AVExpr; 32 | 33 | /** 34 | * Parse and evaluate an expression. 35 | * Note, this is significantly slower than av_expr_eval(). 36 | * 37 | * @param res a pointer to a double where is put the result value of 38 | * the expression, or NAN in case of error 39 | * @param s expression as a zero terminated string, for example "1+2^3+5*5+sin(2/3)" 40 | * @param const_names NULL terminated array of zero terminated strings of constant identifiers, for example {"PI", "E", 0} 41 | * @param const_values a zero terminated array of values for the identifiers from const_names 42 | * @param func1_names NULL terminated array of zero terminated strings of funcs1 identifiers 43 | * @param funcs1 NULL terminated array of function pointers for functions which take 1 argument 44 | * @param func2_names NULL terminated array of zero terminated strings of funcs2 identifiers 45 | * @param funcs2 NULL terminated array of function pointers for functions which take 2 arguments 46 | * @param opaque a pointer which will be passed to all functions from funcs1 and funcs2 47 | * @param log_ctx parent logging context 48 | * @return 0 in case of success, a negative value corresponding to an 49 | * AVERROR code otherwise 50 | */ 51 | int av_expr_parse_and_eval(double *res, const char *s, 52 | const char * const *const_names, const double *const_values, 53 | const char * const *func1_names, double (* const *funcs1)(void *, double), 54 | const char * const *func2_names, double (* const *funcs2)(void *, double, double), 55 | void *opaque, int log_offset, void *log_ctx); 56 | 57 | /** 58 | * Parse an expression. 59 | * 60 | * @param expr a pointer where is put an AVExpr containing the parsed 61 | * value in case of successful parsing, or NULL otherwise. 62 | * The pointed to AVExpr must be freed with av_expr_free() by the user 63 | * when it is not needed anymore. 64 | * @param s expression as a zero terminated string, for example "1+2^3+5*5+sin(2/3)" 65 | * @param const_names NULL terminated array of zero terminated strings of constant identifiers, for example {"PI", "E", 0} 66 | * @param func1_names NULL terminated array of zero terminated strings of funcs1 identifiers 67 | * @param funcs1 NULL terminated array of function pointers for functions which take 1 argument 68 | * @param func2_names NULL terminated array of zero terminated strings of funcs2 identifiers 69 | * @param funcs2 NULL terminated array of function pointers for functions which take 2 arguments 70 | * @param log_ctx parent logging context 71 | * @return 0 in case of success, a negative value corresponding to an 72 | * AVERROR code otherwise 73 | */ 74 | int av_expr_parse(AVExpr **expr, const char *s, 75 | const char * const *const_names, 76 | const char * const *func1_names, double (* const *funcs1)(void *, double), 77 | const char * const *func2_names, double (* const *funcs2)(void *, double, double), 78 | int log_offset, void *log_ctx); 79 | 80 | /** 81 | * Evaluate a previously parsed expression. 82 | * 83 | * @param const_values a zero terminated array of values for the identifiers from av_expr_parse() const_names 84 | * @param opaque a pointer which will be passed to all functions from funcs1 and funcs2 85 | * @return the value of the expression 86 | */ 87 | double av_expr_eval(AVExpr *e, const double *const_values, void *opaque); 88 | 89 | /** 90 | * Free a parsed expression previously created with av_expr_parse(). 91 | */ 92 | void av_expr_free(AVExpr *e); 93 | 94 | /** 95 | * Parse the string in numstr and return its value as a double. If 96 | * the string is empty, contains only whitespaces, or does not contain 97 | * an initial substring that has the expected syntax for a 98 | * floating-point number, no conversion is performed. In this case, 99 | * returns a value of zero and the value returned in tail is the value 100 | * of numstr. 101 | * 102 | * @param numstr a string representing a number, may contain one of 103 | * the International System number postfixes, for example 'K', 'M', 104 | * 'G'. If 'i' is appended after the postfix, powers of 2 are used 105 | * instead of powers of 10. The 'B' postfix multiplies the value for 106 | * 8, and can be appended after another postfix or used alone. This 107 | * allows using for example 'KB', 'MiB', 'G' and 'B' as postfix. 108 | * @param tail if non-NULL puts here the pointer to the char next 109 | * after the last parsed character 110 | */ 111 | double av_strtod(const char *numstr, char **tail); 112 | 113 | #endif /* AVUTIL_EVAL_H */ 114 | -------------------------------------------------------------------------------- /ffmpeg/include/libavutil/fifo.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of Libav. 3 | * 4 | * Libav is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2.1 of the License, or (at your option) any later version. 8 | * 9 | * Libav is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with Libav; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | */ 18 | 19 | /** 20 | * @file 21 | * a very simple circular buffer FIFO implementation 22 | */ 23 | 24 | #ifndef AVUTIL_FIFO_H 25 | #define AVUTIL_FIFO_H 26 | 27 | #include 28 | #include "avutil.h" 29 | #include "attributes.h" 30 | 31 | typedef struct AVFifoBuffer { 32 | uint8_t *buffer; 33 | uint8_t *rptr, *wptr, *end; 34 | uint32_t rndx, wndx; 35 | } AVFifoBuffer; 36 | 37 | /** 38 | * Initialize an AVFifoBuffer. 39 | * @param size of FIFO 40 | * @return AVFifoBuffer or NULL in case of memory allocation failure 41 | */ 42 | AVFifoBuffer *av_fifo_alloc(unsigned int size); 43 | 44 | /** 45 | * Free an AVFifoBuffer. 46 | * @param f AVFifoBuffer to free 47 | */ 48 | void av_fifo_free(AVFifoBuffer *f); 49 | 50 | /** 51 | * Reset the AVFifoBuffer to the state right after av_fifo_alloc, in particular it is emptied. 52 | * @param f AVFifoBuffer to reset 53 | */ 54 | void av_fifo_reset(AVFifoBuffer *f); 55 | 56 | /** 57 | * Return the amount of data in bytes in the AVFifoBuffer, that is the 58 | * amount of data you can read from it. 59 | * @param f AVFifoBuffer to read from 60 | * @return size 61 | */ 62 | int av_fifo_size(AVFifoBuffer *f); 63 | 64 | /** 65 | * Return the amount of space in bytes in the AVFifoBuffer, that is the 66 | * amount of data you can write into it. 67 | * @param f AVFifoBuffer to write into 68 | * @return size 69 | */ 70 | int av_fifo_space(AVFifoBuffer *f); 71 | 72 | /** 73 | * Feed data from an AVFifoBuffer to a user-supplied callback. 74 | * @param f AVFifoBuffer to read from 75 | * @param buf_size number of bytes to read 76 | * @param func generic read function 77 | * @param dest data destination 78 | */ 79 | int av_fifo_generic_read(AVFifoBuffer *f, void *dest, int buf_size, void (*func)(void*, void*, int)); 80 | 81 | /** 82 | * Feed data from a user-supplied callback to an AVFifoBuffer. 83 | * @param f AVFifoBuffer to write to 84 | * @param src data source; non-const since it may be used as a 85 | * modifiable context by the function defined in func 86 | * @param size number of bytes to write 87 | * @param func generic write function; the first parameter is src, 88 | * the second is dest_buf, the third is dest_buf_size. 89 | * func must return the number of bytes written to dest_buf, or <= 0 to 90 | * indicate no more data available to write. 91 | * If func is NULL, src is interpreted as a simple byte array for source data. 92 | * @return the number of bytes written to the FIFO 93 | */ 94 | int av_fifo_generic_write(AVFifoBuffer *f, void *src, int size, int (*func)(void*, void*, int)); 95 | 96 | /** 97 | * Resize an AVFifoBuffer. 98 | * @param f AVFifoBuffer to resize 99 | * @param size new AVFifoBuffer size in bytes 100 | * @return <0 for failure, >=0 otherwise 101 | */ 102 | int av_fifo_realloc2(AVFifoBuffer *f, unsigned int size); 103 | 104 | /** 105 | * Read and discard the specified amount of data from an AVFifoBuffer. 106 | * @param f AVFifoBuffer to read from 107 | * @param size amount of data to read in bytes 108 | */ 109 | void av_fifo_drain(AVFifoBuffer *f, int size); 110 | 111 | /** 112 | * Return a pointer to the data stored in a FIFO buffer at a certain offset. 113 | * The FIFO buffer is not modified. 114 | * 115 | * @param f AVFifoBuffer to peek at, f must be non-NULL 116 | * @param offs an offset in bytes, its absolute value must be less 117 | * than the used buffer size or the returned pointer will 118 | * point outside to the buffer data. 119 | * The used buffer size can be checked with av_fifo_size(). 120 | */ 121 | static inline uint8_t *av_fifo_peek2(const AVFifoBuffer *f, int offs) 122 | { 123 | uint8_t *ptr = f->rptr + offs; 124 | if (ptr >= f->end) 125 | ptr = f->buffer + (ptr - f->end); 126 | else if (ptr < f->buffer) 127 | ptr = f->end - (f->buffer - ptr); 128 | return ptr; 129 | } 130 | 131 | #endif /* AVUTIL_FIFO_H */ 132 | -------------------------------------------------------------------------------- /ffmpeg/include/libavutil/file.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of Libav. 3 | * 4 | * Libav is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2.1 of the License, or (at your option) any later version. 8 | * 9 | * Libav is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with Libav; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | */ 18 | 19 | #ifndef AVUTIL_FILE_H 20 | #define AVUTIL_FILE_H 21 | 22 | #include 23 | 24 | #include "avutil.h" 25 | 26 | /** 27 | * @file 28 | * Misc file utilities. 29 | */ 30 | 31 | /** 32 | * Read the file with name filename, and put its content in a newly 33 | * allocated buffer or map it with mmap() when available. 34 | * In case of success set *bufptr to the read or mmapped buffer, and 35 | * *size to the size in bytes of the buffer in *bufptr. 36 | * The returned buffer must be released with av_file_unmap(). 37 | * 38 | * @param log_offset loglevel offset used for logging 39 | * @param log_ctx context used for logging 40 | * @return a non negative number in case of success, a negative value 41 | * corresponding to an AVERROR error code in case of failure 42 | */ 43 | int av_file_map(const char *filename, uint8_t **bufptr, size_t *size, 44 | int log_offset, void *log_ctx); 45 | 46 | /** 47 | * Unmap or free the buffer bufptr created by av_file_map(). 48 | * 49 | * @param size size in bytes of bufptr, must be the same as returned 50 | * by av_file_map() 51 | */ 52 | void av_file_unmap(uint8_t *bufptr, size_t size); 53 | 54 | #endif /* AVUTIL_FILE_H */ 55 | -------------------------------------------------------------------------------- /ffmpeg/include/libavutil/hmac.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012 Martin Storsjo 3 | * 4 | * This file is part of Libav. 5 | * 6 | * Libav is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * Libav is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with Libav; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | #ifndef AVUTIL_HMAC_H 22 | #define AVUTIL_HMAC_H 23 | 24 | #include 25 | 26 | /** 27 | * @defgroup lavu_hmac HMAC 28 | * @ingroup lavu_crypto 29 | * @{ 30 | */ 31 | 32 | enum AVHMACType { 33 | AV_HMAC_MD5, 34 | AV_HMAC_SHA1, 35 | }; 36 | 37 | typedef struct AVHMAC AVHMAC; 38 | 39 | /** 40 | * Allocate an AVHMAC context. 41 | * @param type The hash function used for the HMAC. 42 | */ 43 | AVHMAC *av_hmac_alloc(enum AVHMACType type); 44 | 45 | /** 46 | * Free an AVHMAC context. 47 | * @param ctx The context to free, may be NULL 48 | */ 49 | void av_hmac_free(AVHMAC *ctx); 50 | 51 | /** 52 | * Initialize an AVHMAC context with an authentication key. 53 | * @param ctx The HMAC context 54 | * @param key The authentication key 55 | * @param keylen The length of the key, in bytes 56 | */ 57 | void av_hmac_init(AVHMAC *ctx, const uint8_t *key, unsigned int keylen); 58 | 59 | /** 60 | * Hash data with the HMAC. 61 | * @param ctx The HMAC context 62 | * @param data The data to hash 63 | * @param len The length of the data, in bytes 64 | */ 65 | void av_hmac_update(AVHMAC *ctx, const uint8_t *data, unsigned int len); 66 | 67 | /** 68 | * Finish hashing and output the HMAC digest. 69 | * @param ctx The HMAC context 70 | * @param out The output buffer to write the digest into 71 | * @param outlen The length of the out buffer, in bytes 72 | * @return The number of bytes written to out, or a negative error code. 73 | */ 74 | int av_hmac_final(AVHMAC *ctx, uint8_t *out, unsigned int outlen); 75 | 76 | /** 77 | * Hash an array of data with a key. 78 | * @param ctx The HMAC context 79 | * @param data The data to hash 80 | * @param len The length of the data, in bytes 81 | * @param key The authentication key 82 | * @param keylen The length of the key, in bytes 83 | * @param out The output buffer to write the digest into 84 | * @param outlen The length of the out buffer, in bytes 85 | * @return The number of bytes written to out, or a negative error code. 86 | */ 87 | int av_hmac_calc(AVHMAC *ctx, const uint8_t *data, unsigned int len, 88 | const uint8_t *key, unsigned int keylen, 89 | uint8_t *out, unsigned int outlen); 90 | 91 | /** 92 | * @} 93 | */ 94 | 95 | #endif /* AVUTIL_HMAC_H */ 96 | -------------------------------------------------------------------------------- /ffmpeg/include/libavutil/imgutils.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of Libav. 3 | * 4 | * Libav is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2.1 of the License, or (at your option) any later version. 8 | * 9 | * Libav is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with Libav; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | */ 18 | 19 | #ifndef AVUTIL_IMGUTILS_H 20 | #define AVUTIL_IMGUTILS_H 21 | 22 | /** 23 | * @file 24 | * misc image utilities 25 | * 26 | * @addtogroup lavu_picture 27 | * @{ 28 | */ 29 | 30 | #include "avutil.h" 31 | #include "pixdesc.h" 32 | 33 | /** 34 | * Compute the max pixel step for each plane of an image with a 35 | * format described by pixdesc. 36 | * 37 | * The pixel step is the distance in bytes between the first byte of 38 | * the group of bytes which describe a pixel component and the first 39 | * byte of the successive group in the same plane for the same 40 | * component. 41 | * 42 | * @param max_pixsteps an array which is filled with the max pixel step 43 | * for each plane. Since a plane may contain different pixel 44 | * components, the computed max_pixsteps[plane] is relative to the 45 | * component in the plane with the max pixel step. 46 | * @param max_pixstep_comps an array which is filled with the component 47 | * for each plane which has the max pixel step. May be NULL. 48 | */ 49 | void av_image_fill_max_pixsteps(int max_pixsteps[4], int max_pixstep_comps[4], 50 | const AVPixFmtDescriptor *pixdesc); 51 | 52 | /** 53 | * Compute the size of an image line with format pix_fmt and width 54 | * width for the plane plane. 55 | * 56 | * @return the computed size in bytes 57 | */ 58 | int av_image_get_linesize(enum AVPixelFormat pix_fmt, int width, int plane); 59 | 60 | /** 61 | * Fill plane linesizes for an image with pixel format pix_fmt and 62 | * width width. 63 | * 64 | * @param linesizes array to be filled with the linesize for each plane 65 | * @return >= 0 in case of success, a negative error code otherwise 66 | */ 67 | int av_image_fill_linesizes(int linesizes[4], enum AVPixelFormat pix_fmt, int width); 68 | 69 | /** 70 | * Fill plane data pointers for an image with pixel format pix_fmt and 71 | * height height. 72 | * 73 | * @param data pointers array to be filled with the pointer for each image plane 74 | * @param ptr the pointer to a buffer which will contain the image 75 | * @param linesizes the array containing the linesize for each 76 | * plane, should be filled by av_image_fill_linesizes() 77 | * @return the size in bytes required for the image buffer, a negative 78 | * error code in case of failure 79 | */ 80 | int av_image_fill_pointers(uint8_t *data[4], enum AVPixelFormat pix_fmt, int height, 81 | uint8_t *ptr, const int linesizes[4]); 82 | 83 | /** 84 | * Allocate an image with size w and h and pixel format pix_fmt, and 85 | * fill pointers and linesizes accordingly. 86 | * The allocated image buffer has to be freed by using 87 | * av_freep(&pointers[0]). 88 | * 89 | * @param align the value to use for buffer size alignment 90 | * @return the size in bytes required for the image buffer, a negative 91 | * error code in case of failure 92 | */ 93 | int av_image_alloc(uint8_t *pointers[4], int linesizes[4], 94 | int w, int h, enum AVPixelFormat pix_fmt, int align); 95 | 96 | /** 97 | * Copy image plane from src to dst. 98 | * That is, copy "height" number of lines of "bytewidth" bytes each. 99 | * The first byte of each successive line is separated by *_linesize 100 | * bytes. 101 | * 102 | * @param dst_linesize linesize for the image plane in dst 103 | * @param src_linesize linesize for the image plane in src 104 | */ 105 | void av_image_copy_plane(uint8_t *dst, int dst_linesize, 106 | const uint8_t *src, int src_linesize, 107 | int bytewidth, int height); 108 | 109 | /** 110 | * Copy image in src_data to dst_data. 111 | * 112 | * @param dst_linesizes linesizes for the image in dst_data 113 | * @param src_linesizes linesizes for the image in src_data 114 | */ 115 | void av_image_copy(uint8_t *dst_data[4], int dst_linesizes[4], 116 | const uint8_t *src_data[4], const int src_linesizes[4], 117 | enum AVPixelFormat pix_fmt, int width, int height); 118 | 119 | /** 120 | * Check if the given dimension of an image is valid, meaning that all 121 | * bytes of the image can be addressed with a signed int. 122 | * 123 | * @param w the width of the picture 124 | * @param h the height of the picture 125 | * @param log_offset the offset to sum to the log level for logging with log_ctx 126 | * @param log_ctx the parent logging context, it may be NULL 127 | * @return >= 0 if valid, a negative error code otherwise 128 | */ 129 | int av_image_check_size(unsigned int w, unsigned int h, int log_offset, void *log_ctx); 130 | 131 | int avpriv_set_systematic_pal2(uint32_t pal[256], enum AVPixelFormat pix_fmt); 132 | 133 | /** 134 | * @} 135 | */ 136 | 137 | 138 | #endif /* AVUTIL_IMGUTILS_H */ 139 | -------------------------------------------------------------------------------- /ffmpeg/include/libavutil/intfloat.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2011 Mans Rullgard 3 | * 4 | * This file is part of Libav. 5 | * 6 | * Libav is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * Libav is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with Libav; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | #ifndef AVUTIL_INTFLOAT_H 22 | #define AVUTIL_INTFLOAT_H 23 | 24 | #include 25 | #include "attributes.h" 26 | 27 | union av_intfloat32 { 28 | uint32_t i; 29 | float f; 30 | }; 31 | 32 | union av_intfloat64 { 33 | uint64_t i; 34 | double f; 35 | }; 36 | 37 | /** 38 | * Reinterpret a 32-bit integer as a float. 39 | */ 40 | static av_always_inline float av_int2float(uint32_t i) 41 | { 42 | union av_intfloat32 v; 43 | v.i = i; 44 | return v.f; 45 | } 46 | 47 | /** 48 | * Reinterpret a float as a 32-bit integer. 49 | */ 50 | static av_always_inline uint32_t av_float2int(float f) 51 | { 52 | union av_intfloat32 v; 53 | v.f = f; 54 | return v.i; 55 | } 56 | 57 | /** 58 | * Reinterpret a 64-bit integer as a double. 59 | */ 60 | static av_always_inline double av_int2double(uint64_t i) 61 | { 62 | union av_intfloat64 v; 63 | v.i = i; 64 | return v.f; 65 | } 66 | 67 | /** 68 | * Reinterpret a double as a 64-bit integer. 69 | */ 70 | static av_always_inline uint64_t av_double2int(double f) 71 | { 72 | union av_intfloat64 v; 73 | v.f = f; 74 | return v.i; 75 | } 76 | 77 | #endif /* AVUTIL_INTFLOAT_H */ 78 | -------------------------------------------------------------------------------- /ffmpeg/include/libavutil/intfloat_readwrite.h: -------------------------------------------------------------------------------- 1 | /* 2 | * copyright (c) 2005 Michael Niedermayer 3 | * 4 | * This file is part of Libav. 5 | * 6 | * Libav is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * Libav is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with Libav; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | #ifndef AVUTIL_INTFLOAT_READWRITE_H 22 | #define AVUTIL_INTFLOAT_READWRITE_H 23 | 24 | #include 25 | #include "attributes.h" 26 | 27 | /* IEEE 80 bits extended float */ 28 | typedef struct AVExtFloat { 29 | uint8_t exponent[2]; 30 | uint8_t mantissa[8]; 31 | } AVExtFloat; 32 | 33 | attribute_deprecated double av_int2dbl(int64_t v) av_const; 34 | attribute_deprecated float av_int2flt(int32_t v) av_const; 35 | attribute_deprecated double av_ext2dbl(const AVExtFloat ext) av_const; 36 | attribute_deprecated int64_t av_dbl2int(double d) av_const; 37 | attribute_deprecated int32_t av_flt2int(float d) av_const; 38 | attribute_deprecated AVExtFloat av_dbl2ext(double d) av_const; 39 | 40 | #endif /* AVUTIL_INTFLOAT_READWRITE_H */ 41 | -------------------------------------------------------------------------------- /ffmpeg/include/libavutil/lfg.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Lagged Fibonacci PRNG 3 | * Copyright (c) 2008 Michael Niedermayer 4 | * 5 | * This file is part of Libav. 6 | * 7 | * Libav is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public 9 | * License as published by the Free Software Foundation; either 10 | * version 2.1 of the License, or (at your option) any later version. 11 | * 12 | * Libav is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public 18 | * License along with Libav; if not, write to the Free Software 19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 20 | */ 21 | 22 | #ifndef AVUTIL_LFG_H 23 | #define AVUTIL_LFG_H 24 | 25 | typedef struct AVLFG { 26 | unsigned int state[64]; 27 | int index; 28 | } AVLFG; 29 | 30 | void av_lfg_init(AVLFG *c, unsigned int seed); 31 | 32 | /** 33 | * Get the next random unsigned 32-bit number using an ALFG. 34 | * 35 | * Please also consider a simple LCG like state= state*1664525+1013904223, 36 | * it may be good enough and faster for your specific use case. 37 | */ 38 | static inline unsigned int av_lfg_get(AVLFG *c){ 39 | c->state[c->index & 63] = c->state[(c->index-24) & 63] + c->state[(c->index-55) & 63]; 40 | return c->state[c->index++ & 63]; 41 | } 42 | 43 | /** 44 | * Get the next random unsigned 32-bit number using a MLFG. 45 | * 46 | * Please also consider av_lfg_get() above, it is faster. 47 | */ 48 | static inline unsigned int av_mlfg_get(AVLFG *c){ 49 | unsigned int a= c->state[(c->index-55) & 63]; 50 | unsigned int b= c->state[(c->index-24) & 63]; 51 | return c->state[c->index++ & 63] = 2*a*b+a+b; 52 | } 53 | 54 | /** 55 | * Get the next two numbers generated by a Box-Muller Gaussian 56 | * generator using the random numbers issued by lfg. 57 | * 58 | * @param out array where the two generated numbers are placed 59 | */ 60 | void av_bmg_get(AVLFG *lfg, double out[2]); 61 | 62 | #endif /* AVUTIL_LFG_H */ 63 | -------------------------------------------------------------------------------- /ffmpeg/include/libavutil/log.h: -------------------------------------------------------------------------------- 1 | /* 2 | * copyright (c) 2006 Michael Niedermayer 3 | * 4 | * This file is part of Libav. 5 | * 6 | * Libav is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * Libav is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with Libav; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | #ifndef AVUTIL_LOG_H 22 | #define AVUTIL_LOG_H 23 | 24 | #include 25 | #include "avutil.h" 26 | #include "attributes.h" 27 | 28 | /** 29 | * Describe the class of an AVClass context structure. That is an 30 | * arbitrary struct of which the first field is a pointer to an 31 | * AVClass struct (e.g. AVCodecContext, AVFormatContext etc.). 32 | */ 33 | typedef struct AVClass { 34 | /** 35 | * The name of the class; usually it is the same name as the 36 | * context structure type to which the AVClass is associated. 37 | */ 38 | const char* class_name; 39 | 40 | /** 41 | * A pointer to a function which returns the name of a context 42 | * instance ctx associated with the class. 43 | */ 44 | const char* (*item_name)(void* ctx); 45 | 46 | /** 47 | * a pointer to the first option specified in the class if any or NULL 48 | * 49 | * @see av_set_default_options() 50 | */ 51 | const struct AVOption *option; 52 | 53 | /** 54 | * LIBAVUTIL_VERSION with which this structure was created. 55 | * This is used to allow fields to be added without requiring major 56 | * version bumps everywhere. 57 | */ 58 | 59 | int version; 60 | 61 | /** 62 | * Offset in the structure where log_level_offset is stored. 63 | * 0 means there is no such variable 64 | */ 65 | int log_level_offset_offset; 66 | 67 | /** 68 | * Offset in the structure where a pointer to the parent context for 69 | * logging is stored. For example a decoder could pass its AVCodecContext 70 | * to eval as such a parent context, which an av_log() implementation 71 | * could then leverage to display the parent context. 72 | * The offset can be NULL. 73 | */ 74 | int parent_log_context_offset; 75 | 76 | /** 77 | * Return next AVOptions-enabled child or NULL 78 | */ 79 | void* (*child_next)(void *obj, void *prev); 80 | 81 | /** 82 | * Return an AVClass corresponding to the next potential 83 | * AVOptions-enabled child. 84 | * 85 | * The difference between child_next and this is that 86 | * child_next iterates over _already existing_ objects, while 87 | * child_class_next iterates over _all possible_ children. 88 | */ 89 | const struct AVClass* (*child_class_next)(const struct AVClass *prev); 90 | } AVClass; 91 | 92 | /* av_log API */ 93 | 94 | #define AV_LOG_QUIET -8 95 | 96 | /** 97 | * Something went really wrong and we will crash now. 98 | */ 99 | #define AV_LOG_PANIC 0 100 | 101 | /** 102 | * Something went wrong and recovery is not possible. 103 | * For example, no header was found for a format which depends 104 | * on headers or an illegal combination of parameters is used. 105 | */ 106 | #define AV_LOG_FATAL 8 107 | 108 | /** 109 | * Something went wrong and cannot losslessly be recovered. 110 | * However, not all future data is affected. 111 | */ 112 | #define AV_LOG_ERROR 16 113 | 114 | /** 115 | * Something somehow does not look correct. This may or may not 116 | * lead to problems. An example would be the use of '-vstrict -2'. 117 | */ 118 | #define AV_LOG_WARNING 24 119 | 120 | #define AV_LOG_INFO 32 121 | #define AV_LOG_VERBOSE 40 122 | 123 | /** 124 | * Stuff which is only useful for libav* developers. 125 | */ 126 | #define AV_LOG_DEBUG 48 127 | 128 | /** 129 | * Send the specified message to the log if the level is less than or equal 130 | * to the current av_log_level. By default, all logging messages are sent to 131 | * stderr. This behavior can be altered by setting a different av_vlog callback 132 | * function. 133 | * 134 | * @param avcl A pointer to an arbitrary struct of which the first field is a 135 | * pointer to an AVClass struct. 136 | * @param level The importance level of the message, lower values signifying 137 | * higher importance. 138 | * @param fmt The format string (printf-compatible) that specifies how 139 | * subsequent arguments are converted to output. 140 | * @see av_vlog 141 | */ 142 | void av_log(void *avcl, int level, const char *fmt, ...) av_printf_format(3, 4); 143 | 144 | void av_vlog(void *avcl, int level, const char *fmt, va_list); 145 | int av_log_get_level(void); 146 | void av_log_set_level(int); 147 | void av_log_set_callback(void (*)(void*, int, const char*, va_list)); 148 | void av_log_default_callback(void* ptr, int level, const char* fmt, va_list vl); 149 | const char* av_default_item_name(void* ctx); 150 | 151 | /** 152 | * av_dlog macros 153 | * Useful to print debug messages that shouldn't get compiled in normally. 154 | */ 155 | 156 | #ifdef DEBUG 157 | # define av_dlog(pctx, ...) av_log(pctx, AV_LOG_DEBUG, __VA_ARGS__) 158 | #else 159 | # define av_dlog(pctx, ...) 160 | #endif 161 | 162 | /** 163 | * Skip repeated messages, this requires the user app to use av_log() instead of 164 | * (f)printf as the 2 would otherwise interfere and lead to 165 | * "Last message repeated x times" messages below (f)printf messages with some 166 | * bad luck. 167 | * Also to receive the last, "last repeated" line if any, the user app must 168 | * call av_log(NULL, AV_LOG_QUIET, ""); at the end 169 | */ 170 | #define AV_LOG_SKIP_REPEATED 1 171 | void av_log_set_flags(int arg); 172 | 173 | #endif /* AVUTIL_LOG_H */ 174 | -------------------------------------------------------------------------------- /ffmpeg/include/libavutil/lzo.h: -------------------------------------------------------------------------------- 1 | /* 2 | * LZO 1x decompression 3 | * copyright (c) 2006 Reimar Doeffinger 4 | * 5 | * This file is part of Libav. 6 | * 7 | * Libav is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public 9 | * License as published by the Free Software Foundation; either 10 | * version 2.1 of the License, or (at your option) any later version. 11 | * 12 | * Libav is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public 18 | * License along with Libav; if not, write to the Free Software 19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 20 | */ 21 | 22 | #ifndef AVUTIL_LZO_H 23 | #define AVUTIL_LZO_H 24 | 25 | /** 26 | * @defgroup lavu_lzo LZO 27 | * @ingroup lavu_crypto 28 | * 29 | * @{ 30 | */ 31 | 32 | #include 33 | 34 | /** @name Error flags returned by av_lzo1x_decode 35 | * @{ */ 36 | /// end of the input buffer reached before decoding finished 37 | #define AV_LZO_INPUT_DEPLETED 1 38 | /// decoded data did not fit into output buffer 39 | #define AV_LZO_OUTPUT_FULL 2 40 | /// a reference to previously decoded data was wrong 41 | #define AV_LZO_INVALID_BACKPTR 4 42 | /// a non-specific error in the compressed bitstream 43 | #define AV_LZO_ERROR 8 44 | /** @} */ 45 | 46 | #define AV_LZO_INPUT_PADDING 8 47 | #define AV_LZO_OUTPUT_PADDING 12 48 | 49 | /** 50 | * @brief Decodes LZO 1x compressed data. 51 | * @param out output buffer 52 | * @param outlen size of output buffer, number of bytes left are returned here 53 | * @param in input buffer 54 | * @param inlen size of input buffer, number of bytes left are returned here 55 | * @return 0 on success, otherwise a combination of the error flags above 56 | * 57 | * Make sure all buffers are appropriately padded, in must provide 58 | * AV_LZO_INPUT_PADDING, out must provide AV_LZO_OUTPUT_PADDING additional bytes. 59 | */ 60 | int av_lzo1x_decode(void *out, int *outlen, const void *in, int *inlen); 61 | 62 | /** 63 | * @} 64 | */ 65 | 66 | #endif /* AVUTIL_LZO_H */ 67 | -------------------------------------------------------------------------------- /ffmpeg/include/libavutil/mathematics.h: -------------------------------------------------------------------------------- 1 | /* 2 | * copyright (c) 2005 Michael Niedermayer 3 | * 4 | * This file is part of Libav. 5 | * 6 | * Libav is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * Libav is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with Libav; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | #ifndef AVUTIL_MATHEMATICS_H 22 | #define AVUTIL_MATHEMATICS_H 23 | 24 | #include 25 | #include 26 | #include "attributes.h" 27 | #include "rational.h" 28 | #include "intfloat.h" 29 | 30 | #ifndef M_LOG2_10 31 | #define M_LOG2_10 3.32192809488736234787 /* log_2 10 */ 32 | #endif 33 | #ifndef M_PHI 34 | #define M_PHI 1.61803398874989484820 /* phi / golden ratio */ 35 | #endif 36 | #ifndef NAN 37 | #define NAN av_int2float(0x7fc00000) 38 | #endif 39 | #ifndef INFINITY 40 | #define INFINITY av_int2float(0x7f800000) 41 | #endif 42 | 43 | /** 44 | * @addtogroup lavu_math 45 | * @{ 46 | */ 47 | 48 | 49 | enum AVRounding { 50 | AV_ROUND_ZERO = 0, ///< Round toward zero. 51 | AV_ROUND_INF = 1, ///< Round away from zero. 52 | AV_ROUND_DOWN = 2, ///< Round toward -infinity. 53 | AV_ROUND_UP = 3, ///< Round toward +infinity. 54 | AV_ROUND_NEAR_INF = 5, ///< Round to nearest and halfway cases away from zero. 55 | }; 56 | 57 | /** 58 | * Return the greatest common divisor of a and b. 59 | * If both a and b are 0 or either or both are <0 then behavior is 60 | * undefined. 61 | */ 62 | int64_t av_const av_gcd(int64_t a, int64_t b); 63 | 64 | /** 65 | * Rescale a 64-bit integer with rounding to nearest. 66 | * A simple a*b/c isn't possible as it can overflow. 67 | */ 68 | int64_t av_rescale(int64_t a, int64_t b, int64_t c) av_const; 69 | 70 | /** 71 | * Rescale a 64-bit integer with specified rounding. 72 | * A simple a*b/c isn't possible as it can overflow. 73 | */ 74 | int64_t av_rescale_rnd(int64_t a, int64_t b, int64_t c, enum AVRounding) av_const; 75 | 76 | /** 77 | * Rescale a 64-bit integer by 2 rational numbers. 78 | */ 79 | int64_t av_rescale_q(int64_t a, AVRational bq, AVRational cq) av_const; 80 | 81 | /** 82 | * Rescale a 64-bit integer by 2 rational numbers with specified rounding. 83 | */ 84 | int64_t av_rescale_q_rnd(int64_t a, AVRational bq, AVRational cq, 85 | enum AVRounding) av_const; 86 | 87 | /** 88 | * Compare 2 timestamps each in its own timebases. 89 | * The result of the function is undefined if one of the timestamps 90 | * is outside the int64_t range when represented in the others timebase. 91 | * @return -1 if ts_a is before ts_b, 1 if ts_a is after ts_b or 0 if they represent the same position 92 | */ 93 | int av_compare_ts(int64_t ts_a, AVRational tb_a, int64_t ts_b, AVRational tb_b); 94 | 95 | /** 96 | * Compare 2 integers modulo mod. 97 | * That is we compare integers a and b for which only the least 98 | * significant log2(mod) bits are known. 99 | * 100 | * @param mod must be a power of 2 101 | * @return a negative value if a is smaller than b 102 | * a positive value if a is greater than b 103 | * 0 if a equals b 104 | */ 105 | int64_t av_compare_mod(uint64_t a, uint64_t b, uint64_t mod); 106 | 107 | /** 108 | * @} 109 | */ 110 | 111 | #endif /* AVUTIL_MATHEMATICS_H */ 112 | -------------------------------------------------------------------------------- /ffmpeg/include/libavutil/md5.h: -------------------------------------------------------------------------------- 1 | /* 2 | * copyright (c) 2006 Michael Niedermayer 3 | * 4 | * This file is part of Libav. 5 | * 6 | * Libav is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * Libav is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with Libav; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | #ifndef AVUTIL_MD5_H 22 | #define AVUTIL_MD5_H 23 | 24 | #include 25 | 26 | #include "attributes.h" 27 | #include "version.h" 28 | 29 | /** 30 | * @defgroup lavu_md5 MD5 31 | * @ingroup lavu_crypto 32 | * @{ 33 | */ 34 | 35 | #if FF_API_CONTEXT_SIZE 36 | extern attribute_deprecated const int av_md5_size; 37 | #endif 38 | 39 | struct AVMD5; 40 | 41 | struct AVMD5 *av_md5_alloc(void); 42 | void av_md5_init(struct AVMD5 *ctx); 43 | void av_md5_update(struct AVMD5 *ctx, const uint8_t *src, const int len); 44 | void av_md5_final(struct AVMD5 *ctx, uint8_t *dst); 45 | void av_md5_sum(uint8_t *dst, const uint8_t *src, const int len); 46 | 47 | /** 48 | * @} 49 | */ 50 | 51 | #endif /* AVUTIL_MD5_H */ 52 | -------------------------------------------------------------------------------- /ffmpeg/include/libavutil/mem.h: -------------------------------------------------------------------------------- 1 | /* 2 | * copyright (c) 2006 Michael Niedermayer 3 | * 4 | * This file is part of Libav. 5 | * 6 | * Libav is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * Libav is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with Libav; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | /** 22 | * @file 23 | * memory handling functions 24 | */ 25 | 26 | #ifndef AVUTIL_MEM_H 27 | #define AVUTIL_MEM_H 28 | 29 | #include 30 | #include 31 | 32 | #include "attributes.h" 33 | #include "avutil.h" 34 | 35 | /** 36 | * @addtogroup lavu_mem 37 | * @{ 38 | */ 39 | 40 | 41 | #if defined(__ICC) && __ICC < 1200 || defined(__SUNPRO_C) 42 | #define DECLARE_ALIGNED(n,t,v) t __attribute__ ((aligned (n))) v 43 | #define DECLARE_ASM_CONST(n,t,v) const t __attribute__ ((aligned (n))) v 44 | #elif defined(__TI_COMPILER_VERSION__) 45 | #define DECLARE_ALIGNED(n,t,v) \ 46 | AV_PRAGMA(DATA_ALIGN(v,n)) \ 47 | t __attribute__((aligned(n))) v 48 | #define DECLARE_ASM_CONST(n,t,v) \ 49 | AV_PRAGMA(DATA_ALIGN(v,n)) \ 50 | static const t __attribute__((aligned(n))) v 51 | #elif defined(__GNUC__) 52 | #define DECLARE_ALIGNED(n,t,v) t __attribute__ ((aligned (n))) v 53 | #define DECLARE_ASM_CONST(n,t,v) static const t av_used __attribute__ ((aligned (n))) v 54 | #elif defined(_MSC_VER) 55 | #define DECLARE_ALIGNED(n,t,v) __declspec(align(n)) t v 56 | #define DECLARE_ASM_CONST(n,t,v) __declspec(align(n)) static const t v 57 | #else 58 | #define DECLARE_ALIGNED(n,t,v) t v 59 | #define DECLARE_ASM_CONST(n,t,v) static const t v 60 | #endif 61 | 62 | #if AV_GCC_VERSION_AT_LEAST(3,1) 63 | #define av_malloc_attrib __attribute__((__malloc__)) 64 | #else 65 | #define av_malloc_attrib 66 | #endif 67 | 68 | #if AV_GCC_VERSION_AT_LEAST(4,3) 69 | #define av_alloc_size(...) __attribute__((alloc_size(__VA_ARGS__))) 70 | #else 71 | #define av_alloc_size(...) 72 | #endif 73 | 74 | /** 75 | * Allocate a block of size bytes with alignment suitable for all 76 | * memory accesses (including vectors if available on the CPU). 77 | * @param size Size in bytes for the memory block to be allocated. 78 | * @return Pointer to the allocated block, NULL if the block cannot 79 | * be allocated. 80 | * @see av_mallocz() 81 | */ 82 | void *av_malloc(size_t size) av_malloc_attrib av_alloc_size(1); 83 | 84 | /** 85 | * Helper function to allocate a block of size * nmemb bytes with 86 | * using av_malloc() 87 | * @param nmemb Number of elements 88 | * @param size Size of the single element 89 | * @return Pointer to the allocated block, NULL if the block cannot 90 | * be allocated. 91 | * @see av_malloc() 92 | */ 93 | av_alloc_size(1, 2) static inline void *av_malloc_array(size_t nmemb, size_t size) 94 | { 95 | if (size <= 0 || nmemb >= INT_MAX / size) 96 | return NULL; 97 | return av_malloc(nmemb * size); 98 | } 99 | 100 | /** 101 | * Allocate or reallocate a block of memory. 102 | * If ptr is NULL and size > 0, allocate a new block. If 103 | * size is zero, free the memory block pointed to by ptr. 104 | * @param ptr Pointer to a memory block already allocated with 105 | * av_malloc(z)() or av_realloc() or NULL. 106 | * @param size Size in bytes for the memory block to be allocated or 107 | * reallocated. 108 | * @return Pointer to a newly reallocated block or NULL if the block 109 | * cannot be reallocated or the function is used to free the memory block. 110 | * @see av_fast_realloc() 111 | */ 112 | void *av_realloc(void *ptr, size_t size) av_alloc_size(2); 113 | 114 | /** 115 | * Free a memory block which has been allocated with av_malloc(z)() or 116 | * av_realloc(). 117 | * @param ptr Pointer to the memory block which should be freed. 118 | * @note ptr = NULL is explicitly allowed. 119 | * @note It is recommended that you use av_freep() instead. 120 | * @see av_freep() 121 | */ 122 | void av_free(void *ptr); 123 | 124 | /** 125 | * Allocate a block of size bytes with alignment suitable for all 126 | * memory accesses (including vectors if available on the CPU) and 127 | * zero all the bytes of the block. 128 | * @param size Size in bytes for the memory block to be allocated. 129 | * @return Pointer to the allocated block, NULL if it cannot be allocated. 130 | * @see av_malloc() 131 | */ 132 | void *av_mallocz(size_t size) av_malloc_attrib av_alloc_size(1); 133 | 134 | /** 135 | * Helper function to allocate a block of size * nmemb bytes with 136 | * using av_mallocz() 137 | * @param nmemb Number of elements 138 | * @param size Size of the single element 139 | * @return Pointer to the allocated block, NULL if the block cannot 140 | * be allocated. 141 | * @see av_mallocz() 142 | * @see av_malloc_array() 143 | */ 144 | av_alloc_size(1, 2) static inline void *av_mallocz_array(size_t nmemb, size_t size) 145 | { 146 | if (size <= 0 || nmemb >= INT_MAX / size) 147 | return NULL; 148 | return av_mallocz(nmemb * size); 149 | } 150 | 151 | /** 152 | * Duplicate the string s. 153 | * @param s string to be duplicated 154 | * @return Pointer to a newly allocated string containing a 155 | * copy of s or NULL if the string cannot be allocated. 156 | */ 157 | char *av_strdup(const char *s) av_malloc_attrib; 158 | 159 | /** 160 | * Free a memory block which has been allocated with av_malloc(z)() or 161 | * av_realloc() and set the pointer pointing to it to NULL. 162 | * @param ptr Pointer to the pointer to the memory block which should 163 | * be freed. 164 | * @see av_free() 165 | */ 166 | void av_freep(void *ptr); 167 | 168 | /** 169 | * @brief deliberately overlapping memcpy implementation 170 | * @param dst destination buffer 171 | * @param back how many bytes back we start (the initial size of the overlapping window) 172 | * @param cnt number of bytes to copy, must be >= 0 173 | * 174 | * cnt > back is valid, this will copy the bytes we just copied, 175 | * thus creating a repeating pattern with a period length of back. 176 | */ 177 | void av_memcpy_backptr(uint8_t *dst, int back, int cnt); 178 | 179 | /** 180 | * @} 181 | */ 182 | 183 | #endif /* AVUTIL_MEM_H */ 184 | -------------------------------------------------------------------------------- /ffmpeg/include/libavutil/parseutils.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of Libav. 3 | * 4 | * Libav is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2.1 of the License, or (at your option) any later version. 8 | * 9 | * Libav is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with Libav; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | */ 18 | 19 | #ifndef AVUTIL_PARSEUTILS_H 20 | #define AVUTIL_PARSEUTILS_H 21 | 22 | #include 23 | 24 | #include "rational.h" 25 | 26 | /** 27 | * @file 28 | * misc parsing utilities 29 | */ 30 | 31 | /** 32 | * Parse str and put in width_ptr and height_ptr the detected values. 33 | * 34 | * @param[in,out] width_ptr pointer to the variable which will contain the detected 35 | * width value 36 | * @param[in,out] height_ptr pointer to the variable which will contain the detected 37 | * height value 38 | * @param[in] str the string to parse: it has to be a string in the format 39 | * width x height or a valid video size abbreviation. 40 | * @return >= 0 on success, a negative error code otherwise 41 | */ 42 | int av_parse_video_size(int *width_ptr, int *height_ptr, const char *str); 43 | 44 | /** 45 | * Parse str and store the detected values in *rate. 46 | * 47 | * @param[in,out] rate pointer to the AVRational which will contain the detected 48 | * frame rate 49 | * @param[in] str the string to parse: it has to be a string in the format 50 | * rate_num / rate_den, a float number or a valid video rate abbreviation 51 | * @return >= 0 on success, a negative error code otherwise 52 | */ 53 | int av_parse_video_rate(AVRational *rate, const char *str); 54 | 55 | /** 56 | * Put the RGBA values that correspond to color_string in rgba_color. 57 | * 58 | * @param color_string a string specifying a color. It can be the name of 59 | * a color (case insensitive match) or a [0x|#]RRGGBB[AA] sequence, 60 | * possibly followed by "@" and a string representing the alpha 61 | * component. 62 | * The alpha component may be a string composed by "0x" followed by an 63 | * hexadecimal number or a decimal number between 0.0 and 1.0, which 64 | * represents the opacity value (0x00/0.0 means completely transparent, 65 | * 0xff/1.0 completely opaque). 66 | * If the alpha component is not specified then 0xff is assumed. 67 | * The string "random" will result in a random color. 68 | * @param slen length of the initial part of color_string containing the 69 | * color. It can be set to -1 if color_string is a null terminated string 70 | * containing nothing else than the color. 71 | * @return >= 0 in case of success, a negative value in case of 72 | * failure (for example if color_string cannot be parsed). 73 | */ 74 | int av_parse_color(uint8_t *rgba_color, const char *color_string, int slen, 75 | void *log_ctx); 76 | 77 | /** 78 | * Parse timestr and return in *time a corresponding number of 79 | * microseconds. 80 | * 81 | * @param timeval puts here the number of microseconds corresponding 82 | * to the string in timestr. If the string represents a duration, it 83 | * is the number of microseconds contained in the time interval. If 84 | * the string is a date, is the number of microseconds since 1st of 85 | * January, 1970 up to the time of the parsed date. If timestr cannot 86 | * be successfully parsed, set *time to INT64_MIN. 87 | 88 | * @param timestr a string representing a date or a duration. 89 | * - If a date the syntax is: 90 | * @code 91 | * [{YYYY-MM-DD|YYYYMMDD}[T|t| ]]{{HH[:MM[:SS[.m...]]]}|{HH[MM[SS[.m...]]]}}[Z] 92 | * now 93 | * @endcode 94 | * If the value is "now" it takes the current time. 95 | * Time is local time unless Z is appended, in which case it is 96 | * interpreted as UTC. 97 | * If the year-month-day part is not specified it takes the current 98 | * year-month-day. 99 | * - If a duration the syntax is: 100 | * @code 101 | * [-]HH[:MM[:SS[.m...]]] 102 | * [-]S+[.m...] 103 | * @endcode 104 | * @param duration flag which tells how to interpret timestr, if not 105 | * zero timestr is interpreted as a duration, otherwise as a date 106 | * @return 0 in case of success, a negative value corresponding to an 107 | * AVERROR code otherwise 108 | */ 109 | int av_parse_time(int64_t *timeval, const char *timestr, int duration); 110 | 111 | /** 112 | * Attempt to find a specific tag in a URL. 113 | * 114 | * syntax: '?tag1=val1&tag2=val2...'. Little URL decoding is done. 115 | * Return 1 if found. 116 | */ 117 | int av_find_info_tag(char *arg, int arg_size, const char *tag1, const char *info); 118 | 119 | /** 120 | * Convert the decomposed UTC time in tm to a time_t value. 121 | */ 122 | time_t av_timegm(struct tm *tm); 123 | 124 | #endif /* AVUTIL_PARSEUTILS_H */ 125 | -------------------------------------------------------------------------------- /ffmpeg/include/libavutil/random_seed.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2009 Baptiste Coudurier 3 | * 4 | * This file is part of Libav. 5 | * 6 | * Libav is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * Libav is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with Libav; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | #ifndef AVUTIL_RANDOM_SEED_H 22 | #define AVUTIL_RANDOM_SEED_H 23 | 24 | #include 25 | /** 26 | * @addtogroup lavu_crypto 27 | * @{ 28 | */ 29 | 30 | /** 31 | * Get random data. 32 | * 33 | * This function can be called repeatedly to generate more random bits 34 | * as needed. It is generally quite slow, and usually used to seed a 35 | * PRNG. As it uses /dev/urandom and /dev/random, the quality of the 36 | * returned random data depends on the platform. 37 | */ 38 | uint32_t av_get_random_seed(void); 39 | 40 | /** 41 | * @} 42 | */ 43 | 44 | #endif /* AVUTIL_RANDOM_SEED_H */ 45 | -------------------------------------------------------------------------------- /ffmpeg/include/libavutil/rational.h: -------------------------------------------------------------------------------- 1 | /* 2 | * rational numbers 3 | * Copyright (c) 2003 Michael Niedermayer 4 | * 5 | * This file is part of Libav. 6 | * 7 | * Libav is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public 9 | * License as published by the Free Software Foundation; either 10 | * version 2.1 of the License, or (at your option) any later version. 11 | * 12 | * Libav is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public 18 | * License along with Libav; if not, write to the Free Software 19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 20 | */ 21 | 22 | /** 23 | * @file 24 | * rational numbers 25 | * @author Michael Niedermayer 26 | */ 27 | 28 | #ifndef AVUTIL_RATIONAL_H 29 | #define AVUTIL_RATIONAL_H 30 | 31 | #include 32 | #include 33 | #include "attributes.h" 34 | 35 | /** 36 | * @addtogroup lavu_math 37 | * @{ 38 | */ 39 | 40 | /** 41 | * rational number numerator/denominator 42 | */ 43 | typedef struct AVRational{ 44 | int num; ///< numerator 45 | int den; ///< denominator 46 | } AVRational; 47 | 48 | /** 49 | * Compare two rationals. 50 | * @param a first rational 51 | * @param b second rational 52 | * @return 0 if a==b, 1 if a>b, -1 if a>63)|1; 59 | else if(b.den && a.den) return 0; 60 | else if(a.num && b.num) return (a.num>>31) - (b.num>>31); 61 | else return INT_MIN; 62 | } 63 | 64 | /** 65 | * Convert rational to double. 66 | * @param a rational to convert 67 | * @return (double) a 68 | */ 69 | static inline double av_q2d(AVRational a){ 70 | return a.num / (double) a.den; 71 | } 72 | 73 | /** 74 | * Reduce a fraction. 75 | * This is useful for framerate calculations. 76 | * @param dst_num destination numerator 77 | * @param dst_den destination denominator 78 | * @param num source numerator 79 | * @param den source denominator 80 | * @param max the maximum allowed for dst_num & dst_den 81 | * @return 1 if exact, 0 otherwise 82 | */ 83 | int av_reduce(int *dst_num, int *dst_den, int64_t num, int64_t den, int64_t max); 84 | 85 | /** 86 | * Multiply two rationals. 87 | * @param b first rational 88 | * @param c second rational 89 | * @return b*c 90 | */ 91 | AVRational av_mul_q(AVRational b, AVRational c) av_const; 92 | 93 | /** 94 | * Divide one rational by another. 95 | * @param b first rational 96 | * @param c second rational 97 | * @return b/c 98 | */ 99 | AVRational av_div_q(AVRational b, AVRational c) av_const; 100 | 101 | /** 102 | * Add two rationals. 103 | * @param b first rational 104 | * @param c second rational 105 | * @return b+c 106 | */ 107 | AVRational av_add_q(AVRational b, AVRational c) av_const; 108 | 109 | /** 110 | * Subtract one rational from another. 111 | * @param b first rational 112 | * @param c second rational 113 | * @return b-c 114 | */ 115 | AVRational av_sub_q(AVRational b, AVRational c) av_const; 116 | 117 | /** 118 | * Invert a rational. 119 | * @param q value 120 | * @return 1 / q 121 | */ 122 | static av_always_inline AVRational av_inv_q(AVRational q) 123 | { 124 | AVRational r = { q.den, q.num }; 125 | return r; 126 | } 127 | 128 | /** 129 | * Convert a double precision floating point number to a rational. 130 | * inf is expressed as {1,0} or {-1,0} depending on the sign. 131 | * 132 | * @param d double to convert 133 | * @param max the maximum allowed numerator and denominator 134 | * @return (AVRational) d 135 | */ 136 | AVRational av_d2q(double d, int max) av_const; 137 | 138 | /** 139 | * @return 1 if q1 is nearer to q than q2, -1 if q2 is nearer 140 | * than q1, 0 if they have the same distance. 141 | */ 142 | int av_nearer_q(AVRational q, AVRational q1, AVRational q2); 143 | 144 | /** 145 | * Find the nearest value in q_list to q. 146 | * @param q_list an array of rationals terminated by {0, 0} 147 | * @return the index of the nearest value found in the array 148 | */ 149 | int av_find_nearest_q_idx(AVRational q, const AVRational* q_list); 150 | 151 | /** 152 | * @} 153 | */ 154 | 155 | #endif /* AVUTIL_RATIONAL_H */ 156 | -------------------------------------------------------------------------------- /ffmpeg/include/libavutil/sha.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2007 Michael Niedermayer 3 | * 4 | * This file is part of Libav. 5 | * 6 | * Libav is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * Libav is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with Libav; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | #ifndef AVUTIL_SHA_H 22 | #define AVUTIL_SHA_H 23 | 24 | #include 25 | 26 | #include "attributes.h" 27 | #include "version.h" 28 | 29 | /** 30 | * @defgroup lavu_sha SHA 31 | * @ingroup lavu_crypto 32 | * @{ 33 | */ 34 | 35 | #if FF_API_CONTEXT_SIZE 36 | extern attribute_deprecated const int av_sha_size; 37 | #endif 38 | 39 | struct AVSHA; 40 | 41 | /** 42 | * Allocate an AVSHA context. 43 | */ 44 | struct AVSHA *av_sha_alloc(void); 45 | 46 | /** 47 | * Initialize SHA-1 or SHA-2 hashing. 48 | * 49 | * @param context pointer to the function context (of size av_sha_size) 50 | * @param bits number of bits in digest (SHA-1 - 160 bits, SHA-2 224 or 256 bits) 51 | * @return zero if initialization succeeded, -1 otherwise 52 | */ 53 | int av_sha_init(struct AVSHA* context, int bits); 54 | 55 | /** 56 | * Update hash value. 57 | * 58 | * @param context hash function context 59 | * @param data input data to update hash with 60 | * @param len input data length 61 | */ 62 | void av_sha_update(struct AVSHA* context, const uint8_t* data, unsigned int len); 63 | 64 | /** 65 | * Finish hashing and output digest value. 66 | * 67 | * @param context hash function context 68 | * @param digest buffer where output digest value is stored 69 | */ 70 | void av_sha_final(struct AVSHA* context, uint8_t *digest); 71 | 72 | /** 73 | * @} 74 | */ 75 | 76 | #endif /* AVUTIL_SHA_H */ 77 | -------------------------------------------------------------------------------- /ffmpeg/include/libavutil/time.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of Libav. 3 | * 4 | * Libav is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2.1 of the License, or (at your option) any later version. 8 | * 9 | * Libav is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with Libav; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | */ 18 | 19 | #ifndef AVUTIL_TIME_H 20 | #define AVUTIL_TIME_H 21 | 22 | #include 23 | 24 | /** 25 | * Get the current time in microseconds. 26 | */ 27 | int64_t av_gettime(void); 28 | 29 | /** 30 | * Sleep for a period of time. Although the duration is expressed in 31 | * microseconds, the actual delay may be rounded to the precision of the 32 | * system timer. 33 | * 34 | * @param usec Number of microseconds to sleep. 35 | * @return zero on success or (negative) error code. 36 | */ 37 | int av_usleep(unsigned usec); 38 | 39 | #endif /* AVUTIL_TIME_H */ 40 | -------------------------------------------------------------------------------- /ffmpeg/include/libavutil/timecode.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2006 Smartjog S.A.S, Baptiste Coudurier 3 | * Copyright (c) 2011-2012 Smartjog S.A.S, Clément Bœsch 4 | * 5 | * This file is part of FFmpeg. 6 | * 7 | * FFmpeg is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public 9 | * License as published by the Free Software Foundation; either 10 | * version 2.1 of the License, or (at your option) any later version. 11 | * 12 | * FFmpeg is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public 18 | * License along with FFmpeg; if not, write to the Free Software 19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 20 | */ 21 | 22 | /** 23 | * @file 24 | * Timecode helpers header 25 | */ 26 | 27 | #ifndef AVUTIL_TIMECODE_H 28 | #define AVUTIL_TIMECODE_H 29 | 30 | #include 31 | #include "rational.h" 32 | 33 | #define AV_TIMECODE_STR_SIZE 16 34 | 35 | enum AVTimecodeFlag { 36 | AV_TIMECODE_FLAG_DROPFRAME = 1<<0, ///< timecode is drop frame 37 | AV_TIMECODE_FLAG_24HOURSMAX = 1<<1, ///< timecode wraps after 24 hours 38 | AV_TIMECODE_FLAG_ALLOWNEGATIVE = 1<<2, ///< negative time values are allowed 39 | }; 40 | 41 | typedef struct { 42 | int start; ///< timecode frame start (first base frame number) 43 | uint32_t flags; ///< flags such as drop frame, +24 hours support, ... 44 | AVRational rate; ///< frame rate in rational form 45 | unsigned fps; ///< frame per second; must be consistent with the rate field 46 | } AVTimecode; 47 | 48 | /** 49 | * Adjust frame number for NTSC drop frame time code. 50 | * 51 | * @param framenum frame number to adjust 52 | * @param fps frame per second, 30 or 60 53 | * @return adjusted frame number 54 | * @warning adjustment is only valid in NTSC 29.97 and 59.94 55 | */ 56 | int av_timecode_adjust_ntsc_framenum2(int framenum, int fps); 57 | 58 | /** 59 | * Convert frame number to SMPTE 12M binary representation. 60 | * 61 | * @param tc timecode data correctly initialized 62 | * @param framenum frame number 63 | * @return the SMPTE binary representation 64 | * 65 | * @note Frame number adjustment is automatically done in case of drop timecode, 66 | * you do NOT have to call av_timecode_adjust_ntsc_framenum2(). 67 | * @note The frame number is relative to tc->start. 68 | * @note Color frame (CF), binary group flags (BGF) and biphase mark polarity 69 | * correction (PC) bits are set to zero. 70 | */ 71 | uint32_t av_timecode_get_smpte_from_framenum(const AVTimecode *tc, int framenum); 72 | 73 | /** 74 | * Load timecode string in buf. 75 | * 76 | * @param buf destination buffer, must be at least AV_TIMECODE_STR_SIZE long 77 | * @param tc timecode data correctly initialized 78 | * @param framenum frame number 79 | * @return the buf parameter 80 | * 81 | * @note Timecode representation can be a negative timecode and have more than 82 | * 24 hours, but will only be honored if the flags are correctly set. 83 | * @note The frame number is relative to tc->start. 84 | */ 85 | char *av_timecode_make_string(const AVTimecode *tc, char *buf, int framenum); 86 | 87 | /** 88 | * Get the timecode string from the SMPTE timecode format. 89 | * 90 | * @param buf destination buffer, must be at least AV_TIMECODE_STR_SIZE long 91 | * @param tcsmpte the 32-bit SMPTE timecode 92 | * @param prevent_df prevent the use of a drop flag when it is known the DF bit 93 | * is arbitrary 94 | * @return the buf parameter 95 | */ 96 | char *av_timecode_make_smpte_tc_string(char *buf, uint32_t tcsmpte, int prevent_df); 97 | 98 | /** 99 | * Get the timecode string from the 25-bit timecode format (MPEG GOP format). 100 | * 101 | * @param buf destination buffer, must be at least AV_TIMECODE_STR_SIZE long 102 | * @param tc25bit the 25-bits timecode 103 | * @return the buf parameter 104 | */ 105 | char *av_timecode_make_mpeg_tc_string(char *buf, uint32_t tc25bit); 106 | 107 | /** 108 | * Init a timecode struct with the passed parameters. 109 | * 110 | * @param log_ctx a pointer to an arbitrary struct of which the first field 111 | * is a pointer to an AVClass struct (used for av_log) 112 | * @param tc pointer to an allocated AVTimecode 113 | * @param rate frame rate in rational form 114 | * @param flags miscellaneous flags such as drop frame, +24 hours, ... 115 | * (see AVTimecodeFlag) 116 | * @param frame_start the first frame number 117 | * @return 0 on success, AVERROR otherwise 118 | */ 119 | int av_timecode_init(AVTimecode *tc, AVRational rate, int flags, int frame_start, void *log_ctx); 120 | 121 | /** 122 | * Parse timecode representation (hh:mm:ss[:;.]ff). 123 | * 124 | * @param log_ctx a pointer to an arbitrary struct of which the first field is a 125 | * pointer to an AVClass struct (used for av_log). 126 | * @param tc pointer to an allocated AVTimecode 127 | * @param rate frame rate in rational form 128 | * @param str timecode string which will determine the frame start 129 | * @return 0 on success, AVERROR otherwise 130 | */ 131 | int av_timecode_init_from_string(AVTimecode *tc, AVRational rate, const char *str, void *log_ctx); 132 | 133 | /** 134 | * Check if the timecode feature is available for the given frame rate 135 | * 136 | * @return 0 if supported, <0 otherwise 137 | */ 138 | int av_timecode_check_frame_rate(AVRational rate); 139 | 140 | #endif /* AVUTIL_TIMECODE_H */ 141 | -------------------------------------------------------------------------------- /ffmpeg/include/libavutil/timestamp.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of FFmpeg. 3 | * 4 | * FFmpeg is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2.1 of the License, or (at your option) any later version. 8 | * 9 | * FFmpeg is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with FFmpeg; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | */ 18 | 19 | /** 20 | * @file 21 | * timestamp utils, mostly useful for debugging/logging purposes 22 | */ 23 | 24 | #ifndef AVUTIL_TIMESTAMP_H 25 | #define AVUTIL_TIMESTAMP_H 26 | 27 | #include "common.h" 28 | 29 | #define AV_TS_MAX_STRING_SIZE 32 30 | 31 | /** 32 | * Fill the provided buffer with a string containing a timestamp 33 | * representation. 34 | * 35 | * @param buf a buffer with size in bytes of at least AV_TS_MAX_STRING_SIZE 36 | * @param ts the timestamp to represent 37 | * @return the buffer in input 38 | */ 39 | static inline char *av_ts_make_string(char *buf, int64_t ts) 40 | { 41 | if (ts == AV_NOPTS_VALUE) snprintf(buf, AV_TS_MAX_STRING_SIZE, "NOPTS"); 42 | else snprintf(buf, AV_TS_MAX_STRING_SIZE, "%"PRId64"", ts); 43 | return buf; 44 | } 45 | 46 | /** 47 | * Convenience macro, the return value should be used only directly in 48 | * function arguments but never stand-alone. 49 | */ 50 | #define av_ts2str(ts) av_ts_make_string((char[AV_TS_MAX_STRING_SIZE]){0}, ts) 51 | 52 | /** 53 | * Fill the provided buffer with a string containing a timestamp time 54 | * representation. 55 | * 56 | * @param buf a buffer with size in bytes of at least AV_TS_MAX_STRING_SIZE 57 | * @param ts the timestamp to represent 58 | * @param tb the timebase of the timestamp 59 | * @return the buffer in input 60 | */ 61 | static inline char *av_ts_make_time_string(char *buf, int64_t ts, AVRational *tb) 62 | { 63 | if (ts == AV_NOPTS_VALUE) snprintf(buf, AV_TS_MAX_STRING_SIZE, "NOPTS"); 64 | else snprintf(buf, AV_TS_MAX_STRING_SIZE, "%.6g", av_q2d(*tb) * ts); 65 | return buf; 66 | } 67 | 68 | /** 69 | * Convenience macro, the return value should be used only directly in 70 | * function arguments but never stand-alone. 71 | */ 72 | #define av_ts2timestr(ts, tb) av_ts_make_time_string((char[AV_TS_MAX_STRING_SIZE]){0}, ts, tb) 73 | 74 | #endif /* AVUTIL_TIMESTAMP_H */ 75 | -------------------------------------------------------------------------------- /ffmpeg/include/libavutil/version.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of Libav. 3 | * 4 | * Libav is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2.1 of the License, or (at your option) any later version. 8 | * 9 | * Libav is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with Libav; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | */ 18 | 19 | #ifndef AVUTIL_VERSION_H 20 | #define AVUTIL_VERSION_H 21 | 22 | #include "avutil.h" 23 | 24 | /** 25 | * @file 26 | * @ingroup lavu 27 | * Libavutil version macros 28 | */ 29 | 30 | /** 31 | * @defgroup lavu_ver Version and Build diagnostics 32 | * 33 | * Macros and function useful to check at compiletime and at runtime 34 | * which version of libavutil is in use. 35 | * 36 | * @{ 37 | */ 38 | 39 | #define LIBAVUTIL_VERSION_MAJOR 52 40 | #define LIBAVUTIL_VERSION_MINOR 12 41 | #define LIBAVUTIL_VERSION_MICRO 0 42 | 43 | #define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \ 44 | LIBAVUTIL_VERSION_MINOR, \ 45 | LIBAVUTIL_VERSION_MICRO) 46 | #define LIBAVUTIL_VERSION AV_VERSION(LIBAVUTIL_VERSION_MAJOR, \ 47 | LIBAVUTIL_VERSION_MINOR, \ 48 | LIBAVUTIL_VERSION_MICRO) 49 | #define LIBAVUTIL_BUILD LIBAVUTIL_VERSION_INT 50 | 51 | #define LIBAVUTIL_IDENT "Lavu" AV_STRINGIFY(LIBAVUTIL_VERSION) 52 | 53 | /** 54 | * @} 55 | * 56 | * @defgroup depr_guards Deprecation guards 57 | * FF_API_* defines may be placed below to indicate public API that will be 58 | * dropped at a future version bump. The defines themselves are not part of 59 | * the public API and may change, break or disappear at any time. 60 | * 61 | * @{ 62 | */ 63 | 64 | #ifndef FF_API_PIX_FMT 65 | #define FF_API_PIX_FMT (LIBAVUTIL_VERSION_MAJOR < 53) 66 | #endif 67 | #ifndef FF_API_CONTEXT_SIZE 68 | #define FF_API_CONTEXT_SIZE (LIBAVUTIL_VERSION_MAJOR < 53) 69 | #endif 70 | #ifndef FF_API_PIX_FMT_DESC 71 | #define FF_API_PIX_FMT_DESC (LIBAVUTIL_VERSION_MAJOR < 53) 72 | #endif 73 | #ifndef FF_API_AV_REVERSE 74 | #define FF_API_AV_REVERSE (LIBAVUTIL_VERSION_MAJOR < 53) 75 | #endif 76 | #ifndef FF_API_AUDIOCONVERT 77 | #define FF_API_AUDIOCONVERT (LIBAVUTIL_VERSION_MAJOR < 53) 78 | #endif 79 | #ifndef FF_API_CPU_FLAG_MMX2 80 | #define FF_API_CPU_FLAG_MMX2 (LIBAVUTIL_VERSION_MAJOR < 53) 81 | #endif 82 | #ifndef FF_API_LLS_PRIVATE 83 | #define FF_API_LLS_PRIVATE (LIBAVUTIL_VERSION_MAJOR < 53) 84 | #endif 85 | #ifndef FF_API_AVFRAME_LAVC 86 | #define FF_API_AVFRAME_LAVC (LIBAVUTIL_VERSION_MAJOR < 53) 87 | #endif 88 | 89 | /** 90 | * @} 91 | */ 92 | 93 | #endif /* AVUTIL_VERSION_H */ 94 | -------------------------------------------------------------------------------- /ffmpeg/include/libavutil/xtea.h: -------------------------------------------------------------------------------- 1 | /* 2 | * A 32-bit implementation of the XTEA algorithm 3 | * 4 | * This file is part of Libav. 5 | * 6 | * Libav is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * Libav is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with Libav; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | #ifndef AVUTIL_XTEA_H 22 | #define AVUTIL_XTEA_H 23 | 24 | #include 25 | 26 | /** 27 | * @defgroup lavu_xtea XTEA 28 | * @ingroup lavu_crypto 29 | * @{ 30 | */ 31 | 32 | typedef struct AVXTEA { 33 | uint32_t key[16]; 34 | } AVXTEA; 35 | 36 | /** 37 | * Initialize an AVXTEA context. 38 | * 39 | * @param ctx an AVXTEA context 40 | * @param key a key of 16 bytes used for encryption/decryption 41 | */ 42 | void av_xtea_init(struct AVXTEA *ctx, const uint8_t key[16]); 43 | 44 | /** 45 | * Encrypt or decrypt a buffer using a previously initialized context. 46 | * 47 | * @param ctx an AVXTEA context 48 | * @param dst destination array, can be equal to src 49 | * @param src source array, can be equal to dst 50 | * @param count number of 8 byte blocks 51 | * @param iv initialization vector for CBC mode, if NULL then ECB will be used 52 | * @param decrypt 0 for encryption, 1 for decryption 53 | */ 54 | void av_xtea_crypt(struct AVXTEA *ctx, uint8_t *dst, const uint8_t *src, 55 | int count, uint8_t *iv, int decrypt); 56 | 57 | /** 58 | * @} 59 | */ 60 | 61 | #endif /* AVUTIL_XTEA_H */ 62 | -------------------------------------------------------------------------------- /ffmpeg/include/libpostproc/postprocess.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2001-2003 Michael Niedermayer (michaelni@gmx.at) 3 | * 4 | * This file is part of FFmpeg. 5 | * 6 | * FFmpeg is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * FFmpeg is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with FFmpeg; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | #ifndef POSTPROC_POSTPROCESS_H 22 | #define POSTPROC_POSTPROCESS_H 23 | 24 | /** 25 | * @file 26 | * @ingroup lpp 27 | * external API header 28 | */ 29 | 30 | /** 31 | * @defgroup lpp Libpostproc 32 | * @{ 33 | */ 34 | 35 | #include "libpostproc/version.h" 36 | 37 | /** 38 | * Return the LIBPOSTPROC_VERSION_INT constant. 39 | */ 40 | unsigned postproc_version(void); 41 | 42 | /** 43 | * Return the libpostproc build-time configuration. 44 | */ 45 | const char *postproc_configuration(void); 46 | 47 | /** 48 | * Return the libpostproc license. 49 | */ 50 | const char *postproc_license(void); 51 | 52 | #define PP_QUALITY_MAX 6 53 | 54 | #define QP_STORE_T int8_t 55 | 56 | #include 57 | 58 | typedef void pp_context; 59 | typedef void pp_mode; 60 | 61 | #if LIBPOSTPROC_VERSION_INT < (52<<16) 62 | typedef pp_context pp_context_t; 63 | typedef pp_mode pp_mode_t; 64 | extern const char *const pp_help; ///< a simple help text 65 | #else 66 | extern const char pp_help[]; ///< a simple help text 67 | #endif 68 | 69 | void pp_postprocess(const uint8_t * src[3], const int srcStride[3], 70 | uint8_t * dst[3], const int dstStride[3], 71 | int horizontalSize, int verticalSize, 72 | const QP_STORE_T *QP_store, int QP_stride, 73 | pp_mode *mode, pp_context *ppContext, int pict_type); 74 | 75 | 76 | /** 77 | * Return a pp_mode or NULL if an error occurred. 78 | * 79 | * @param name the string after "-pp" on the command line 80 | * @param quality a number from 0 to PP_QUALITY_MAX 81 | */ 82 | pp_mode *pp_get_mode_by_name_and_quality(const char *name, int quality); 83 | void pp_free_mode(pp_mode *mode); 84 | 85 | pp_context *pp_get_context(int width, int height, int flags); 86 | void pp_free_context(pp_context *ppContext); 87 | 88 | #define PP_CPU_CAPS_MMX 0x80000000 89 | #define PP_CPU_CAPS_MMX2 0x20000000 90 | #define PP_CPU_CAPS_3DNOW 0x40000000 91 | #define PP_CPU_CAPS_ALTIVEC 0x10000000 92 | #define PP_CPU_CAPS_AUTO 0x00080000 93 | 94 | #define PP_FORMAT 0x00000008 95 | #define PP_FORMAT_420 (0x00000011|PP_FORMAT) 96 | #define PP_FORMAT_422 (0x00000001|PP_FORMAT) 97 | #define PP_FORMAT_411 (0x00000002|PP_FORMAT) 98 | #define PP_FORMAT_444 (0x00000000|PP_FORMAT) 99 | 100 | #define PP_PICT_TYPE_QP2 0x00000010 ///< MPEG2 style QScale 101 | 102 | /** 103 | * @} 104 | */ 105 | 106 | #endif /* POSTPROC_POSTPROCESS_H */ 107 | -------------------------------------------------------------------------------- /ffmpeg/include/libpostproc/version.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Version macros. 3 | * 4 | * This file is part of FFmpeg. 5 | * 6 | * FFmpeg is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * FFmpeg is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with FFmpeg; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | #ifndef POSTPROC_POSTPROCESS_VERSION_H 22 | #define POSTPROC_POSTPROCESS_VERSION_H 23 | 24 | /** 25 | * @file 26 | * Libpostproc version macros 27 | */ 28 | 29 | #include "libavutil/avutil.h" 30 | 31 | #define LIBPOSTPROC_VERSION_MAJOR 52 32 | #define LIBPOSTPROC_VERSION_MINOR 2 33 | #define LIBPOSTPROC_VERSION_MICRO 100 34 | 35 | #define LIBPOSTPROC_VERSION_INT AV_VERSION_INT(LIBPOSTPROC_VERSION_MAJOR, \ 36 | LIBPOSTPROC_VERSION_MINOR, \ 37 | LIBPOSTPROC_VERSION_MICRO) 38 | #define LIBPOSTPROC_VERSION AV_VERSION(LIBPOSTPROC_VERSION_MAJOR, \ 39 | LIBPOSTPROC_VERSION_MINOR, \ 40 | LIBPOSTPROC_VERSION_MICRO) 41 | #define LIBPOSTPROC_BUILD LIBPOSTPROC_VERSION_INT 42 | 43 | #define LIBPOSTPROC_IDENT "postproc" AV_STRINGIFY(LIBPOSTPROC_VERSION) 44 | 45 | #endif /* POSTPROC_POSTPROCESS_VERSION_H */ 46 | -------------------------------------------------------------------------------- /ffmpeg/include/libswresample/version.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Version macros. 3 | * 4 | * This file is part of libswresample 5 | * 6 | * libswresample is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * libswresample is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with libswresample; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | #ifndef SWR_VERSION_H 22 | #define SWR_VERSION_H 23 | 24 | /** 25 | * @file 26 | * Libswresample version macros 27 | */ 28 | 29 | #include "libavutil/avutil.h" 30 | 31 | #define LIBSWRESAMPLE_VERSION_MAJOR 0 32 | #define LIBSWRESAMPLE_VERSION_MINOR 17 33 | #define LIBSWRESAMPLE_VERSION_MICRO 102 34 | 35 | #define LIBSWRESAMPLE_VERSION_INT AV_VERSION_INT(LIBSWRESAMPLE_VERSION_MAJOR, \ 36 | LIBSWRESAMPLE_VERSION_MINOR, \ 37 | LIBSWRESAMPLE_VERSION_MICRO) 38 | #define LIBSWRESAMPLE_VERSION AV_VERSION(LIBSWRESAMPLE_VERSION_MAJOR, \ 39 | LIBSWRESAMPLE_VERSION_MINOR, \ 40 | LIBSWRESAMPLE_VERSION_MICRO) 41 | #define LIBSWRESAMPLE_BUILD LIBSWRESAMPLE_VERSION_INT 42 | 43 | #define LIBSWRESAMPLE_IDENT "SwR" AV_STRINGIFY(LIBSWRESAMPLE_VERSION) 44 | 45 | #endif /* SWR_VERSION_H */ 46 | -------------------------------------------------------------------------------- /ffmpeg/include/libswscale/version.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of Libav. 3 | * 4 | * Libav is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2.1 of the License, or (at your option) any later version. 8 | * 9 | * Libav is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with Libav; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | */ 18 | 19 | #ifndef SWSCALE_VERSION_H 20 | #define SWSCALE_VERSION_H 21 | 22 | /** 23 | * @file 24 | * swscale version macros 25 | */ 26 | 27 | #include "libavutil/avutil.h" 28 | 29 | #define LIBSWSCALE_VERSION_MAJOR 2 30 | #define LIBSWSCALE_VERSION_MINOR 1 31 | #define LIBSWSCALE_VERSION_MICRO 2 32 | 33 | #define LIBSWSCALE_VERSION_INT AV_VERSION_INT(LIBSWSCALE_VERSION_MAJOR, \ 34 | LIBSWSCALE_VERSION_MINOR, \ 35 | LIBSWSCALE_VERSION_MICRO) 36 | #define LIBSWSCALE_VERSION AV_VERSION(LIBSWSCALE_VERSION_MAJOR, \ 37 | LIBSWSCALE_VERSION_MINOR, \ 38 | LIBSWSCALE_VERSION_MICRO) 39 | #define LIBSWSCALE_BUILD LIBSWSCALE_VERSION_INT 40 | 41 | #define LIBSWSCALE_IDENT "SwS" AV_STRINGIFY(LIBSWSCALE_VERSION) 42 | 43 | /** 44 | * FF_API_* defines may be placed below to indicate public API that will be 45 | * dropped at a future version bump. The defines themselves are not part of 46 | * the public API and may change, break or disappear at any time. 47 | */ 48 | 49 | #ifndef FF_API_SWS_GETCONTEXT 50 | #define FF_API_SWS_GETCONTEXT (LIBSWSCALE_VERSION_MAJOR < 3) 51 | #endif 52 | #ifndef FF_API_SWS_CPU_CAPS 53 | #define FF_API_SWS_CPU_CAPS (LIBSWSCALE_VERSION_MAJOR < 3) 54 | #endif 55 | 56 | #endif /* SWSCALE_VERSION_H */ 57 | -------------------------------------------------------------------------------- /ffmpeg/include/semaphore.h: -------------------------------------------------------------------------------- 1 | #ifndef WIN_SEMAPHORE 2 | #define WIN_SEMAPHORE 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | /* Set this to 0 to disable it */ 9 | #define USE_SEM_CriticalSection_SpinCount 100 10 | 11 | #define SEM_VALUE_MAX INT_MAX 12 | 13 | #ifndef _MODE_T_ 14 | #define _MODE_T_ 15 | typedef unsigned short mode_t; 16 | #endif 17 | 18 | typedef void *sem_t; 19 | 20 | #define SEM_FAILED NULL 21 | 22 | int sem_init(sem_t * sem, int pshared, unsigned int value); 23 | 24 | int sem_destroy(sem_t *sem); 25 | 26 | int sem_trywait(sem_t *sem); 27 | 28 | int sem_wait(sem_t *sem); 29 | 30 | int sem_timedwait(sem_t * sem, const struct timespec *t); 31 | 32 | int sem_post(sem_t *sem); 33 | 34 | int sem_post_multiple(sem_t *sem, int count); 35 | 36 | /* yes, it returns a semaphore (or SEM_FAILED) */ 37 | sem_t *sem_open(const char * name, int oflag, mode_t mode, unsigned int value); 38 | 39 | int sem_close(sem_t * sem); 40 | 41 | int sem_unlink(const char * name); 42 | 43 | int sem_getvalue(sem_t * sem, int * sval); 44 | 45 | #ifdef __cplusplus 46 | } 47 | #endif 48 | 49 | #endif /* WIN_SEMAPHORE */ 50 | -------------------------------------------------------------------------------- /ffmpeg/lib/avcodec.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UnickSoft/FFmpeg-encode-example/be7f2a49fbd67e62b29f78ae456d92cf71df446e/ffmpeg/lib/avcodec.lib -------------------------------------------------------------------------------- /ffmpeg/lib/avdevice.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UnickSoft/FFmpeg-encode-example/be7f2a49fbd67e62b29f78ae456d92cf71df446e/ffmpeg/lib/avdevice.lib -------------------------------------------------------------------------------- /ffmpeg/lib/avformat.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UnickSoft/FFmpeg-encode-example/be7f2a49fbd67e62b29f78ae456d92cf71df446e/ffmpeg/lib/avformat.lib -------------------------------------------------------------------------------- /ffmpeg/lib/avutil.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UnickSoft/FFmpeg-encode-example/be7f2a49fbd67e62b29f78ae456d92cf71df446e/ffmpeg/lib/avutil.lib -------------------------------------------------------------------------------- /ffmpeg/lib/swscale.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UnickSoft/FFmpeg-encode-example/be7f2a49fbd67e62b29f78ae456d92cf71df446e/ffmpeg/lib/swscale.lib -------------------------------------------------------------------------------- /ffmpegEncoder.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 10.00 3 | # Visual C++ Express 2008 4 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ffmpegDecoder", "ffmpegEncoder\ffmpegEncoder.vcproj", "{C1D750CD-5B20-48BC-944E-276D23B77F6E}" 5 | EndProject 6 | Global 7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 8 | Debug|Win32 = Debug|Win32 9 | Release|Win32 = Release|Win32 10 | EndGlobalSection 11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 12 | {C1D750CD-5B20-48BC-944E-276D23B77F6E}.Debug|Win32.ActiveCfg = Debug|Win32 13 | {C1D750CD-5B20-48BC-944E-276D23B77F6E}.Debug|Win32.Build.0 = Debug|Win32 14 | {C1D750CD-5B20-48BC-944E-276D23B77F6E}.Release|Win32.ActiveCfg = Release|Win32 15 | {C1D750CD-5B20-48BC-944E-276D23B77F6E}.Release|Win32.Build.0 = Release|Win32 16 | EndGlobalSection 17 | GlobalSection(SolutionProperties) = preSolution 18 | HideSolutionNode = FALSE 19 | EndGlobalSection 20 | EndGlobal 21 | -------------------------------------------------------------------------------- /ffmpegEncoder/Settings.h: -------------------------------------------------------------------------------- 1 | /* 2 | Settings of sample 3 | */ 4 | 5 | #ifndef __SETTINGS_H_ 6 | #define __SETTINGS_H_ 7 | 8 | #define W_VIDEO 320 9 | #define H_VIDEO 240 10 | #define FILE_NAME "c:\\temp\\1.avi" 11 | #define FRAME_COUNT 150 12 | #define CONTAINER "auto" 13 | 14 | 15 | #endif // __SETTINGS_H_ 16 | -------------------------------------------------------------------------------- /ffmpegEncoder/VideoEncoder.h: -------------------------------------------------------------------------------- 1 | /* 2 | FFmpeg simple Encoder 3 | */ 4 | 5 | 6 | #ifndef __VIDEO_ENCODER_H__ 7 | #define __VIDEO_ENCODER_H__ 8 | 9 | #include "ffmpegInclude.h" 10 | #include 11 | #include 12 | 13 | class VideoEncoder 14 | { 15 | private: 16 | 17 | // output file name 18 | std::string outputFilename; 19 | // output format. 20 | AVOutputFormat *pOutFormat; 21 | // format context 22 | AVFormatContext *pFormatContext; 23 | // video stream context 24 | AVStream * pVideoStream; 25 | // audio streams context 26 | AVStream * pAudioStream; 27 | // convert context context 28 | struct SwsContext *pImgConvertCtx; 29 | // encode buffer and size 30 | uint8_t * pVideoEncodeBuffer; 31 | int nSizeVideoEncodeBuffer; 32 | 33 | // audio buffer and size 34 | uint8_t * pAudioEncodeBuffer; 35 | int nSizeAudioEncodeBuffer; 36 | 37 | 38 | // count of sample 39 | int audioInputSampleSize; 40 | // current picture 41 | AVFrame *pCurrentPicture; 42 | 43 | // audio buffer. Save rest samples in audioBuffer from previous audio frame. 44 | char* audioBuffer; 45 | int nAudioBufferSize; 46 | int nAudioBufferSizeCurrent; 47 | 48 | public: 49 | 50 | VideoEncoder() 51 | { 52 | pOutFormat = NULL; 53 | pFormatContext = NULL; 54 | pVideoStream = NULL; 55 | pImgConvertCtx = NULL; 56 | pCurrentPicture = NULL; 57 | pVideoEncodeBuffer = NULL; 58 | nSizeVideoEncodeBuffer = 0; 59 | pAudioEncodeBuffer = NULL; 60 | nSizeAudioEncodeBuffer = 0; 61 | nAudioBufferSize = 1024 * 1024 * 4; 62 | audioBuffer = new char[nAudioBufferSize]; 63 | nAudioBufferSizeCurrent = 0; 64 | } 65 | 66 | virtual ~VideoEncoder() 67 | { 68 | Finish(); 69 | } 70 | 71 | // init output file 72 | bool InitFile(std::string& inputFile, std::string& container); 73 | // Add video and audio data 74 | bool AddFrame(AVFrame* frame, const char* soundBuffer, int soundBufferSize); 75 | // end of output 76 | bool Finish(); 77 | 78 | private: 79 | 80 | // Add video stream 81 | AVStream *AddVideoStream(AVFormatContext *pContext, AVCodecID codec_id); 82 | // Open Video Stream 83 | bool OpenVideo(AVFormatContext *oc, AVStream *pStream); 84 | // Allocate memory 85 | AVFrame * CreateFFmpegPicture(AVPixelFormat pix_fmt, int nWidth, int nHeight); 86 | // Close video stream 87 | void CloseVideo(AVFormatContext *pContext, AVStream *pStream); 88 | // Add audio stream 89 | AVStream * AddAudioStream(AVFormatContext *pContext, AVCodecID codec_id); 90 | // Open audio stream 91 | bool OpenAudio(AVFormatContext *pContext, AVStream *pStream); 92 | // close audio stream 93 | void CloseAudio(AVFormatContext *pContext, AVStream *pStream); 94 | // Add video frame 95 | bool AddVideoFrame(AVFrame * frame, AVCodecContext *pVideoCodec); 96 | // Add audio samples 97 | bool AddAudioSample(AVFormatContext *pFormatContext, 98 | AVStream *pStream, const char* soundBuffer, int soundBufferSize); 99 | // Free resourses. 100 | void Free(); 101 | bool NeedConvert(); 102 | }; 103 | 104 | #endif // __VIDEO_ENCODER_H__ 105 | -------------------------------------------------------------------------------- /ffmpegEncoder/ffmpegEncoder.vcproj: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 15 | 16 | 17 | 18 | 19 | 26 | 29 | 32 | 35 | 38 | 41 | 53 | 56 | 59 | 62 | 71 | 74 | 77 | 80 | 83 | 86 | 89 | 93 | 94 | 102 | 105 | 108 | 111 | 114 | 117 | 130 | 133 | 136 | 139 | 151 | 154 | 157 | 160 | 163 | 166 | 169 | 173 | 174 | 175 | 176 | 177 | 178 | 183 | 186 | 187 | 190 | 191 | 194 | 195 | 196 | 201 | 204 | 205 | 208 | 209 | 212 | 213 | 216 | 217 | 218 | 223 | 224 | 225 | 226 | 227 | 228 | -------------------------------------------------------------------------------- /ffmpegEncoder/ffmpegInclude.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Include ffmpeg files 3 | */ 4 | 5 | 6 | #pragma once 7 | 8 | #ifndef __STDC_CONSTANT_MACROS 9 | #define __STDC_CONSTANT_MACROS 10 | #endif 11 | 12 | //#include "stdint.h" 13 | extern "C" 14 | { 15 | #include 16 | #include 17 | #include 18 | #include 19 | } -------------------------------------------------------------------------------- /ffmpegEncoder/main.cpp: -------------------------------------------------------------------------------- 1 | // Main file 2 | 3 | #include "stdafx.h" 4 | #include "VideoEncoder.h" 5 | #include 6 | #include "Settings.h" 7 | 8 | // Create test video frame 9 | void CreateFrame(char * buffer, int w, int h, int bytespan) 10 | { 11 | int wxh = w * h; 12 | static float seed = 1.0; 13 | for (int i = 0; i < h; i ++) 14 | { 15 | char* line = buffer + i * bytespan; 16 | for (int j = 0; j < w; j ++) 17 | { 18 | // RGB 19 | line[0] = 255 * sin(((float)i / wxh * seed) * 3.14); 20 | line[1] = 255 * cos(((float)j / wxh * seed) * 3.14); 21 | line[2] = 255 * sin(((float)(i + j) / wxh * seed) * 3.14); 22 | line += 3; 23 | } 24 | } 25 | seed = seed + 2.2; 26 | } 27 | 28 | // Create sample 29 | void CreateSample(short * buffer, int sampleCount) 30 | { 31 | static float shift = 0.0; 32 | static float seconds = 0.0; 33 | 34 | const float minNu = 3.14 / (44100.0f) * 700.0f; 35 | const float maxNu = 3.14 / (44100.0f) * 1500.0f; 36 | const float speedNu = 3.14 / (44100.0f) * 10.0f; 37 | 38 | static float varNu = minNu; 39 | 40 | if (varNu > maxNu) 41 | { 42 | varNu = minNu; 43 | } 44 | 45 | varNu += speedNu; 46 | 47 | for (int i = 0; i < sampleCount; i ++) 48 | { 49 | seconds += 1.0f / 44100.0f; 50 | 51 | buffer [i] = sin(i * varNu + shift) * 0x4FFF; 52 | } 53 | shift = shift + varNu * sampleCount; 54 | } 55 | 56 | int _tmain(int argc, _TCHAR* argv[]) 57 | { 58 | VideoEncoder encoder; 59 | 60 | if (encoder.InitFile(std::string(FILE_NAME), std::string(CONTAINER))) 61 | { 62 | int w = W_VIDEO; 63 | int h = H_VIDEO; 64 | AVFrame* frame = avcodec_alloc_frame(); 65 | int nSampleSize = 2 * 44100.0f / 25.0f; // 1 / 25 sec * FORMAT SIZE(S16) 66 | char* sample = new char[nSampleSize]; 67 | // Create frame 68 | int bufferImgSize = avpicture_get_size(PIX_FMT_BGR24, w, h); 69 | uint8_t * buffer = (uint8_t*)av_mallocz(bufferImgSize); 70 | avpicture_fill((AVPicture*)frame, buffer, PIX_FMT_BGR24, w, h); 71 | 72 | for (int i = 0; i < FRAME_COUNT; i++) 73 | { 74 | CreateFrame((char *)frame->data[0], w, h, frame->linesize[0]); 75 | CreateSample((short *)sample, nSampleSize / 2); 76 | if (!encoder.AddFrame(frame, sample, nSampleSize)) 77 | { 78 | printf("Cannot write frame\n"); 79 | } 80 | } 81 | 82 | encoder.Finish(); 83 | av_free(frame->data[0]); 84 | av_free(frame); 85 | delete[] sample; 86 | sample = NULL; 87 | } 88 | else 89 | { 90 | printf ("Cannot open file " FILE_NAME "\n"); 91 | } 92 | 93 | return 0; 94 | } 95 | 96 | -------------------------------------------------------------------------------- /ffmpegEncoder/stdafx.cpp: -------------------------------------------------------------------------------- 1 | // stdafx.cpp : source file that includes just the standard includes 2 | // ffmpegDecoder.pch will be the pre-compiled header 3 | // stdafx.obj will contain the pre-compiled type information 4 | 5 | #include "stdafx.h" 6 | 7 | // TODO: reference any additional headers you need in STDAFX.H 8 | // and not in this file 9 | -------------------------------------------------------------------------------- /ffmpegEncoder/stdafx.h: -------------------------------------------------------------------------------- 1 | // stdafx.h : include file for standard system include files, 2 | // or project specific include files that are used frequently, but 3 | // are changed infrequently 4 | // 5 | 6 | #pragma once 7 | 8 | #include "targetver.h" 9 | 10 | #include 11 | #include 12 | 13 | 14 | 15 | // TODO: reference additional headers your program requires here 16 | -------------------------------------------------------------------------------- /ffmpegEncoder/stdint.h: -------------------------------------------------------------------------------- 1 | /* ISO C9x 7.18 Integer types 2 | * Based on ISO/IEC SC22/WG14 9899 Committee draft (SC22 N2794) 3 | * 4 | * THIS SOFTWARE IS NOT COPYRIGHTED 5 | * 6 | * Contributor: Danny Smith 7 | * 8 | * This source code is offered for use in the public domain. You may 9 | * use, modify or distribute it freely. 10 | * 11 | * This code is distributed in the hope that it will be useful but 12 | * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY 13 | * DISCLAIMED. This includes but is not limited to warranties of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 15 | * 16 | * Date: 2000-12-02 17 | */ 18 | 19 | 20 | #ifndef _STDINT_H 21 | #define _STDINT_H 22 | #define __need_wint_t 23 | #define __need_wchar_t 24 | #include 25 | 26 | /* 7.18.1.1 Exact-width integer types */ 27 | typedef signed char int8_t; 28 | typedef unsigned char uint8_t; 29 | typedef short int16_t; 30 | typedef unsigned short uint16_t; 31 | typedef int int32_t; 32 | typedef unsigned uint32_t; 33 | typedef long long int64_t; 34 | typedef unsigned long long uint64_t; 35 | 36 | /* 7.18.1.2 Minimum-width integer types */ 37 | typedef signed char int_least8_t; 38 | typedef unsigned char uint_least8_t; 39 | typedef short int_least16_t; 40 | typedef unsigned short uint_least16_t; 41 | typedef int int_least32_t; 42 | typedef unsigned uint_least32_t; 43 | typedef long long int_least64_t; 44 | typedef unsigned long long uint_least64_t; 45 | 46 | /* 7.18.1.3 Fastest minimum-width integer types 47 | * Not actually guaranteed to be fastest for all purposes 48 | * Here we use the exact-width types for 8 and 16-bit ints. 49 | */ 50 | typedef char int_fast8_t; 51 | typedef unsigned char uint_fast8_t; 52 | typedef short int_fast16_t; 53 | typedef unsigned short uint_fast16_t; 54 | typedef int int_fast32_t; 55 | typedef unsigned int uint_fast32_t; 56 | typedef long long int_fast64_t; 57 | typedef unsigned long long uint_fast64_t; 58 | 59 | /* 7.18.1.4 Integer types capable of holding object pointers */ 60 | 61 | #ifndef _INTPTR_T_DEFINED 62 | #define _INTPTR_T_DEFINED 63 | #ifdef _WIN64 64 | typedef __int64 intptr_t; 65 | #else 66 | typedef int intptr_t; 67 | #endif 68 | #endif 69 | 70 | #ifndef _UINTPTR_T_DEFINED 71 | #define _UINTPTR_T_DEFINED 72 | #ifdef _WIN64 73 | typedef unsigned __int64 uintptr_t; 74 | #else 75 | typedef unsigned int uintptr_t; 76 | #endif 77 | #endif 78 | 79 | /* 7.18.1.5 Greatest-width integer types */ 80 | typedef long long intmax_t; 81 | typedef unsigned long long uintmax_t; 82 | 83 | /* 7.18.2 Limits of specified-width integer types */ 84 | #if !defined ( __cplusplus) || defined (__STDC_LIMIT_MACROS) 85 | 86 | /* 7.18.2.1 Limits of exact-width integer types */ 87 | #define INT8_MIN (-128) 88 | #define INT16_MIN (-32768) 89 | #define INT32_MIN (-2147483647 - 1) 90 | #define INT64_MIN (-9223372036854775807LL - 1) 91 | 92 | #define INT8_MAX 127 93 | #define INT16_MAX 32767 94 | #define INT32_MAX 2147483647 95 | #define INT64_MAX 9223372036854775807LL 96 | 97 | #define UINT8_MAX 0xff /* 255U */ 98 | #define UINT16_MAX 0xffff /* 65535U */ 99 | #define UINT32_MAX 0xffffffff /* 4294967295U */ 100 | #define UINT64_MAX 0xffffffffffffffffULL /* 18446744073709551615ULL */ 101 | 102 | /* 7.18.2.2 Limits of minimum-width integer types */ 103 | #define INT_LEAST8_MIN INT8_MIN 104 | #define INT_LEAST16_MIN INT16_MIN 105 | #define INT_LEAST32_MIN INT32_MIN 106 | #define INT_LEAST64_MIN INT64_MIN 107 | 108 | #define INT_LEAST8_MAX INT8_MAX 109 | #define INT_LEAST16_MAX INT16_MAX 110 | #define INT_LEAST32_MAX INT32_MAX 111 | #define INT_LEAST64_MAX INT64_MAX 112 | 113 | #define UINT_LEAST8_MAX UINT8_MAX 114 | #define UINT_LEAST16_MAX UINT16_MAX 115 | #define UINT_LEAST32_MAX UINT32_MAX 116 | #define UINT_LEAST64_MAX UINT64_MAX 117 | 118 | /* 7.18.2.3 Limits of fastest minimum-width integer types */ 119 | #define INT_FAST8_MIN INT8_MIN 120 | #define INT_FAST16_MIN INT16_MIN 121 | #define INT_FAST32_MIN INT32_MIN 122 | #define INT_FAST64_MIN INT64_MIN 123 | 124 | #define INT_FAST8_MAX INT8_MAX 125 | #define INT_FAST16_MAX INT16_MAX 126 | #define INT_FAST32_MAX INT32_MAX 127 | #define INT_FAST64_MAX INT64_MAX 128 | 129 | #define UINT_FAST8_MAX UINT8_MAX 130 | #define UINT_FAST16_MAX UINT16_MAX 131 | #define UINT_FAST32_MAX UINT32_MAX 132 | #define UINT_FAST64_MAX UINT64_MAX 133 | 134 | /* 7.18.2.4 Limits of integer types capable of holding 135 | object pointers */ 136 | #ifdef _WIN64 137 | #define INTPTR_MIN INT64_MIN 138 | #define INTPTR_MAX INT64_MAX 139 | #define UINTPTR_MAX UINT64_MAX 140 | #else 141 | #define INTPTR_MIN INT32_MIN 142 | #define INTPTR_MAX INT32_MAX 143 | #define UINTPTR_MAX UINT32_MAX 144 | #endif 145 | 146 | /* 7.18.2.5 Limits of greatest-width integer types */ 147 | #define INTMAX_MIN INT64_MIN 148 | #define INTMAX_MAX INT64_MAX 149 | #define UINTMAX_MAX UINT64_MAX 150 | 151 | /* 7.18.3 Limits of other integer types */ 152 | #define PTRDIFF_MIN INTPTR_MIN 153 | #define PTRDIFF_MAX INTPTR_MAX 154 | 155 | #define SIG_ATOMIC_MIN INTPTR_MIN 156 | #define SIG_ATOMIC_MAX INTPTR_MAX 157 | 158 | #define SIZE_MAX UINTPTR_MAX 159 | 160 | #ifndef WCHAR_MIN /* also in wchar.h */ 161 | #define WCHAR_MIN 0 162 | #define WCHAR_MAX 0xffff /* UINT16_MAX */ 163 | #endif 164 | 165 | /* 166 | * wint_t is unsigned short for compatibility with MS runtime 167 | */ 168 | #define WINT_MIN 0 169 | #define WINT_MAX 0xffff /* UINT16_MAX */ 170 | 171 | #endif /* !defined ( __cplusplus) || defined __STDC_LIMIT_MACROS */ 172 | 173 | 174 | /* 7.18.4 Macros for integer constants */ 175 | #if !defined ( __cplusplus) || defined (__STDC_CONSTANT_MACROS) 176 | 177 | /* 7.18.4.1 Macros for minimum-width integer constants 178 | 179 | Accoding to Douglas Gwyn : 180 | "This spec was changed in ISO/IEC 9899:1999 TC1; in ISO/IEC 181 | 9899:1999 as initially published, the expansion was required 182 | to be an integer constant of precisely matching type, which 183 | is impossible to accomplish for the shorter types on most 184 | platforms, because C99 provides no standard way to designate 185 | an integer constant with width less than that of type int. 186 | TC1 changed this to require just an integer constant 187 | *expression* with *promoted* type." 188 | */ 189 | 190 | #define INT8_C(val) ((int8_t) + (val)) 191 | #define UINT8_C(val) ((uint8_t) + (val##U)) 192 | #define INT16_C(val) ((int16_t) + (val)) 193 | #define UINT16_C(val) ((uint16_t) + (val##U)) 194 | 195 | #define INT32_C(val) val##L 196 | #define UINT32_C(val) val##UL 197 | #define INT64_C(val) val##LL 198 | #define UINT64_C(val) val##ULL 199 | 200 | /* 7.18.4.2 Macros for greatest-width integer constants */ 201 | #define INTMAX_C(val) INT64_C(val) 202 | #define UINTMAX_C(val) UINT64_C(val) 203 | 204 | #endif /* !defined ( __cplusplus) || defined __STDC_CONSTANT_MACROS */ 205 | 206 | #endif 207 | -------------------------------------------------------------------------------- /ffmpegEncoder/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // The following macros define the minimum required platform. The minimum required platform 4 | // is the earliest version of Windows, Internet Explorer etc. that has the necessary features to run 5 | // your application. The macros work by enabling all features available on platform versions up to and 6 | // including the version specified. 7 | 8 | // Modify the following defines if you have to target a platform prior to the ones specified below. 9 | // Refer to MSDN for the latest info on corresponding values for different platforms. 10 | #ifndef _WIN32_WINNT // Specifies that the minimum required platform is Windows Vista. 11 | #define _WIN32_WINNT 0x0600 // Change this to the appropriate value to target other versions of Windows. 12 | #endif 13 | 14 | --------------------------------------------------------------------------------