react-native-audio-api 0.8.0-nightly-5a12f24-20250901 → 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,57 @@
1
+ /*
2
+ * Copyright (c) 2009 Baptiste Coudurier <baptiste.coudurier@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_RANDOM_SEED_H
22
+ #define AVUTIL_RANDOM_SEED_H
23
+
24
+ #include <stddef.h>
25
+ #include <stdint.h>
26
+ /**
27
+ * @addtogroup lavu_crypto
28
+ * @{
29
+ */
30
+
31
+ /**
32
+ * Get a seed to use in conjunction with random functions.
33
+ * This function tries to provide a good seed at a best effort bases.
34
+ * Its possible to call this function multiple times if more bits are needed.
35
+ * It can be quite slow, which is why it should only be used as seed for a faster
36
+ * PRNG. The quality of the seed depends on the platform.
37
+ */
38
+ uint32_t av_get_random_seed(void);
39
+
40
+ /**
41
+ * Generate cryptographically secure random data, i.e. suitable for use as
42
+ * encryption keys and similar.
43
+ *
44
+ * @param buf buffer into which the random data will be written
45
+ * @param len size of buf in bytes
46
+ *
47
+ * @retval 0 success, len bytes of random data was written
48
+ * into buf
49
+ * @retval "a negative AVERROR code" random data could not be generated
50
+ */
51
+ int av_random_bytes(uint8_t *buf, size_t len);
52
+
53
+ /**
54
+ * @}
55
+ */
56
+
57
+ #endif /* AVUTIL_RANDOM_SEED_H */
@@ -0,0 +1,225 @@
1
+ /*
2
+ * rational numbers
3
+ * Copyright (c) 2003 Michael Niedermayer <michaelni@gmx.at>
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_math_rational
25
+ * Utilties for rational number calculation.
26
+ * @author Michael Niedermayer <michaelni@gmx.at>
27
+ */
28
+
29
+ #ifndef AVUTIL_RATIONAL_H
30
+ #define AVUTIL_RATIONAL_H
31
+
32
+ #include <stdint.h>
33
+ #include <limits.h>
34
+ #include "attributes.h"
35
+
36
+ /**
37
+ * @defgroup lavu_math_rational AVRational
38
+ * @ingroup lavu_math
39
+ * Rational number calculation.
40
+ *
41
+ * While rational numbers can be expressed as floating-point numbers, the
42
+ * conversion process is a lossy one, so are floating-point operations. On the
43
+ * other hand, the nature of FFmpeg demands highly accurate calculation of
44
+ * timestamps. This set of rational number utilities serves as a generic
45
+ * interface for manipulating rational numbers as pairs of numerators and
46
+ * denominators.
47
+ *
48
+ * Many of the functions that operate on AVRational's have the suffix `_q`, in
49
+ * reference to the mathematical symbol "ℚ" (Q) which denotes the set of all
50
+ * rational numbers.
51
+ *
52
+ * @{
53
+ */
54
+
55
+ /**
56
+ * Rational number (pair of numerator and denominator).
57
+ */
58
+ typedef struct AVRational{
59
+ int num; ///< Numerator
60
+ int den; ///< Denominator
61
+ } AVRational;
62
+
63
+ /**
64
+ * Create an AVRational.
65
+ *
66
+ * Useful for compilers that do not support compound literals.
67
+ *
68
+ * @note The return value is not reduced.
69
+ * @see av_reduce()
70
+ */
71
+ static inline AVRational av_make_q(int num, int den)
72
+ {
73
+ AVRational r = { num, den };
74
+ return r;
75
+ }
76
+
77
+ /**
78
+ * Compare two rationals.
79
+ *
80
+ * @param a First rational
81
+ * @param b Second rational
82
+ *
83
+ * @return One of the following values:
84
+ * - 0 if `a == b`
85
+ * - 1 if `a > b`
86
+ * - -1 if `a < b`
87
+ * - `INT_MIN` if one of the values is of the form `0 / 0`
88
+ */
89
+ static inline int av_cmp_q(AVRational a, AVRational b){
90
+ const int64_t tmp= a.num * (int64_t)b.den - b.num * (int64_t)a.den;
91
+
92
+ if(tmp) return (int)((tmp ^ a.den ^ b.den)>>63)|1;
93
+ else if(b.den && a.den) return 0;
94
+ else if(a.num && b.num) return (a.num>>31) - (b.num>>31);
95
+ else return INT_MIN;
96
+ }
97
+
98
+ /**
99
+ * Convert an AVRational to a `double`.
100
+ * @param a AVRational to convert
101
+ * @return `a` in floating-point form
102
+ * @see av_d2q()
103
+ */
104
+ static inline double av_q2d(AVRational a){
105
+ return a.num / (double) a.den;
106
+ }
107
+
108
+ /**
109
+ * Reduce a fraction.
110
+ *
111
+ * This is useful for framerate calculations.
112
+ *
113
+ * @param[out] dst_num Destination numerator
114
+ * @param[out] dst_den Destination denominator
115
+ * @param[in] num Source numerator
116
+ * @param[in] den Source denominator
117
+ * @param[in] max Maximum allowed values for `dst_num` & `dst_den`
118
+ * @return 1 if the operation is exact, 0 otherwise
119
+ */
120
+ int av_reduce(int *dst_num, int *dst_den, int64_t num, int64_t den, int64_t max);
121
+
122
+ /**
123
+ * Multiply two rationals.
124
+ * @param b First rational
125
+ * @param c Second rational
126
+ * @return b*c
127
+ */
128
+ AVRational av_mul_q(AVRational b, AVRational c) av_const;
129
+
130
+ /**
131
+ * Divide one rational by another.
132
+ * @param b First rational
133
+ * @param c Second rational
134
+ * @return b/c
135
+ */
136
+ AVRational av_div_q(AVRational b, AVRational c) av_const;
137
+
138
+ /**
139
+ * Add two rationals.
140
+ * @param b First rational
141
+ * @param c Second rational
142
+ * @return b+c
143
+ */
144
+ AVRational av_add_q(AVRational b, AVRational c) av_const;
145
+
146
+ /**
147
+ * Subtract one rational from another.
148
+ * @param b First rational
149
+ * @param c Second rational
150
+ * @return b-c
151
+ */
152
+ AVRational av_sub_q(AVRational b, AVRational c) av_const;
153
+
154
+ /**
155
+ * Invert a rational.
156
+ * @param q value
157
+ * @return 1 / q
158
+ */
159
+ static av_always_inline AVRational av_inv_q(AVRational q)
160
+ {
161
+ AVRational r = { q.den, q.num };
162
+ return r;
163
+ }
164
+
165
+ /**
166
+ * Convert a double precision floating point number to a rational.
167
+ *
168
+ * In case of infinity, the returned value is expressed as `{1, 0}` or
169
+ * `{-1, 0}` depending on the sign.
170
+ *
171
+ * In general rational numbers with |num| <= 1<<26 && |den| <= 1<<26
172
+ * can be recovered exactly from their double representation.
173
+ * (no exceptions were found within 1B random ones)
174
+ *
175
+ * @param d `double` to convert
176
+ * @param max Maximum allowed numerator and denominator
177
+ * @return `d` in AVRational form
178
+ * @see av_q2d()
179
+ */
180
+ AVRational av_d2q(double d, int max) av_const;
181
+
182
+ /**
183
+ * Find which of the two rationals is closer to another rational.
184
+ *
185
+ * @param q Rational to be compared against
186
+ * @param q1 Rational to be tested
187
+ * @param q2 Rational to be tested
188
+ * @return One of the following values:
189
+ * - 1 if `q1` is nearer to `q` than `q2`
190
+ * - -1 if `q2` is nearer to `q` than `q1`
191
+ * - 0 if they have the same distance
192
+ */
193
+ int av_nearer_q(AVRational q, AVRational q1, AVRational q2);
194
+
195
+ /**
196
+ * Find the value in a list of rationals nearest a given reference rational.
197
+ *
198
+ * @param q Reference rational
199
+ * @param q_list Array of rationals terminated by `{0, 0}`
200
+ * @return Index of the nearest value found in the array
201
+ */
202
+ int av_find_nearest_q_idx(AVRational q, const AVRational* q_list);
203
+
204
+ /**
205
+ * Convert an AVRational to a IEEE 32-bit `float` expressed in fixed-point
206
+ * format.
207
+ *
208
+ * @param q Rational to be converted
209
+ * @return Equivalent floating-point value, expressed as an unsigned 32-bit
210
+ * integer.
211
+ * @note The returned value is platform-indepedant.
212
+ */
213
+ uint32_t av_q2intfloat(AVRational q);
214
+
215
+ /**
216
+ * Return the best rational so that a and b are multiple of it.
217
+ * If the resulting denominator is larger than max_den, return def.
218
+ */
219
+ AVRational av_gcd_q(AVRational a, AVRational b, int max_den, AVRational def);
220
+
221
+ /**
222
+ * @}
223
+ */
224
+
225
+ #endif /* AVUTIL_RATIONAL_H */
@@ -0,0 +1,69 @@
1
+ /*
2
+ * RC4 encryption/decryption/pseudo-random number generator
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_RC4_H
22
+ #define AVUTIL_RC4_H
23
+
24
+ #include <stdint.h>
25
+
26
+ /**
27
+ * @defgroup lavu_rc4 RC4
28
+ * @ingroup lavu_crypto
29
+ * @{
30
+ */
31
+
32
+ typedef struct AVRC4 {
33
+ uint8_t state[256];
34
+ int x, y;
35
+ } AVRC4;
36
+
37
+ /**
38
+ * Allocate an AVRC4 context.
39
+ */
40
+ AVRC4 *av_rc4_alloc(void);
41
+
42
+ /**
43
+ * @brief Initializes an AVRC4 context.
44
+ *
45
+ * @param d pointer to the AVRC4 context
46
+ * @param key buffer containig the key
47
+ * @param key_bits must be a multiple of 8
48
+ * @param decrypt 0 for encryption, 1 for decryption, currently has no effect
49
+ * @return zero on success, negative value otherwise
50
+ */
51
+ int av_rc4_init(struct AVRC4 *d, const uint8_t *key, int key_bits, int decrypt);
52
+
53
+ /**
54
+ * @brief Encrypts / decrypts using the RC4 algorithm.
55
+ *
56
+ * @param d pointer to the AVRC4 context
57
+ * @param count number of bytes
58
+ * @param dst destination array, can be equal to src
59
+ * @param src source array, can be equal to dst, may be NULL
60
+ * @param iv not (yet) used for RC4, should be NULL
61
+ * @param decrypt 0 for encryption, 1 for decryption, not (yet) used
62
+ */
63
+ void av_rc4_crypt(struct AVRC4 *d, uint8_t *dst, const uint8_t *src, int count, uint8_t *iv, int decrypt);
64
+
65
+ /**
66
+ * @}
67
+ */
68
+
69
+ #endif /* AVUTIL_RC4_H */
@@ -0,0 +1,297 @@
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_REFSTRUCT_H
20
+ #define AVUTIL_REFSTRUCT_H
21
+
22
+ #include <stddef.h>
23
+
24
+ /**
25
+ * RefStruct is an API for creating reference-counted objects
26
+ * with minimal overhead. The API is designed for objects,
27
+ * not buffers like the AVBuffer API. The main differences
28
+ * to the AVBuffer API are as follows:
29
+ *
30
+ * - It uses void* instead of uint8_t* as its base type due to
31
+ * its focus on objects.
32
+ * - There are no equivalents of AVBuffer and AVBufferRef.
33
+ * E.g. there is no way to get the usable size of the object:
34
+ * The user is supposed to know what is at the other end of
35
+ * the pointer. It also avoids one level of indirection.
36
+ * - Custom allocators are not supported. This allows to simplify
37
+ * the implementation and reduce the amount of allocations.
38
+ * - It also has the advantage that the user's free callback need
39
+ * only free the resources owned by the object, but not the
40
+ * object itself.
41
+ * - Because referencing (and replacing) an object managed by the
42
+ * RefStruct API does not involve allocations, they can not fail
43
+ * and therefore need not be checked.
44
+ *
45
+ * @note Referencing and unreferencing the buffers is thread-safe and thus
46
+ * may be done from multiple threads simultaneously without any need for
47
+ * additional locking.
48
+ */
49
+
50
+ /**
51
+ * This union is used for all opaque parameters in this API to spare the user
52
+ * to cast const away in case the opaque to use is const-qualified.
53
+ *
54
+ * The functions provided by this API with an AVRefStructOpaque come in pairs
55
+ * named foo_c and foo. The foo function accepts void* as opaque and is just
56
+ * a wrapper around the foo_c function; "_c" means "(potentially) const".
57
+ */
58
+ typedef union {
59
+ void *nc;
60
+ const void *c;
61
+ } AVRefStructOpaque;
62
+
63
+ /**
64
+ * If this flag is set in av_refstruct_alloc_ext_c(), the object will not
65
+ * be initially zeroed.
66
+ */
67
+ #define AV_REFSTRUCT_FLAG_NO_ZEROING (1 << 0)
68
+
69
+ /**
70
+ * Allocate a refcounted object of usable size `size` managed via
71
+ * the RefStruct API.
72
+ *
73
+ * By default (in the absence of flags to the contrary),
74
+ * the returned object is initially zeroed.
75
+ *
76
+ * @param size Desired usable size of the returned object.
77
+ * @param flags A bitwise combination of AV_REFSTRUCT_FLAG_* flags.
78
+ * @param opaque A pointer that will be passed to the free_cb callback.
79
+ * @param free_cb A callback for freeing this object's content
80
+ * when its reference count reaches zero;
81
+ * it must not free the object itself.
82
+ * @return A pointer to an object of the desired size or NULL on failure.
83
+ */
84
+ void *av_refstruct_alloc_ext_c(size_t size, unsigned flags, AVRefStructOpaque opaque,
85
+ void (*free_cb)(AVRefStructOpaque opaque, void *obj));
86
+
87
+ /**
88
+ * A wrapper around av_refstruct_alloc_ext_c() for the common case
89
+ * of a non-const qualified opaque.
90
+ *
91
+ * @see av_refstruct_alloc_ext_c()
92
+ */
93
+ static inline
94
+ void *av_refstruct_alloc_ext(size_t size, unsigned flags, void *opaque,
95
+ void (*free_cb)(AVRefStructOpaque opaque, void *obj))
96
+ {
97
+ return av_refstruct_alloc_ext_c(size, flags, (AVRefStructOpaque){.nc = opaque},
98
+ free_cb);
99
+ }
100
+
101
+ /**
102
+ * Equivalent to av_refstruct_alloc_ext(size, 0, NULL, NULL)
103
+ */
104
+ static inline
105
+ void *av_refstruct_allocz(size_t size)
106
+ {
107
+ return av_refstruct_alloc_ext(size, 0, NULL, NULL);
108
+ }
109
+
110
+ /**
111
+ * Decrement the reference count of the underlying object and automatically
112
+ * free the object if there are no more references to it.
113
+ *
114
+ * `*objp == NULL` is legal and a no-op.
115
+ *
116
+ * @param objp Pointer to a pointer that is either NULL or points to an object
117
+ * managed via this API. `*objp` is set to NULL on return.
118
+ */
119
+ void av_refstruct_unref(void *objp);
120
+
121
+ /**
122
+ * Create a new reference to an object managed via this API,
123
+ * i.e. increment the reference count of the underlying object
124
+ * and return obj.
125
+ * @return a pointer equal to obj.
126
+ */
127
+ void *av_refstruct_ref(void *obj);
128
+
129
+ /**
130
+ * Analog of av_refstruct_ref(), but for constant objects.
131
+ * @see av_refstruct_ref()
132
+ */
133
+ const void *av_refstruct_ref_c(const void *obj);
134
+
135
+ /**
136
+ * Ensure `*dstp` refers to the same object as src.
137
+ *
138
+ * If `*dstp` is already equal to src, do nothing. Otherwise unreference `*dstp`
139
+ * and replace it with a new reference to src in case `src != NULL` (this
140
+ * involves incrementing the reference count of src's underlying object) or
141
+ * with NULL otherwise.
142
+ *
143
+ * @param dstp Pointer to a pointer that is either NULL or points to an object
144
+ * managed via this API.
145
+ * @param src A pointer to an object managed via this API or NULL.
146
+ */
147
+ void av_refstruct_replace(void *dstp, const void *src);
148
+
149
+ /**
150
+ * Check whether the reference count of an object managed
151
+ * via this API is 1.
152
+ *
153
+ * @param obj A pointer to an object managed via this API.
154
+ * @return 1 if the reference count of obj is 1; 0 otherwise.
155
+ */
156
+ int av_refstruct_exclusive(const void *obj);
157
+
158
+ /**
159
+ * AVRefStructPool is an API for a thread-safe pool of objects managed
160
+ * via the RefStruct API.
161
+ *
162
+ * Frequently allocating and freeing large or complicated objects may be slow
163
+ * and wasteful. This API is meant to solve this in cases when the caller
164
+ * needs a set of interchangable objects.
165
+ *
166
+ * At the beginning, the user must call allocate the pool via
167
+ * av_refstruct_pool_alloc() or its analogue av_refstruct_pool_alloc_ext().
168
+ * Then whenever an object is needed, call av_refstruct_pool_get() to
169
+ * get a new or reused object from the pool. This new object works in all
170
+ * aspects the same way as the ones created by av_refstruct_alloc_ext().
171
+ * However, when the last reference to this object is unreferenced, it is
172
+ * (optionally) reset and returned to the pool instead of being freed and
173
+ * will be reused for subsequent av_refstruct_pool_get() calls.
174
+ *
175
+ * When the caller is done with the pool and no longer needs to create any new
176
+ * objects, av_refstruct_pool_uninit() must be called to mark the pool as
177
+ * freeable. Then entries returned to the pool will then be freed.
178
+ * Once all the entries are freed, the pool will automatically be freed.
179
+ *
180
+ * Allocating and releasing objects with this API is thread-safe as long as
181
+ * the user-supplied callbacks (if provided) are thread-safe.
182
+ */
183
+
184
+ /**
185
+ * The buffer pool. This structure is opaque and not meant to be accessed
186
+ * directly. It is allocated with the allocators below and freed with
187
+ * av_refstruct_pool_uninit().
188
+ */
189
+ typedef struct AVRefStructPool AVRefStructPool;
190
+
191
+ /**
192
+ * If this flag is not set, every object in the pool will be zeroed before
193
+ * the init callback is called or before it is turned over to the user
194
+ * for the first time if no init callback has been provided.
195
+ */
196
+ #define AV_REFSTRUCT_POOL_FLAG_NO_ZEROING AV_REFSTRUCT_FLAG_NO_ZEROING
197
+ /**
198
+ * If this flag is set and both init_cb and reset_cb callbacks are provided,
199
+ * then reset_cb will be called if init_cb fails.
200
+ * The object passed to reset_cb will be in the state left by init_cb.
201
+ */
202
+ #define AV_REFSTRUCT_POOL_FLAG_RESET_ON_INIT_ERROR (1 << 16)
203
+ /**
204
+ * If this flag is set and both init_cb and free_entry_cb callbacks are
205
+ * provided, then free_cb will be called if init_cb fails.
206
+ *
207
+ * It will be called after reset_cb in case reset_cb and the
208
+ * AV_REFSTRUCT_POOL_FLAG_RESET_ON_INIT_ERROR flag are also set.
209
+ *
210
+ * The object passed to free_cb will be in the state left by
211
+ * the callbacks applied earlier (init_cb potentially followed by reset_cb).
212
+ */
213
+ #define AV_REFSTRUCT_POOL_FLAG_FREE_ON_INIT_ERROR (1 << 17)
214
+ /**
215
+ * If this flag is set, the entries will be zeroed before
216
+ * being returned to the user (after the init or reset callbacks
217
+ * have been called (if provided)). Furthermore, to avoid zeroing twice
218
+ * it also makes the pool behave as if the AV_REFSTRUCT_POOL_FLAG_NO_ZEROING
219
+ * flag had been provided.
220
+ */
221
+ #define AV_REFSTRUCT_POOL_FLAG_ZERO_EVERY_TIME (1 << 18)
222
+
223
+ /**
224
+ * Equivalent to av_refstruct_pool_alloc(size, flags, NULL, NULL, NULL, NULL, NULL)
225
+ */
226
+ AVRefStructPool *av_refstruct_pool_alloc(size_t size, unsigned flags);
227
+
228
+ /**
229
+ * Allocate an AVRefStructPool, potentially using complex callbacks.
230
+ *
231
+ * @param size size of the entries of the pool
232
+ * @param flags a bitwise combination of AV_REFSTRUCT_POOL_FLAG_* flags
233
+ * @param opaque A pointer that will be passed to the callbacks below.
234
+ * @param init A callback that will be called directly after a new entry
235
+ * has been allocated. obj has already been zeroed unless
236
+ * the AV_REFSTRUCT_POOL_FLAG_NO_ZEROING flag is in use.
237
+ * @param reset A callback that will be called after an entry has been
238
+ * returned to the pool and before it is reused.
239
+ * @param free_entry A callback that will be called when an entry is freed
240
+ * after the pool has been marked as to be uninitialized.
241
+ * @param free A callback that will be called when the pool itself is
242
+ * freed (after the last entry has been returned and freed).
243
+ */
244
+ AVRefStructPool *av_refstruct_pool_alloc_ext_c(size_t size, unsigned flags,
245
+ AVRefStructOpaque opaque,
246
+ int (*init_cb)(AVRefStructOpaque opaque, void *obj),
247
+ void (*reset_cb)(AVRefStructOpaque opaque, void *obj),
248
+ void (*free_entry_cb)(AVRefStructOpaque opaque, void *obj),
249
+ void (*free_cb)(AVRefStructOpaque opaque));
250
+
251
+ /**
252
+ * A wrapper around av_refstruct_pool_alloc_ext_c() for the common case
253
+ * of a non-const qualified opaque.
254
+ *
255
+ * @see av_refstruct_pool_alloc_ext_c()
256
+ */
257
+ static inline
258
+ AVRefStructPool *av_refstruct_pool_alloc_ext(size_t size, unsigned flags,
259
+ void *opaque,
260
+ int (*init_cb)(AVRefStructOpaque opaque, void *obj),
261
+ void (*reset_cb)(AVRefStructOpaque opaque, void *obj),
262
+ void (*free_entry_cb)(AVRefStructOpaque opaque, void *obj),
263
+ void (*free_cb)(AVRefStructOpaque opaque))
264
+ {
265
+ return av_refstruct_pool_alloc_ext_c(size, flags, (AVRefStructOpaque){.nc = opaque},
266
+ init_cb, reset_cb, free_entry_cb, free_cb);
267
+ }
268
+
269
+ /**
270
+ * Get an object from the pool, reusing an old one from the pool when
271
+ * available.
272
+ *
273
+ * Every call to this function must happen before av_refstruct_pool_uninit().
274
+ * Otherwise undefined behaviour may occur.
275
+ *
276
+ * @param pool the pool from which to get the object
277
+ * @return a reference to the object on success, NULL on error.
278
+ */
279
+ void *av_refstruct_pool_get(AVRefStructPool *pool);
280
+
281
+ /**
282
+ * Mark the pool as being available for freeing. It will actually be freed
283
+ * only once all the allocated buffers associated with the pool are released.
284
+ * Thus it is safe to call this function while some of the allocated buffers
285
+ * are still in use.
286
+ *
287
+ * It is illegal to try to get a new entry after this function has been called.
288
+ *
289
+ * @param poolp pointer to a pointer to either NULL or a pool to be freed.
290
+ * `*poolp` will be set to NULL.
291
+ */
292
+ static inline void av_refstruct_pool_uninit(AVRefStructPool **poolp)
293
+ {
294
+ av_refstruct_unref(poolp);
295
+ }
296
+
297
+ #endif /* AVUTIL_REFSTRUCT_H */
@@ -0,0 +1,50 @@
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_REPLAYGAIN_H
20
+ #define AVUTIL_REPLAYGAIN_H
21
+
22
+ #include <stdint.h>
23
+
24
+ /**
25
+ * ReplayGain information (see
26
+ * http://wiki.hydrogenaudio.org/index.php?title=ReplayGain_1.0_specification).
27
+ * The size of this struct is a part of the public ABI.
28
+ */
29
+ typedef struct AVReplayGain {
30
+ /**
31
+ * Track replay gain in microbels (divide by 100000 to get the value in dB).
32
+ * Should be set to INT32_MIN when unknown.
33
+ */
34
+ int32_t track_gain;
35
+ /**
36
+ * Peak track amplitude, with 100000 representing full scale (but values
37
+ * may overflow). 0 when unknown.
38
+ */
39
+ uint32_t track_peak;
40
+ /**
41
+ * Same as track_gain, but for the whole album.
42
+ */
43
+ int32_t album_gain;
44
+ /**
45
+ * Same as track_peak, but for the whole album,
46
+ */
47
+ uint32_t album_peak;
48
+ } AVReplayGain;
49
+
50
+ #endif /* AVUTIL_REPLAYGAIN_H */