pull/358/head
q191201771 7 months ago
parent f31e75b52f
commit 592dc3e2e8

@ -106,6 +106,8 @@ func (session *PullSession) WaitChan() <-chan error {
return session.conn.Done()
}
// ---------------------------------------------------------------------------------------------------------------------
// ISessionUrlContext interface
// ---------------------------------------------------------------------------------------------------------------------
// Url 文档请参考: interface ISessionUrlContext
@ -128,12 +130,18 @@ func (session *PullSession) RawQuery() string {
return session.urlCtx.RawQuery
}
// ---------------------------------------------------------------------------------------------------------------------
// IObject interface
// ---------------------------------------------------------------------------------------------------------------------
// UniqueKey 文档请参考: interface IObject
func (session *PullSession) UniqueKey() string {
return session.sessionStat.UniqueKey()
}
// ----- ISessionStat --------------------------------------------------------------------------------------------------
// ---------------------------------------------------------------------------------------------------------------------
// ISessionStat interface
// ---------------------------------------------------------------------------------------------------------------------
// UpdateStat 文档请参考: interface ISessionStat
func (session *PullSession) UpdateStat(intervalSec uint32) {

@ -115,6 +115,8 @@ func (s *PullSession) WaitChan() <-chan error {
return s.core.WaitChan()
}
// ---------------------------------------------------------------------------------------------------------------------
// ISessionUrlContext interface
// ---------------------------------------------------------------------------------------------------------------------
// Url 文档请参考: interface ISessionUrlContext
@ -137,12 +139,18 @@ func (s *PullSession) RawQuery() string {
return s.core.RawQuery()
}
// ---------------------------------------------------------------------------------------------------------------------
// IObject interface
// ---------------------------------------------------------------------------------------------------------------------
// UniqueKey 文档请参考: interface IObject
func (s *PullSession) UniqueKey() string {
return s.core.UniqueKey()
}
// ----- ISessionStat --------------------------------------------------------------------------------------------------
// ---------------------------------------------------------------------------------------------------------------------
// ISessionStat interface
// ---------------------------------------------------------------------------------------------------------------------
// GetStat 文档请参考: interface ISessionStat
func (s *PullSession) GetStat() base.StatSession {

@ -109,6 +109,8 @@ func (s *PushSession) WaitChan() <-chan error {
return s.core.WaitChan()
}
// ---------------------------------------------------------------------------------------------------------------------
// ISessionUrlContext interface
// ---------------------------------------------------------------------------------------------------------------------
// Url 文档请参考: interface ISessionUrlContext
@ -131,12 +133,18 @@ func (s *PushSession) RawQuery() string {
return s.core.RawQuery()
}
// ---------------------------------------------------------------------------------------------------------------------
// IObject interface
// ---------------------------------------------------------------------------------------------------------------------
// UniqueKey 文档请参考: interface IObject
func (s *PushSession) UniqueKey() string {
return s.core.UniqueKey()
}
// ----- ISessionStat --------------------------------------------------------------------------------------------------
// ---------------------------------------------------------------------------------------------------------------------
// ISessionStat interface
// ---------------------------------------------------------------------------------------------------------------------
// GetStat 文档请参考: interface ISessionStat
func (s *PushSession) GetStat() base.StatSession {

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

@ -128,6 +128,8 @@ func (session *PushSession) WaitChan() <-chan error {
return session.waitChan
}
// ---------------------------------------------------------------------------------------------------------------------
// ISessionUrlContext interface
// ---------------------------------------------------------------------------------------------------------------------
// Url 文档请参考: interface ISessionUrlContext
@ -150,12 +152,18 @@ func (session *PushSession) RawQuery() string {
return session.cmdSession.RawQuery()
}
// ---------------------------------------------------------------------------------------------------------------------
// ISessionUrlContext IObject
// ---------------------------------------------------------------------------------------------------------------------
// UniqueKey 文档请参考: interface IObject
func (session *PushSession) UniqueKey() string {
return session.baseOutSession.UniqueKey()
}
// ----- ISessionStat --------------------------------------------------------------------------------------------------
// ---------------------------------------------------------------------------------------------------------------------
// ISessionStat IObject
// ---------------------------------------------------------------------------------------------------------------------
// GetStat 文档请参考: interface ISessionStat
func (session *PushSession) GetStat() base.StatSession {
@ -174,43 +182,51 @@ func (session *PushSession) IsAlive() (readAlive, writeAlive bool) {
return session.baseOutSession.IsAlive()
}
// ---------------------------------------------------------------------------------------------------------------------
// ISessionStat IClientCommandSessionObserver
// ---------------------------------------------------------------------------------------------------------------------
// OnConnectResult IClientCommandSessionObserver, callback by ClientCommandSession
// OnConnectResult callback by ClientCommandSession
func (session *PushSession) OnConnectResult() {
// noop
}
// OnDescribeResponse IClientCommandSessionObserver, callback by ClientCommandSession
// OnDescribeResponse callback by ClientCommandSession
func (session *PushSession) OnDescribeResponse(sdpCtx sdp.LogicContext) {
// noop
}
// OnSetupWithConn IClientCommandSessionObserver, callback by ClientCommandSession
// OnSetupWithConn callback by ClientCommandSession
func (session *PushSession) OnSetupWithConn(uri string, rtpConn, rtcpConn *nazanet.UdpConnection) {
_ = session.baseOutSession.SetupWithConn(uri, rtpConn, rtcpConn)
}
// OnSetupWithChannel IClientCommandSessionObserver, callback by ClientCommandSession
// OnSetupWithChannel callback by ClientCommandSession
func (session *PushSession) OnSetupWithChannel(uri string, rtpChannel, rtcpChannel int) {
_ = session.baseOutSession.SetupWithChannel(uri, rtpChannel, rtcpChannel)
}
// OnSetupResult IClientCommandSessionObserver, callback by ClientCommandSession
// OnSetupResult callback by ClientCommandSession
func (session *PushSession) OnSetupResult() {
// noop
}
// OnInterleavedPacket IClientCommandSessionObserver, callback by ClientCommandSession
// OnInterleavedPacket callback by ClientCommandSession
func (session *PushSession) OnInterleavedPacket(packet []byte, channel int) {
session.baseOutSession.HandleInterleavedPacket(packet, channel)
}
// WriteInterleavedPacket IInterleavedPacketWriter, callback by BaseOutSession
// ---------------------------------------------------------------------------------------------------------------------
// ISessionStat IInterleavedPacketWriter
// ---------------------------------------------------------------------------------------------------------------------
// WriteInterleavedPacket callback by BaseOutSession
func (session *PushSession) WriteInterleavedPacket(packet []byte, channel int) error {
return session.cmdSession.WriteInterleavedPacket(packet, channel)
}
// ---------------------------------------------------------------------------------------------------------------------
func (session *PushSession) dispose(err error) error {
var retErr error
session.disposeOnce.Do(func() {

Loading…
Cancel
Save