Skip to content

Commit

Permalink
comment
Browse files Browse the repository at this point in the history
  • Loading branch information
q191201771 committed Jun 24, 2024
1 parent f31e75b commit 592dc3e
Show file tree
Hide file tree
Showing 5 changed files with 75 additions and 19 deletions.
10 changes: 9 additions & 1 deletion pkg/httpflv/client_pull_session.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ func (session *PullSession) WaitChan() <-chan error {
return session.conn.Done()
}

// ---------------------------------------------------------------------------------------------------------------------
// ISessionUrlContext interface
// ---------------------------------------------------------------------------------------------------------------------

// Url 文档请参考: interface ISessionUrlContext
Expand All @@ -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) {
Expand Down
10 changes: 9 additions & 1 deletion pkg/rtmp/client_pull_session.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,8 @@ func (s *PullSession) WaitChan() <-chan error {
return s.core.WaitChan()
}

// ---------------------------------------------------------------------------------------------------------------------
// ISessionUrlContext interface
// ---------------------------------------------------------------------------------------------------------------------

// Url 文档请参考: interface ISessionUrlContext
Expand All @@ -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 {
Expand Down
10 changes: 9 additions & 1 deletion pkg/rtmp/client_push_session.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,8 @@ func (s *PushSession) WaitChan() <-chan error {
return s.core.WaitChan()
}

// ---------------------------------------------------------------------------------------------------------------------
// ISessionUrlContext interface
// ---------------------------------------------------------------------------------------------------------------------

// Url 文档请参考: interface ISessionUrlContext
Expand All @@ -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 {
Expand Down
32 changes: 24 additions & 8 deletions pkg/rtsp/client_pull_session.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,8 @@ func (session *PullSession) WaitChan() <-chan error {
return session.waitChan
}

// ---------------------------------------------------------------------------------------------------------------------
// ISessionUrlContext interface
// ---------------------------------------------------------------------------------------------------------------------

// Url 文档请参考: interface ISessionUrlContext
Expand All @@ -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 {
Expand All @@ -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() {
Expand Down
32 changes: 24 additions & 8 deletions pkg/rtsp/client_push_session.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,8 @@ func (session *PushSession) WaitChan() <-chan error {
return session.waitChan
}

// ---------------------------------------------------------------------------------------------------------------------
// ISessionUrlContext interface
// ---------------------------------------------------------------------------------------------------------------------

// Url 文档请参考: interface ISessionUrlContext
Expand All @@ -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 {
Expand All @@ -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() {
Expand Down

0 comments on commit 592dc3e

Please sign in to comment.