@drutech/react-native-audio-analyzer 1.1.1-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (223) hide show
  1. package/LICENSE +20 -0
  2. package/README.md +124 -0
  3. package/android/CMakeCache.txt +372 -0
  4. package/android/CMakeLists.txt +44 -0
  5. package/android/Makefile +211 -0
  6. package/android/build.gradle +110 -0
  7. package/android/cmake_install.cmake +49 -0
  8. package/android/cpp-adapter.cpp +40 -0
  9. package/android/ffmpeg_16kb/include/config.h +749 -0
  10. package/android/ffmpeg_16kb/include/libavcodec/ac3_parser.h +36 -0
  11. package/android/ffmpeg_16kb/include/libavcodec/adts_parser.h +37 -0
  12. package/android/ffmpeg_16kb/include/libavcodec/arm/mathops.h +108 -0
  13. package/android/ffmpeg_16kb/include/libavcodec/avcodec.h +3192 -0
  14. package/android/ffmpeg_16kb/include/libavcodec/avdct.h +88 -0
  15. package/android/ffmpeg_16kb/include/libavcodec/avfft.h +118 -0
  16. package/android/ffmpeg_16kb/include/libavcodec/bsf.h +332 -0
  17. package/android/ffmpeg_16kb/include/libavcodec/codec.h +375 -0
  18. package/android/ffmpeg_16kb/include/libavcodec/codec_desc.h +128 -0
  19. package/android/ffmpeg_16kb/include/libavcodec/codec_id.h +661 -0
  20. package/android/ffmpeg_16kb/include/libavcodec/codec_par.h +247 -0
  21. package/android/ffmpeg_16kb/include/libavcodec/d3d11va.h +112 -0
  22. package/android/ffmpeg_16kb/include/libavcodec/defs.h +192 -0
  23. package/android/ffmpeg_16kb/include/libavcodec/dirac.h +131 -0
  24. package/android/ffmpeg_16kb/include/libavcodec/dv_profile.h +82 -0
  25. package/android/ffmpeg_16kb/include/libavcodec/dxva2.h +93 -0
  26. package/android/ffmpeg_16kb/include/libavcodec/jni.h +46 -0
  27. package/android/ffmpeg_16kb/include/libavcodec/mathops.h +255 -0
  28. package/android/ffmpeg_16kb/include/libavcodec/mediacodec.h +103 -0
  29. package/android/ffmpeg_16kb/include/libavcodec/packet.h +731 -0
  30. package/android/ffmpeg_16kb/include/libavcodec/qsv.h +109 -0
  31. package/android/ffmpeg_16kb/include/libavcodec/vdpau.h +157 -0
  32. package/android/ffmpeg_16kb/include/libavcodec/version.h +45 -0
  33. package/android/ffmpeg_16kb/include/libavcodec/version_major.h +52 -0
  34. package/android/ffmpeg_16kb/include/libavcodec/videotoolbox.h +150 -0
  35. package/android/ffmpeg_16kb/include/libavcodec/vorbis_parser.h +74 -0
  36. package/android/ffmpeg_16kb/include/libavcodec/x86/mathops.h +133 -0
  37. package/android/ffmpeg_16kb/include/libavcodec/xvmc.h +171 -0
  38. package/android/ffmpeg_16kb/include/libavdevice/avdevice.h +397 -0
  39. package/android/ffmpeg_16kb/include/libavdevice/version.h +45 -0
  40. package/android/ffmpeg_16kb/include/libavdevice/version_major.h +36 -0
  41. package/android/ffmpeg_16kb/include/libavfilter/avfilter.h +1491 -0
  42. package/android/ffmpeg_16kb/include/libavfilter/buffersink.h +173 -0
  43. package/android/ffmpeg_16kb/include/libavfilter/buffersrc.h +218 -0
  44. package/android/ffmpeg_16kb/include/libavfilter/version.h +48 -0
  45. package/android/ffmpeg_16kb/include/libavfilter/version_major.h +38 -0
  46. package/android/ffmpeg_16kb/include/libavformat/avformat.h +2826 -0
  47. package/android/ffmpeg_16kb/include/libavformat/avio.h +837 -0
  48. package/android/ffmpeg_16kb/include/libavformat/network.h +341 -0
  49. package/android/ffmpeg_16kb/include/libavformat/os_support.h +317 -0
  50. package/android/ffmpeg_16kb/include/libavformat/url.h +409 -0
  51. package/android/ffmpeg_16kb/include/libavformat/version.h +47 -0
  52. package/android/ffmpeg_16kb/include/libavformat/version_major.h +52 -0
  53. package/android/ffmpeg_16kb/include/libavutil/aarch64/timer.h +50 -0
  54. package/android/ffmpeg_16kb/include/libavutil/adler32.h +63 -0
  55. package/android/ffmpeg_16kb/include/libavutil/aes.h +69 -0
  56. package/android/ffmpeg_16kb/include/libavutil/aes_ctr.h +99 -0
  57. package/android/ffmpeg_16kb/include/libavutil/ambient_viewing_environment.h +72 -0
  58. package/android/ffmpeg_16kb/include/libavutil/arm/timer.h +46 -0
  59. package/android/ffmpeg_16kb/include/libavutil/attributes.h +173 -0
  60. package/android/ffmpeg_16kb/include/libavutil/attributes_internal.h +34 -0
  61. package/android/ffmpeg_16kb/include/libavutil/audio_fifo.h +186 -0
  62. package/android/ffmpeg_16kb/include/libavutil/avassert.h +75 -0
  63. package/android/ffmpeg_16kb/include/libavutil/avconfig.h +6 -0
  64. package/android/ffmpeg_16kb/include/libavutil/avstring.h +429 -0
  65. package/android/ffmpeg_16kb/include/libavutil/avutil.h +371 -0
  66. package/android/ffmpeg_16kb/include/libavutil/base64.h +72 -0
  67. package/android/ffmpeg_16kb/include/libavutil/blowfish.h +82 -0
  68. package/android/ffmpeg_16kb/include/libavutil/bprint.h +251 -0
  69. package/android/ffmpeg_16kb/include/libavutil/bswap.h +111 -0
  70. package/android/ffmpeg_16kb/include/libavutil/buffer.h +322 -0
  71. package/android/ffmpeg_16kb/include/libavutil/camellia.h +70 -0
  72. package/android/ffmpeg_16kb/include/libavutil/cast5.h +80 -0
  73. package/android/ffmpeg_16kb/include/libavutil/channel_layout.h +783 -0
  74. package/android/ffmpeg_16kb/include/libavutil/common.h +578 -0
  75. package/android/ffmpeg_16kb/include/libavutil/cpu.h +134 -0
  76. package/android/ffmpeg_16kb/include/libavutil/crc.h +102 -0
  77. package/android/ffmpeg_16kb/include/libavutil/csp.h +150 -0
  78. package/android/ffmpeg_16kb/include/libavutil/des.h +81 -0
  79. package/android/ffmpeg_16kb/include/libavutil/detection_bbox.h +108 -0
  80. package/android/ffmpeg_16kb/include/libavutil/dict.h +241 -0
  81. package/android/ffmpeg_16kb/include/libavutil/display.h +109 -0
  82. package/android/ffmpeg_16kb/include/libavutil/dovi_meta.h +236 -0
  83. package/android/ffmpeg_16kb/include/libavutil/downmix_info.h +115 -0
  84. package/android/ffmpeg_16kb/include/libavutil/encryption_info.h +205 -0
  85. package/android/ffmpeg_16kb/include/libavutil/error.h +128 -0
  86. package/android/ffmpeg_16kb/include/libavutil/eval.h +140 -0
  87. package/android/ffmpeg_16kb/include/libavutil/ffversion.h +5 -0
  88. package/android/ffmpeg_16kb/include/libavutil/fifo.h +448 -0
  89. package/android/ffmpeg_16kb/include/libavutil/file.h +115 -0
  90. package/android/ffmpeg_16kb/include/libavutil/film_grain_params.h +260 -0
  91. package/android/ffmpeg_16kb/include/libavutil/frame.h +964 -0
  92. package/android/ffmpeg_16kb/include/libavutil/getenv_utf8.h +86 -0
  93. package/android/ffmpeg_16kb/include/libavutil/hash.h +264 -0
  94. package/android/ffmpeg_16kb/include/libavutil/hdr_dynamic_metadata.h +343 -0
  95. package/android/ffmpeg_16kb/include/libavutil/hdr_dynamic_vivid_metadata.h +285 -0
  96. package/android/ffmpeg_16kb/include/libavutil/hmac.h +99 -0
  97. package/android/ffmpeg_16kb/include/libavutil/hwcontext.h +610 -0
  98. package/android/ffmpeg_16kb/include/libavutil/hwcontext_cuda.h +69 -0
  99. package/android/ffmpeg_16kb/include/libavutil/hwcontext_d3d11va.h +178 -0
  100. package/android/ffmpeg_16kb/include/libavutil/hwcontext_drm.h +169 -0
  101. package/android/ffmpeg_16kb/include/libavutil/hwcontext_dxva2.h +75 -0
  102. package/android/ffmpeg_16kb/include/libavutil/hwcontext_mediacodec.h +61 -0
  103. package/android/ffmpeg_16kb/include/libavutil/hwcontext_opencl.h +100 -0
  104. package/android/ffmpeg_16kb/include/libavutil/hwcontext_qsv.h +64 -0
  105. package/android/ffmpeg_16kb/include/libavutil/hwcontext_vaapi.h +117 -0
  106. package/android/ffmpeg_16kb/include/libavutil/hwcontext_vdpau.h +44 -0
  107. package/android/ffmpeg_16kb/include/libavutil/hwcontext_videotoolbox.h +96 -0
  108. package/android/ffmpeg_16kb/include/libavutil/hwcontext_vulkan.h +281 -0
  109. package/android/ffmpeg_16kb/include/libavutil/imgutils.h +331 -0
  110. package/android/ffmpeg_16kb/include/libavutil/internal.h +190 -0
  111. package/android/ffmpeg_16kb/include/libavutil/intfloat.h +77 -0
  112. package/android/ffmpeg_16kb/include/libavutil/intreadwrite.h +644 -0
  113. package/android/ffmpeg_16kb/include/libavutil/lfg.h +81 -0
  114. package/android/ffmpeg_16kb/include/libavutil/libm.h +471 -0
  115. package/android/ffmpeg_16kb/include/libavutil/log.h +387 -0
  116. package/android/ffmpeg_16kb/include/libavutil/lzo.h +66 -0
  117. package/android/ffmpeg_16kb/include/libavutil/macros.h +80 -0
  118. package/android/ffmpeg_16kb/include/libavutil/mastering_display_metadata.h +128 -0
  119. package/android/ffmpeg_16kb/include/libavutil/mathematics.h +245 -0
  120. package/android/ffmpeg_16kb/include/libavutil/md5.h +89 -0
  121. package/android/ffmpeg_16kb/include/libavutil/mem.h +609 -0
  122. package/android/ffmpeg_16kb/include/libavutil/motion_vector.h +57 -0
  123. package/android/ffmpeg_16kb/include/libavutil/murmur3.h +115 -0
  124. package/android/ffmpeg_16kb/include/libavutil/opt.h +891 -0
  125. package/android/ffmpeg_16kb/include/libavutil/parseutils.h +197 -0
  126. package/android/ffmpeg_16kb/include/libavutil/pixdesc.h +435 -0
  127. package/android/ffmpeg_16kb/include/libavutil/pixelutils.h +51 -0
  128. package/android/ffmpeg_16kb/include/libavutil/pixfmt.h +691 -0
  129. package/android/ffmpeg_16kb/include/libavutil/random_seed.h +43 -0
  130. package/android/ffmpeg_16kb/include/libavutil/rational.h +221 -0
  131. package/android/ffmpeg_16kb/include/libavutil/rc4.h +69 -0
  132. package/android/ffmpeg_16kb/include/libavutil/replaygain.h +50 -0
  133. package/android/ffmpeg_16kb/include/libavutil/reverse.h +28 -0
  134. package/android/ffmpeg_16kb/include/libavutil/ripemd.h +83 -0
  135. package/android/ffmpeg_16kb/include/libavutil/samplefmt.h +269 -0
  136. package/android/ffmpeg_16kb/include/libavutil/sha.h +90 -0
  137. package/android/ffmpeg_16kb/include/libavutil/sha512.h +92 -0
  138. package/android/ffmpeg_16kb/include/libavutil/spherical.h +227 -0
  139. package/android/ffmpeg_16kb/include/libavutil/stereo3d.h +229 -0
  140. package/android/ffmpeg_16kb/include/libavutil/tea.h +71 -0
  141. package/android/ffmpeg_16kb/include/libavutil/thread.h +204 -0
  142. package/android/ffmpeg_16kb/include/libavutil/threadmessage.h +115 -0
  143. package/android/ffmpeg_16kb/include/libavutil/time.h +56 -0
  144. package/android/ffmpeg_16kb/include/libavutil/timecode.h +199 -0
  145. package/android/ffmpeg_16kb/include/libavutil/timer.h +156 -0
  146. package/android/ffmpeg_16kb/include/libavutil/timestamp.h +78 -0
  147. package/android/ffmpeg_16kb/include/libavutil/tree.h +137 -0
  148. package/android/ffmpeg_16kb/include/libavutil/twofish.h +70 -0
  149. package/android/ffmpeg_16kb/include/libavutil/tx.h +176 -0
  150. package/android/ffmpeg_16kb/include/libavutil/uuid.h +146 -0
  151. package/android/ffmpeg_16kb/include/libavutil/version.h +122 -0
  152. package/android/ffmpeg_16kb/include/libavutil/video_enc_params.h +171 -0
  153. package/android/ffmpeg_16kb/include/libavutil/x86/asm.h +154 -0
  154. package/android/ffmpeg_16kb/include/libavutil/x86/emms.h +58 -0
  155. package/android/ffmpeg_16kb/include/libavutil/x86/timer.h +50 -0
  156. package/android/ffmpeg_16kb/include/libavutil/xtea.h +94 -0
  157. package/android/ffmpeg_16kb/include/libswresample/swresample.h +650 -0
  158. package/android/ffmpeg_16kb/include/libswresample/version.h +46 -0
  159. package/android/ffmpeg_16kb/include/libswresample/version_major.h +31 -0
  160. package/android/ffmpeg_16kb/include/libswscale/swscale.h +436 -0
  161. package/android/ffmpeg_16kb/include/libswscale/version.h +44 -0
  162. package/android/ffmpeg_16kb/include/libswscale/version_major.h +35 -0
  163. package/android/ffmpeg_16kb/lib/arm64-v8a/libavcodec.so +0 -0
  164. package/android/ffmpeg_16kb/lib/arm64-v8a/libavdevice.so +0 -0
  165. package/android/ffmpeg_16kb/lib/arm64-v8a/libavfilter.so +0 -0
  166. package/android/ffmpeg_16kb/lib/arm64-v8a/libavformat.so +0 -0
  167. package/android/ffmpeg_16kb/lib/arm64-v8a/libavutil.so +0 -0
  168. package/android/ffmpeg_16kb/lib/arm64-v8a/libswresample.so +0 -0
  169. package/android/ffmpeg_16kb/lib/arm64-v8a/libswscale.so +0 -0
  170. package/android/ffmpeg_16kb/lib/armeabi-v7a/libavcodec_neon.so +0 -0
  171. package/android/ffmpeg_16kb/lib/armeabi-v7a/libavdevice_neon.so +0 -0
  172. package/android/ffmpeg_16kb/lib/armeabi-v7a/libavfilter_neon.so +0 -0
  173. package/android/ffmpeg_16kb/lib/armeabi-v7a/libavformat_neon.so +0 -0
  174. package/android/ffmpeg_16kb/lib/armeabi-v7a/libavutil_neon.so +0 -0
  175. package/android/ffmpeg_16kb/lib/armeabi-v7a/libswresample_neon.so +0 -0
  176. package/android/ffmpeg_16kb/lib/armeabi-v7a/libswscale_neon.so +0 -0
  177. package/android/ffmpeg_16kb/lib/x86/libavcodec.so +0 -0
  178. package/android/ffmpeg_16kb/lib/x86/libavdevice.so +0 -0
  179. package/android/ffmpeg_16kb/lib/x86/libavfilter.so +0 -0
  180. package/android/ffmpeg_16kb/lib/x86/libavformat.so +0 -0
  181. package/android/ffmpeg_16kb/lib/x86/libavutil.so +0 -0
  182. package/android/ffmpeg_16kb/lib/x86/libswresample.so +0 -0
  183. package/android/ffmpeg_16kb/lib/x86/libswscale.so +0 -0
  184. package/android/ffmpeg_16kb/lib/x86_64/libavcodec.so +0 -0
  185. package/android/ffmpeg_16kb/lib/x86_64/libavdevice.so +0 -0
  186. package/android/ffmpeg_16kb/lib/x86_64/libavfilter.so +0 -0
  187. package/android/ffmpeg_16kb/lib/x86_64/libavformat.so +0 -0
  188. package/android/ffmpeg_16kb/lib/x86_64/libavutil.so +0 -0
  189. package/android/ffmpeg_16kb/lib/x86_64/libswresample.so +0 -0
  190. package/android/ffmpeg_16kb/lib/x86_64/libswscale.so +0 -0
  191. package/android/gradle.properties +5 -0
  192. package/android/src/main/AndroidManifest.xml +3 -0
  193. package/android/src/main/AndroidManifestNew.xml +2 -0
  194. package/android/src/main/java/com/audioanalyzer/AmplitudeData.java +20 -0
  195. package/android/src/main/java/com/audioanalyzer/AudioAnalyzerModule.java +52 -0
  196. package/android/src/main/java/com/audioanalyzer/AudioAnalyzerPackage.java +28 -0
  197. package/cpp/react-native-audio-analyzer.cpp +143 -0
  198. package/cpp/react-native-audio-analyzer.h +27 -0
  199. package/ios/AudioAnalyzer.h +19 -0
  200. package/ios/AudioAnalyzer.mm +43 -0
  201. package/lib/commonjs/helpers.js +34 -0
  202. package/lib/commonjs/helpers.js.map +1 -0
  203. package/lib/commonjs/helpers.test.js +49 -0
  204. package/lib/commonjs/helpers.test.js.map +1 -0
  205. package/lib/commonjs/index.js +35 -0
  206. package/lib/commonjs/index.js.map +1 -0
  207. package/lib/module/helpers.js +27 -0
  208. package/lib/module/helpers.js.map +1 -0
  209. package/lib/module/helpers.test.js +47 -0
  210. package/lib/module/helpers.test.js.map +1 -0
  211. package/lib/module/index.js +15 -0
  212. package/lib/module/index.js.map +1 -0
  213. package/lib/typescript/src/helpers.d.ts +3 -0
  214. package/lib/typescript/src/helpers.d.ts.map +1 -0
  215. package/lib/typescript/src/helpers.test.d.ts +2 -0
  216. package/lib/typescript/src/helpers.test.d.ts.map +1 -0
  217. package/lib/typescript/src/index.d.ts +7 -0
  218. package/lib/typescript/src/index.d.ts.map +1 -0
  219. package/package.json +163 -0
  220. package/react-native-audio-analyzer.podspec +44 -0
  221. package/src/helpers.test.ts +59 -0
  222. package/src/helpers.ts +34 -0
  223. package/src/index.tsx +30 -0
@@ -0,0 +1,387 @@
1
+ /*
2
+ * copyright (c) 2006 Michael Niedermayer <michaelni@gmx.at>
3
+ *
4
+ * This file is part of FFmpeg.
5
+ *
6
+ * FFmpeg is free software; you can redistribute it and/or
7
+ * modify it under the terms of the GNU Lesser General Public
8
+ * License as published by the Free Software Foundation; either
9
+ * version 2.1 of the License, or (at your option) any later version.
10
+ *
11
+ * FFmpeg is distributed in the hope that it will be useful,
12
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14
+ * Lesser General Public License for more details.
15
+ *
16
+ * You should have received a copy of the GNU Lesser General Public
17
+ * License along with FFmpeg; if not, write to the Free Software
18
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19
+ */
20
+
21
+ #ifndef AVUTIL_LOG_H
22
+ #define AVUTIL_LOG_H
23
+
24
+ #include <stdarg.h>
25
+ #include "attributes.h"
26
+ #include "version.h"
27
+
28
+ typedef enum {
29
+ AV_CLASS_CATEGORY_NA = 0,
30
+ AV_CLASS_CATEGORY_INPUT,
31
+ AV_CLASS_CATEGORY_OUTPUT,
32
+ AV_CLASS_CATEGORY_MUXER,
33
+ AV_CLASS_CATEGORY_DEMUXER,
34
+ AV_CLASS_CATEGORY_ENCODER,
35
+ AV_CLASS_CATEGORY_DECODER,
36
+ AV_CLASS_CATEGORY_FILTER,
37
+ AV_CLASS_CATEGORY_BITSTREAM_FILTER,
38
+ AV_CLASS_CATEGORY_SWSCALER,
39
+ AV_CLASS_CATEGORY_SWRESAMPLER,
40
+ AV_CLASS_CATEGORY_DEVICE_VIDEO_OUTPUT = 40,
41
+ AV_CLASS_CATEGORY_DEVICE_VIDEO_INPUT,
42
+ AV_CLASS_CATEGORY_DEVICE_AUDIO_OUTPUT,
43
+ AV_CLASS_CATEGORY_DEVICE_AUDIO_INPUT,
44
+ AV_CLASS_CATEGORY_DEVICE_OUTPUT,
45
+ AV_CLASS_CATEGORY_DEVICE_INPUT,
46
+ AV_CLASS_CATEGORY_NB ///< not part of ABI/API
47
+ }AVClassCategory;
48
+
49
+ #define AV_IS_INPUT_DEVICE(category) \
50
+ (((category) == AV_CLASS_CATEGORY_DEVICE_VIDEO_INPUT) || \
51
+ ((category) == AV_CLASS_CATEGORY_DEVICE_AUDIO_INPUT) || \
52
+ ((category) == AV_CLASS_CATEGORY_DEVICE_INPUT))
53
+
54
+ #define AV_IS_OUTPUT_DEVICE(category) \
55
+ (((category) == AV_CLASS_CATEGORY_DEVICE_VIDEO_OUTPUT) || \
56
+ ((category) == AV_CLASS_CATEGORY_DEVICE_AUDIO_OUTPUT) || \
57
+ ((category) == AV_CLASS_CATEGORY_DEVICE_OUTPUT))
58
+
59
+ struct AVOptionRanges;
60
+
61
+ /**
62
+ * Describe the class of an AVClass context structure. That is an
63
+ * arbitrary struct of which the first field is a pointer to an
64
+ * AVClass struct (e.g. AVCodecContext, AVFormatContext etc.).
65
+ */
66
+ typedef struct AVClass {
67
+ /**
68
+ * The name of the class; usually it is the same name as the
69
+ * context structure type to which the AVClass is associated.
70
+ */
71
+ const char* class_name;
72
+
73
+ /**
74
+ * A pointer to a function which returns the name of a context
75
+ * instance ctx associated with the class.
76
+ */
77
+ const char* (*item_name)(void* ctx);
78
+
79
+ /**
80
+ * a pointer to the first option specified in the class if any or NULL
81
+ *
82
+ * @see av_set_default_options()
83
+ */
84
+ const struct AVOption *option;
85
+
86
+ /**
87
+ * LIBAVUTIL_VERSION with which this structure was created.
88
+ * This is used to allow fields to be added without requiring major
89
+ * version bumps everywhere.
90
+ */
91
+
92
+ int version;
93
+
94
+ /**
95
+ * Offset in the structure where log_level_offset is stored.
96
+ * 0 means there is no such variable
97
+ */
98
+ int log_level_offset_offset;
99
+
100
+ /**
101
+ * Offset in the structure where a pointer to the parent context for
102
+ * logging is stored. For example a decoder could pass its AVCodecContext
103
+ * to eval as such a parent context, which an av_log() implementation
104
+ * could then leverage to display the parent context.
105
+ * The offset can be NULL.
106
+ */
107
+ int parent_log_context_offset;
108
+
109
+ /**
110
+ * Category used for visualization (like color)
111
+ * This is only set if the category is equal for all objects using this class.
112
+ * available since version (51 << 16 | 56 << 8 | 100)
113
+ */
114
+ AVClassCategory category;
115
+
116
+ /**
117
+ * Callback to return the category.
118
+ * available since version (51 << 16 | 59 << 8 | 100)
119
+ */
120
+ AVClassCategory (*get_category)(void* ctx);
121
+
122
+ /**
123
+ * Callback to return the supported/allowed ranges.
124
+ * available since version (52.12)
125
+ */
126
+ int (*query_ranges)(struct AVOptionRanges **, void *obj, const char *key, int flags);
127
+
128
+ /**
129
+ * Return next AVOptions-enabled child or NULL
130
+ */
131
+ void* (*child_next)(void *obj, void *prev);
132
+
133
+ /**
134
+ * Iterate over the AVClasses corresponding to potential AVOptions-enabled
135
+ * children.
136
+ *
137
+ * @param iter pointer to opaque iteration state. The caller must initialize
138
+ * *iter to NULL before the first call.
139
+ * @return AVClass for the next AVOptions-enabled child or NULL if there are
140
+ * no more such children.
141
+ *
142
+ * @note The difference between child_next and this is that child_next
143
+ * iterates over _already existing_ objects, while child_class_iterate
144
+ * iterates over _all possible_ children.
145
+ */
146
+ const struct AVClass* (*child_class_iterate)(void **iter);
147
+ } AVClass;
148
+
149
+ /**
150
+ * @addtogroup lavu_log
151
+ *
152
+ * @{
153
+ *
154
+ * @defgroup lavu_log_constants Logging Constants
155
+ *
156
+ * @{
157
+ */
158
+
159
+ /**
160
+ * Print no output.
161
+ */
162
+ #define AV_LOG_QUIET -8
163
+
164
+ /**
165
+ * Something went really wrong and we will crash now.
166
+ */
167
+ #define AV_LOG_PANIC 0
168
+
169
+ /**
170
+ * Something went wrong and recovery is not possible.
171
+ * For example, no header was found for a format which depends
172
+ * on headers or an illegal combination of parameters is used.
173
+ */
174
+ #define AV_LOG_FATAL 8
175
+
176
+ /**
177
+ * Something went wrong and cannot losslessly be recovered.
178
+ * However, not all future data is affected.
179
+ */
180
+ #define AV_LOG_ERROR 16
181
+
182
+ /**
183
+ * Something somehow does not look correct. This may or may not
184
+ * lead to problems. An example would be the use of '-vstrict -2'.
185
+ */
186
+ #define AV_LOG_WARNING 24
187
+
188
+ /**
189
+ * Standard information.
190
+ */
191
+ #define AV_LOG_INFO 32
192
+
193
+ /**
194
+ * Detailed information.
195
+ */
196
+ #define AV_LOG_VERBOSE 40
197
+
198
+ /**
199
+ * Stuff which is only useful for libav* developers.
200
+ */
201
+ #define AV_LOG_DEBUG 48
202
+
203
+ /**
204
+ * Extremely verbose debugging, useful for libav* development.
205
+ */
206
+ #define AV_LOG_TRACE 56
207
+
208
+ #define AV_LOG_MAX_OFFSET (AV_LOG_TRACE - AV_LOG_QUIET)
209
+
210
+ /**
211
+ * @}
212
+ */
213
+
214
+ /**
215
+ * Sets additional colors for extended debugging sessions.
216
+ * @code
217
+ av_log(ctx, AV_LOG_DEBUG|AV_LOG_C(134), "Message in purple\n");
218
+ @endcode
219
+ * Requires 256color terminal support. Uses outside debugging is not
220
+ * recommended.
221
+ */
222
+ #define AV_LOG_C(x) ((x) << 8)
223
+
224
+ /**
225
+ * Send the specified message to the log if the level is less than or equal
226
+ * to the current av_log_level. By default, all logging messages are sent to
227
+ * stderr. This behavior can be altered by setting a different logging callback
228
+ * function.
229
+ * @see av_log_set_callback
230
+ *
231
+ * @param avcl A pointer to an arbitrary struct of which the first field is a
232
+ * pointer to an AVClass struct or NULL if general log.
233
+ * @param level The importance level of the message expressed using a @ref
234
+ * lavu_log_constants "Logging Constant".
235
+ * @param fmt The format string (printf-compatible) that specifies how
236
+ * subsequent arguments are converted to output.
237
+ */
238
+ void av_log(void *avcl, int level, const char *fmt, ...) av_printf_format(3, 4);
239
+
240
+ /**
241
+ * Send the specified message to the log once with the initial_level and then with
242
+ * the subsequent_level. By default, all logging messages are sent to
243
+ * stderr. This behavior can be altered by setting a different logging callback
244
+ * function.
245
+ * @see av_log
246
+ *
247
+ * @param avcl A pointer to an arbitrary struct of which the first field is a
248
+ * pointer to an AVClass struct or NULL if general log.
249
+ * @param initial_level importance level of the message expressed using a @ref
250
+ * lavu_log_constants "Logging Constant" for the first occurance.
251
+ * @param subsequent_level importance level of the message expressed using a @ref
252
+ * lavu_log_constants "Logging Constant" after the first occurance.
253
+ * @param fmt The format string (printf-compatible) that specifies how
254
+ * subsequent arguments are converted to output.
255
+ * @param state a variable to keep trak of if a message has already been printed
256
+ * this must be initialized to 0 before the first use. The same state
257
+ * must not be accessed by 2 Threads simultaneously.
258
+ */
259
+ void av_log_once(void* avcl, int initial_level, int subsequent_level, int *state, const char *fmt, ...) av_printf_format(5, 6);
260
+
261
+
262
+ /**
263
+ * Send the specified message to the log if the level is less than or equal
264
+ * to the current av_log_level. By default, all logging messages are sent to
265
+ * stderr. This behavior can be altered by setting a different logging callback
266
+ * function.
267
+ * @see av_log_set_callback
268
+ *
269
+ * @param avcl A pointer to an arbitrary struct of which the first field is a
270
+ * pointer to an AVClass struct.
271
+ * @param level The importance level of the message expressed using a @ref
272
+ * lavu_log_constants "Logging Constant".
273
+ * @param fmt The format string (printf-compatible) that specifies how
274
+ * subsequent arguments are converted to output.
275
+ * @param vl The arguments referenced by the format string.
276
+ */
277
+ void av_vlog(void *avcl, int level, const char *fmt, va_list vl);
278
+
279
+ /**
280
+ * Get the current log level
281
+ *
282
+ * @see lavu_log_constants
283
+ *
284
+ * @return Current log level
285
+ */
286
+ int av_log_get_level(void);
287
+
288
+ /**
289
+ * Set the log level
290
+ *
291
+ * @see lavu_log_constants
292
+ *
293
+ * @param level Logging level
294
+ */
295
+ void av_log_set_level(int level);
296
+
297
+ /**
298
+ * Set the logging callback
299
+ *
300
+ * @note The callback must be thread safe, even if the application does not use
301
+ * threads itself as some codecs are multithreaded.
302
+ *
303
+ * @see av_log_default_callback
304
+ *
305
+ * @param callback A logging function with a compatible signature.
306
+ */
307
+ void av_log_set_callback(void (*callback)(void*, int, const char*, va_list));
308
+
309
+ /**
310
+ * Default logging callback
311
+ *
312
+ * It prints the message to stderr, optionally colorizing it.
313
+ *
314
+ * @param avcl A pointer to an arbitrary struct of which the first field is a
315
+ * pointer to an AVClass struct.
316
+ * @param level The importance level of the message expressed using a @ref
317
+ * lavu_log_constants "Logging Constant".
318
+ * @param fmt The format string (printf-compatible) that specifies how
319
+ * subsequent arguments are converted to output.
320
+ * @param vl The arguments referenced by the format string.
321
+ */
322
+ void av_log_default_callback(void *avcl, int level, const char *fmt,
323
+ va_list vl);
324
+
325
+ /**
326
+ * Return the context name
327
+ *
328
+ * @param ctx The AVClass context
329
+ *
330
+ * @return The AVClass class_name
331
+ */
332
+ const char* av_default_item_name(void* ctx);
333
+ AVClassCategory av_default_get_category(void *ptr);
334
+
335
+ /**
336
+ * Format a line of log the same way as the default callback.
337
+ * @param line buffer to receive the formatted line
338
+ * @param line_size size of the buffer
339
+ * @param print_prefix used to store whether the prefix must be printed;
340
+ * must point to a persistent integer initially set to 1
341
+ */
342
+ void av_log_format_line(void *ptr, int level, const char *fmt, va_list vl,
343
+ char *line, int line_size, int *print_prefix);
344
+
345
+ /**
346
+ * Format a line of log the same way as the default callback.
347
+ * @param line buffer to receive the formatted line;
348
+ * may be NULL if line_size is 0
349
+ * @param line_size size of the buffer; at most line_size-1 characters will
350
+ * be written to the buffer, plus one null terminator
351
+ * @param print_prefix used to store whether the prefix must be printed;
352
+ * must point to a persistent integer initially set to 1
353
+ * @return Returns a negative value if an error occurred, otherwise returns
354
+ * the number of characters that would have been written for a
355
+ * sufficiently large buffer, not including the terminating null
356
+ * character. If the return value is not less than line_size, it means
357
+ * that the log message was truncated to fit the buffer.
358
+ */
359
+ int av_log_format_line2(void *ptr, int level, const char *fmt, va_list vl,
360
+ char *line, int line_size, int *print_prefix);
361
+
362
+ /**
363
+ * Skip repeated messages, this requires the user app to use av_log() instead of
364
+ * (f)printf as the 2 would otherwise interfere and lead to
365
+ * "Last message repeated x times" messages below (f)printf messages with some
366
+ * bad luck.
367
+ * Also to receive the last, "last repeated" line if any, the user app must
368
+ * call av_log(NULL, AV_LOG_QUIET, "%s", ""); at the end
369
+ */
370
+ #define AV_LOG_SKIP_REPEATED 1
371
+
372
+ /**
373
+ * Include the log severity in messages originating from codecs.
374
+ *
375
+ * Results in messages such as:
376
+ * [rawvideo @ 0xDEADBEEF] [error] encode did not produce valid pts
377
+ */
378
+ #define AV_LOG_PRINT_LEVEL 2
379
+
380
+ void av_log_set_flags(int arg);
381
+ int av_log_get_flags(void);
382
+
383
+ /**
384
+ * @}
385
+ */
386
+
387
+ #endif /* AVUTIL_LOG_H */
@@ -0,0 +1,66 @@
1
+ /*
2
+ * LZO 1x decompression
3
+ * copyright (c) 2006 Reimar Doeffinger
4
+ *
5
+ * This file is part of FFmpeg.
6
+ *
7
+ * FFmpeg is free software; you can redistribute it and/or
8
+ * modify it under the terms of the GNU Lesser General Public
9
+ * License as published by the Free Software Foundation; either
10
+ * version 2.1 of the License, or (at your option) any later version.
11
+ *
12
+ * FFmpeg is distributed in the hope that it will be useful,
13
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15
+ * Lesser General Public License for more details.
16
+ *
17
+ * You should have received a copy of the GNU Lesser General Public
18
+ * License along with FFmpeg; if not, write to the Free Software
19
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20
+ */
21
+
22
+ #ifndef AVUTIL_LZO_H
23
+ #define AVUTIL_LZO_H
24
+
25
+ /**
26
+ * @defgroup lavu_lzo LZO
27
+ * @ingroup lavu_crypto
28
+ *
29
+ * @{
30
+ */
31
+
32
+ #include <stdint.h>
33
+
34
+ /** @name Error flags returned by av_lzo1x_decode
35
+ * @{ */
36
+ /// end of the input buffer reached before decoding finished
37
+ #define AV_LZO_INPUT_DEPLETED 1
38
+ /// decoded data did not fit into output buffer
39
+ #define AV_LZO_OUTPUT_FULL 2
40
+ /// a reference to previously decoded data was wrong
41
+ #define AV_LZO_INVALID_BACKPTR 4
42
+ /// a non-specific error in the compressed bitstream
43
+ #define AV_LZO_ERROR 8
44
+ /** @} */
45
+
46
+ #define AV_LZO_INPUT_PADDING 8
47
+ #define AV_LZO_OUTPUT_PADDING 12
48
+
49
+ /**
50
+ * @brief Decodes LZO 1x compressed data.
51
+ * @param out output buffer
52
+ * @param outlen size of output buffer, number of bytes left are returned here
53
+ * @param in input buffer
54
+ * @param inlen size of input buffer, number of bytes left are returned here
55
+ * @return 0 on success, otherwise a combination of the error flags above
56
+ *
57
+ * Make sure all buffers are appropriately padded, in must provide
58
+ * AV_LZO_INPUT_PADDING, out must provide AV_LZO_OUTPUT_PADDING additional bytes.
59
+ */
60
+ int av_lzo1x_decode(void *out, int *outlen, const void *in, int *inlen);
61
+
62
+ /**
63
+ * @}
64
+ */
65
+
66
+ #endif /* AVUTIL_LZO_H */
@@ -0,0 +1,80 @@
1
+ /*
2
+ * This file is part of FFmpeg.
3
+ *
4
+ * FFmpeg is free software; you can redistribute it and/or
5
+ * modify it under the terms of the GNU Lesser General Public
6
+ * License as published by the Free Software Foundation; either
7
+ * version 2.1 of the License, or (at your option) any later version.
8
+ *
9
+ * FFmpeg is distributed in the hope that it will be useful,
10
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12
+ * Lesser General Public License for more details.
13
+ *
14
+ * You should have received a copy of the GNU Lesser General Public
15
+ * License along with FFmpeg; if not, write to the Free Software
16
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17
+ */
18
+
19
+ /**
20
+ * @file
21
+ * @ingroup lavu
22
+ * Utility Preprocessor macros
23
+ */
24
+
25
+ #ifndef AVUTIL_MACROS_H
26
+ #define AVUTIL_MACROS_H
27
+
28
+ #include "libavutil/avconfig.h"
29
+
30
+ #if AV_HAVE_BIGENDIAN
31
+ # define AV_NE(be, le) (be)
32
+ #else
33
+ # define AV_NE(be, le) (le)
34
+ #endif
35
+
36
+ /**
37
+ * Comparator.
38
+ * For two numerical expressions x and y, gives 1 if x > y, -1 if x < y, and 0
39
+ * if x == y. This is useful for instance in a qsort comparator callback.
40
+ * Furthermore, compilers are able to optimize this to branchless code, and
41
+ * there is no risk of overflow with signed types.
42
+ * As with many macros, this evaluates its argument multiple times, it thus
43
+ * must not have a side-effect.
44
+ */
45
+ #define FFDIFFSIGN(x,y) (((x)>(y)) - ((x)<(y)))
46
+
47
+ #define FFMAX(a,b) ((a) > (b) ? (a) : (b))
48
+ #define FFMAX3(a,b,c) FFMAX(FFMAX(a,b),c)
49
+ #define FFMIN(a,b) ((a) > (b) ? (b) : (a))
50
+ #define FFMIN3(a,b,c) FFMIN(FFMIN(a,b),c)
51
+
52
+ #define FFSWAP(type,a,b) do{type SWAP_tmp= b; b= a; a= SWAP_tmp;}while(0)
53
+ #define FF_ARRAY_ELEMS(a) (sizeof(a) / sizeof((a)[0]))
54
+
55
+ #define MKTAG(a,b,c,d) ((a) | ((b) << 8) | ((c) << 16) | ((unsigned)(d) << 24))
56
+ #define MKBETAG(a,b,c,d) ((d) | ((c) << 8) | ((b) << 16) | ((unsigned)(a) << 24))
57
+
58
+ /**
59
+ * @addtogroup preproc_misc Preprocessor String Macros
60
+ *
61
+ * String manipulation macros
62
+ *
63
+ * @{
64
+ */
65
+
66
+ #define AV_STRINGIFY(s) AV_TOSTRING(s)
67
+ #define AV_TOSTRING(s) #s
68
+
69
+ #define AV_GLUE(a, b) a ## b
70
+ #define AV_JOIN(a, b) AV_GLUE(a, b)
71
+
72
+ /**
73
+ * @}
74
+ */
75
+
76
+ #define AV_PRAGMA(s) _Pragma(#s)
77
+
78
+ #define FFALIGN(x, a) (((x)+(a)-1)&~((a)-1))
79
+
80
+ #endif /* AVUTIL_MACROS_H */
@@ -0,0 +1,128 @@
1
+ /*
2
+ * Copyright (c) 2016 Neil Birkbeck <neil.birkbeck@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_MASTERING_DISPLAY_METADATA_H
22
+ #define AVUTIL_MASTERING_DISPLAY_METADATA_H
23
+
24
+ #include "frame.h"
25
+ #include "rational.h"
26
+
27
+
28
+ /**
29
+ * Mastering display metadata capable of representing the color volume of
30
+ * the display used to master the content (SMPTE 2086:2014).
31
+ *
32
+ * To be used as payload of a AVFrameSideData or AVPacketSideData with the
33
+ * appropriate type.
34
+ *
35
+ * @note The struct should be allocated with av_mastering_display_metadata_alloc()
36
+ * and its size is not a part of the public ABI.
37
+ */
38
+ typedef struct AVMasteringDisplayMetadata {
39
+ /**
40
+ * CIE 1931 xy chromaticity coords of color primaries (r, g, b order).
41
+ */
42
+ AVRational display_primaries[3][2];
43
+
44
+ /**
45
+ * CIE 1931 xy chromaticity coords of white point.
46
+ */
47
+ AVRational white_point[2];
48
+
49
+ /**
50
+ * Min luminance of mastering display (cd/m^2).
51
+ */
52
+ AVRational min_luminance;
53
+
54
+ /**
55
+ * Max luminance of mastering display (cd/m^2).
56
+ */
57
+ AVRational max_luminance;
58
+
59
+ /**
60
+ * Flag indicating whether the display primaries (and white point) are set.
61
+ */
62
+ int has_primaries;
63
+
64
+ /**
65
+ * Flag indicating whether the luminance (min_ and max_) have been set.
66
+ */
67
+ int has_luminance;
68
+
69
+ } AVMasteringDisplayMetadata;
70
+
71
+ /**
72
+ * Allocate an AVMasteringDisplayMetadata structure and set its fields to
73
+ * default values. The resulting struct can be freed using av_freep().
74
+ *
75
+ * @return An AVMasteringDisplayMetadata filled with default values or NULL
76
+ * on failure.
77
+ */
78
+ AVMasteringDisplayMetadata *av_mastering_display_metadata_alloc(void);
79
+
80
+ /**
81
+ * Allocate a complete AVMasteringDisplayMetadata and add it to the frame.
82
+ *
83
+ * @param frame The frame which side data is added to.
84
+ *
85
+ * @return The AVMasteringDisplayMetadata structure to be filled by caller.
86
+ */
87
+ AVMasteringDisplayMetadata *av_mastering_display_metadata_create_side_data(AVFrame *frame);
88
+
89
+ /**
90
+ * Content light level needed by to transmit HDR over HDMI (CTA-861.3).
91
+ *
92
+ * To be used as payload of a AVFrameSideData or AVPacketSideData with the
93
+ * appropriate type.
94
+ *
95
+ * @note The struct should be allocated with av_content_light_metadata_alloc()
96
+ * and its size is not a part of the public ABI.
97
+ */
98
+ typedef struct AVContentLightMetadata {
99
+ /**
100
+ * Max content light level (cd/m^2).
101
+ */
102
+ unsigned MaxCLL;
103
+
104
+ /**
105
+ * Max average light level per frame (cd/m^2).
106
+ */
107
+ unsigned MaxFALL;
108
+ } AVContentLightMetadata;
109
+
110
+ /**
111
+ * Allocate an AVContentLightMetadata structure and set its fields to
112
+ * default values. The resulting struct can be freed using av_freep().
113
+ *
114
+ * @return An AVContentLightMetadata filled with default values or NULL
115
+ * on failure.
116
+ */
117
+ AVContentLightMetadata *av_content_light_metadata_alloc(size_t *size);
118
+
119
+ /**
120
+ * Allocate a complete AVContentLightMetadata and add it to the frame.
121
+ *
122
+ * @param frame The frame which side data is added to.
123
+ *
124
+ * @return The AVContentLightMetadata structure to be filled by caller.
125
+ */
126
+ AVContentLightMetadata *av_content_light_metadata_create_side_data(AVFrame *frame);
127
+
128
+ #endif /* AVUTIL_MASTERING_DISPLAY_METADATA_H */