Documentation
¶
Index ¶
- Constants
- func SdpErrFmt(errCode, errStr string) string
- func SplitLines(s *string) *[]Line
- func UInt(s string) uint
- type AVMedia
- type Candidate
- type Connection
- type DTLS
- type DataChannel
- type ExtMap
- type ICE
- type Line
- func (l *Line) Append(format string, a ...interface{})
- func (l *Line) AppendIfHas(flag interface{}, format string, a ...interface{})
- func (l *Line) Decode(format string, a ...interface{}) (errStr string)
- func (l *Line) DecodeIfHas(flag, format string, a ...interface{}) (errStr string)
- func (l *Line) Has(subStr string) bool
- func (l *Line) Str() string
- type MediaBase
- type Origin
- type RTCP
- type RTP
- type SCTPMAP
- type SDP
- type SSRC
- type TIME
Constants ¶
View Source
const ( CAND_UDP = "udp" CAND_TCP = "tcp" )
candidate
View Source
const ( CAND_RTP = "rtp" CAND_RTCP = "rctp" )
View Source
const ( CAND_HOST = "host" CAND_SRFLX = "srflx" CAND_RELAY = "relay" )
View Source
const ( MEDIA_UNKNOWN = "" MEDIA_AUDIO = "m=audio" MEDIA_VIDEO = "m=video" MEDIA_DATA_CHAN = "m=application" )
View Source
const (
CAND_TCP_ACTIVE = "active"
)
View Source
const (
DTLS_SHA256 = "sha-256"
)
View Source
const (
SDP_ERR_NONE = ""
)
Variables ¶
This section is empty.
Functions ¶
func SplitLines ¶
Types ¶
type AVMedia ¶
type Candidate ¶
type Candidate struct {
ID uint //candidate id
TransType string //1 rtp 2 rtcp
Proto string //udp tcp
Priority uint //priority, webrtc use bigger one
IP net.IP //ip
Port uint //port
HostType string //typ host(p2p) typ srflx(stun) typ relay(turn)
TcpType string //tcptype e.g. active
RAddr net.IP //used by turn or stun
RPort uint //used by turn or stun
Generation string //generation
IsEnd bool //a=end-of-candidates
}
type Connection ¶
c=<nettype> <addrtype> <connection-address>
type DTLS ¶
type DataChannel ¶
type DataChannel struct {
MediaBase
SctpMap SCTPMAP
//a=sctp-port:5000
//a=max-message-size:100000
SctpPort int
MaxMsgSize int
}
func (*DataChannel) Decode ¶
func (m *DataChannel) Decode(l *Line) (errStr string)
func (*DataChannel) Encode ¶
func (m *DataChannel) Encode(l *Line)
type ICE ¶
type ICE struct {
Cands []*Candidate //ICE candidates
Ufrag string //ICE ufrag
Pwd string //ICE pwd
Options string //ICE options e.g. trikle
Identity string //https://tools.ietf.org/html/draft-ietf-rtcweb-security-arch-14#section-5.6.4.2
}
type MediaBase ¶
type MediaBase struct {
//m=...
Type string //media type, audio video data ...
Port string //transport port
Proto string //transport protocol
Format string //for DataChannel , audio video use rtpmap
//c=...
ConnData Connection //connection
//a=rtcp:1 IN IP4 0.0.0.0
Rtcp RTCP //rtcp
RtcpRsize bool
//a=sendrecv
Mode string //sendonly recvonly sendrecv
//a=rtcp-mux
RtcpMux bool //rtp and rtcp can use the same port
RtcpMuxOnly bool //rtp and rtcp can use the same port only
BundleOnly bool //a=bundle-only
Ice ICE //ICE
Dtls DTLS //DTLS
Mid string //mid
//如果ssrc>1才会有这行 =1不会有这行
//a=ssrc-group:FID 2231627014 632943048
// SSRCFIDS []string //ssrc group fid array
SSRCS map[string]*SSRC //Synchronisation Source
MsID string //firefox webrtc media stream id
}
func (*MediaBase) DecodeDTLSFinger ¶
type Origin ¶
type Origin struct {
UserName string
SessID string
SessVersion string
NetType string
AddrType string
Address string
}
o=<username> <sess-id> <sess-version> <nettype> <addrtype> <unicast-address>
type RTP ¶
e.g. a=rtpmap:111 opus/48000/2 a=rtcp-fb:111 transport-cc a=fmtp:111 minptime=10; useinbandfec=1 a=rtpmap:103 ISAC/16000 a=rtpmap:104 ISAC/32000 a=rtpmap:9 G722/8000 a=rtpmap:0 PCMU/8000 a=rtpmap:8 PCMA/8000 a=rtpmap:106 CN/32000 a=rtpmap:105 CN/16000 a=rtpmap:13 CN/8000 a=rtpmap:126 telephone-event/8000
type SCTPMAP ¶
a=sctpmap:50000 webrtc-datachannel 1024 a=sctpmap:sctpmap-number app [max-message-size] [streams]
type SDP ¶
type SDP struct {
Version uint //v= (protocol version, must be 0)
Origin Origin //o= (originator and session identifier)
SessName string //s= (session name)
ConnInfo string //c=* (connection information -- not required if included in all media)
Time TIME //t= (time the session is active)
GroupBundle [3]string //a=group:BUNDLE audio video data (audio video use same port)
GroupLS [2]string //a=group:LS audio video (mid1 mid2)
// LS
IceTrickle bool //a=ice-options:trickle
Identity string //a=identity:...
MsIDSema string //a=msid-semantic: WMS ...(webrtc media stream id semantic)
//Media
Medias []media
}
func (*SDP) DecodeGlobal ¶
func (*SDP) EncodeGlobal ¶
func (*SDP) EncodeMedia ¶
Click to show internal directories.
Click to hide internal directories.