mirror of
https://github.com/lkmio/lkm.git
synced 2025-09-28 12:02:09 +08:00
支持保存推流数据包到文件. 打印拉流url
This commit is contained in:
@@ -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()
|
||||
}
|
||||
|
Reference in New Issue
Block a user