@libmedia/avutil 0.2.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 (451) hide show
  1. package/COPYING.LGPLv3 +165 -0
  2. package/README.md +13 -0
  3. package/dist/cjs/AVStream.d.ts +163 -0
  4. package/dist/cjs/AVStream.js +36 -0
  5. package/dist/cjs/AVStream.js.map +1 -0
  6. package/dist/cjs/audiosamplefmt.d.ts +225 -0
  7. package/dist/cjs/audiosamplefmt.js +6 -0
  8. package/dist/cjs/audiosamplefmt.js.map +1 -0
  9. package/dist/cjs/avformat.d.ts +51 -0
  10. package/dist/cjs/avformat.js +6 -0
  11. package/dist/cjs/avformat.js.map +1 -0
  12. package/dist/cjs/codec.d.ts +863 -0
  13. package/dist/cjs/codec.js +6 -0
  14. package/dist/cjs/codec.js.map +1 -0
  15. package/dist/cjs/codecs/aac.d.ts +115 -0
  16. package/dist/cjs/codecs/aac.js +131 -0
  17. package/dist/cjs/codecs/aac.js.map +1 -0
  18. package/dist/cjs/codecs/ac3.d.ts +73 -0
  19. package/dist/cjs/codecs/ac3.js +73 -0
  20. package/dist/cjs/codecs/ac3.js.map +1 -0
  21. package/dist/cjs/codecs/av1.d.ts +72 -0
  22. package/dist/cjs/codecs/av1.js +238 -0
  23. package/dist/cjs/codecs/av1.js.map +1 -0
  24. package/dist/cjs/codecs/dts.d.ts +17 -0
  25. package/dist/cjs/codecs/dts.js +40 -0
  26. package/dist/cjs/codecs/dts.js.map +1 -0
  27. package/dist/cjs/codecs/flac.d.ts +16 -0
  28. package/dist/cjs/codecs/flac.js +6 -0
  29. package/dist/cjs/codecs/flac.js.map +1 -0
  30. package/dist/cjs/codecs/h264.d.ts +137 -0
  31. package/dist/cjs/codecs/h264.js +374 -0
  32. package/dist/cjs/codecs/h264.js.map +1 -0
  33. package/dist/cjs/codecs/hevc.d.ts +163 -0
  34. package/dist/cjs/codecs/hevc.js +431 -0
  35. package/dist/cjs/codecs/hevc.js.map +1 -0
  36. package/dist/cjs/codecs/mp3.d.ts +13 -0
  37. package/dist/cjs/codecs/mp3.js +94 -0
  38. package/dist/cjs/codecs/mp3.js.map +1 -0
  39. package/dist/cjs/codecs/mpeg4.d.ts +7 -0
  40. package/dist/cjs/codecs/mpeg4.js +10 -0
  41. package/dist/cjs/codecs/mpeg4.js.map +1 -0
  42. package/dist/cjs/codecs/mpegvideo.d.ts +7 -0
  43. package/dist/cjs/codecs/mpegvideo.js +14 -0
  44. package/dist/cjs/codecs/mpegvideo.js.map +1 -0
  45. package/dist/cjs/codecs/opus.d.ts +23 -0
  46. package/dist/cjs/codecs/opus.js +53 -0
  47. package/dist/cjs/codecs/opus.js.map +1 -0
  48. package/dist/cjs/codecs/vp8.d.ts +27 -0
  49. package/dist/cjs/codecs/vp8.js +37 -0
  50. package/dist/cjs/codecs/vp8.js.map +1 -0
  51. package/dist/cjs/codecs/vp9.d.ts +42 -0
  52. package/dist/cjs/codecs/vp9.js +130 -0
  53. package/dist/cjs/codecs/vp9.js.map +1 -0
  54. package/dist/cjs/codecs/vvc.d.ts +178 -0
  55. package/dist/cjs/codecs/vvc.js +376 -0
  56. package/dist/cjs/codecs/vvc.js.map +1 -0
  57. package/dist/cjs/constant.d.ts +28 -0
  58. package/dist/cjs/constant.js +23 -0
  59. package/dist/cjs/constant.js.map +1 -0
  60. package/dist/cjs/error.d.ts +9 -0
  61. package/dist/cjs/error.js +9 -0
  62. package/dist/cjs/error.js.map +1 -0
  63. package/dist/cjs/function/analyzeAVFormat.d.ts +3 -0
  64. package/dist/cjs/function/analyzeAVFormat.js +34 -0
  65. package/dist/cjs/function/analyzeAVFormat.js.map +1 -0
  66. package/dist/cjs/function/analyzeUrlIOLoader.d.ts +7 -0
  67. package/dist/cjs/function/analyzeUrlIOLoader.js +89 -0
  68. package/dist/cjs/function/analyzeUrlIOLoader.js.map +1 -0
  69. package/dist/cjs/function/audioData2AVFrame.d.ts +2 -0
  70. package/dist/cjs/function/audioData2AVFrame.js +48 -0
  71. package/dist/cjs/function/audioData2AVFrame.js.map +1 -0
  72. package/dist/cjs/function/avframe2AudioData.d.ts +3 -0
  73. package/dist/cjs/function/avframe2AudioData.js +100 -0
  74. package/dist/cjs/function/avframe2AudioData.js.map +1 -0
  75. package/dist/cjs/function/avframe2VideoFrame.d.ts +6 -0
  76. package/dist/cjs/function/avframe2VideoFrame.js +114 -0
  77. package/dist/cjs/function/avframe2VideoFrame.js.map +1 -0
  78. package/dist/cjs/function/avpacket2EncodedAudioChunk.d.ts +2 -0
  79. package/dist/cjs/function/avpacket2EncodedAudioChunk.js +15 -0
  80. package/dist/cjs/function/avpacket2EncodedAudioChunk.js.map +1 -0
  81. package/dist/cjs/function/avpacket2EncodedVideoChunk.d.ts +2 -0
  82. package/dist/cjs/function/avpacket2EncodedVideoChunk.js +15 -0
  83. package/dist/cjs/function/avpacket2EncodedVideoChunk.js.map +1 -0
  84. package/dist/cjs/function/compileResource.d.ts +2 -0
  85. package/dist/cjs/function/compileResource.js +47 -0
  86. package/dist/cjs/function/compileResource.js.map +1 -0
  87. package/dist/cjs/function/encodedAudioChunk2AVPacket.d.ts +2 -0
  88. package/dist/cjs/function/encodedAudioChunk2AVPacket.js +23 -0
  89. package/dist/cjs/function/encodedAudioChunk2AVPacket.js.map +1 -0
  90. package/dist/cjs/function/encodedVideoChunk2AVPacket.d.ts +7 -0
  91. package/dist/cjs/function/encodedVideoChunk2AVPacket.js +30 -0
  92. package/dist/cjs/function/encodedVideoChunk2AVPacket.js.map +1 -0
  93. package/dist/cjs/function/getAudioCodec.d.ts +2 -0
  94. package/dist/cjs/function/getAudioCodec.js +13 -0
  95. package/dist/cjs/function/getAudioCodec.js.map +1 -0
  96. package/dist/cjs/function/getHardwarePreference.d.ts +1 -0
  97. package/dist/cjs/function/getHardwarePreference.js +16 -0
  98. package/dist/cjs/function/getHardwarePreference.js.map +1 -0
  99. package/dist/cjs/function/getVideoCodec.d.ts +2 -0
  100. package/dist/cjs/function/getVideoCodec.js +76 -0
  101. package/dist/cjs/function/getVideoCodec.js.map +1 -0
  102. package/dist/cjs/function/hasAlphaChannel.d.ts +2 -0
  103. package/dist/cjs/function/hasAlphaChannel.js +12 -0
  104. package/dist/cjs/function/hasAlphaChannel.js.map +1 -0
  105. package/dist/cjs/function/isHdr.d.ts +2 -0
  106. package/dist/cjs/function/isHdr.js +13 -0
  107. package/dist/cjs/function/isHdr.js.map +1 -0
  108. package/dist/cjs/function/videoFrame2AVFrame.d.ts +7 -0
  109. package/dist/cjs/function/videoFrame2AVFrame.js +111 -0
  110. package/dist/cjs/function/videoFrame2AVFrame.js.map +1 -0
  111. package/dist/cjs/implement/AVFramePoolImpl.d.ts +10 -0
  112. package/dist/cjs/implement/AVFramePoolImpl.js +54 -0
  113. package/dist/cjs/implement/AVFramePoolImpl.js.map +1 -0
  114. package/dist/cjs/implement/AVPCMBufferPoolImpl.d.ts +10 -0
  115. package/dist/cjs/implement/AVPCMBufferPoolImpl.js +52 -0
  116. package/dist/cjs/implement/AVPCMBufferPoolImpl.js.map +1 -0
  117. package/dist/cjs/implement/AVPacketPoolImpl.d.ts +10 -0
  118. package/dist/cjs/implement/AVPacketPoolImpl.js +54 -0
  119. package/dist/cjs/implement/AVPacketPoolImpl.js.map +1 -0
  120. package/dist/cjs/pixelFormatDescriptor.d.ts +100 -0
  121. package/dist/cjs/pixelFormatDescriptor.js +1075 -0
  122. package/dist/cjs/pixelFormatDescriptor.js.map +1 -0
  123. package/dist/cjs/pixfmt.d.ts +1294 -0
  124. package/dist/cjs/pixfmt.js +6 -0
  125. package/dist/cjs/pixfmt.js.map +1 -0
  126. package/dist/cjs/sampleFormatDescriptor.d.ts +6 -0
  127. package/dist/cjs/sampleFormatDescriptor.js +55 -0
  128. package/dist/cjs/sampleFormatDescriptor.js.map +1 -0
  129. package/dist/cjs/stringEnum.d.ts +105 -0
  130. package/dist/cjs/stringEnum.js +219 -0
  131. package/dist/cjs/stringEnum.js.map +1 -0
  132. package/dist/cjs/struct/audiosample.d.ts +64 -0
  133. package/dist/cjs/struct/audiosample.js +134 -0
  134. package/dist/cjs/struct/audiosample.js.map +1 -0
  135. package/dist/cjs/struct/avbuffer.d.ts +85 -0
  136. package/dist/cjs/struct/avbuffer.js +319 -0
  137. package/dist/cjs/struct/avbuffer.js.map +1 -0
  138. package/dist/cjs/struct/avcodecparameters.d.ts +163 -0
  139. package/dist/cjs/struct/avcodecparameters.js +380 -0
  140. package/dist/cjs/struct/avcodecparameters.js.map +1 -0
  141. package/dist/cjs/struct/avdict.d.ts +17 -0
  142. package/dist/cjs/struct/avdict.js +74 -0
  143. package/dist/cjs/struct/avdict.js.map +1 -0
  144. package/dist/cjs/struct/avframe.d.ts +559 -0
  145. package/dist/cjs/struct/avframe.js +720 -0
  146. package/dist/cjs/struct/avframe.js.map +1 -0
  147. package/dist/cjs/struct/avpacket.d.ts +125 -0
  148. package/dist/cjs/struct/avpacket.js +286 -0
  149. package/dist/cjs/struct/avpacket.js.map +1 -0
  150. package/dist/cjs/struct/avpcmbuffer.d.ts +44 -0
  151. package/dist/cjs/struct/avpcmbuffer.js +128 -0
  152. package/dist/cjs/struct/avpcmbuffer.js.map +1 -0
  153. package/dist/cjs/struct/avsubtitle.d.ts +30 -0
  154. package/dist/cjs/struct/avsubtitle.js +6 -0
  155. package/dist/cjs/struct/avsubtitle.js.map +1 -0
  156. package/dist/cjs/struct/rational.d.ts +15 -0
  157. package/dist/cjs/struct/rational.js +43 -0
  158. package/dist/cjs/struct/rational.js.map +1 -0
  159. package/dist/cjs/util/amf.d.ts +10 -0
  160. package/dist/cjs/util/amf.js +109 -0
  161. package/dist/cjs/util/amf.js.map +1 -0
  162. package/dist/cjs/util/av1syntax.d.ts +9 -0
  163. package/dist/cjs/util/av1syntax.js +53 -0
  164. package/dist/cjs/util/av1syntax.js.map +1 -0
  165. package/dist/cjs/util/avbuffer.d.ts +17 -0
  166. package/dist/cjs/util/avbuffer.js +147 -0
  167. package/dist/cjs/util/avbuffer.js.map +1 -0
  168. package/dist/cjs/util/avdict.d.ts +8 -0
  169. package/dist/cjs/util/avdict.js +69 -0
  170. package/dist/cjs/util/avdict.js.map +1 -0
  171. package/dist/cjs/util/avframe.d.ts +14 -0
  172. package/dist/cjs/util/avframe.js +233 -0
  173. package/dist/cjs/util/avframe.js.map +1 -0
  174. package/dist/cjs/util/avpacket.d.ts +22 -0
  175. package/dist/cjs/util/avpacket.js +171 -0
  176. package/dist/cjs/util/avpacket.js.map +1 -0
  177. package/dist/cjs/util/channel.d.ts +4 -0
  178. package/dist/cjs/util/channel.js +43 -0
  179. package/dist/cjs/util/channel.js.map +1 -0
  180. package/dist/cjs/util/codecparameters.d.ts +4 -0
  181. package/dist/cjs/util/codecparameters.js +69 -0
  182. package/dist/cjs/util/codecparameters.js.map +1 -0
  183. package/dist/cjs/util/common.d.ts +3 -0
  184. package/dist/cjs/util/common.js +16 -0
  185. package/dist/cjs/util/common.js.map +1 -0
  186. package/dist/cjs/util/crypto.d.ts +1 -0
  187. package/dist/cjs/util/crypto.js +8 -0
  188. package/dist/cjs/util/crypto.js.map +1 -0
  189. package/dist/cjs/util/expgolomb.d.ts +26 -0
  190. package/dist/cjs/util/expgolomb.js +35 -0
  191. package/dist/cjs/util/expgolomb.js.map +1 -0
  192. package/dist/cjs/util/intread.d.ts +9 -0
  193. package/dist/cjs/util/intread.js +36 -0
  194. package/dist/cjs/util/intread.js.map +1 -0
  195. package/dist/cjs/util/intwrite.d.ts +9 -0
  196. package/dist/cjs/util/intwrite.js +36 -0
  197. package/dist/cjs/util/intwrite.js.map +1 -0
  198. package/dist/cjs/util/mem.d.ts +5 -0
  199. package/dist/cjs/util/mem.js +48 -0
  200. package/dist/cjs/util/mem.js.map +1 -0
  201. package/dist/cjs/util/nalu.d.ts +12 -0
  202. package/dist/cjs/util/nalu.js +130 -0
  203. package/dist/cjs/util/nalu.js.map +1 -0
  204. package/dist/cjs/util/ntp.d.ts +1 -0
  205. package/dist/cjs/util/ntp.js +9 -0
  206. package/dist/cjs/util/ntp.js.map +1 -0
  207. package/dist/cjs/util/pcm.d.ts +4 -0
  208. package/dist/cjs/util/pcm.js +141 -0
  209. package/dist/cjs/util/pcm.js.map +1 -0
  210. package/dist/cjs/util/pixel.d.ts +11 -0
  211. package/dist/cjs/util/pixel.js +197 -0
  212. package/dist/cjs/util/pixel.js.map +1 -0
  213. package/dist/cjs/util/rational.d.ts +41 -0
  214. package/dist/cjs/util/rational.js +33 -0
  215. package/dist/cjs/util/rational.js.map +1 -0
  216. package/dist/cjs/util/sample.d.ts +7 -0
  217. package/dist/cjs/util/sample.js +46 -0
  218. package/dist/cjs/util/sample.js.map +1 -0
  219. package/dist/cjs/util/serialize.d.ts +64 -0
  220. package/dist/cjs/util/serialize.js +143 -0
  221. package/dist/cjs/util/serialize.js.map +1 -0
  222. package/dist/esm/AVStream.d.ts +163 -0
  223. package/dist/esm/AVStream.js +34 -0
  224. package/dist/esm/AVStream.js.map +1 -0
  225. package/dist/esm/audiosamplefmt.d.ts +225 -0
  226. package/dist/esm/audiosamplefmt.js +2 -0
  227. package/dist/esm/audiosamplefmt.js.map +1 -0
  228. package/dist/esm/avformat.d.ts +51 -0
  229. package/dist/esm/avformat.js +2 -0
  230. package/dist/esm/avformat.js.map +1 -0
  231. package/dist/esm/codec.d.ts +863 -0
  232. package/dist/esm/codec.js +2 -0
  233. package/dist/esm/codec.js.map +1 -0
  234. package/dist/esm/codecs/aac.d.ts +115 -0
  235. package/dist/esm/codecs/aac.js +132 -0
  236. package/dist/esm/codecs/aac.js.map +1 -0
  237. package/dist/esm/codecs/ac3.d.ts +73 -0
  238. package/dist/esm/codecs/ac3.js +63 -0
  239. package/dist/esm/codecs/ac3.js.map +1 -0
  240. package/dist/esm/codecs/av1.d.ts +72 -0
  241. package/dist/esm/codecs/av1.js +218 -0
  242. package/dist/esm/codecs/av1.js.map +1 -0
  243. package/dist/esm/codecs/dts.d.ts +17 -0
  244. package/dist/esm/codecs/dts.js +34 -0
  245. package/dist/esm/codecs/dts.js.map +1 -0
  246. package/dist/esm/codecs/flac.d.ts +16 -0
  247. package/dist/esm/codecs/flac.js +2 -0
  248. package/dist/esm/codecs/flac.js.map +1 -0
  249. package/dist/esm/codecs/h264.d.ts +137 -0
  250. package/dist/esm/codecs/h264.js +373 -0
  251. package/dist/esm/codecs/h264.js.map +1 -0
  252. package/dist/esm/codecs/hevc.d.ts +163 -0
  253. package/dist/esm/codecs/hevc.js +427 -0
  254. package/dist/esm/codecs/hevc.js.map +1 -0
  255. package/dist/esm/codecs/mp3.d.ts +13 -0
  256. package/dist/esm/codecs/mp3.js +95 -0
  257. package/dist/esm/codecs/mp3.js.map +1 -0
  258. package/dist/esm/codecs/mpeg4.d.ts +7 -0
  259. package/dist/esm/codecs/mpeg4.js +6 -0
  260. package/dist/esm/codecs/mpeg4.js.map +1 -0
  261. package/dist/esm/codecs/mpegvideo.d.ts +7 -0
  262. package/dist/esm/codecs/mpegvideo.js +10 -0
  263. package/dist/esm/codecs/mpegvideo.js.map +1 -0
  264. package/dist/esm/codecs/opus.d.ts +23 -0
  265. package/dist/esm/codecs/opus.js +49 -0
  266. package/dist/esm/codecs/opus.js.map +1 -0
  267. package/dist/esm/codecs/vp8.d.ts +27 -0
  268. package/dist/esm/codecs/vp8.js +30 -0
  269. package/dist/esm/codecs/vp8.js.map +1 -0
  270. package/dist/esm/codecs/vp9.d.ts +42 -0
  271. package/dist/esm/codecs/vp9.js +136 -0
  272. package/dist/esm/codecs/vp9.js.map +1 -0
  273. package/dist/esm/codecs/vvc.d.ts +178 -0
  274. package/dist/esm/codecs/vvc.js +369 -0
  275. package/dist/esm/codecs/vvc.js.map +1 -0
  276. package/dist/esm/constant.d.ts +28 -0
  277. package/dist/esm/constant.js +47 -0
  278. package/dist/esm/constant.js.map +1 -0
  279. package/dist/esm/error.d.ts +9 -0
  280. package/dist/esm/error.js +18 -0
  281. package/dist/esm/error.js.map +1 -0
  282. package/dist/esm/function/analyzeAVFormat.d.ts +3 -0
  283. package/dist/esm/function/analyzeAVFormat.js +30 -0
  284. package/dist/esm/function/analyzeAVFormat.js.map +1 -0
  285. package/dist/esm/function/analyzeUrlIOLoader.d.ts +7 -0
  286. package/dist/esm/function/analyzeUrlIOLoader.js +63 -0
  287. package/dist/esm/function/analyzeUrlIOLoader.js.map +1 -0
  288. package/dist/esm/function/audioData2AVFrame.d.ts +2 -0
  289. package/dist/esm/function/audioData2AVFrame.js +51 -0
  290. package/dist/esm/function/audioData2AVFrame.js.map +1 -0
  291. package/dist/esm/function/avframe2AudioData.d.ts +3 -0
  292. package/dist/esm/function/avframe2AudioData.js +104 -0
  293. package/dist/esm/function/avframe2AudioData.js.map +1 -0
  294. package/dist/esm/function/avframe2VideoFrame.d.ts +6 -0
  295. package/dist/esm/function/avframe2VideoFrame.js +117 -0
  296. package/dist/esm/function/avframe2VideoFrame.js.map +1 -0
  297. package/dist/esm/function/avpacket2EncodedAudioChunk.d.ts +2 -0
  298. package/dist/esm/function/avpacket2EncodedAudioChunk.js +13 -0
  299. package/dist/esm/function/avpacket2EncodedAudioChunk.js.map +1 -0
  300. package/dist/esm/function/avpacket2EncodedVideoChunk.d.ts +2 -0
  301. package/dist/esm/function/avpacket2EncodedVideoChunk.js +13 -0
  302. package/dist/esm/function/avpacket2EncodedVideoChunk.js.map +1 -0
  303. package/dist/esm/function/compileResource.d.ts +2 -0
  304. package/dist/esm/function/compileResource.js +17 -0
  305. package/dist/esm/function/compileResource.js.map +1 -0
  306. package/dist/esm/function/encodedAudioChunk2AVPacket.d.ts +2 -0
  307. package/dist/esm/function/encodedAudioChunk2AVPacket.js +28 -0
  308. package/dist/esm/function/encodedAudioChunk2AVPacket.js.map +1 -0
  309. package/dist/esm/function/encodedVideoChunk2AVPacket.d.ts +7 -0
  310. package/dist/esm/function/encodedVideoChunk2AVPacket.js +35 -0
  311. package/dist/esm/function/encodedVideoChunk2AVPacket.js.map +1 -0
  312. package/dist/esm/function/getAudioCodec.d.ts +2 -0
  313. package/dist/esm/function/getAudioCodec.js +10 -0
  314. package/dist/esm/function/getAudioCodec.js.map +1 -0
  315. package/dist/esm/function/getHardwarePreference.d.ts +1 -0
  316. package/dist/esm/function/getHardwarePreference.js +6 -0
  317. package/dist/esm/function/getHardwarePreference.js.map +1 -0
  318. package/dist/esm/function/getVideoCodec.d.ts +2 -0
  319. package/dist/esm/function/getVideoCodec.js +64 -0
  320. package/dist/esm/function/getVideoCodec.js.map +1 -0
  321. package/dist/esm/function/hasAlphaChannel.d.ts +2 -0
  322. package/dist/esm/function/hasAlphaChannel.js +10 -0
  323. package/dist/esm/function/hasAlphaChannel.js.map +1 -0
  324. package/dist/esm/function/isHdr.d.ts +2 -0
  325. package/dist/esm/function/isHdr.js +10 -0
  326. package/dist/esm/function/isHdr.js.map +1 -0
  327. package/dist/esm/function/videoFrame2AVFrame.d.ts +7 -0
  328. package/dist/esm/function/videoFrame2AVFrame.js +111 -0
  329. package/dist/esm/function/videoFrame2AVFrame.js.map +1 -0
  330. package/dist/esm/implement/AVFramePoolImpl.d.ts +10 -0
  331. package/dist/esm/implement/AVFramePoolImpl.js +32 -0
  332. package/dist/esm/implement/AVFramePoolImpl.js.map +1 -0
  333. package/dist/esm/implement/AVPCMBufferPoolImpl.d.ts +10 -0
  334. package/dist/esm/implement/AVPCMBufferPoolImpl.js +28 -0
  335. package/dist/esm/implement/AVPCMBufferPoolImpl.js.map +1 -0
  336. package/dist/esm/implement/AVPacketPoolImpl.d.ts +10 -0
  337. package/dist/esm/implement/AVPacketPoolImpl.js +32 -0
  338. package/dist/esm/implement/AVPacketPoolImpl.js.map +1 -0
  339. package/dist/esm/pixelFormatDescriptor.d.ts +100 -0
  340. package/dist/esm/pixelFormatDescriptor.js +1071 -0
  341. package/dist/esm/pixelFormatDescriptor.js.map +1 -0
  342. package/dist/esm/pixfmt.d.ts +1294 -0
  343. package/dist/esm/pixfmt.js +2 -0
  344. package/dist/esm/pixfmt.js.map +1 -0
  345. package/dist/esm/sampleFormatDescriptor.d.ts +6 -0
  346. package/dist/esm/sampleFormatDescriptor.js +51 -0
  347. package/dist/esm/sampleFormatDescriptor.js.map +1 -0
  348. package/dist/esm/stringEnum.d.ts +105 -0
  349. package/dist/esm/stringEnum.js +242 -0
  350. package/dist/esm/stringEnum.js.map +1 -0
  351. package/dist/esm/struct/audiosample.d.ts +64 -0
  352. package/dist/esm/struct/audiosample.js +123 -0
  353. package/dist/esm/struct/audiosample.js.map +1 -0
  354. package/dist/esm/struct/avbuffer.d.ts +85 -0
  355. package/dist/esm/struct/avbuffer.js +309 -0
  356. package/dist/esm/struct/avbuffer.js.map +1 -0
  357. package/dist/esm/struct/avcodecparameters.d.ts +163 -0
  358. package/dist/esm/struct/avcodecparameters.js +387 -0
  359. package/dist/esm/struct/avcodecparameters.js.map +1 -0
  360. package/dist/esm/struct/avdict.d.ts +17 -0
  361. package/dist/esm/struct/avdict.js +65 -0
  362. package/dist/esm/struct/avdict.js.map +1 -0
  363. package/dist/esm/struct/avframe.d.ts +559 -0
  364. package/dist/esm/struct/avframe.js +723 -0
  365. package/dist/esm/struct/avframe.js.map +1 -0
  366. package/dist/esm/struct/avpacket.d.ts +125 -0
  367. package/dist/esm/struct/avpacket.js +281 -0
  368. package/dist/esm/struct/avpacket.js.map +1 -0
  369. package/dist/esm/struct/avpcmbuffer.d.ts +44 -0
  370. package/dist/esm/struct/avpcmbuffer.js +120 -0
  371. package/dist/esm/struct/avpcmbuffer.js.map +1 -0
  372. package/dist/esm/struct/avsubtitle.d.ts +30 -0
  373. package/dist/esm/struct/avsubtitle.js +2 -0
  374. package/dist/esm/struct/avsubtitle.js.map +1 -0
  375. package/dist/esm/struct/rational.d.ts +15 -0
  376. package/dist/esm/struct/rational.js +37 -0
  377. package/dist/esm/struct/rational.js.map +1 -0
  378. package/dist/esm/util/amf.d.ts +10 -0
  379. package/dist/esm/util/amf.js +84 -0
  380. package/dist/esm/util/amf.js.map +1 -0
  381. package/dist/esm/util/av1syntax.d.ts +9 -0
  382. package/dist/esm/util/av1syntax.js +54 -0
  383. package/dist/esm/util/av1syntax.js.map +1 -0
  384. package/dist/esm/util/avbuffer.d.ts +17 -0
  385. package/dist/esm/util/avbuffer.js +138 -0
  386. package/dist/esm/util/avbuffer.js.map +1 -0
  387. package/dist/esm/util/avdict.d.ts +8 -0
  388. package/dist/esm/util/avdict.js +77 -0
  389. package/dist/esm/util/avdict.js.map +1 -0
  390. package/dist/esm/util/avframe.d.ts +14 -0
  391. package/dist/esm/util/avframe.js +218 -0
  392. package/dist/esm/util/avframe.js.map +1 -0
  393. package/dist/esm/util/avpacket.d.ts +22 -0
  394. package/dist/esm/util/avpacket.js +161 -0
  395. package/dist/esm/util/avpacket.js.map +1 -0
  396. package/dist/esm/util/channel.d.ts +4 -0
  397. package/dist/esm/util/channel.js +25 -0
  398. package/dist/esm/util/channel.js.map +1 -0
  399. package/dist/esm/util/codecparameters.d.ts +4 -0
  400. package/dist/esm/util/codecparameters.js +73 -0
  401. package/dist/esm/util/codecparameters.js.map +1 -0
  402. package/dist/esm/util/common.d.ts +3 -0
  403. package/dist/esm/util/common.js +14 -0
  404. package/dist/esm/util/common.js.map +1 -0
  405. package/dist/esm/util/crypto.d.ts +1 -0
  406. package/dist/esm/util/crypto.js +4 -0
  407. package/dist/esm/util/crypto.js.map +1 -0
  408. package/dist/esm/util/expgolomb.d.ts +26 -0
  409. package/dist/esm/util/expgolomb.js +36 -0
  410. package/dist/esm/util/expgolomb.js.map +1 -0
  411. package/dist/esm/util/intread.d.ts +9 -0
  412. package/dist/esm/util/intread.js +38 -0
  413. package/dist/esm/util/intread.js.map +1 -0
  414. package/dist/esm/util/intwrite.d.ts +9 -0
  415. package/dist/esm/util/intwrite.js +38 -0
  416. package/dist/esm/util/intwrite.js.map +1 -0
  417. package/dist/esm/util/mem.d.ts +5 -0
  418. package/dist/esm/util/mem.js +34 -0
  419. package/dist/esm/util/mem.js.map +1 -0
  420. package/dist/esm/util/nalu.d.ts +12 -0
  421. package/dist/esm/util/nalu.js +113 -0
  422. package/dist/esm/util/nalu.js.map +1 -0
  423. package/dist/esm/util/ntp.d.ts +1 -0
  424. package/dist/esm/util/ntp.js +5 -0
  425. package/dist/esm/util/ntp.js.map +1 -0
  426. package/dist/esm/util/pcm.d.ts +4 -0
  427. package/dist/esm/util/pcm.js +139 -0
  428. package/dist/esm/util/pcm.js.map +1 -0
  429. package/dist/esm/util/pixel.d.ts +11 -0
  430. package/dist/esm/util/pixel.js +180 -0
  431. package/dist/esm/util/pixel.js.map +1 -0
  432. package/dist/esm/util/rational.d.ts +41 -0
  433. package/dist/esm/util/rational.js +33 -0
  434. package/dist/esm/util/rational.js.map +1 -0
  435. package/dist/esm/util/sample.d.ts +7 -0
  436. package/dist/esm/util/sample.js +48 -0
  437. package/dist/esm/util/sample.js.map +1 -0
  438. package/dist/esm/util/serialize.d.ts +64 -0
  439. package/dist/esm/util/serialize.js +136 -0
  440. package/dist/esm/util/serialize.js.map +1 -0
  441. package/include/audiosample.h +186 -0
  442. package/include/avbuffer.h +104 -0
  443. package/include/avcodec.h +585 -0
  444. package/include/avcodecparameters.h +189 -0
  445. package/include/avdict.h +23 -0
  446. package/include/avframe.h +1053 -0
  447. package/include/avpacket.h +498 -0
  448. package/include/avpcmbuffer.h +82 -0
  449. package/include/pixfmt.h +204 -0
  450. package/include/rational.h +10 -0
  451. package/package.json +386 -0
@@ -0,0 +1,1053 @@
1
+ #ifndef _LIBMEDIA_AVUTIL_AVFRAME_H_
2
+
3
+ #define _LIBMEDIA_AVUTIL_AVFRAME_H_
4
+
5
+ #define FF_API_INTERLACED_FRAME 1
6
+ #define FF_API_FRAME_KEY 1
7
+ #define FF_API_PALETTE_HAS_CHANGED 1
8
+ #define API_FRAME_PKT 1
9
+
10
+ #include <stddef.h>
11
+ #include <stdint.h>
12
+ #include "rational.h"
13
+ #include "pixfmt.h"
14
+ #include "avbuffer.h"
15
+ #include "avdct.h"
16
+
17
+ enum AVPictureType {
18
+ AV_PICTURE_TYPE_NONE = 0, ///< Undefined
19
+ AV_PICTURE_TYPE_I, ///< Intra
20
+ AV_PICTURE_TYPE_P, ///< Predicted
21
+ AV_PICTURE_TYPE_B, ///< Bi-dir predicted
22
+ AV_PICTURE_TYPE_S, ///< S(GMC)-VOP MPEG-4
23
+ AV_PICTURE_TYPE_SI, ///< Switching Intra
24
+ AV_PICTURE_TYPE_SP, ///< Switching Predicted
25
+ AV_PICTURE_TYPE_BI, ///< BI type
26
+ };
27
+
28
+ /**
29
+ * @defgroup lavu_frame AVFrame
30
+ * @ingroup lavu_data
31
+ *
32
+ * @{
33
+ * AVFrame is an abstraction for reference-counted raw multimedia data.
34
+ */
35
+
36
+ enum AVFrameSideDataType {
37
+ /**
38
+ * The data is the AVPanScan struct defined in libavcodec.
39
+ */
40
+ AV_FRAME_DATA_PANSCAN,
41
+ /**
42
+ * ATSC A53 Part 4 Closed Captions.
43
+ * A53 CC bitstream is stored as uint8_t in AVFrameSideData.data.
44
+ * The number of bytes of CC data is AVFrameSideData.size.
45
+ */
46
+ AV_FRAME_DATA_A53_CC,
47
+ /**
48
+ * Stereoscopic 3d metadata.
49
+ * The data is the AVStereo3D struct defined in libavutil/stereo3d.h.
50
+ */
51
+ AV_FRAME_DATA_STEREO3D,
52
+ /**
53
+ * The data is the AVMatrixEncoding enum defined in libavutil/channel_layout.h.
54
+ */
55
+ AV_FRAME_DATA_MATRIXENCODING,
56
+ /**
57
+ * Metadata relevant to a downmix procedure.
58
+ * The data is the AVDownmixInfo struct defined in libavutil/downmix_info.h.
59
+ */
60
+ AV_FRAME_DATA_DOWNMIX_INFO,
61
+ /**
62
+ * ReplayGain information in the form of the AVReplayGain struct.
63
+ */
64
+ AV_FRAME_DATA_REPLAYGAIN,
65
+ /**
66
+ * This side data contains a 3x3 transformation matrix describing an affine
67
+ * transformation that needs to be applied to the frame for correct
68
+ * presentation.
69
+ *
70
+ * See libavutil/display.h for a detailed description of the data.
71
+ */
72
+ AV_FRAME_DATA_DISPLAYMATRIX,
73
+ /**
74
+ * Active Format Description data consisting of a single byte as specified
75
+ * in ETSI TS 101 154 using AVActiveFormatDescription enum.
76
+ */
77
+ AV_FRAME_DATA_AFD,
78
+ /**
79
+ * Motion vectors exported by some codecs (on demand through the export_mvs
80
+ * flag set in the libavcodec AVCodecContext flags2 option).
81
+ * The data is the AVMotionVector struct defined in
82
+ * libavutil/motion_vector.h.
83
+ */
84
+ AV_FRAME_DATA_MOTION_VECTORS,
85
+ /**
86
+ * Recommmends skipping the specified number of samples. This is exported
87
+ * only if the "skip_manual" AVOption is set in libavcodec.
88
+ * This has the same format as AV_PKT_DATA_SKIP_SAMPLES.
89
+ * @code
90
+ * u32le number of samples to skip from start of this packet
91
+ * u32le number of samples to skip from end of this packet
92
+ * u8 reason for start skip
93
+ * u8 reason for end skip (0=padding silence, 1=convergence)
94
+ * @endcode
95
+ */
96
+ AV_FRAME_DATA_SKIP_SAMPLES,
97
+ /**
98
+ * This side data must be associated with an audio frame and corresponds to
99
+ * enum AVAudioServiceType defined in avcodec.h.
100
+ */
101
+ AV_FRAME_DATA_AUDIO_SERVICE_TYPE,
102
+ /**
103
+ * Mastering display metadata associated with a video frame. The payload is
104
+ * an AVMasteringDisplayMetadata type and contains information about the
105
+ * mastering display color volume.
106
+ */
107
+ AV_FRAME_DATA_MASTERING_DISPLAY_METADATA,
108
+ /**
109
+ * The GOP timecode in 25 bit timecode format. Data format is 64-bit integer.
110
+ * This is set on the first frame of a GOP that has a temporal reference of 0.
111
+ */
112
+ AV_FRAME_DATA_GOP_TIMECODE,
113
+
114
+ /**
115
+ * The data represents the AVSphericalMapping structure defined in
116
+ * libavutil/spherical.h.
117
+ */
118
+ AV_FRAME_DATA_SPHERICAL,
119
+
120
+ /**
121
+ * Content light level (based on CTA-861.3). This payload contains data in
122
+ * the form of the AVContentLightMetadata struct.
123
+ */
124
+ AV_FRAME_DATA_CONTENT_LIGHT_LEVEL,
125
+
126
+ /**
127
+ * The data contains an ICC profile as an opaque octet buffer following the
128
+ * format described by ISO 15076-1 with an optional name defined in the
129
+ * metadata key entry "name".
130
+ */
131
+ AV_FRAME_DATA_ICC_PROFILE,
132
+
133
+ /**
134
+ * Timecode which conforms to SMPTE ST 12-1. The data is an array of 4 uint32_t
135
+ * where the first uint32_t describes how many (1-3) of the other timecodes are used.
136
+ * The timecode format is described in the documentation of av_timecode_get_smpte_from_framenum()
137
+ * function in libavutil/timecode.h.
138
+ */
139
+ AV_FRAME_DATA_S12M_TIMECODE,
140
+
141
+ /**
142
+ * HDR dynamic metadata associated with a video frame. The payload is
143
+ * an AVDynamicHDRPlus type and contains information for color
144
+ * volume transform - application 4 of SMPTE 2094-40:2016 standard.
145
+ */
146
+ AV_FRAME_DATA_DYNAMIC_HDR_PLUS,
147
+
148
+ /**
149
+ * Regions Of Interest, the data is an array of AVRegionOfInterest type, the number of
150
+ * array element is implied by AVFrameSideData.size / AVRegionOfInterest.self_size.
151
+ */
152
+ AV_FRAME_DATA_REGIONS_OF_INTEREST,
153
+
154
+ /**
155
+ * Encoding parameters for a video frame, as described by AVVideoEncParams.
156
+ */
157
+ AV_FRAME_DATA_VIDEO_ENC_PARAMS,
158
+
159
+ /**
160
+ * User data unregistered metadata associated with a video frame.
161
+ * This is the H.26[45] UDU SEI message, and shouldn't be used for any other purpose
162
+ * The data is stored as uint8_t in AVFrameSideData.data which is 16 bytes of
163
+ * uuid_iso_iec_11578 followed by AVFrameSideData.size - 16 bytes of user_data_payload_byte.
164
+ */
165
+ AV_FRAME_DATA_SEI_UNREGISTERED,
166
+
167
+ /**
168
+ * Film grain parameters for a frame, described by AVFilmGrainParams.
169
+ * Must be present for every frame which should have film grain applied.
170
+ *
171
+ * May be present multiple times, for example when there are multiple
172
+ * alternative parameter sets for different video signal characteristics.
173
+ * The user should select the most appropriate set for the application.
174
+ */
175
+ AV_FRAME_DATA_FILM_GRAIN_PARAMS,
176
+
177
+ /**
178
+ * Bounding boxes for object detection and classification,
179
+ * as described by AVDetectionBBoxHeader.
180
+ */
181
+ AV_FRAME_DATA_DETECTION_BBOXES,
182
+
183
+ /**
184
+ * Dolby Vision RPU raw data, suitable for passing to x265
185
+ * or other libraries. Array of uint8_t, with NAL emulation
186
+ * bytes intact.
187
+ */
188
+ AV_FRAME_DATA_DOVI_RPU_BUFFER,
189
+
190
+ /**
191
+ * Parsed Dolby Vision metadata, suitable for passing to a software
192
+ * implementation. The payload is the AVDOVIMetadata struct defined in
193
+ * libavutil/dovi_meta.h.
194
+ */
195
+ AV_FRAME_DATA_DOVI_METADATA,
196
+
197
+ /**
198
+ * HDR Vivid dynamic metadata associated with a video frame. The payload is
199
+ * an AVDynamicHDRVivid type and contains information for color
200
+ * volume transform - CUVA 005.1-2021.
201
+ */
202
+ AV_FRAME_DATA_DYNAMIC_HDR_VIVID,
203
+
204
+ /**
205
+ * Ambient viewing environment metadata, as defined by H.274.
206
+ */
207
+ AV_FRAME_DATA_AMBIENT_VIEWING_ENVIRONMENT,
208
+
209
+ /**
210
+ * Provide encoder-specific hinting information about changed/unchanged
211
+ * portions of a frame. It can be used to pass information about which
212
+ * macroblocks can be skipped because they didn't change from the
213
+ * corresponding ones in the previous frame. This could be useful for
214
+ * applications which know this information in advance to speed up
215
+ * encoding.
216
+ */
217
+ AV_FRAME_DATA_VIDEO_HINT,
218
+ };
219
+
220
+ /**
221
+ * Structure to hold side data for an AVFrame.
222
+ *
223
+ * sizeof(AVFrameSideData) is not a part of the public ABI, so new fields may be added
224
+ * to the end with a minor bump.
225
+ */
226
+ typedef struct AVFrameSideData {
227
+ enum AVFrameSideDataType type;
228
+ uint8_t *data;
229
+ size_t size;
230
+ AVDictionary *metadata;
231
+ AVBufferRef *buf;
232
+ } AVFrameSideData;
233
+
234
+ typedef struct AVFrame {
235
+ #define AV_NUM_DATA_POINTERS 8
236
+ /**
237
+ * pointer to the picture/channel planes.
238
+ * This might be different from the first allocated byte. For video,
239
+ * it could even point to the end of the image data.
240
+ *
241
+ * All pointers in data and extended_data must point into one of the
242
+ * AVBufferRef in buf or extended_buf.
243
+ *
244
+ * Some decoders access areas outside 0,0 - width,height, please
245
+ * see avcodec_align_dimensions2(). Some filters and swscale can read
246
+ * up to 16 bytes beyond the planes, if these filters are to be used,
247
+ * then 16 extra bytes must be allocated.
248
+ *
249
+ * NOTE: Pointers not needed by the format MUST be set to NULL.
250
+ *
251
+ * @attention In case of video, the data[] pointers can point to the
252
+ * end of image data in order to reverse line order, when used in
253
+ * combination with negative values in the linesize[] array.
254
+ */
255
+ uint8_t *data[AV_NUM_DATA_POINTERS];
256
+
257
+ /**
258
+ * For video, a positive or negative value, which is typically indicating
259
+ * the size in bytes of each picture line, but it can also be:
260
+ * - the negative byte size of lines for vertical flipping
261
+ * (with data[n] pointing to the end of the data
262
+ * - a positive or negative multiple of the byte size as for accessing
263
+ * even and odd fields of a frame (possibly flipped)
264
+ *
265
+ * For audio, only linesize[0] may be set. For planar audio, each channel
266
+ * plane must be the same size.
267
+ *
268
+ * For video the linesizes should be multiples of the CPUs alignment
269
+ * preference, this is 16 or 32 for modern desktop CPUs.
270
+ * Some code requires such alignment other code can be slower without
271
+ * correct alignment, for yet other it makes no difference.
272
+ *
273
+ * @note The linesize may be larger than the size of usable data -- there
274
+ * may be extra padding present for performance reasons.
275
+ *
276
+ * @attention In case of video, line size values can be negative to achieve
277
+ * a vertically inverted iteration over image lines.
278
+ */
279
+ int linesize[AV_NUM_DATA_POINTERS];
280
+
281
+ /**
282
+ * pointers to the data planes/channels.
283
+ *
284
+ * For video, this should simply point to data[].
285
+ *
286
+ * For planar audio, each channel has a separate data pointer, and
287
+ * linesize[0] contains the size of each channel buffer.
288
+ * For packed audio, there is just one data pointer, and linesize[0]
289
+ * contains the total size of the buffer for all channels.
290
+ *
291
+ * Note: Both data and extended_data should always be set in a valid frame,
292
+ * but for planar audio with more channels that can fit in data,
293
+ * extended_data must be used in order to access all channels.
294
+ */
295
+ uint8_t **extended_data;
296
+
297
+ /**
298
+ * @name Video dimensions
299
+ * Video frames only. The coded dimensions (in pixels) of the video frame,
300
+ * i.e. the size of the rectangle that contains some well-defined values.
301
+ *
302
+ * @note The part of the frame intended for display/presentation is further
303
+ * restricted by the @ref cropping "Cropping rectangle".
304
+ * @{
305
+ */
306
+ int width, height;
307
+ /**
308
+ * @}
309
+ */
310
+
311
+ /**
312
+ * number of audio samples (per channel) described by this frame
313
+ */
314
+ int nb_samples;
315
+
316
+ /**
317
+ * format of the frame, -1 if unknown or unset
318
+ * Values correspond to enum AVPixelFormat for video frames,
319
+ * enum AVSampleFormat for audio)
320
+ */
321
+ int format;
322
+
323
+ #if FF_API_FRAME_KEY
324
+ /**
325
+ * 1 -> keyframe, 0-> not
326
+ *
327
+ * @deprecated Use AV_FRAME_FLAG_KEY instead
328
+ */
329
+ attribute_deprecated
330
+ int key_frame;
331
+ #endif
332
+
333
+ /**
334
+ * Picture type of the frame.
335
+ */
336
+ enum AVPictureType pict_type;
337
+
338
+ /**
339
+ * Sample aspect ratio for the video frame, 0/1 if unknown/unspecified.
340
+ */
341
+ AVRational sample_aspect_ratio;
342
+
343
+ /**
344
+ * Presentation timestamp in time_base units (time when frame should be shown to user).
345
+ */
346
+ int64_t pts;
347
+
348
+ /**
349
+ * DTS copied from the AVPacket that triggered returning this frame. (if frame threading isn't used)
350
+ * This is also the Presentation time of this AVFrame calculated from
351
+ * only AVPacket.dts values without pts values.
352
+ */
353
+ int64_t pkt_dts;
354
+
355
+ /**
356
+ * Time base for the timestamps in this frame.
357
+ * In the future, this field may be set on frames output by decoders or
358
+ * filters, but its value will be by default ignored on input to encoders
359
+ * or filters.
360
+ */
361
+ AVRational time_base;
362
+
363
+ /**
364
+ * quality (between 1 (good) and FF_LAMBDA_MAX (bad))
365
+ */
366
+ int quality;
367
+
368
+ /**
369
+ * Frame owner's private data.
370
+ *
371
+ * This field may be set by the code that allocates/owns the frame data.
372
+ * It is then not touched by any library functions, except:
373
+ * - it is copied to other references by av_frame_copy_props() (and hence by
374
+ * av_frame_ref());
375
+ * - it is set to NULL when the frame is cleared by av_frame_unref()
376
+ * - on the caller's explicit request. E.g. libavcodec encoders/decoders
377
+ * will copy this field to/from @ref AVPacket "AVPackets" if the caller sets
378
+ * @ref AV_CODEC_FLAG_COPY_OPAQUE.
379
+ *
380
+ * @see opaque_ref the reference-counted analogue
381
+ */
382
+ void *opaque;
383
+
384
+ /**
385
+ * Number of fields in this frame which should be repeated, i.e. the total
386
+ * duration of this frame should be repeat_pict + 2 normal field durations.
387
+ *
388
+ * For interlaced frames this field may be set to 1, which signals that this
389
+ * frame should be presented as 3 fields: beginning with the first field (as
390
+ * determined by AV_FRAME_FLAG_TOP_FIELD_FIRST being set or not), followed
391
+ * by the second field, and then the first field again.
392
+ *
393
+ * For progressive frames this field may be set to a multiple of 2, which
394
+ * signals that this frame's duration should be (repeat_pict + 2) / 2
395
+ * normal frame durations.
396
+ *
397
+ * @note This field is computed from MPEG2 repeat_first_field flag and its
398
+ * associated flags, H.264 pic_struct from picture timing SEI, and
399
+ * their analogues in other codecs. Typically it should only be used when
400
+ * higher-layer timing information is not available.
401
+ */
402
+ int repeat_pict;
403
+
404
+ #if FF_API_INTERLACED_FRAME
405
+ /**
406
+ * The content of the picture is interlaced.
407
+ *
408
+ * @deprecated Use AV_FRAME_FLAG_INTERLACED instead
409
+ */
410
+ attribute_deprecated
411
+ int interlaced_frame;
412
+
413
+ /**
414
+ * If the content is interlaced, is top field displayed first.
415
+ *
416
+ * @deprecated Use AV_FRAME_FLAG_TOP_FIELD_FIRST instead
417
+ */
418
+ attribute_deprecated
419
+ int top_field_first;
420
+ #endif
421
+
422
+ #if FF_API_PALETTE_HAS_CHANGED
423
+ /**
424
+ * Tell user application that palette has changed from previous frame.
425
+ */
426
+ attribute_deprecated
427
+ int palette_has_changed;
428
+ #endif
429
+
430
+ /**
431
+ * Sample rate of the audio data.
432
+ */
433
+ int sample_rate;
434
+
435
+ /**
436
+ * AVBuffer references backing the data for this frame. All the pointers in
437
+ * data and extended_data must point inside one of the buffers in buf or
438
+ * extended_buf. This array must be filled contiguously -- if buf[i] is
439
+ * non-NULL then buf[j] must also be non-NULL for all j < i.
440
+ *
441
+ * There may be at most one AVBuffer per data plane, so for video this array
442
+ * always contains all the references. For planar audio with more than
443
+ * AV_NUM_DATA_POINTERS channels, there may be more buffers than can fit in
444
+ * this array. Then the extra AVBufferRef pointers are stored in the
445
+ * extended_buf array.
446
+ */
447
+ AVBufferRef *buf[AV_NUM_DATA_POINTERS];
448
+
449
+ /**
450
+ * For planar audio which requires more than AV_NUM_DATA_POINTERS
451
+ * AVBufferRef pointers, this array will hold all the references which
452
+ * cannot fit into AVFrame.buf.
453
+ *
454
+ * Note that this is different from AVFrame.extended_data, which always
455
+ * contains all the pointers. This array only contains the extra pointers,
456
+ * which cannot fit into AVFrame.buf.
457
+ *
458
+ * This array is always allocated using av_malloc() by whoever constructs
459
+ * the frame. It is freed in av_frame_unref().
460
+ */
461
+ AVBufferRef **extended_buf;
462
+ /**
463
+ * Number of elements in extended_buf.
464
+ */
465
+ int nb_extended_buf;
466
+
467
+ AVFrameSideData **side_data;
468
+ int nb_side_data;
469
+
470
+ /**
471
+ * @defgroup lavu_frame_flags AV_FRAME_FLAGS
472
+ * @ingroup lavu_frame
473
+ * Flags describing additional frame properties.
474
+ *
475
+ * @{
476
+ */
477
+
478
+ /**
479
+ * The frame data may be corrupted, e.g. due to decoding errors.
480
+ */
481
+ #define AV_FRAME_FLAG_CORRUPT (1 << 0)
482
+ /**
483
+ * A flag to mark frames that are keyframes.
484
+ */
485
+ #define AV_FRAME_FLAG_KEY (1 << 1)
486
+ /**
487
+ * A flag to mark the frames which need to be decoded, but shouldn't be output.
488
+ */
489
+ #define AV_FRAME_FLAG_DISCARD (1 << 2)
490
+ /**
491
+ * A flag to mark frames whose content is interlaced.
492
+ */
493
+ #define AV_FRAME_FLAG_INTERLACED (1 << 3)
494
+ /**
495
+ * A flag to mark frames where the top field is displayed first if the content
496
+ * is interlaced.
497
+ */
498
+ #define AV_FRAME_FLAG_TOP_FIELD_FIRST (1 << 4)
499
+ /**
500
+ * @}
501
+ */
502
+
503
+ /**
504
+ * Frame flags, a combination of @ref lavu_frame_flags
505
+ */
506
+ int flags;
507
+
508
+ /**
509
+ * MPEG vs JPEG YUV range.
510
+ * - encoding: Set by user
511
+ * - decoding: Set by libavcodec
512
+ */
513
+ enum AVColorRange color_range;
514
+
515
+ enum AVColorPrimaries color_primaries;
516
+
517
+ enum AVColorTransferCharacteristic color_trc;
518
+
519
+ /**
520
+ * YUV colorspace type.
521
+ * - encoding: Set by user
522
+ * - decoding: Set by libavcodec
523
+ */
524
+ enum AVColorSpace colorspace;
525
+
526
+ enum AVChromaLocation chroma_location;
527
+
528
+ /**
529
+ * frame timestamp estimated using various heuristics, in stream time base
530
+ * - encoding: unused
531
+ * - decoding: set by libavcodec, read by user.
532
+ */
533
+ int64_t best_effort_timestamp;
534
+
535
+ #if FF_API_FRAME_PKT
536
+ /**
537
+ * reordered pos from the last AVPacket that has been input into the decoder
538
+ * - encoding: unused
539
+ * - decoding: Read by user.
540
+ * @deprecated use AV_CODEC_FLAG_COPY_OPAQUE to pass through arbitrary user
541
+ * data from packets to frames
542
+ */
543
+ attribute_deprecated
544
+ int64_t pkt_pos;
545
+ #endif
546
+
547
+ /**
548
+ * metadata.
549
+ * - encoding: Set by user.
550
+ * - decoding: Set by libavcodec.
551
+ */
552
+ AVDictionary *metadata;
553
+
554
+ /**
555
+ * decode error flags of the frame, set to a combination of
556
+ * FF_DECODE_ERROR_xxx flags if the decoder produced a frame, but there
557
+ * were errors during the decoding.
558
+ * - encoding: unused
559
+ * - decoding: set by libavcodec, read by user.
560
+ */
561
+ int decode_error_flags;
562
+ #define FF_DECODE_ERROR_INVALID_BITSTREAM 1
563
+ #define FF_DECODE_ERROR_MISSING_REFERENCE 2
564
+ #define FF_DECODE_ERROR_CONCEALMENT_ACTIVE 4
565
+ #define FF_DECODE_ERROR_DECODE_SLICES 8
566
+
567
+ #if FF_API_FRAME_PKT
568
+ /**
569
+ * size of the corresponding packet containing the compressed
570
+ * frame.
571
+ * It is set to a negative value if unknown.
572
+ * - encoding: unused
573
+ * - decoding: set by libavcodec, read by user.
574
+ * @deprecated use AV_CODEC_FLAG_COPY_OPAQUE to pass through arbitrary user
575
+ * data from packets to frames
576
+ */
577
+ attribute_deprecated
578
+ int pkt_size;
579
+ #endif
580
+
581
+ /**
582
+ * For hwaccel-format frames, this should be a reference to the
583
+ * AVHWFramesContext describing the frame.
584
+ */
585
+ AVBufferRef *hw_frames_ctx;
586
+
587
+ /**
588
+ * Frame owner's private data.
589
+ *
590
+ * This field may be set by the code that allocates/owns the frame data.
591
+ * It is then not touched by any library functions, except:
592
+ * - a new reference to the underlying buffer is propagated by
593
+ * av_frame_copy_props() (and hence by av_frame_ref());
594
+ * - it is unreferenced in av_frame_unref();
595
+ * - on the caller's explicit request. E.g. libavcodec encoders/decoders
596
+ * will propagate a new reference to/from @ref AVPacket "AVPackets" if the
597
+ * caller sets @ref AV_CODEC_FLAG_COPY_OPAQUE.
598
+ *
599
+ * @see opaque the plain pointer analogue
600
+ */
601
+ AVBufferRef *opaque_ref;
602
+
603
+ /**
604
+ * @anchor cropping
605
+ * @name Cropping
606
+ * Video frames only. The number of pixels to discard from the the
607
+ * top/bottom/left/right border of the frame to obtain the sub-rectangle of
608
+ * the frame intended for presentation.
609
+ * @{
610
+ */
611
+ size_t crop_top;
612
+ size_t crop_bottom;
613
+ size_t crop_left;
614
+ size_t crop_right;
615
+ /**
616
+ * @}
617
+ */
618
+
619
+ /**
620
+ * AVBufferRef for internal use by a single libav* library.
621
+ * Must not be used to transfer data between libraries.
622
+ * Has to be NULL when ownership of the frame leaves the respective library.
623
+ *
624
+ * Code outside the FFmpeg libs should never check or change the contents of the buffer ref.
625
+ *
626
+ * FFmpeg calls av_buffer_unref() on it when the frame is unreferenced.
627
+ * av_frame_copy_props() calls create a new reference with av_buffer_ref()
628
+ * for the target frame's private_ref field.
629
+ */
630
+ AVBufferRef *private_ref;
631
+
632
+ /**
633
+ * Channel layout of the audio data.
634
+ */
635
+ AVChannelLayout ch_layout;
636
+
637
+ /**
638
+ * Duration of the frame, in the same units as pts. 0 if unknown.
639
+ */
640
+ int64_t duration;
641
+ } AVFrame;
642
+
643
+ typedef struct AVFrameRef {
644
+ /**
645
+ * pointer to the picture/channel planes.
646
+ * This might be different from the first allocated byte. For video,
647
+ * it could even point to the end of the image data.
648
+ *
649
+ * All pointers in data and extended_data must point into one of the
650
+ * AVBufferRef in buf or extended_buf.
651
+ *
652
+ * Some decoders access areas outside 0,0 - width,height, please
653
+ * see avcodec_align_dimensions2(). Some filters and swscale can read
654
+ * up to 16 bytes beyond the planes, if these filters are to be used,
655
+ * then 16 extra bytes must be allocated.
656
+ *
657
+ * NOTE: Pointers not needed by the format MUST be set to NULL.
658
+ *
659
+ * @attention In case of video, the data[] pointers can point to the
660
+ * end of image data in order to reverse line order, when used in
661
+ * combination with negative values in the linesize[] array.
662
+ */
663
+ uint8_t *data[AV_NUM_DATA_POINTERS];
664
+
665
+ /**
666
+ * For video, a positive or negative value, which is typically indicating
667
+ * the size in bytes of each picture line, but it can also be:
668
+ * - the negative byte size of lines for vertical flipping
669
+ * (with data[n] pointing to the end of the data
670
+ * - a positive or negative multiple of the byte size as for accessing
671
+ * even and odd fields of a frame (possibly flipped)
672
+ *
673
+ * For audio, only linesize[0] may be set. For planar audio, each channel
674
+ * plane must be the same size.
675
+ *
676
+ * For video the linesizes should be multiples of the CPUs alignment
677
+ * preference, this is 16 or 32 for modern desktop CPUs.
678
+ * Some code requires such alignment other code can be slower without
679
+ * correct alignment, for yet other it makes no difference.
680
+ *
681
+ * @note The linesize may be larger than the size of usable data -- there
682
+ * may be extra padding present for performance reasons.
683
+ *
684
+ * @attention In case of video, line size values can be negative to achieve
685
+ * a vertically inverted iteration over image lines.
686
+ */
687
+ int linesize[AV_NUM_DATA_POINTERS];
688
+
689
+ /**
690
+ * pointers to the data planes/channels.
691
+ *
692
+ * For video, this should simply point to data[].
693
+ *
694
+ * For planar audio, each channel has a separate data pointer, and
695
+ * linesize[0] contains the size of each channel buffer.
696
+ * For packed audio, there is just one data pointer, and linesize[0]
697
+ * contains the total size of the buffer for all channels.
698
+ *
699
+ * Note: Both data and extended_data should always be set in a valid frame,
700
+ * but for planar audio with more channels that can fit in data,
701
+ * extended_data must be used in order to access all channels.
702
+ */
703
+ uint8_t **extended_data;
704
+
705
+ /**
706
+ * @name Video dimensions
707
+ * Video frames only. The coded dimensions (in pixels) of the video frame,
708
+ * i.e. the size of the rectangle that contains some well-defined values.
709
+ *
710
+ * @note The part of the frame intended for display/presentation is further
711
+ * restricted by the @ref cropping "Cropping rectangle".
712
+ * @{
713
+ */
714
+ int width, height;
715
+ /**
716
+ * @}
717
+ */
718
+
719
+ /**
720
+ * number of audio samples (per channel) described by this frame
721
+ */
722
+ int nb_samples;
723
+
724
+ /**
725
+ * format of the frame, -1 if unknown or unset
726
+ * Values correspond to enum AVPixelFormat for video frames,
727
+ * enum AVSampleFormat for audio)
728
+ */
729
+ int format;
730
+
731
+ #if FF_API_FRAME_KEY
732
+ /**
733
+ * 1 -> keyframe, 0-> not
734
+ *
735
+ * @deprecated Use AV_FRAME_FLAG_KEY instead
736
+ */
737
+ attribute_deprecated
738
+ int key_frame;
739
+ #endif
740
+
741
+ /**
742
+ * Picture type of the frame.
743
+ */
744
+ enum AVPictureType pict_type;
745
+
746
+ /**
747
+ * Sample aspect ratio for the video frame, 0/1 if unknown/unspecified.
748
+ */
749
+ AVRational sample_aspect_ratio;
750
+
751
+ /**
752
+ * Presentation timestamp in time_base units (time when frame should be shown to user).
753
+ */
754
+ int64_t pts;
755
+
756
+ /**
757
+ * DTS copied from the AVPacket that triggered returning this frame. (if frame threading isn't used)
758
+ * This is also the Presentation time of this AVFrame calculated from
759
+ * only AVPacket.dts values without pts values.
760
+ */
761
+ int64_t pkt_dts;
762
+
763
+ /**
764
+ * Time base for the timestamps in this frame.
765
+ * In the future, this field may be set on frames output by decoders or
766
+ * filters, but its value will be by default ignored on input to encoders
767
+ * or filters.
768
+ */
769
+ AVRational time_base;
770
+
771
+ /**
772
+ * quality (between 1 (good) and FF_LAMBDA_MAX (bad))
773
+ */
774
+ int quality;
775
+
776
+ /**
777
+ * Frame owner's private data.
778
+ *
779
+ * This field may be set by the code that allocates/owns the frame data.
780
+ * It is then not touched by any library functions, except:
781
+ * - it is copied to other references by av_frame_copy_props() (and hence by
782
+ * av_frame_ref());
783
+ * - it is set to NULL when the frame is cleared by av_frame_unref()
784
+ * - on the caller's explicit request. E.g. libavcodec encoders/decoders
785
+ * will copy this field to/from @ref AVPacket "AVPackets" if the caller sets
786
+ * @ref AV_CODEC_FLAG_COPY_OPAQUE.
787
+ *
788
+ * @see opaque_ref the reference-counted analogue
789
+ */
790
+ void *opaque;
791
+
792
+ /**
793
+ * Number of fields in this frame which should be repeated, i.e. the total
794
+ * duration of this frame should be repeat_pict + 2 normal field durations.
795
+ *
796
+ * For interlaced frames this field may be set to 1, which signals that this
797
+ * frame should be presented as 3 fields: beginning with the first field (as
798
+ * determined by AV_FRAME_FLAG_TOP_FIELD_FIRST being set or not), followed
799
+ * by the second field, and then the first field again.
800
+ *
801
+ * For progressive frames this field may be set to a multiple of 2, which
802
+ * signals that this frame's duration should be (repeat_pict + 2) / 2
803
+ * normal frame durations.
804
+ *
805
+ * @note This field is computed from MPEG2 repeat_first_field flag and its
806
+ * associated flags, H.264 pic_struct from picture timing SEI, and
807
+ * their analogues in other codecs. Typically it should only be used when
808
+ * higher-layer timing information is not available.
809
+ */
810
+ int repeat_pict;
811
+
812
+ #if FF_API_INTERLACED_FRAME
813
+ /**
814
+ * The content of the picture is interlaced.
815
+ *
816
+ * @deprecated Use AV_FRAME_FLAG_INTERLACED instead
817
+ */
818
+ attribute_deprecated
819
+ int interlaced_frame;
820
+
821
+ /**
822
+ * If the content is interlaced, is top field displayed first.
823
+ *
824
+ * @deprecated Use AV_FRAME_FLAG_TOP_FIELD_FIRST instead
825
+ */
826
+ attribute_deprecated
827
+ int top_field_first;
828
+ #endif
829
+
830
+ #if FF_API_PALETTE_HAS_CHANGED
831
+ /**
832
+ * Tell user application that palette has changed from previous frame.
833
+ */
834
+ attribute_deprecated
835
+ int palette_has_changed;
836
+ #endif
837
+
838
+ /**
839
+ * Sample rate of the audio data.
840
+ */
841
+ int sample_rate;
842
+
843
+ /**
844
+ * AVBuffer references backing the data for this frame. All the pointers in
845
+ * data and extended_data must point inside one of the buffers in buf or
846
+ * extended_buf. This array must be filled contiguously -- if buf[i] is
847
+ * non-NULL then buf[j] must also be non-NULL for all j < i.
848
+ *
849
+ * There may be at most one AVBuffer per data plane, so for video this array
850
+ * always contains all the references. For planar audio with more than
851
+ * AV_NUM_DATA_POINTERS channels, there may be more buffers than can fit in
852
+ * this array. Then the extra AVBufferRef pointers are stored in the
853
+ * extended_buf array.
854
+ */
855
+ AVBufferRef *buf[AV_NUM_DATA_POINTERS];
856
+
857
+ /**
858
+ * For planar audio which requires more than AV_NUM_DATA_POINTERS
859
+ * AVBufferRef pointers, this array will hold all the references which
860
+ * cannot fit into AVFrame.buf.
861
+ *
862
+ * Note that this is different from AVFrame.extended_data, which always
863
+ * contains all the pointers. This array only contains the extra pointers,
864
+ * which cannot fit into AVFrame.buf.
865
+ *
866
+ * This array is always allocated using av_malloc() by whoever constructs
867
+ * the frame. It is freed in av_frame_unref().
868
+ */
869
+ AVBufferRef **extended_buf;
870
+ /**
871
+ * Number of elements in extended_buf.
872
+ */
873
+ int nb_extended_buf;
874
+
875
+ AVFrameSideData **side_data;
876
+ int nb_side_data;
877
+
878
+ /**
879
+ * @defgroup lavu_frame_flags AV_FRAME_FLAGS
880
+ * @ingroup lavu_frame
881
+ * Flags describing additional frame properties.
882
+ *
883
+ * @{
884
+ */
885
+
886
+ /**
887
+ * The frame data may be corrupted, e.g. due to decoding errors.
888
+ */
889
+ #define AV_FRAME_FLAG_CORRUPT (1 << 0)
890
+ /**
891
+ * A flag to mark frames that are keyframes.
892
+ */
893
+ #define AV_FRAME_FLAG_KEY (1 << 1)
894
+ /**
895
+ * A flag to mark the frames which need to be decoded, but shouldn't be output.
896
+ */
897
+ #define AV_FRAME_FLAG_DISCARD (1 << 2)
898
+ /**
899
+ * A flag to mark frames whose content is interlaced.
900
+ */
901
+ #define AV_FRAME_FLAG_INTERLACED (1 << 3)
902
+ /**
903
+ * A flag to mark frames where the top field is displayed first if the content
904
+ * is interlaced.
905
+ */
906
+ #define AV_FRAME_FLAG_TOP_FIELD_FIRST (1 << 4)
907
+ /**
908
+ * @}
909
+ */
910
+
911
+ /**
912
+ * Frame flags, a combination of @ref lavu_frame_flags
913
+ */
914
+ int flags;
915
+
916
+ /**
917
+ * MPEG vs JPEG YUV range.
918
+ * - encoding: Set by user
919
+ * - decoding: Set by libavcodec
920
+ */
921
+ enum AVColorRange color_range;
922
+
923
+ enum AVColorPrimaries color_primaries;
924
+
925
+ enum AVColorTransferCharacteristic color_trc;
926
+
927
+ /**
928
+ * YUV colorspace type.
929
+ * - encoding: Set by user
930
+ * - decoding: Set by libavcodec
931
+ */
932
+ enum AVColorSpace colorspace;
933
+
934
+ enum AVChromaLocation chroma_location;
935
+
936
+ /**
937
+ * frame timestamp estimated using various heuristics, in stream time base
938
+ * - encoding: unused
939
+ * - decoding: set by libavcodec, read by user.
940
+ */
941
+ int64_t best_effort_timestamp;
942
+
943
+ #if FF_API_FRAME_PKT
944
+ /**
945
+ * reordered pos from the last AVPacket that has been input into the decoder
946
+ * - encoding: unused
947
+ * - decoding: Read by user.
948
+ * @deprecated use AV_CODEC_FLAG_COPY_OPAQUE to pass through arbitrary user
949
+ * data from packets to frames
950
+ */
951
+ attribute_deprecated
952
+ int64_t pkt_pos;
953
+ #endif
954
+
955
+ /**
956
+ * metadata.
957
+ * - encoding: Set by user.
958
+ * - decoding: Set by libavcodec.
959
+ */
960
+ AVDictionary *metadata;
961
+
962
+ /**
963
+ * decode error flags of the frame, set to a combination of
964
+ * FF_DECODE_ERROR_xxx flags if the decoder produced a frame, but there
965
+ * were errors during the decoding.
966
+ * - encoding: unused
967
+ * - decoding: set by libavcodec, read by user.
968
+ */
969
+ int decode_error_flags;
970
+ #define FF_DECODE_ERROR_INVALID_BITSTREAM 1
971
+ #define FF_DECODE_ERROR_MISSING_REFERENCE 2
972
+ #define FF_DECODE_ERROR_CONCEALMENT_ACTIVE 4
973
+ #define FF_DECODE_ERROR_DECODE_SLICES 8
974
+
975
+ #if FF_API_FRAME_PKT
976
+ /**
977
+ * size of the corresponding packet containing the compressed
978
+ * frame.
979
+ * It is set to a negative value if unknown.
980
+ * - encoding: unused
981
+ * - decoding: set by libavcodec, read by user.
982
+ * @deprecated use AV_CODEC_FLAG_COPY_OPAQUE to pass through arbitrary user
983
+ * data from packets to frames
984
+ */
985
+ attribute_deprecated
986
+ int pkt_size;
987
+ #endif
988
+
989
+ /**
990
+ * For hwaccel-format frames, this should be a reference to the
991
+ * AVHWFramesContext describing the frame.
992
+ */
993
+ AVBufferRef *hw_frames_ctx;
994
+
995
+ /**
996
+ * Frame owner's private data.
997
+ *
998
+ * This field may be set by the code that allocates/owns the frame data.
999
+ * It is then not touched by any library functions, except:
1000
+ * - a new reference to the underlying buffer is propagated by
1001
+ * av_frame_copy_props() (and hence by av_frame_ref());
1002
+ * - it is unreferenced in av_frame_unref();
1003
+ * - on the caller's explicit request. E.g. libavcodec encoders/decoders
1004
+ * will propagate a new reference to/from @ref AVPacket "AVPackets" if the
1005
+ * caller sets @ref AV_CODEC_FLAG_COPY_OPAQUE.
1006
+ *
1007
+ * @see opaque the plain pointer analogue
1008
+ */
1009
+ AVBufferRef *opaque_ref;
1010
+
1011
+ /**
1012
+ * @anchor cropping
1013
+ * @name Cropping
1014
+ * Video frames only. The number of pixels to discard from the the
1015
+ * top/bottom/left/right border of the frame to obtain the sub-rectangle of
1016
+ * the frame intended for presentation.
1017
+ * @{
1018
+ */
1019
+ size_t crop_top;
1020
+ size_t crop_bottom;
1021
+ size_t crop_left;
1022
+ size_t crop_right;
1023
+ /**
1024
+ * @}
1025
+ */
1026
+
1027
+ /**
1028
+ * AVBufferRef for internal use by a single libav* library.
1029
+ * Must not be used to transfer data between libraries.
1030
+ * Has to be NULL when ownership of the frame leaves the respective library.
1031
+ *
1032
+ * Code outside the FFmpeg libs should never check or change the contents of the buffer ref.
1033
+ *
1034
+ * FFmpeg calls av_buffer_unref() on it when the frame is unreferenced.
1035
+ * av_frame_copy_props() calls create a new reference with av_buffer_ref()
1036
+ * for the target frame's private_ref field.
1037
+ */
1038
+ AVBufferRef *private_ref;
1039
+
1040
+ /**
1041
+ * Channel layout of the audio data.
1042
+ */
1043
+ AVChannelLayout ch_layout;
1044
+
1045
+ /**
1046
+ * Duration of the frame, in the same units as pts. 0 if unknown.
1047
+ */
1048
+ int64_t duration;
1049
+
1050
+ atomic_int32 ref_count;
1051
+ } AVFrameRef;
1052
+
1053
+ #endif