@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.
Files changed (223) hide show
  1. package/LICENSE +20 -0
  2. package/README.md +124 -0
  3. package/android/CMakeCache.txt +372 -0
  4. package/android/CMakeLists.txt +44 -0
  5. package/android/Makefile +211 -0
  6. package/android/build.gradle +110 -0
  7. package/android/cmake_install.cmake +49 -0
  8. package/android/cpp-adapter.cpp +40 -0
  9. package/android/ffmpeg_16kb/include/config.h +749 -0
  10. package/android/ffmpeg_16kb/include/libavcodec/ac3_parser.h +36 -0
  11. package/android/ffmpeg_16kb/include/libavcodec/adts_parser.h +37 -0
  12. package/android/ffmpeg_16kb/include/libavcodec/arm/mathops.h +108 -0
  13. package/android/ffmpeg_16kb/include/libavcodec/avcodec.h +3192 -0
  14. package/android/ffmpeg_16kb/include/libavcodec/avdct.h +88 -0
  15. package/android/ffmpeg_16kb/include/libavcodec/avfft.h +118 -0
  16. package/android/ffmpeg_16kb/include/libavcodec/bsf.h +332 -0
  17. package/android/ffmpeg_16kb/include/libavcodec/codec.h +375 -0
  18. package/android/ffmpeg_16kb/include/libavcodec/codec_desc.h +128 -0
  19. package/android/ffmpeg_16kb/include/libavcodec/codec_id.h +661 -0
  20. package/android/ffmpeg_16kb/include/libavcodec/codec_par.h +247 -0
  21. package/android/ffmpeg_16kb/include/libavcodec/d3d11va.h +112 -0
  22. package/android/ffmpeg_16kb/include/libavcodec/defs.h +192 -0
  23. package/android/ffmpeg_16kb/include/libavcodec/dirac.h +131 -0
  24. package/android/ffmpeg_16kb/include/libavcodec/dv_profile.h +82 -0
  25. package/android/ffmpeg_16kb/include/libavcodec/dxva2.h +93 -0
  26. package/android/ffmpeg_16kb/include/libavcodec/jni.h +46 -0
  27. package/android/ffmpeg_16kb/include/libavcodec/mathops.h +255 -0
  28. package/android/ffmpeg_16kb/include/libavcodec/mediacodec.h +103 -0
  29. package/android/ffmpeg_16kb/include/libavcodec/packet.h +731 -0
  30. package/android/ffmpeg_16kb/include/libavcodec/qsv.h +109 -0
  31. package/android/ffmpeg_16kb/include/libavcodec/vdpau.h +157 -0
  32. package/android/ffmpeg_16kb/include/libavcodec/version.h +45 -0
  33. package/android/ffmpeg_16kb/include/libavcodec/version_major.h +52 -0
  34. package/android/ffmpeg_16kb/include/libavcodec/videotoolbox.h +150 -0
  35. package/android/ffmpeg_16kb/include/libavcodec/vorbis_parser.h +74 -0
  36. package/android/ffmpeg_16kb/include/libavcodec/x86/mathops.h +133 -0
  37. package/android/ffmpeg_16kb/include/libavcodec/xvmc.h +171 -0
  38. package/android/ffmpeg_16kb/include/libavdevice/avdevice.h +397 -0
  39. package/android/ffmpeg_16kb/include/libavdevice/version.h +45 -0
  40. package/android/ffmpeg_16kb/include/libavdevice/version_major.h +36 -0
  41. package/android/ffmpeg_16kb/include/libavfilter/avfilter.h +1491 -0
  42. package/android/ffmpeg_16kb/include/libavfilter/buffersink.h +173 -0
  43. package/android/ffmpeg_16kb/include/libavfilter/buffersrc.h +218 -0
  44. package/android/ffmpeg_16kb/include/libavfilter/version.h +48 -0
  45. package/android/ffmpeg_16kb/include/libavfilter/version_major.h +38 -0
  46. package/android/ffmpeg_16kb/include/libavformat/avformat.h +2826 -0
  47. package/android/ffmpeg_16kb/include/libavformat/avio.h +837 -0
  48. package/android/ffmpeg_16kb/include/libavformat/network.h +341 -0
  49. package/android/ffmpeg_16kb/include/libavformat/os_support.h +317 -0
  50. package/android/ffmpeg_16kb/include/libavformat/url.h +409 -0
  51. package/android/ffmpeg_16kb/include/libavformat/version.h +47 -0
  52. package/android/ffmpeg_16kb/include/libavformat/version_major.h +52 -0
  53. package/android/ffmpeg_16kb/include/libavutil/aarch64/timer.h +50 -0
  54. package/android/ffmpeg_16kb/include/libavutil/adler32.h +63 -0
  55. package/android/ffmpeg_16kb/include/libavutil/aes.h +69 -0
  56. package/android/ffmpeg_16kb/include/libavutil/aes_ctr.h +99 -0
  57. package/android/ffmpeg_16kb/include/libavutil/ambient_viewing_environment.h +72 -0
  58. package/android/ffmpeg_16kb/include/libavutil/arm/timer.h +46 -0
  59. package/android/ffmpeg_16kb/include/libavutil/attributes.h +173 -0
  60. package/android/ffmpeg_16kb/include/libavutil/attributes_internal.h +34 -0
  61. package/android/ffmpeg_16kb/include/libavutil/audio_fifo.h +186 -0
  62. package/android/ffmpeg_16kb/include/libavutil/avassert.h +75 -0
  63. package/android/ffmpeg_16kb/include/libavutil/avconfig.h +6 -0
  64. package/android/ffmpeg_16kb/include/libavutil/avstring.h +429 -0
  65. package/android/ffmpeg_16kb/include/libavutil/avutil.h +371 -0
  66. package/android/ffmpeg_16kb/include/libavutil/base64.h +72 -0
  67. package/android/ffmpeg_16kb/include/libavutil/blowfish.h +82 -0
  68. package/android/ffmpeg_16kb/include/libavutil/bprint.h +251 -0
  69. package/android/ffmpeg_16kb/include/libavutil/bswap.h +111 -0
  70. package/android/ffmpeg_16kb/include/libavutil/buffer.h +322 -0
  71. package/android/ffmpeg_16kb/include/libavutil/camellia.h +70 -0
  72. package/android/ffmpeg_16kb/include/libavutil/cast5.h +80 -0
  73. package/android/ffmpeg_16kb/include/libavutil/channel_layout.h +783 -0
  74. package/android/ffmpeg_16kb/include/libavutil/common.h +578 -0
  75. package/android/ffmpeg_16kb/include/libavutil/cpu.h +134 -0
  76. package/android/ffmpeg_16kb/include/libavutil/crc.h +102 -0
  77. package/android/ffmpeg_16kb/include/libavutil/csp.h +150 -0
  78. package/android/ffmpeg_16kb/include/libavutil/des.h +81 -0
  79. package/android/ffmpeg_16kb/include/libavutil/detection_bbox.h +108 -0
  80. package/android/ffmpeg_16kb/include/libavutil/dict.h +241 -0
  81. package/android/ffmpeg_16kb/include/libavutil/display.h +109 -0
  82. package/android/ffmpeg_16kb/include/libavutil/dovi_meta.h +236 -0
  83. package/android/ffmpeg_16kb/include/libavutil/downmix_info.h +115 -0
  84. package/android/ffmpeg_16kb/include/libavutil/encryption_info.h +205 -0
  85. package/android/ffmpeg_16kb/include/libavutil/error.h +128 -0
  86. package/android/ffmpeg_16kb/include/libavutil/eval.h +140 -0
  87. package/android/ffmpeg_16kb/include/libavutil/ffversion.h +5 -0
  88. package/android/ffmpeg_16kb/include/libavutil/fifo.h +448 -0
  89. package/android/ffmpeg_16kb/include/libavutil/file.h +115 -0
  90. package/android/ffmpeg_16kb/include/libavutil/film_grain_params.h +260 -0
  91. package/android/ffmpeg_16kb/include/libavutil/frame.h +964 -0
  92. package/android/ffmpeg_16kb/include/libavutil/getenv_utf8.h +86 -0
  93. package/android/ffmpeg_16kb/include/libavutil/hash.h +264 -0
  94. package/android/ffmpeg_16kb/include/libavutil/hdr_dynamic_metadata.h +343 -0
  95. package/android/ffmpeg_16kb/include/libavutil/hdr_dynamic_vivid_metadata.h +285 -0
  96. package/android/ffmpeg_16kb/include/libavutil/hmac.h +99 -0
  97. package/android/ffmpeg_16kb/include/libavutil/hwcontext.h +610 -0
  98. package/android/ffmpeg_16kb/include/libavutil/hwcontext_cuda.h +69 -0
  99. package/android/ffmpeg_16kb/include/libavutil/hwcontext_d3d11va.h +178 -0
  100. package/android/ffmpeg_16kb/include/libavutil/hwcontext_drm.h +169 -0
  101. package/android/ffmpeg_16kb/include/libavutil/hwcontext_dxva2.h +75 -0
  102. package/android/ffmpeg_16kb/include/libavutil/hwcontext_mediacodec.h +61 -0
  103. package/android/ffmpeg_16kb/include/libavutil/hwcontext_opencl.h +100 -0
  104. package/android/ffmpeg_16kb/include/libavutil/hwcontext_qsv.h +64 -0
  105. package/android/ffmpeg_16kb/include/libavutil/hwcontext_vaapi.h +117 -0
  106. package/android/ffmpeg_16kb/include/libavutil/hwcontext_vdpau.h +44 -0
  107. package/android/ffmpeg_16kb/include/libavutil/hwcontext_videotoolbox.h +96 -0
  108. package/android/ffmpeg_16kb/include/libavutil/hwcontext_vulkan.h +281 -0
  109. package/android/ffmpeg_16kb/include/libavutil/imgutils.h +331 -0
  110. package/android/ffmpeg_16kb/include/libavutil/internal.h +190 -0
  111. package/android/ffmpeg_16kb/include/libavutil/intfloat.h +77 -0
  112. package/android/ffmpeg_16kb/include/libavutil/intreadwrite.h +644 -0
  113. package/android/ffmpeg_16kb/include/libavutil/lfg.h +81 -0
  114. package/android/ffmpeg_16kb/include/libavutil/libm.h +471 -0
  115. package/android/ffmpeg_16kb/include/libavutil/log.h +387 -0
  116. package/android/ffmpeg_16kb/include/libavutil/lzo.h +66 -0
  117. package/android/ffmpeg_16kb/include/libavutil/macros.h +80 -0
  118. package/android/ffmpeg_16kb/include/libavutil/mastering_display_metadata.h +128 -0
  119. package/android/ffmpeg_16kb/include/libavutil/mathematics.h +245 -0
  120. package/android/ffmpeg_16kb/include/libavutil/md5.h +89 -0
  121. package/android/ffmpeg_16kb/include/libavutil/mem.h +609 -0
  122. package/android/ffmpeg_16kb/include/libavutil/motion_vector.h +57 -0
  123. package/android/ffmpeg_16kb/include/libavutil/murmur3.h +115 -0
  124. package/android/ffmpeg_16kb/include/libavutil/opt.h +891 -0
  125. package/android/ffmpeg_16kb/include/libavutil/parseutils.h +197 -0
  126. package/android/ffmpeg_16kb/include/libavutil/pixdesc.h +435 -0
  127. package/android/ffmpeg_16kb/include/libavutil/pixelutils.h +51 -0
  128. package/android/ffmpeg_16kb/include/libavutil/pixfmt.h +691 -0
  129. package/android/ffmpeg_16kb/include/libavutil/random_seed.h +43 -0
  130. package/android/ffmpeg_16kb/include/libavutil/rational.h +221 -0
  131. package/android/ffmpeg_16kb/include/libavutil/rc4.h +69 -0
  132. package/android/ffmpeg_16kb/include/libavutil/replaygain.h +50 -0
  133. package/android/ffmpeg_16kb/include/libavutil/reverse.h +28 -0
  134. package/android/ffmpeg_16kb/include/libavutil/ripemd.h +83 -0
  135. package/android/ffmpeg_16kb/include/libavutil/samplefmt.h +269 -0
  136. package/android/ffmpeg_16kb/include/libavutil/sha.h +90 -0
  137. package/android/ffmpeg_16kb/include/libavutil/sha512.h +92 -0
  138. package/android/ffmpeg_16kb/include/libavutil/spherical.h +227 -0
  139. package/android/ffmpeg_16kb/include/libavutil/stereo3d.h +229 -0
  140. package/android/ffmpeg_16kb/include/libavutil/tea.h +71 -0
  141. package/android/ffmpeg_16kb/include/libavutil/thread.h +204 -0
  142. package/android/ffmpeg_16kb/include/libavutil/threadmessage.h +115 -0
  143. package/android/ffmpeg_16kb/include/libavutil/time.h +56 -0
  144. package/android/ffmpeg_16kb/include/libavutil/timecode.h +199 -0
  145. package/android/ffmpeg_16kb/include/libavutil/timer.h +156 -0
  146. package/android/ffmpeg_16kb/include/libavutil/timestamp.h +78 -0
  147. package/android/ffmpeg_16kb/include/libavutil/tree.h +137 -0
  148. package/android/ffmpeg_16kb/include/libavutil/twofish.h +70 -0
  149. package/android/ffmpeg_16kb/include/libavutil/tx.h +176 -0
  150. package/android/ffmpeg_16kb/include/libavutil/uuid.h +146 -0
  151. package/android/ffmpeg_16kb/include/libavutil/version.h +122 -0
  152. package/android/ffmpeg_16kb/include/libavutil/video_enc_params.h +171 -0
  153. package/android/ffmpeg_16kb/include/libavutil/x86/asm.h +154 -0
  154. package/android/ffmpeg_16kb/include/libavutil/x86/emms.h +58 -0
  155. package/android/ffmpeg_16kb/include/libavutil/x86/timer.h +50 -0
  156. package/android/ffmpeg_16kb/include/libavutil/xtea.h +94 -0
  157. package/android/ffmpeg_16kb/include/libswresample/swresample.h +650 -0
  158. package/android/ffmpeg_16kb/include/libswresample/version.h +46 -0
  159. package/android/ffmpeg_16kb/include/libswresample/version_major.h +31 -0
  160. package/android/ffmpeg_16kb/include/libswscale/swscale.h +436 -0
  161. package/android/ffmpeg_16kb/include/libswscale/version.h +44 -0
  162. package/android/ffmpeg_16kb/include/libswscale/version_major.h +35 -0
  163. package/android/ffmpeg_16kb/lib/arm64-v8a/libavcodec.so +0 -0
  164. package/android/ffmpeg_16kb/lib/arm64-v8a/libavdevice.so +0 -0
  165. package/android/ffmpeg_16kb/lib/arm64-v8a/libavfilter.so +0 -0
  166. package/android/ffmpeg_16kb/lib/arm64-v8a/libavformat.so +0 -0
  167. package/android/ffmpeg_16kb/lib/arm64-v8a/libavutil.so +0 -0
  168. package/android/ffmpeg_16kb/lib/arm64-v8a/libswresample.so +0 -0
  169. package/android/ffmpeg_16kb/lib/arm64-v8a/libswscale.so +0 -0
  170. package/android/ffmpeg_16kb/lib/armeabi-v7a/libavcodec_neon.so +0 -0
  171. package/android/ffmpeg_16kb/lib/armeabi-v7a/libavdevice_neon.so +0 -0
  172. package/android/ffmpeg_16kb/lib/armeabi-v7a/libavfilter_neon.so +0 -0
  173. package/android/ffmpeg_16kb/lib/armeabi-v7a/libavformat_neon.so +0 -0
  174. package/android/ffmpeg_16kb/lib/armeabi-v7a/libavutil_neon.so +0 -0
  175. package/android/ffmpeg_16kb/lib/armeabi-v7a/libswresample_neon.so +0 -0
  176. package/android/ffmpeg_16kb/lib/armeabi-v7a/libswscale_neon.so +0 -0
  177. package/android/ffmpeg_16kb/lib/x86/libavcodec.so +0 -0
  178. package/android/ffmpeg_16kb/lib/x86/libavdevice.so +0 -0
  179. package/android/ffmpeg_16kb/lib/x86/libavfilter.so +0 -0
  180. package/android/ffmpeg_16kb/lib/x86/libavformat.so +0 -0
  181. package/android/ffmpeg_16kb/lib/x86/libavutil.so +0 -0
  182. package/android/ffmpeg_16kb/lib/x86/libswresample.so +0 -0
  183. package/android/ffmpeg_16kb/lib/x86/libswscale.so +0 -0
  184. package/android/ffmpeg_16kb/lib/x86_64/libavcodec.so +0 -0
  185. package/android/ffmpeg_16kb/lib/x86_64/libavdevice.so +0 -0
  186. package/android/ffmpeg_16kb/lib/x86_64/libavfilter.so +0 -0
  187. package/android/ffmpeg_16kb/lib/x86_64/libavformat.so +0 -0
  188. package/android/ffmpeg_16kb/lib/x86_64/libavutil.so +0 -0
  189. package/android/ffmpeg_16kb/lib/x86_64/libswresample.so +0 -0
  190. package/android/ffmpeg_16kb/lib/x86_64/libswscale.so +0 -0
  191. package/android/gradle.properties +5 -0
  192. package/android/src/main/AndroidManifest.xml +3 -0
  193. package/android/src/main/AndroidManifestNew.xml +2 -0
  194. package/android/src/main/java/com/audioanalyzer/AmplitudeData.java +20 -0
  195. package/android/src/main/java/com/audioanalyzer/AudioAnalyzerModule.java +52 -0
  196. package/android/src/main/java/com/audioanalyzer/AudioAnalyzerPackage.java +28 -0
  197. package/cpp/react-native-audio-analyzer.cpp +143 -0
  198. package/cpp/react-native-audio-analyzer.h +27 -0
  199. package/ios/AudioAnalyzer.h +19 -0
  200. package/ios/AudioAnalyzer.mm +43 -0
  201. package/lib/commonjs/helpers.js +34 -0
  202. package/lib/commonjs/helpers.js.map +1 -0
  203. package/lib/commonjs/helpers.test.js +49 -0
  204. package/lib/commonjs/helpers.test.js.map +1 -0
  205. package/lib/commonjs/index.js +35 -0
  206. package/lib/commonjs/index.js.map +1 -0
  207. package/lib/module/helpers.js +27 -0
  208. package/lib/module/helpers.js.map +1 -0
  209. package/lib/module/helpers.test.js +47 -0
  210. package/lib/module/helpers.test.js.map +1 -0
  211. package/lib/module/index.js +15 -0
  212. package/lib/module/index.js.map +1 -0
  213. package/lib/typescript/src/helpers.d.ts +3 -0
  214. package/lib/typescript/src/helpers.d.ts.map +1 -0
  215. package/lib/typescript/src/helpers.test.d.ts +2 -0
  216. package/lib/typescript/src/helpers.test.d.ts.map +1 -0
  217. package/lib/typescript/src/index.d.ts +7 -0
  218. package/lib/typescript/src/index.d.ts.map +1 -0
  219. package/package.json +163 -0
  220. package/react-native-audio-analyzer.podspec +44 -0
  221. package/src/helpers.test.ts +59 -0
  222. package/src/helpers.ts +34 -0
  223. package/src/index.tsx +30 -0
@@ -0,0 +1,99 @@
1
+ /*
2
+ * AES-CTR cipher
3
+ * Copyright (c) 2015 Eran Kornblau <erankor at gmail dot com>
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
+ #ifndef AVUTIL_AES_CTR_H
23
+ #define AVUTIL_AES_CTR_H
24
+
25
+ /**
26
+ * @defgroup lavu_aes_ctr AES-CTR
27
+ * @ingroup lavu_crypto
28
+ * @{
29
+ */
30
+
31
+ #include <stdint.h>
32
+
33
+ #include "attributes.h"
34
+
35
+ #define AES_CTR_KEY_SIZE (16)
36
+ #define AES_CTR_IV_SIZE (8)
37
+
38
+ struct AVAESCTR;
39
+
40
+ /**
41
+ * Allocate an AVAESCTR context.
42
+ */
43
+ struct AVAESCTR *av_aes_ctr_alloc(void);
44
+
45
+ /**
46
+ * Initialize an AVAESCTR context.
47
+ *
48
+ * @param a The AVAESCTR context to initialize
49
+ * @param key encryption key, must have a length of AES_CTR_KEY_SIZE
50
+ */
51
+ int av_aes_ctr_init(struct AVAESCTR *a, const uint8_t *key);
52
+
53
+ /**
54
+ * Release an AVAESCTR context.
55
+ *
56
+ * @param a The AVAESCTR context
57
+ */
58
+ void av_aes_ctr_free(struct AVAESCTR *a);
59
+
60
+ /**
61
+ * Process a buffer using a previously initialized context.
62
+ *
63
+ * @param a The AVAESCTR context
64
+ * @param dst destination array, can be equal to src
65
+ * @param src source array, can be equal to dst
66
+ * @param size the size of src and dst
67
+ */
68
+ void av_aes_ctr_crypt(struct AVAESCTR *a, uint8_t *dst, const uint8_t *src, int size);
69
+
70
+ /**
71
+ * Get the current iv
72
+ */
73
+ const uint8_t* av_aes_ctr_get_iv(struct AVAESCTR *a);
74
+
75
+ /**
76
+ * Generate a random iv
77
+ */
78
+ void av_aes_ctr_set_random_iv(struct AVAESCTR *a);
79
+
80
+ /**
81
+ * Forcefully change the 8-byte iv
82
+ */
83
+ void av_aes_ctr_set_iv(struct AVAESCTR *a, const uint8_t* iv);
84
+
85
+ /**
86
+ * Forcefully change the "full" 16-byte iv, including the counter
87
+ */
88
+ void av_aes_ctr_set_full_iv(struct AVAESCTR *a, const uint8_t* iv);
89
+
90
+ /**
91
+ * Increment the top 64 bit of the iv (performed after each frame)
92
+ */
93
+ void av_aes_ctr_increment_iv(struct AVAESCTR *a);
94
+
95
+ /**
96
+ * @}
97
+ */
98
+
99
+ #endif /* AVUTIL_AES_CTR_H */
@@ -0,0 +1,72 @@
1
+ /*
2
+ * Copyright (c) 2023 Jan Ekström <jeebjp@gmail.com>
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 AVUTIL_AMBIENT_VIEWING_ENVIRONMENT_H
22
+ #define AVUTIL_AMBIENT_VIEWING_ENVIRONMENT_H
23
+
24
+ #include <stddef.h>
25
+ #include "frame.h"
26
+ #include "rational.h"
27
+
28
+ /**
29
+ * Ambient viewing environment metadata as defined by H.274. The values are
30
+ * saved in AVRationals so that they keep their exactness, while allowing for
31
+ * easy access to a double value with f.ex. av_q2d.
32
+ *
33
+ * @note sizeof(AVAmbientViewingEnvironment) is not part of the public ABI, and
34
+ * it must be allocated using av_ambient_viewing_environment_alloc.
35
+ */
36
+ typedef struct AVAmbientViewingEnvironment {
37
+ /**
38
+ * Environmental illuminance of the ambient viewing environment in lux.
39
+ */
40
+ AVRational ambient_illuminance;
41
+
42
+ /**
43
+ * Normalized x chromaticity coordinate of the environmental ambient light
44
+ * in the nominal viewing environment according to the CIE 1931 definition
45
+ * of x and y as specified in ISO/CIE 11664-1.
46
+ */
47
+ AVRational ambient_light_x;
48
+
49
+ /**
50
+ * Normalized y chromaticity coordinate of the environmental ambient light
51
+ * in the nominal viewing environment according to the CIE 1931 definition
52
+ * of x and y as specified in ISO/CIE 11664-1.
53
+ */
54
+ AVRational ambient_light_y;
55
+ } AVAmbientViewingEnvironment;
56
+
57
+ /**
58
+ * Allocate an AVAmbientViewingEnvironment structure.
59
+ *
60
+ * @return the newly allocated struct or NULL on failure
61
+ */
62
+ AVAmbientViewingEnvironment *av_ambient_viewing_environment_alloc(size_t *size);
63
+
64
+ /**
65
+ * Allocate and add an AVAmbientViewingEnvironment structure to an existing
66
+ * AVFrame as side data.
67
+ *
68
+ * @return the newly allocated struct, or NULL on failure
69
+ */
70
+ AVAmbientViewingEnvironment *av_ambient_viewing_environment_create_side_data(AVFrame *frame);
71
+
72
+ #endif /* AVUTIL_AMBIENT_VIEWING_ENVIRONMENT_H */
@@ -0,0 +1,46 @@
1
+ /*
2
+ * Copyright (c) 2009 Mans Rullgard <mans@mansr.com>
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 AVUTIL_ARM_TIMER_H
22
+ #define AVUTIL_ARM_TIMER_H
23
+
24
+ #include <stdint.h>
25
+ #include "config.h"
26
+
27
+ #if defined(__APPLE__)
28
+
29
+ #include <mach/mach_time.h>
30
+
31
+ #define AV_READ_TIME mach_absolute_time
32
+
33
+ #elif HAVE_INLINE_ASM && defined(__ARM_ARCH_7A__)
34
+
35
+ #define AV_READ_TIME read_time
36
+
37
+ static inline uint64_t read_time(void)
38
+ {
39
+ unsigned cc;
40
+ __asm__ volatile ("mrc p15, 0, %0, c9, c13, 0" : "=r"(cc));
41
+ return cc;
42
+ }
43
+
44
+ #endif /* HAVE_INLINE_ASM && __ARM_ARCH_7A__ */
45
+
46
+ #endif /* AVUTIL_ARM_TIMER_H */
@@ -0,0 +1,173 @@
1
+ /*
2
+ * copyright (c) 2006 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
+ * 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
+ # define AV_GCC_VERSION_AT_MOST(x,y) (__GNUC__ < (x) || __GNUC__ == (x) && __GNUC_MINOR__ <= (y))
32
+ #else
33
+ # define AV_GCC_VERSION_AT_LEAST(x,y) 0
34
+ # define AV_GCC_VERSION_AT_MOST(x,y) 0
35
+ #endif
36
+
37
+ #ifdef __has_builtin
38
+ # define AV_HAS_BUILTIN(x) __has_builtin(x)
39
+ #else
40
+ # define AV_HAS_BUILTIN(x) 0
41
+ #endif
42
+
43
+ #ifndef av_always_inline
44
+ #if AV_GCC_VERSION_AT_LEAST(3,1)
45
+ # define av_always_inline __attribute__((always_inline)) inline
46
+ #elif defined(_MSC_VER)
47
+ # define av_always_inline __forceinline
48
+ #else
49
+ # define av_always_inline inline
50
+ #endif
51
+ #endif
52
+
53
+ #ifndef av_extern_inline
54
+ #if defined(__ICL) && __ICL >= 1210 || defined(__GNUC_STDC_INLINE__)
55
+ # define av_extern_inline extern inline
56
+ #else
57
+ # define av_extern_inline inline
58
+ #endif
59
+ #endif
60
+
61
+ #if AV_GCC_VERSION_AT_LEAST(3,4)
62
+ # define av_warn_unused_result __attribute__((warn_unused_result))
63
+ #else
64
+ # define av_warn_unused_result
65
+ #endif
66
+
67
+ #if AV_GCC_VERSION_AT_LEAST(3,1)
68
+ # define av_noinline __attribute__((noinline))
69
+ #elif defined(_MSC_VER)
70
+ # define av_noinline __declspec(noinline)
71
+ #else
72
+ # define av_noinline
73
+ #endif
74
+
75
+ #if AV_GCC_VERSION_AT_LEAST(3,1) || defined(__clang__)
76
+ # define av_pure __attribute__((pure))
77
+ #else
78
+ # define av_pure
79
+ #endif
80
+
81
+ #if AV_GCC_VERSION_AT_LEAST(2,6) || defined(__clang__)
82
+ # define av_const __attribute__((const))
83
+ #else
84
+ # define av_const
85
+ #endif
86
+
87
+ #if AV_GCC_VERSION_AT_LEAST(4,3) || defined(__clang__)
88
+ # define av_cold __attribute__((cold))
89
+ #else
90
+ # define av_cold
91
+ #endif
92
+
93
+ #if AV_GCC_VERSION_AT_LEAST(4,1) && !defined(__llvm__)
94
+ # define av_flatten __attribute__((flatten))
95
+ #else
96
+ # define av_flatten
97
+ #endif
98
+
99
+ #if AV_GCC_VERSION_AT_LEAST(3,1)
100
+ # define attribute_deprecated __attribute__((deprecated))
101
+ #elif defined(_MSC_VER)
102
+ # define attribute_deprecated __declspec(deprecated)
103
+ #else
104
+ # define attribute_deprecated
105
+ #endif
106
+
107
+ /**
108
+ * Disable warnings about deprecated features
109
+ * This is useful for sections of code kept for backward compatibility and
110
+ * scheduled for removal.
111
+ */
112
+ #ifndef AV_NOWARN_DEPRECATED
113
+ #if AV_GCC_VERSION_AT_LEAST(4,6) || defined(__clang__)
114
+ # define AV_NOWARN_DEPRECATED(code) \
115
+ _Pragma("GCC diagnostic push") \
116
+ _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"") \
117
+ code \
118
+ _Pragma("GCC diagnostic pop")
119
+ #elif defined(_MSC_VER)
120
+ # define AV_NOWARN_DEPRECATED(code) \
121
+ __pragma(warning(push)) \
122
+ __pragma(warning(disable : 4996)) \
123
+ code; \
124
+ __pragma(warning(pop))
125
+ #else
126
+ # define AV_NOWARN_DEPRECATED(code) code
127
+ #endif
128
+ #endif
129
+
130
+ #if defined(__GNUC__) || defined(__clang__)
131
+ # define av_unused __attribute__((unused))
132
+ #else
133
+ # define av_unused
134
+ #endif
135
+
136
+ /**
137
+ * Mark a variable as used and prevent the compiler from optimizing it
138
+ * away. This is useful for variables accessed only from inline
139
+ * assembler without the compiler being aware.
140
+ */
141
+ #if AV_GCC_VERSION_AT_LEAST(3,1) || defined(__clang__)
142
+ # define av_used __attribute__((used))
143
+ #else
144
+ # define av_used
145
+ #endif
146
+
147
+ #if AV_GCC_VERSION_AT_LEAST(3,3) || defined(__clang__)
148
+ # define av_alias __attribute__((may_alias))
149
+ #else
150
+ # define av_alias
151
+ #endif
152
+
153
+ #if (defined(__GNUC__) || defined(__clang__)) && !defined(__INTEL_COMPILER)
154
+ # define av_uninit(x) x=x
155
+ #else
156
+ # define av_uninit(x) x
157
+ #endif
158
+
159
+ #if defined(__GNUC__) || defined(__clang__)
160
+ # define av_builtin_constant_p __builtin_constant_p
161
+ # define av_printf_format(fmtpos, attrpos) __attribute__((__format__(__printf__, fmtpos, attrpos)))
162
+ #else
163
+ # define av_builtin_constant_p(x) 0
164
+ # define av_printf_format(fmtpos, attrpos)
165
+ #endif
166
+
167
+ #if AV_GCC_VERSION_AT_LEAST(2,5) || defined(__clang__)
168
+ # define av_noreturn __attribute__((noreturn))
169
+ #else
170
+ # define av_noreturn
171
+ #endif
172
+
173
+ #endif /* AVUTIL_ATTRIBUTES_H */
@@ -0,0 +1,34 @@
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 AVUTIL_ATTRIBUTES_INTERNAL_H
20
+ #define AVUTIL_ATTRIBUTES_INTERNAL_H
21
+
22
+ #include "attributes.h"
23
+
24
+ #if (AV_GCC_VERSION_AT_LEAST(4,0) || defined(__clang__)) && (defined(__ELF__) || defined(__MACH__))
25
+ # define attribute_visibility_hidden __attribute__((visibility("hidden")))
26
+ # define FF_VISIBILITY_PUSH_HIDDEN _Pragma("GCC visibility push(hidden)")
27
+ # define FF_VISIBILITY_POP_HIDDEN _Pragma("GCC visibility pop")
28
+ #else
29
+ # define attribute_visibility_hidden
30
+ # define FF_VISIBILITY_PUSH_HIDDEN
31
+ # define FF_VISIBILITY_POP_HIDDEN
32
+ #endif
33
+
34
+ #endif /* AVUTIL_ATTRIBUTES_INTERNAL_H */
@@ -0,0 +1,186 @@
1
+ /*
2
+ * Audio FIFO
3
+ * Copyright (c) 2012 Justin Ruggles <justin.ruggles@gmail.com>
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
+ * Audio FIFO Buffer
25
+ */
26
+
27
+ #ifndef AVUTIL_AUDIO_FIFO_H
28
+ #define AVUTIL_AUDIO_FIFO_H
29
+
30
+ #include "attributes.h"
31
+ #include "samplefmt.h"
32
+
33
+ /**
34
+ * @addtogroup lavu_audio
35
+ * @{
36
+ *
37
+ * @defgroup lavu_audiofifo Audio FIFO Buffer
38
+ * @{
39
+ */
40
+
41
+ /**
42
+ * Context for an Audio FIFO Buffer.
43
+ *
44
+ * - Operates at the sample level rather than the byte level.
45
+ * - Supports multiple channels with either planar or packed sample format.
46
+ * - Automatic reallocation when writing to a full buffer.
47
+ */
48
+ typedef struct AVAudioFifo AVAudioFifo;
49
+
50
+ /**
51
+ * Free an AVAudioFifo.
52
+ *
53
+ * @param af AVAudioFifo to free
54
+ */
55
+ void av_audio_fifo_free(AVAudioFifo *af);
56
+
57
+ /**
58
+ * Allocate an AVAudioFifo.
59
+ *
60
+ * @param sample_fmt sample format
61
+ * @param channels number of channels
62
+ * @param nb_samples initial allocation size, in samples
63
+ * @return newly allocated AVAudioFifo, or NULL on error
64
+ */
65
+ AVAudioFifo *av_audio_fifo_alloc(enum AVSampleFormat sample_fmt, int channels,
66
+ int nb_samples);
67
+
68
+ /**
69
+ * Reallocate an AVAudioFifo.
70
+ *
71
+ * @param af AVAudioFifo to reallocate
72
+ * @param nb_samples new allocation size, in samples
73
+ * @return 0 if OK, or negative AVERROR code on failure
74
+ */
75
+ av_warn_unused_result
76
+ int av_audio_fifo_realloc(AVAudioFifo *af, int nb_samples);
77
+
78
+ /**
79
+ * Write data to an AVAudioFifo.
80
+ *
81
+ * The AVAudioFifo will be reallocated automatically if the available space
82
+ * is less than nb_samples.
83
+ *
84
+ * @see enum AVSampleFormat
85
+ * The documentation for AVSampleFormat describes the data layout.
86
+ *
87
+ * @param af AVAudioFifo to write to
88
+ * @param data audio data plane pointers
89
+ * @param nb_samples number of samples to write
90
+ * @return number of samples actually written, or negative AVERROR
91
+ * code on failure. If successful, the number of samples
92
+ * actually written will always be nb_samples.
93
+ */
94
+ int av_audio_fifo_write(AVAudioFifo *af, void **data, int nb_samples);
95
+
96
+ /**
97
+ * Peek data from an AVAudioFifo.
98
+ *
99
+ * @see enum AVSampleFormat
100
+ * The documentation for AVSampleFormat describes the data layout.
101
+ *
102
+ * @param af AVAudioFifo to read from
103
+ * @param data audio data plane pointers
104
+ * @param nb_samples number of samples to peek
105
+ * @return number of samples actually peek, or negative AVERROR code
106
+ * on failure. The number of samples actually peek will not
107
+ * be greater than nb_samples, and will only be less than
108
+ * nb_samples if av_audio_fifo_size is less than nb_samples.
109
+ */
110
+ int av_audio_fifo_peek(AVAudioFifo *af, void **data, int nb_samples);
111
+
112
+ /**
113
+ * Peek data from an AVAudioFifo.
114
+ *
115
+ * @see enum AVSampleFormat
116
+ * The documentation for AVSampleFormat describes the data layout.
117
+ *
118
+ * @param af AVAudioFifo to read from
119
+ * @param data audio data plane pointers
120
+ * @param nb_samples number of samples to peek
121
+ * @param offset offset from current read position
122
+ * @return number of samples actually peek, or negative AVERROR code
123
+ * on failure. The number of samples actually peek will not
124
+ * be greater than nb_samples, and will only be less than
125
+ * nb_samples if av_audio_fifo_size is less than nb_samples.
126
+ */
127
+ int av_audio_fifo_peek_at(AVAudioFifo *af, void **data, int nb_samples, int offset);
128
+
129
+ /**
130
+ * Read data from an AVAudioFifo.
131
+ *
132
+ * @see enum AVSampleFormat
133
+ * The documentation for AVSampleFormat describes the data layout.
134
+ *
135
+ * @param af AVAudioFifo to read from
136
+ * @param data audio data plane pointers
137
+ * @param nb_samples number of samples to read
138
+ * @return number of samples actually read, or negative AVERROR code
139
+ * on failure. The number of samples actually read will not
140
+ * be greater than nb_samples, and will only be less than
141
+ * nb_samples if av_audio_fifo_size is less than nb_samples.
142
+ */
143
+ int av_audio_fifo_read(AVAudioFifo *af, void **data, int nb_samples);
144
+
145
+ /**
146
+ * Drain data from an AVAudioFifo.
147
+ *
148
+ * Removes the data without reading it.
149
+ *
150
+ * @param af AVAudioFifo to drain
151
+ * @param nb_samples number of samples to drain
152
+ * @return 0 if OK, or negative AVERROR code on failure
153
+ */
154
+ int av_audio_fifo_drain(AVAudioFifo *af, int nb_samples);
155
+
156
+ /**
157
+ * Reset the AVAudioFifo buffer.
158
+ *
159
+ * This empties all data in the buffer.
160
+ *
161
+ * @param af AVAudioFifo to reset
162
+ */
163
+ void av_audio_fifo_reset(AVAudioFifo *af);
164
+
165
+ /**
166
+ * Get the current number of samples in the AVAudioFifo available for reading.
167
+ *
168
+ * @param af the AVAudioFifo to query
169
+ * @return number of samples available for reading
170
+ */
171
+ int av_audio_fifo_size(AVAudioFifo *af);
172
+
173
+ /**
174
+ * Get the current number of samples in the AVAudioFifo available for writing.
175
+ *
176
+ * @param af the AVAudioFifo to query
177
+ * @return number of samples available for writing
178
+ */
179
+ int av_audio_fifo_space(AVAudioFifo *af);
180
+
181
+ /**
182
+ * @}
183
+ * @}
184
+ */
185
+
186
+ #endif /* AVUTIL_AUDIO_FIFO_H */
@@ -0,0 +1,75 @@
1
+ /*
2
+ * copyright (c) 2010 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 assert() macros that are a bit more flexible than ISO C assert().
24
+ * @author Michael Niedermayer <michaelni@gmx.at>
25
+ */
26
+
27
+ #ifndef AVUTIL_AVASSERT_H
28
+ #define AVUTIL_AVASSERT_H
29
+
30
+ #include <stdlib.h>
31
+ #include "log.h"
32
+ #include "macros.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_PANIC, "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 speed loss.
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
+ #define av_assert2_fpu() av_assert0_fpu()
63
+ #else
64
+ #define av_assert2(cond) ((void)0)
65
+ #define av_assert2_fpu() ((void)0)
66
+ #endif
67
+
68
+ /**
69
+ * Assert that floating point operations can be executed.
70
+ *
71
+ * This will av_assert0() that the cpu is not in MMX state on X86
72
+ */
73
+ void av_assert0_fpu(void);
74
+
75
+ #endif /* AVUTIL_AVASSERT_H */
@@ -0,0 +1,6 @@
1
+ /* Generated by ffmpeg configure */
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 */