Browse Source

remove runOnPublish (breaking change)

pull/883/head
aler9 4 years ago
parent
commit
b4649ef60b
  1. 4
      Makefile
  2. 12
      internal/conf/path.go
  3. 4
      internal/core/api.go

4
Makefile

@ -127,7 +127,7 @@ define CONFIG_RUN
paths: paths:
all: all:
# runOnPublish: ffmpeg -i rtsp://localhost:$$RTSP_PORT/$$RTSP_PATH -c copy -f mpegts myfile_$$RTSP_PATH.ts # runOnReady: ffmpeg -i rtsp://localhost:$$RTSP_PORT/$$RTSP_PATH -c copy -f mpegts myfile_$$RTSP_PATH.ts
# readUser: test # readUser: test
# readPass: tast # readPass: tast
# runOnDemand: ffmpeg -re -stream_loop -1 -i testimages/ffmpeg/emptyvideo.mkv -c copy -f rtsp rtsp://localhost:$$RTSP_PORT/$$RTSP_PATH # runOnDemand: ffmpeg -re -stream_loop -1 -i testimages/ffmpeg/emptyvideo.mkv -c copy -f rtsp rtsp://localhost:$$RTSP_PORT/$$RTSP_PATH
@ -139,7 +139,7 @@ paths:
# runOnDemand: ffmpeg -i rtsp://192.168.2.198:554/stream -c copy -f rtsp rtsp://localhost:$$RTSP_PORT/proxied2 # runOnDemand: ffmpeg -i rtsp://192.168.2.198:554/stream -c copy -f rtsp rtsp://localhost:$$RTSP_PORT/proxied2
# original: # original:
# runOnPublish: ffmpeg -i rtsp://localhost:554/original -b:a 64k -c:v libx264 -preset ultrafast -b:v 500k -max_muxing_queue_size 1024 -f rtsp rtsp://localhost:8554/compressed # runOnReady: ffmpeg -i rtsp://localhost:554/original -b:a 64k -c:v libx264 -preset ultrafast -b:v 500k -max_muxing_queue_size 1024 -f rtsp rtsp://localhost:8554/compressed
endef endef
export CONFIG_RUN export CONFIG_RUN

12
internal/conf/path.go

@ -69,10 +69,6 @@ type PathConf struct {
RunOnReadyRestart bool `json:"runOnReadyRestart"` RunOnReadyRestart bool `json:"runOnReadyRestart"`
RunOnRead string `json:"runOnRead"` RunOnRead string `json:"runOnRead"`
RunOnReadRestart bool `json:"runOnReadRestart"` RunOnReadRestart bool `json:"runOnReadRestart"`
// deprecated, replaced by runOnReady. TODO: remove in next version
RunOnPublish string `json:"runOnPublish"`
RunOnPublishRestart bool `json:"runOnPublishRestart"`
} }
func (pconf *PathConf) checkAndFillMissing(conf *Conf, name string) error { func (pconf *PathConf) checkAndFillMissing(conf *Conf, name string) error {
@ -245,14 +241,6 @@ func (pconf *PathConf) checkAndFillMissing(conf *Conf, name string) error {
return fmt.Errorf("'runOnDemand' can be used only when source is 'publisher'") return fmt.Errorf("'runOnDemand' can be used only when source is 'publisher'")
} }
if pconf.RunOnPublish != "" {
pconf.RunOnReady = pconf.RunOnPublish
}
if pconf.RunOnPublishRestart {
pconf.RunOnReadyRestart = true
}
if pconf.RunOnDemandStartTimeout == 0 { if pconf.RunOnDemandStartTimeout == 0 {
pconf.RunOnDemandStartTimeout = 10 * StringDuration(time.Second) pconf.RunOnDemandStartTimeout = 10 * StringDuration(time.Second)
} }

4
internal/core/api.go

@ -130,10 +130,6 @@ func loadConfPathData(ctx *gin.Context) (interface{}, error) {
RunOnReadyRestart *bool `json:"runOnReadyRestart"` RunOnReadyRestart *bool `json:"runOnReadyRestart"`
RunOnRead *string `json:"runOnRead"` RunOnRead *string `json:"runOnRead"`
RunOnReadRestart *bool `json:"runOnReadRestart"` RunOnReadRestart *bool `json:"runOnReadRestart"`
// deprecated, replaced by runOnReady. TODO: remove in next version
RunOnPublish *string `json:"runOnPublish"`
RunOnPublishRestart *bool `json:"runOnPublishRestart"`
} }
err := json.NewDecoder(ctx.Request.Body).Decode(&in) err := json.NewDecoder(ctx.Request.Body).Decode(&in)
if err != nil { if err != nil {

Loading…
Cancel
Save