Versions in this module Expand all Collapse all v0 v0.0.1 Dec 8, 2023 Changes in this version + const AuthAlgorithm + const AuthTypeBasic + const AuthTypeDigest + const HeaderAccept + const HeaderAcceptApplicationSdp + const HeaderAuthorization + const HeaderCSeq + const HeaderContentLength + const HeaderPublic + const HeaderRange + const HeaderRangeDefault + const HeaderSession + const HeaderTransport + const HeaderTransportClientPlayTcpTmpl + const HeaderTransportClientPlayTmpl + const HeaderTransportClientRecordTcpTmpl + const HeaderTransportClientRecordTmpl + const HeaderTransportServerPlayTmpl + const HeaderTransportServerRecordTmpl + const HeaderUserAgent + const HeaderWwwAuthenticate + const Interleaved + const MethodAnnounce + const MethodDescribe + const MethodGetParameter + const MethodOptions + const MethodPlay + const MethodRecord + const MethodSetup + const MethodTeardown + const RtspOptionsResponseServer + const RtspRealm + const TransportFieldClientPort + const TransportFieldInterleaved + const TransportFieldServerPort + var ResponseAnnounceTmpl = ... + var ResponseAuthorizedTmpl = ... + var ResponseDescribeTmpl = ... + var ResponseErrorCodeTmpl = ... + var ResponseGetParameterTmpl = ... + var ResponseOptionsTmpl = ... + var ResponsePlayTmpl = ... + var ResponseRecordTmpl = ... + var ResponseSetupTmpl = ... + var ResponseTeardownTmpl = ... + func PackRequest(method, uri string, headers map[string]string, body string) (ret string) + func PackResponseAnnounce(cseq string) string + func PackResponseAuthorized(cseq, authenticate string) string + func PackResponseDescribe(cseq, sdp string) string + func PackResponseError(errorCode uint, errorReason, cseq string) string + func PackResponseGetParameter(cseq string) string + func PackResponseOptions(cseq string) string + func PackResponsePlay(cseq string) string + func PackResponseRecord(cseq string, sessionId string) string + func PackResponseSetup(cseq string, htv string, sessionId string) string + func PackResponseTeardown(cseq string) string + type Auth struct + Algorithm string + Nonce string + Opaque string + Password string + Realm string + Response string + Stale string + Typ string + Uri string + Username string + func (a *Auth) CheckAuthorization(method, username, password string) bool + func (a *Auth) FeedWwwAuthenticate(auths []string, username, password string) + func (a *Auth) MakeAuthenticate(method string) string + func (a *Auth) MakeAuthorization(method, uri string) string + func (a *Auth) ParseAuthorization(authStr string) (err error) + type AvPacketQueue struct + func NewAvPacketQueue(onAvPacket OnAvPacket) *AvPacketQueue + func (a *AvPacketQueue) Feed(pkt media.AvPacket) + func (a *AvPacketQueue) PopAllByForce() + type BaseInSession struct + func NewBaseInSession(sessionType rtsp_base.SessionType, ...) *BaseInSession + func NewBaseInSessionWithObserver(sessionType rtsp_base.SessionType, ...) *BaseInSession + func (session *BaseInSession) Dispose() error + func (session *BaseInSession) GetSdp() sdp.LogicContext + func (session *BaseInSession) GetStat() rtsp_base.StatSession + func (session *BaseInSession) HandleInterleavedPacket(b []byte, channel int) + func (session *BaseInSession) InitWithSdp(sdpCtx sdp.LogicContext) + func (session *BaseInSession) IsAlive() (readAlive, writeAlive bool) + func (session *BaseInSession) SetObserver(observer IBaseInSessionObserver) + func (session *BaseInSession) SetupWithChannel(uri string, rtpChannel, rtcpChannel int) error + func (session *BaseInSession) SetupWithConn(uri string, rtpConn, rtcpConn *netUdp.UdpConnection) error + func (session *BaseInSession) UniqueKey() string + func (session *BaseInSession) UpdateStat(intervalSec uint32) + func (session *BaseInSession) WaitChan() <-chan error + func (session *BaseInSession) WriteRtpRtcpDummy() + type BaseOutSession struct + func NewBaseOutSession(sessionType rtsp_base.SessionType, ...) *BaseOutSession + func (session *BaseOutSession) Dispose() error + func (session *BaseOutSession) GetStat() rtsp_base.StatSession + func (session *BaseOutSession) HandleInterleavedPacket(b []byte, channel int) + func (session *BaseOutSession) InitWithSdp(sdpCtx sdp.LogicContext) + func (session *BaseOutSession) IsAlive() (readAlive, writeAlive bool) + func (session *BaseOutSession) SetupWithChannel(uri string, rtpChannel, rtcpChannel int) error + func (session *BaseOutSession) SetupWithConn(uri string, rtpConn, rtcpConn *netUdp.UdpConnection) error + func (session *BaseOutSession) UniqueKey() string + func (session *BaseOutSession) UpdateStat(intervalSec uint32) + func (session *BaseOutSession) WaitChan() <-chan error + func (session *BaseOutSession) WriteRtpPacket(packet rtprtcp.RTPPacket) error + type ClientRtspSession struct + func NewClientRtspSession(t ClientRtspSessionType, uniqueKey string, observer IClientRtspSessionObserver, ...) *ClientRtspSession + func (session *ClientRtspSession) AppName() string + func (session *ClientRtspSession) Dispose() error + func (session *ClientRtspSession) Do(rawUrl string) error + func (session *ClientRtspSession) InitWithSdp(sdpCtx sdp.LogicContext) + func (session *ClientRtspSession) RawQuery() string + func (session *ClientRtspSession) RemoteAddr() string + func (session *ClientRtspSession) StreamName() string + func (session *ClientRtspSession) UniqueKey() string + func (session *ClientRtspSession) Url() string + func (session *ClientRtspSession) WaitChan() <-chan error + func (session *ClientRtspSession) WriteInterleavedPacket(packet []byte, channel int) error + type ClientRtspSessionOption struct + DoTimeoutMs int + OverTcp bool + type ClientRtspSessionType int + const CcstPullSession + const CcstPushSession + type IBaseInSessionObserver interface + OnAvPacket func(pkt media.AvPacket) + OnRtpPacket func(pkt rtprtcp.RTPPacket) + OnSdp func(sdpCtx sdp.LogicContext) + type IClientRtspSessionObserver interface + OnConnectResult func() + OnDescribeResponse func(sdpCtx sdp.LogicContext) + OnInterleavedPacket func(packet []byte, channel int) + OnSetupResult func() + OnSetupWithChannel func(uri string, rtpChannel, rtcpChannel int) + OnSetupWithConn func(uri string, rtpConn, rtcpConn *netUdp.UdpConnection) + type IInterleavedPacketWriter interface + WriteInterleavedPacket func(packet []byte, channel int) error + type IPubSessionObserver interface + type IPullSessionObserver interface + type IRtspServerObserver interface + OnDelRtspPubSession func(session *PubSession) + OnDelRtspSession func(session *ServerRTSPSession) + OnDelRtspSubSession func(session *SubSession) + OnNewRtspPubSession func(session *PubSession) error + OnNewRtspSessionConnect func(session *ServerRTSPSession) + OnNewRtspSubSessionDescribe func(session *SubSession) (err error, sdp []byte) + OnNewRtspSubSessionPlay func(session *SubSession) error + type IServerRtspSessionObserver interface + OnNewRtspPubSession func(session *PubSession) error + OnNewRtspSubSessionDescribe func(session *SubSession) (err error, sdp []byte) + OnNewRtspSubSessionPlay func(session *SubSession) error + type ModClientRtspSessionOption func(option *ClientRtspSessionOption) + type ModPullSessionOption func(option *PullSessionOption) + type ModPushSessionOption func(option *PushSessionOption) + type OnAvPacket func(pkt media.AvPacket) + type PubSession struct + func NewPubSession(urlCtx httpUtils.UrlContext, rtspSession *ServerRTSPSession) *PubSession + func (session *PubSession) AppName() string + func (session *PubSession) Dispose() error + func (session *PubSession) GetSdp() sdp.LogicContext + func (session *PubSession) GetStat() rtsp_base.StatSession + func (session *PubSession) HandleInterleavedPacket(b []byte, channel int) + func (session *PubSession) InitWithSdp(sdpCtx sdp.LogicContext) + func (session *PubSession) IsAlive() (readAlive, writeAlive bool) + func (session *PubSession) RawQuery() string + func (session *PubSession) SetObserver(observer IPubSessionObserver) + func (session *PubSession) SetupWithChannel(uri string, rtpChannel, rtcpChannel int) error + func (session *PubSession) SetupWithConn(uri string, rtpConn, rtcpConn *netUdp.UdpConnection) error + func (session *PubSession) StreamName() string + func (session *PubSession) UniqueKey() string + func (session *PubSession) UpdateStat(intervalSec uint32) + func (session *PubSession) Url() string + func (session *PubSession) WriteInterleavedPacket(packet []byte, channel int) error + type PullSession struct + func NewPullSession(observer IPullSessionObserver, modOptions ...ModPullSessionOption) *PullSession + func (session *PullSession) AppName() string + func (session *PullSession) Dispose() error + func (session *PullSession) GetSdp() sdp.LogicContext + func (session *PullSession) GetStat() rtsp_base.StatSession + func (session *PullSession) IsAlive() (readAlive, writeAlive bool) + func (session *PullSession) OnConnectResult() + func (session *PullSession) OnDescribeResponse(sdpCtx sdp.LogicContext) + func (session *PullSession) OnInterleavedPacket(packet []byte, channel int) + func (session *PullSession) OnSetupResult() + func (session *PullSession) OnSetupWithChannel(uri string, rtpChannel, rtcpChannel int) + func (session *PullSession) OnSetupWithConn(uri string, rtpConn, rtcpConn *netUdp.UdpConnection) + func (session *PullSession) Pull(rawUrl string) error + func (session *PullSession) RawQuery() string + func (session *PullSession) StreamName() string + func (session *PullSession) UniqueKey() string + func (session *PullSession) UpdateStat(intervalSec uint32) + func (session *PullSession) Url() string + func (session *PullSession) WaitChan() <-chan error + func (session *PullSession) WithOnDescribeResponse(onDescribeResponse func()) *PullSession + func (session *PullSession) WriteInterleavedPacket(packet []byte, channel int) error + type PullSessionOption struct + OverTcp bool + PullTimeoutMs int + type PushSession struct + func NewPushSession(modOptions ...ModPushSessionOption) *PushSession + func (session *PushSession) AppName() string + func (session *PushSession) Dispose() error + func (session *PushSession) GetStat() rtsp_base.StatSession + func (session *PushSession) IsAlive() (readAlive, writeAlive bool) + func (session *PushSession) OnConnectResult() + func (session *PushSession) OnDescribeResponse(sdpCtx sdp.LogicContext) + func (session *PushSession) OnInterleavedPacket(packet []byte, channel int) + func (session *PushSession) OnSetupResult() + func (session *PushSession) OnSetupWithChannel(uri string, rtpChannel, rtcpChannel int) + func (session *PushSession) OnSetupWithConn(uri string, rtpConn, rtcpConn *netUdp.UdpConnection) + func (session *PushSession) Push(rawUrl string, sdpCtx sdp.LogicContext) error + func (session *PushSession) RawQuery() string + func (session *PushSession) StreamName() string + func (session *PushSession) UniqueKey() string + func (session *PushSession) UpdateStat(intervalSec uint32) + func (session *PushSession) Url() string + func (session *PushSession) WaitChan() <-chan error + func (session *PushSession) WriteInterleavedPacket(packet []byte, channel int) error + func (session *PushSession) WriteRtpPacket(packet rtprtcp.RTPPacket) error + type PushSessionOption struct + OverTcp bool + PushTimeoutMs int + type Server struct + func NewServer(addr string, observer IRtspServerObserver, auth ServerAuthConfig) *Server + func (s *Server) Dispose() + func (s *Server) Listen() (err error) + func (s *Server) ListenWithTLS(certFile, keyFile string) (err error) + func (s *Server) OnDelRtspPubSession(session *PubSession) + func (s *Server) OnDelRtspSubSession(session *SubSession) + func (s *Server) OnNewRtspPubSession(session *PubSession) error + func (s *Server) OnNewRtspSubSessionDescribe(session *SubSession) (err error, sdp []byte) + func (s *Server) OnNewRtspSubSessionPlay(session *SubSession) error + func (s *Server) RunLoop() error + type ServerAuthConfig struct + AuthEnable bool + AuthMethod int + PassWord string + UserName string + type ServerRTSPSession struct + func NewServerRTSPSession(observer IServerRtspSessionObserver, conn net.Conn, authConf ServerAuthConfig) *ServerRTSPSession + func (session *ServerRTSPSession) Dispose() error + func (session *ServerRTSPSession) FeedSdp(b []byte) + func (session *ServerRTSPSession) GetStat() rtsp_base.StatSession + func (session *ServerRTSPSession) IsAlive() (readAlive, writeAlive bool) + func (session *ServerRTSPSession) RemoteAddr() string + func (session *ServerRTSPSession) RunLoop() error + func (session *ServerRTSPSession) UniqueKey() string + func (session *ServerRTSPSession) UpdateStat(intervalSec uint32) + func (session *ServerRTSPSession) WriteInterleavedPacket(packet []byte, channel int) error + type SubSession struct + ShouldWaitVideoKeyFrame bool + func NewSubSession(urlCtx httpUtils.UrlContext, rtspSession *ServerRTSPSession) *SubSession + func (session *SubSession) AppName() string + func (session *SubSession) Dispose() error + func (session *SubSession) FeedSdp(sdpCtx sdp.LogicContext) + func (session *SubSession) GetQuery(key string) string + func (session *SubSession) GetStat() rtsp_base.StatSession + func (session *SubSession) HandleInterleavedPacket(b []byte, channel int) + func (session *SubSession) InitWithSdp(sdpCtx sdp.LogicContext) + func (session *SubSession) IsAlive() (readAlive, writeAlive bool) + func (session *SubSession) RawQuery() string + func (session *SubSession) SetupWithChannel(uri string, rtpChannel, rtcpChannel int) error + func (session *SubSession) SetupWithConn(uri string, rtpConn, rtcpConn *netUdp.UdpConnection) error + func (session *SubSession) StreamName() string + func (session *SubSession) UniqueKey() string + func (session *SubSession) UpdateStat(intervalSec uint32) + func (session *SubSession) Url() string + func (session *SubSession) WriteInterleavedPacket(packet []byte, channel int) error + func (session *SubSession) WriteRtpPacket(packet rtprtcp.RTPPacket)