mirror of
https://github.com/aler9/rtsp-simple-server
synced 2025-10-04 15:22:48 +08:00
split readPublisher into reader and publisher
This commit is contained in:
@@ -23,8 +23,8 @@ const (
|
||||
|
||||
type rtspSourceParent interface {
|
||||
Log(logger.Level, string, ...interface{})
|
||||
OnSourceExternalSetReady(req sourceExtSetReadyReq)
|
||||
OnSourceExternalSetNotReady(req sourceExtSetNotReadyReq)
|
||||
OnSourceStaticSetReady(req pathSourceStaticSetReadyReq)
|
||||
OnSourceStaticSetNotReady(req pathSourceStaticSetNotReadyReq)
|
||||
OnSourceFrame(int, gortsplib.StreamType, []byte)
|
||||
}
|
||||
|
||||
@@ -94,8 +94,8 @@ func (s *rtspSource) Close() {
|
||||
// IsSource implements source.
|
||||
func (s *rtspSource) IsSource() {}
|
||||
|
||||
// IsSourceExternal implements sourceExternal.
|
||||
func (s *rtspSource) IsSourceExternal() {}
|
||||
// IsSourceStatic implements sourceStatic.
|
||||
func (s *rtspSource) IsSourceStatic() {}
|
||||
|
||||
func (s *rtspSource) log(level logger.Level, format string, args ...interface{}) {
|
||||
s.parent.Log(level, "[rtsp source] "+format, args...)
|
||||
@@ -187,12 +187,12 @@ func (s *rtspSource) runInner() bool {
|
||||
|
||||
s.log(logger.Info, "ready")
|
||||
|
||||
s.parent.OnSourceExternalSetReady(sourceExtSetReadyReq{
|
||||
s.parent.OnSourceStaticSetReady(pathSourceStaticSetReadyReq{
|
||||
Tracks: conn.Tracks(),
|
||||
})
|
||||
|
||||
defer func() {
|
||||
s.parent.OnSourceExternalSetNotReady(sourceExtSetNotReadyReq{})
|
||||
s.parent.OnSourceStaticSetNotReady(pathSourceStaticSetNotReadyReq{})
|
||||
}()
|
||||
|
||||
readErr := make(chan error)
|
||||
|
Reference in New Issue
Block a user