This commit is contained in:
aler9
2020-07-19 18:01:49 +02:00
parent 511d109e8d
commit e5d15bc157
6 changed files with 14 additions and 13 deletions

View File

@@ -20,10 +20,10 @@ func md5Hex(in string) string {
type AuthMethod int type AuthMethod int
const ( const (
// basic authentication method // Basic authentication method
Basic AuthMethod = iota Basic AuthMethod = iota
// digest authentication method // Digest authentication method
Digest Digest
) )

View File

@@ -316,7 +316,7 @@ func (c *ConnClient) setup(u *url.URL, media *sdp.MediaDescription, transport []
} }
// SetupUdp writes a SETUP request, that means that we want to read // SetupUdp writes a SETUP request, that means that we want to read
// a track with given media, id and the UDP transport. It then reads a Response. // a given track with the UDP transport. It then reads a Response.
func (c *ConnClient) SetupUdp(u *url.URL, track *Track, rtpPort int, func (c *ConnClient) SetupUdp(u *url.URL, track *Track, rtpPort int,
rtcpPort int) (int, int, *Response, error) { rtcpPort int) (int, int, *Response, error) {
@@ -343,7 +343,7 @@ func (c *ConnClient) SetupUdp(u *url.URL, track *Track, rtpPort int,
} }
// SetupTcp writes a SETUP request, that means that we want to read // SetupTcp writes a SETUP request, that means that we want to read
// a track with given media, given id and the TCP transport. It then reads a Response. // a given track with the TCP transport. It then reads a Response.
func (c *ConnClient) SetupTcp(u *url.URL, track *Track) (*Response, error) { func (c *ConnClient) SetupTcp(u *url.URL, track *Track) (*Response, error) {
interleaved := fmt.Sprintf("interleaved=%d-%d", (track.Id * 2), (track.Id*2)+1) interleaved := fmt.Sprintf("interleaved=%d-%d", (track.Id * 2), (track.Id*2)+1)

View File

@@ -11,8 +11,8 @@ const (
interleavedFrameMagicByte = 0x24 interleavedFrameMagicByte = 0x24
) )
// InterleavedFrame is an object that allows to send and receive binary data // InterleavedFrame is a structure that allows to transfer binary frames
// within RTSP connections. It is used to send RTP and RTCP packets via TCP. // through RTSP TCP connections. It is used to send RTP and RTCP packets via TCP.
type InterleavedFrame struct { type InterleavedFrame struct {
// track id // track id
TrackId int TrackId int

View File

@@ -13,9 +13,10 @@ const (
requestMaxProtocolLength = 128 requestMaxProtocolLength = 128
) )
// Method is a RTSP request method. // Method is the method of a RTSP request.
type Method string type Method string
// standard methods
const ( const (
ANNOUNCE Method = "ANNOUNCE" ANNOUNCE Method = "ANNOUNCE"
DESCRIBE Method = "DESCRIBE" DESCRIBE Method = "DESCRIBE"

View File

@@ -9,8 +9,8 @@ import (
// StatusCode is the status code of a RTSP response. // StatusCode is the status code of a RTSP response.
type StatusCode int type StatusCode int
// standard status codes
const ( const (
// standard status codes
StatusContinue StatusCode = 100 StatusContinue StatusCode = 100
StatusOK StatusCode = 200 StatusOK StatusCode = 200
StatusMovedPermanently StatusCode = 301 StatusMovedPermanently StatusCode = 301

View File

@@ -15,13 +15,13 @@ const (
type StreamProtocol int type StreamProtocol int
const ( const (
// invalid protocol // StreamProtocolInvalid is an invalid protocol
StreamProtocolInvalid StreamProtocol = iota StreamProtocolInvalid StreamProtocol = iota
// UDP protocol // StreamProtocolUdp means that the stream uses the UDP\ protocol
StreamProtocolUdp StreamProtocolUdp
// TCP protocol // StreamProtocolTcp means that the stream uses the TCP protocol
StreamProtocolTcp StreamProtocolTcp
) )
@@ -37,10 +37,10 @@ func (sp StreamProtocol) String() string {
type StreamType int type StreamType int
const ( const (
// stream that contains RTP packets // StreamTypeRtp means that the stream contains RTP packets
StreamTypeRtp StreamType = iota + 1 StreamTypeRtp StreamType = iota + 1
// stream that contains RTCP packets // StreamTypeRtp means that the stream contains RTCP packets
StreamTypeRtcp StreamTypeRtcp
) )