@drutech/react-native-audio-analyzer 1.1.1-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +20 -0
- package/README.md +124 -0
- package/android/CMakeCache.txt +372 -0
- package/android/CMakeLists.txt +44 -0
- package/android/Makefile +211 -0
- package/android/build.gradle +110 -0
- package/android/cmake_install.cmake +49 -0
- package/android/cpp-adapter.cpp +40 -0
- package/android/ffmpeg_16kb/include/config.h +749 -0
- package/android/ffmpeg_16kb/include/libavcodec/ac3_parser.h +36 -0
- package/android/ffmpeg_16kb/include/libavcodec/adts_parser.h +37 -0
- package/android/ffmpeg_16kb/include/libavcodec/arm/mathops.h +108 -0
- package/android/ffmpeg_16kb/include/libavcodec/avcodec.h +3192 -0
- package/android/ffmpeg_16kb/include/libavcodec/avdct.h +88 -0
- package/android/ffmpeg_16kb/include/libavcodec/avfft.h +118 -0
- package/android/ffmpeg_16kb/include/libavcodec/bsf.h +332 -0
- package/android/ffmpeg_16kb/include/libavcodec/codec.h +375 -0
- package/android/ffmpeg_16kb/include/libavcodec/codec_desc.h +128 -0
- package/android/ffmpeg_16kb/include/libavcodec/codec_id.h +661 -0
- package/android/ffmpeg_16kb/include/libavcodec/codec_par.h +247 -0
- package/android/ffmpeg_16kb/include/libavcodec/d3d11va.h +112 -0
- package/android/ffmpeg_16kb/include/libavcodec/defs.h +192 -0
- package/android/ffmpeg_16kb/include/libavcodec/dirac.h +131 -0
- package/android/ffmpeg_16kb/include/libavcodec/dv_profile.h +82 -0
- package/android/ffmpeg_16kb/include/libavcodec/dxva2.h +93 -0
- package/android/ffmpeg_16kb/include/libavcodec/jni.h +46 -0
- package/android/ffmpeg_16kb/include/libavcodec/mathops.h +255 -0
- package/android/ffmpeg_16kb/include/libavcodec/mediacodec.h +103 -0
- package/android/ffmpeg_16kb/include/libavcodec/packet.h +731 -0
- package/android/ffmpeg_16kb/include/libavcodec/qsv.h +109 -0
- package/android/ffmpeg_16kb/include/libavcodec/vdpau.h +157 -0
- package/android/ffmpeg_16kb/include/libavcodec/version.h +45 -0
- package/android/ffmpeg_16kb/include/libavcodec/version_major.h +52 -0
- package/android/ffmpeg_16kb/include/libavcodec/videotoolbox.h +150 -0
- package/android/ffmpeg_16kb/include/libavcodec/vorbis_parser.h +74 -0
- package/android/ffmpeg_16kb/include/libavcodec/x86/mathops.h +133 -0
- package/android/ffmpeg_16kb/include/libavcodec/xvmc.h +171 -0
- package/android/ffmpeg_16kb/include/libavdevice/avdevice.h +397 -0
- package/android/ffmpeg_16kb/include/libavdevice/version.h +45 -0
- package/android/ffmpeg_16kb/include/libavdevice/version_major.h +36 -0
- package/android/ffmpeg_16kb/include/libavfilter/avfilter.h +1491 -0
- package/android/ffmpeg_16kb/include/libavfilter/buffersink.h +173 -0
- package/android/ffmpeg_16kb/include/libavfilter/buffersrc.h +218 -0
- package/android/ffmpeg_16kb/include/libavfilter/version.h +48 -0
- package/android/ffmpeg_16kb/include/libavfilter/version_major.h +38 -0
- package/android/ffmpeg_16kb/include/libavformat/avformat.h +2826 -0
- package/android/ffmpeg_16kb/include/libavformat/avio.h +837 -0
- package/android/ffmpeg_16kb/include/libavformat/network.h +341 -0
- package/android/ffmpeg_16kb/include/libavformat/os_support.h +317 -0
- package/android/ffmpeg_16kb/include/libavformat/url.h +409 -0
- package/android/ffmpeg_16kb/include/libavformat/version.h +47 -0
- package/android/ffmpeg_16kb/include/libavformat/version_major.h +52 -0
- package/android/ffmpeg_16kb/include/libavutil/aarch64/timer.h +50 -0
- package/android/ffmpeg_16kb/include/libavutil/adler32.h +63 -0
- package/android/ffmpeg_16kb/include/libavutil/aes.h +69 -0
- package/android/ffmpeg_16kb/include/libavutil/aes_ctr.h +99 -0
- package/android/ffmpeg_16kb/include/libavutil/ambient_viewing_environment.h +72 -0
- package/android/ffmpeg_16kb/include/libavutil/arm/timer.h +46 -0
- package/android/ffmpeg_16kb/include/libavutil/attributes.h +173 -0
- package/android/ffmpeg_16kb/include/libavutil/attributes_internal.h +34 -0
- package/android/ffmpeg_16kb/include/libavutil/audio_fifo.h +186 -0
- package/android/ffmpeg_16kb/include/libavutil/avassert.h +75 -0
- package/android/ffmpeg_16kb/include/libavutil/avconfig.h +6 -0
- package/android/ffmpeg_16kb/include/libavutil/avstring.h +429 -0
- package/android/ffmpeg_16kb/include/libavutil/avutil.h +371 -0
- package/android/ffmpeg_16kb/include/libavutil/base64.h +72 -0
- package/android/ffmpeg_16kb/include/libavutil/blowfish.h +82 -0
- package/android/ffmpeg_16kb/include/libavutil/bprint.h +251 -0
- package/android/ffmpeg_16kb/include/libavutil/bswap.h +111 -0
- package/android/ffmpeg_16kb/include/libavutil/buffer.h +322 -0
- package/android/ffmpeg_16kb/include/libavutil/camellia.h +70 -0
- package/android/ffmpeg_16kb/include/libavutil/cast5.h +80 -0
- package/android/ffmpeg_16kb/include/libavutil/channel_layout.h +783 -0
- package/android/ffmpeg_16kb/include/libavutil/common.h +578 -0
- package/android/ffmpeg_16kb/include/libavutil/cpu.h +134 -0
- package/android/ffmpeg_16kb/include/libavutil/crc.h +102 -0
- package/android/ffmpeg_16kb/include/libavutil/csp.h +150 -0
- package/android/ffmpeg_16kb/include/libavutil/des.h +81 -0
- package/android/ffmpeg_16kb/include/libavutil/detection_bbox.h +108 -0
- package/android/ffmpeg_16kb/include/libavutil/dict.h +241 -0
- package/android/ffmpeg_16kb/include/libavutil/display.h +109 -0
- package/android/ffmpeg_16kb/include/libavutil/dovi_meta.h +236 -0
- package/android/ffmpeg_16kb/include/libavutil/downmix_info.h +115 -0
- package/android/ffmpeg_16kb/include/libavutil/encryption_info.h +205 -0
- package/android/ffmpeg_16kb/include/libavutil/error.h +128 -0
- package/android/ffmpeg_16kb/include/libavutil/eval.h +140 -0
- package/android/ffmpeg_16kb/include/libavutil/ffversion.h +5 -0
- package/android/ffmpeg_16kb/include/libavutil/fifo.h +448 -0
- package/android/ffmpeg_16kb/include/libavutil/file.h +115 -0
- package/android/ffmpeg_16kb/include/libavutil/film_grain_params.h +260 -0
- package/android/ffmpeg_16kb/include/libavutil/frame.h +964 -0
- package/android/ffmpeg_16kb/include/libavutil/getenv_utf8.h +86 -0
- package/android/ffmpeg_16kb/include/libavutil/hash.h +264 -0
- package/android/ffmpeg_16kb/include/libavutil/hdr_dynamic_metadata.h +343 -0
- package/android/ffmpeg_16kb/include/libavutil/hdr_dynamic_vivid_metadata.h +285 -0
- package/android/ffmpeg_16kb/include/libavutil/hmac.h +99 -0
- package/android/ffmpeg_16kb/include/libavutil/hwcontext.h +610 -0
- package/android/ffmpeg_16kb/include/libavutil/hwcontext_cuda.h +69 -0
- package/android/ffmpeg_16kb/include/libavutil/hwcontext_d3d11va.h +178 -0
- package/android/ffmpeg_16kb/include/libavutil/hwcontext_drm.h +169 -0
- package/android/ffmpeg_16kb/include/libavutil/hwcontext_dxva2.h +75 -0
- package/android/ffmpeg_16kb/include/libavutil/hwcontext_mediacodec.h +61 -0
- package/android/ffmpeg_16kb/include/libavutil/hwcontext_opencl.h +100 -0
- package/android/ffmpeg_16kb/include/libavutil/hwcontext_qsv.h +64 -0
- package/android/ffmpeg_16kb/include/libavutil/hwcontext_vaapi.h +117 -0
- package/android/ffmpeg_16kb/include/libavutil/hwcontext_vdpau.h +44 -0
- package/android/ffmpeg_16kb/include/libavutil/hwcontext_videotoolbox.h +96 -0
- package/android/ffmpeg_16kb/include/libavutil/hwcontext_vulkan.h +281 -0
- package/android/ffmpeg_16kb/include/libavutil/imgutils.h +331 -0
- package/android/ffmpeg_16kb/include/libavutil/internal.h +190 -0
- package/android/ffmpeg_16kb/include/libavutil/intfloat.h +77 -0
- package/android/ffmpeg_16kb/include/libavutil/intreadwrite.h +644 -0
- package/android/ffmpeg_16kb/include/libavutil/lfg.h +81 -0
- package/android/ffmpeg_16kb/include/libavutil/libm.h +471 -0
- package/android/ffmpeg_16kb/include/libavutil/log.h +387 -0
- package/android/ffmpeg_16kb/include/libavutil/lzo.h +66 -0
- package/android/ffmpeg_16kb/include/libavutil/macros.h +80 -0
- package/android/ffmpeg_16kb/include/libavutil/mastering_display_metadata.h +128 -0
- package/android/ffmpeg_16kb/include/libavutil/mathematics.h +245 -0
- package/android/ffmpeg_16kb/include/libavutil/md5.h +89 -0
- package/android/ffmpeg_16kb/include/libavutil/mem.h +609 -0
- package/android/ffmpeg_16kb/include/libavutil/motion_vector.h +57 -0
- package/android/ffmpeg_16kb/include/libavutil/murmur3.h +115 -0
- package/android/ffmpeg_16kb/include/libavutil/opt.h +891 -0
- package/android/ffmpeg_16kb/include/libavutil/parseutils.h +197 -0
- package/android/ffmpeg_16kb/include/libavutil/pixdesc.h +435 -0
- package/android/ffmpeg_16kb/include/libavutil/pixelutils.h +51 -0
- package/android/ffmpeg_16kb/include/libavutil/pixfmt.h +691 -0
- package/android/ffmpeg_16kb/include/libavutil/random_seed.h +43 -0
- package/android/ffmpeg_16kb/include/libavutil/rational.h +221 -0
- package/android/ffmpeg_16kb/include/libavutil/rc4.h +69 -0
- package/android/ffmpeg_16kb/include/libavutil/replaygain.h +50 -0
- package/android/ffmpeg_16kb/include/libavutil/reverse.h +28 -0
- package/android/ffmpeg_16kb/include/libavutil/ripemd.h +83 -0
- package/android/ffmpeg_16kb/include/libavutil/samplefmt.h +269 -0
- package/android/ffmpeg_16kb/include/libavutil/sha.h +90 -0
- package/android/ffmpeg_16kb/include/libavutil/sha512.h +92 -0
- package/android/ffmpeg_16kb/include/libavutil/spherical.h +227 -0
- package/android/ffmpeg_16kb/include/libavutil/stereo3d.h +229 -0
- package/android/ffmpeg_16kb/include/libavutil/tea.h +71 -0
- package/android/ffmpeg_16kb/include/libavutil/thread.h +204 -0
- package/android/ffmpeg_16kb/include/libavutil/threadmessage.h +115 -0
- package/android/ffmpeg_16kb/include/libavutil/time.h +56 -0
- package/android/ffmpeg_16kb/include/libavutil/timecode.h +199 -0
- package/android/ffmpeg_16kb/include/libavutil/timer.h +156 -0
- package/android/ffmpeg_16kb/include/libavutil/timestamp.h +78 -0
- package/android/ffmpeg_16kb/include/libavutil/tree.h +137 -0
- package/android/ffmpeg_16kb/include/libavutil/twofish.h +70 -0
- package/android/ffmpeg_16kb/include/libavutil/tx.h +176 -0
- package/android/ffmpeg_16kb/include/libavutil/uuid.h +146 -0
- package/android/ffmpeg_16kb/include/libavutil/version.h +122 -0
- package/android/ffmpeg_16kb/include/libavutil/video_enc_params.h +171 -0
- package/android/ffmpeg_16kb/include/libavutil/x86/asm.h +154 -0
- package/android/ffmpeg_16kb/include/libavutil/x86/emms.h +58 -0
- package/android/ffmpeg_16kb/include/libavutil/x86/timer.h +50 -0
- package/android/ffmpeg_16kb/include/libavutil/xtea.h +94 -0
- package/android/ffmpeg_16kb/include/libswresample/swresample.h +650 -0
- package/android/ffmpeg_16kb/include/libswresample/version.h +46 -0
- package/android/ffmpeg_16kb/include/libswresample/version_major.h +31 -0
- package/android/ffmpeg_16kb/include/libswscale/swscale.h +436 -0
- package/android/ffmpeg_16kb/include/libswscale/version.h +44 -0
- package/android/ffmpeg_16kb/include/libswscale/version_major.h +35 -0
- package/android/ffmpeg_16kb/lib/arm64-v8a/libavcodec.so +0 -0
- package/android/ffmpeg_16kb/lib/arm64-v8a/libavdevice.so +0 -0
- package/android/ffmpeg_16kb/lib/arm64-v8a/libavfilter.so +0 -0
- package/android/ffmpeg_16kb/lib/arm64-v8a/libavformat.so +0 -0
- package/android/ffmpeg_16kb/lib/arm64-v8a/libavutil.so +0 -0
- package/android/ffmpeg_16kb/lib/arm64-v8a/libswresample.so +0 -0
- package/android/ffmpeg_16kb/lib/arm64-v8a/libswscale.so +0 -0
- package/android/ffmpeg_16kb/lib/armeabi-v7a/libavcodec_neon.so +0 -0
- package/android/ffmpeg_16kb/lib/armeabi-v7a/libavdevice_neon.so +0 -0
- package/android/ffmpeg_16kb/lib/armeabi-v7a/libavfilter_neon.so +0 -0
- package/android/ffmpeg_16kb/lib/armeabi-v7a/libavformat_neon.so +0 -0
- package/android/ffmpeg_16kb/lib/armeabi-v7a/libavutil_neon.so +0 -0
- package/android/ffmpeg_16kb/lib/armeabi-v7a/libswresample_neon.so +0 -0
- package/android/ffmpeg_16kb/lib/armeabi-v7a/libswscale_neon.so +0 -0
- package/android/ffmpeg_16kb/lib/x86/libavcodec.so +0 -0
- package/android/ffmpeg_16kb/lib/x86/libavdevice.so +0 -0
- package/android/ffmpeg_16kb/lib/x86/libavfilter.so +0 -0
- package/android/ffmpeg_16kb/lib/x86/libavformat.so +0 -0
- package/android/ffmpeg_16kb/lib/x86/libavutil.so +0 -0
- package/android/ffmpeg_16kb/lib/x86/libswresample.so +0 -0
- package/android/ffmpeg_16kb/lib/x86/libswscale.so +0 -0
- package/android/ffmpeg_16kb/lib/x86_64/libavcodec.so +0 -0
- package/android/ffmpeg_16kb/lib/x86_64/libavdevice.so +0 -0
- package/android/ffmpeg_16kb/lib/x86_64/libavfilter.so +0 -0
- package/android/ffmpeg_16kb/lib/x86_64/libavformat.so +0 -0
- package/android/ffmpeg_16kb/lib/x86_64/libavutil.so +0 -0
- package/android/ffmpeg_16kb/lib/x86_64/libswresample.so +0 -0
- package/android/ffmpeg_16kb/lib/x86_64/libswscale.so +0 -0
- package/android/gradle.properties +5 -0
- package/android/src/main/AndroidManifest.xml +3 -0
- package/android/src/main/AndroidManifestNew.xml +2 -0
- package/android/src/main/java/com/audioanalyzer/AmplitudeData.java +20 -0
- package/android/src/main/java/com/audioanalyzer/AudioAnalyzerModule.java +52 -0
- package/android/src/main/java/com/audioanalyzer/AudioAnalyzerPackage.java +28 -0
- package/cpp/react-native-audio-analyzer.cpp +143 -0
- package/cpp/react-native-audio-analyzer.h +27 -0
- package/ios/AudioAnalyzer.h +19 -0
- package/ios/AudioAnalyzer.mm +43 -0
- package/lib/commonjs/helpers.js +34 -0
- package/lib/commonjs/helpers.js.map +1 -0
- package/lib/commonjs/helpers.test.js +49 -0
- package/lib/commonjs/helpers.test.js.map +1 -0
- package/lib/commonjs/index.js +35 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/module/helpers.js +27 -0
- package/lib/module/helpers.js.map +1 -0
- package/lib/module/helpers.test.js +47 -0
- package/lib/module/helpers.test.js.map +1 -0
- package/lib/module/index.js +15 -0
- package/lib/module/index.js.map +1 -0
- package/lib/typescript/src/helpers.d.ts +3 -0
- package/lib/typescript/src/helpers.d.ts.map +1 -0
- package/lib/typescript/src/helpers.test.d.ts +2 -0
- package/lib/typescript/src/helpers.test.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +7 -0
- package/lib/typescript/src/index.d.ts.map +1 -0
- package/package.json +163 -0
- package/react-native-audio-analyzer.podspec +44 -0
- package/src/helpers.test.ts +59 -0
- package/src/helpers.ts +34 -0
- package/src/index.tsx +30 -0
|
@@ -0,0 +1,128 @@
|
|
|
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
|
+
* error code definitions
|
|
22
|
+
*/
|
|
23
|
+
|
|
24
|
+
#ifndef AVUTIL_ERROR_H
|
|
25
|
+
#define AVUTIL_ERROR_H
|
|
26
|
+
|
|
27
|
+
#include <errno.h>
|
|
28
|
+
#include <stddef.h>
|
|
29
|
+
|
|
30
|
+
#include "macros.h"
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* @addtogroup lavu_error
|
|
34
|
+
*
|
|
35
|
+
* @{
|
|
36
|
+
*/
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
/* error handling */
|
|
40
|
+
#if EDOM > 0
|
|
41
|
+
#define AVERROR(e) (-(e)) ///< Returns a negative error code from a POSIX error code, to return from library functions.
|
|
42
|
+
#define AVUNERROR(e) (-(e)) ///< Returns a POSIX error code from a library function error return value.
|
|
43
|
+
#else
|
|
44
|
+
/* Some platforms have E* and errno already negated. */
|
|
45
|
+
#define AVERROR(e) (e)
|
|
46
|
+
#define AVUNERROR(e) (e)
|
|
47
|
+
#endif
|
|
48
|
+
|
|
49
|
+
#define FFERRTAG(a, b, c, d) (-(int)MKTAG(a, b, c, d))
|
|
50
|
+
|
|
51
|
+
#define AVERROR_BSF_NOT_FOUND FFERRTAG(0xF8,'B','S','F') ///< Bitstream filter not found
|
|
52
|
+
#define AVERROR_BUG FFERRTAG( 'B','U','G','!') ///< Internal bug, also see AVERROR_BUG2
|
|
53
|
+
#define AVERROR_BUFFER_TOO_SMALL FFERRTAG( 'B','U','F','S') ///< Buffer too small
|
|
54
|
+
#define AVERROR_DECODER_NOT_FOUND FFERRTAG(0xF8,'D','E','C') ///< Decoder not found
|
|
55
|
+
#define AVERROR_DEMUXER_NOT_FOUND FFERRTAG(0xF8,'D','E','M') ///< Demuxer not found
|
|
56
|
+
#define AVERROR_ENCODER_NOT_FOUND FFERRTAG(0xF8,'E','N','C') ///< Encoder not found
|
|
57
|
+
#define AVERROR_EOF FFERRTAG( 'E','O','F',' ') ///< End of file
|
|
58
|
+
#define AVERROR_EXIT FFERRTAG( 'E','X','I','T') ///< Immediate exit was requested; the called function should not be restarted
|
|
59
|
+
#define AVERROR_EXTERNAL FFERRTAG( 'E','X','T',' ') ///< Generic error in an external library
|
|
60
|
+
#define AVERROR_FILTER_NOT_FOUND FFERRTAG(0xF8,'F','I','L') ///< Filter not found
|
|
61
|
+
#define AVERROR_INVALIDDATA FFERRTAG( 'I','N','D','A') ///< Invalid data found when processing input
|
|
62
|
+
#define AVERROR_MUXER_NOT_FOUND FFERRTAG(0xF8,'M','U','X') ///< Muxer not found
|
|
63
|
+
#define AVERROR_OPTION_NOT_FOUND FFERRTAG(0xF8,'O','P','T') ///< Option not found
|
|
64
|
+
#define AVERROR_PATCHWELCOME FFERRTAG( 'P','A','W','E') ///< Not yet implemented in FFmpeg, patches welcome
|
|
65
|
+
#define AVERROR_PROTOCOL_NOT_FOUND FFERRTAG(0xF8,'P','R','O') ///< Protocol not found
|
|
66
|
+
|
|
67
|
+
#define AVERROR_STREAM_NOT_FOUND FFERRTAG(0xF8,'S','T','R') ///< Stream not found
|
|
68
|
+
/**
|
|
69
|
+
* This is semantically identical to AVERROR_BUG
|
|
70
|
+
* it has been introduced in Libav after our AVERROR_BUG and with a modified value.
|
|
71
|
+
*/
|
|
72
|
+
#define AVERROR_BUG2 FFERRTAG( 'B','U','G',' ')
|
|
73
|
+
#define AVERROR_UNKNOWN FFERRTAG( 'U','N','K','N') ///< Unknown error, typically from an external library
|
|
74
|
+
#define AVERROR_EXPERIMENTAL (-0x2bb2afa8) ///< Requested feature is flagged experimental. Set strict_std_compliance if you really want to use it.
|
|
75
|
+
#define AVERROR_INPUT_CHANGED (-0x636e6701) ///< Input changed between calls. Reconfiguration is required. (can be OR-ed with AVERROR_OUTPUT_CHANGED)
|
|
76
|
+
#define AVERROR_OUTPUT_CHANGED (-0x636e6702) ///< Output changed between calls. Reconfiguration is required. (can be OR-ed with AVERROR_INPUT_CHANGED)
|
|
77
|
+
/* HTTP & RTSP errors */
|
|
78
|
+
#define AVERROR_HTTP_BAD_REQUEST FFERRTAG(0xF8,'4','0','0')
|
|
79
|
+
#define AVERROR_HTTP_UNAUTHORIZED FFERRTAG(0xF8,'4','0','1')
|
|
80
|
+
#define AVERROR_HTTP_FORBIDDEN FFERRTAG(0xF8,'4','0','3')
|
|
81
|
+
#define AVERROR_HTTP_NOT_FOUND FFERRTAG(0xF8,'4','0','4')
|
|
82
|
+
#define AVERROR_HTTP_OTHER_4XX FFERRTAG(0xF8,'4','X','X')
|
|
83
|
+
#define AVERROR_HTTP_SERVER_ERROR FFERRTAG(0xF8,'5','X','X')
|
|
84
|
+
|
|
85
|
+
#define AV_ERROR_MAX_STRING_SIZE 64
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Put a description of the AVERROR code errnum in errbuf.
|
|
89
|
+
* In case of failure the global variable errno is set to indicate the
|
|
90
|
+
* error. Even in case of failure av_strerror() will print a generic
|
|
91
|
+
* error message indicating the errnum provided to errbuf.
|
|
92
|
+
*
|
|
93
|
+
* @param errnum error code to describe
|
|
94
|
+
* @param errbuf buffer to which description is written
|
|
95
|
+
* @param errbuf_size the size in bytes of errbuf
|
|
96
|
+
* @return 0 on success, a negative value if a description for errnum
|
|
97
|
+
* cannot be found
|
|
98
|
+
*/
|
|
99
|
+
int av_strerror(int errnum, char *errbuf, size_t errbuf_size);
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* Fill the provided buffer with a string containing an error string
|
|
103
|
+
* corresponding to the AVERROR code errnum.
|
|
104
|
+
*
|
|
105
|
+
* @param errbuf a buffer
|
|
106
|
+
* @param errbuf_size size in bytes of errbuf
|
|
107
|
+
* @param errnum error code to describe
|
|
108
|
+
* @return the buffer in input, filled with the error description
|
|
109
|
+
* @see av_strerror()
|
|
110
|
+
*/
|
|
111
|
+
static inline char *av_make_error_string(char *errbuf, size_t errbuf_size, int errnum)
|
|
112
|
+
{
|
|
113
|
+
av_strerror(errnum, errbuf, errbuf_size);
|
|
114
|
+
return errbuf;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* Convenience macro, the return value should be used only directly in
|
|
119
|
+
* function arguments but never stand-alone.
|
|
120
|
+
*/
|
|
121
|
+
#define av_err2str(errnum) \
|
|
122
|
+
av_make_error_string((char[AV_ERROR_MAX_STRING_SIZE]){0}, AV_ERROR_MAX_STRING_SIZE, errnum)
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* @}
|
|
126
|
+
*/
|
|
127
|
+
|
|
128
|
+
#endif /* AVUTIL_ERROR_H */
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2002 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
|
|
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
|
+
/**
|
|
22
|
+
* @file
|
|
23
|
+
* simple arithmetic expression evaluator
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
#ifndef AVUTIL_EVAL_H
|
|
27
|
+
#define AVUTIL_EVAL_H
|
|
28
|
+
|
|
29
|
+
typedef struct AVExpr AVExpr;
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Parse and evaluate an expression.
|
|
33
|
+
* Note, this is significantly slower than av_expr_eval().
|
|
34
|
+
*
|
|
35
|
+
* @param res a pointer to a double where is put the result value of
|
|
36
|
+
* the expression, or NAN in case of error
|
|
37
|
+
* @param s expression as a zero terminated string, for example "1+2^3+5*5+sin(2/3)"
|
|
38
|
+
* @param const_names NULL terminated array of zero terminated strings of constant identifiers, for example {"PI", "E", 0}
|
|
39
|
+
* @param const_values a zero terminated array of values for the identifiers from const_names
|
|
40
|
+
* @param func1_names NULL terminated array of zero terminated strings of funcs1 identifiers
|
|
41
|
+
* @param funcs1 NULL terminated array of function pointers for functions which take 1 argument
|
|
42
|
+
* @param func2_names NULL terminated array of zero terminated strings of funcs2 identifiers
|
|
43
|
+
* @param funcs2 NULL terminated array of function pointers for functions which take 2 arguments
|
|
44
|
+
* @param opaque a pointer which will be passed to all functions from funcs1 and funcs2
|
|
45
|
+
* @param log_offset log level offset, can be used to silence error messages
|
|
46
|
+
* @param log_ctx parent logging context
|
|
47
|
+
* @return >= 0 in case of success, a negative value corresponding to an
|
|
48
|
+
* AVERROR code otherwise
|
|
49
|
+
*/
|
|
50
|
+
int av_expr_parse_and_eval(double *res, const char *s,
|
|
51
|
+
const char * const *const_names, const double *const_values,
|
|
52
|
+
const char * const *func1_names, double (* const *funcs1)(void *, double),
|
|
53
|
+
const char * const *func2_names, double (* const *funcs2)(void *, double, double),
|
|
54
|
+
void *opaque, int log_offset, void *log_ctx);
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Parse an expression.
|
|
58
|
+
*
|
|
59
|
+
* @param expr a pointer where is put an AVExpr containing the parsed
|
|
60
|
+
* value in case of successful parsing, or NULL otherwise.
|
|
61
|
+
* The pointed to AVExpr must be freed with av_expr_free() by the user
|
|
62
|
+
* when it is not needed anymore.
|
|
63
|
+
* @param s expression as a zero terminated string, for example "1+2^3+5*5+sin(2/3)"
|
|
64
|
+
* @param const_names NULL terminated array of zero terminated strings of constant identifiers, for example {"PI", "E", 0}
|
|
65
|
+
* @param func1_names NULL terminated array of zero terminated strings of funcs1 identifiers
|
|
66
|
+
* @param funcs1 NULL terminated array of function pointers for functions which take 1 argument
|
|
67
|
+
* @param func2_names NULL terminated array of zero terminated strings of funcs2 identifiers
|
|
68
|
+
* @param funcs2 NULL terminated array of function pointers for functions which take 2 arguments
|
|
69
|
+
* @param log_offset log level offset, can be used to silence error messages
|
|
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 e the AVExpr to evaluate
|
|
84
|
+
* @param const_values a zero terminated array of values for the identifiers from av_expr_parse() const_names
|
|
85
|
+
* @param opaque a pointer which will be passed to all functions from funcs1 and funcs2
|
|
86
|
+
* @return the value of the expression
|
|
87
|
+
*/
|
|
88
|
+
double av_expr_eval(AVExpr *e, const double *const_values, void *opaque);
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Track the presence of variables and their number of occurrences in a parsed expression
|
|
92
|
+
*
|
|
93
|
+
* @param e the AVExpr to track variables in
|
|
94
|
+
* @param counter a zero-initialized array where the count of each variable will be stored
|
|
95
|
+
* @param size size of array
|
|
96
|
+
* @return 0 on success, a negative value indicates that no expression or array was passed
|
|
97
|
+
* or size was zero
|
|
98
|
+
*/
|
|
99
|
+
int av_expr_count_vars(AVExpr *e, unsigned *counter, int size);
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* Track the presence of user provided functions and their number of occurrences
|
|
103
|
+
* in a parsed expression.
|
|
104
|
+
*
|
|
105
|
+
* @param e the AVExpr to track user provided functions in
|
|
106
|
+
* @param counter a zero-initialized array where the count of each function will be stored
|
|
107
|
+
* if you passed 5 functions with 2 arguments to av_expr_parse()
|
|
108
|
+
* then for arg=2 this will use upto 5 entries.
|
|
109
|
+
* @param size size of array
|
|
110
|
+
* @param arg number of arguments the counted functions have
|
|
111
|
+
* @return 0 on success, a negative value indicates that no expression or array was passed
|
|
112
|
+
* or size was zero
|
|
113
|
+
*/
|
|
114
|
+
int av_expr_count_func(AVExpr *e, unsigned *counter, int size, int arg);
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* Free a parsed expression previously created with av_expr_parse().
|
|
118
|
+
*/
|
|
119
|
+
void av_expr_free(AVExpr *e);
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* Parse the string in numstr and return its value as a double. If
|
|
123
|
+
* the string is empty, contains only whitespaces, or does not contain
|
|
124
|
+
* an initial substring that has the expected syntax for a
|
|
125
|
+
* floating-point number, no conversion is performed. In this case,
|
|
126
|
+
* returns a value of zero and the value returned in tail is the value
|
|
127
|
+
* of numstr.
|
|
128
|
+
*
|
|
129
|
+
* @param numstr a string representing a number, may contain one of
|
|
130
|
+
* the International System number postfixes, for example 'K', 'M',
|
|
131
|
+
* 'G'. If 'i' is appended after the postfix, powers of 2 are used
|
|
132
|
+
* instead of powers of 10. The 'B' postfix multiplies the value by
|
|
133
|
+
* 8, and can be appended after another postfix or used alone. This
|
|
134
|
+
* allows using for example 'KB', 'MiB', 'G' and 'B' as postfix.
|
|
135
|
+
* @param tail if non-NULL puts here the pointer to the char next
|
|
136
|
+
* after the last parsed character
|
|
137
|
+
*/
|
|
138
|
+
double av_strtod(const char *numstr, char **tail);
|
|
139
|
+
|
|
140
|
+
#endif /* AVUTIL_EVAL_H */
|