|
|
@ -145,6 +145,8 @@ func (session *PullSession) WaitChan() <-chan error {
|
|
|
|
return session.waitChan
|
|
|
|
return session.waitChan
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// ---------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
// ISessionUrlContext interface
|
|
|
|
// ---------------------------------------------------------------------------------------------------------------------
|
|
|
|
// ---------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
|
|
// Url 文档请参考: interface ISessionUrlContext
|
|
|
|
// Url 文档请参考: interface ISessionUrlContext
|
|
|
@ -167,12 +169,18 @@ func (session *PullSession) RawQuery() string {
|
|
|
|
return session.cmdSession.RawQuery()
|
|
|
|
return session.cmdSession.RawQuery()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// ---------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
// IObject interface
|
|
|
|
|
|
|
|
// ---------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
|
|
// UniqueKey 文档请参考: interface IObject
|
|
|
|
// UniqueKey 文档请参考: interface IObject
|
|
|
|
func (session *PullSession) UniqueKey() string {
|
|
|
|
func (session *PullSession) UniqueKey() string {
|
|
|
|
return session.baseInSession.UniqueKey()
|
|
|
|
return session.baseInSession.UniqueKey()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// ----- ISessionStat --------------------------------------------------------------------------------------------------
|
|
|
|
// ---------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
// ISessionStat interface
|
|
|
|
|
|
|
|
// ---------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
|
|
// GetStat 文档请参考: interface ISessionStat
|
|
|
|
// GetStat 文档请参考: interface ISessionStat
|
|
|
|
func (session *PullSession) GetStat() base.StatSession {
|
|
|
|
func (session *PullSession) GetStat() base.StatSession {
|
|
|
@ -191,44 +199,52 @@ func (session *PullSession) IsAlive() (readAlive, writeAlive bool) {
|
|
|
|
return session.baseInSession.IsAlive()
|
|
|
|
return session.baseInSession.IsAlive()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// ---------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
// IClientCommandSessionObserver interface
|
|
|
|
// ---------------------------------------------------------------------------------------------------------------------
|
|
|
|
// ---------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
|
|
// OnConnectResult IClientCommandSessionObserver, callback by ClientCommandSession
|
|
|
|
// OnConnectResult callback by ClientCommandSession
|
|
|
|
func (session *PullSession) OnConnectResult() {
|
|
|
|
func (session *PullSession) OnConnectResult() {
|
|
|
|
// noop
|
|
|
|
// noop
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// OnDescribeResponse IClientCommandSessionObserver, callback by ClientCommandSession
|
|
|
|
// OnDescribeResponse callback by ClientCommandSession
|
|
|
|
func (session *PullSession) OnDescribeResponse(sdpCtx sdp.LogicContext) {
|
|
|
|
func (session *PullSession) OnDescribeResponse(sdpCtx sdp.LogicContext) {
|
|
|
|
session.onDescribeResponse()
|
|
|
|
session.onDescribeResponse()
|
|
|
|
session.baseInSession.InitWithSdp(sdpCtx)
|
|
|
|
session.baseInSession.InitWithSdp(sdpCtx)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// OnSetupWithConn IClientCommandSessionObserver, callback by ClientCommandSession
|
|
|
|
// OnSetupWithConn callback by ClientCommandSession
|
|
|
|
func (session *PullSession) OnSetupWithConn(uri string, rtpConn, rtcpConn *nazanet.UdpConnection) {
|
|
|
|
func (session *PullSession) OnSetupWithConn(uri string, rtpConn, rtcpConn *nazanet.UdpConnection) {
|
|
|
|
_ = session.baseInSession.SetupWithConn(uri, rtpConn, rtcpConn)
|
|
|
|
_ = session.baseInSession.SetupWithConn(uri, rtpConn, rtcpConn)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// OnSetupWithChannel IClientCommandSessionObserver, callback by ClientCommandSession
|
|
|
|
// OnSetupWithChannel callback by ClientCommandSession
|
|
|
|
func (session *PullSession) OnSetupWithChannel(uri string, rtpChannel, rtcpChannel int) {
|
|
|
|
func (session *PullSession) OnSetupWithChannel(uri string, rtpChannel, rtcpChannel int) {
|
|
|
|
_ = session.baseInSession.SetupWithChannel(uri, rtpChannel, rtcpChannel)
|
|
|
|
_ = session.baseInSession.SetupWithChannel(uri, rtpChannel, rtcpChannel)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// OnSetupResult IClientCommandSessionObserver, callback by ClientCommandSession
|
|
|
|
// OnSetupResult callback by ClientCommandSession
|
|
|
|
func (session *PullSession) OnSetupResult() {
|
|
|
|
func (session *PullSession) OnSetupResult() {
|
|
|
|
session.baseInSession.WriteRtpRtcpDummy()
|
|
|
|
session.baseInSession.WriteRtpRtcpDummy()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// OnInterleavedPacket IClientCommandSessionObserver, callback by ClientCommandSession
|
|
|
|
// OnInterleavedPacket callback by ClientCommandSession
|
|
|
|
func (session *PullSession) OnInterleavedPacket(packet []byte, channel int) {
|
|
|
|
func (session *PullSession) OnInterleavedPacket(packet []byte, channel int) {
|
|
|
|
session.baseInSession.HandleInterleavedPacket(packet, channel)
|
|
|
|
session.baseInSession.HandleInterleavedPacket(packet, channel)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// WriteInterleavedPacket IInterleavedPacketWriter, callback by BaseInSession
|
|
|
|
// ---------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
// IInterleavedPacketWriter interface
|
|
|
|
|
|
|
|
// ---------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// WriteInterleavedPacket callback by BaseInSession
|
|
|
|
func (session *PullSession) WriteInterleavedPacket(packet []byte, channel int) error {
|
|
|
|
func (session *PullSession) WriteInterleavedPacket(packet []byte, channel int) error {
|
|
|
|
return session.cmdSession.WriteInterleavedPacket(packet, channel)
|
|
|
|
return session.cmdSession.WriteInterleavedPacket(packet, channel)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// ---------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
|
|
func (session *PullSession) dispose(err error) error {
|
|
|
|
func (session *PullSession) dispose(err error) error {
|
|
|
|
var retErr error
|
|
|
|
var retErr error
|
|
|
|
session.disposeOnce.Do(func() {
|
|
|
|
session.disposeOnce.Do(func() {
|
|
|
|