react-native-audio-api 0.7.2 → 0.8.0-nightly-daaceff-20250902

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 (214) hide show
  1. package/RNAudioAPI.podspec +15 -6
  2. package/android/build.gradle +10 -1
  3. package/android/src/main/cpp/audioapi/CMakeLists.txt +21 -5
  4. package/android/src/main/jniLibs/arm64-v8a/libavcodec.so +0 -0
  5. package/android/src/main/jniLibs/arm64-v8a/libavformat.so +0 -0
  6. package/android/src/main/jniLibs/arm64-v8a/libavutil.so +0 -0
  7. package/android/src/main/jniLibs/arm64-v8a/libswresample.so +0 -0
  8. package/android/src/main/jniLibs/armeabi-v7a/libavcodec.so +0 -0
  9. package/android/src/main/jniLibs/armeabi-v7a/libavformat.so +0 -0
  10. package/android/src/main/jniLibs/armeabi-v7a/libavutil.so +0 -0
  11. package/android/src/main/jniLibs/armeabi-v7a/libswresample.so +0 -0
  12. package/android/src/main/jniLibs/x86/libavcodec.so +0 -0
  13. package/android/src/main/jniLibs/x86/libavformat.so +0 -0
  14. package/android/src/main/jniLibs/x86/libavutil.so +0 -0
  15. package/android/src/main/jniLibs/x86/libswresample.so +0 -0
  16. package/android/src/main/jniLibs/x86_64/libavcodec.so +0 -0
  17. package/android/src/main/jniLibs/x86_64/libavformat.so +0 -0
  18. package/android/src/main/jniLibs/x86_64/libavutil.so +0 -0
  19. package/android/src/main/jniLibs/x86_64/libswresample.so +0 -0
  20. package/common/cpp/audioapi/HostObjects/BaseAudioContextHostObject.h +11 -0
  21. package/common/cpp/audioapi/HostObjects/StreamerNodeHostObject.h +30 -0
  22. package/common/cpp/audioapi/core/BaseAudioContext.cpp +9 -0
  23. package/common/cpp/audioapi/core/BaseAudioContext.h +2 -0
  24. package/common/cpp/audioapi/core/sources/StreamerNode.cpp +299 -0
  25. package/common/cpp/audioapi/core/sources/StreamerNode.h +123 -0
  26. package/common/cpp/audioapi/external/arm64-v8a/libcrypto.a +0 -0
  27. package/common/cpp/audioapi/external/arm64-v8a/libssl.a +0 -0
  28. package/common/cpp/audioapi/external/armeabi-v7a/libcrypto.a +0 -0
  29. package/common/cpp/audioapi/external/armeabi-v7a/libssl.a +0 -0
  30. package/common/cpp/audioapi/external/ffmpeg_include/libavcodec/ac3_parser.h +36 -0
  31. package/common/cpp/audioapi/external/ffmpeg_include/libavcodec/adts_parser.h +37 -0
  32. package/common/cpp/audioapi/external/ffmpeg_include/libavcodec/avcodec.h +2947 -0
  33. package/common/cpp/audioapi/external/ffmpeg_include/libavcodec/avdct.h +88 -0
  34. package/common/cpp/audioapi/external/ffmpeg_include/libavcodec/bsf.h +332 -0
  35. package/common/cpp/audioapi/external/ffmpeg_include/libavcodec/codec.h +367 -0
  36. package/common/cpp/audioapi/external/ffmpeg_include/libavcodec/codec_desc.h +134 -0
  37. package/common/cpp/audioapi/external/ffmpeg_include/libavcodec/codec_id.h +681 -0
  38. package/common/cpp/audioapi/external/ffmpeg_include/libavcodec/codec_par.h +248 -0
  39. package/common/cpp/audioapi/external/ffmpeg_include/libavcodec/d3d11va.h +109 -0
  40. package/common/cpp/audioapi/external/ffmpeg_include/libavcodec/defs.h +359 -0
  41. package/common/cpp/audioapi/external/ffmpeg_include/libavcodec/dirac.h +135 -0
  42. package/common/cpp/audioapi/external/ffmpeg_include/libavcodec/dv_profile.h +82 -0
  43. package/common/cpp/audioapi/external/ffmpeg_include/libavcodec/dxva2.h +90 -0
  44. package/common/cpp/audioapi/external/ffmpeg_include/libavcodec/jni.h +67 -0
  45. package/common/cpp/audioapi/external/ffmpeg_include/libavcodec/mediacodec.h +103 -0
  46. package/common/cpp/audioapi/external/ffmpeg_include/libavcodec/packet.h +907 -0
  47. package/common/cpp/audioapi/external/ffmpeg_include/libavcodec/qsv.h +109 -0
  48. package/common/cpp/audioapi/external/ffmpeg_include/libavcodec/vdpau.h +138 -0
  49. package/common/cpp/audioapi/external/ffmpeg_include/libavcodec/version.h +45 -0
  50. package/common/cpp/audioapi/external/ffmpeg_include/libavcodec/version_major.h +55 -0
  51. package/common/cpp/audioapi/external/ffmpeg_include/libavcodec/videotoolbox.h +85 -0
  52. package/common/cpp/audioapi/external/ffmpeg_include/libavcodec/vorbis_parser.h +74 -0
  53. package/common/cpp/audioapi/external/ffmpeg_include/libavformat/avformat.h +3004 -0
  54. package/common/cpp/audioapi/external/ffmpeg_include/libavformat/avio.h +831 -0
  55. package/common/cpp/audioapi/external/ffmpeg_include/libavformat/version.h +47 -0
  56. package/common/cpp/audioapi/external/ffmpeg_include/libavformat/version_major.h +50 -0
  57. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/adler32.h +63 -0
  58. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/aes.h +69 -0
  59. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/aes_ctr.h +99 -0
  60. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/ambient_viewing_environment.h +72 -0
  61. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/attributes.h +175 -0
  62. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/audio_fifo.h +187 -0
  63. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/avassert.h +120 -0
  64. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/avconfig.h +6 -0
  65. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/avstring.h +428 -0
  66. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/avutil.h +364 -0
  67. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/base64.h +72 -0
  68. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/blowfish.h +82 -0
  69. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/bprint.h +254 -0
  70. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/bswap.h +105 -0
  71. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/buffer.h +322 -0
  72. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/camellia.h +70 -0
  73. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/cast5.h +80 -0
  74. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/channel_layout.h +762 -0
  75. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/common.h +589 -0
  76. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/container_fifo.h +130 -0
  77. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/cpu.h +150 -0
  78. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/crc.h +102 -0
  79. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/csp.h +192 -0
  80. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/des.h +81 -0
  81. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/detection_bbox.h +108 -0
  82. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/dict.h +242 -0
  83. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/display.h +109 -0
  84. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/dovi_meta.h +396 -0
  85. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/downmix_info.h +115 -0
  86. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/encryption_info.h +205 -0
  87. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/error.h +129 -0
  88. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/eval.h +140 -0
  89. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/executor.h +67 -0
  90. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/ffversion.h +5 -0
  91. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/fifo.h +242 -0
  92. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/file.h +62 -0
  93. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/film_grain_params.h +282 -0
  94. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/frame.h +1163 -0
  95. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/hash.h +264 -0
  96. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/hdr_dynamic_metadata.h +376 -0
  97. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/hdr_dynamic_vivid_metadata.h +292 -0
  98. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/hmac.h +99 -0
  99. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/hwcontext.h +601 -0
  100. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/hwcontext_amf.h +46 -0
  101. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/hwcontext_cuda.h +74 -0
  102. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/hwcontext_d3d11va.h +178 -0
  103. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/hwcontext_d3d12va.h +142 -0
  104. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/hwcontext_drm.h +169 -0
  105. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/hwcontext_dxva2.h +75 -0
  106. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/hwcontext_mediacodec.h +61 -0
  107. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/hwcontext_oh.h +34 -0
  108. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/hwcontext_opencl.h +100 -0
  109. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/hwcontext_qsv.h +87 -0
  110. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/hwcontext_vaapi.h +117 -0
  111. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/hwcontext_vdpau.h +44 -0
  112. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/hwcontext_videotoolbox.h +106 -0
  113. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/hwcontext_vulkan.h +377 -0
  114. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/iamf.h +694 -0
  115. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/imgutils.h +377 -0
  116. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/intfloat.h +77 -0
  117. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/intreadwrite.h +677 -0
  118. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/lfg.h +81 -0
  119. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/log.h +427 -0
  120. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/lzo.h +66 -0
  121. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/macros.h +80 -0
  122. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/mastering_display_metadata.h +137 -0
  123. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/mathematics.h +300 -0
  124. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/md5.h +89 -0
  125. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/mem.h +607 -0
  126. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/motion_vector.h +57 -0
  127. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/murmur3.h +115 -0
  128. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/opt.h +1194 -0
  129. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/parseutils.h +197 -0
  130. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/pixdesc.h +440 -0
  131. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/pixelutils.h +51 -0
  132. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/pixfmt.h +797 -0
  133. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/random_seed.h +57 -0
  134. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/rational.h +225 -0
  135. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/rc4.h +69 -0
  136. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/refstruct.h +297 -0
  137. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/replaygain.h +50 -0
  138. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/ripemd.h +83 -0
  139. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/samplefmt.h +269 -0
  140. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/sha.h +90 -0
  141. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/sha512.h +92 -0
  142. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/spherical.h +243 -0
  143. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/stereo3d.h +325 -0
  144. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/tdrdi.h +164 -0
  145. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/tea.h +71 -0
  146. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/threadmessage.h +115 -0
  147. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/timecode.h +199 -0
  148. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/timestamp.h +85 -0
  149. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/tree.h +137 -0
  150. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/twofish.h +70 -0
  151. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/tx.h +210 -0
  152. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/uuid.h +146 -0
  153. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/version.h +119 -0
  154. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/video_enc_params.h +171 -0
  155. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/video_hint.h +107 -0
  156. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/xtea.h +94 -0
  157. package/common/cpp/audioapi/external/ffmpeg_include/libswresample/swresample.h +587 -0
  158. package/common/cpp/audioapi/external/ffmpeg_include/libswresample/version.h +46 -0
  159. package/common/cpp/audioapi/external/ffmpeg_include/libswresample/version_major.h +31 -0
  160. package/common/cpp/audioapi/external/libavcodec.xcframework/Info.plist +44 -0
  161. package/common/cpp/audioapi/external/libavcodec.xcframework/ios-arm64/libavcodec.framework/Info.plist +1 -0
  162. package/common/cpp/audioapi/external/libavcodec.xcframework/ios-arm64/libavcodec.framework/libavcodec +0 -0
  163. package/common/cpp/audioapi/external/libavcodec.xcframework/ios-arm64_x86_64-simulator/libavcodec.framework/Info.plist +1 -0
  164. package/common/cpp/audioapi/external/libavcodec.xcframework/ios-arm64_x86_64-simulator/libavcodec.framework/libavcodec +0 -0
  165. package/common/cpp/audioapi/external/libavcodec.xcframework/ios-arm64_x86_64-simulator/libavcodec.framework/libavcodec.framework/Info.plist +1 -0
  166. package/common/cpp/audioapi/external/libavcodec.xcframework/ios-arm64_x86_64-simulator/libavcodec.framework/libavcodec.framework/libavcodec +0 -0
  167. package/common/cpp/audioapi/external/libavformat.xcframework/Info.plist +44 -0
  168. package/common/cpp/audioapi/external/libavformat.xcframework/ios-arm64/libavformat.framework/Info.plist +1 -0
  169. package/common/cpp/audioapi/external/libavformat.xcframework/ios-arm64/libavformat.framework/libavformat +0 -0
  170. package/common/cpp/audioapi/external/libavformat.xcframework/ios-arm64_x86_64-simulator/libavformat.framework/Info.plist +1 -0
  171. package/common/cpp/audioapi/external/libavformat.xcframework/ios-arm64_x86_64-simulator/libavformat.framework/libavformat +0 -0
  172. package/common/cpp/audioapi/external/libavutil.xcframework/Info.plist +44 -0
  173. package/common/cpp/audioapi/external/libavutil.xcframework/ios-arm64/libavutil.framework/Info.plist +1 -0
  174. package/common/cpp/audioapi/external/libavutil.xcframework/ios-arm64/libavutil.framework/libavutil +0 -0
  175. package/common/cpp/audioapi/external/libavutil.xcframework/ios-arm64_x86_64-simulator/libavutil.framework/Info.plist +1 -0
  176. package/common/cpp/audioapi/external/libavutil.xcframework/ios-arm64_x86_64-simulator/libavutil.framework/libavutil +0 -0
  177. package/common/cpp/audioapi/external/libswresample.xcframework/Info.plist +44 -0
  178. package/common/cpp/audioapi/external/libswresample.xcframework/ios-arm64/libswresample.framework/Info.plist +1 -0
  179. package/common/cpp/audioapi/external/libswresample.xcframework/ios-arm64/libswresample.framework/libswresample +0 -0
  180. package/common/cpp/audioapi/external/libswresample.xcframework/ios-arm64_x86_64-simulator/libswresample.framework/Info.plist +1 -0
  181. package/common/cpp/audioapi/external/libswresample.xcframework/ios-arm64_x86_64-simulator/libswresample.framework/libswresample +0 -0
  182. package/common/cpp/audioapi/external/x86/libcrypto.a +0 -0
  183. package/common/cpp/audioapi/external/x86/libssl.a +0 -0
  184. package/common/cpp/audioapi/external/x86_64/libcrypto.a +0 -0
  185. package/common/cpp/audioapi/external/x86_64/libssl.a +0 -0
  186. package/common/cpp/audioapi/libs/ffmpeg/INSTRUCTIONS.md +26 -0
  187. package/common/cpp/audioapi/libs/ffmpeg/create_xcframework.sh +111 -0
  188. package/common/cpp/audioapi/libs/ffmpeg/ffmpeg_setup.sh +360 -0
  189. package/common/cpp/test/CMakeLists.txt +5 -1
  190. package/lib/commonjs/api.js +7 -0
  191. package/lib/commonjs/api.js.map +1 -1
  192. package/lib/commonjs/core/BaseAudioContext.js +4 -0
  193. package/lib/commonjs/core/BaseAudioContext.js.map +1 -1
  194. package/lib/commonjs/core/StreamerNode.js +15 -0
  195. package/lib/commonjs/core/StreamerNode.js.map +1 -0
  196. package/lib/module/api.js +1 -0
  197. package/lib/module/api.js.map +1 -1
  198. package/lib/module/core/BaseAudioContext.js +4 -0
  199. package/lib/module/core/BaseAudioContext.js.map +1 -1
  200. package/lib/module/core/StreamerNode.js +9 -0
  201. package/lib/module/core/StreamerNode.js.map +1 -0
  202. package/lib/typescript/api.d.ts +1 -0
  203. package/lib/typescript/api.d.ts.map +1 -1
  204. package/lib/typescript/core/BaseAudioContext.d.ts +2 -0
  205. package/lib/typescript/core/BaseAudioContext.d.ts.map +1 -1
  206. package/lib/typescript/core/StreamerNode.d.ts +5 -0
  207. package/lib/typescript/core/StreamerNode.d.ts.map +1 -0
  208. package/lib/typescript/interfaces.d.ts +4 -0
  209. package/lib/typescript/interfaces.d.ts.map +1 -1
  210. package/package.json +1 -1
  211. package/src/api.ts +1 -0
  212. package/src/core/BaseAudioContext.ts +5 -0
  213. package/src/core/StreamerNode.ts +8 -0
  214. package/src/interfaces.ts +5 -0
@@ -0,0 +1,187 @@
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 * const *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(const AVAudioFifo *af, void * const *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(const AVAudioFifo *af, void * const *data,
128
+ int nb_samples, int offset);
129
+
130
+ /**
131
+ * Read data from an AVAudioFifo.
132
+ *
133
+ * @see enum AVSampleFormat
134
+ * The documentation for AVSampleFormat describes the data layout.
135
+ *
136
+ * @param af AVAudioFifo to read from
137
+ * @param data audio data plane pointers
138
+ * @param nb_samples number of samples to read
139
+ * @return number of samples actually read, or negative AVERROR code
140
+ * on failure. The number of samples actually read will not
141
+ * be greater than nb_samples, and will only be less than
142
+ * nb_samples if av_audio_fifo_size is less than nb_samples.
143
+ */
144
+ int av_audio_fifo_read(AVAudioFifo *af, void * const *data, int nb_samples);
145
+
146
+ /**
147
+ * Drain data from an AVAudioFifo.
148
+ *
149
+ * Removes the data without reading it.
150
+ *
151
+ * @param af AVAudioFifo to drain
152
+ * @param nb_samples number of samples to drain
153
+ * @return 0 if OK, or negative AVERROR code on failure
154
+ */
155
+ int av_audio_fifo_drain(AVAudioFifo *af, int nb_samples);
156
+
157
+ /**
158
+ * Reset the AVAudioFifo buffer.
159
+ *
160
+ * This empties all data in the buffer.
161
+ *
162
+ * @param af AVAudioFifo to reset
163
+ */
164
+ void av_audio_fifo_reset(AVAudioFifo *af);
165
+
166
+ /**
167
+ * Get the current number of samples in the AVAudioFifo available for reading.
168
+ *
169
+ * @param af the AVAudioFifo to query
170
+ * @return number of samples available for reading
171
+ */
172
+ int av_audio_fifo_size(AVAudioFifo *af);
173
+
174
+ /**
175
+ * Get the current number of samples in the AVAudioFifo available for writing.
176
+ *
177
+ * @param af the AVAudioFifo to query
178
+ * @return number of samples available for writing
179
+ */
180
+ int av_audio_fifo_space(AVAudioFifo *af);
181
+
182
+ /**
183
+ * @}
184
+ * @}
185
+ */
186
+
187
+ #endif /* AVUTIL_AUDIO_FIFO_H */
@@ -0,0 +1,120 @@
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
+ #ifdef HAVE_AV_CONFIG_H
32
+ # include "config.h"
33
+ #endif
34
+ #include "attributes.h"
35
+ #include "log.h"
36
+ #include "macros.h"
37
+
38
+ /**
39
+ * assert() equivalent, that is always enabled.
40
+ */
41
+ #define av_assert0(cond) do { \
42
+ if (!(cond)) { \
43
+ av_log(NULL, AV_LOG_PANIC, "Assertion %s failed at %s:%d\n", \
44
+ AV_STRINGIFY(cond), __FILE__, __LINE__); \
45
+ abort(); \
46
+ } \
47
+ } while (0)
48
+
49
+
50
+ /**
51
+ * assert() equivalent, that does not lie in speed critical code.
52
+ * These asserts() thus can be enabled without fearing speed loss.
53
+ */
54
+ #if defined(ASSERT_LEVEL) && ASSERT_LEVEL > 0
55
+ #define av_assert1(cond) av_assert0(cond)
56
+ #else
57
+ #define av_assert1(cond) ((void)0)
58
+ #endif
59
+
60
+
61
+ /**
62
+ * assert() equivalent, that does lie in speed critical code.
63
+ */
64
+ #if defined(ASSERT_LEVEL) && ASSERT_LEVEL > 1
65
+ #define av_assert2(cond) av_assert0(cond)
66
+ #define av_assert2_fpu() av_assert0_fpu()
67
+ #else
68
+ #define av_assert2(cond) ((void)0)
69
+ #define av_assert2_fpu() ((void)0)
70
+ #endif
71
+
72
+ /**
73
+ * Assert that floating point operations can be executed.
74
+ *
75
+ * This will av_assert0() that the cpu is not in MMX state on X86
76
+ */
77
+ void av_assert0_fpu(void);
78
+
79
+ /**
80
+ * Asserts that are used as compiler optimization hints depending
81
+ * upon ASSERT_LEVEL and NBDEBUG.
82
+ *
83
+ * Undefined behaviour occurs if execution reaches a point marked
84
+ * with av_unreachable() or if a condition used with av_assume()
85
+ * is false.
86
+ *
87
+ * The condition used with av_assume() should not have side-effects
88
+ * and should be visible to the compiler.
89
+ */
90
+ #if defined(ASSERT_LEVEL) ? ASSERT_LEVEL > 0 : !defined(HAVE_AV_CONFIG_H) && !defined(NDEBUG)
91
+ #define av_unreachable(msg) \
92
+ do { \
93
+ av_log(NULL, AV_LOG_PANIC, \
94
+ "Reached supposedly unreachable code at %s:%d: %s\n", \
95
+ __FILE__, __LINE__, msg); \
96
+ abort(); \
97
+ } while (0)
98
+ #define av_assume(cond) av_assert0(cond)
99
+ #else
100
+ #if AV_GCC_VERSION_AT_LEAST(4, 5) || AV_HAS_BUILTIN(__builtin_unreachable)
101
+ #define av_unreachable(msg) __builtin_unreachable()
102
+ #elif defined(_MSC_VER)
103
+ #define av_unreachable(msg) __assume(0)
104
+ #define av_assume(cond) __assume(cond)
105
+ #elif __STDC_VERSION__ >= 202311L
106
+ #include <stddef.h>
107
+ #define av_unreachable(msg) unreachable()
108
+ #else
109
+ #define av_unreachable(msg) ((void)0)
110
+ #endif
111
+
112
+ #ifndef av_assume
113
+ #define av_assume(cond) do { \
114
+ if (!(cond)) \
115
+ av_unreachable(); \
116
+ } while (0)
117
+ #endif
118
+ #endif
119
+
120
+ #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 */