Versions in this module Expand all Collapse all v0 v0.0.2 Aug 24, 2023 v0.0.1 Aug 23, 2023 Changes in this version + const ANNOUNCE + const Accept + const AcceptEncoding + const AcceptLanguage + const Allow + const Authorization + const BAD_REQUEST + const Bandwidth + const Blocksize + const CSeq + const CacheControl + const Conference + const Connection + const ContentBase + const ContentEncoding + const ContentLanguage + const ContentLength + const ContentLocation + const ContentType + const DESCRIBE + const Date + const Expires + const From + const GET_PARAMETER + const IfModifiedSince + const Internal_Server_Error + const LastModified + const Location + const MODE_PLAY + const MODE_RECORD + const MOVED_Permanently + const MOVED_Temporarily + const Not_Found + const Not_Implemented + const OK + const OPTIONS + const PAUSE + const PLAY + const ProxyAuthenticate + const ProxyRequire + const Public + const RECORD + const REDIRECT + const RTPInfo + const RTSP_1_0 + const RTSP_2_0 + const Range + const Referer + const Require + const RetryAfter + const SETUP + const SET_PARAMETER + const STATE_Init + const STATE_Playing + const STATE_Ready + const STATE_Recording + const Scale + const Server + const Session + const Session_Not_Found + const Speed + const TEARDOWN + const Transport + const Unauthorized + const Unsupported + const Unsupported_Transport + const UserAgent + const Version_Not_Supported + const Via + const WWWAuthenticate + func GetEncodeNameByCodecId(cid RTSP_CODEC_ID) string + type ClientHandle interface + HandleAnnounce func(cli *RtspClient, res RtspResponse) error + HandleDescribe func(cli *RtspClient, res RtspResponse, sdp *sdp.Sdp, tracks map[string]*RtspTrack) error + HandleGetParameter func(cli *RtspClient, res RtspResponse) error + HandleOption func(cli *RtspClient, res RtspResponse, public []string) error + HandlePause func(cli *RtspClient, res RtspResponse) error + HandlePlay func(cli *RtspClient, res RtspResponse, timeRange *RangeTime, info *RtpInfo) error + HandleRecord func(cli *RtspClient, res RtspResponse, timeRange *RangeTime, info *RtpInfo) error + HandleRedirect func(cli *RtspClient, req RtspRequest, location string, timeRange *RangeTime) error + HandleRequest func(cli *RtspClient, req RtspRequest) error + HandleSetParameter func(cli *RtspClient, res RtspResponse) error + HandleSetup func(cli *RtspClient, res RtspResponse, currentTrack *RtspTrack, ...) error + HandleTeardown func(cli *RtspClient, res RtspResponse) error + type ClientOption func(cli *RtspClient) + func WithEnableRecord() ClientOption + type HeadFiled map[string]string + func (filed HeadFiled) Add(key string, value interface{}) + func (filed HeadFiled) Has(key string) bool + type LowerTransport int + const TCP + const UDP + type OnSampleCallBack func(sample RtspSample) + type OutPutCallBack func([]byte) error + type PacketCallBack func(b []byte, isRtcp bool) error + type RTSP_CODEC_ID int + const RTSP_CODEC_AAC + const RTSP_CODEC_G711A + const RTSP_CODEC_G711U + const RTSP_CODEC_H264 + const RTSP_CODEC_H265 + const RTSP_CODEC_PS + const RTSP_CODEC_TS + func GetCodecIdByEncodeName(name string) RTSP_CODEC_ID + type RangeTime struct + func (rt RangeTime) EncodeString() string + type RangeType int + const RANGE_NPT + const RANGE_UTC + type RtpInfo struct + Rtptime int64 + Seq uint16 + Url string + func NewRtpInfo(url string, seq uint16) *RtpInfo + func (info *RtpInfo) Decode(str string) + func (info *RtpInfo) EncodeString() string + type RtspClient struct + func NewRtspClient(uri string, handle ClientHandle, opt ...ClientOption) (*RtspClient, error) + func (client *RtspClient) AddTrack(track *RtspTrack) + func (client *RtspClient) EnableRTCP() + func (client *RtspClient) GetTrack(trackName string) (track *RtspTrack, found bool) + func (client *RtspClient) Input(data []byte) (err error) + func (client *RtspClient) KeepAlive(method string) error + func (client *RtspClient) Pause() (err error) + func (client *RtspClient) Play() + func (client *RtspClient) SessionDescribe() string + func (client *RtspClient) SetOutput(output OutPutCallBack) + func (client *RtspClient) SetRange(timeRange RangeTime) + func (client *RtspClient) SetScale(scale float32) + func (client *RtspClient) SetSessionDescribe(sdp *sdp.Sdp) + func (client *RtspClient) SetSpeed(speed float32) + func (client *RtspClient) Start() error + func (client *RtspClient) TearDown() (err error) + type RtspCodec struct + ChannelCount uint8 + Cid RTSP_CODEC_ID + PayloadType uint8 + SampleRate uint32 + func NewApplicatioCodec(name string, pt uint8) RtspCodec + func NewAudioCodec(name string, pt uint8, sampleRate uint32, channelCount int) RtspCodec + func NewCodec(name string, pt uint8, sampleRate uint32, channel uint8) RtspCodec + func NewVideoCodec(name string, pt uint8, sampleRate uint32) RtspCodec + type RtspRequest struct + Body string + Fileds HeadFiled + Method string + Uri string + Version int + func (req *RtspRequest) Encode() string + type RtspResponse struct + Body string + Fileds HeadFiled + Reason string + StatusCode int + Version int + func (res *RtspResponse) Encode() string + type RtspSample struct + Cid RTSP_CODEC_ID + Completed bool + Sample []byte + Timestamp uint32 + type RtspServer struct + func NewRtspServer(handle ServerHandle, opt ...ServerOption) *RtspServer + func (server *RtspServer) AddTrack(track *RtspTrack) + func (server *RtspServer) Input(data []byte) (err error) + func (server *RtspServer) SetOutput(output OutPutCallBack) + type RtspTrack struct + Codec RtspCodec + TrackName string + func NewAudioTrack(codec RtspCodec, opt ...TrackOption) *RtspTrack + func NewMetaTrack(codec RtspCodec, opt ...TrackOption) *RtspTrack + func NewVideoTrack(codec RtspCodec, opt ...TrackOption) *RtspTrack + func (track *RtspTrack) Bye() error + func (track *RtspTrack) EnableTCP() + func (track *RtspTrack) GetRtcpRecvContext() *rtcp.RtcpContext + func (track *RtspTrack) GetRtcpSendContext() *rtcp.RtcpContext + func (track *RtspTrack) GetTransport() *RtspTransport + func (track *RtspTrack) Input(data []byte, isRtcp bool) error + func (track *RtspTrack) OnPacket(f PacketCallBack) + func (track *RtspTrack) OnSample(onsample OnSampleCallBack) + func (track *RtspTrack) OpenTrack() + func (track *RtspTrack) ReceiveReport() error + func (track *RtspTrack) SendReport() error + func (track *RtspTrack) SetCodecParamHandle(handle sdp.FmtpCodecParamParser) + func (track *RtspTrack) SetExtraData(extra interface{}) + func (track *RtspTrack) SetTransport(transport *RtspTransport) + func (track *RtspTrack) SourceDescription(sdesType uint8, content string) error + func (track *RtspTrack) WriteSample(sample RtspSample) error + type RtspTransport struct + Client_ports [2]uint16 + Interleaved [2]int + IsMultiCast bool + Proto LowerTransport + Server_ports [2]uint16 + func NewRtspTransport(opt ...TransportOption) *RtspTransport + func (transport *RtspTransport) Decode(data []byte) error + func (transport *RtspTransport) DecodeString(data string) error + func (transport *RtspTransport) EncodeString() string + func (transport *RtspTransport) SetClientUdpPort(rtpPort uint16, rtcpPort uint16) + func (transport *RtspTransport) SetInterleaved(interleaved [2]int) + func (transport *RtspTransport) SetServerUdpPort(rtpPort uint16, rtcpPort uint16) + type ServerHandle interface + HandleAnnounce func(svr *RtspServer, req RtspRequest, tracks map[string]*RtspTrack) + HandleDescribe func(svr *RtspServer, req RtspRequest, res *RtspResponse) + HandleGetParameter func(svr *RtspServer, req RtspRequest, res *RtspResponse) + HandleOption func(svr *RtspServer, req RtspRequest, res *RtspResponse) + HandlePause func(svr *RtspServer, req RtspRequest, res *RtspResponse) + HandlePlay func(svr *RtspServer, req RtspRequest, res *RtspResponse, timeRange *RangeTime, ...) + HandleRecord func(svr *RtspServer, req RtspRequest, res *RtspResponse, timeRange *RangeTime, ...) + HandleResponse func(svr *RtspServer, res RtspResponse) + HandleSetParameter func(svr *RtspServer, req RtspRequest, res *RtspResponse) + HandleSetup func(svr *RtspServer, req RtspRequest, res *RtspResponse, transport *RtspTransport, ...) + HandleTeardown func(svr *RtspServer, req RtspRequest, res *RtspResponse) + type ServerOption func(*RtspServer) + func WithAuthType(authType string) ServerOption + func WithRealm(realm string) ServerOption + func WithUserInfo(userName, passwd string) ServerOption + type TrackCallBack func(track *RtspTrack) + type TrackOption func(t *RtspTrack) + func WithCodecParamHandler(handler sdp.FmtpCodecParamParser) TrackOption + func WithDisableRtcpRR() TrackOption + type TransportOption func(transport *RtspTransport) + func WithClientUdpPort(rtpPort uint16, rtcpPort uint16) TransportOption + func WithEnableUdp() TransportOption + func WithMode(mode string) TransportOption + func WithServerUdpPort(rtpPort uint16, rtcpPort uint16) TransportOption + func WithTcpInterleaved(interleaved [2]int) TransportOption