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.
- package/dist/cli.js +6 -6
- package/dist/index.js +5 -5
- package/package.json +1 -1
- package/src/liquidsoap.grammar +2 -0
- package/src/parser.js +4 -4
- 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
|
@@ -79,20 +79,20 @@ let type_of_format f =
|
|
|
79
79
|
Type.make
|
|
80
80
|
(Format_type.descr
|
|
81
81
|
(`Format
|
|
82
|
-
|
|
83
|
-
|
|
82
|
+
Content.(
|
|
83
|
+
default_format (kind_of_string "ffmpeg.copy"))))
|
|
84
84
|
| `Encode { Ffmpeg_format.mode = `Raw; options = `Audio _ } ->
|
|
85
85
|
Type.make
|
|
86
86
|
(Format_type.descr
|
|
87
87
|
(`Format
|
|
88
|
-
|
|
89
|
-
|
|
88
|
+
Content.(
|
|
89
|
+
default_format (kind_of_string "ffmpeg.audio.raw"))))
|
|
90
90
|
| `Encode { Ffmpeg_format.mode = `Raw; options = `Video _ } ->
|
|
91
91
|
Type.make
|
|
92
92
|
(Format_type.descr
|
|
93
93
|
(`Format
|
|
94
|
-
|
|
95
|
-
|
|
94
|
+
Content.(
|
|
95
|
+
default_format (kind_of_string "ffmpeg.video.raw"))))
|
|
96
96
|
| `Encode
|
|
97
97
|
Ffmpeg_format.
|
|
98
98
|
{
|
|
@@ -270,24 +270,19 @@ let with_url_output encoder file =
|
|
|
270
270
|
| Ffmpeg opts -> Ffmpeg { opts with Ffmpeg_format.output = `Url file }
|
|
271
271
|
| _ -> failwith "No file output!"
|
|
272
272
|
|
|
273
|
-
(** An encoder, once initialized, is something that consumes
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
its stream. This is ok, though, because the ogg container/streams
|
|
283
|
-
is meant to be sequentialized but not the mp3 format.
|
|
284
|
-
header contains data that should be sent first to streaming
|
|
285
|
-
client. *)
|
|
273
|
+
(** An encoder, once initialized, is something that consumes frames, insert
|
|
274
|
+
metadata and that you eventually close (triggers flushing). Insert metadata
|
|
275
|
+
is really meant for inline metadata, i.e. in most cases, stream sources.
|
|
276
|
+
Otherwise, metadata are passed when creating the encoder. For instance, the
|
|
277
|
+
mp3 encoder may accept metadata initially and write them as id3 tags but
|
|
278
|
+
does not support inline metadata. Also, the ogg encoder supports inline
|
|
279
|
+
metadata but restarts its stream. This is ok, though, because the ogg
|
|
280
|
+
container/streams is meant to be sequentialized but not the mp3 format.
|
|
281
|
+
header contains data that should be sent first to streaming client. *)
|
|
286
282
|
|
|
287
283
|
type split_result =
|
|
288
284
|
[ (* Returns (flushed, first_bytes_for_next_segment) *)
|
|
289
|
-
`Ok of
|
|
290
|
-
Strings.t * Strings.t
|
|
285
|
+
`Ok of Strings.t * Strings.t
|
|
291
286
|
| `Nope of Strings.t ]
|
|
292
287
|
|
|
293
288
|
(* Raised by [init_encode] if more data is needed. *)
|
|
@@ -332,8 +327,8 @@ type encoder = {
|
|
|
332
327
|
type factory =
|
|
333
328
|
?hls:bool -> pos:Pos.t option -> string -> Frame.Metadata.Export.t -> encoder
|
|
334
329
|
|
|
335
|
-
(** A plugin might or might not accept a given format.
|
|
336
|
-
|
|
330
|
+
(** A plugin might or might not accept a given format. If it accepts it, it
|
|
331
|
+
gives a function creating suitable encoders. *)
|
|
337
332
|
type plugin = format -> factory option
|
|
338
333
|
|
|
339
334
|
let plug : plugin Plug.t =
|
|
@@ -66,24 +66,19 @@ val url_output : format -> bool
|
|
|
66
66
|
|
|
67
67
|
val with_url_output : format -> string -> format
|
|
68
68
|
|
|
69
|
-
(** An encoder, once initialized, is something that consumes
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
* its stream. This is ok, though, because the ogg container/streams
|
|
79
|
-
* is meant to be sequentialized but not the mp3 format.
|
|
80
|
-
* header contains data that should be sent first to streaming
|
|
81
|
-
* client. *)
|
|
69
|
+
(** An encoder, once initialized, is something that consumes frames, insert
|
|
70
|
+
metadata and that you eventually close (triggers flushing). Insert metadata
|
|
71
|
+
is really meant for inline metadata, i.e. in most cases, stream sources.
|
|
72
|
+
Otherwise, metadata are passed when creating the encoder. For instance, the
|
|
73
|
+
mp3 encoder may accept metadata initially and write them as id3 tags but
|
|
74
|
+
does not support inline metadata. Also, the ogg encoder supports inline
|
|
75
|
+
metadata but restarts its stream. This is ok, though, because the ogg
|
|
76
|
+
container/streams is meant to be sequentialized but not the mp3 format.
|
|
77
|
+
header contains data that should be sent first to streaming client. *)
|
|
82
78
|
|
|
83
79
|
type split_result =
|
|
84
80
|
[ (* Returns (flushed, first_bytes_for_next_segment) *)
|
|
85
|
-
`Ok of
|
|
86
|
-
Strings.t * Strings.t
|
|
81
|
+
`Ok of Strings.t * Strings.t
|
|
87
82
|
| `Nope of Strings.t ]
|
|
88
83
|
|
|
89
84
|
(* Raised by [init_encode] if more data is needed. *)
|
|
@@ -119,8 +114,8 @@ type encoder = {
|
|
|
119
114
|
type factory =
|
|
120
115
|
?hls:bool -> pos:Pos.t option -> string -> Frame.Metadata.Export.t -> encoder
|
|
121
116
|
|
|
122
|
-
(** A plugin might or might not accept a given format.
|
|
123
|
-
|
|
117
|
+
(** A plugin might or might not accept a given format. If it accepts it, it
|
|
118
|
+
gives a function creating suitable encoders. *)
|
|
124
119
|
type plugin = format -> factory option
|
|
125
120
|
|
|
126
121
|
val plug : plugin Plug.t
|
|
@@ -24,6 +24,9 @@
|
|
|
24
24
|
|
|
25
25
|
open Ffmpeg_encoder_common
|
|
26
26
|
|
|
27
|
+
let replace_default opts name default =
|
|
28
|
+
Hashtbl.replace opts name (Option.value ~default (Hashtbl.find_opt opts name))
|
|
29
|
+
|
|
27
30
|
let () =
|
|
28
31
|
Plug.register Encoder.plug "ffmpeg" ~doc:"" (function
|
|
29
32
|
| Encoder.Ffmpeg ffmpeg ->
|
|
@@ -32,28 +35,14 @@ let () =
|
|
|
32
35
|
(* Inject hls params. *)
|
|
33
36
|
let ffmpeg =
|
|
34
37
|
if hls then (
|
|
35
|
-
let opts =
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
"+dash+skip_sidx+skip_trailer+frag_custom")
|
|
44
|
-
(Hashtbl.find_opt ffmpeg.Ffmpeg_format.opts
|
|
45
|
-
"movflags")
|
|
46
|
-
in
|
|
47
|
-
Hashtbl.replace opts "movflags" movflags;
|
|
48
|
-
let frag_duration =
|
|
49
|
-
Option.value ~default:(`Int 10)
|
|
50
|
-
(Hashtbl.find_opt ffmpeg.Ffmpeg_format.opts
|
|
51
|
-
"frag_duration")
|
|
52
|
-
in
|
|
53
|
-
Hashtbl.replace opts "frag_duration" frag_duration;
|
|
54
|
-
opts
|
|
55
|
-
| _ -> ffmpeg.Ffmpeg_format.opts
|
|
56
|
-
in
|
|
38
|
+
let opts = Hashtbl.copy ffmpeg.Ffmpeg_format.opts in
|
|
39
|
+
replace_default opts "flush_packets" (`Int 1);
|
|
40
|
+
(match ffmpeg.Ffmpeg_format.format with
|
|
41
|
+
| Some "mp4" ->
|
|
42
|
+
replace_default opts "movflags"
|
|
43
|
+
(`String "+dash+skip_sidx+skip_trailer+frag_custom");
|
|
44
|
+
replace_default opts "frag_duration" (`Int 10)
|
|
45
|
+
| _ -> ());
|
|
57
46
|
let streams =
|
|
58
47
|
List.map
|
|
59
48
|
(function
|
|
@@ -62,11 +51,8 @@ let () =
|
|
|
62
51
|
({ Ffmpeg_format.opts } as stream :
|
|
63
52
|
Ffmpeg_format.encoded_stream) ) ->
|
|
64
53
|
let opts = Hashtbl.copy opts in
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
(Hashtbl.find_opt opts "flags")
|
|
68
|
-
in
|
|
69
|
-
Hashtbl.replace opts "flags" flags;
|
|
54
|
+
replace_default opts "flags"
|
|
55
|
+
(`String "+global_header");
|
|
70
56
|
(lbl, `Encode { stream with Ffmpeg_format.opts })
|
|
71
57
|
| s -> s)
|
|
72
58
|
ffmpeg.Ffmpeg_format.streams
|
|
@@ -131,7 +131,7 @@ let encoder ~pos ~on_keyframe ~keyframes ~mk_streams ffmpeg meta =
|
|
|
131
131
|
let format = mk_format ffmpeg in
|
|
132
132
|
let interleaved =
|
|
133
133
|
match ffmpeg.interleaved with
|
|
134
|
-
| `Default ->
|
|
134
|
+
| `Default -> 1 < List.length ffmpeg.streams
|
|
135
135
|
| `True -> true
|
|
136
136
|
| `False -> false
|
|
137
137
|
in
|
|
@@ -44,8 +44,7 @@ let encoder flac meta =
|
|
|
44
44
|
in
|
|
45
45
|
let buf = Strings.Mutable.empty () in
|
|
46
46
|
let write chunk = Strings.Mutable.add_bytes buf chunk in
|
|
47
|
-
let
|
|
48
|
-
let enc = Flac.Encoder.create ~comments p cb in
|
|
47
|
+
let enc = Flac.Encoder.create ~comments ~write p in
|
|
49
48
|
let enc = ref enc in
|
|
50
49
|
let encode frame =
|
|
51
50
|
let b = AFrame.pcm frame in
|
|
@@ -55,11 +54,11 @@ let encoder flac meta =
|
|
|
55
54
|
(dst_freq /. src_freq) b 0 len
|
|
56
55
|
in
|
|
57
56
|
let b = Audio.sub b start len in
|
|
58
|
-
Flac.Encoder.process !enc
|
|
57
|
+
Flac.Encoder.process !enc b;
|
|
59
58
|
Strings.Mutable.flush buf
|
|
60
59
|
in
|
|
61
60
|
let stop () =
|
|
62
|
-
Flac.Encoder.finish !enc
|
|
61
|
+
Flac.Encoder.finish !enc;
|
|
63
62
|
Strings.Mutable.flush buf
|
|
64
63
|
in
|
|
65
64
|
{
|
|
@@ -20,7 +20,8 @@
|
|
|
20
20
|
|
|
21
21
|
*****************************************************************************)
|
|
22
22
|
|
|
23
|
-
(** NDI encoder. This encoder does nothing and can only by used with
|
|
23
|
+
(** NDI encoder. This encoder does nothing and can only by used with
|
|
24
|
+
`output.ndi` *)
|
|
24
25
|
|
|
25
26
|
let encoder ~pos _ =
|
|
26
27
|
let error () =
|
|
@@ -132,8 +132,7 @@ let encoder ~pos { Ogg_format.audio; video } =
|
|
|
132
132
|
and ogg_stop () =
|
|
133
133
|
let f track = track.id <- None in
|
|
134
134
|
List.iter f tracks;
|
|
135
|
-
|
|
136
|
-
Ogg_muxer.end_of_stream ogg_enc
|
|
135
|
+
Ogg_muxer.end_of_stream ogg_enc
|
|
137
136
|
and stop () =
|
|
138
137
|
ogg_stop ();
|
|
139
138
|
Ogg_muxer.get_data ogg_enc
|
|
@@ -40,9 +40,9 @@ let type_of_encoder p =
|
|
|
40
40
|
let make params =
|
|
41
41
|
let defaults =
|
|
42
42
|
{
|
|
43
|
-
External_encoder_format.channels
|
|
44
43
|
(* We use a hardcoded value in order not to force the evaluation of the
|
|
45
|
-
|
|
44
|
+
number of channels too early, see #933. *)
|
|
45
|
+
External_encoder_format.channels = 2;
|
|
46
46
|
samplerate = Frame.audio_rate;
|
|
47
47
|
video = None;
|
|
48
48
|
header = true;
|
|
@@ -62,7 +62,7 @@ let make params =
|
|
|
62
62
|
bitrate = 64;
|
|
63
63
|
bitrate_mode = `Constant;
|
|
64
64
|
(* We use a hardcoded value in order not to force the evaluation of the
|
|
65
|
-
|
|
65
|
+
number of channels too early, see #933. *)
|
|
66
66
|
channels = 2;
|
|
67
67
|
samplerate = check_samplerate ~pos:None Frame.audio_rate;
|
|
68
68
|
sbr_mode = false;
|
|
@@ -66,11 +66,18 @@ let channels args =
|
|
|
66
66
|
name (Term.to_string tm))
|
|
67
67
|
with Not_found -> 2)
|
|
68
68
|
|
|
69
|
+
let parse_int str =
|
|
70
|
+
try
|
|
71
|
+
let f = Avutil.expr_parse_and_eval str in
|
|
72
|
+
if not (Float.is_integer f) then raise Not_found;
|
|
73
|
+
int_of_float f
|
|
74
|
+
with _ -> int_of_string str
|
|
75
|
+
|
|
69
76
|
let to_int t =
|
|
70
77
|
match t with
|
|
71
78
|
| Value.Int { value = i } -> i
|
|
72
|
-
| Value.String { value = s } ->
|
|
73
|
-
| Value.Float { value = f } -> int_of_float f
|
|
79
|
+
| Value.String { value = s } -> parse_int s
|
|
80
|
+
| Value.Float { value = f } when Float.is_integer f -> int_of_float f
|
|
74
81
|
| _ -> Lang_encoder.raise_error ~pos:(Value.pos t) "integer expected"
|
|
75
82
|
|
|
76
83
|
let to_string t =
|
|
@@ -83,7 +90,7 @@ let to_string t =
|
|
|
83
90
|
let to_float t =
|
|
84
91
|
match t with
|
|
85
92
|
| Value.Int { value = i } -> float i
|
|
86
|
-
| Value.String { value = s } ->
|
|
93
|
+
| Value.String { value = s } -> Avutil.expr_parse_and_eval s
|
|
87
94
|
| Value.Float { value = f } -> f
|
|
88
95
|
| _ -> Lang_encoder.raise_error ~pos:(Value.pos t) "float expected"
|
|
89
96
|
|
|
@@ -212,50 +219,50 @@ let type_of_encoder =
|
|
|
212
219
|
Type.make
|
|
213
220
|
(Format_type.descr
|
|
214
221
|
(`Format
|
|
215
|
-
|
|
222
|
+
(Content.default_format Ffmpeg_copy_content.kind)))
|
|
216
223
|
| `Raw ->
|
|
217
224
|
Type.make
|
|
218
225
|
(Format_type.descr
|
|
219
226
|
(`Format
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
227
|
+
(match
|
|
228
|
+
stream_media_type ~to_pos:term_pos
|
|
229
|
+
~to_static_string:to_static_string_term name
|
|
230
|
+
args
|
|
231
|
+
with
|
|
232
|
+
| `Audio ->
|
|
233
|
+
Content.default_format
|
|
234
|
+
Ffmpeg_raw_content.Audio.kind
|
|
235
|
+
| `Video ->
|
|
236
|
+
Content.default_format
|
|
237
|
+
Ffmpeg_raw_content.Video.kind)))
|
|
231
238
|
| `Internal ->
|
|
232
239
|
Type.make
|
|
233
240
|
(Format_type.descr
|
|
234
241
|
(`Format
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
242
|
+
(match
|
|
243
|
+
stream_media_type ~to_pos:term_pos
|
|
244
|
+
~to_static_string:to_static_string_term name
|
|
245
|
+
args
|
|
246
|
+
with
|
|
247
|
+
| `Audio ->
|
|
248
|
+
let channels = channels args in
|
|
249
|
+
let pcm_kind =
|
|
250
|
+
List.fold_left
|
|
251
|
+
(fun pcm_kind -> function
|
|
252
|
+
| "", { Term.term = `String "pcm" } ->
|
|
253
|
+
Content.Audio.kind
|
|
254
|
+
| "", { Term.term = `String "pcm_s16" }
|
|
255
|
+
->
|
|
256
|
+
Content_pcm_s16.kind
|
|
257
|
+
| "", { Term.term = `String "pcm_f32" }
|
|
258
|
+
->
|
|
259
|
+
Content_pcm_f32.kind
|
|
260
|
+
| _ -> pcm_kind)
|
|
261
|
+
Content.Audio.kind args
|
|
262
|
+
in
|
|
263
|
+
Frame_base.format_of_channels ~pcm_kind
|
|
264
|
+
channels
|
|
265
|
+
| `Video -> Content.(default_format Video.kind))))
|
|
259
266
|
in
|
|
260
267
|
let field = Frame.Fields.register field in
|
|
261
268
|
Frame.Fields.add field format content_type
|
|
@@ -33,7 +33,7 @@ let flac_gen params =
|
|
|
33
33
|
{
|
|
34
34
|
Flac_format.fill = None;
|
|
35
35
|
(* We use a hardcoded value in order not to force the evaluation of the
|
|
36
|
-
|
|
36
|
+
number of channels too early, see #933. *)
|
|
37
37
|
channels = 2;
|
|
38
38
|
samplerate = Frame.audio_rate;
|
|
39
39
|
bits_per_sample = 16;
|
|
@@ -29,9 +29,9 @@ let type_of_encoder p =
|
|
|
29
29
|
let make params =
|
|
30
30
|
let defaults =
|
|
31
31
|
{
|
|
32
|
-
Shine_format.channels
|
|
33
32
|
(* We use a hardcoded value in order not to force the evaluation of the
|
|
34
|
-
|
|
33
|
+
number of channels too early, see #933. *)
|
|
34
|
+
Shine_format.channels = 2;
|
|
35
35
|
samplerate = Frame.audio_rate;
|
|
36
36
|
bitrate = 128;
|
|
37
37
|
}
|
|
@@ -32,7 +32,7 @@ let make_cbr params =
|
|
|
32
32
|
Vorbis_format.mode = Vorbis_format.CBR 128;
|
|
33
33
|
fill = None;
|
|
34
34
|
(* We use a hardcoded value in order not to force the evaluation of the
|
|
35
|
-
|
|
35
|
+
number of channels too early, see #933. *)
|
|
36
36
|
channels = 2;
|
|
37
37
|
samplerate = Frame.audio_rate;
|
|
38
38
|
}
|
|
@@ -33,7 +33,7 @@ let make params =
|
|
|
33
33
|
header = true;
|
|
34
34
|
duration = None;
|
|
35
35
|
(* We use a hardcoded value in order not to force the evaluation of the
|
|
36
|
-
|
|
36
|
+
number of channels too early, see #933. *)
|
|
37
37
|
channels = 2;
|
|
38
38
|
samplerate = Frame.audio_rate;
|
|
39
39
|
}
|
|
@@ -77,17 +77,12 @@ let watch : watch =
|
|
|
77
77
|
let e = List.flatten (List.map event_conv e) in
|
|
78
78
|
let wd = Inotify.add_watch fd file e in
|
|
79
79
|
handlers := (wd, f) :: !handlers;
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
(Printexc.to_string exn)));
|
|
89
|
-
handlers := List.remove_assoc wd !handlers)
|
|
90
|
-
in
|
|
91
|
-
Gc.finalise finalise unwatch;
|
|
92
|
-
unwatch)
|
|
80
|
+
Mutex_utils.mutexify m (fun () ->
|
|
81
|
+
(try Inotify.rm_watch fd wd
|
|
82
|
+
with exn ->
|
|
83
|
+
let bt = Printexc.get_backtrace () in
|
|
84
|
+
Utils.log_exception ~log ~bt
|
|
85
|
+
(Printf.sprintf "Error while removing file watch handler: %s"
|
|
86
|
+
(Printexc.to_string exn)));
|
|
87
|
+
handlers := List.remove_assoc wd !handlers))
|
|
93
88
|
()
|
|
@@ -149,26 +149,22 @@ module type T = sig
|
|
|
149
149
|
|
|
150
150
|
(* Source input *)
|
|
151
151
|
|
|
152
|
-
class virtual source :
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
method virtual icy_charset : string option
|
|
169
|
-
method virtual meta_charset : string option
|
|
170
|
-
method virtual get_mime_type : string option
|
|
171
|
-
end
|
|
152
|
+
class virtual source : object
|
|
153
|
+
inherit Source.source
|
|
154
|
+
|
|
155
|
+
method virtual relay :
|
|
156
|
+
string ->
|
|
157
|
+
(string * string) list ->
|
|
158
|
+
?read:(socket -> bytes -> int -> int -> int) ->
|
|
159
|
+
socket ->
|
|
160
|
+
unit
|
|
161
|
+
|
|
162
|
+
method virtual insert_metadata : Frame.metadata -> unit
|
|
163
|
+
method virtual login : string * (socket:socket -> string -> string -> bool)
|
|
164
|
+
method virtual icy_charset : string option
|
|
165
|
+
method virtual meta_charset : string option
|
|
166
|
+
method virtual get_mime_type : string option
|
|
167
|
+
end
|
|
172
168
|
|
|
173
169
|
val http_auth_check :
|
|
174
170
|
?query:(string * string) list ->
|
|
@@ -506,8 +502,10 @@ module Make (T : Transport_t) : T with type socket = T.socket = struct
|
|
|
506
502
|
(http_error_page 404 "Not found" "This mountpoint isn't available.")
|
|
507
503
|
in
|
|
508
504
|
let* () =
|
|
509
|
-
if
|
|
510
|
-
|
|
505
|
+
if
|
|
506
|
+
(* ICY and Xaudiocast auth check was done before.. *)
|
|
507
|
+
not auth
|
|
508
|
+
then exec_http_auth_check ~login:s#login h headers
|
|
511
509
|
else Duppy.Monad.return ()
|
|
512
510
|
in
|
|
513
511
|
try
|
|
@@ -951,7 +949,7 @@ module Make (T : Transport_t) : T with type socket = T.socket = struct
|
|
|
951
949
|
let* auth, huri, smethod =
|
|
952
950
|
(* X-audiocast sends lines of the form:
|
|
953
951
|
[SOURCE password path] *)
|
|
954
|
-
|
|
952
|
+
match hprotocol with
|
|
955
953
|
| `Xaudiocast_uri uri ->
|
|
956
954
|
let password = huri in
|
|
957
955
|
(* We check authentication here *)
|
|
@@ -1126,7 +1124,7 @@ module Make (T : Transport_t) : T with type socket = T.socket = struct
|
|
|
1126
1124
|
out_s
|
|
1127
1125
|
|
|
1128
1126
|
(* This, contrary to the find_xx functions
|
|
1129
|
-
|
|
1127
|
+
creates the handlers when they are missing. *)
|
|
1130
1128
|
let get_handler ~pos ~transport ~icy port =
|
|
1131
1129
|
try
|
|
1132
1130
|
let { handler; fds; transport = t } = Hashtbl.find opened_ports port in
|
|
@@ -96,6 +96,7 @@ class virtual ['a] base_output ~pass_metadata ~name ~frame_t ~field source =
|
|
|
96
96
|
val mutable input : [ `Frame of 'a Avutil.frame | `Flush ] -> unit =
|
|
97
97
|
fun _ -> ()
|
|
98
98
|
|
|
99
|
+
method self_sync = source#self_sync
|
|
99
100
|
method set_input fn = input <- fn
|
|
100
101
|
val mutable init : 'a Avutil.frame -> unit = fun _ -> assert false
|
|
101
102
|
method set_init v = init <- v
|
|
@@ -129,7 +130,7 @@ class virtual ['a] base_output ~pass_metadata ~name ~frame_t ~field source =
|
|
|
129
130
|
let metadata =
|
|
130
131
|
if pass_metadata then (
|
|
131
132
|
(* Pass only one metadata. *)
|
|
132
|
-
|
|
133
|
+
match Frame.get_all_metadata memo with
|
|
133
134
|
| (_, m) :: _ -> Frame.Metadata.to_list m
|
|
134
135
|
| _ -> [])
|
|
135
136
|
else []
|
|
@@ -146,8 +147,8 @@ class virtual ['a] base_output ~pass_metadata ~name ~frame_t ~field source =
|
|
|
146
147
|
frames
|
|
147
148
|
end
|
|
148
149
|
|
|
149
|
-
(** From the script perspective, the operator sending data to a filter graph
|
|
150
|
-
|
|
150
|
+
(** From the script perspective, the operator sending data to a filter graph is
|
|
151
|
+
an output. *)
|
|
151
152
|
class audio_output ~pass_metadata ~name ~frame_t ~field source =
|
|
152
153
|
object
|
|
153
154
|
inherit [[ `Audio ]] base_output ~pass_metadata ~name ~frame_t ~field source
|
|
@@ -34,9 +34,8 @@ end)
|
|
|
34
34
|
|
|
35
35
|
let sync_source = SyncSource.make ()
|
|
36
36
|
|
|
37
|
-
(** Wrapper for calling set_* functions and checking that the desired
|
|
38
|
-
|
|
39
|
-
* too violent. *)
|
|
37
|
+
(** Wrapper for calling set_* functions and checking that the desired value has
|
|
38
|
+
been accepted. If not, the current behavior is a bit too violent. *)
|
|
40
39
|
let force f fd x =
|
|
41
40
|
let x' = f fd x in
|
|
42
41
|
if x <> x' then failwith "cannot obtain desired OSS settings"
|
|
@@ -53,7 +52,7 @@ class output ~self_sync ~on_start ~on_stop ~infallible ~register_telnet ~start
|
|
|
53
52
|
|
|
54
53
|
val mutable fd = None
|
|
55
54
|
|
|
56
|
-
method
|
|
55
|
+
method self_sync =
|
|
57
56
|
if self_sync then (`Dynamic, if fd <> None then Some sync_source else None)
|
|
58
57
|
else (`Static, None)
|
|
59
58
|
|
|
@@ -162,7 +162,7 @@ class output ~self_sync ~start ~on_start ~on_stop ~infallible ~register_telnet
|
|
|
162
162
|
|
|
163
163
|
val mutable stream = None
|
|
164
164
|
|
|
165
|
-
method
|
|
165
|
+
method self_sync =
|
|
166
166
|
if self_sync then
|
|
167
167
|
(`Dynamic, if stream <> None then Some sync_source else None)
|
|
168
168
|
else (`Static, None)
|
|
@@ -46,7 +46,6 @@ class virtual base ~self_sync ~client ~device =
|
|
|
46
46
|
val client_name = client
|
|
47
47
|
val dev = device
|
|
48
48
|
val mutable stream = None
|
|
49
|
-
method virtual log : Log.t
|
|
50
49
|
|
|
51
50
|
method self_sync : Clock.self_sync =
|
|
52
51
|
if self_sync then
|
|
@@ -62,7 +61,7 @@ class output ~infallible ~register_telnet ~start ~on_start ~on_stop p =
|
|
|
62
61
|
let device =
|
|
63
62
|
if device = Some "" then (
|
|
64
63
|
log#important
|
|
65
|
-
"Empty device name \"\" is deprecated! Please use `null
|
|
64
|
+
"Empty device name \"\" is deprecated! Please use `null` instead..";
|
|
66
65
|
None)
|
|
67
66
|
else device
|
|
68
67
|
in
|
|
@@ -79,7 +78,7 @@ class output ~infallible ~register_telnet ~start ~on_start ~on_stop p =
|
|
|
79
78
|
object (self)
|
|
80
79
|
inherit base ~self_sync ~client ~device
|
|
81
80
|
|
|
82
|
-
inherit
|
|
81
|
+
inherit
|
|
83
82
|
Output.output
|
|
84
83
|
~infallible ~register_telnet ~on_stop ~on_start ~name
|
|
85
84
|
~output_kind:"output.pulseaudio" val_source start
|
|
@@ -151,7 +150,7 @@ class input p =
|
|
|
151
150
|
let device =
|
|
152
151
|
if device = Some "" then (
|
|
153
152
|
log#important
|
|
154
|
-
"Empty device name \"\" is deprecated! Please use `null
|
|
153
|
+
"Empty device name \"\" is deprecated! Please use `null` instead..";
|
|
155
154
|
None)
|
|
156
155
|
else device
|
|
157
156
|
in
|