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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (225) hide show
  1. package/RNAudioAPI.podspec +15 -6
  2. package/android/build.gradle +11 -2
  3. package/android/src/main/cpp/audioapi/CMakeLists.txt +24 -17
  4. package/android/src/main/cpp/audioapi/android/core/AudioDecoder.cpp +51 -21
  5. package/android/src/main/jniLibs/arm64-v8a/libavcodec.so +0 -0
  6. package/android/src/main/jniLibs/arm64-v8a/libavformat.so +0 -0
  7. package/android/src/main/jniLibs/arm64-v8a/libavutil.so +0 -0
  8. package/android/src/main/jniLibs/arm64-v8a/libswresample.so +0 -0
  9. package/android/src/main/jniLibs/armeabi-v7a/libavcodec.so +0 -0
  10. package/android/src/main/jniLibs/armeabi-v7a/libavformat.so +0 -0
  11. package/android/src/main/jniLibs/armeabi-v7a/libavutil.so +0 -0
  12. package/android/src/main/jniLibs/armeabi-v7a/libswresample.so +0 -0
  13. package/android/src/main/jniLibs/x86/libavcodec.so +0 -0
  14. package/android/src/main/jniLibs/x86/libavformat.so +0 -0
  15. package/android/src/main/jniLibs/x86/libavutil.so +0 -0
  16. package/android/src/main/jniLibs/x86/libswresample.so +0 -0
  17. package/android/src/main/jniLibs/x86_64/libavcodec.so +0 -0
  18. package/android/src/main/jniLibs/x86_64/libavformat.so +0 -0
  19. package/android/src/main/jniLibs/x86_64/libavutil.so +0 -0
  20. package/android/src/main/jniLibs/x86_64/libswresample.so +0 -0
  21. package/common/cpp/audioapi/HostObjects/BaseAudioContextHostObject.h +11 -0
  22. package/common/cpp/audioapi/HostObjects/StreamerNodeHostObject.h +30 -0
  23. package/common/cpp/audioapi/core/BaseAudioContext.cpp +9 -0
  24. package/common/cpp/audioapi/core/BaseAudioContext.h +2 -0
  25. package/common/cpp/audioapi/core/sources/StreamerNode.cpp +299 -0
  26. package/common/cpp/audioapi/core/sources/StreamerNode.h +123 -0
  27. package/common/cpp/audioapi/core/utils/AudioDecoder.h +61 -0
  28. package/common/cpp/audioapi/core/utils/AudioNodeManager.cpp +14 -2
  29. package/common/cpp/audioapi/core/utils/AudioNodeManager.h +3 -0
  30. package/common/cpp/audioapi/external/arm64-v8a/libcrypto.a +0 -0
  31. package/common/cpp/audioapi/external/arm64-v8a/libssl.a +0 -0
  32. package/common/cpp/audioapi/external/armeabi-v7a/libcrypto.a +0 -0
  33. package/common/cpp/audioapi/external/armeabi-v7a/libssl.a +0 -0
  34. package/common/cpp/audioapi/external/ffmpeg_include/libavcodec/ac3_parser.h +36 -0
  35. package/common/cpp/audioapi/external/ffmpeg_include/libavcodec/adts_parser.h +37 -0
  36. package/common/cpp/audioapi/external/ffmpeg_include/libavcodec/avcodec.h +2947 -0
  37. package/common/cpp/audioapi/external/ffmpeg_include/libavcodec/avdct.h +88 -0
  38. package/common/cpp/audioapi/external/ffmpeg_include/libavcodec/bsf.h +332 -0
  39. package/common/cpp/audioapi/external/ffmpeg_include/libavcodec/codec.h +367 -0
  40. package/common/cpp/audioapi/external/ffmpeg_include/libavcodec/codec_desc.h +134 -0
  41. package/common/cpp/audioapi/external/ffmpeg_include/libavcodec/codec_id.h +681 -0
  42. package/common/cpp/audioapi/external/ffmpeg_include/libavcodec/codec_par.h +248 -0
  43. package/common/cpp/audioapi/external/ffmpeg_include/libavcodec/d3d11va.h +109 -0
  44. package/common/cpp/audioapi/external/ffmpeg_include/libavcodec/defs.h +359 -0
  45. package/common/cpp/audioapi/external/ffmpeg_include/libavcodec/dirac.h +135 -0
  46. package/common/cpp/audioapi/external/ffmpeg_include/libavcodec/dv_profile.h +82 -0
  47. package/common/cpp/audioapi/external/ffmpeg_include/libavcodec/dxva2.h +90 -0
  48. package/common/cpp/audioapi/external/ffmpeg_include/libavcodec/jni.h +67 -0
  49. package/common/cpp/audioapi/external/ffmpeg_include/libavcodec/mediacodec.h +103 -0
  50. package/common/cpp/audioapi/external/ffmpeg_include/libavcodec/packet.h +907 -0
  51. package/common/cpp/audioapi/external/ffmpeg_include/libavcodec/qsv.h +109 -0
  52. package/common/cpp/audioapi/external/ffmpeg_include/libavcodec/vdpau.h +138 -0
  53. package/common/cpp/audioapi/external/ffmpeg_include/libavcodec/version.h +45 -0
  54. package/common/cpp/audioapi/external/ffmpeg_include/libavcodec/version_major.h +55 -0
  55. package/common/cpp/audioapi/external/ffmpeg_include/libavcodec/videotoolbox.h +85 -0
  56. package/common/cpp/audioapi/external/ffmpeg_include/libavcodec/vorbis_parser.h +74 -0
  57. package/common/cpp/audioapi/external/ffmpeg_include/libavformat/avformat.h +3004 -0
  58. package/common/cpp/audioapi/external/ffmpeg_include/libavformat/avio.h +831 -0
  59. package/common/cpp/audioapi/external/ffmpeg_include/libavformat/version.h +47 -0
  60. package/common/cpp/audioapi/external/ffmpeg_include/libavformat/version_major.h +50 -0
  61. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/adler32.h +63 -0
  62. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/aes.h +69 -0
  63. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/aes_ctr.h +99 -0
  64. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/ambient_viewing_environment.h +72 -0
  65. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/attributes.h +175 -0
  66. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/audio_fifo.h +187 -0
  67. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/avassert.h +120 -0
  68. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/avconfig.h +6 -0
  69. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/avstring.h +428 -0
  70. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/avutil.h +364 -0
  71. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/base64.h +72 -0
  72. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/blowfish.h +82 -0
  73. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/bprint.h +254 -0
  74. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/bswap.h +105 -0
  75. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/buffer.h +322 -0
  76. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/camellia.h +70 -0
  77. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/cast5.h +80 -0
  78. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/channel_layout.h +762 -0
  79. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/common.h +589 -0
  80. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/container_fifo.h +130 -0
  81. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/cpu.h +150 -0
  82. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/crc.h +102 -0
  83. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/csp.h +192 -0
  84. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/des.h +81 -0
  85. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/detection_bbox.h +108 -0
  86. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/dict.h +242 -0
  87. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/display.h +109 -0
  88. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/dovi_meta.h +396 -0
  89. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/downmix_info.h +115 -0
  90. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/encryption_info.h +205 -0
  91. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/error.h +129 -0
  92. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/eval.h +140 -0
  93. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/executor.h +67 -0
  94. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/ffversion.h +5 -0
  95. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/fifo.h +242 -0
  96. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/file.h +62 -0
  97. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/film_grain_params.h +282 -0
  98. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/frame.h +1163 -0
  99. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/hash.h +264 -0
  100. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/hdr_dynamic_metadata.h +376 -0
  101. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/hdr_dynamic_vivid_metadata.h +292 -0
  102. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/hmac.h +99 -0
  103. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/hwcontext.h +601 -0
  104. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/hwcontext_amf.h +46 -0
  105. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/hwcontext_cuda.h +74 -0
  106. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/hwcontext_d3d11va.h +178 -0
  107. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/hwcontext_d3d12va.h +142 -0
  108. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/hwcontext_drm.h +169 -0
  109. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/hwcontext_dxva2.h +75 -0
  110. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/hwcontext_mediacodec.h +61 -0
  111. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/hwcontext_oh.h +34 -0
  112. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/hwcontext_opencl.h +100 -0
  113. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/hwcontext_qsv.h +87 -0
  114. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/hwcontext_vaapi.h +117 -0
  115. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/hwcontext_vdpau.h +44 -0
  116. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/hwcontext_videotoolbox.h +106 -0
  117. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/hwcontext_vulkan.h +377 -0
  118. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/iamf.h +694 -0
  119. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/imgutils.h +377 -0
  120. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/intfloat.h +77 -0
  121. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/intreadwrite.h +677 -0
  122. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/lfg.h +81 -0
  123. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/log.h +427 -0
  124. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/lzo.h +66 -0
  125. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/macros.h +80 -0
  126. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/mastering_display_metadata.h +137 -0
  127. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/mathematics.h +300 -0
  128. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/md5.h +89 -0
  129. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/mem.h +607 -0
  130. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/motion_vector.h +57 -0
  131. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/murmur3.h +115 -0
  132. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/opt.h +1194 -0
  133. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/parseutils.h +197 -0
  134. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/pixdesc.h +440 -0
  135. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/pixelutils.h +51 -0
  136. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/pixfmt.h +797 -0
  137. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/random_seed.h +57 -0
  138. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/rational.h +225 -0
  139. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/rc4.h +69 -0
  140. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/refstruct.h +297 -0
  141. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/replaygain.h +50 -0
  142. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/ripemd.h +83 -0
  143. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/samplefmt.h +269 -0
  144. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/sha.h +90 -0
  145. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/sha512.h +92 -0
  146. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/spherical.h +243 -0
  147. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/stereo3d.h +325 -0
  148. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/tdrdi.h +164 -0
  149. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/tea.h +71 -0
  150. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/threadmessage.h +115 -0
  151. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/timecode.h +199 -0
  152. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/timestamp.h +85 -0
  153. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/tree.h +137 -0
  154. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/twofish.h +70 -0
  155. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/tx.h +210 -0
  156. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/uuid.h +146 -0
  157. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/version.h +119 -0
  158. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/video_enc_params.h +171 -0
  159. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/video_hint.h +107 -0
  160. package/common/cpp/audioapi/external/ffmpeg_include/libavutil/xtea.h +94 -0
  161. package/common/cpp/audioapi/external/ffmpeg_include/libswresample/swresample.h +587 -0
  162. package/common/cpp/audioapi/external/ffmpeg_include/libswresample/version.h +46 -0
  163. package/common/cpp/audioapi/external/ffmpeg_include/libswresample/version_major.h +31 -0
  164. package/common/cpp/audioapi/external/libavcodec.xcframework/Info.plist +44 -0
  165. package/common/cpp/audioapi/external/libavcodec.xcframework/ios-arm64/libavcodec.framework/Info.plist +1 -0
  166. package/common/cpp/audioapi/external/libavcodec.xcframework/ios-arm64/libavcodec.framework/libavcodec +0 -0
  167. package/common/cpp/audioapi/external/libavcodec.xcframework/ios-arm64_x86_64-simulator/libavcodec.framework/Info.plist +1 -0
  168. package/common/cpp/audioapi/external/libavcodec.xcframework/ios-arm64_x86_64-simulator/libavcodec.framework/libavcodec +0 -0
  169. package/common/cpp/audioapi/external/libavformat.xcframework/Info.plist +44 -0
  170. package/common/cpp/audioapi/external/libavformat.xcframework/ios-arm64/libavformat.framework/Info.plist +1 -0
  171. package/common/cpp/audioapi/external/libavformat.xcframework/ios-arm64/libavformat.framework/libavformat +0 -0
  172. package/common/cpp/audioapi/external/libavformat.xcframework/ios-arm64_x86_64-simulator/libavformat.framework/Info.plist +1 -0
  173. package/common/cpp/audioapi/external/libavformat.xcframework/ios-arm64_x86_64-simulator/libavformat.framework/libavformat +0 -0
  174. package/common/cpp/audioapi/external/libavutil.xcframework/Info.plist +44 -0
  175. package/common/cpp/audioapi/external/libavutil.xcframework/ios-arm64/libavutil.framework/Info.plist +1 -0
  176. package/common/cpp/audioapi/external/libavutil.xcframework/ios-arm64/libavutil.framework/libavutil +0 -0
  177. package/common/cpp/audioapi/external/libavutil.xcframework/ios-arm64_x86_64-simulator/libavutil.framework/Info.plist +1 -0
  178. package/common/cpp/audioapi/external/libavutil.xcframework/ios-arm64_x86_64-simulator/libavutil.framework/libavutil +0 -0
  179. package/common/cpp/audioapi/external/libswresample.xcframework/Info.plist +44 -0
  180. package/common/cpp/audioapi/external/libswresample.xcframework/ios-arm64/libswresample.framework/Info.plist +1 -0
  181. package/common/cpp/audioapi/external/libswresample.xcframework/ios-arm64/libswresample.framework/libswresample +0 -0
  182. package/common/cpp/audioapi/external/libswresample.xcframework/ios-arm64_x86_64-simulator/libswresample.framework/Info.plist +1 -0
  183. package/common/cpp/audioapi/external/libswresample.xcframework/ios-arm64_x86_64-simulator/libswresample.framework/libswresample +0 -0
  184. package/common/cpp/audioapi/external/x86/libcrypto.a +0 -0
  185. package/common/cpp/audioapi/external/x86/libssl.a +0 -0
  186. package/common/cpp/audioapi/external/x86_64/libcrypto.a +0 -0
  187. package/common/cpp/audioapi/external/x86_64/libssl.a +0 -0
  188. package/common/cpp/audioapi/libs/ffmpeg/FFmpegDecoding.cpp +402 -0
  189. package/common/cpp/audioapi/libs/ffmpeg/FFmpegDecoding.h +27 -0
  190. package/common/cpp/audioapi/libs/ffmpeg/INSTRUCTIONS.md +26 -0
  191. package/common/cpp/audioapi/libs/ffmpeg/create_xcframework.sh +111 -0
  192. package/common/cpp/audioapi/libs/ffmpeg/ffmpeg_setup.sh +361 -0
  193. package/common/cpp/audioapi/utils/SpscChannel.hpp +47 -38
  194. package/common/cpp/test/CMakeLists.txt +7 -1
  195. package/ios/audioapi/ios/core/AudioDecoder.mm +22 -2
  196. package/lib/commonjs/api.js +7 -0
  197. package/lib/commonjs/api.js.map +1 -1
  198. package/lib/commonjs/core/AudioContext.js.map +1 -1
  199. package/lib/commonjs/core/BaseAudioContext.js +4 -0
  200. package/lib/commonjs/core/BaseAudioContext.js.map +1 -1
  201. package/lib/commonjs/core/StreamerNode.js +15 -0
  202. package/lib/commonjs/core/StreamerNode.js.map +1 -0
  203. package/lib/module/api.js +1 -0
  204. package/lib/module/api.js.map +1 -1
  205. package/lib/module/core/AudioContext.js.map +1 -1
  206. package/lib/module/core/BaseAudioContext.js +4 -0
  207. package/lib/module/core/BaseAudioContext.js.map +1 -1
  208. package/lib/module/core/StreamerNode.js +9 -0
  209. package/lib/module/core/StreamerNode.js.map +1 -0
  210. package/lib/typescript/api.d.ts +1 -0
  211. package/lib/typescript/api.d.ts.map +1 -1
  212. package/lib/typescript/core/AudioContext.d.ts +1 -1
  213. package/lib/typescript/core/AudioContext.d.ts.map +1 -1
  214. package/lib/typescript/core/BaseAudioContext.d.ts +2 -0
  215. package/lib/typescript/core/BaseAudioContext.d.ts.map +1 -1
  216. package/lib/typescript/core/StreamerNode.d.ts +5 -0
  217. package/lib/typescript/core/StreamerNode.d.ts.map +1 -0
  218. package/lib/typescript/interfaces.d.ts +5 -1
  219. package/lib/typescript/interfaces.d.ts.map +1 -1
  220. package/package.json +1 -1
  221. package/src/api.ts +1 -0
  222. package/src/core/AudioContext.ts +1 -1
  223. package/src/core/BaseAudioContext.ts +5 -0
  224. package/src/core/StreamerNode.ts +8 -0
  225. package/src/interfaces.ts +6 -1
@@ -0,0 +1,601 @@
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_HWCONTEXT_H
20
+ #define AVUTIL_HWCONTEXT_H
21
+
22
+ #include "buffer.h"
23
+ #include "frame.h"
24
+ #include "log.h"
25
+ #include "pixfmt.h"
26
+
27
+ enum AVHWDeviceType {
28
+ AV_HWDEVICE_TYPE_NONE,
29
+ AV_HWDEVICE_TYPE_VDPAU,
30
+ AV_HWDEVICE_TYPE_CUDA,
31
+ AV_HWDEVICE_TYPE_VAAPI,
32
+ AV_HWDEVICE_TYPE_DXVA2,
33
+ AV_HWDEVICE_TYPE_QSV,
34
+ AV_HWDEVICE_TYPE_VIDEOTOOLBOX,
35
+ AV_HWDEVICE_TYPE_D3D11VA,
36
+ AV_HWDEVICE_TYPE_DRM,
37
+ AV_HWDEVICE_TYPE_OPENCL,
38
+ AV_HWDEVICE_TYPE_MEDIACODEC,
39
+ AV_HWDEVICE_TYPE_VULKAN,
40
+ AV_HWDEVICE_TYPE_D3D12VA,
41
+ AV_HWDEVICE_TYPE_AMF,
42
+ /* OpenHarmony Codec device */
43
+ AV_HWDEVICE_TYPE_OHCODEC,
44
+ };
45
+
46
+ /**
47
+ * This struct aggregates all the (hardware/vendor-specific) "high-level" state,
48
+ * i.e. state that is not tied to a concrete processing configuration.
49
+ * E.g., in an API that supports hardware-accelerated encoding and decoding,
50
+ * this struct will (if possible) wrap the state that is common to both encoding
51
+ * and decoding and from which specific instances of encoders or decoders can be
52
+ * derived.
53
+ *
54
+ * This struct is reference-counted with the AVBuffer mechanism. The
55
+ * av_hwdevice_ctx_alloc() constructor yields a reference, whose data field
56
+ * points to the actual AVHWDeviceContext. Further objects derived from
57
+ * AVHWDeviceContext (such as AVHWFramesContext, describing a frame pool with
58
+ * specific properties) will hold an internal reference to it. After all the
59
+ * references are released, the AVHWDeviceContext itself will be freed,
60
+ * optionally invoking a user-specified callback for uninitializing the hardware
61
+ * state.
62
+ */
63
+ typedef struct AVHWDeviceContext {
64
+ /**
65
+ * A class for logging. Set by av_hwdevice_ctx_alloc().
66
+ */
67
+ const AVClass *av_class;
68
+
69
+ /**
70
+ * This field identifies the underlying API used for hardware access.
71
+ *
72
+ * This field is set when this struct is allocated and never changed
73
+ * afterwards.
74
+ */
75
+ enum AVHWDeviceType type;
76
+
77
+ /**
78
+ * The format-specific data, allocated and freed by libavutil along with
79
+ * this context.
80
+ *
81
+ * Should be cast by the user to the format-specific context defined in the
82
+ * corresponding header (hwcontext_*.h) and filled as described in the
83
+ * documentation before calling av_hwdevice_ctx_init().
84
+ *
85
+ * After calling av_hwdevice_ctx_init() this struct should not be modified
86
+ * by the caller.
87
+ */
88
+ void *hwctx;
89
+
90
+ /**
91
+ * This field may be set by the caller before calling av_hwdevice_ctx_init().
92
+ *
93
+ * If non-NULL, this callback will be called when the last reference to
94
+ * this context is unreferenced, immediately before it is freed.
95
+ *
96
+ * @note when other objects (e.g an AVHWFramesContext) are derived from this
97
+ * struct, this callback will be invoked after all such child objects
98
+ * are fully uninitialized and their respective destructors invoked.
99
+ */
100
+ void (*free)(struct AVHWDeviceContext *ctx);
101
+
102
+ /**
103
+ * Arbitrary user data, to be used e.g. by the free() callback.
104
+ */
105
+ void *user_opaque;
106
+ } AVHWDeviceContext;
107
+
108
+ /**
109
+ * This struct describes a set or pool of "hardware" frames (i.e. those with
110
+ * data not located in normal system memory). All the frames in the pool are
111
+ * assumed to be allocated in the same way and interchangeable.
112
+ *
113
+ * This struct is reference-counted with the AVBuffer mechanism and tied to a
114
+ * given AVHWDeviceContext instance. The av_hwframe_ctx_alloc() constructor
115
+ * yields a reference, whose data field points to the actual AVHWFramesContext
116
+ * struct.
117
+ */
118
+ typedef struct AVHWFramesContext {
119
+ /**
120
+ * A class for logging.
121
+ */
122
+ const AVClass *av_class;
123
+
124
+ /**
125
+ * A reference to the parent AVHWDeviceContext. This reference is owned and
126
+ * managed by the enclosing AVHWFramesContext, but the caller may derive
127
+ * additional references from it.
128
+ */
129
+ AVBufferRef *device_ref;
130
+
131
+ /**
132
+ * The parent AVHWDeviceContext. This is simply a pointer to
133
+ * device_ref->data provided for convenience.
134
+ *
135
+ * Set by libavutil in av_hwframe_ctx_init().
136
+ */
137
+ AVHWDeviceContext *device_ctx;
138
+
139
+ /**
140
+ * The format-specific data, allocated and freed automatically along with
141
+ * this context.
142
+ *
143
+ * The user shall ignore this field if the corresponding format-specific
144
+ * header (hwcontext_*.h) does not define a context to be used as
145
+ * AVHWFramesContext.hwctx.
146
+ *
147
+ * Otherwise, it should be cast by the user to said context and filled
148
+ * as described in the documentation before calling av_hwframe_ctx_init().
149
+ *
150
+ * After any frames using this context are created, the contents of this
151
+ * struct should not be modified by the caller.
152
+ */
153
+ void *hwctx;
154
+
155
+ /**
156
+ * This field may be set by the caller before calling av_hwframe_ctx_init().
157
+ *
158
+ * If non-NULL, this callback will be called when the last reference to
159
+ * this context is unreferenced, immediately before it is freed.
160
+ */
161
+ void (*free)(struct AVHWFramesContext *ctx);
162
+
163
+ /**
164
+ * Arbitrary user data, to be used e.g. by the free() callback.
165
+ */
166
+ void *user_opaque;
167
+
168
+ /**
169
+ * A pool from which the frames are allocated by av_hwframe_get_buffer().
170
+ * This field may be set by the caller before calling av_hwframe_ctx_init().
171
+ * The buffers returned by calling av_buffer_pool_get() on this pool must
172
+ * have the properties described in the documentation in the corresponding hw
173
+ * type's header (hwcontext_*.h). The pool will be freed strictly before
174
+ * this struct's free() callback is invoked.
175
+ *
176
+ * This field may be NULL, then libavutil will attempt to allocate a pool
177
+ * internally. Note that certain device types enforce pools allocated at
178
+ * fixed size (frame count), which cannot be extended dynamically. In such a
179
+ * case, initial_pool_size must be set appropriately.
180
+ */
181
+ AVBufferPool *pool;
182
+
183
+ /**
184
+ * Initial size of the frame pool. If a device type does not support
185
+ * dynamically resizing the pool, then this is also the maximum pool size.
186
+ *
187
+ * May be set by the caller before calling av_hwframe_ctx_init(). Must be
188
+ * set if pool is NULL and the device type does not support dynamic pools.
189
+ */
190
+ int initial_pool_size;
191
+
192
+ /**
193
+ * The pixel format identifying the underlying HW surface type.
194
+ *
195
+ * Must be a hwaccel format, i.e. the corresponding descriptor must have the
196
+ * AV_PIX_FMT_FLAG_HWACCEL flag set.
197
+ *
198
+ * Must be set by the user before calling av_hwframe_ctx_init().
199
+ */
200
+ enum AVPixelFormat format;
201
+
202
+ /**
203
+ * The pixel format identifying the actual data layout of the hardware
204
+ * frames.
205
+ *
206
+ * Must be set by the caller before calling av_hwframe_ctx_init().
207
+ *
208
+ * @note when the underlying API does not provide the exact data layout, but
209
+ * only the colorspace/bit depth, this field should be set to the fully
210
+ * planar version of that format (e.g. for 8-bit 420 YUV it should be
211
+ * AV_PIX_FMT_YUV420P, not AV_PIX_FMT_NV12 or anything else).
212
+ */
213
+ enum AVPixelFormat sw_format;
214
+
215
+ /**
216
+ * The allocated dimensions of the frames in this pool.
217
+ *
218
+ * Must be set by the user before calling av_hwframe_ctx_init().
219
+ */
220
+ int width, height;
221
+ } AVHWFramesContext;
222
+
223
+ /**
224
+ * Look up an AVHWDeviceType by name.
225
+ *
226
+ * @param name String name of the device type (case-insensitive).
227
+ * @return The type from enum AVHWDeviceType, or AV_HWDEVICE_TYPE_NONE if
228
+ * not found.
229
+ */
230
+ enum AVHWDeviceType av_hwdevice_find_type_by_name(const char *name);
231
+
232
+ /** Get the string name of an AVHWDeviceType.
233
+ *
234
+ * @param type Type from enum AVHWDeviceType.
235
+ * @return Pointer to a static string containing the name, or NULL if the type
236
+ * is not valid.
237
+ */
238
+ const char *av_hwdevice_get_type_name(enum AVHWDeviceType type);
239
+
240
+ /**
241
+ * Iterate over supported device types.
242
+ *
243
+ * @param prev AV_HWDEVICE_TYPE_NONE initially, then the previous type
244
+ * returned by this function in subsequent iterations.
245
+ * @return The next usable device type from enum AVHWDeviceType, or
246
+ * AV_HWDEVICE_TYPE_NONE if there are no more.
247
+ */
248
+ enum AVHWDeviceType av_hwdevice_iterate_types(enum AVHWDeviceType prev);
249
+
250
+ /**
251
+ * Allocate an AVHWDeviceContext for a given hardware type.
252
+ *
253
+ * @param type the type of the hardware device to allocate.
254
+ * @return a reference to the newly created AVHWDeviceContext on success or NULL
255
+ * on failure.
256
+ */
257
+ AVBufferRef *av_hwdevice_ctx_alloc(enum AVHWDeviceType type);
258
+
259
+ /**
260
+ * Finalize the device context before use. This function must be called after
261
+ * the context is filled with all the required information and before it is
262
+ * used in any way.
263
+ *
264
+ * @param ref a reference to the AVHWDeviceContext
265
+ * @return 0 on success, a negative AVERROR code on failure
266
+ */
267
+ int av_hwdevice_ctx_init(AVBufferRef *ref);
268
+
269
+ /**
270
+ * Open a device of the specified type and create an AVHWDeviceContext for it.
271
+ *
272
+ * This is a convenience function intended to cover the simple cases. Callers
273
+ * who need to fine-tune device creation/management should open the device
274
+ * manually and then wrap it in an AVHWDeviceContext using
275
+ * av_hwdevice_ctx_alloc()/av_hwdevice_ctx_init().
276
+ *
277
+ * The returned context is already initialized and ready for use, the caller
278
+ * should not call av_hwdevice_ctx_init() on it. The user_opaque/free fields of
279
+ * the created AVHWDeviceContext are set by this function and should not be
280
+ * touched by the caller.
281
+ *
282
+ * @param device_ctx On success, a reference to the newly-created device context
283
+ * will be written here. The reference is owned by the caller
284
+ * and must be released with av_buffer_unref() when no longer
285
+ * needed. On failure, NULL will be written to this pointer.
286
+ * @param type The type of the device to create.
287
+ * @param device A type-specific string identifying the device to open.
288
+ * @param opts A dictionary of additional (type-specific) options to use in
289
+ * opening the device. The dictionary remains owned by the caller.
290
+ * @param flags currently unused
291
+ *
292
+ * @return 0 on success, a negative AVERROR code on failure.
293
+ */
294
+ int av_hwdevice_ctx_create(AVBufferRef **device_ctx, enum AVHWDeviceType type,
295
+ const char *device, AVDictionary *opts, int flags);
296
+
297
+ /**
298
+ * Create a new device of the specified type from an existing device.
299
+ *
300
+ * If the source device is a device of the target type or was originally
301
+ * derived from such a device (possibly through one or more intermediate
302
+ * devices of other types), then this will return a reference to the
303
+ * existing device of the same type as is requested.
304
+ *
305
+ * Otherwise, it will attempt to derive a new device from the given source
306
+ * device. If direct derivation to the new type is not implemented, it will
307
+ * attempt the same derivation from each ancestor of the source device in
308
+ * turn looking for an implemented derivation method.
309
+ *
310
+ * @param dst_ctx On success, a reference to the newly-created
311
+ * AVHWDeviceContext.
312
+ * @param type The type of the new device to create.
313
+ * @param src_ctx A reference to an existing AVHWDeviceContext which will be
314
+ * used to create the new device.
315
+ * @param flags Currently unused; should be set to zero.
316
+ * @return Zero on success, a negative AVERROR code on failure.
317
+ */
318
+ int av_hwdevice_ctx_create_derived(AVBufferRef **dst_ctx,
319
+ enum AVHWDeviceType type,
320
+ AVBufferRef *src_ctx, int flags);
321
+
322
+ /**
323
+ * Create a new device of the specified type from an existing device.
324
+ *
325
+ * This function performs the same action as av_hwdevice_ctx_create_derived,
326
+ * however, it is able to set options for the new device to be derived.
327
+ *
328
+ * @param dst_ctx On success, a reference to the newly-created
329
+ * AVHWDeviceContext.
330
+ * @param type The type of the new device to create.
331
+ * @param src_ctx A reference to an existing AVHWDeviceContext which will be
332
+ * used to create the new device.
333
+ * @param options Options for the new device to create, same format as in
334
+ * av_hwdevice_ctx_create.
335
+ * @param flags Currently unused; should be set to zero.
336
+ * @return Zero on success, a negative AVERROR code on failure.
337
+ */
338
+ int av_hwdevice_ctx_create_derived_opts(AVBufferRef **dst_ctx,
339
+ enum AVHWDeviceType type,
340
+ AVBufferRef *src_ctx,
341
+ AVDictionary *options, int flags);
342
+
343
+ /**
344
+ * Allocate an AVHWFramesContext tied to a given device context.
345
+ *
346
+ * @param device_ctx a reference to a AVHWDeviceContext. This function will make
347
+ * a new reference for internal use, the one passed to the
348
+ * function remains owned by the caller.
349
+ * @return a reference to the newly created AVHWFramesContext on success or NULL
350
+ * on failure.
351
+ */
352
+ AVBufferRef *av_hwframe_ctx_alloc(AVBufferRef *device_ctx);
353
+
354
+ /**
355
+ * Finalize the context before use. This function must be called after the
356
+ * context is filled with all the required information and before it is attached
357
+ * to any frames.
358
+ *
359
+ * @param ref a reference to the AVHWFramesContext
360
+ * @return 0 on success, a negative AVERROR code on failure
361
+ */
362
+ int av_hwframe_ctx_init(AVBufferRef *ref);
363
+
364
+ /**
365
+ * Allocate a new frame attached to the given AVHWFramesContext.
366
+ *
367
+ * @param hwframe_ctx a reference to an AVHWFramesContext
368
+ * @param frame an empty (freshly allocated or unreffed) frame to be filled with
369
+ * newly allocated buffers.
370
+ * @param flags currently unused, should be set to zero
371
+ * @return 0 on success, a negative AVERROR code on failure
372
+ */
373
+ int av_hwframe_get_buffer(AVBufferRef *hwframe_ctx, AVFrame *frame, int flags);
374
+
375
+ /**
376
+ * Copy data to or from a hw surface. At least one of dst/src must have an
377
+ * AVHWFramesContext attached.
378
+ *
379
+ * If src has an AVHWFramesContext attached, then the format of dst (if set)
380
+ * must use one of the formats returned by av_hwframe_transfer_get_formats(src,
381
+ * AV_HWFRAME_TRANSFER_DIRECTION_FROM).
382
+ * If dst has an AVHWFramesContext attached, then the format of src must use one
383
+ * of the formats returned by av_hwframe_transfer_get_formats(dst,
384
+ * AV_HWFRAME_TRANSFER_DIRECTION_TO)
385
+ *
386
+ * dst may be "clean" (i.e. with data/buf pointers unset), in which case the
387
+ * data buffers will be allocated by this function using av_frame_get_buffer().
388
+ * If dst->format is set, then this format will be used, otherwise (when
389
+ * dst->format is AV_PIX_FMT_NONE) the first acceptable format will be chosen.
390
+ *
391
+ * The two frames must have matching allocated dimensions (i.e. equal to
392
+ * AVHWFramesContext.width/height), since not all device types support
393
+ * transferring a sub-rectangle of the whole surface. The display dimensions
394
+ * (i.e. AVFrame.width/height) may be smaller than the allocated dimensions, but
395
+ * also have to be equal for both frames. When the display dimensions are
396
+ * smaller than the allocated dimensions, the content of the padding in the
397
+ * destination frame is unspecified.
398
+ *
399
+ * @param dst the destination frame. dst is not touched on failure.
400
+ * @param src the source frame.
401
+ * @param flags currently unused, should be set to zero
402
+ * @return 0 on success, a negative AVERROR error code on failure.
403
+ */
404
+ int av_hwframe_transfer_data(AVFrame *dst, const AVFrame *src, int flags);
405
+
406
+ enum AVHWFrameTransferDirection {
407
+ /**
408
+ * Transfer the data from the queried hw frame.
409
+ */
410
+ AV_HWFRAME_TRANSFER_DIRECTION_FROM,
411
+
412
+ /**
413
+ * Transfer the data to the queried hw frame.
414
+ */
415
+ AV_HWFRAME_TRANSFER_DIRECTION_TO,
416
+ };
417
+
418
+ /**
419
+ * Get a list of possible source or target formats usable in
420
+ * av_hwframe_transfer_data().
421
+ *
422
+ * @param hwframe_ctx the frame context to obtain the information for
423
+ * @param dir the direction of the transfer
424
+ * @param formats the pointer to the output format list will be written here.
425
+ * The list is terminated with AV_PIX_FMT_NONE and must be freed
426
+ * by the caller when no longer needed using av_free().
427
+ * If this function returns successfully, the format list will
428
+ * have at least one item (not counting the terminator).
429
+ * On failure, the contents of this pointer are unspecified.
430
+ * @param flags currently unused, should be set to zero
431
+ * @return 0 on success, a negative AVERROR code on failure.
432
+ */
433
+ int av_hwframe_transfer_get_formats(AVBufferRef *hwframe_ctx,
434
+ enum AVHWFrameTransferDirection dir,
435
+ enum AVPixelFormat **formats, int flags);
436
+
437
+
438
+ /**
439
+ * This struct describes the constraints on hardware frames attached to
440
+ * a given device with a hardware-specific configuration. This is returned
441
+ * by av_hwdevice_get_hwframe_constraints() and must be freed by
442
+ * av_hwframe_constraints_free() after use.
443
+ */
444
+ typedef struct AVHWFramesConstraints {
445
+ /**
446
+ * A list of possible values for format in the hw_frames_ctx,
447
+ * terminated by AV_PIX_FMT_NONE. This member will always be filled.
448
+ */
449
+ enum AVPixelFormat *valid_hw_formats;
450
+
451
+ /**
452
+ * A list of possible values for sw_format in the hw_frames_ctx,
453
+ * terminated by AV_PIX_FMT_NONE. Can be NULL if this information is
454
+ * not known.
455
+ */
456
+ enum AVPixelFormat *valid_sw_formats;
457
+
458
+ /**
459
+ * The minimum size of frames in this hw_frames_ctx.
460
+ * (Zero if not known.)
461
+ */
462
+ int min_width;
463
+ int min_height;
464
+
465
+ /**
466
+ * The maximum size of frames in this hw_frames_ctx.
467
+ * (INT_MAX if not known / no limit.)
468
+ */
469
+ int max_width;
470
+ int max_height;
471
+ } AVHWFramesConstraints;
472
+
473
+ /**
474
+ * Allocate a HW-specific configuration structure for a given HW device.
475
+ * After use, the user must free all members as required by the specific
476
+ * hardware structure being used, then free the structure itself with
477
+ * av_free().
478
+ *
479
+ * @param device_ctx a reference to the associated AVHWDeviceContext.
480
+ * @return The newly created HW-specific configuration structure on
481
+ * success or NULL on failure.
482
+ */
483
+ void *av_hwdevice_hwconfig_alloc(AVBufferRef *device_ctx);
484
+
485
+ /**
486
+ * Get the constraints on HW frames given a device and the HW-specific
487
+ * configuration to be used with that device. If no HW-specific
488
+ * configuration is provided, returns the maximum possible capabilities
489
+ * of the device.
490
+ *
491
+ * @param ref a reference to the associated AVHWDeviceContext.
492
+ * @param hwconfig a filled HW-specific configuration structure, or NULL
493
+ * to return the maximum possible capabilities of the device.
494
+ * @return AVHWFramesConstraints structure describing the constraints
495
+ * on the device, or NULL if not available.
496
+ */
497
+ AVHWFramesConstraints *av_hwdevice_get_hwframe_constraints(AVBufferRef *ref,
498
+ const void *hwconfig);
499
+
500
+ /**
501
+ * Free an AVHWFrameConstraints structure.
502
+ *
503
+ * @param constraints The (filled or unfilled) AVHWFrameConstraints structure.
504
+ */
505
+ void av_hwframe_constraints_free(AVHWFramesConstraints **constraints);
506
+
507
+
508
+ /**
509
+ * Flags to apply to frame mappings.
510
+ */
511
+ enum {
512
+ /**
513
+ * The mapping must be readable.
514
+ */
515
+ AV_HWFRAME_MAP_READ = 1 << 0,
516
+ /**
517
+ * The mapping must be writeable.
518
+ */
519
+ AV_HWFRAME_MAP_WRITE = 1 << 1,
520
+ /**
521
+ * The mapped frame will be overwritten completely in subsequent
522
+ * operations, so the current frame data need not be loaded. Any values
523
+ * which are not overwritten are unspecified.
524
+ */
525
+ AV_HWFRAME_MAP_OVERWRITE = 1 << 2,
526
+ /**
527
+ * The mapping must be direct. That is, there must not be any copying in
528
+ * the map or unmap steps. Note that performance of direct mappings may
529
+ * be much lower than normal memory.
530
+ */
531
+ AV_HWFRAME_MAP_DIRECT = 1 << 3,
532
+ };
533
+
534
+ /**
535
+ * Map a hardware frame.
536
+ *
537
+ * This has a number of different possible effects, depending on the format
538
+ * and origin of the src and dst frames. On input, src should be a usable
539
+ * frame with valid buffers and dst should be blank (typically as just created
540
+ * by av_frame_alloc()). src should have an associated hwframe context, and
541
+ * dst may optionally have a format and associated hwframe context.
542
+ *
543
+ * If src was created by mapping a frame from the hwframe context of dst,
544
+ * then this function undoes the mapping - dst is replaced by a reference to
545
+ * the frame that src was originally mapped from.
546
+ *
547
+ * If both src and dst have an associated hwframe context, then this function
548
+ * attempts to map the src frame from its hardware context to that of dst and
549
+ * then fill dst with appropriate data to be usable there. This will only be
550
+ * possible if the hwframe contexts and associated devices are compatible -
551
+ * given compatible devices, av_hwframe_ctx_create_derived() can be used to
552
+ * create a hwframe context for dst in which mapping should be possible.
553
+ *
554
+ * If src has a hwframe context but dst does not, then the src frame is
555
+ * mapped to normal memory and should thereafter be usable as a normal frame.
556
+ * If the format is set on dst, then the mapping will attempt to create dst
557
+ * with that format and fail if it is not possible. If format is unset (is
558
+ * AV_PIX_FMT_NONE) then dst will be mapped with whatever the most appropriate
559
+ * format to use is (probably the sw_format of the src hwframe context).
560
+ *
561
+ * A return value of AVERROR(ENOSYS) indicates that the mapping is not
562
+ * possible with the given arguments and hwframe setup, while other return
563
+ * values indicate that it failed somehow.
564
+ *
565
+ * On failure, the destination frame will be left blank, except for the
566
+ * hw_frames_ctx/format fields thay may have been set by the caller - those will
567
+ * be preserved as they were.
568
+ *
569
+ * @param dst Destination frame, to contain the mapping.
570
+ * @param src Source frame, to be mapped.
571
+ * @param flags Some combination of AV_HWFRAME_MAP_* flags.
572
+ * @return Zero on success, negative AVERROR code on failure.
573
+ */
574
+ int av_hwframe_map(AVFrame *dst, const AVFrame *src, int flags);
575
+
576
+
577
+ /**
578
+ * Create and initialise an AVHWFramesContext as a mapping of another existing
579
+ * AVHWFramesContext on a different device.
580
+ *
581
+ * av_hwframe_ctx_init() should not be called after this.
582
+ *
583
+ * @param derived_frame_ctx On success, a reference to the newly created
584
+ * AVHWFramesContext.
585
+ * @param format The AVPixelFormat for the derived context.
586
+ * @param derived_device_ctx A reference to the device to create the new
587
+ * AVHWFramesContext on.
588
+ * @param source_frame_ctx A reference to an existing AVHWFramesContext
589
+ * which will be mapped to the derived context.
590
+ * @param flags Some combination of AV_HWFRAME_MAP_* flags, defining the
591
+ * mapping parameters to apply to frames which are allocated
592
+ * in the derived device.
593
+ * @return Zero on success, negative AVERROR code on failure.
594
+ */
595
+ int av_hwframe_ctx_create_derived(AVBufferRef **derived_frame_ctx,
596
+ enum AVPixelFormat format,
597
+ AVBufferRef *derived_device_ctx,
598
+ AVBufferRef *source_frame_ctx,
599
+ int flags);
600
+
601
+ #endif /* AVUTIL_HWCONTEXT_H */
@@ -0,0 +1,46 @@
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
+ #ifndef AVUTIL_HWCONTEXT_AMF_H
21
+ #define AVUTIL_HWCONTEXT_AMF_H
22
+
23
+ #include "pixfmt.h"
24
+ #include "hwcontext.h"
25
+ #include <AMF/core/Factory.h>
26
+ #include <AMF/core/Context.h>
27
+ #include <AMF/core/Trace.h>
28
+ #include <AMF/core/Debug.h>
29
+
30
+ /**
31
+ * This struct is allocated as AVHWDeviceContext.hwctx
32
+ */
33
+ typedef struct AVAMFDeviceContext {
34
+ void * library;
35
+ AMFFactory *factory;
36
+ void *trace_writer;
37
+
38
+ int64_t version; ///< version of AMF runtime
39
+ AMFContext *context;
40
+ AMF_MEMORY_TYPE memory_type;
41
+ } AVAMFDeviceContext;
42
+
43
+ enum AMF_SURFACE_FORMAT av_av_to_amf_format(enum AVPixelFormat fmt);
44
+ enum AVPixelFormat av_amf_to_av_format(enum AMF_SURFACE_FORMAT fmt);
45
+
46
+ #endif /* AVUTIL_HWCONTEXT_AMF_H */