Add timeout query param to RTSP incoming source #1118
This commit is contained in:
@@ -210,6 +210,11 @@ func tcpHandler(conn *rtsp.Conn) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
query := conn.URL.Query()
|
||||||
|
if s := query.Get("timeout"); s != "" {
|
||||||
|
conn.Timeout = core.Atoi(s)
|
||||||
|
}
|
||||||
|
|
||||||
log.Debug().Str("stream", name).Msg("[rtsp] new producer")
|
log.Debug().Str("stream", name).Msg("[rtsp] new producer")
|
||||||
|
|
||||||
stream.AddProducer(conn)
|
stream.AddProducer(conn)
|
||||||
|
|||||||
@@ -124,7 +124,11 @@ func (c *Conn) Handle() (err error) {
|
|||||||
|
|
||||||
case core.ModePassiveProducer:
|
case core.ModePassiveProducer:
|
||||||
// polling frames from remote RTSP Client (ex FFmpeg)
|
// polling frames from remote RTSP Client (ex FFmpeg)
|
||||||
|
if c.Timeout == 0 {
|
||||||
timeout = time.Second * 15
|
timeout = time.Second * 15
|
||||||
|
} else {
|
||||||
|
timeout = time.Second * time.Duration(c.Timeout)
|
||||||
|
}
|
||||||
|
|
||||||
case core.ModePassiveConsumer:
|
case core.ModePassiveConsumer:
|
||||||
// pushing frames to remote RTSP Client (ex VLC)
|
// pushing frames to remote RTSP Client (ex VLC)
|
||||||
|
|||||||
Reference in New Issue
Block a user