@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,109 @@
1
+ /*
2
+ * Intel MediaSDK QSV public API
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 AVCODEC_QSV_H
22
+ #define AVCODEC_QSV_H
23
+
24
+ #include <mfxvideo.h>
25
+
26
+ #include "libavutil/buffer.h"
27
+
28
+ /**
29
+ * This struct is used for communicating QSV parameters between libavcodec and
30
+ * the caller. It is managed by the caller and must be assigned to
31
+ * AVCodecContext.hwaccel_context.
32
+ * - decoding: hwaccel_context must be set on return from the get_format()
33
+ * callback
34
+ * - encoding: hwaccel_context must be set before avcodec_open2()
35
+ */
36
+ typedef struct AVQSVContext {
37
+ /**
38
+ * If non-NULL, the session to use for encoding or decoding.
39
+ * Otherwise, libavcodec will try to create an internal session.
40
+ */
41
+ mfxSession session;
42
+
43
+ /**
44
+ * The IO pattern to use.
45
+ */
46
+ int iopattern;
47
+
48
+ /**
49
+ * Extra buffers to pass to encoder or decoder initialization.
50
+ */
51
+ mfxExtBuffer **ext_buffers;
52
+ int nb_ext_buffers;
53
+
54
+ /**
55
+ * Encoding only. If this field is set to non-zero by the caller, libavcodec
56
+ * will create an mfxExtOpaqueSurfaceAlloc extended buffer and pass it to
57
+ * the encoder initialization. This only makes sense if iopattern is also
58
+ * set to MFX_IOPATTERN_IN_OPAQUE_MEMORY.
59
+ *
60
+ * The number of allocated opaque surfaces will be the sum of the number
61
+ * required by the encoder and the user-provided value nb_opaque_surfaces.
62
+ * The array of the opaque surfaces will be exported to the caller through
63
+ * the opaque_surfaces field.
64
+ *
65
+ * The caller must set this field to zero for oneVPL (MFX_VERSION >= 2.0)
66
+ */
67
+ int opaque_alloc;
68
+
69
+ /**
70
+ * Encoding only, and only if opaque_alloc is set to non-zero. Before
71
+ * calling avcodec_open2(), the caller should set this field to the number
72
+ * of extra opaque surfaces to allocate beyond what is required by the
73
+ * encoder.
74
+ *
75
+ * On return from avcodec_open2(), this field will be set by libavcodec to
76
+ * the total number of allocated opaque surfaces.
77
+ */
78
+ int nb_opaque_surfaces;
79
+
80
+ /**
81
+ * Encoding only, and only if opaque_alloc is set to non-zero. On return
82
+ * from avcodec_open2(), this field will be used by libavcodec to export the
83
+ * array of the allocated opaque surfaces to the caller, so they can be
84
+ * passed to other parts of the pipeline.
85
+ *
86
+ * The buffer reference exported here is owned and managed by libavcodec,
87
+ * the callers should make their own reference with av_buffer_ref() and free
88
+ * it with av_buffer_unref() when it is no longer needed.
89
+ *
90
+ * The buffer data is an nb_opaque_surfaces-sized array of mfxFrameSurface1.
91
+ */
92
+ AVBufferRef *opaque_surfaces;
93
+
94
+ /**
95
+ * Encoding only, and only if opaque_alloc is set to non-zero. On return
96
+ * from avcodec_open2(), this field will be set to the surface type used in
97
+ * the opaque allocation request.
98
+ */
99
+ int opaque_alloc_type;
100
+ } AVQSVContext;
101
+
102
+ /**
103
+ * Allocate a new context.
104
+ *
105
+ * It must be freed by the caller with av_free().
106
+ */
107
+ AVQSVContext *av_qsv_alloc_context(void);
108
+
109
+ #endif /* AVCODEC_QSV_H */
@@ -0,0 +1,157 @@
1
+ /*
2
+ * The Video Decode and Presentation API for UNIX (VDPAU) is used for
3
+ * hardware-accelerated decoding of MPEG-1/2, H.264 and VC-1.
4
+ *
5
+ * Copyright (C) 2008 NVIDIA
6
+ *
7
+ * This file is part of FFmpeg.
8
+ *
9
+ * FFmpeg is free software; you can redistribute it and/or
10
+ * modify it under the terms of the GNU Lesser General Public
11
+ * License as published by the Free Software Foundation; either
12
+ * version 2.1 of the License, or (at your option) any later version.
13
+ *
14
+ * FFmpeg is distributed in the hope that it will be useful,
15
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
16
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17
+ * Lesser General Public License for more details.
18
+ *
19
+ * You should have received a copy of the GNU Lesser General Public
20
+ * License along with FFmpeg; if not, write to the Free Software
21
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
22
+ */
23
+
24
+ #ifndef AVCODEC_VDPAU_H
25
+ #define AVCODEC_VDPAU_H
26
+
27
+ /**
28
+ * @file
29
+ * @ingroup lavc_codec_hwaccel_vdpau
30
+ * Public libavcodec VDPAU header.
31
+ */
32
+
33
+
34
+ /**
35
+ * @defgroup lavc_codec_hwaccel_vdpau VDPAU Decoder and Renderer
36
+ * @ingroup lavc_codec_hwaccel
37
+ *
38
+ * VDPAU hardware acceleration has two modules
39
+ * - VDPAU decoding
40
+ * - VDPAU presentation
41
+ *
42
+ * The VDPAU decoding module parses all headers using FFmpeg
43
+ * parsing mechanisms and uses VDPAU for the actual decoding.
44
+ *
45
+ * As per the current implementation, the actual decoding
46
+ * and rendering (API calls) are done as part of the VDPAU
47
+ * presentation (vo_vdpau.c) module.
48
+ *
49
+ * @{
50
+ */
51
+
52
+ #include <vdpau/vdpau.h>
53
+
54
+ #include "libavutil/avconfig.h"
55
+ #include "libavutil/attributes.h"
56
+
57
+ #include "avcodec.h"
58
+
59
+ struct AVCodecContext;
60
+ struct AVFrame;
61
+
62
+ typedef int (*AVVDPAU_Render2)(struct AVCodecContext *, struct AVFrame *,
63
+ const VdpPictureInfo *, uint32_t,
64
+ const VdpBitstreamBuffer *);
65
+
66
+ /**
67
+ * This structure is used to share data between the libavcodec library and
68
+ * the client video application.
69
+ * The user shall allocate the structure via the av_alloc_vdpau_hwaccel
70
+ * function and make it available as
71
+ * AVCodecContext.hwaccel_context. Members can be set by the user once
72
+ * during initialization or through each AVCodecContext.get_buffer()
73
+ * function call. In any case, they must be valid prior to calling
74
+ * decoding functions.
75
+ *
76
+ * The size of this structure is not a part of the public ABI and must not
77
+ * be used outside of libavcodec. Use av_vdpau_alloc_context() to allocate an
78
+ * AVVDPAUContext.
79
+ */
80
+ typedef struct AVVDPAUContext {
81
+ /**
82
+ * VDPAU decoder handle
83
+ *
84
+ * Set by user.
85
+ */
86
+ VdpDecoder decoder;
87
+
88
+ /**
89
+ * VDPAU decoder render callback
90
+ *
91
+ * Set by the user.
92
+ */
93
+ VdpDecoderRender *render;
94
+
95
+ AVVDPAU_Render2 render2;
96
+ } AVVDPAUContext;
97
+
98
+ /**
99
+ * @brief allocation function for AVVDPAUContext
100
+ *
101
+ * Allows extending the struct without breaking API/ABI
102
+ */
103
+ AVVDPAUContext *av_alloc_vdpaucontext(void);
104
+
105
+ AVVDPAU_Render2 av_vdpau_hwaccel_get_render2(const AVVDPAUContext *);
106
+ void av_vdpau_hwaccel_set_render2(AVVDPAUContext *, AVVDPAU_Render2);
107
+
108
+ /**
109
+ * Associate a VDPAU device with a codec context for hardware acceleration.
110
+ * This function is meant to be called from the get_format() codec callback,
111
+ * or earlier. It can also be called after avcodec_flush_buffers() to change
112
+ * the underlying VDPAU device mid-stream (e.g. to recover from non-transparent
113
+ * display preemption).
114
+ *
115
+ * @note get_format() must return AV_PIX_FMT_VDPAU if this function completes
116
+ * successfully.
117
+ *
118
+ * @param avctx decoding context whose get_format() callback is invoked
119
+ * @param device VDPAU device handle to use for hardware acceleration
120
+ * @param get_proc_address VDPAU device driver
121
+ * @param flags zero of more OR'd AV_HWACCEL_FLAG_* flags
122
+ *
123
+ * @return 0 on success, an AVERROR code on failure.
124
+ */
125
+ int av_vdpau_bind_context(AVCodecContext *avctx, VdpDevice device,
126
+ VdpGetProcAddress *get_proc_address, unsigned flags);
127
+
128
+ /**
129
+ * Gets the parameters to create an adequate VDPAU video surface for the codec
130
+ * context using VDPAU hardware decoding acceleration.
131
+ *
132
+ * @note Behavior is undefined if the context was not successfully bound to a
133
+ * VDPAU device using av_vdpau_bind_context().
134
+ *
135
+ * @param avctx the codec context being used for decoding the stream
136
+ * @param type storage space for the VDPAU video surface chroma type
137
+ * (or NULL to ignore)
138
+ * @param width storage space for the VDPAU video surface pixel width
139
+ * (or NULL to ignore)
140
+ * @param height storage space for the VDPAU video surface pixel height
141
+ * (or NULL to ignore)
142
+ *
143
+ * @return 0 on success, a negative AVERROR code on failure.
144
+ */
145
+ int av_vdpau_get_surface_parameters(AVCodecContext *avctx, VdpChromaType *type,
146
+ uint32_t *width, uint32_t *height);
147
+
148
+ /**
149
+ * Allocate an AVVDPAUContext.
150
+ *
151
+ * @return Newly-allocated AVVDPAUContext or NULL on failure.
152
+ */
153
+ AVVDPAUContext *av_vdpau_alloc_context(void);
154
+
155
+ /** @} */
156
+
157
+ #endif /* AVCODEC_VDPAU_H */
@@ -0,0 +1,45 @@
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 AVCODEC_VERSION_H
20
+ #define AVCODEC_VERSION_H
21
+
22
+ /**
23
+ * @file
24
+ * @ingroup libavc
25
+ * Libavcodec version macros.
26
+ */
27
+
28
+ #include "libavutil/version.h"
29
+
30
+ #include "version_major.h"
31
+
32
+ #define LIBAVCODEC_VERSION_MINOR 3
33
+ #define LIBAVCODEC_VERSION_MICRO 100
34
+
35
+ #define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
36
+ LIBAVCODEC_VERSION_MINOR, \
37
+ LIBAVCODEC_VERSION_MICRO)
38
+ #define LIBAVCODEC_VERSION AV_VERSION(LIBAVCODEC_VERSION_MAJOR, \
39
+ LIBAVCODEC_VERSION_MINOR, \
40
+ LIBAVCODEC_VERSION_MICRO)
41
+ #define LIBAVCODEC_BUILD LIBAVCODEC_VERSION_INT
42
+
43
+ #define LIBAVCODEC_IDENT "Lavc" AV_STRINGIFY(LIBAVCODEC_VERSION)
44
+
45
+ #endif /* AVCODEC_VERSION_H */
@@ -0,0 +1,52 @@
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 AVCODEC_VERSION_MAJOR_H
20
+ #define AVCODEC_VERSION_MAJOR_H
21
+
22
+ /**
23
+ * @file
24
+ * @ingroup libavc
25
+ * Libavcodec version macros.
26
+ */
27
+
28
+ #define LIBAVCODEC_VERSION_MAJOR 60
29
+
30
+ /**
31
+ * FF_API_* defines may be placed below to indicate public API that will be
32
+ * dropped at a future version bump. The defines themselves are not part of
33
+ * the public API and may change, break or disappear at any time.
34
+ *
35
+ * @note, when bumping the major version it is recommended to manually
36
+ * disable each FF_API_* in its own commit instead of disabling them all
37
+ * at once through the bump. This improves the git bisect-ability of the change.
38
+ */
39
+
40
+ #define FF_API_INIT_PACKET (LIBAVCODEC_VERSION_MAJOR < 61)
41
+ #define FF_API_IDCT_NONE (LIBAVCODEC_VERSION_MAJOR < 61)
42
+ #define FF_API_SVTAV1_OPTS (LIBAVCODEC_VERSION_MAJOR < 61)
43
+ #define FF_API_AYUV_CODECID (LIBAVCODEC_VERSION_MAJOR < 61)
44
+ #define FF_API_VT_OUTPUT_CALLBACK (LIBAVCODEC_VERSION_MAJOR < 61)
45
+ #define FF_API_AVCODEC_CHROMA_POS (LIBAVCODEC_VERSION_MAJOR < 61)
46
+ #define FF_API_VT_HWACCEL_CONTEXT (LIBAVCODEC_VERSION_MAJOR < 61)
47
+ #define FF_API_AVCTX_FRAME_NUMBER (LIBAVCODEC_VERSION_MAJOR < 61)
48
+
49
+ // reminder to remove CrystalHD decoders on next major bump
50
+ #define FF_CODEC_CRYSTAL_HD (LIBAVCODEC_VERSION_MAJOR < 61)
51
+
52
+ #endif /* AVCODEC_VERSION_MAJOR_H */
@@ -0,0 +1,150 @@
1
+ /*
2
+ * Videotoolbox hardware acceleration
3
+ *
4
+ * copyright (c) 2012 Sebastien Zwickert
5
+ *
6
+ * This file is part of FFmpeg.
7
+ *
8
+ * FFmpeg is free software; you can redistribute it and/or
9
+ * modify it under the terms of the GNU Lesser General Public
10
+ * License as published by the Free Software Foundation; either
11
+ * version 2.1 of the License, or (at your option) any later version.
12
+ *
13
+ * FFmpeg is distributed in the hope that it will be useful,
14
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16
+ * Lesser General Public License for more details.
17
+ *
18
+ * You should have received a copy of the GNU Lesser General Public
19
+ * License along with FFmpeg; if not, write to the Free Software
20
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21
+ */
22
+
23
+ #ifndef AVCODEC_VIDEOTOOLBOX_H
24
+ #define AVCODEC_VIDEOTOOLBOX_H
25
+
26
+ /**
27
+ * @file
28
+ * @ingroup lavc_codec_hwaccel_videotoolbox
29
+ * Public libavcodec Videotoolbox header.
30
+ */
31
+
32
+ /**
33
+ * @defgroup lavc_codec_hwaccel_videotoolbox VideoToolbox Decoder
34
+ * @ingroup lavc_codec_hwaccel
35
+ *
36
+ * Hardware accelerated decoding using VideoToolbox on Apple Platforms
37
+ *
38
+ * @{
39
+ */
40
+
41
+ #include <stdint.h>
42
+
43
+ #define Picture QuickdrawPicture
44
+ #include <VideoToolbox/VideoToolbox.h>
45
+ #undef Picture
46
+
47
+ #include "libavcodec/avcodec.h"
48
+
49
+ #include "libavutil/attributes.h"
50
+
51
+ /**
52
+ * This struct holds all the information that needs to be passed
53
+ * between the caller and libavcodec for initializing Videotoolbox decoding.
54
+ * Its size is not a part of the public ABI, it must be allocated with
55
+ * av_videotoolbox_alloc_context() and freed with av_free().
56
+ */
57
+ typedef struct AVVideotoolboxContext {
58
+ /**
59
+ * Videotoolbox decompression session object.
60
+ */
61
+ VTDecompressionSessionRef session;
62
+
63
+ #if FF_API_VT_OUTPUT_CALLBACK
64
+ /**
65
+ * The output callback that must be passed to the session.
66
+ * Set by av_videottoolbox_default_init()
67
+ */
68
+ attribute_deprecated
69
+ VTDecompressionOutputCallback output_callback;
70
+ #endif
71
+
72
+ /**
73
+ * CVPixelBuffer Format Type that Videotoolbox will use for decoded frames.
74
+ * set by the caller. If this is set to 0, then no specific format is
75
+ * requested from the decoder, and its native format is output.
76
+ */
77
+ OSType cv_pix_fmt_type;
78
+
79
+ /**
80
+ * CoreMedia Format Description that Videotoolbox will use to create the decompression session.
81
+ */
82
+ CMVideoFormatDescriptionRef cm_fmt_desc;
83
+
84
+ /**
85
+ * CoreMedia codec type that Videotoolbox will use to create the decompression session.
86
+ */
87
+ int cm_codec_type;
88
+ } AVVideotoolboxContext;
89
+
90
+ #if FF_API_VT_HWACCEL_CONTEXT
91
+
92
+ /**
93
+ * Allocate and initialize a Videotoolbox context.
94
+ *
95
+ * This function should be called from the get_format() callback when the caller
96
+ * selects the AV_PIX_FMT_VIDETOOLBOX format. The caller must then create
97
+ * the decoder object (using the output callback provided by libavcodec) that
98
+ * will be used for Videotoolbox-accelerated decoding.
99
+ *
100
+ * When decoding with Videotoolbox is finished, the caller must destroy the decoder
101
+ * object and free the Videotoolbox context using av_free().
102
+ *
103
+ * @return the newly allocated context or NULL on failure
104
+ * @deprecated Use AVCodecContext.hw_frames_ctx or hw_device_ctx instead.
105
+ */
106
+ attribute_deprecated
107
+ AVVideotoolboxContext *av_videotoolbox_alloc_context(void);
108
+
109
+ /**
110
+ * This is a convenience function that creates and sets up the Videotoolbox context using
111
+ * an internal implementation.
112
+ *
113
+ * @param avctx the corresponding codec context
114
+ *
115
+ * @return >= 0 on success, a negative AVERROR code on failure
116
+ * @deprecated Use AVCodecContext.hw_frames_ctx or hw_device_ctx instead.
117
+ */
118
+ attribute_deprecated
119
+ int av_videotoolbox_default_init(AVCodecContext *avctx);
120
+
121
+ /**
122
+ * This is a convenience function that creates and sets up the Videotoolbox context using
123
+ * an internal implementation.
124
+ *
125
+ * @param avctx the corresponding codec context
126
+ * @param vtctx the Videotoolbox context to use
127
+ *
128
+ * @return >= 0 on success, a negative AVERROR code on failure
129
+ * @deprecated Use AVCodecContext.hw_frames_ctx or hw_device_ctx instead.
130
+ */
131
+ attribute_deprecated
132
+ int av_videotoolbox_default_init2(AVCodecContext *avctx, AVVideotoolboxContext *vtctx);
133
+
134
+ /**
135
+ * This function must be called to free the Videotoolbox context initialized with
136
+ * av_videotoolbox_default_init().
137
+ *
138
+ * @param avctx the corresponding codec context
139
+ * @deprecated Use AVCodecContext.hw_frames_ctx or hw_device_ctx instead.
140
+ */
141
+ attribute_deprecated
142
+ void av_videotoolbox_default_free(AVCodecContext *avctx);
143
+
144
+ #endif /* FF_API_VT_HWACCEL_CONTEXT */
145
+
146
+ /**
147
+ * @}
148
+ */
149
+
150
+ #endif /* AVCODEC_VIDEOTOOLBOX_H */
@@ -0,0 +1,74 @@
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
+ * A public API for Vorbis parsing
22
+ *
23
+ * Determines the duration for each packet.
24
+ */
25
+
26
+ #ifndef AVCODEC_VORBIS_PARSER_H
27
+ #define AVCODEC_VORBIS_PARSER_H
28
+
29
+ #include <stdint.h>
30
+
31
+ typedef struct AVVorbisParseContext AVVorbisParseContext;
32
+
33
+ /**
34
+ * Allocate and initialize the Vorbis parser using headers in the extradata.
35
+ */
36
+ AVVorbisParseContext *av_vorbis_parse_init(const uint8_t *extradata,
37
+ int extradata_size);
38
+
39
+ /**
40
+ * Free the parser and everything associated with it.
41
+ */
42
+ void av_vorbis_parse_free(AVVorbisParseContext **s);
43
+
44
+ #define VORBIS_FLAG_HEADER 0x00000001
45
+ #define VORBIS_FLAG_COMMENT 0x00000002
46
+ #define VORBIS_FLAG_SETUP 0x00000004
47
+
48
+ /**
49
+ * Get the duration for a Vorbis packet.
50
+ *
51
+ * If @p flags is @c NULL,
52
+ * special frames are considered invalid.
53
+ *
54
+ * @param s Vorbis parser context
55
+ * @param buf buffer containing a Vorbis frame
56
+ * @param buf_size size of the buffer
57
+ * @param flags flags for special frames
58
+ */
59
+ int av_vorbis_parse_frame_flags(AVVorbisParseContext *s, const uint8_t *buf,
60
+ int buf_size, int *flags);
61
+
62
+ /**
63
+ * Get the duration for a Vorbis packet.
64
+ *
65
+ * @param s Vorbis parser context
66
+ * @param buf buffer containing a Vorbis frame
67
+ * @param buf_size size of the buffer
68
+ */
69
+ int av_vorbis_parse_frame(AVVorbisParseContext *s, const uint8_t *buf,
70
+ int buf_size);
71
+
72
+ void av_vorbis_parse_reset(AVVorbisParseContext *s);
73
+
74
+ #endif /* AVCODEC_VORBIS_PARSER_H */