From 0b260b3c08aa822db0dfd97acfac9a8f43280aa6 Mon Sep 17 00:00:00 2001 From: Moritz Grimm Date: Thu, 23 Nov 2017 18:34:57 +0100 Subject: [PATCH] Make media inputs ("intakes") a list of things, too --- doc/ezstream.1.in.in | 43 ++++- examples/ezstream-file_template.xml | 8 +- examples/ezstream-full.xml | 30 ++-- examples/ezstream-minimal.xml | 8 +- examples/ezstream-stdin.xml | 8 +- examples/ezstream-video.xml | 8 +- src/Makefile.am | 2 + src/cfg.c | 124 ++------------ src/cfg.h | 42 +---- src/cfg_encoder.h | 2 + src/cfg_intake.c | 247 ++++++++++++++++++++++++++++ src/cfg_intake.h | 68 ++++++++ src/cfg_private.h | 11 +- src/cfg_stream.c | 47 ++++++ src/cfg_stream.h | 21 +++ src/cfg_xmlfile.c | 106 ++++++++---- src/ezstream.c | 47 +++--- src/stream.c | 13 ++ src/stream.h | 2 + tests/Makefile.am | 6 + tests/check_cfg.c | 93 ----------- tests/check_cfg_intake.c | 170 +++++++++++++++++++ tests/check_cfg_stream.c | 36 ++++ tests/check_cfg_xmlfile.c | 3 + tests/check_stream.c | 3 + tests/config-bad.xml | 16 +- tests/config-bad5.xml | 11 ++ tests/config-bad6.xml | 32 ++++ 28 files changed, 872 insertions(+), 335 deletions(-) create mode 100644 src/cfg_intake.c create mode 100644 src/cfg_intake.h create mode 100644 tests/check_cfg_intake.c create mode 100644 tests/config-bad6.xml diff --git a/doc/ezstream.1.in.in b/doc/ezstream.1.in.in index 930488b..91452cc 100644 --- a/doc/ezstream.1.in.in +++ b/doc/ezstream.1.in.in @@ -307,6 +307,15 @@ The broadcast is private (the default). .It Ar 1|Yes|True The broadcast is public. .El +.It Sy \& +Use the intake +.Po +input media +.Pc +configuration with the provided symbolic name for this stream. +.Pp +Default: +.Ar default .It Sy \& Use the server configuration with the provided symbolic name for this stream. .Pp @@ -376,17 +385,41 @@ Informational number of audio channels of the broadcast. Default: .Em none .El -.Ss Media block +.Ss Intakes block .Bl -tag -width -Ds -.It Sy \& -.Pq Mandatory. -This element contains the entire input media configuration as child elements. +.It Sy \& +This element contains all intake blocks as child elements. Its parent is the .Sy \& element. +.Pp +A configuration file may contain multiple named intake configurations. +The stream configuration determines what intake +.Po +media input +.Pc +configuration should be used. .El -.Ss Media configuration +.Ss Intake block .Bl -tag -width -Ds +.It Sy \& +.Pq Mandatory. +This element contains the entire input media configuration as child elements. +Its parent is the +.Sy \& +element. +.El +.Ss Intake configuration +.Bl -tag -width -Ds +.It Sy \& +Set the name of the intake configuration. +This may be referenced in a +.Sy \& . +.Pp +The name is case-aware, but not case-sensitive. +.Pp +Default: +.Ar default .It Sy \& Configure the input media type: .Pp diff --git a/examples/ezstream-file_template.xml b/examples/ezstream-file_template.xml index 713954d..d016648 100644 --- a/examples/ezstream-file_template.xml +++ b/examples/ezstream-file_template.xml @@ -26,9 +26,11 @@ - - %FILENAME% - + + + %FILENAME% + + diff --git a/examples/ezstream-full.xml b/examples/ezstream-full.xml index dbb9392..9f1030c 100644 --- a/examples/ezstream-full.xml +++ b/examples/ezstream-full.xml @@ -75,6 +75,9 @@ /stream.ogg + + Default + Default @@ -100,21 +103,26 @@ - - - autodetect + + + + Default - - playlist.m3u + + autodetect - - Yes + + playlist.m3u - - No - + + Yes + + + No + + - - - - - - + + + + + + + + + diff --git a/tests/config-bad5.xml b/tests/config-bad5.xml index 7f0e23d..9a4ee41 100644 --- a/tests/config-bad5.xml +++ b/tests/config-bad5.xml @@ -15,6 +15,17 @@ + + + secret + duplicate + + + secret + duplicate + + + vorbis diff --git a/tests/config-bad6.xml b/tests/config-bad6.xml new file mode 100644 index 0000000..24e4239 --- /dev/null +++ b/tests/config-bad6.xml @@ -0,0 +1,32 @@ + + + + + + + 127.0.0.1 + + + + + + /stream.ogg + + + + + + + + + + + + + + + + + + +