mirror of
https://github.com/aler9/rtsp-simple-server
synced 2025-10-05 07:36:57 +08:00
split readPublisher into reader and publisher
This commit is contained in:
@@ -24,8 +24,8 @@ const (
|
||||
|
||||
type rtmpSourceParent interface {
|
||||
Log(logger.Level, string, ...interface{})
|
||||
OnSourceExternalSetReady(req sourceExtSetReadyReq)
|
||||
OnSourceExternalSetNotReady(req sourceExtSetNotReadyReq)
|
||||
OnSourceStaticSetReady(req pathSourceStaticSetReadyReq)
|
||||
OnSourceStaticSetNotReady(req pathSourceStaticSetNotReadyReq)
|
||||
OnSourceFrame(int, gortsplib.StreamType, []byte)
|
||||
}
|
||||
|
||||
@@ -81,8 +81,8 @@ func (s *rtmpSource) Close() {
|
||||
// IsSource implements source.
|
||||
func (s *rtmpSource) IsSource() {}
|
||||
|
||||
// IsSourceExternal implements sourceExternal.
|
||||
func (s *rtmpSource) IsSourceExternal() {}
|
||||
// IsSourceStatic implements sourceStatic.
|
||||
func (s *rtmpSource) IsSourceStatic() {}
|
||||
|
||||
func (s *rtmpSource) log(level logger.Level, format string, args ...interface{}) {
|
||||
s.parent.Log(level, "[rtmp source] "+format, args...)
|
||||
@@ -168,12 +168,12 @@ func (s *rtmpSource) runInner() bool {
|
||||
|
||||
s.log(logger.Info, "ready")
|
||||
|
||||
s.parent.OnSourceExternalSetReady(sourceExtSetReadyReq{
|
||||
s.parent.OnSourceStaticSetReady(pathSourceStaticSetReadyReq{
|
||||
Tracks: tracks,
|
||||
})
|
||||
|
||||
defer func() {
|
||||
s.parent.OnSourceExternalSetNotReady(sourceExtSetNotReadyReq{})
|
||||
s.parent.OnSourceStaticSetNotReady(pathSourceStaticSetNotReadyReq{})
|
||||
}()
|
||||
|
||||
rtcpSenders := rtcpsenderset.New(tracks, s.parent.OnSourceFrame)
|
||||
|
Reference in New Issue
Block a user