react-native-audio-api 0.8.0-nightly-5a12f24-20250901 → 0.8.0

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 (225) hide show
  1. package/RNAudioAPI.podspec +15 -6
  2. package/android/build.gradle +11 -2
  3. package/android/src/main/cpp/audioapi/CMakeLists.txt +24 -17
  4. package/android/src/main/cpp/audioapi/android/core/AudioDecoder.cpp +51 -21
  5. package/android/src/main/jniLibs/arm64-v8a/libavcodec.so +0 -0
  6. package/android/src/main/jniLibs/arm64-v8a/libavformat.so +0 -0
  7. package/android/src/main/jniLibs/arm64-v8a/libavutil.so +0 -0
  8. package/android/src/main/jniLibs/arm64-v8a/libswresample.so +0 -0
  9. package/android/src/main/jniLibs/armeabi-v7a/libavcodec.so +0 -0
  10. package/android/src/main/jniLibs/armeabi-v7a/libavformat.so +0 -0
  11. package/android/src/main/jniLibs/armeabi-v7a/libavutil.so +0 -0
  12. package/android/src/main/jniLibs/armeabi-v7a/libswresample.so +0 -0
  13. package/android/src/main/jniLibs/x86/libavcodec.so +0 -0
  14. package/android/src/main/jniLibs/x86/libavformat.so +0 -0
  15. package/android/src/main/jniLibs/x86/libavutil.so +0 -0
  16. package/android/src/main/jniLibs/x86/libswresample.so +0 -0
  17. package/android/src/main/jniLibs/x86_64/libavcodec.so +0 -0
  18. package/android/src/main/jniLibs/x86_64/libavformat.so +0 -0
  19. package/android/src/main/jniLibs/x86_64/libavutil.so +0 -0
  20. package/android/src/main/jniLibs/x86_64/libswresample.so +0 -0
  21. package/common/cpp/audioapi/HostObjects/BaseAudioContextHostObject.h +11 -0
  22. package/common/cpp/audioapi/HostObjects/StreamerNodeHostObject.h +30 -0
  23. package/common/cpp/audioapi/core/BaseAudioContext.cpp +9 -0
  24. package/common/cpp/audioapi/core/BaseAudioContext.h +2 -0
  25. package/common/cpp/audioapi/core/sources/StreamerNode.cpp +299 -0
  26. package/common/cpp/audioapi/core/sources/StreamerNode.h +123 -0
  27. package/common/cpp/audioapi/core/utils/AudioDecoder.h +61 -0
  28. package/common/cpp/audioapi/core/utils/AudioNodeManager.cpp +14 -2
  29. package/common/cpp/audioapi/core/utils/AudioNodeManager.h +3 -0
  30. package/common/cpp/audioapi/external/arm64-v8a/libcrypto.a +0 -0
  31. package/common/cpp/audioapi/external/arm64-v8a/libssl.a +0 -0
  32. package/common/cpp/audioapi/external/armeabi-v7a/libcrypto.a +0 -0
  33. package/common/cpp/audioapi/external/armeabi-v7a/libssl.a +0 -0
  34. package/common/cpp/audioapi/external/ffmpeg_include/libavcodec/ac3_parser.h +36 -0
  35. package/common/cpp/audioapi/external/ffmpeg_include/libavcodec/adts_parser.h +37 -0
  36. package/common/cpp/audioapi/external/ffmpeg_include/libavcodec/avcodec.h +2947 -0
  37. package/common/cpp/audioapi/external/ffmpeg_include/libavcodec/avdct.h +88 -0
  38. package/common/cpp/audioapi/external/ffmpeg_include/libavcodec/bsf.h +332 -0
  39. package/common/cpp/audioapi/external/ffmpeg_include/libavcodec/codec.h +367 -0
  40. package/common/cpp/audioapi/external/ffmpeg_include/libavcodec/codec_desc.h +134 -0
  41. package/common/cpp/audioapi/external/ffmpeg_include/libavcodec/codec_id.h +681 -0
  42. package/common/cpp/audioapi/external/ffmpeg_include/libavcodec/codec_par.h +248 -0
  43. package/common/cpp/audioapi/external/ffmpeg_include/libavcodec/d3d11va.h +109 -0
  44. package/common/cpp/audioapi/external/ffmpeg_include/libavcodec/defs.h +359 -0
  45. package/common/cpp/audioapi/external/ffmpeg_include/libavcodec/dirac.h +135 -0
  46. package/common/cpp/audioapi/external/ffmpeg_include/libavcodec/dv_profile.h +82 -0
  47. package/common/cpp/audioapi/external/ffmpeg_include/libavcodec/dxva2.h +90 -0
  48. package/common/cpp/audioapi/external/ffmpeg_include/libavcodec/jni.h +67 -0
  49. package/common/cpp/audioapi/external/ffmpeg_include/libavcodec/mediacodec.h +103 -0
  50. package/common/cpp/audioapi/external/ffmpeg_include/libavcodec/packet.h +907 -0
  51. package/common/cpp/audioapi/external/ffmpeg_include/libavcodec/qsv.h +109 -0
  52. package/common/cpp/audioapi/external/ffmpeg_include/libavcodec/vdpau.h +138 -0
  53. package/common/cpp/audioapi/external/ffmpeg_include/libavcodec/version.h +45 -0
  54. package/common/cpp/audioapi/external/ffmpeg_include/libavcodec/version_major.h +55 -0
  55. package/common/cpp/audioapi/external/ffmpeg_include/libavcodec/videotoolbox.h +85 -0
  56. package/common/cpp/audioapi/external/ffmpeg_include/libavcodec/vorbis_parser.h +74 -0
  57. package/common/cpp/audioapi/external/ffmpeg_include/libavformat/avformat.h +3004 -0
  58. package/common/cpp/audioapi/external/ffmpeg_include/libavformat/avio.h +831 -0
  59. package/common/cpp/audioapi/external/ffmpeg_include/libavformat/version.h +47 -0
  60. package/common/cpp/audioapi/external/ffmpeg_include/libavformat/version_major.h +50 -0
  61. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/adler32.h +63 -0
  62. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/aes.h +69 -0
  63. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/aes_ctr.h +99 -0
  64. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/ambient_viewing_environment.h +72 -0
  65. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/attributes.h +175 -0
  66. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/audio_fifo.h +187 -0
  67. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/avassert.h +120 -0
  68. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/avconfig.h +6 -0
  69. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/avstring.h +428 -0
  70. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/avutil.h +364 -0
  71. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/base64.h +72 -0
  72. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/blowfish.h +82 -0
  73. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/bprint.h +254 -0
  74. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/bswap.h +105 -0
  75. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/buffer.h +322 -0
  76. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/camellia.h +70 -0
  77. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/cast5.h +80 -0
  78. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/channel_layout.h +762 -0
  79. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/common.h +589 -0
  80. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/container_fifo.h +130 -0
  81. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/cpu.h +150 -0
  82. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/crc.h +102 -0
  83. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/csp.h +192 -0
  84. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/des.h +81 -0
  85. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/detection_bbox.h +108 -0
  86. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/dict.h +242 -0
  87. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/display.h +109 -0
  88. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/dovi_meta.h +396 -0
  89. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/downmix_info.h +115 -0
  90. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/encryption_info.h +205 -0
  91. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/error.h +129 -0
  92. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/eval.h +140 -0
  93. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/executor.h +67 -0
  94. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/ffversion.h +5 -0
  95. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/fifo.h +242 -0
  96. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/file.h +62 -0
  97. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/film_grain_params.h +282 -0
  98. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/frame.h +1163 -0
  99. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/hash.h +264 -0
  100. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/hdr_dynamic_metadata.h +376 -0
  101. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/hdr_dynamic_vivid_metadata.h +292 -0
  102. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/hmac.h +99 -0
  103. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/hwcontext.h +601 -0
  104. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/hwcontext_amf.h +46 -0
  105. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/hwcontext_cuda.h +74 -0
  106. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/hwcontext_d3d11va.h +178 -0
  107. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/hwcontext_d3d12va.h +142 -0
  108. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/hwcontext_drm.h +169 -0
  109. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/hwcontext_dxva2.h +75 -0
  110. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/hwcontext_mediacodec.h +61 -0
  111. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/hwcontext_oh.h +34 -0
  112. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/hwcontext_opencl.h +100 -0
  113. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/hwcontext_qsv.h +87 -0
  114. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/hwcontext_vaapi.h +117 -0
  115. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/hwcontext_vdpau.h +44 -0
  116. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/hwcontext_videotoolbox.h +106 -0
  117. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/hwcontext_vulkan.h +377 -0
  118. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/iamf.h +694 -0
  119. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/imgutils.h +377 -0
  120. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/intfloat.h +77 -0
  121. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/intreadwrite.h +677 -0
  122. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/lfg.h +81 -0
  123. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/log.h +427 -0
  124. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/lzo.h +66 -0
  125. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/macros.h +80 -0
  126. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/mastering_display_metadata.h +137 -0
  127. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/mathematics.h +300 -0
  128. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/md5.h +89 -0
  129. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/mem.h +607 -0
  130. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/motion_vector.h +57 -0
  131. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/murmur3.h +115 -0
  132. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/opt.h +1194 -0
  133. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/parseutils.h +197 -0
  134. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/pixdesc.h +440 -0
  135. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/pixelutils.h +51 -0
  136. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/pixfmt.h +797 -0
  137. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/random_seed.h +57 -0
  138. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/rational.h +225 -0
  139. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/rc4.h +69 -0
  140. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/refstruct.h +297 -0
  141. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/replaygain.h +50 -0
  142. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/ripemd.h +83 -0
  143. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/samplefmt.h +269 -0
  144. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/sha.h +90 -0
  145. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/sha512.h +92 -0
  146. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/spherical.h +243 -0
  147. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/stereo3d.h +325 -0
  148. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/tdrdi.h +164 -0
  149. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/tea.h +71 -0
  150. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/threadmessage.h +115 -0
  151. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/timecode.h +199 -0
  152. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/timestamp.h +85 -0
  153. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/tree.h +137 -0
  154. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/twofish.h +70 -0
  155. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/tx.h +210 -0
  156. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/uuid.h +146 -0
  157. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/version.h +119 -0
  158. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/video_enc_params.h +171 -0
  159. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/video_hint.h +107 -0
  160. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/xtea.h +94 -0
  161. package/common/cpp/audioapi/external/ffmpeg_include/libswresample/swresample.h +587 -0
  162. package/common/cpp/audioapi/external/ffmpeg_include/libswresample/version.h +46 -0
  163. package/common/cpp/audioapi/external/ffmpeg_include/libswresample/version_major.h +31 -0
  164. package/common/cpp/audioapi/external/libavcodec.xcframework/Info.plist +44 -0
  165. package/common/cpp/audioapi/external/libavcodec.xcframework/ios-arm64/libavcodec.framework/Info.plist +1 -0
  166. package/common/cpp/audioapi/external/libavcodec.xcframework/ios-arm64/libavcodec.framework/libavcodec +0 -0
  167. package/common/cpp/audioapi/external/libavcodec.xcframework/ios-arm64_x86_64-simulator/libavcodec.framework/Info.plist +1 -0
  168. package/common/cpp/audioapi/external/libavcodec.xcframework/ios-arm64_x86_64-simulator/libavcodec.framework/libavcodec +0 -0
  169. package/common/cpp/audioapi/external/libavformat.xcframework/Info.plist +44 -0
  170. package/common/cpp/audioapi/external/libavformat.xcframework/ios-arm64/libavformat.framework/Info.plist +1 -0
  171. package/common/cpp/audioapi/external/libavformat.xcframework/ios-arm64/libavformat.framework/libavformat +0 -0
  172. package/common/cpp/audioapi/external/libavformat.xcframework/ios-arm64_x86_64-simulator/libavformat.framework/Info.plist +1 -0
  173. package/common/cpp/audioapi/external/libavformat.xcframework/ios-arm64_x86_64-simulator/libavformat.framework/libavformat +0 -0
  174. package/common/cpp/audioapi/external/libavutil.xcframework/Info.plist +44 -0
  175. package/common/cpp/audioapi/external/libavutil.xcframework/ios-arm64/libavutil.framework/Info.plist +1 -0
  176. package/common/cpp/audioapi/external/libavutil.xcframework/ios-arm64/libavutil.framework/libavutil +0 -0
  177. package/common/cpp/audioapi/external/libavutil.xcframework/ios-arm64_x86_64-simulator/libavutil.framework/Info.plist +1 -0
  178. package/common/cpp/audioapi/external/libavutil.xcframework/ios-arm64_x86_64-simulator/libavutil.framework/libavutil +0 -0
  179. package/common/cpp/audioapi/external/libswresample.xcframework/Info.plist +44 -0
  180. package/common/cpp/audioapi/external/libswresample.xcframework/ios-arm64/libswresample.framework/Info.plist +1 -0
  181. package/common/cpp/audioapi/external/libswresample.xcframework/ios-arm64/libswresample.framework/libswresample +0 -0
  182. package/common/cpp/audioapi/external/libswresample.xcframework/ios-arm64_x86_64-simulator/libswresample.framework/Info.plist +1 -0
  183. package/common/cpp/audioapi/external/libswresample.xcframework/ios-arm64_x86_64-simulator/libswresample.framework/libswresample +0 -0
  184. package/common/cpp/audioapi/external/x86/libcrypto.a +0 -0
  185. package/common/cpp/audioapi/external/x86/libssl.a +0 -0
  186. package/common/cpp/audioapi/external/x86_64/libcrypto.a +0 -0
  187. package/common/cpp/audioapi/external/x86_64/libssl.a +0 -0
  188. package/common/cpp/audioapi/libs/ffmpeg/FFmpegDecoding.cpp +402 -0
  189. package/common/cpp/audioapi/libs/ffmpeg/FFmpegDecoding.h +27 -0
  190. package/common/cpp/audioapi/libs/ffmpeg/INSTRUCTIONS.md +26 -0
  191. package/common/cpp/audioapi/libs/ffmpeg/create_xcframework.sh +111 -0
  192. package/common/cpp/audioapi/libs/ffmpeg/ffmpeg_setup.sh +361 -0
  193. package/common/cpp/audioapi/utils/SpscChannel.hpp +47 -38
  194. package/common/cpp/test/CMakeLists.txt +7 -1
  195. package/ios/audioapi/ios/core/AudioDecoder.mm +22 -2
  196. package/lib/commonjs/api.js +7 -0
  197. package/lib/commonjs/api.js.map +1 -1
  198. package/lib/commonjs/core/AudioContext.js.map +1 -1
  199. package/lib/commonjs/core/BaseAudioContext.js +4 -0
  200. package/lib/commonjs/core/BaseAudioContext.js.map +1 -1
  201. package/lib/commonjs/core/StreamerNode.js +15 -0
  202. package/lib/commonjs/core/StreamerNode.js.map +1 -0
  203. package/lib/module/api.js +1 -0
  204. package/lib/module/api.js.map +1 -1
  205. package/lib/module/core/AudioContext.js.map +1 -1
  206. package/lib/module/core/BaseAudioContext.js +4 -0
  207. package/lib/module/core/BaseAudioContext.js.map +1 -1
  208. package/lib/module/core/StreamerNode.js +9 -0
  209. package/lib/module/core/StreamerNode.js.map +1 -0
  210. package/lib/typescript/api.d.ts +1 -0
  211. package/lib/typescript/api.d.ts.map +1 -1
  212. package/lib/typescript/core/AudioContext.d.ts +1 -1
  213. package/lib/typescript/core/AudioContext.d.ts.map +1 -1
  214. package/lib/typescript/core/BaseAudioContext.d.ts +2 -0
  215. package/lib/typescript/core/BaseAudioContext.d.ts.map +1 -1
  216. package/lib/typescript/core/StreamerNode.d.ts +5 -0
  217. package/lib/typescript/core/StreamerNode.d.ts.map +1 -0
  218. package/lib/typescript/interfaces.d.ts +5 -1
  219. package/lib/typescript/interfaces.d.ts.map +1 -1
  220. package/package.json +1 -1
  221. package/src/api.ts +1 -0
  222. package/src/core/AudioContext.ts +1 -1
  223. package/src/core/BaseAudioContext.ts +5 -0
  224. package/src/core/StreamerNode.ts +8 -0
  225. package/src/interfaces.ts +6 -1
@@ -0,0 +1,83 @@
1
+ /*
2
+ * Copyright (C) 2007 Michael Niedermayer <michaelni@gmx.at>
3
+ * Copyright (C) 2013 James Almer <jamrial@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
+ * @ingroup lavu_ripemd
25
+ * Public header for RIPEMD hash function implementation.
26
+ */
27
+
28
+ #ifndef AVUTIL_RIPEMD_H
29
+ #define AVUTIL_RIPEMD_H
30
+
31
+ #include <stddef.h>
32
+ #include <stdint.h>
33
+
34
+ #include "attributes.h"
35
+
36
+ /**
37
+ * @defgroup lavu_ripemd RIPEMD
38
+ * @ingroup lavu_hash
39
+ * RIPEMD hash function implementation.
40
+ *
41
+ * @{
42
+ */
43
+
44
+ extern const int av_ripemd_size;
45
+
46
+ struct AVRIPEMD;
47
+
48
+ /**
49
+ * Allocate an AVRIPEMD context.
50
+ */
51
+ struct AVRIPEMD *av_ripemd_alloc(void);
52
+
53
+ /**
54
+ * Initialize RIPEMD hashing.
55
+ *
56
+ * @param context pointer to the function context (of size av_ripemd_size)
57
+ * @param bits number of bits in digest (128, 160, 256 or 320 bits)
58
+ * @return zero if initialization succeeded, -1 otherwise
59
+ */
60
+ int av_ripemd_init(struct AVRIPEMD* context, int bits);
61
+
62
+ /**
63
+ * Update hash value.
64
+ *
65
+ * @param context hash function context
66
+ * @param data input data to update hash with
67
+ * @param len input data length
68
+ */
69
+ void av_ripemd_update(struct AVRIPEMD* context, const uint8_t* data, size_t len);
70
+
71
+ /**
72
+ * Finish hashing and output digest value.
73
+ *
74
+ * @param context hash function context
75
+ * @param digest buffer where output digest value is stored
76
+ */
77
+ void av_ripemd_final(struct AVRIPEMD* context, uint8_t *digest);
78
+
79
+ /**
80
+ * @}
81
+ */
82
+
83
+ #endif /* AVUTIL_RIPEMD_H */
@@ -0,0 +1,269 @@
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_SAMPLEFMT_H
20
+ #define AVUTIL_SAMPLEFMT_H
21
+
22
+ #include <stdint.h>
23
+
24
+ /**
25
+ * @addtogroup lavu_audio
26
+ * @{
27
+ *
28
+ * @defgroup lavu_sampfmts Audio sample formats
29
+ *
30
+ * Audio sample format enumeration and related convenience functions.
31
+ * @{
32
+ */
33
+
34
+ /**
35
+ * Audio sample formats
36
+ *
37
+ * - The data described by the sample format is always in native-endian order.
38
+ * Sample values can be expressed by native C types, hence the lack of a signed
39
+ * 24-bit sample format even though it is a common raw audio data format.
40
+ *
41
+ * - The floating-point formats are based on full volume being in the range
42
+ * [-1.0, 1.0]. Any values outside this range are beyond full volume level.
43
+ *
44
+ * - The data layout as used in av_samples_fill_arrays() and elsewhere in FFmpeg
45
+ * (such as AVFrame in libavcodec) is as follows:
46
+ *
47
+ * @par
48
+ * For planar sample formats, each audio channel is in a separate data plane,
49
+ * and linesize is the buffer size, in bytes, for a single plane. All data
50
+ * planes must be the same size. For packed sample formats, only the first data
51
+ * plane is used, and samples for each channel are interleaved. In this case,
52
+ * linesize is the buffer size, in bytes, for the 1 plane.
53
+ *
54
+ */
55
+ enum AVSampleFormat {
56
+ AV_SAMPLE_FMT_NONE = -1,
57
+ AV_SAMPLE_FMT_U8, ///< unsigned 8 bits
58
+ AV_SAMPLE_FMT_S16, ///< signed 16 bits
59
+ AV_SAMPLE_FMT_S32, ///< signed 32 bits
60
+ AV_SAMPLE_FMT_FLT, ///< float
61
+ AV_SAMPLE_FMT_DBL, ///< double
62
+
63
+ AV_SAMPLE_FMT_U8P, ///< unsigned 8 bits, planar
64
+ AV_SAMPLE_FMT_S16P, ///< signed 16 bits, planar
65
+ AV_SAMPLE_FMT_S32P, ///< signed 32 bits, planar
66
+ AV_SAMPLE_FMT_FLTP, ///< float, planar
67
+ AV_SAMPLE_FMT_DBLP, ///< double, planar
68
+ AV_SAMPLE_FMT_S64, ///< signed 64 bits
69
+ AV_SAMPLE_FMT_S64P, ///< signed 64 bits, planar
70
+
71
+ AV_SAMPLE_FMT_NB ///< Number of sample formats. DO NOT USE if linking dynamically
72
+ };
73
+
74
+ /**
75
+ * Return the name of sample_fmt, or NULL if sample_fmt is not
76
+ * recognized.
77
+ */
78
+ const char *av_get_sample_fmt_name(enum AVSampleFormat sample_fmt);
79
+
80
+ /**
81
+ * Return a sample format corresponding to name, or AV_SAMPLE_FMT_NONE
82
+ * on error.
83
+ */
84
+ enum AVSampleFormat av_get_sample_fmt(const char *name);
85
+
86
+ /**
87
+ * Return the planar<->packed alternative form of the given sample format, or
88
+ * AV_SAMPLE_FMT_NONE on error. If the passed sample_fmt is already in the
89
+ * requested planar/packed format, the format returned is the same as the
90
+ * input.
91
+ */
92
+ enum AVSampleFormat av_get_alt_sample_fmt(enum AVSampleFormat sample_fmt, int planar);
93
+
94
+ /**
95
+ * Get the packed alternative form of the given sample format.
96
+ *
97
+ * If the passed sample_fmt is already in packed format, the format returned is
98
+ * the same as the input.
99
+ *
100
+ * @return the packed alternative form of the given sample format or
101
+ AV_SAMPLE_FMT_NONE on error.
102
+ */
103
+ enum AVSampleFormat av_get_packed_sample_fmt(enum AVSampleFormat sample_fmt);
104
+
105
+ /**
106
+ * Get the planar alternative form of the given sample format.
107
+ *
108
+ * If the passed sample_fmt is already in planar format, the format returned is
109
+ * the same as the input.
110
+ *
111
+ * @return the planar alternative form of the given sample format or
112
+ AV_SAMPLE_FMT_NONE on error.
113
+ */
114
+ enum AVSampleFormat av_get_planar_sample_fmt(enum AVSampleFormat sample_fmt);
115
+
116
+ /**
117
+ * Generate a string corresponding to the sample format with
118
+ * sample_fmt, or a header if sample_fmt is negative.
119
+ *
120
+ * @param buf the buffer where to write the string
121
+ * @param buf_size the size of buf
122
+ * @param sample_fmt the number of the sample format to print the
123
+ * corresponding info string, or a negative value to print the
124
+ * corresponding header.
125
+ * @return the pointer to the filled buffer or NULL if sample_fmt is
126
+ * unknown or in case of other errors
127
+ */
128
+ char *av_get_sample_fmt_string(char *buf, int buf_size, enum AVSampleFormat sample_fmt);
129
+
130
+ /**
131
+ * Return number of bytes per sample.
132
+ *
133
+ * @param sample_fmt the sample format
134
+ * @return number of bytes per sample or zero if unknown for the given
135
+ * sample format
136
+ */
137
+ int av_get_bytes_per_sample(enum AVSampleFormat sample_fmt);
138
+
139
+ /**
140
+ * Check if the sample format is planar.
141
+ *
142
+ * @param sample_fmt the sample format to inspect
143
+ * @return 1 if the sample format is planar, 0 if it is interleaved
144
+ */
145
+ int av_sample_fmt_is_planar(enum AVSampleFormat sample_fmt);
146
+
147
+ /**
148
+ * Get the required buffer size for the given audio parameters.
149
+ *
150
+ * @param[out] linesize calculated linesize, may be NULL
151
+ * @param nb_channels the number of channels
152
+ * @param nb_samples the number of samples in a single channel
153
+ * @param sample_fmt the sample format
154
+ * @param align buffer size alignment (0 = default, 1 = no alignment)
155
+ * @return required buffer size, or negative error code on failure
156
+ */
157
+ int av_samples_get_buffer_size(int *linesize, int nb_channels, int nb_samples,
158
+ enum AVSampleFormat sample_fmt, int align);
159
+
160
+ /**
161
+ * @}
162
+ *
163
+ * @defgroup lavu_sampmanip Samples manipulation
164
+ *
165
+ * Functions that manipulate audio samples
166
+ * @{
167
+ */
168
+
169
+ /**
170
+ * Fill plane data pointers and linesize for samples with sample
171
+ * format sample_fmt.
172
+ *
173
+ * The audio_data array is filled with the pointers to the samples data planes:
174
+ * for planar, set the start point of each channel's data within the buffer,
175
+ * for packed, set the start point of the entire buffer only.
176
+ *
177
+ * The value pointed to by linesize is set to the aligned size of each
178
+ * channel's data buffer for planar layout, or to the aligned size of the
179
+ * buffer for all channels for packed layout.
180
+ *
181
+ * The buffer in buf must be big enough to contain all the samples
182
+ * (use av_samples_get_buffer_size() to compute its minimum size),
183
+ * otherwise the audio_data pointers will point to invalid data.
184
+ *
185
+ * @see enum AVSampleFormat
186
+ * The documentation for AVSampleFormat describes the data layout.
187
+ *
188
+ * @param[out] audio_data array to be filled with the pointer for each channel
189
+ * @param[out] linesize calculated linesize, may be NULL
190
+ * @param buf the pointer to a buffer containing the samples
191
+ * @param nb_channels the number of channels
192
+ * @param nb_samples the number of samples in a single channel
193
+ * @param sample_fmt the sample format
194
+ * @param align buffer size alignment (0 = default, 1 = no alignment)
195
+ * @return minimum size in bytes required for the buffer on success,
196
+ * or a negative error code on failure
197
+ */
198
+ int av_samples_fill_arrays(uint8_t **audio_data, int *linesize,
199
+ const uint8_t *buf,
200
+ int nb_channels, int nb_samples,
201
+ enum AVSampleFormat sample_fmt, int align);
202
+
203
+ /**
204
+ * Allocate a samples buffer for nb_samples samples, and fill data pointers and
205
+ * linesize accordingly.
206
+ * The allocated samples buffer can be freed by using av_freep(&audio_data[0])
207
+ * Allocated data will be initialized to silence.
208
+ *
209
+ * @see enum AVSampleFormat
210
+ * The documentation for AVSampleFormat describes the data layout.
211
+ *
212
+ * @param[out] audio_data array to be filled with the pointer for each channel
213
+ * @param[out] linesize aligned size for audio buffer(s), may be NULL
214
+ * @param nb_channels number of audio channels
215
+ * @param nb_samples number of samples per channel
216
+ * @param sample_fmt the sample format
217
+ * @param align buffer size alignment (0 = default, 1 = no alignment)
218
+ * @return >=0 on success or a negative error code on failure
219
+ * @todo return the size of the allocated buffer in case of success at the next bump
220
+ * @see av_samples_fill_arrays()
221
+ * @see av_samples_alloc_array_and_samples()
222
+ */
223
+ int av_samples_alloc(uint8_t **audio_data, int *linesize, int nb_channels,
224
+ int nb_samples, enum AVSampleFormat sample_fmt, int align);
225
+
226
+ /**
227
+ * Allocate a data pointers array, samples buffer for nb_samples
228
+ * samples, and fill data pointers and linesize accordingly.
229
+ *
230
+ * This is the same as av_samples_alloc(), but also allocates the data
231
+ * pointers array.
232
+ *
233
+ * @see av_samples_alloc()
234
+ */
235
+ int av_samples_alloc_array_and_samples(uint8_t ***audio_data, int *linesize, int nb_channels,
236
+ int nb_samples, enum AVSampleFormat sample_fmt, int align);
237
+
238
+ /**
239
+ * Copy samples from src to dst.
240
+ *
241
+ * @param dst destination array of pointers to data planes
242
+ * @param src source array of pointers to data planes
243
+ * @param dst_offset offset in samples at which the data will be written to dst
244
+ * @param src_offset offset in samples at which the data will be read from src
245
+ * @param nb_samples number of samples to be copied
246
+ * @param nb_channels number of audio channels
247
+ * @param sample_fmt audio sample format
248
+ */
249
+ int av_samples_copy(uint8_t * const *dst, uint8_t * const *src, int dst_offset,
250
+ int src_offset, int nb_samples, int nb_channels,
251
+ enum AVSampleFormat sample_fmt);
252
+
253
+ /**
254
+ * Fill an audio buffer with silence.
255
+ *
256
+ * @param audio_data array of pointers to data planes
257
+ * @param offset offset in samples at which to start filling
258
+ * @param nb_samples number of samples to fill
259
+ * @param nb_channels number of audio channels
260
+ * @param sample_fmt audio sample format
261
+ */
262
+ int av_samples_set_silence(uint8_t * const *audio_data, int offset, int nb_samples,
263
+ int nb_channels, enum AVSampleFormat sample_fmt);
264
+
265
+ /**
266
+ * @}
267
+ * @}
268
+ */
269
+ #endif /* AVUTIL_SAMPLEFMT_H */
@@ -0,0 +1,90 @@
1
+ /*
2
+ * Copyright (C) 2007 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
+ * @ingroup lavu_sha
24
+ * Public header for SHA-1 & SHA-256 hash function implementations.
25
+ */
26
+
27
+ #ifndef AVUTIL_SHA_H
28
+ #define AVUTIL_SHA_H
29
+
30
+ #include <stddef.h>
31
+ #include <stdint.h>
32
+
33
+ #include "attributes.h"
34
+
35
+ /**
36
+ * @defgroup lavu_sha SHA
37
+ * @ingroup lavu_hash
38
+ * SHA-1 and SHA-256 (Secure Hash Algorithm) hash function implementations.
39
+ *
40
+ * This module supports the following SHA hash functions:
41
+ *
42
+ * - SHA-1: 160 bits
43
+ * - SHA-224: 224 bits, as a variant of SHA-2
44
+ * - SHA-256: 256 bits, as a variant of SHA-2
45
+ *
46
+ * @see For SHA-384, SHA-512, and variants thereof, see @ref lavu_sha512.
47
+ *
48
+ * @{
49
+ */
50
+
51
+ extern const int av_sha_size;
52
+
53
+ struct AVSHA;
54
+
55
+ /**
56
+ * Allocate an AVSHA context.
57
+ */
58
+ struct AVSHA *av_sha_alloc(void);
59
+
60
+ /**
61
+ * Initialize SHA-1 or SHA-2 hashing.
62
+ *
63
+ * @param context pointer to the function context (of size av_sha_size)
64
+ * @param bits number of bits in digest (SHA-1 - 160 bits, SHA-2 224 or 256 bits)
65
+ * @return zero if initialization succeeded, -1 otherwise
66
+ */
67
+ int av_sha_init(struct AVSHA* context, int bits);
68
+
69
+ /**
70
+ * Update hash value.
71
+ *
72
+ * @param ctx hash function context
73
+ * @param data input data to update hash with
74
+ * @param len input data length
75
+ */
76
+ void av_sha_update(struct AVSHA *ctx, const uint8_t *data, size_t len);
77
+
78
+ /**
79
+ * Finish hashing and output digest value.
80
+ *
81
+ * @param context hash function context
82
+ * @param digest buffer where output digest value is stored
83
+ */
84
+ void av_sha_final(struct AVSHA* context, uint8_t *digest);
85
+
86
+ /**
87
+ * @}
88
+ */
89
+
90
+ #endif /* AVUTIL_SHA_H */
@@ -0,0 +1,92 @@
1
+ /*
2
+ * Copyright (C) 2007 Michael Niedermayer <michaelni@gmx.at>
3
+ * Copyright (C) 2013 James Almer <jamrial@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
+ * @ingroup lavu_sha512
25
+ * Public header for SHA-512 implementation.
26
+ */
27
+
28
+ #ifndef AVUTIL_SHA512_H
29
+ #define AVUTIL_SHA512_H
30
+
31
+ #include <stddef.h>
32
+ #include <stdint.h>
33
+
34
+ #include "attributes.h"
35
+
36
+ /**
37
+ * @defgroup lavu_sha512 SHA-512
38
+ * @ingroup lavu_hash
39
+ * SHA-512 (Secure Hash Algorithm) hash function implementations.
40
+ *
41
+ * This module supports the following SHA-2 hash functions:
42
+ *
43
+ * - SHA-512/224: 224 bits
44
+ * - SHA-512/256: 256 bits
45
+ * - SHA-384: 384 bits
46
+ * - SHA-512: 512 bits
47
+ *
48
+ * @see For SHA-1, SHA-256, and variants thereof, see @ref lavu_sha.
49
+ *
50
+ * @{
51
+ */
52
+
53
+ extern const int av_sha512_size;
54
+
55
+ struct AVSHA512;
56
+
57
+ /**
58
+ * Allocate an AVSHA512 context.
59
+ */
60
+ struct AVSHA512 *av_sha512_alloc(void);
61
+
62
+ /**
63
+ * Initialize SHA-2 512 hashing.
64
+ *
65
+ * @param context pointer to the function context (of size av_sha512_size)
66
+ * @param bits number of bits in digest (224, 256, 384 or 512 bits)
67
+ * @return zero if initialization succeeded, -1 otherwise
68
+ */
69
+ int av_sha512_init(struct AVSHA512* context, int bits);
70
+
71
+ /**
72
+ * Update hash value.
73
+ *
74
+ * @param context hash function context
75
+ * @param data input data to update hash with
76
+ * @param len input data length
77
+ */
78
+ void av_sha512_update(struct AVSHA512* context, const uint8_t* data, size_t len);
79
+
80
+ /**
81
+ * Finish hashing and output digest value.
82
+ *
83
+ * @param context hash function context
84
+ * @param digest buffer where output digest value is stored
85
+ */
86
+ void av_sha512_final(struct AVSHA512* context, uint8_t *digest);
87
+
88
+ /**
89
+ * @}
90
+ */
91
+
92
+ #endif /* AVUTIL_SHA512_H */