codemirror-lang-liquidsoap 0.3.5 → 0.3.7
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.
- package/dist/cli.js +8 -8
- package/dist/index.js +7 -7
- package/package.json +1 -1
- package/src/liquidsoap.grammar +10 -4
- package/src/parser.js +6 -6
- package/tests/liquidsoap/.codespellignore +1 -0
- package/tests/liquidsoap/.github/ISSUE_TEMPLATE/bug_report.yml +16 -0
- package/tests/liquidsoap/.github/docker/alpine.dockerfile +20 -0
- package/tests/liquidsoap/.github/docker/debian.dockerfile +55 -0
- package/tests/liquidsoap/.github/opam/{liquidsoap-core-windows.opam → liquidsoap-windows.opam} +8 -5
- package/tests/liquidsoap/.github/renovate.json +23 -0
- package/tests/liquidsoap/.github/scripts/add-local-opam-packages.sh +5 -3
- package/tests/liquidsoap/.github/scripts/build-apk.sh +10 -19
- package/tests/liquidsoap/.github/scripts/build-deb.sh +6 -15
- package/tests/liquidsoap/.github/scripts/build-details.sh +15 -4
- package/tests/liquidsoap/.github/scripts/build-posix.sh +11 -20
- package/tests/liquidsoap/.github/scripts/build-website.sh +1 -1
- package/tests/liquidsoap/.github/scripts/build-win32.sh +6 -2
- package/tests/liquidsoap/.github/scripts/push-docker.sh +13 -15
- package/tests/liquidsoap/.github/workflows/ci.yml +291 -185
- package/tests/liquidsoap/.ocamlformat +1 -1
- package/tests/liquidsoap/.pre-commit-config.yaml +2 -2
- package/tests/liquidsoap/CHANGES.md +112 -3
- package/tests/liquidsoap/README.md +10 -9
- package/tests/liquidsoap/ROADMAP.md +14 -8
- package/tests/liquidsoap/bin/liquidsoap-macos-instruments +7 -0
- package/tests/liquidsoap/doc/content/build.md +0 -1
- package/tests/liquidsoap/doc/content/faq.md +2 -4
- package/tests/liquidsoap/doc/content/icy_metadata.md +2 -2
- package/tests/liquidsoap/doc/content/install.md +13 -2
- package/tests/liquidsoap/doc/content/json.md +1 -1
- package/tests/liquidsoap/doc/content/language.md +4 -4
- package/tests/liquidsoap/doc/content/liq/beets-protocol.liq +1 -1
- package/tests/liquidsoap/doc/content/liq/crossfade.liq +1 -1
- package/tests/liquidsoap/doc/content/liq/harbor-simple.liq +1 -1
- package/tests/liquidsoap/doc/content/liq/radiopi.liq +10 -9
- package/tests/liquidsoap/doc/content/liq/request.dynamic.liq +1 -1
- package/tests/liquidsoap/doc/content/migrating.md +25 -3
- package/tests/liquidsoap/doc/content/playlist_parsers.md +46 -1
- package/tests/liquidsoap/doc/content/script_loading.md +3 -0
- package/tests/liquidsoap/doc/content/xml.md +160 -0
- package/tests/liquidsoap/doc/dune.inc +129 -0
- package/tests/liquidsoap/dune-project +29 -49
- package/tests/liquidsoap/liquidsoap +1 -1
- package/tests/liquidsoap/{liquidsoap-js.opam → opam/liquidsoap-js.opam} +3 -2
- package/tests/liquidsoap/{liquidsoap-lang.opam → opam/liquidsoap-lang.opam} +4 -3
- package/tests/liquidsoap/{liquidsoap-mode.opam → opam/liquidsoap-mode.opam} +3 -2
- package/tests/liquidsoap/{liquidsoap-core.opam → opam/liquidsoap.opam} +46 -17
- package/tests/liquidsoap/{prometheus-liquidsoap.opam → opam/prometheus-liquidsoap.opam} +2 -1
- package/tests/liquidsoap/{sdl-liquidsoap.opam → opam/sdl-liquidsoap.opam} +2 -1
- package/tests/liquidsoap/{tls-liquidsoap.opam → opam/tls-liquidsoap.opam} +2 -1
- package/tests/liquidsoap/src/bin/dune +1 -1
- package/tests/liquidsoap/src/config/xmlplaylist_option.disabled.ml +2 -0
- package/tests/liquidsoap/src/core/builtins/builtins_ffmpeg_decoder.ml +22 -22
- package/tests/liquidsoap/src/core/builtins/builtins_ffmpeg_encoder.ml +4 -4
- package/tests/liquidsoap/src/core/builtins/builtins_ffmpeg_filters.ml +37 -41
- package/tests/liquidsoap/src/core/builtins/builtins_files.ml +3 -1
- package/tests/liquidsoap/src/core/builtins/builtins_optionals.ml +0 -1
- package/tests/liquidsoap/src/core/builtins/builtins_process.ml +15 -7
- package/tests/liquidsoap/src/core/builtins/builtins_resolvers.ml +16 -0
- package/tests/liquidsoap/src/core/builtins/builtins_socket.ml +7 -5
- package/tests/liquidsoap/src/core/builtins/builtins_source.ml +3 -3
- package/tests/liquidsoap/src/core/builtins/builtins_srt.ml +84 -8
- package/tests/liquidsoap/src/core/builtins/builtins_string_extra.ml +13 -0
- package/tests/liquidsoap/src/core/builtins/builtins_sys.ml +6 -6
- package/tests/liquidsoap/src/core/builtins/builtins_thread.ml +2 -2
- package/tests/liquidsoap/src/core/builtins/builtins_time.ml +5 -3
- package/tests/liquidsoap/src/core/builtins/builtins_tls.ml +1 -1
- package/tests/liquidsoap/src/core/clock.ml +105 -38
- package/tests/liquidsoap/src/core/clock.mli +1 -0
- package/tests/liquidsoap/src/core/clock_base.ml +2 -2
- package/tests/liquidsoap/src/core/conversions/stereo.ml +6 -8
- package/tests/liquidsoap/src/core/converters/audio_converter.mli +5 -5
- package/tests/liquidsoap/src/core/converters/video_converter.ml +2 -2
- package/tests/liquidsoap/src/core/converters/video_converter.mli +3 -3
- package/tests/liquidsoap/src/core/decoder/decoder.ml +14 -17
- package/tests/liquidsoap/src/core/decoder/decoder.mli +11 -11
- package/tests/liquidsoap/src/core/decoder/decoder_utils.ml +12 -13
- package/tests/liquidsoap/src/core/decoder/decoder_utils.mli +2 -3
- package/tests/liquidsoap/src/core/decoder/external_decoder.ml +9 -13
- package/tests/liquidsoap/src/core/decoder/ffmpeg_decoder.ml +57 -53
- package/tests/liquidsoap/src/core/decoder/ffmpeg_raw_decoder.ml +28 -9
- package/tests/liquidsoap/src/core/decoder/flac_metadata_plug.ml +15 -2
- package/tests/liquidsoap/src/core/decoder/image_decoder.ml +33 -19
- package/tests/liquidsoap/src/core/decoder/liq_flac_decoder.ml +22 -23
- package/tests/liquidsoap/src/core/decoder/liq_ogg_decoder.ml +5 -5
- package/tests/liquidsoap/src/core/decoder/mad_decoder.ml +2 -2
- package/tests/liquidsoap/src/core/decoder/midi_decoder.ml +1 -2
- package/tests/liquidsoap/src/core/decoder/ogg_flac_duration.ml +3 -11
- package/tests/liquidsoap/src/core/decoder/ogg_metadata_plug.ml +15 -2
- package/tests/liquidsoap/src/core/decoder/raw_audio_decoder.ml +8 -7
- package/tests/liquidsoap/src/core/decoder/wav_aiff_decoder.ml +3 -3
- package/tests/liquidsoap/src/core/dune +2 -15
- package/tests/liquidsoap/src/core/encoder/encoder.ml +18 -23
- package/tests/liquidsoap/src/core/encoder/encoder.mli +12 -17
- package/tests/liquidsoap/src/core/encoder/encoders/ffmpeg_encoder.ml +13 -27
- package/tests/liquidsoap/src/core/encoder/encoders/ffmpeg_encoder_common.ml +1 -1
- package/tests/liquidsoap/src/core/encoder/encoders/flac_encoder.ml +3 -4
- package/tests/liquidsoap/src/core/encoder/encoders/ndi_encoder.ml +2 -1
- package/tests/liquidsoap/src/core/encoder/encoders/ogg_encoder.ml +1 -2
- package/tests/liquidsoap/src/core/encoder/lang/lang_external_encoder.ml +2 -2
- package/tests/liquidsoap/src/core/encoder/lang/lang_fdkaac.ml +1 -1
- package/tests/liquidsoap/src/core/encoder/lang/lang_ffmpeg.ml +46 -39
- package/tests/liquidsoap/src/core/encoder/lang/lang_flac.ml +1 -1
- package/tests/liquidsoap/src/core/encoder/lang/lang_shine.ml +2 -2
- package/tests/liquidsoap/src/core/encoder/lang/lang_vorbis.ml +1 -1
- package/tests/liquidsoap/src/core/encoder/lang/lang_wav.ml +1 -1
- package/tests/liquidsoap/src/core/file_watcher.inotify.ml +8 -13
- package/tests/liquidsoap/src/core/harbor/harbor.ml +22 -24
- package/tests/liquidsoap/src/core/io/ffmpeg_filter_io.ml +4 -3
- package/tests/liquidsoap/src/core/io/oss_io.ml +3 -4
- package/tests/liquidsoap/src/core/io/portaudio_io.ml +1 -1
- package/tests/liquidsoap/src/core/io/pulseaudio_io.ml +3 -4
- package/tests/liquidsoap/src/core/io/srt_io.ml +316 -120
- package/tests/liquidsoap/src/core/io/udp_io.ml +14 -12
- package/tests/liquidsoap/src/core/lang.mli +10 -12
- package/tests/liquidsoap/src/core/lang_source.ml +25 -39
- package/tests/liquidsoap/src/core/lang_string.ml +30 -0
- package/tests/liquidsoap/src/core/lang_string.mli +3 -0
- package/tests/liquidsoap/src/core/ogg_formats/ogg_flac_encoder.ml +6 -6
- package/tests/liquidsoap/src/core/ogg_formats/ogg_muxer.ml +17 -27
- package/tests/liquidsoap/src/core/ogg_formats/ogg_muxer.mli +44 -53
- package/tests/liquidsoap/src/core/ogg_formats/opus_encoder.ml +1 -1
- package/tests/liquidsoap/src/core/ogg_formats/vorbis_encoder.ml +1 -2
- package/tests/liquidsoap/src/core/operators/add.ml +2 -2
- package/tests/liquidsoap/src/core/operators/cross.ml +2 -2
- package/tests/liquidsoap/src/core/operators/delay.ml +23 -6
- package/tests/liquidsoap/src/core/operators/dtmf.ml +3 -2
- package/tests/liquidsoap/src/core/operators/dyn_op.ml +2 -2
- package/tests/liquidsoap/src/core/operators/fir_filter.ml +2 -1
- package/tests/liquidsoap/src/core/operators/iir_filter.ml +1 -1
- package/tests/liquidsoap/src/core/operators/insert_metadata.ml +1 -1
- package/tests/liquidsoap/src/core/operators/lilv_op.ml +1 -1
- package/tests/liquidsoap/src/core/operators/lufs.ml +136 -89
- package/tests/liquidsoap/src/core/operators/lufs_c.c +105 -0
- package/tests/liquidsoap/src/core/operators/map_metadata.ml +33 -9
- package/tests/liquidsoap/src/core/operators/max_duration.ml +3 -4
- package/tests/liquidsoap/src/core/operators/muxer.ml +2 -1
- package/tests/liquidsoap/src/core/operators/noblank.ml +6 -6
- package/tests/liquidsoap/src/core/operators/sequence.ml +5 -5
- package/tests/liquidsoap/src/core/operators/switch.ml +10 -11
- package/tests/liquidsoap/src/core/operators/time_warp.ml +14 -11
- package/tests/liquidsoap/src/core/operators/video_fade.ml +2 -3
- package/tests/liquidsoap/src/core/outputs/ao_out.ml +1 -1
- package/tests/liquidsoap/src/core/outputs/bjack_out.ml +1 -1
- package/tests/liquidsoap/src/core/outputs/graphics_out.ml +6 -2
- package/tests/liquidsoap/src/core/outputs/harbor_output.ml +12 -10
- package/tests/liquidsoap/src/core/outputs/hls_output.ml +19 -14
- package/tests/liquidsoap/src/core/outputs/icecast2.ml +85 -52
- package/tests/liquidsoap/src/core/outputs/ndi_out.ml +1 -1
- package/tests/liquidsoap/src/core/outputs/output.ml +8 -9
- package/tests/liquidsoap/src/core/outputs/output.mli +61 -61
- package/tests/liquidsoap/src/core/outputs/pipe_output.ml +8 -6
- package/tests/liquidsoap/src/core/outputs/sdl_out.ml +5 -2
- package/tests/liquidsoap/src/core/playlist_parser.ml +6 -7
- package/tests/liquidsoap/src/core/playlists/playlist_basic.ml +0 -180
- package/tests/liquidsoap/src/core/protocols/annotate.ml +3 -3
- package/tests/liquidsoap/src/core/request.ml +16 -17
- package/tests/liquidsoap/src/core/request.mli +27 -28
- package/tests/liquidsoap/src/core/shebang.ml +3 -2
- package/tests/liquidsoap/src/core/source.ml +104 -63
- package/tests/liquidsoap/src/core/source.mli +249 -247
- package/tests/liquidsoap/src/core/sources/generated.ml +2 -2
- package/tests/liquidsoap/src/core/sources/request_dynamic.ml +2 -2
- package/tests/liquidsoap/src/core/sources/synthesized.ml +2 -2
- package/tests/liquidsoap/src/core/stream/aFrame.mli +7 -9
- package/tests/liquidsoap/src/core/stream/content.mli +4 -13
- package/tests/liquidsoap/src/core/stream/content_base.ml +2 -19
- package/tests/liquidsoap/src/core/stream/content_video.ml +9 -10
- package/tests/liquidsoap/src/core/stream/ffmpeg_copy_content.ml +19 -15
- package/tests/liquidsoap/src/core/stream/ffmpeg_raw_content.ml +26 -9
- package/tests/liquidsoap/src/core/stream/frame.ml +4 -4
- package/tests/liquidsoap/src/core/stream/frame.mli +13 -15
- package/tests/liquidsoap/src/core/stream/frame_base.ml +1 -2
- package/tests/liquidsoap/src/core/stream/frame_settings.ml +14 -14
- package/tests/liquidsoap/src/core/stream/generator.mli +14 -17
- package/tests/liquidsoap/src/core/stream/mFrame.mli +2 -2
- package/tests/liquidsoap/src/core/tools/charset.ml +28 -18
- package/tests/liquidsoap/src/core/tools/charset_base.ml +5 -0
- package/tests/liquidsoap/src/core/tools/child_support.ml +2 -2
- package/tests/liquidsoap/src/core/tools/ffmpeg_avfilter_utils.ml +139 -0
- package/tests/liquidsoap/src/core/tools/ffmpeg_avfilter_utils.mli +22 -0
- package/tests/liquidsoap/src/core/tools/ffmpeg_utils.ml +2 -1
- package/tests/liquidsoap/src/core/tools/lifecycle.mli +4 -4
- package/tests/liquidsoap/src/core/tools/liq_http.ml +44 -19
- package/tests/liquidsoap/src/core/tools/liq_http.mli +1 -1
- package/tests/liquidsoap/src/core/tools/log.ml +3 -8
- package/tests/liquidsoap/src/core/tools/log.mli +1 -1
- package/tests/liquidsoap/src/core/tools/mutex_utils.ml +1 -1
- package/tests/liquidsoap/src/core/tools/pool.ml +2 -2
- package/tests/liquidsoap/src/core/tools/process_handler.mli +30 -27
- package/tests/liquidsoap/src/core/tools/producer_consumer.ml +10 -9
- package/tests/liquidsoap/src/{lang → core/tools}/queues.ml +58 -64
- package/tests/liquidsoap/src/{lang → core/tools}/queues.mli +10 -0
- package/tests/liquidsoap/src/core/tools/sdl_utils.ml +2 -0
- package/tests/liquidsoap/src/core/tools/server.mli +8 -8
- package/tests/liquidsoap/src/core/tools/sha1.ml +2 -1
- package/tests/liquidsoap/src/core/tools/start_stop.ml +2 -1
- package/tests/liquidsoap/src/core/tools/strings.mli +5 -4
- package/tests/liquidsoap/src/core/tools/tutils.ml +7 -7
- package/tests/liquidsoap/src/core/tools/tutils.mli +14 -18
- package/tests/liquidsoap/src/core/tools/unix_c.c +16 -5
- package/tests/liquidsoap/src/core/tools/utils.ml +83 -25
- package/tests/liquidsoap/src/core/tools/wav_aiff.ml +3 -3
- package/tests/liquidsoap/src/core/tools/wav_aiff.mli +7 -7
- package/tests/liquidsoap/src/core/types/format_type.ml +6 -6
- package/tests/liquidsoap/src/js/index.html +1 -154
- package/tests/liquidsoap/src/js/interactive_js.ml +7 -3
- package/tests/liquidsoap/src/js/stdlib_js.liq +6 -0
- package/tests/liquidsoap/src/lang/builtins_lang.ml +8 -0
- package/tests/liquidsoap/src/lang/builtins_null.ml +1 -1
- package/tests/liquidsoap/src/lang/builtins_string.ml +2 -11
- package/tests/liquidsoap/src/lang/builtins_xml.ml +204 -0
- package/tests/liquidsoap/src/lang/cache.ml +7 -2
- package/tests/liquidsoap/src/lang/dune +5 -2
- package/tests/liquidsoap/src/lang/flags.ml +2 -2
- package/tests/liquidsoap/src/lang/lang.mli +10 -12
- package/tests/liquidsoap/src/lang/lang_core.ml +24 -24
- package/tests/liquidsoap/src/lang/lang_eval.ml +1 -1
- package/tests/liquidsoap/src/lang/lang_string.ml +7 -13
- package/tests/liquidsoap/src/lang/lang_string.mli +0 -1
- package/tests/liquidsoap/src/lang/lexer.ml +3 -0
- package/tests/liquidsoap/src/lang/parser.mly +7 -4
- package/tests/liquidsoap/src/lang/parser_helper.ml +9 -77
- package/tests/liquidsoap/src/lang/parser_helper.mli +1 -1
- package/tests/liquidsoap/src/lang/pos.ml +4 -4
- package/tests/liquidsoap/src/lang/pos.mli +55 -0
- package/tests/liquidsoap/src/lang/preprocessor.ml +12 -5
- package/tests/liquidsoap/src/lang/repr.ml +6 -6
- package/tests/liquidsoap/src/lang/runtime.ml +55 -48
- package/tests/liquidsoap/src/lang/runtime.mli +8 -3
- package/tests/liquidsoap/src/lang/term/parsed_term.ml +33 -33
- package/tests/liquidsoap/src/lang/term/term_base.ml +14 -10
- package/tests/liquidsoap/src/lang/term/term_preprocessor.ml +28 -1
- package/tests/liquidsoap/src/lang/term/term_reducer.ml +244 -132
- package/tests/liquidsoap/src/lang/term/term_reducer.mli +10 -2
- package/tests/liquidsoap/src/lang/term/term_stdlib.ml +14 -13
- package/tests/liquidsoap/src/lang/term.mli +3 -1
- package/tests/liquidsoap/src/lang/typechecking.ml +16 -16
- package/tests/liquidsoap/src/lang/typechecking.mli +5 -1
- package/tests/liquidsoap/src/lang/types/type_base.ml +16 -17
- package/tests/liquidsoap/src/lang/typing.ml +13 -12
- package/tests/liquidsoap/src/lang/typing.mli +2 -1
- package/tests/liquidsoap/src/lang/value.ml +20 -14
- package/tests/liquidsoap/src/libs/audio.liq +53 -18
- package/tests/liquidsoap/src/libs/autocue.liq +8 -8
- package/tests/liquidsoap/src/libs/clock.liq +3 -3
- package/tests/liquidsoap/src/libs/dune +2 -2
- package/tests/liquidsoap/src/libs/extra/audio.liq +4 -4
- package/tests/liquidsoap/src/libs/extra/audioscrobbler.liq +487 -0
- package/tests/liquidsoap/src/libs/extra/deprecations.liq +11 -11
- package/tests/liquidsoap/src/libs/extra/externals.liq +9 -9
- package/tests/liquidsoap/src/libs/extra/fades.liq +2 -2
- package/tests/liquidsoap/src/libs/extra/file.liq +1 -1
- package/tests/liquidsoap/src/libs/extra/http.liq +4 -4
- package/tests/liquidsoap/src/libs/extra/interactive.liq +1 -1
- package/tests/liquidsoap/src/libs/extra/metadata.liq +3 -3
- package/tests/liquidsoap/src/libs/extra/native.liq +6 -6
- package/tests/liquidsoap/src/libs/extra/server.liq +2 -2
- package/tests/liquidsoap/src/libs/extra/source.liq +10 -10
- package/tests/liquidsoap/src/libs/extra/spinitron.liq +11 -11
- package/tests/liquidsoap/src/libs/extra/telnet.liq +51 -0
- package/tests/liquidsoap/src/libs/extra/video.liq +2 -2
- package/tests/liquidsoap/src/libs/fades.liq +70 -57
- package/tests/liquidsoap/src/libs/ffmpeg.liq +50 -33
- package/tests/liquidsoap/src/libs/file.liq +8 -8
- package/tests/liquidsoap/src/libs/hls.liq +5 -5
- package/tests/liquidsoap/src/libs/http.liq +64 -37
- package/tests/liquidsoap/src/libs/icecast.liq +1 -1
- package/tests/liquidsoap/src/libs/io.liq +6 -6
- package/tests/liquidsoap/src/libs/medialib.liq +46 -45
- package/tests/liquidsoap/src/libs/metadata.liq +4 -4
- package/tests/liquidsoap/src/libs/null.liq +3 -3
- package/tests/liquidsoap/src/libs/playlist.liq +547 -22
- package/tests/liquidsoap/src/libs/protocols.liq +14 -14
- package/tests/liquidsoap/src/libs/replaygain.liq +11 -11
- package/tests/liquidsoap/src/libs/request.liq +27 -29
- package/tests/liquidsoap/src/libs/runtime.liq +2 -0
- package/tests/liquidsoap/src/libs/source.liq +15 -15
- package/tests/liquidsoap/src/libs/sqlite.liq +1 -1
- package/tests/liquidsoap/src/libs/stdlib.liq +1 -1
- package/tests/liquidsoap/src/libs/string.liq +6 -6
- package/tests/liquidsoap/src/libs/switches.liq +3 -3
- package/tests/liquidsoap/src/libs/thread.liq +3 -9
- package/tests/liquidsoap/src/libs/tracks.liq +23 -9
- package/tests/liquidsoap/src/libs/video.liq +32 -32
- package/tests/liquidsoap/src/modules/dtools/README.md +58 -0
- package/tests/liquidsoap/src/modules/dtools/dtools.ml +19 -0
- package/tests/liquidsoap/src/modules/dtools/dtools.mli +284 -0
- package/tests/liquidsoap/src/modules/dtools/dtools_impl.ml +860 -0
- package/tests/liquidsoap/src/modules/dtools/dtools_syslog.impl.ml +45 -0
- package/tests/liquidsoap/src/modules/dtools/dtools_syslog.noop.ml +1 -0
- package/tests/liquidsoap/src/modules/dtools/dune +12 -0
- package/tests/liquidsoap/src/modules/duppy/.merlin +4 -0
- package/tests/liquidsoap/src/modules/duppy/README.md +47 -0
- package/tests/liquidsoap/src/modules/duppy/dune +7 -0
- package/tests/liquidsoap/src/modules/duppy/duppy.ml +1097 -0
- package/tests/liquidsoap/src/modules/duppy/duppy.mli +494 -0
- package/tests/liquidsoap/src/modules/duppy/duppy_stubs.c +176 -0
- package/tests/liquidsoap/src/modules/duppy/examples/dune +9 -0
- package/tests/liquidsoap/src/modules/duppy/examples/http.ml +560 -0
- package/tests/liquidsoap/src/modules/duppy/examples/index.html +1 -0
- package/tests/liquidsoap/src/modules/duppy/examples/telnet.ml +150 -0
- package/tests/liquidsoap/src/modules/xmlplaylist/dune +5 -0
- package/tests/liquidsoap/src/modules/xmlplaylist/xmlplaylist.ml +185 -0
- package/tests/liquidsoap/src/modules/xmlplaylist/xmlplaylist.mli +56 -0
- package/tests/liquidsoap/src/ndi/ndi.mli +2 -3
- package/tests/liquidsoap/src/runtime/build_config.ml +0 -1
- package/tests/liquidsoap/src/runtime/main.ml +4 -23
- package/tests/liquidsoap/src/stereotool/stereotool.mli +3 -3
- package/tests/liquidsoap/src/tooling/parsed_json.ml +6 -4
- package/tests/liquidsoap/tests/core/content_test.ml +2 -39
- package/tests/liquidsoap/tests/core/dune +13 -0
- package/tests/liquidsoap/tests/core/dune.inc +1 -1
- package/tests/liquidsoap/tests/core/gen_dune.ml +4 -1
- package/tests/liquidsoap/tests/core/json_test.ml +10 -0
- package/tests/liquidsoap/tests/core/more_types.ml +32 -28
- package/tests/liquidsoap/tests/core/output_encoded_test.ml +2 -0
- package/tests/liquidsoap/tests/core/string_test.ml +4 -0
- package/tests/liquidsoap/tests/core/types.ml +1 -1
- package/tests/liquidsoap/tests/harbor/http.liq +1 -1
- package/tests/liquidsoap/tests/harbor/http2.liq +1 -1
- package/tests/liquidsoap/tests/language/cue_test.liq +3993 -0
- package/tests/liquidsoap/tests/language/dune.inc +24 -0
- package/tests/liquidsoap/tests/language/error.liq +1 -1
- package/tests/liquidsoap/tests/language/json.liq +11 -11
- package/tests/liquidsoap/tests/language/list.liq +1 -1
- package/tests/liquidsoap/tests/language/metadata.liq +1 -1
- package/tests/liquidsoap/tests/language/null.liq +9 -9
- package/tests/liquidsoap/tests/language/record.liq +23 -23
- package/tests/liquidsoap/tests/language/replaygain.liq +8 -8
- package/tests/liquidsoap/tests/language/sqlite.liq +1 -1
- package/tests/liquidsoap/tests/language/string.liq +1 -1
- package/tests/liquidsoap/tests/language/type_errors.liq +2 -2
- package/tests/liquidsoap/tests/language/typing.liq +2 -2
- package/tests/liquidsoap/tests/language/various.liq +1 -0
- package/tests/liquidsoap/tests/language/xml_test.liq +132 -0
- package/tests/liquidsoap/tests/media/dune +74 -0
- package/tests/liquidsoap/tests/media/dune.inc +63 -0
- package/tests/liquidsoap/tests/media/ffmpeg_add_text.liq +42 -56
- package/tests/liquidsoap/tests/media/ffmpeg_copy_concat.liq +5 -2
- package/tests/liquidsoap/tests/media/ffmpeg_distributed_hls.liq +2 -4
- package/tests/liquidsoap/tests/media/ffmpeg_filter_changing_rate.liq +1 -1
- package/tests/liquidsoap/tests/media/ffmpeg_inline_encode_decode_audio.liq +1 -5
- package/tests/liquidsoap/tests/media/ffmpeg_inline_encode_decode_video.liq +1 -3
- package/tests/liquidsoap/tests/media/ffmpeg_raw_and_encode_decoder.liq +1 -3
- package/tests/liquidsoap/tests/media/ffmpeg_raw_hls.liq +2 -4
- package/tests/liquidsoap/tests/media/ffmpeg_raw_implicit_conversion.liq +63 -0
- package/tests/liquidsoap/tests/media/gen_dune.ml +1 -0
- package/tests/liquidsoap/tests/media/image_decoder_duration.liq +15 -0
- package/tests/liquidsoap/tests/media/lufs_integrated.liq +17 -0
- package/tests/liquidsoap/tests/regression/AC5109.liq +2 -2
- package/tests/liquidsoap/tests/regression/GH1129.liq +3 -3
- package/tests/liquidsoap/tests/regression/GH1279.liq +2 -2
- package/tests/liquidsoap/tests/regression/GH1327.liq +3 -3
- package/tests/liquidsoap/tests/regression/GH2585.liq +0 -2
- package/tests/liquidsoap/tests/regression/GH2756-2.liq +3 -3
- package/tests/liquidsoap/tests/regression/GH2756.liq +2 -2
- package/tests/liquidsoap/tests/regression/GH3134.liq +2 -2
- package/tests/liquidsoap/tests/regression/GH3303.liq +2 -2
- package/tests/liquidsoap/tests/regression/GH4163.liq +14 -3
- package/tests/liquidsoap/tests/regression/GH4281-2.liq +29 -0
- package/tests/liquidsoap/tests/regression/GH4281.liq +29 -0
- package/tests/liquidsoap/tests/regression/GH4395.liq +27 -0
- package/tests/liquidsoap/tests/regression/LS354-1.liq +1 -1
- package/tests/liquidsoap/tests/regression/LS354-2.liq +1 -1
- package/tests/liquidsoap/tests/regression/append-merge.liq +3 -1
- package/tests/liquidsoap/tests/regression/dune.inc +64 -0
- package/tests/liquidsoap/tests/regression/fallible_ogg.liq +9 -0
- package/tests/liquidsoap/tests/regression/init-error.liq +2 -0
- package/tests/liquidsoap/tests/regression/seek_track_map.liq +1 -1
- package/tests/liquidsoap/tests/regression/source_dynamic.liq +2 -2
- package/tests/liquidsoap/tests/run_test.ml +53 -60
- package/tests/liquidsoap/tests/streams/cross-override-end.liq +9 -2
- package/tests/liquidsoap/tests/streams/cross-override-start.liq +9 -2
- package/tests/liquidsoap/tests/streams/cross-override.liq +9 -2
- package/tests/liquidsoap/tests/streams/cross-persist-end-override.liq +9 -2
- package/tests/liquidsoap/tests/streams/cross-persist-override.liq +9 -2
- package/tests/liquidsoap/tests/streams/cross-persist-start-override.liq +9 -2
- package/tests/liquidsoap/tests/streams/cross.liq +8 -2
- package/tests/liquidsoap/tests/streams/crossfade-plot.liq +11 -8
- package/tests/liquidsoap/tests/streams/crossfade-plot.new.txt +148 -248
- package/tests/liquidsoap/tests/streams/crossfade-plot.old.txt +50 -150
- package/tests/liquidsoap/tests/streams/crossfade.liq +8 -2
- package/tests/liquidsoap/tests/streams/ctype2.liq +1 -1
- package/tests/liquidsoap/tests/streams/dune.inc +31 -0
- package/tests/liquidsoap/tests/streams/fades-overrides.liq +9 -2
- package/tests/liquidsoap/tests/streams/fades-persistent-override.liq +9 -2
- package/tests/liquidsoap/tests/streams/harbor_metadata_3.liq +1 -1
- package/tests/liquidsoap/tests/streams/hls_id3v2.liq +11 -7
- package/tests/liquidsoap/tests/streams/icecast_last_meta.liq +47 -0
- package/tests/liquidsoap/tests/streams/icecast_ssl.liq +3 -0
- package/tests/liquidsoap/tests/streams/icecast_ssl_tls.liq +3 -3
- package/tests/liquidsoap/tests/streams/icecast_tls.liq +1 -0
- package/tests/liquidsoap/tests/streams/icecast_tls_ssl.liq +5 -0
- package/tests/liquidsoap/tests/streams/no-cue-cut.liq +2 -2
- package/tests/liquidsoap/tests/streams/random.liq +2 -2
- package/tests/liquidsoap/tests/streams/replaygain.liq +10 -10
- package/tests/liquidsoap/tests/streams/rotate.liq +6 -1
- package/tests/liquidsoap/tests/streams/say.liq +2 -2
- package/tests/liquidsoap/tests/streams/srt_listen_callback.liq +1 -0
- package/tests/liquidsoap/tests/streams/srt_multiple_outputs.liq +1 -0
- package/tests/liquidsoap/tests/streams/srt_passphrase.liq +1 -0
- package/tests/liquidsoap/tests/streams/srt_raw_pcm.liq +1 -0
- package/tests/liquidsoap/tests/test.liq +4 -5
- package/tests/liquidsoap/.github/docker/Dockerfile.production +0 -37
- package/tests/liquidsoap/.github/docker/Dockerfile.production-alpine +0 -18
- package/tests/liquidsoap/.github/opam/packages/metadata/metadata.0.3.0/opam +0 -33
- package/tests/liquidsoap/.github/scripts/build-docker-alpine.sh +0 -31
- package/tests/liquidsoap/.github/scripts/build-docker.sh +0 -35
- package/tests/liquidsoap/liquidsoap-libs-extra.opam +0 -32
- package/tests/liquidsoap/liquidsoap-libs.opam +0 -31
- package/tests/liquidsoap/liquidsoap.opam +0 -63
- package/tests/liquidsoap/src/core/builtins/builtins_lastfm.ml +0 -110
- package/tests/liquidsoap/src/core/tools/liqfm.ml +0 -244
- package/tests/liquidsoap/src/libs/extra/lastfm.liq +0 -185
- /package/tests/liquidsoap/.github/docker/{Dockerfile.website → website.dockerfile} +0 -0
- /package/tests/liquidsoap/.github/opam/packages/ffmpeg-av-windows/{ffmpeg-av-windows.1.2.0 → ffmpeg-av-windows.1.2.5}/opam +0 -0
- /package/tests/liquidsoap/.github/opam/packages/ffmpeg-avcodec-windows/{ffmpeg-avcodec-windows.1.2.0 → ffmpeg-avcodec-windows.1.2.5}/opam +0 -0
- /package/tests/liquidsoap/.github/opam/packages/ffmpeg-avdevice-windows/{ffmpeg-avdevice-windows.1.2.0 → ffmpeg-avdevice-windows.1.2.5}/opam +0 -0
- /package/tests/liquidsoap/.github/opam/packages/ffmpeg-avfilter-windows/{ffmpeg-avfilter-windows.1.2.0 → ffmpeg-avfilter-windows.1.2.5}/opam +0 -0
- /package/tests/liquidsoap/.github/opam/packages/ffmpeg-avutil-windows/{ffmpeg-avutil-windows.1.2.0 → ffmpeg-avutil-windows.1.2.5}/opam +0 -0
- /package/tests/liquidsoap/.github/opam/packages/ffmpeg-swresample-windows/{ffmpeg-swresample-windows.1.2.0 → ffmpeg-swresample-windows.1.2.5}/opam +0 -0
- /package/tests/liquidsoap/.github/opam/packages/ffmpeg-swscale-windows/{ffmpeg-swscale-windows.1.2.0 → ffmpeg-swscale-windows.1.2.5}/opam +0 -0
- /package/tests/liquidsoap/.github/opam/packages/ffmpeg-windows/{ffmpeg-windows.1.2.0 → ffmpeg-windows.1.2.5}/opam +0 -0
- /package/tests/liquidsoap/{liquidsoap-mode.opam.template → opam/liquidsoap-mode.opam.template} +0 -0
- /package/tests/liquidsoap/{liquidsoap.opam.template → opam/liquidsoap.opam.template} +0 -0
|
@@ -23,22 +23,24 @@
|
|
|
23
23
|
open Mm
|
|
24
24
|
|
|
25
25
|
(** In [`CPU] mode, synchronization is governed by the CPU clock.
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
26
|
+
|
|
27
|
+
In [`None] mode, there is no synchronization control. Latency in is governed
|
|
28
|
+
by the time it takes for the sources to produce and output data.
|
|
29
|
+
|
|
30
|
+
In [`Auto] mode, synchronization is governed by the CPU unless at least one
|
|
31
|
+
active source is declared [self_sync] in which case latency is delegated to
|
|
32
|
+
this source. A typical example being a source linked to a sound card, in
|
|
33
|
+
which case the source latency is governed by the sound card's clock.
|
|
34
|
+
|
|
35
|
+
Another case is synchronous network protocol such as [input.srt]. *)
|
|
35
36
|
type sync = [ `Auto | `CPU | `None ]
|
|
36
37
|
|
|
37
38
|
(** A source can be: passive, active or output. Active sources and outputs are
|
|
38
39
|
animated on each clock cycle. Output are kept around until they are manually
|
|
39
|
-
shutdown. Active and passive sources can be garbage collected if they are
|
|
40
|
-
any output. The [output] method is called on each clock
|
|
41
|
-
The [reset] method is called when there
|
|
40
|
+
shutdown. Active and passive sources can be garbage collected if they are
|
|
41
|
+
not connected to any output. The [output] method is called on each clock
|
|
42
|
+
cycle on active sources and outputs. The [reset] method is called when there
|
|
43
|
+
is too much latency. *)
|
|
42
44
|
type active = < reset : unit ; output : unit >
|
|
43
45
|
|
|
44
46
|
type source_type = [ `Passive | `Active of active | `Output of active ]
|
|
@@ -74,192 +76,187 @@ type watcher = {
|
|
|
74
76
|
|
|
75
77
|
(** The [source] use is to send data frames through the [get] method. *)
|
|
76
78
|
class virtual source :
|
|
77
|
-
?stack:Pos.t list
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
->
|
|
81
|
-
|
|
82
|
-
|
|
79
|
+
?stack:Pos.t list ->
|
|
80
|
+
?clock:Clock.t ->
|
|
81
|
+
name:string ->
|
|
82
|
+
unit ->
|
|
83
|
+
object
|
|
84
|
+
method private mutexify : 'a 'b. ('a -> 'b) -> 'a -> 'b
|
|
83
85
|
|
|
84
|
-
|
|
86
|
+
(** {1 Naming} *)
|
|
85
87
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
+
(** Identifier of the source. *)
|
|
89
|
+
method id : string
|
|
88
90
|
|
|
89
|
-
|
|
90
|
-
method set_id : ?definitive:bool -> string -> unit
|
|
91
|
+
method set_id : ?force:bool -> string -> unit
|
|
91
92
|
|
|
92
|
-
|
|
93
|
-
|
|
93
|
+
(** Position in script *)
|
|
94
|
+
method pos : Pos.Option.t
|
|
94
95
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
96
|
+
method stack : Pos.t list
|
|
97
|
+
method set_stack : Pos.t list -> unit
|
|
98
|
+
method stack_unifier : Pos.t list Unifier.t
|
|
98
99
|
|
|
99
|
-
|
|
100
|
+
(** {1 Source characteristics} *)
|
|
100
101
|
|
|
101
|
-
|
|
102
|
-
|
|
102
|
+
(** If [false], [is_ready] should always return [true]. *)
|
|
103
|
+
method virtual fallible : bool
|
|
103
104
|
|
|
104
|
-
|
|
105
|
-
|
|
105
|
+
(** The source type. Defaults to [`Passive] *)
|
|
106
|
+
method source_type : source_type
|
|
106
107
|
|
|
107
|
-
|
|
108
|
-
|
|
108
|
+
(** [true] if the source needs to be animated on each clock tick. *)
|
|
109
|
+
method active : bool
|
|
109
110
|
|
|
110
|
-
|
|
111
|
+
(** {1 Init/shutdown} *)
|
|
111
112
|
|
|
112
|
-
|
|
113
|
-
|
|
113
|
+
(** Register a callback, to be executed when source shuts down. *)
|
|
114
|
+
method on_sleep : (unit -> unit) -> unit
|
|
114
115
|
|
|
115
|
-
|
|
116
|
-
|
|
116
|
+
(** The clock under which the source will run. *)
|
|
117
|
+
method clock : Clock.t
|
|
117
118
|
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
implemented by the various operators. *)
|
|
129
|
-
method virtual self_sync : Clock.self_sync
|
|
119
|
+
(** Does the source provide its own synchronization? Examples: Alsa, AO, SRT
|
|
120
|
+
I/O, etc.. This information is used at the clock level to decide whether
|
|
121
|
+
or not we should synchronize with the CPU clock after producing a frame
|
|
122
|
+
(for [`Auto] clocks). Please note that in the case of multiple sources
|
|
123
|
+
filling the frame with different notion notion of synchronization, there
|
|
124
|
+
is no consistent notion of time or synchronization. In this case (and with
|
|
125
|
+
a [`Auto] clock), we simply decide based on whether there is one
|
|
126
|
+
[self_sync] source or not. This logic should dictate how the method is
|
|
127
|
+
implemented by the various operators. *)
|
|
128
|
+
method virtual self_sync : Clock.self_sync
|
|
130
129
|
|
|
131
|
-
|
|
130
|
+
method source_sync : bool -> Clock.sync_source option
|
|
132
131
|
|
|
133
|
-
|
|
134
|
-
|
|
132
|
+
(** Register a callback when wake_up is called. *)
|
|
133
|
+
method on_wake_up : (unit -> unit) -> unit
|
|
135
134
|
|
|
136
|
-
|
|
137
|
-
|
|
135
|
+
(** Called when the source must be ready. Can be called multiple times *)
|
|
136
|
+
method wake_up : unit
|
|
138
137
|
|
|
139
|
-
|
|
140
|
-
|
|
138
|
+
(** Register a callback when sleep is called. *)
|
|
139
|
+
method on_sleep : (unit -> unit) -> unit
|
|
141
140
|
|
|
142
|
-
|
|
143
|
-
|
|
141
|
+
(** Called when the source can release all its resources. Can be called
|
|
142
|
+
concurrently and multiple times. *)
|
|
143
|
+
method sleep : unit
|
|
144
144
|
|
|
145
|
-
|
|
146
|
-
|
|
145
|
+
(** Force the source to sleep. Should be called by the clocks only. *)
|
|
146
|
+
method force_sleep : unit
|
|
147
147
|
|
|
148
|
-
|
|
149
|
-
|
|
148
|
+
(** Check if a source is up or not. *)
|
|
149
|
+
method is_up : bool
|
|
150
150
|
|
|
151
|
-
|
|
151
|
+
(** {1 Streaming} *)
|
|
152
152
|
|
|
153
|
-
|
|
153
|
+
method frame_type : Type.t
|
|
154
154
|
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
155
|
+
(** This is called when content-type can be computed, i.e. either after frame
|
|
156
|
+
type has been passed from the typing system during `check_eval` or at
|
|
157
|
+
`wake_up` *)
|
|
158
|
+
method content_type_computation_allowed : unit
|
|
159
159
|
|
|
160
|
-
|
|
160
|
+
method has_content_type : bool
|
|
161
161
|
|
|
162
|
-
|
|
163
|
-
|
|
162
|
+
(** What type of content does this source produce. *)
|
|
163
|
+
method content_type : Frame.content_type
|
|
164
164
|
|
|
165
|
-
|
|
166
|
-
|
|
165
|
+
(** This method fails when content is not PCM. *)
|
|
166
|
+
method private audio_channels : int
|
|
167
167
|
|
|
168
|
-
|
|
168
|
+
method private samplerate : float
|
|
169
|
+
method private video_dimensions : int * int
|
|
169
170
|
|
|
170
|
-
|
|
171
|
-
|
|
171
|
+
(** A buffer that can be used by the source. *)
|
|
172
|
+
method buffer : Generator.t
|
|
172
173
|
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
Content.Video.data
|
|
174
|
+
method private generate_video :
|
|
175
|
+
?create:(pos:int -> width:int -> height:int -> unit -> Video.Canvas.image) ->
|
|
176
|
+
field:Frame.Fields.field ->
|
|
177
|
+
int ->
|
|
178
|
+
Content.Video.data
|
|
179
179
|
|
|
180
|
-
|
|
180
|
+
method last_image : Frame.Fields.field -> Video.Canvas.image
|
|
181
181
|
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
182
|
+
method private nearest_image :
|
|
183
|
+
pos:int ->
|
|
184
|
+
last_image:Video.Canvas.image ->
|
|
185
|
+
Content.Video.data ->
|
|
186
|
+
Video.Canvas.image
|
|
187
187
|
|
|
188
|
-
|
|
189
|
-
|
|
188
|
+
(** An empty frame that can be used by the source. *)
|
|
189
|
+
method empty_frame : Frame.t
|
|
190
190
|
|
|
191
|
-
|
|
192
|
-
|
|
191
|
+
(** An empty frame with a track mark. *)
|
|
192
|
+
method end_of_track : Frame.t
|
|
193
193
|
|
|
194
|
-
|
|
195
|
-
|
|
194
|
+
(** Number of main ticks left in the current track. Defaults to -1=unknown. *)
|
|
195
|
+
method virtual remaining : int
|
|
196
196
|
|
|
197
|
-
|
|
198
|
-
|
|
197
|
+
(* Elapsed time since the last track mark. *)
|
|
198
|
+
method elapsed : int
|
|
199
199
|
|
|
200
|
-
|
|
201
|
-
|
|
200
|
+
(* Estimated total duration of the current track. -1=unknown. *)
|
|
201
|
+
method duration : int
|
|
202
202
|
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
method virtual seek_source : source
|
|
203
|
+
(** Return the source effectively used to seek. Used by the muxer to determine
|
|
204
|
+
if there is a unique seeking source. Should return [self] if there isn't
|
|
205
|
+
such a unique source. *)
|
|
206
|
+
method virtual seek_source : source
|
|
208
207
|
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
method seek : int -> int
|
|
208
|
+
(** [self#seek_ticks x] skips [x] main ticks. returns the number of ticks
|
|
209
|
+
actually skipped. By default it always returns 0, refusing to seek at all.
|
|
210
|
+
That method may be called from any thread, concurrently with [#get_frame],
|
|
211
|
+
so they should not interfere. *)
|
|
212
|
+
method seek : int -> int
|
|
215
213
|
|
|
216
|
-
|
|
217
|
-
|
|
214
|
+
(** The source's last metadata. *)
|
|
215
|
+
method last_metadata : Frame.metadata option
|
|
218
216
|
|
|
219
|
-
|
|
220
|
-
|
|
217
|
+
method reset_last_metadata_on_track : bool
|
|
218
|
+
method set_reset_last_metadata_on_track : bool -> unit
|
|
221
219
|
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
220
|
+
(** Register a server command. The command is registered when the source wakes
|
|
221
|
+
up under its own id as namespace and deregistered when it goes down. *)
|
|
222
|
+
method register_command :
|
|
223
|
+
?usage:string -> descr:string -> string -> (string -> string) -> unit
|
|
226
224
|
|
|
227
|
-
|
|
228
|
-
|
|
225
|
+
(** Register a callback to be called on new metadata *)
|
|
226
|
+
method on_metadata : (Frame.metadata -> unit) -> unit
|
|
229
227
|
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
method on_track : (Frame.metadata -> unit) -> unit
|
|
228
|
+
(** Register a callback to be called on new track. Callback is called with the
|
|
229
|
+
most recent metadata before a given track mark. *)
|
|
230
|
+
method on_track : (Frame.metadata -> unit) -> unit
|
|
234
231
|
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
232
|
+
(** These two are used by [generate_from_multiple_sources] and should not be
|
|
233
|
+
used otherwise. *)
|
|
234
|
+
method private execute_on_track : Frame.t -> unit
|
|
238
235
|
|
|
239
|
-
|
|
236
|
+
method private set_last_metadata : Frame.t -> unit
|
|
240
237
|
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
238
|
+
(** Sources must implement this method. It should return [true] when the
|
|
239
|
+
source can produce data during the current streaming cycle. *)
|
|
240
|
+
method virtual private can_generate_frame : bool
|
|
244
241
|
|
|
245
|
-
|
|
246
|
-
|
|
242
|
+
method on_before_streaming_cycle : (unit -> unit) -> unit
|
|
243
|
+
method on_after_streaming_cycle : (unit -> unit) -> unit
|
|
247
244
|
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
245
|
+
(** Sources must implement this method. It should return the data produced
|
|
246
|
+
during the current streaming cycle. Sources are responsible for producing
|
|
247
|
+
as much data as possible, up-to the frame size setting. *)
|
|
248
|
+
method virtual private generate_frame : Frame.t
|
|
252
249
|
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
250
|
+
(** This method is based on [can_generate_frame] and has the same value
|
|
251
|
+
through the whole streaming cycle. *)
|
|
252
|
+
method is_ready : bool
|
|
256
253
|
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
254
|
+
(** If the source is ready, this method computes the frame generated by the
|
|
255
|
+
source during the current streaming cycle. Returned value is cached and
|
|
256
|
+
should be the same throughout the whole streaming cycle. *)
|
|
257
|
+
method get_frame : Frame.t
|
|
261
258
|
|
|
262
|
-
|
|
259
|
+
(** This method passes the frame returned by [#get_frame] to the given callback.
|
|
263
260
|
The callback should return the portion of the frame (of the form: [start, end))
|
|
264
261
|
that was effectively used. This method is used when a consumer of the source's data
|
|
265
262
|
only uses an initial chunk of the frame. In this case, the remaining data is cached
|
|
@@ -271,107 +268,111 @@ class virtual source :
|
|
|
271
268
|
source#consumed (Frame.position frame);
|
|
272
269
|
frame
|
|
273
270
|
]} *)
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
271
|
+
method get_partial_frame : (Frame.t -> Frame.t) -> Frame.t
|
|
272
|
+
|
|
273
|
+
(** Check a frame without consuming any of its data. *)
|
|
274
|
+
method peek_frame : Frame.t
|
|
275
|
+
|
|
276
|
+
(** Manually mark amount of consumed data from the source. *)
|
|
277
|
+
method consumed : int -> unit
|
|
278
|
+
|
|
279
|
+
(** This method requests a specific field of the frame that can be mutated. It
|
|
280
|
+
is used by a consumer of the source that will modify the source's data
|
|
281
|
+
(e.g. [amplify]). The source will do its best to minimize data copy
|
|
282
|
+
according to the streaming context. Typically, if there is only one
|
|
283
|
+
consumer of the source's data, it should be safe to pass its data without
|
|
284
|
+
copying it. *)
|
|
285
|
+
method get_mutable_content : Frame.field -> Content.data
|
|
286
|
+
|
|
287
|
+
(** This method is the same as [#get_mutable_content] but returns a full frame
|
|
288
|
+
with the requested mutable field included. *)
|
|
289
|
+
method get_mutable_frame : Frame.field -> Frame.t
|
|
290
|
+
|
|
291
|
+
(** By convention, frames produced during the streaming cycle can only have at
|
|
292
|
+
most one track mark. In case of multiple track marks (which most likely
|
|
293
|
+
indicate a programming problem), all subsequent track marks past the first
|
|
294
|
+
one are dropped.
|
|
295
|
+
|
|
296
|
+
This function returns a pair: [(initial_frame, new_track option)] of an
|
|
297
|
+
initial frame and, if a track mark is present in the frame, the optional
|
|
298
|
+
portion of the frame contained after this track mark.
|
|
299
|
+
|
|
300
|
+
This method can be used to implement operations that should be aware of
|
|
301
|
+
new tracks. *)
|
|
302
|
+
method private split_frame : Frame.t -> Frame.t * Frame.t option
|
|
303
|
+
|
|
304
|
+
(** This method is a convenience function to set some data. It returns the
|
|
305
|
+
frame produced by the source during the current streaming cycle with the
|
|
306
|
+
given field data replaced by the data passed to the function with length
|
|
307
|
+
set as the frame's length. *)
|
|
308
|
+
method set_frame_data :
|
|
309
|
+
Frame.field ->
|
|
310
|
+
(?offset:int -> ?length:int -> 'a -> Content.data) ->
|
|
311
|
+
'a ->
|
|
312
|
+
Frame.t
|
|
313
|
+
|
|
314
|
+
(** Various information related to the current frame. *)
|
|
315
|
+
|
|
316
|
+
method frame_position : int
|
|
317
|
+
method frame_audio_position : int
|
|
318
|
+
method frame_has_track_mark : bool
|
|
319
|
+
method frame_track_mark : int option
|
|
320
|
+
method frame_metadata : (int * Frame.Metadata.t) list
|
|
321
|
+
|
|
322
|
+
(** Tells the source to end its current track. *)
|
|
323
|
+
method virtual abort_track : unit
|
|
324
|
+
|
|
325
|
+
(** {1 Utilities} *)
|
|
326
|
+
|
|
327
|
+
method log : Log.t
|
|
328
|
+
method add_watcher : watcher -> unit
|
|
329
|
+
end
|
|
329
330
|
|
|
330
331
|
(* Entry-points sources, which need to actively perform some task. *)
|
|
331
332
|
and virtual active_source :
|
|
332
|
-
?stack:Pos.t list
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
->
|
|
336
|
-
|
|
337
|
-
|
|
333
|
+
?stack:Pos.t list ->
|
|
334
|
+
?clock:Clock.t ->
|
|
335
|
+
name:string ->
|
|
336
|
+
unit ->
|
|
337
|
+
object
|
|
338
|
+
inherit source
|
|
338
339
|
|
|
339
|
-
|
|
340
|
-
|
|
340
|
+
(** Do whatever needed when the latency gets too big and is reset. *)
|
|
341
|
+
method virtual reset : unit
|
|
341
342
|
|
|
342
|
-
|
|
343
|
-
|
|
343
|
+
method virtual output : unit
|
|
344
|
+
end
|
|
344
345
|
|
|
345
346
|
(* This is for defining a source which has children *)
|
|
346
347
|
class virtual operator :
|
|
347
|
-
?stack:Pos.t list
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
348
|
+
?stack:Pos.t list ->
|
|
349
|
+
?clock:Clock.t ->
|
|
350
|
+
name:string ->
|
|
351
|
+
source list ->
|
|
352
|
+
object
|
|
353
|
+
inherit source
|
|
354
|
+
end
|
|
354
355
|
|
|
355
356
|
(* Most usual active source: the active_operator, pulling one source's data
|
|
356
|
-
|
|
357
|
+
and outputting it. *)
|
|
357
358
|
class virtual active_operator :
|
|
358
|
-
?stack:Pos.t list
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
359
|
+
?stack:Pos.t list ->
|
|
360
|
+
?clock:Clock.t ->
|
|
361
|
+
name:string ->
|
|
362
|
+
source list ->
|
|
363
|
+
object
|
|
364
|
+
inherit active_source
|
|
365
|
+
end
|
|
365
366
|
|
|
366
367
|
(** Type governing whether or not the same source should be re-selected.
|
|
367
368
|
- [`Force] means that the operator should at least try to see if a new
|
|
368
369
|
source should be selected.
|
|
369
|
-
- [`Ok] means that the operator should re-select the current source
|
|
370
|
-
|
|
371
|
-
- [`After_position p] means that the operator should re-select the
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
370
|
+
- [`Ok] means that the operator should re-select the current source whenever
|
|
371
|
+
possible.
|
|
372
|
+
- [`After_position p] means that the operator should re-select the current
|
|
373
|
+
source only if it can produce data past the given position The
|
|
374
|
+
[generate_from_multiple_sources] implements a [can_reselect] that can be
|
|
375
|
+
called with the currently selected source to validate this logic. *)
|
|
375
376
|
type reselect = [ `Ok | `Force | `After_position of int ]
|
|
376
377
|
|
|
377
378
|
(* Helper to generate data from a sequence of source.
|
|
@@ -379,17 +380,18 @@ type reselect = [ `Ok | `Force | `After_position of int ]
|
|
|
379
380
|
When frame is partial, a track mark is added unless [merge] is
|
|
380
381
|
set to [true]. *)
|
|
381
382
|
class virtual generate_from_multiple_sources :
|
|
382
|
-
merge:(unit -> bool)
|
|
383
|
-
|
|
384
|
-
->
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
383
|
+
merge:(unit -> bool) ->
|
|
384
|
+
track_sensitive:(unit -> bool) ->
|
|
385
|
+
unit ->
|
|
386
|
+
object
|
|
387
|
+
method virtual get_source : reselect:reselect -> unit -> source option
|
|
388
|
+
method virtual split_frame : Frame.t -> Frame.t * Frame.t option
|
|
389
|
+
method virtual empty_frame : Frame.t
|
|
390
|
+
method virtual private execute_on_track : Frame.t -> unit
|
|
391
|
+
method virtual private set_last_metadata : Frame.t -> unit
|
|
392
|
+
method virtual log : Log.t
|
|
393
|
+
method virtual id : string
|
|
394
|
+
method private can_reselect : reselect:reselect -> source -> bool
|
|
395
|
+
method private can_generate_frame : bool
|
|
396
|
+
method private generate_frame : Frame.t
|
|
397
|
+
end
|
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
*****************************************************************************)
|
|
22
22
|
|
|
23
23
|
(* Reads data from an audio buffer generator.
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
A thread safe generator should be used if it has to be fed concurrently.
|
|
25
|
+
Store [bufferize] seconds before declaring itself as ready. *)
|
|
26
26
|
class virtual source ?(seek = false) ?(replay_meta = false) ~bufferize
|
|
27
27
|
~empty_on_abort () =
|
|
28
28
|
let bufferize = Frame.main_of_seconds bufferize in
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
*****************************************************************************)
|
|
22
22
|
|
|
23
23
|
open Source
|
|
24
|
-
module Queue =
|
|
24
|
+
module Queue = Queues.Queue
|
|
25
25
|
|
|
26
26
|
let conf_prefetch =
|
|
27
27
|
Dtools.Conf.int ~p:(Request.conf#plug "prefetch") ~d:1 "Default prefetch"
|
|
@@ -258,7 +258,7 @@ class dynamic ?(name = "request.dynamic") ~retry_delay ~available ~prefetch
|
|
|
258
258
|
| _ -> assert false)
|
|
259
259
|
|
|
260
260
|
(** This method should be called whenever the feeding task has a new
|
|
261
|
-
|
|
261
|
+
opportunity to feed the queue, in case it is sleeping. *)
|
|
262
262
|
method private notify_new_request =
|
|
263
263
|
match Atomic.get state with
|
|
264
264
|
| `Started (d, { notify }) when d <= Unix.gettimeofday () -> notify ()
|
|
@@ -24,10 +24,10 @@
|
|
|
24
24
|
support seek by doing nothing. However, for other, seek should be
|
|
25
25
|
disabled. Thus, if [seek] is [true], the seek function is [fun x -> x]
|
|
26
26
|
otherwise it is [fun _ -> 0] *)
|
|
27
|
-
class virtual source
|
|
27
|
+
class virtual source ~name ~seek duration =
|
|
28
28
|
let track_size = Option.map Frame.main_of_seconds duration in
|
|
29
29
|
object (self)
|
|
30
|
-
inherit Source.source
|
|
30
|
+
inherit Source.source ~name ()
|
|
31
31
|
method fallible = track_size <> None
|
|
32
32
|
val mutable remaining = track_size
|
|
33
33
|
method private can_generate_frame = remaining <> Some 0
|