codemirror-lang-liquidsoap 0.3.5 → 0.3.6

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 (427) hide show
  1. package/dist/cli.js +6 -6
  2. package/dist/index.js +5 -5
  3. package/package.json +1 -1
  4. package/src/liquidsoap.grammar +2 -0
  5. package/src/parser.js +4 -4
  6. package/tests/liquidsoap/.codespellignore +1 -0
  7. package/tests/liquidsoap/.github/ISSUE_TEMPLATE/bug_report.yml +16 -0
  8. package/tests/liquidsoap/.github/docker/alpine.dockerfile +20 -0
  9. package/tests/liquidsoap/.github/docker/debian.dockerfile +55 -0
  10. package/tests/liquidsoap/.github/opam/{liquidsoap-core-windows.opam → liquidsoap-windows.opam} +8 -5
  11. package/tests/liquidsoap/.github/renovate.json +23 -0
  12. package/tests/liquidsoap/.github/scripts/add-local-opam-packages.sh +5 -3
  13. package/tests/liquidsoap/.github/scripts/build-apk.sh +10 -19
  14. package/tests/liquidsoap/.github/scripts/build-deb.sh +6 -15
  15. package/tests/liquidsoap/.github/scripts/build-details.sh +15 -4
  16. package/tests/liquidsoap/.github/scripts/build-posix.sh +11 -20
  17. package/tests/liquidsoap/.github/scripts/build-website.sh +1 -1
  18. package/tests/liquidsoap/.github/scripts/build-win32.sh +6 -2
  19. package/tests/liquidsoap/.github/scripts/push-docker.sh +13 -15
  20. package/tests/liquidsoap/.github/workflows/ci.yml +291 -185
  21. package/tests/liquidsoap/.ocamlformat +1 -1
  22. package/tests/liquidsoap/.pre-commit-config.yaml +2 -2
  23. package/tests/liquidsoap/CHANGES.md +112 -3
  24. package/tests/liquidsoap/README.md +10 -9
  25. package/tests/liquidsoap/ROADMAP.md +14 -8
  26. package/tests/liquidsoap/bin/liquidsoap-macos-instruments +7 -0
  27. package/tests/liquidsoap/doc/content/build.md +0 -1
  28. package/tests/liquidsoap/doc/content/faq.md +2 -4
  29. package/tests/liquidsoap/doc/content/icy_metadata.md +2 -2
  30. package/tests/liquidsoap/doc/content/install.md +13 -2
  31. package/tests/liquidsoap/doc/content/json.md +1 -1
  32. package/tests/liquidsoap/doc/content/language.md +4 -4
  33. package/tests/liquidsoap/doc/content/liq/beets-protocol.liq +1 -1
  34. package/tests/liquidsoap/doc/content/liq/crossfade.liq +1 -1
  35. package/tests/liquidsoap/doc/content/liq/harbor-simple.liq +1 -1
  36. package/tests/liquidsoap/doc/content/liq/radiopi.liq +10 -9
  37. package/tests/liquidsoap/doc/content/liq/request.dynamic.liq +1 -1
  38. package/tests/liquidsoap/doc/content/migrating.md +25 -3
  39. package/tests/liquidsoap/doc/content/playlist_parsers.md +46 -1
  40. package/tests/liquidsoap/doc/content/script_loading.md +3 -0
  41. package/tests/liquidsoap/doc/content/xml.md +160 -0
  42. package/tests/liquidsoap/doc/dune.inc +129 -0
  43. package/tests/liquidsoap/dune-project +29 -49
  44. package/tests/liquidsoap/liquidsoap +1 -1
  45. package/tests/liquidsoap/{liquidsoap-js.opam → opam/liquidsoap-js.opam} +3 -2
  46. package/tests/liquidsoap/{liquidsoap-lang.opam → opam/liquidsoap-lang.opam} +4 -3
  47. package/tests/liquidsoap/{liquidsoap-mode.opam → opam/liquidsoap-mode.opam} +3 -2
  48. package/tests/liquidsoap/{liquidsoap-core.opam → opam/liquidsoap.opam} +46 -17
  49. package/tests/liquidsoap/{prometheus-liquidsoap.opam → opam/prometheus-liquidsoap.opam} +2 -1
  50. package/tests/liquidsoap/{sdl-liquidsoap.opam → opam/sdl-liquidsoap.opam} +2 -1
  51. package/tests/liquidsoap/{tls-liquidsoap.opam → opam/tls-liquidsoap.opam} +2 -1
  52. package/tests/liquidsoap/src/bin/dune +1 -1
  53. package/tests/liquidsoap/src/config/xmlplaylist_option.disabled.ml +2 -0
  54. package/tests/liquidsoap/src/core/builtins/builtins_ffmpeg_decoder.ml +22 -22
  55. package/tests/liquidsoap/src/core/builtins/builtins_ffmpeg_encoder.ml +4 -4
  56. package/tests/liquidsoap/src/core/builtins/builtins_ffmpeg_filters.ml +37 -41
  57. package/tests/liquidsoap/src/core/builtins/builtins_files.ml +3 -1
  58. package/tests/liquidsoap/src/core/builtins/builtins_optionals.ml +0 -1
  59. package/tests/liquidsoap/src/core/builtins/builtins_process.ml +15 -7
  60. package/tests/liquidsoap/src/core/builtins/builtins_resolvers.ml +16 -0
  61. package/tests/liquidsoap/src/core/builtins/builtins_socket.ml +7 -5
  62. package/tests/liquidsoap/src/core/builtins/builtins_source.ml +3 -3
  63. package/tests/liquidsoap/src/core/builtins/builtins_srt.ml +84 -8
  64. package/tests/liquidsoap/src/core/builtins/builtins_string_extra.ml +13 -0
  65. package/tests/liquidsoap/src/core/builtins/builtins_sys.ml +6 -6
  66. package/tests/liquidsoap/src/core/builtins/builtins_thread.ml +2 -2
  67. package/tests/liquidsoap/src/core/builtins/builtins_time.ml +5 -3
  68. package/tests/liquidsoap/src/core/builtins/builtins_tls.ml +1 -1
  69. package/tests/liquidsoap/src/core/clock.ml +105 -38
  70. package/tests/liquidsoap/src/core/clock.mli +1 -0
  71. package/tests/liquidsoap/src/core/clock_base.ml +2 -2
  72. package/tests/liquidsoap/src/core/conversions/stereo.ml +6 -8
  73. package/tests/liquidsoap/src/core/converters/audio_converter.mli +5 -5
  74. package/tests/liquidsoap/src/core/converters/video_converter.ml +2 -2
  75. package/tests/liquidsoap/src/core/converters/video_converter.mli +3 -3
  76. package/tests/liquidsoap/src/core/decoder/decoder.ml +14 -17
  77. package/tests/liquidsoap/src/core/decoder/decoder.mli +11 -11
  78. package/tests/liquidsoap/src/core/decoder/decoder_utils.ml +12 -13
  79. package/tests/liquidsoap/src/core/decoder/decoder_utils.mli +2 -3
  80. package/tests/liquidsoap/src/core/decoder/external_decoder.ml +9 -13
  81. package/tests/liquidsoap/src/core/decoder/ffmpeg_decoder.ml +57 -53
  82. package/tests/liquidsoap/src/core/decoder/ffmpeg_raw_decoder.ml +28 -9
  83. package/tests/liquidsoap/src/core/decoder/flac_metadata_plug.ml +15 -2
  84. package/tests/liquidsoap/src/core/decoder/image_decoder.ml +33 -19
  85. package/tests/liquidsoap/src/core/decoder/liq_flac_decoder.ml +22 -23
  86. package/tests/liquidsoap/src/core/decoder/liq_ogg_decoder.ml +5 -5
  87. package/tests/liquidsoap/src/core/decoder/mad_decoder.ml +2 -2
  88. package/tests/liquidsoap/src/core/decoder/midi_decoder.ml +1 -2
  89. package/tests/liquidsoap/src/core/decoder/ogg_flac_duration.ml +3 -11
  90. package/tests/liquidsoap/src/core/decoder/ogg_metadata_plug.ml +15 -2
  91. package/tests/liquidsoap/src/core/decoder/raw_audio_decoder.ml +8 -7
  92. package/tests/liquidsoap/src/core/decoder/wav_aiff_decoder.ml +3 -3
  93. package/tests/liquidsoap/src/core/dune +2 -15
  94. package/tests/liquidsoap/src/core/encoder/encoder.ml +18 -23
  95. package/tests/liquidsoap/src/core/encoder/encoder.mli +12 -17
  96. package/tests/liquidsoap/src/core/encoder/encoders/ffmpeg_encoder.ml +13 -27
  97. package/tests/liquidsoap/src/core/encoder/encoders/ffmpeg_encoder_common.ml +1 -1
  98. package/tests/liquidsoap/src/core/encoder/encoders/flac_encoder.ml +3 -4
  99. package/tests/liquidsoap/src/core/encoder/encoders/ndi_encoder.ml +2 -1
  100. package/tests/liquidsoap/src/core/encoder/encoders/ogg_encoder.ml +1 -2
  101. package/tests/liquidsoap/src/core/encoder/lang/lang_external_encoder.ml +2 -2
  102. package/tests/liquidsoap/src/core/encoder/lang/lang_fdkaac.ml +1 -1
  103. package/tests/liquidsoap/src/core/encoder/lang/lang_ffmpeg.ml +46 -39
  104. package/tests/liquidsoap/src/core/encoder/lang/lang_flac.ml +1 -1
  105. package/tests/liquidsoap/src/core/encoder/lang/lang_shine.ml +2 -2
  106. package/tests/liquidsoap/src/core/encoder/lang/lang_vorbis.ml +1 -1
  107. package/tests/liquidsoap/src/core/encoder/lang/lang_wav.ml +1 -1
  108. package/tests/liquidsoap/src/core/file_watcher.inotify.ml +8 -13
  109. package/tests/liquidsoap/src/core/harbor/harbor.ml +22 -24
  110. package/tests/liquidsoap/src/core/io/ffmpeg_filter_io.ml +4 -3
  111. package/tests/liquidsoap/src/core/io/oss_io.ml +3 -4
  112. package/tests/liquidsoap/src/core/io/portaudio_io.ml +1 -1
  113. package/tests/liquidsoap/src/core/io/pulseaudio_io.ml +3 -4
  114. package/tests/liquidsoap/src/core/io/srt_io.ml +316 -120
  115. package/tests/liquidsoap/src/core/io/udp_io.ml +14 -12
  116. package/tests/liquidsoap/src/core/lang.mli +10 -12
  117. package/tests/liquidsoap/src/core/lang_source.ml +25 -39
  118. package/tests/liquidsoap/src/core/lang_string.ml +30 -0
  119. package/tests/liquidsoap/src/core/lang_string.mli +3 -0
  120. package/tests/liquidsoap/src/core/ogg_formats/ogg_flac_encoder.ml +6 -6
  121. package/tests/liquidsoap/src/core/ogg_formats/ogg_muxer.ml +17 -27
  122. package/tests/liquidsoap/src/core/ogg_formats/ogg_muxer.mli +44 -53
  123. package/tests/liquidsoap/src/core/ogg_formats/opus_encoder.ml +1 -1
  124. package/tests/liquidsoap/src/core/ogg_formats/vorbis_encoder.ml +1 -2
  125. package/tests/liquidsoap/src/core/operators/add.ml +2 -2
  126. package/tests/liquidsoap/src/core/operators/cross.ml +2 -2
  127. package/tests/liquidsoap/src/core/operators/delay.ml +23 -6
  128. package/tests/liquidsoap/src/core/operators/dtmf.ml +3 -2
  129. package/tests/liquidsoap/src/core/operators/dyn_op.ml +2 -2
  130. package/tests/liquidsoap/src/core/operators/fir_filter.ml +2 -1
  131. package/tests/liquidsoap/src/core/operators/iir_filter.ml +1 -1
  132. package/tests/liquidsoap/src/core/operators/insert_metadata.ml +1 -1
  133. package/tests/liquidsoap/src/core/operators/lilv_op.ml +1 -1
  134. package/tests/liquidsoap/src/core/operators/lufs.ml +136 -89
  135. package/tests/liquidsoap/src/core/operators/lufs_c.c +105 -0
  136. package/tests/liquidsoap/src/core/operators/map_metadata.ml +33 -9
  137. package/tests/liquidsoap/src/core/operators/max_duration.ml +3 -4
  138. package/tests/liquidsoap/src/core/operators/muxer.ml +2 -1
  139. package/tests/liquidsoap/src/core/operators/noblank.ml +6 -6
  140. package/tests/liquidsoap/src/core/operators/sequence.ml +5 -5
  141. package/tests/liquidsoap/src/core/operators/switch.ml +10 -11
  142. package/tests/liquidsoap/src/core/operators/time_warp.ml +14 -11
  143. package/tests/liquidsoap/src/core/operators/video_fade.ml +2 -3
  144. package/tests/liquidsoap/src/core/outputs/ao_out.ml +1 -1
  145. package/tests/liquidsoap/src/core/outputs/bjack_out.ml +1 -1
  146. package/tests/liquidsoap/src/core/outputs/graphics_out.ml +6 -2
  147. package/tests/liquidsoap/src/core/outputs/harbor_output.ml +12 -10
  148. package/tests/liquidsoap/src/core/outputs/hls_output.ml +19 -14
  149. package/tests/liquidsoap/src/core/outputs/icecast2.ml +85 -52
  150. package/tests/liquidsoap/src/core/outputs/ndi_out.ml +1 -1
  151. package/tests/liquidsoap/src/core/outputs/output.ml +8 -9
  152. package/tests/liquidsoap/src/core/outputs/output.mli +61 -61
  153. package/tests/liquidsoap/src/core/outputs/pipe_output.ml +8 -6
  154. package/tests/liquidsoap/src/core/outputs/sdl_out.ml +5 -2
  155. package/tests/liquidsoap/src/core/playlist_parser.ml +6 -7
  156. package/tests/liquidsoap/src/core/playlists/playlist_basic.ml +0 -180
  157. package/tests/liquidsoap/src/core/protocols/annotate.ml +3 -3
  158. package/tests/liquidsoap/src/core/request.ml +16 -17
  159. package/tests/liquidsoap/src/core/request.mli +27 -28
  160. package/tests/liquidsoap/src/core/shebang.ml +3 -2
  161. package/tests/liquidsoap/src/core/source.ml +104 -63
  162. package/tests/liquidsoap/src/core/source.mli +249 -247
  163. package/tests/liquidsoap/src/core/sources/generated.ml +2 -2
  164. package/tests/liquidsoap/src/core/sources/request_dynamic.ml +2 -2
  165. package/tests/liquidsoap/src/core/sources/synthesized.ml +2 -2
  166. package/tests/liquidsoap/src/core/stream/aFrame.mli +7 -9
  167. package/tests/liquidsoap/src/core/stream/content.mli +4 -13
  168. package/tests/liquidsoap/src/core/stream/content_base.ml +2 -19
  169. package/tests/liquidsoap/src/core/stream/content_video.ml +9 -10
  170. package/tests/liquidsoap/src/core/stream/ffmpeg_copy_content.ml +19 -15
  171. package/tests/liquidsoap/src/core/stream/ffmpeg_raw_content.ml +26 -9
  172. package/tests/liquidsoap/src/core/stream/frame.ml +4 -4
  173. package/tests/liquidsoap/src/core/stream/frame.mli +13 -15
  174. package/tests/liquidsoap/src/core/stream/frame_base.ml +1 -2
  175. package/tests/liquidsoap/src/core/stream/frame_settings.ml +14 -14
  176. package/tests/liquidsoap/src/core/stream/generator.mli +14 -17
  177. package/tests/liquidsoap/src/core/stream/mFrame.mli +2 -2
  178. package/tests/liquidsoap/src/core/tools/charset.ml +28 -18
  179. package/tests/liquidsoap/src/core/tools/charset_base.ml +5 -0
  180. package/tests/liquidsoap/src/core/tools/child_support.ml +2 -2
  181. package/tests/liquidsoap/src/core/tools/ffmpeg_avfilter_utils.ml +139 -0
  182. package/tests/liquidsoap/src/core/tools/ffmpeg_avfilter_utils.mli +22 -0
  183. package/tests/liquidsoap/src/core/tools/ffmpeg_utils.ml +2 -1
  184. package/tests/liquidsoap/src/core/tools/lifecycle.mli +4 -4
  185. package/tests/liquidsoap/src/core/tools/liq_http.ml +44 -19
  186. package/tests/liquidsoap/src/core/tools/liq_http.mli +1 -1
  187. package/tests/liquidsoap/src/core/tools/log.ml +3 -8
  188. package/tests/liquidsoap/src/core/tools/log.mli +1 -1
  189. package/tests/liquidsoap/src/core/tools/mutex_utils.ml +1 -1
  190. package/tests/liquidsoap/src/core/tools/pool.ml +2 -2
  191. package/tests/liquidsoap/src/core/tools/process_handler.mli +30 -27
  192. package/tests/liquidsoap/src/core/tools/producer_consumer.ml +10 -9
  193. package/tests/liquidsoap/src/{lang → core/tools}/queues.ml +58 -64
  194. package/tests/liquidsoap/src/{lang → core/tools}/queues.mli +10 -0
  195. package/tests/liquidsoap/src/core/tools/sdl_utils.ml +2 -0
  196. package/tests/liquidsoap/src/core/tools/server.mli +8 -8
  197. package/tests/liquidsoap/src/core/tools/sha1.ml +2 -1
  198. package/tests/liquidsoap/src/core/tools/start_stop.ml +2 -1
  199. package/tests/liquidsoap/src/core/tools/strings.mli +5 -4
  200. package/tests/liquidsoap/src/core/tools/tutils.ml +7 -7
  201. package/tests/liquidsoap/src/core/tools/tutils.mli +14 -18
  202. package/tests/liquidsoap/src/core/tools/unix_c.c +16 -5
  203. package/tests/liquidsoap/src/core/tools/utils.ml +83 -25
  204. package/tests/liquidsoap/src/core/tools/wav_aiff.ml +3 -3
  205. package/tests/liquidsoap/src/core/tools/wav_aiff.mli +7 -7
  206. package/tests/liquidsoap/src/core/types/format_type.ml +6 -6
  207. package/tests/liquidsoap/src/js/index.html +1 -154
  208. package/tests/liquidsoap/src/js/interactive_js.ml +7 -3
  209. package/tests/liquidsoap/src/js/stdlib_js.liq +6 -0
  210. package/tests/liquidsoap/src/lang/builtins_lang.ml +8 -0
  211. package/tests/liquidsoap/src/lang/builtins_null.ml +1 -1
  212. package/tests/liquidsoap/src/lang/builtins_string.ml +2 -11
  213. package/tests/liquidsoap/src/lang/builtins_xml.ml +204 -0
  214. package/tests/liquidsoap/src/lang/cache.ml +7 -2
  215. package/tests/liquidsoap/src/lang/dune +5 -2
  216. package/tests/liquidsoap/src/lang/flags.ml +2 -2
  217. package/tests/liquidsoap/src/lang/lang.mli +10 -12
  218. package/tests/liquidsoap/src/lang/lang_core.ml +24 -24
  219. package/tests/liquidsoap/src/lang/lang_eval.ml +1 -1
  220. package/tests/liquidsoap/src/lang/lang_string.ml +7 -13
  221. package/tests/liquidsoap/src/lang/lang_string.mli +0 -1
  222. package/tests/liquidsoap/src/lang/lexer.ml +3 -0
  223. package/tests/liquidsoap/src/lang/parser.mly +7 -4
  224. package/tests/liquidsoap/src/lang/parser_helper.ml +9 -77
  225. package/tests/liquidsoap/src/lang/parser_helper.mli +1 -1
  226. package/tests/liquidsoap/src/lang/pos.ml +4 -4
  227. package/tests/liquidsoap/src/lang/pos.mli +55 -0
  228. package/tests/liquidsoap/src/lang/preprocessor.ml +12 -5
  229. package/tests/liquidsoap/src/lang/repr.ml +6 -6
  230. package/tests/liquidsoap/src/lang/runtime.ml +55 -48
  231. package/tests/liquidsoap/src/lang/runtime.mli +8 -3
  232. package/tests/liquidsoap/src/lang/term/parsed_term.ml +33 -33
  233. package/tests/liquidsoap/src/lang/term/term_base.ml +14 -10
  234. package/tests/liquidsoap/src/lang/term/term_preprocessor.ml +28 -1
  235. package/tests/liquidsoap/src/lang/term/term_reducer.ml +244 -132
  236. package/tests/liquidsoap/src/lang/term/term_reducer.mli +10 -2
  237. package/tests/liquidsoap/src/lang/term/term_stdlib.ml +14 -13
  238. package/tests/liquidsoap/src/lang/term.mli +3 -1
  239. package/tests/liquidsoap/src/lang/typechecking.ml +16 -16
  240. package/tests/liquidsoap/src/lang/typechecking.mli +5 -1
  241. package/tests/liquidsoap/src/lang/types/type_base.ml +16 -17
  242. package/tests/liquidsoap/src/lang/typing.ml +13 -12
  243. package/tests/liquidsoap/src/lang/typing.mli +2 -1
  244. package/tests/liquidsoap/src/lang/value.ml +20 -14
  245. package/tests/liquidsoap/src/libs/audio.liq +53 -18
  246. package/tests/liquidsoap/src/libs/autocue.liq +8 -8
  247. package/tests/liquidsoap/src/libs/clock.liq +3 -3
  248. package/tests/liquidsoap/src/libs/dune +2 -2
  249. package/tests/liquidsoap/src/libs/extra/audio.liq +4 -4
  250. package/tests/liquidsoap/src/libs/extra/audioscrobbler.liq +487 -0
  251. package/tests/liquidsoap/src/libs/extra/deprecations.liq +11 -11
  252. package/tests/liquidsoap/src/libs/extra/externals.liq +9 -9
  253. package/tests/liquidsoap/src/libs/extra/fades.liq +2 -2
  254. package/tests/liquidsoap/src/libs/extra/file.liq +1 -1
  255. package/tests/liquidsoap/src/libs/extra/http.liq +4 -4
  256. package/tests/liquidsoap/src/libs/extra/interactive.liq +1 -1
  257. package/tests/liquidsoap/src/libs/extra/metadata.liq +3 -3
  258. package/tests/liquidsoap/src/libs/extra/native.liq +6 -6
  259. package/tests/liquidsoap/src/libs/extra/server.liq +2 -2
  260. package/tests/liquidsoap/src/libs/extra/source.liq +10 -10
  261. package/tests/liquidsoap/src/libs/extra/spinitron.liq +11 -11
  262. package/tests/liquidsoap/src/libs/extra/telnet.liq +51 -0
  263. package/tests/liquidsoap/src/libs/extra/video.liq +2 -2
  264. package/tests/liquidsoap/src/libs/fades.liq +70 -57
  265. package/tests/liquidsoap/src/libs/ffmpeg.liq +50 -33
  266. package/tests/liquidsoap/src/libs/file.liq +8 -8
  267. package/tests/liquidsoap/src/libs/hls.liq +5 -5
  268. package/tests/liquidsoap/src/libs/http.liq +64 -37
  269. package/tests/liquidsoap/src/libs/icecast.liq +1 -1
  270. package/tests/liquidsoap/src/libs/io.liq +6 -6
  271. package/tests/liquidsoap/src/libs/medialib.liq +46 -45
  272. package/tests/liquidsoap/src/libs/metadata.liq +4 -4
  273. package/tests/liquidsoap/src/libs/null.liq +3 -3
  274. package/tests/liquidsoap/src/libs/playlist.liq +547 -22
  275. package/tests/liquidsoap/src/libs/protocols.liq +14 -14
  276. package/tests/liquidsoap/src/libs/replaygain.liq +11 -11
  277. package/tests/liquidsoap/src/libs/request.liq +27 -29
  278. package/tests/liquidsoap/src/libs/runtime.liq +2 -0
  279. package/tests/liquidsoap/src/libs/source.liq +15 -15
  280. package/tests/liquidsoap/src/libs/sqlite.liq +1 -1
  281. package/tests/liquidsoap/src/libs/stdlib.liq +1 -1
  282. package/tests/liquidsoap/src/libs/string.liq +6 -6
  283. package/tests/liquidsoap/src/libs/switches.liq +3 -3
  284. package/tests/liquidsoap/src/libs/thread.liq +3 -9
  285. package/tests/liquidsoap/src/libs/tracks.liq +23 -9
  286. package/tests/liquidsoap/src/libs/video.liq +32 -32
  287. package/tests/liquidsoap/src/modules/dtools/README.md +58 -0
  288. package/tests/liquidsoap/src/modules/dtools/dtools.ml +19 -0
  289. package/tests/liquidsoap/src/modules/dtools/dtools.mli +284 -0
  290. package/tests/liquidsoap/src/modules/dtools/dtools_impl.ml +860 -0
  291. package/tests/liquidsoap/src/modules/dtools/dtools_syslog.impl.ml +45 -0
  292. package/tests/liquidsoap/src/modules/dtools/dtools_syslog.noop.ml +1 -0
  293. package/tests/liquidsoap/src/modules/dtools/dune +12 -0
  294. package/tests/liquidsoap/src/modules/duppy/.merlin +4 -0
  295. package/tests/liquidsoap/src/modules/duppy/README.md +47 -0
  296. package/tests/liquidsoap/src/modules/duppy/dune +7 -0
  297. package/tests/liquidsoap/src/modules/duppy/duppy.ml +1097 -0
  298. package/tests/liquidsoap/src/modules/duppy/duppy.mli +494 -0
  299. package/tests/liquidsoap/src/modules/duppy/duppy_stubs.c +176 -0
  300. package/tests/liquidsoap/src/modules/duppy/examples/dune +9 -0
  301. package/tests/liquidsoap/src/modules/duppy/examples/http.ml +560 -0
  302. package/tests/liquidsoap/src/modules/duppy/examples/index.html +1 -0
  303. package/tests/liquidsoap/src/modules/duppy/examples/telnet.ml +150 -0
  304. package/tests/liquidsoap/src/modules/xmlplaylist/dune +5 -0
  305. package/tests/liquidsoap/src/modules/xmlplaylist/xmlplaylist.ml +185 -0
  306. package/tests/liquidsoap/src/modules/xmlplaylist/xmlplaylist.mli +56 -0
  307. package/tests/liquidsoap/src/ndi/ndi.mli +2 -3
  308. package/tests/liquidsoap/src/runtime/build_config.ml +0 -1
  309. package/tests/liquidsoap/src/runtime/main.ml +4 -23
  310. package/tests/liquidsoap/src/stereotool/stereotool.mli +3 -3
  311. package/tests/liquidsoap/src/tooling/parsed_json.ml +6 -4
  312. package/tests/liquidsoap/tests/core/content_test.ml +2 -39
  313. package/tests/liquidsoap/tests/core/dune +13 -0
  314. package/tests/liquidsoap/tests/core/dune.inc +1 -1
  315. package/tests/liquidsoap/tests/core/gen_dune.ml +4 -1
  316. package/tests/liquidsoap/tests/core/json_test.ml +10 -0
  317. package/tests/liquidsoap/tests/core/more_types.ml +32 -28
  318. package/tests/liquidsoap/tests/core/output_encoded_test.ml +2 -0
  319. package/tests/liquidsoap/tests/core/string_test.ml +4 -0
  320. package/tests/liquidsoap/tests/core/types.ml +1 -1
  321. package/tests/liquidsoap/tests/harbor/http.liq +1 -1
  322. package/tests/liquidsoap/tests/harbor/http2.liq +1 -1
  323. package/tests/liquidsoap/tests/language/cue_test.liq +3993 -0
  324. package/tests/liquidsoap/tests/language/dune.inc +24 -0
  325. package/tests/liquidsoap/tests/language/error.liq +1 -1
  326. package/tests/liquidsoap/tests/language/json.liq +11 -11
  327. package/tests/liquidsoap/tests/language/list.liq +1 -1
  328. package/tests/liquidsoap/tests/language/metadata.liq +1 -1
  329. package/tests/liquidsoap/tests/language/null.liq +9 -9
  330. package/tests/liquidsoap/tests/language/record.liq +23 -23
  331. package/tests/liquidsoap/tests/language/replaygain.liq +8 -8
  332. package/tests/liquidsoap/tests/language/sqlite.liq +1 -1
  333. package/tests/liquidsoap/tests/language/string.liq +1 -1
  334. package/tests/liquidsoap/tests/language/type_errors.liq +2 -2
  335. package/tests/liquidsoap/tests/language/typing.liq +2 -2
  336. package/tests/liquidsoap/tests/language/various.liq +1 -0
  337. package/tests/liquidsoap/tests/language/xml_test.liq +132 -0
  338. package/tests/liquidsoap/tests/media/dune +74 -0
  339. package/tests/liquidsoap/tests/media/dune.inc +63 -0
  340. package/tests/liquidsoap/tests/media/ffmpeg_add_text.liq +42 -56
  341. package/tests/liquidsoap/tests/media/ffmpeg_copy_concat.liq +5 -2
  342. package/tests/liquidsoap/tests/media/ffmpeg_distributed_hls.liq +2 -4
  343. package/tests/liquidsoap/tests/media/ffmpeg_filter_changing_rate.liq +1 -1
  344. package/tests/liquidsoap/tests/media/ffmpeg_inline_encode_decode_audio.liq +1 -5
  345. package/tests/liquidsoap/tests/media/ffmpeg_inline_encode_decode_video.liq +1 -3
  346. package/tests/liquidsoap/tests/media/ffmpeg_raw_and_encode_decoder.liq +1 -3
  347. package/tests/liquidsoap/tests/media/ffmpeg_raw_hls.liq +2 -4
  348. package/tests/liquidsoap/tests/media/ffmpeg_raw_implicit_conversion.liq +63 -0
  349. package/tests/liquidsoap/tests/media/gen_dune.ml +1 -0
  350. package/tests/liquidsoap/tests/media/image_decoder_duration.liq +15 -0
  351. package/tests/liquidsoap/tests/media/lufs_integrated.liq +17 -0
  352. package/tests/liquidsoap/tests/regression/AC5109.liq +2 -2
  353. package/tests/liquidsoap/tests/regression/GH1129.liq +3 -3
  354. package/tests/liquidsoap/tests/regression/GH1279.liq +2 -2
  355. package/tests/liquidsoap/tests/regression/GH1327.liq +3 -3
  356. package/tests/liquidsoap/tests/regression/GH2585.liq +0 -2
  357. package/tests/liquidsoap/tests/regression/GH2756-2.liq +3 -3
  358. package/tests/liquidsoap/tests/regression/GH2756.liq +2 -2
  359. package/tests/liquidsoap/tests/regression/GH3134.liq +2 -2
  360. package/tests/liquidsoap/tests/regression/GH3303.liq +2 -2
  361. package/tests/liquidsoap/tests/regression/GH4163.liq +14 -3
  362. package/tests/liquidsoap/tests/regression/GH4281-2.liq +29 -0
  363. package/tests/liquidsoap/tests/regression/GH4281.liq +29 -0
  364. package/tests/liquidsoap/tests/regression/GH4395.liq +27 -0
  365. package/tests/liquidsoap/tests/regression/LS354-1.liq +1 -1
  366. package/tests/liquidsoap/tests/regression/LS354-2.liq +1 -1
  367. package/tests/liquidsoap/tests/regression/append-merge.liq +3 -1
  368. package/tests/liquidsoap/tests/regression/dune.inc +64 -0
  369. package/tests/liquidsoap/tests/regression/fallible_ogg.liq +9 -0
  370. package/tests/liquidsoap/tests/regression/init-error.liq +2 -0
  371. package/tests/liquidsoap/tests/regression/seek_track_map.liq +1 -1
  372. package/tests/liquidsoap/tests/regression/source_dynamic.liq +2 -2
  373. package/tests/liquidsoap/tests/run_test.ml +53 -60
  374. package/tests/liquidsoap/tests/streams/cross-override-end.liq +9 -2
  375. package/tests/liquidsoap/tests/streams/cross-override-start.liq +9 -2
  376. package/tests/liquidsoap/tests/streams/cross-override.liq +9 -2
  377. package/tests/liquidsoap/tests/streams/cross-persist-end-override.liq +9 -2
  378. package/tests/liquidsoap/tests/streams/cross-persist-override.liq +9 -2
  379. package/tests/liquidsoap/tests/streams/cross-persist-start-override.liq +9 -2
  380. package/tests/liquidsoap/tests/streams/cross.liq +8 -2
  381. package/tests/liquidsoap/tests/streams/crossfade-plot.liq +11 -8
  382. package/tests/liquidsoap/tests/streams/crossfade-plot.new.txt +148 -248
  383. package/tests/liquidsoap/tests/streams/crossfade-plot.old.txt +50 -150
  384. package/tests/liquidsoap/tests/streams/crossfade.liq +8 -2
  385. package/tests/liquidsoap/tests/streams/ctype2.liq +1 -1
  386. package/tests/liquidsoap/tests/streams/dune.inc +31 -0
  387. package/tests/liquidsoap/tests/streams/fades-overrides.liq +9 -2
  388. package/tests/liquidsoap/tests/streams/fades-persistent-override.liq +9 -2
  389. package/tests/liquidsoap/tests/streams/harbor_metadata_3.liq +1 -1
  390. package/tests/liquidsoap/tests/streams/hls_id3v2.liq +11 -7
  391. package/tests/liquidsoap/tests/streams/icecast_last_meta.liq +47 -0
  392. package/tests/liquidsoap/tests/streams/icecast_ssl.liq +3 -0
  393. package/tests/liquidsoap/tests/streams/icecast_ssl_tls.liq +3 -3
  394. package/tests/liquidsoap/tests/streams/icecast_tls.liq +1 -0
  395. package/tests/liquidsoap/tests/streams/icecast_tls_ssl.liq +5 -0
  396. package/tests/liquidsoap/tests/streams/no-cue-cut.liq +2 -2
  397. package/tests/liquidsoap/tests/streams/random.liq +2 -2
  398. package/tests/liquidsoap/tests/streams/replaygain.liq +10 -10
  399. package/tests/liquidsoap/tests/streams/rotate.liq +6 -1
  400. package/tests/liquidsoap/tests/streams/say.liq +2 -2
  401. package/tests/liquidsoap/tests/streams/srt_listen_callback.liq +1 -0
  402. package/tests/liquidsoap/tests/streams/srt_multiple_outputs.liq +1 -0
  403. package/tests/liquidsoap/tests/streams/srt_passphrase.liq +1 -0
  404. package/tests/liquidsoap/tests/streams/srt_raw_pcm.liq +1 -0
  405. package/tests/liquidsoap/tests/test.liq +4 -5
  406. package/tests/liquidsoap/.github/docker/Dockerfile.production +0 -37
  407. package/tests/liquidsoap/.github/docker/Dockerfile.production-alpine +0 -18
  408. package/tests/liquidsoap/.github/opam/packages/metadata/metadata.0.3.0/opam +0 -33
  409. package/tests/liquidsoap/.github/scripts/build-docker-alpine.sh +0 -31
  410. package/tests/liquidsoap/.github/scripts/build-docker.sh +0 -35
  411. package/tests/liquidsoap/liquidsoap-libs-extra.opam +0 -32
  412. package/tests/liquidsoap/liquidsoap-libs.opam +0 -31
  413. package/tests/liquidsoap/liquidsoap.opam +0 -63
  414. package/tests/liquidsoap/src/core/builtins/builtins_lastfm.ml +0 -110
  415. package/tests/liquidsoap/src/core/tools/liqfm.ml +0 -244
  416. package/tests/liquidsoap/src/libs/extra/lastfm.liq +0 -185
  417. /package/tests/liquidsoap/.github/docker/{Dockerfile.website → website.dockerfile} +0 -0
  418. /package/tests/liquidsoap/.github/opam/packages/ffmpeg-av-windows/{ffmpeg-av-windows.1.2.0 → ffmpeg-av-windows.1.2.5}/opam +0 -0
  419. /package/tests/liquidsoap/.github/opam/packages/ffmpeg-avcodec-windows/{ffmpeg-avcodec-windows.1.2.0 → ffmpeg-avcodec-windows.1.2.5}/opam +0 -0
  420. /package/tests/liquidsoap/.github/opam/packages/ffmpeg-avdevice-windows/{ffmpeg-avdevice-windows.1.2.0 → ffmpeg-avdevice-windows.1.2.5}/opam +0 -0
  421. /package/tests/liquidsoap/.github/opam/packages/ffmpeg-avfilter-windows/{ffmpeg-avfilter-windows.1.2.0 → ffmpeg-avfilter-windows.1.2.5}/opam +0 -0
  422. /package/tests/liquidsoap/.github/opam/packages/ffmpeg-avutil-windows/{ffmpeg-avutil-windows.1.2.0 → ffmpeg-avutil-windows.1.2.5}/opam +0 -0
  423. /package/tests/liquidsoap/.github/opam/packages/ffmpeg-swresample-windows/{ffmpeg-swresample-windows.1.2.0 → ffmpeg-swresample-windows.1.2.5}/opam +0 -0
  424. /package/tests/liquidsoap/.github/opam/packages/ffmpeg-swscale-windows/{ffmpeg-swscale-windows.1.2.0 → ffmpeg-swscale-windows.1.2.5}/opam +0 -0
  425. /package/tests/liquidsoap/.github/opam/packages/ffmpeg-windows/{ffmpeg-windows.1.2.0 → ffmpeg-windows.1.2.5}/opam +0 -0
  426. /package/tests/liquidsoap/{liquidsoap-mode.opam.template → opam/liquidsoap-mode.opam.template} +0 -0
  427. /package/tests/liquidsoap/{liquidsoap.opam.template → opam/liquidsoap.opam.template} +0 -0
@@ -9,7 +9,7 @@ license: "GPL-2.0-or-later"
9
9
  homepage: "https://github.com/savonet/liquidsoap"
10
10
  bug-reports: "https://github.com/savonet/liquidsoap/issues"
11
11
  depends: [
12
- "dune" {>= "3.6"}
12
+ "dune" {>= "3.18"}
13
13
  "tsdl"
14
14
  "tsdl-image" {>= "0.3.2"}
15
15
  "tsdl-ttf"
@@ -32,3 +32,4 @@ build: [
32
32
  ["dune" "install" "-p" name "--create-install-files" name]
33
33
  ]
34
34
  dev-repo: "git+https://github.com/savonet/liquidsoap.git"
35
+ x-maintenance-intent: ["(latest)"]
@@ -9,7 +9,7 @@ license: "GPL-2.0-or-later"
9
9
  homepage: "https://github.com/savonet/liquidsoap"
10
10
  bug-reports: "https://github.com/savonet/liquidsoap/issues"
11
11
  depends: [
12
- "dune" {>= "3.6"}
12
+ "dune" {>= "3.18"}
13
13
  "tls"
14
14
  "ca-certs"
15
15
  "mirage-crypto-rng"
@@ -33,3 +33,4 @@ build: [
33
33
  ["dune" "install" "-p" name "--create-install-files" name]
34
34
  ]
35
35
  dev-repo: "git+https://github.com/savonet/liquidsoap.git"
36
+ x-maintenance-intent: ["(latest)"]
@@ -1,7 +1,7 @@
1
1
  (executable
2
2
  (name liquidsoap)
3
3
  (public_name liquidsoap)
4
- (package liquidsoap-core)
4
+ (package liquidsoap)
5
5
  (link_flags -cclib %{env:LIQ_LDFLAGS=})
6
6
  (libraries liquidsoap_runtime)
7
7
  (modules liquidsoap))
@@ -0,0 +1,2 @@
1
+ let detected = "no (requires xmlm)"
2
+ let enabled = false
@@ -179,18 +179,18 @@ let decode_audio_frame ~field ~mode generator =
179
179
  match !current_converter with None -> () | Some (c, _, _) -> c `Flush)
180
180
  in
181
181
 
182
- let convert
183
- : 'a 'b.
184
- get_data:(Content.data -> ('a, 'b) Content_video.Base.content) ->
185
- decoder:([ `Frame of Content.data | `Flush ] -> unit) ->
186
- [ `Frame of Frame.t | `Flush ] ->
187
- unit =
182
+ let convert :
183
+ 'a 'b.
184
+ get_data:(Content.data -> ('a, 'b) Content_video.Base.content) ->
185
+ decoder:([ `Frame of Content.data | `Flush ] -> unit) ->
186
+ [ `Frame of Frame.t | `Flush ] ->
187
+ unit =
188
188
  fun ~get_data ~decoder -> function
189
- | `Frame frame ->
190
- let frame = Frame.get frame field in
191
- let { Content.Video.data; _ } = get_data frame in
192
- if data = [] then () else decoder (`Frame frame)
193
- | `Flush -> decoder `Flush
189
+ | `Frame frame ->
190
+ let frame = Frame.get frame field in
191
+ let { Content.Video.data; _ } = get_data frame in
192
+ if data = [] then () else decoder (`Frame frame)
193
+ | `Flush -> decoder `Flush
194
194
  in
195
195
 
196
196
  match mode with
@@ -387,18 +387,18 @@ let decode_video_frame ~field ~mode generator =
387
387
  !last_params)
388
388
  in
389
389
 
390
- let convert
391
- : 'a 'b.
392
- get_data:(Content.data -> ('a, 'b) Content_video.Base.content) ->
393
- decoder:([ `Frame of Content.data | `Flush ] -> unit) ->
394
- [ `Frame of Frame.t | `Flush ] ->
395
- unit =
390
+ let convert :
391
+ 'a 'b.
392
+ get_data:(Content.data -> ('a, 'b) Content_video.Base.content) ->
393
+ decoder:([ `Frame of Content.data | `Flush ] -> unit) ->
394
+ [ `Frame of Frame.t | `Flush ] ->
395
+ unit =
396
396
  fun ~get_data ~decoder -> function
397
- | `Frame frame ->
398
- let frame = Frame.get frame field in
399
- let { Content.Video.data; _ } = get_data frame in
400
- if data = [] then () else decoder (`Frame frame)
401
- | `Flush -> decoder `Flush
397
+ | `Frame frame ->
398
+ let frame = Frame.get frame field in
399
+ let { Content.Video.data; _ } = get_data frame in
400
+ if data = [] then () else decoder (`Frame frame)
401
+ | `Flush -> decoder `Flush
402
402
  in
403
403
 
404
404
  match mode with
@@ -267,10 +267,10 @@ let encode_video_frame ~source_idx ~type_t ~mode ~opts ?codec ~format ~field
267
267
  let params =
268
268
  Some
269
269
  (`Video
270
- {
271
- Ffmpeg_copy_content.avg_frame_rate = Some target_frame_rate;
272
- params = Avcodec.params encoder;
273
- })
270
+ {
271
+ Ffmpeg_copy_content.avg_frame_rate = Some target_frame_rate;
272
+ params = Avcodec.params encoder;
273
+ })
274
274
  in
275
275
  let effective_t =
276
276
  Type.make
@@ -21,41 +21,38 @@
21
21
  *****************************************************************************)
22
22
 
23
23
  open Builtins_ffmpeg_base
24
- module Queue = Liquidsoap_lang.Queues.Queue
24
+ module Queue = Queues.Queue
25
25
 
26
26
  (** FFmpeg filter graphs initialization is pretty tricky. Things to consider:
27
- * - FFmpeg filters are using a push paradigm, pushing from the sources down
28
- * to the outputs
29
- * - Liquidsoap uses a pull paradigm, pulling data from the outputs.
30
- * - FFmpeg filters inputs need to know the exact content of the data sent to
31
- * them before being initialized, which is only known in the worst case
32
- * when receiving the first frame.
33
- *
34
- * Therefore, the intended implementation is to:
35
- * -> Consider ffmpeg filter graphs as a single operator with N inputs
36
- * and M outputs (audio/video) with inputs being any source converted to
37
- * a ffmpeg graph input, even if not used, for simplification.
38
- * -> The outputs are placed in their clock which controls a child clock
39
- * containing the inputs.
40
- * -> The graph initialization is suspended until its initialization conditions
41
- * are met.
42
- * -> When all the inputs have been initialized and are ready (call to `#is_ready`),
43
- * the graph is considered ready and its output can start requesting
44
- * content. This is captured by the call to `is_ready` below.
45
- * -> When requesting content, the outputs can tick the input clock as many time
46
- * as needed to generate output data. We expect more or less real time with
47
- * perhaps an accordion pattern between input and output so we do not
48
- * look at latency control like we do for crossfades.
49
- * -> When receiving its first frame, the liquidsoap input will then initialize the
50
- * corresponding ffmpeg graph input with full format info.
51
- * -> When all inputs have been initialized, which is know by checking if all of
52
- * the graph's lazy values for input pads have been forced (executed),
53
- * the whole graph is initialized, outputs connected and data can start to flow!
54
- * This is captured by the call to `initialized` below.
55
- *
56
- * This is contingent to the inputs being checked for `#is_ready` and the
57
- * outputs only pulling when _all_ inputs are available, to avoid running
58
- * into endless pulling loops. *)
27
+ - FFmpeg filters are using a push paradigm, pushing from the sources down to
28
+ the outputs
29
+ - Liquidsoap uses a pull paradigm, pulling data from the outputs.
30
+ - FFmpeg filters inputs need to know the exact content of the data sent to
31
+ them before being initialized, which is only known in the worst case when
32
+ receiving the first frame.
33
+
34
+ Therefore, the intended implementation is to: -> Consider ffmpeg filter
35
+ graphs as a single operator with N inputs and M outputs (audio/video) with
36
+ inputs being any source converted to a ffmpeg graph input, even if not used,
37
+ for simplification. -> The outputs are placed in their clock which controls
38
+ a child clock containing the inputs. -> The graph initialization is
39
+ suspended until its initialization conditions are met. -> When all the
40
+ inputs have been initialized and are ready (call to `#is_ready`), the graph
41
+ is considered ready and its output can start requesting content. This is
42
+ captured by the call to `is_ready` below. -> When requesting content, the
43
+ outputs can tick the input clock as many time as needed to generate output
44
+ data. We expect more or less real time with perhaps an accordion pattern
45
+ between input and output so we do not look at latency control like we do for
46
+ crossfades. -> When receiving its first frame, the liquidsoap input will
47
+ then initialize the corresponding ffmpeg graph input with full format info.
48
+ -> When all inputs have been initialized, which is know by checking if all
49
+ of the graph's lazy values for input pads have been forced (executed), the
50
+ whole graph is initialized, outputs connected and data can start to flow!
51
+ This is captured by the call to `initialized` below.
52
+
53
+ This is contingent to the inputs being checked for `#is_ready` and the
54
+ outputs only pulling when _all_ inputs are available, to avoid running into
55
+ endless pulling loops. *)
59
56
 
60
57
  let ffmpeg_filter_audio = Lang.add_module ~base:ffmpeg_filter "audio"
61
58
  let ffmpeg_filter_video = Lang.add_module ~base:ffmpeg_filter "video"
@@ -565,7 +562,7 @@ let abuffer_args frame =
565
562
  let sample_rate = Avutil.Audio.frame_get_sample_rate frame in
566
563
  let channel_layout = Avutil.Audio.frame_get_channel_layout frame in
567
564
  let channel_layout_params =
568
- match Avutil.Channel_layout.get_native_id channel_layout with
565
+ match Avutil.Channel_layout.get_mask channel_layout with
569
566
  | Some id -> ("channel_layout", `Int64 id)
570
567
  | None ->
571
568
  let channel_layout =
@@ -573,8 +570,7 @@ let abuffer_args frame =
573
570
  (Avutil.Channel_layout.get_nb_channels channel_layout)
574
571
  in
575
572
  ( "channel_layout",
576
- `Int64
577
- (Option.get (Avutil.Channel_layout.get_native_id channel_layout))
573
+ `Int64 (Option.get (Avutil.Channel_layout.get_mask channel_layout))
578
574
  )
579
575
  in
580
576
  let sample_format = Avutil.Audio.frame_get_sample_format frame in
@@ -637,8 +633,8 @@ let _ =
637
633
  (Type.make
638
634
  (Format_type.descr
639
635
  (`Format
640
- Ffmpeg_raw_content.Audio.(
641
- lift_params (default_params `Raw)))))
636
+ Ffmpeg_raw_content.Audio.(
637
+ lift_params (default_params `Raw)))))
642
638
  ())
643
639
  in
644
640
  let name = uniq_name "abuffer" in
@@ -765,8 +761,8 @@ let _ =
765
761
  (Type.make
766
762
  (Format_type.descr
767
763
  (`Format
768
- Ffmpeg_raw_content.Video.(
769
- lift_params (default_params `Raw)))))
764
+ Ffmpeg_raw_content.Video.(
765
+ lift_params (default_params `Raw)))))
770
766
  ())
771
767
  in
772
768
  let name = uniq_name "buffer" in
@@ -885,7 +881,7 @@ let _ =
885
881
  }
886
882
  in
887
883
  let ret = Lang.apply ~pos:(Lang.pos p) fn [("", Graph.to_value graph)] in
888
- let id = Lang_string.generate_id "ffmpeg.filter" in
884
+ let id = "ffmpeg.filter" in
889
885
  let output_clock = Clock.create ~id () in
890
886
  let input_clock =
891
887
  Clock.create_sub_clock ~id:(id ^ ".input") output_clock
@@ -430,7 +430,9 @@ let _ =
430
430
  let path = Lang_string.home_unrelate (Lang.to_string (List.assoc "" p)) in
431
431
  try
432
432
  Builtins_socket.Socket_value.(
433
- to_value (Http.unix_socket (Unix.openfile path flags file_perms)))
433
+ to_value
434
+ (Http.unix_socket ~pos:(Lang.pos p)
435
+ (Unix.openfile path flags file_perms)))
434
436
  with exn ->
435
437
  let bt = Printexc.get_raw_backtrace () in
436
438
  Lang.raise_as_runtime ~bt ~kind:"file" exn)
@@ -28,7 +28,6 @@ let () =
28
28
  ("irc", Irc_option.enabled);
29
29
  ("ladspa", Ladspa_option.enabled);
30
30
  ("lame", Lame_option.enabled);
31
- ("lastfm", Lastfm_option.enabled);
32
31
  ("lilv", Lilv_option.enabled);
33
32
  ("lo", Lo_option.enabled);
34
33
  ("mad", Mad_option.enabled);
@@ -44,7 +44,7 @@ let () =
44
44
  ignore
45
45
  (Lang.add_builtin_value ~base:process name ~category:`System
46
46
  ~descr:("The process' " ^ name)
47
- (Builtins_socket.Socket_value.to_value (Http.unix_socket fd))
47
+ (Builtins_socket.Socket_value.to_value (Http.unix_socket ~pos:[] fd))
48
48
  Builtins_socket.Socket_value.t))
49
49
  [("stdin", Unix.stdin); ("stdout", Unix.stdout); ("stderr", Unix.stderr)]
50
50
 
@@ -258,12 +258,20 @@ let _ =
258
258
  try
259
259
  Tutils.wait_for (`Read out_pipe) timeout;
260
260
  -1.
261
- with Tutils.Timeout f ->
262
- (try Process_handler.kill p
263
- with exn ->
264
- log#important "Error while killing process: %s"
265
- (Printexc.to_string exn));
266
- f
261
+ with
262
+ | Tutils.Exit ->
263
+ (try Process_handler.kill p
264
+ with exn ->
265
+ log#important "Error while killing process: %s"
266
+ (Printexc.to_string exn));
267
+ status := Some (`Exception Tutils.Exit);
268
+ -1.
269
+ | Tutils.Timeout f ->
270
+ (try Process_handler.kill p
271
+ with exn ->
272
+ log#important "Error while killing process: %s"
273
+ (Printexc.to_string exn));
274
+ f
267
275
  in
268
276
  (timed_out, !status))
269
277
  in
@@ -106,6 +106,22 @@ let _ =
106
106
  if reentrant then reentrant_decoders := format :: !reentrant_decoders;
107
107
  Lang.unit)
108
108
 
109
+ let _ =
110
+ Lang.add_builtin ~base:Builtins_sys.playlist_parse "get_file"
111
+ ~category:`Liquidsoap ~descr:"Resolve a uri relative to a given pwd."
112
+ [
113
+ ( "pwd",
114
+ Lang.nullable_t Lang.string_t,
115
+ Some Lang.null,
116
+ Some "Current directory to use for relative file path." );
117
+ ("", Lang.string_t, None, Some "URI");
118
+ ]
119
+ Lang.string_t
120
+ (fun p ->
121
+ let pwd = Lang.to_valued_option Lang.to_string (List.assoc "pwd" p) in
122
+ let uri = Lang.to_string (List.assoc "" p) in
123
+ Lang.string (Playlist_parser.get_file ?pwd uri))
124
+
109
125
  let add_playlist_parser ~format name (parser : Playlist_parser.parser) =
110
126
  let return_t = Lang.list_t (Lang.product_t Lang.metadata_t Lang.string_t) in
111
127
  Lang.add_builtin ~base:Builtins_sys.playlist_parse name ~category:`Liquidsoap
@@ -405,8 +405,8 @@ module Socket_value = struct
405
405
  "Connect a socket to an address." );
406
406
  ]
407
407
 
408
- let to_unix_value v =
409
- let socket = Http.unix_socket v in
408
+ let to_unix_value ~pos v =
409
+ let socket = Http.unix_socket ~pos v in
410
410
  let server = socket#transport#server in
411
411
  Lang.meth (to_server_value socket)
412
412
  [
@@ -452,7 +452,8 @@ let _ =
452
452
  let domain = Socket_domain.of_value (List.assoc "domain" p) in
453
453
  let typ = Socket_type.of_value (List.assoc "type" p) in
454
454
  let protocol = Lang.to_int (List.assoc "protocol" p) in
455
- Socket_value.to_unix_value (Unix.socket ~cloexec:true domain typ protocol))
455
+ Socket_value.to_unix_value ~pos:(Lang.pos p)
456
+ (Unix.socket ~cloexec:true domain typ protocol))
456
457
 
457
458
  let _ =
458
459
  Lang.add_builtin ~base:socket "pair" ~category:`Internet
@@ -472,9 +473,10 @@ let _ =
472
473
  let typ = Socket_type.of_value (List.assoc "type" p) in
473
474
  let protocol = Lang.to_int (List.assoc "protocol" p) in
474
475
  let s, s' = Unix.socketpair ~cloexec:true domain typ protocol in
476
+ let pos = Lang.pos p in
475
477
  Lang.product
476
- (Socket_value.to_unix_value s)
477
- (Socket_value.to_unix_value s'))
478
+ (Socket_value.to_unix_value ~pos s)
479
+ (Socket_value.to_unix_value ~pos s'))
478
480
 
479
481
  let socket_domain = Lang.add_module ~base:socket "domain"
480
482
  let socket_type = Lang.add_module ~base:socket "type"
@@ -23,8 +23,8 @@
23
23
  let source = Muxer.source
24
24
 
25
25
  let _ =
26
- Lang.add_builtin ~base:source "set_name" ~category:(`Source `Liquidsoap)
27
- ~descr:"Set the name of an operator."
26
+ Lang.add_builtin ~base:source "set_id" ~category:(`Source `Liquidsoap)
27
+ ~descr:"Set the id of an operator."
28
28
  [
29
29
  ("", Lang.source_t (Lang.univ_t ()), None, None);
30
30
  ("", Lang.string_t, None, None);
@@ -33,7 +33,7 @@ let _ =
33
33
  (fun p ->
34
34
  let s = Lang.assoc "" 1 p |> Lang.to_source in
35
35
  let n = Lang.assoc "" 2 p |> Lang.to_string in
36
- s#set_name n;
36
+ s#set_id n;
37
37
  Lang.unit)
38
38
 
39
39
  let _ =
@@ -28,18 +28,37 @@ exception Done
28
28
  exception Not_connected
29
29
 
30
30
  module Socket_value = struct
31
- let read_only_socket_options_specs = [("read_data", `Int Srt.rcvdata)]
31
+ let read_only_socket_options_specs = [("rcvdata", `Int Srt.rcvdata)]
32
+
33
+ let write_only_socket_options_specs =
34
+ [
35
+ ("messageapi", `Bool Srt.messageapi);
36
+ ("payloadsize", `Int Srt.payloadsize);
37
+ ("conntimeo", `Int Srt.conntimeo);
38
+ ("passphrase", `String Srt.passphrase);
39
+ ("enforced_encryption", `Bool Srt.enforced_encryption);
40
+ ]
32
41
 
33
42
  let read_write_socket_options_specs =
34
43
  [
35
- ("read_timeout", `Int Srt.rcvtimeo);
36
- ("write_timeout", `Int Srt.sndtimeo);
44
+ ("rcvsyn", `Bool Srt.rcvsyn);
45
+ ("sndsyn", `Bool Srt.sndsyn);
46
+ ("rcvtimeout", `Int Srt.rcvtimeo);
47
+ ("sndtimeout", `Int Srt.sndtimeo);
48
+ ("reuseaddr", `Bool Srt.reuseaddr);
49
+ ("rcvbuf", `Int Srt.rcvbuf);
50
+ ("sndbuf", `Int Srt.sndbuf);
51
+ ("udp_rcvbuf", `Int Srt.udp_rcvbuf);
52
+ ("udp_sndbuf", `Int Srt.udp_sndbuf);
37
53
  ("streamid", `String Srt.streamid);
38
54
  ("pbkeylen", `Int Srt.pbkeylen);
39
- ("read_latency", `Int Srt.rcvlatency);
55
+ ("ipv6only", `Bool Srt.ipv6only);
56
+ ("rcvlatency", `Int Srt.rcvlatency);
57
+ ("peerlatency", `Int Srt.peerlatency);
58
+ ("latency", `Int Srt.latency);
40
59
  ]
41
60
 
42
- let mk_socket_option name socket_opt =
61
+ let mk_read_socket_option name socket_opt =
43
62
  let t =
44
63
  match socket_opt with
45
64
  | `Int _ -> Lang.int_t
@@ -61,12 +80,52 @@ module Socket_value = struct
61
80
  let bt = Printexc.get_raw_backtrace () in
62
81
  Lang.raise_as_runtime ~bt ~kind:"srt" exn) )
63
82
 
83
+ let mk_write_socket_option name socket_opt =
84
+ let t =
85
+ match socket_opt with
86
+ | `Int _ -> Lang.int_t
87
+ | `Bool _ -> Lang.bool_t
88
+ | `String _ -> Lang.string_t
89
+ in
90
+ ( "set_" ^ name,
91
+ ([], Lang.fun_t [(false, "", t)] Lang.unit_t),
92
+ "Set " ^ name ^ " option",
93
+ fun s ->
94
+ Lang.val_fun
95
+ [("", "", None)]
96
+ (fun p ->
97
+ let v = List.assoc "" p in
98
+ try
99
+ (match socket_opt with
100
+ | `Int socket_opt ->
101
+ Srt.setsockflag s socket_opt (Lang.to_int v)
102
+ | `Bool socket_opt ->
103
+ Srt.setsockflag s socket_opt (Lang.to_bool v)
104
+ | `String socket_opt ->
105
+ Srt.setsockflag s socket_opt (Lang.to_string v));
106
+ Lang.unit
107
+ with exn ->
108
+ let bt = Printexc.get_raw_backtrace () in
109
+ Lang.raise_as_runtime ~bt ~kind:"srt" exn) )
110
+
64
111
  let socket_options_meths =
112
+ let read_meths =
113
+ List.fold_left
114
+ (fun cur (name, socket_opt) ->
115
+ mk_read_socket_option name socket_opt :: cur)
116
+ (List.fold_left
117
+ (fun cur (name, socket_opt) ->
118
+ mk_read_socket_option name socket_opt :: cur)
119
+ [] read_only_socket_options_specs)
120
+ read_write_socket_options_specs
121
+ in
65
122
  List.fold_left
66
- (fun cur (name, socket_opt) -> mk_socket_option name socket_opt :: cur)
123
+ (fun cur (name, socket_opt) ->
124
+ mk_write_socket_option name socket_opt :: cur)
67
125
  (List.fold_left
68
- (fun cur (name, socket_opt) -> mk_socket_option name socket_opt :: cur)
69
- [] read_only_socket_options_specs)
126
+ (fun cur (name, socket_opt) ->
127
+ mk_write_socket_option name socket_opt :: cur)
128
+ read_meths write_only_socket_options_specs)
70
129
  read_write_socket_options_specs
71
130
 
72
131
  let stats_specs =
@@ -263,6 +322,10 @@ module Socket_value = struct
263
322
  let meths =
264
323
  socket_options_meths
265
324
  @ [
325
+ ( "id",
326
+ ([], Lang.int_t),
327
+ "Socket ID",
328
+ fun s -> Lang.int (Srt.socket_id s) );
266
329
  ( "status",
267
330
  ([], Lang.fun_t [] Lang.string_t),
268
331
  "Socket status",
@@ -327,9 +390,22 @@ module Socket_value = struct
327
390
  (List.map (fun (n, _, fn) -> (n, fn stats)) stats_specs)) );
328
391
  ]
329
392
 
393
+ let base_t = t
394
+
330
395
  let t =
331
396
  Lang.method_t t (List.map (fun (lbl, t, descr, _) -> (lbl, t, descr)) meths)
332
397
 
398
+ let to_base_value = to_value
399
+
333
400
  let to_value s =
334
401
  Lang.meth (to_value s) (List.map (fun (lbl, _, _, m) -> (lbl, m s)) meths)
335
402
  end
403
+
404
+ let srt = Lang.add_module "srt"
405
+
406
+ let clock =
407
+ Lang.add_builtin "socket" ~base:srt ~category:`Liquidsoap
408
+ ~descr:"Decorate a srt socket with all its methods."
409
+ [("", Socket_value.base_t, None, None)]
410
+ Socket_value.t
411
+ (fun p -> Socket_value.(to_value (of_value (List.assoc "" p))))
@@ -174,3 +174,16 @@ let _ =
174
174
  ("picture_type", Lang.int pic.Metadata.ID3v2.pic_type);
175
175
  ("description", Lang.string pic.Metadata.ID3v2.pic_description);
176
176
  ])
177
+
178
+ let _ =
179
+ Lang.add_builtin ~base:string "id" ~category:`String
180
+ ~descr:"Generate an identifier with given operator name."
181
+ [
182
+ ("category", Lang.string_t, Some (Lang.string ""), Some "Category");
183
+ ("", Lang.string_t, None, Some "Operator name.");
184
+ ]
185
+ Lang.string_t
186
+ (fun p ->
187
+ let name = List.assoc "" p |> Lang.to_string in
188
+ let category = List.assoc "category" p |> Lang.to_string in
189
+ Lang.string (Lang_string.generate_id ~category name))
@@ -76,10 +76,10 @@ let decoder_oblivious = Lang.add_module ~base:decoder "oblivious"
76
76
 
77
77
  let _ =
78
78
  (* The type of the test function for external decoders.
79
- * Return is one of:
80
- * . 0: no audio
81
- * . -1: audio with unknown number of channels.
82
- * . x >= 1: audio with a fixed number (x) of channels. *)
79
+ Return is one of:
80
+ . 0: no audio
81
+ . -1: audio with unknown number of channels.
82
+ . x >= 1: audio with a fixed number (x) of channels. *)
83
83
  let test_file_t = Lang.fun_t [(false, "", Lang.string_t)] Lang.int_t in
84
84
  let test_arg =
85
85
  ( "test",
@@ -310,8 +310,8 @@ let _ =
310
310
 
311
311
  let _ =
312
312
  (* Cheap implementation of "getopt" which does not really deserve its name
313
- * since it has little to do with the standards that getopt(3) implements.
314
- * A complete rework of argv() and getopt() should eventually be done. *)
313
+ since it has little to do with the standards that getopt(3) implements.
314
+ A complete rework of argv() and getopt() should eventually be done. *)
315
315
  let argv = Shebang.argv in
316
316
  let offset =
317
317
  (* Index of the last non-script parameter on the command-line. *)
@@ -148,8 +148,8 @@ let _ =
148
148
  let _ =
149
149
  Lang.add_builtin ~base:thread "pause" ~category:`Programming
150
150
  ~descr:
151
- "Pause execution for a given amount of seconds. This freezes the calling \
152
- thread and should not be used in the main streaming loop."
151
+ "Pause execution for a given amount of seconds. This puts the calling \
152
+ thread to sleep and should not be used in the main streaming loop."
153
153
  [("", Lang.float_t, None, Some "Number of seconds of pause.")]
154
154
  Lang.unit_t
155
155
  (fun p ->
@@ -41,8 +41,8 @@ let _ =
41
41
  let time =
42
42
  Lang.add_builtin ~category:`Time "time"
43
43
  ~descr:
44
- "Return the current time since 00:00:00 GMT, Jan. 1, 1970, in seconds." []
45
- Lang.float_t (fun _ -> Lang.float (Unix.gettimeofday ()))
44
+ "Return the current time since 00:00:00 GMT, Jan. 1, 1970, in seconds."
45
+ [] Lang.float_t (fun _ -> Lang.float (Unix.gettimeofday ()))
46
46
 
47
47
  let _ =
48
48
  Lang.add_builtin ~category:`Time ~base:time "up"
@@ -158,7 +158,9 @@ let _ =
158
158
  try
159
159
  let tokenizer = Liquidsoap_lang.Preprocessor.mk_tokenizer lexbuf in
160
160
  let predicate =
161
- Liquidsoap_lang.Term_reducer.to_term (processor tokenizer)
161
+ Liquidsoap_lang.Term_reducer.to_term
162
+ ~throw:(fun ~bt exn -> Printexc.raise_with_backtrace exn bt)
163
+ (processor tokenizer)
162
164
  in
163
165
  Lang.val_fun [] (fun _ -> Liquidsoap_lang.Evaluation.eval predicate)
164
166
  with _ ->
@@ -30,7 +30,7 @@ module Liq_tls = struct
30
30
  mutable state : Tls.Engine.state;
31
31
  }
32
32
 
33
- let () = Mirage_crypto_rng_unix.initialize (module Mirage_crypto_rng.Fortuna)
33
+ let () = Mirage_crypto_rng_unix.use_default ()
34
34
  let buf_len = 4096
35
35
 
36
36
  let string_of_alert_level = function