summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/daq/s5proxy/sample.json12
-rw-r--r--src/daq/s5proxy/src/s5proxy/config.go6
-rw-r--r--src/daq/s5proxy/src/s5proxy/stats.go6
3 files changed, 16 insertions, 8 deletions
diff --git a/src/daq/s5proxy/sample.json b/src/daq/s5proxy/sample.json
index cd72df2..664bda4 100644
--- a/src/daq/s5proxy/sample.json
+++ b/src/daq/s5proxy/sample.json
@@ -35,9 +35,15 @@
"hostname": "public1",
"tags": [ "hello", "world" ],
"duration": "15s",
- "format" : "/${content}-${format}-${quality}",
- "stream": [
- "av-orig/flash,webm/high,medium,low,mini"
+ "matches": [
+ {
+ "format" : "/${content}-${format}-${quality}",
+ "streams":"av-orig/flash,webm/high,medium,low,mini"
+ },
+ {
+ "format" : "/${format}/${content}-${quality}",
+ "streams": "av-orig/dash,hls/high,medium,low,mini"
+ }
]
}
}
diff --git a/src/daq/s5proxy/src/s5proxy/config.go b/src/daq/s5proxy/src/s5proxy/config.go
index d3b3222..d6e0fa5 100644
--- a/src/daq/s5proxy/src/s5proxy/config.go
+++ b/src/daq/s5proxy/src/s5proxy/config.go
@@ -209,8 +209,10 @@ type SFiveConf struct {
Hostname string `json:"hostname"`
Tags []string `json:"tags"`
Duration SFiveDuration `json:"duration"`
- Format string `json:"format"`
- Stream []string `json:"stream"`
+ Matches []struct {
+ Format string `json:"format"`
+ Streams string `json:"streams"`
+ } `json:"matches"`
}
//*********************************************
diff --git a/src/daq/s5proxy/src/s5proxy/stats.go b/src/daq/s5proxy/src/s5proxy/stats.go
index 85e848c..b4eccaa 100644
--- a/src/daq/s5proxy/src/s5proxy/stats.go
+++ b/src/daq/s5proxy/src/s5proxy/stats.go
@@ -222,14 +222,14 @@ func NewStats(conf *Config) (s *Stats, err error) {
s.updates = make(chan *UpdateFull, 1000)
s.workers = make(map[string]StatsWorker)
var content, format, quality []string
- for _, desc := range conf.SFive.Stream {
- if content, format, quality, err = parseStreamDescription(desc); err != nil {
+ for _, match := range conf.SFive.Matches {
+ if content, format, quality, err = parseStreamDescription(match.Streams); err != nil {
return
}
for _, c := range content {
for _, f := range format {
for _, q := range quality {
- name := generateStreamName(conf.SFive.Format, c, f, q)
+ name := generateStreamName(match.Format, c, f, q)
s.workers[name] = NewStatsWorker(Stream{c, f, q}, s.updates)
s5l.Printf("STATS: adding streamer '%s'", name)
}