支持保存推流数据包到文件. 打印拉流url

This commit is contained in:
yangjiechina
2024-07-04 22:35:55 +08:00
parent 4b1200d9ad
commit dfda276583
17 changed files with 280 additions and 81 deletions

View File

@@ -1,6 +1,7 @@
package stream
import (
"encoding/json"
"fmt"
"github.com/yangjiechina/lkm/log"
"net"
@@ -173,6 +174,7 @@ type PublishSource struct {
idleTimer *time.Timer
sinkCount int
closed bool
firstPacket bool
urlValues url.Values
}
@@ -254,6 +256,13 @@ func (s *PublishSource) LoopEvent() {
break
}
if !s.firstPacket {
urls := GetStreamPlayUrls(s.Id_)
indent, _ := json.MarshalIndent(urls, "", "\t")
log.Sugar.Infof("%s 开始推流 source:%s 拉流地址:\r\n%s", s.Type_.ToString(), s.Id_, indent)
s.firstPacket = true
}
if AppConfig.ReceiveTimeout > 0 {
s.lastPacketTime = time.Now()
}