-
-
Notifications
You must be signed in to change notification settings - Fork 130
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
872 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
let detected = "no (requires ctypes-foreign)" | ||
let enabled = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
noop.enabled.ml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
(***************************************************************************** | ||
Liquidsoap, a programmable stream generator. | ||
Copyright 2003-2024 Savonet team | ||
This program is free software; you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
the Free Software Foundation; either version 2 of the License, or | ||
(at your option) any later version. | ||
This program is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU General Public License for more details, fully stated in the COPYING | ||
file at the root of the liquidsoap distribution. | ||
You should have received a copy of the GNU General Public License | ||
along with this program; if not, write to the Free Software | ||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | ||
*****************************************************************************) | ||
|
||
(** NDI encoder. This encoder does nothing and can only by used with `output.ndi` *) | ||
|
||
let encoder ~pos _ = | ||
let error () = | ||
Runtime_error.raise | ||
~pos:(match pos with Some p -> [p] | None -> []) | ||
~message:"The NDI encoder can only be used with `output.ndi`!" "invalid" | ||
in | ||
{ | ||
Encoder.insert_metadata = (fun _ -> error ()); | ||
header = error; | ||
hls = Encoder.dummy_hls (fun _ -> error ()); | ||
encode = (fun _ -> error ()); | ||
stop = error; | ||
} | ||
|
||
let () = | ||
Plug.register Encoder.plug "ndi" | ||
~doc:"NDI encoder. Only used with `output.ndi`." (function | ||
| Encoder.NDI m -> Some (fun ?hls:_ ~pos _ _ -> encoder ~pos m) | ||
| _ -> None) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
(***************************************************************************** | ||
Liquidsoap, a programmable stream generator. | ||
Copyright 2003-2024 Savonet team | ||
This program is free software; you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
the Free Software Foundation; either version 2 of the License, or | ||
(at your option) any later version. | ||
This program is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU General Public License for more details, fully stated in the COPYING | ||
file at the root of the liquidsoap distribution. | ||
You should have received a copy of the GNU General Public License | ||
along with this program; if not, write to the Free Software | ||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | ||
*****************************************************************************) | ||
|
||
type t = { audio : bool; video : bool } | ||
|
||
let to_string { audio; video } = | ||
Printf.sprintf "%%ndi(%s)" | ||
(String.concat "," | ||
((if audio then "%audio" else "%audio.none") | ||
:: (if video then ["%video"] else ["%video.none"]))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
(***************************************************************************** | ||
Liquidsoap, a programmable stream generator. | ||
Copyright 2003-2024 Savonet team | ||
This program is free software; you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
the Free Software Foundation; either version 2 of the License, or | ||
(at your option) any later version. | ||
This program is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU General Public License for more details, fully stated in the COPYING | ||
file at the root of the liquidsoap distribution. | ||
You should have received a copy of the GNU General Public License | ||
along with this program; if not, write to the Free Software | ||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | ||
*****************************************************************************) | ||
|
||
open Ndi_format | ||
|
||
let type_of_encoder p = | ||
match | ||
List.fold_left | ||
(fun (audio, video) -> function | ||
| `Encoder ("audio", []) -> (true, video) | ||
| `Encoder ("audio.none", []) -> (false, video) | ||
| `Encoder ("video", []) -> (audio, true) | ||
| `Encoder ("video.none", []) -> (audio, false) | ||
| _ -> (audio, video)) | ||
(true, true) p | ||
with | ||
| true, true -> Encoder.audio_video_type ~pcm_kind:Content.Audio.kind 2 | ||
| false, true -> Encoder.video_type () | ||
| true, false -> Encoder.audio_type ~pcm_kind:Content.Audio.kind 2 | ||
| _ -> Lang_encoder.raise_error ~pos:None "Invalid %%ndi encoder parameter!" | ||
|
||
let make params = | ||
let defaults = { audio = true; video = true } in | ||
let ndi = | ||
List.fold_left | ||
(fun ndi -> function | ||
| `Encoder ("audio", []) -> { ndi with audio = true } | ||
| `Encoder ("audio.none", []) -> { ndi with audio = false } | ||
| `Encoder ("video", []) -> { ndi with video = true } | ||
| `Encoder ("video.none", []) -> { ndi with video = false } | ||
| `Labelled (_, v) -> | ||
Lang_encoder.raise_error ~pos:(Value.pos v) "Invalid parameter!" | ||
| _ -> | ||
Lang_encoder.raise_error ~pos:None | ||
"Invalid %%ndi encoder parameter!") | ||
defaults params | ||
in | ||
if (not ndi.audio) && not ndi.video then | ||
Lang_encoder.raise_error ~pos:None | ||
"%%ndi encoder needs at least one audio or video field!"; | ||
Encoder.NDI ndi | ||
|
||
let () = Lang_encoder.register "ndi" type_of_encoder make |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.