golanggohlsrtmpwebrtcmedia-serverobs-studiortcprtmp-proxyrtmp-serverrtprtsprtsp-proxyrtsp-relayrtsp-serversrtstreamingwebrtc-proxy
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
44 lines
990 B
44 lines
990 B
package core |
|
|
|
import ( |
|
"github.com/bluenviron/mediamtx/internal/defs" |
|
"github.com/bluenviron/mediamtx/internal/externalcmd" |
|
"github.com/bluenviron/mediamtx/internal/logger" |
|
) |
|
|
|
type conn struct { |
|
rtspAddress string |
|
runOnConnect string |
|
runOnConnectRestart bool |
|
runOnDisconnect string |
|
externalCmdPool *externalcmd.Pool |
|
logger logger.Writer |
|
|
|
onDisconnectHook func() |
|
} |
|
|
|
func newConn( |
|
rtspAddress string, |
|
runOnConnect string, |
|
runOnConnectRestart bool, |
|
runOnDisconnect string, |
|
externalCmdPool *externalcmd.Pool, |
|
logger logger.Writer, |
|
) *conn { |
|
return &conn{ |
|
rtspAddress: rtspAddress, |
|
runOnConnect: runOnConnect, |
|
runOnConnectRestart: runOnConnectRestart, |
|
runOnDisconnect: runOnDisconnect, |
|
externalCmdPool: externalCmdPool, |
|
logger: logger, |
|
} |
|
} |
|
|
|
func (c *conn) open(desc defs.APIPathSourceOrReader) { |
|
c.onDisconnectHook = onConnectHook(c, desc) |
|
} |
|
|
|
func (c *conn) close() { |
|
c.onDisconnectHook() |
|
}
|
|
|