mirror of
https://github.com/lkmio/lkm.git
synced 2025-10-05 15:16:49 +08:00
完善sink断开处理
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package stream
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/yangjiechina/avformat/utils"
|
||||
"github.com/yangjiechina/live-server/log"
|
||||
"net"
|
||||
@@ -43,7 +44,10 @@ type ISink interface {
|
||||
// DesiredVideoCodecId DescribeVideoCodecId 允许客户端拉取指定的视频流
|
||||
DesiredVideoCodecId() utils.AVCodecID
|
||||
|
||||
// Close 关闭释放Sink, 从传输流或等待队列中删除sink
|
||||
Close()
|
||||
|
||||
PrintInfo() string
|
||||
}
|
||||
|
||||
// GenerateSinkId 根据网络地址生成SinkId IPV4使用一个uint64, IPV6使用String
|
||||
@@ -184,6 +188,10 @@ func (s *SinkImpl) Close() {
|
||||
}
|
||||
}
|
||||
|
||||
func (s *SinkImpl) PrintInfo() string {
|
||||
return fmt.Sprintf("%s-%v source:%s", s.ProtocolStr(), s.Id_, s.SourceId_)
|
||||
}
|
||||
|
||||
func (s *SinkImpl) Play(sink ISink, success func(), failure func(state utils.HookState)) {
|
||||
f := func() {
|
||||
source := SourceManager.Find(sink.SourceId())
|
||||
|
Reference in New Issue
Block a user