srtapi

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 3, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EUNKNOWN        = Errno(C.SRT_EUNKNOWN)
	SUCCESS         = Errno(C.SRT_SUCCESS)
	ECONNSETUP      = Errno(C.SRT_ECONNSETUP)
	ENOSERVER       = Errno(C.SRT_ENOSERVER)
	ECONNREJ        = Errno(C.SRT_ECONNREJ)
	ESOCKFAIL       = Errno(C.SRT_ESOCKFAIL)
	ESECFAIL        = Errno(C.SRT_ESECFAIL)
	ECONNFAIL       = Errno(C.SRT_ECONNFAIL)
	ECONNLOST       = Errno(C.SRT_ECONNLOST)
	ENOCONN         = Errno(C.SRT_ENOCONN)
	ERESOURCE       = Errno(C.SRT_ERESOURCE)
	ETHREAD         = Errno(C.SRT_ETHREAD)
	ENOBUF          = Errno(C.SRT_ENOBUF)
	EFILE           = Errno(C.SRT_EFILE)
	EINVRDOFF       = Errno(C.SRT_EINVRDOFF)
	ERDPERM         = Errno(C.SRT_ERDPERM)
	EINVWROFF       = Errno(C.SRT_EINVWROFF)
	EWRPERM         = Errno(C.SRT_EWRPERM)
	EINVOP          = Errno(C.SRT_EINVOP)
	EBOUNDSOCK      = Errno(C.SRT_EBOUNDSOCK)
	ECONNSOCK       = Errno(C.SRT_ECONNSOCK)
	EINVPARAM       = Errno(C.SRT_EINVPARAM)
	EINVSOCK        = Errno(C.SRT_EINVSOCK)
	EUNBOUNDSOCK    = Errno(C.SRT_EUNBOUNDSOCK)
	ENOLISTEN       = Errno(C.SRT_ENOLISTEN)
	ERDVNOSERV      = Errno(C.SRT_ERDVNOSERV)
	ERDVUNBOUND     = Errno(C.SRT_ERDVUNBOUND)
	EINVALMSGAPI    = Errno(C.SRT_EINVALMSGAPI)
	EINVALBUFFERAPI = Errno(C.SRT_EINVALBUFFERAPI)
	EDUPLISTEN      = Errno(C.SRT_EDUPLISTEN)
	ELARGEMSG       = Errno(C.SRT_ELARGEMSG)
	EINVPOLLID      = Errno(C.SRT_EINVPOLLID)
	EASYNCFAIL      = Errno(C.SRT_EASYNCFAIL)
	EASYNCSND       = Errno(C.SRT_EASYNCSND)
	EASYNCRCV       = Errno(C.SRT_EASYNCRCV)
	ETIMEOUT        = Errno(C.SRT_ETIMEOUT)
	ECONGEST        = Errno(C.SRT_ECONGEST)
	EPEERERR        = Errno(C.SRT_EPEERERR)
)

Errors

View Source
const (
	SizeofSockaddrAny   = _Socklen(unsafe.Sizeof(rsa))
	SizeofSockaddrInet4 = _Socklen(unsafe.Sizeof(rs4))
	SizeofSockaddrInet6 = _Socklen(unsafe.Sizeof(rs6))
)

Size of raw sock addr structures

View Source
const (
	StatusInit       = C.SRTS_INIT
	StatusOpened     = C.SRTS_OPENED
	StatusListening  = C.SRTS_LISTENING
	StatusConnecting = C.SRTS_CONNECTING
	StatusConnected  = C.SRTS_CONNECTED
	StatusBroken     = C.SRTS_BROKEN
	StatusClosing    = C.SRTS_CLOSING
	StatusClosed     = C.SRTS_CLOSED
	StatusNonexist   = C.SRTS_NONEXIST
)

SRT socket status

View Source
const (
	OptionMss                = C.SRTO_MSS
	OptionSndsyn             = C.SRTO_SNDSYN
	OptionRcvsyn             = C.SRTO_RCVSYN
	OptionIsn                = C.SRTO_ISN
	OptionFc                 = C.SRTO_FC
	OptionSndbuf             = C.SRTO_SNDBUF
	OptionRcvbuf             = C.SRTO_RCVBUF
	OptionLinger             = C.SRTO_LINGER
	OptionUDPSndbuf          = C.SRTO_UDP_SNDBUF
	OptionUDPRcvbuf          = C.SRTO_UDP_RCVBUF
	OptionRendezvous         = C.SRTO_RENDEZVOUS
	OptionSndtimeo           = C.SRTO_SNDTIMEO
	OptionRcvtimeo           = C.SRTO_RCVTIMEO
	OptionReuseaddr          = C.SRTO_REUSEADDR
	OptionMaxbw              = C.SRTO_MAXBW
	OptionState              = C.SRTO_STATE
	OptionEvent              = C.SRTO_EVENT
	OptionSnddata            = C.SRTO_SNDDATA
	OptionRcvdata            = C.SRTO_RCVDATA
	OptionSender             = C.SRTO_SENDER
	OptionTsbpdmode          = C.SRTO_TSBPDMODE
	OptionLatency            = C.SRTO_LATENCY
	OptionTsbpddelay         = C.SRTO_TSBPDDELAY
	OptionInputbw            = C.SRTO_INPUTBW
	OptionOheadbw            = C.SRTO_OHEADBW
	OptionPassphrase         = C.SRTO_PASSPHRASE
	OptionPbkeylen           = C.SRTO_PBKEYLEN
	OptionKmstate            = C.SRTO_KMSTATE
	OptionIpttl              = C.SRTO_IPTTL
	OptionIptos              = C.SRTO_IPTOS
	OptionTlpktdrop          = C.SRTO_TLPKTDROP
	OptionSnddropdelay       = C.SRTO_SNDDROPDELAY
	OptionNakreport          = C.SRTO_NAKREPORT
	OptionVersion            = C.SRTO_VERSION
	OptionPeerversion        = C.SRTO_PEERVERSION
	OptionConntimeo          = C.SRTO_CONNTIMEO
	OptionSndkmstate         = C.SRTO_SNDKMSTATE
	OptionRcvkmstate         = C.SRTO_RCVKMSTATE
	OptionLossmaxttl         = C.SRTO_LOSSMAXTTL
	OptionRcvlatency         = C.SRTO_RCVLATENCY
	OptionPeerlatency        = C.SRTO_PEERLATENCY
	OptionMinversion         = C.SRTO_MINVERSION
	OptionStreamid           = C.SRTO_STREAMID
	OptionCongestion         = C.SRTO_CONGESTION
	OptionMessageapi         = C.SRTO_MESSAGEAPI
	OptionPayloadsize        = C.SRTO_PAYLOADSIZE
	OptionTranstype          = C.SRTO_TRANSTYPE
	OptionKmrefreshrate      = C.SRTO_KMREFRESHRATE
	OptionKmpreannounce      = C.SRTO_KMPREANNOUNCE
	OptionEnforcedencryption = C.SRTO_ENFORCEDENCRYPTION
	OptionIpv60only          = C.SRTO_IPV6ONLY
	OptionPeeridletimeo      = C.SRTO_PEERIDLETIMEO
	OptionPacketfilter       = C.SRTO_PACKETFILTER
)

SRT socket options

View Source
const (
	TypeLive    = C.SRTT_LIVE
	TypeFile    = C.SRTT_FILE
	TypeInvalid = C.SRTT_INVALID
)

SRT trans type

View Source
const (
	LogEmerg   = 0
	LogAlert   = 1
	LogFatal   = 2
	LogError   = 3
	LogWarning = 4
	LogNote    = 5
	LogInfo    = 6
	LogDebug   = 7
)

SRT log level

View Source
const (
	LogFAGeneral = 0
	LogFABstats  = 1
	LogFAControl = 2
	LogFAData    = 3
	LogFATsbpd   = 4
	LogFARexmit  = 5
)

SRT log FA

View Source
const (
	LogFlagDisableTime       = 1
	LogFlagDisableThreadname = 2
	LogFlagDisableSeverity   = 4
	LogFlagDisableEOF        = 8
)

SRT log flags

View Source
const (
	EpollIn  = C.SRT_EPOLL_IN
	EpollOut = C.SRT_EPOLL_OUT
	EpollErr = C.SRT_EPOLL_ERR
	EpollEt  = C.SRT_EPOLL_ET
)

SRT epoll opt

View Source
const (
	InvalidSock          = -1
	APIError             = -1
	DefaultSendfileBlock = 364000
	DefaultRecvfileBlock = 7280000
)

SRT const

View Source
const (
	EpollEnableEmpty       = C.SRT_EPOLL_ENABLE_EMPTY
	EpollEnableOutputcheck = C.SRT_EPOLL_ENABLE_OUTPUTCHECK
)

SRT_EPOLL_FLAGS

Variables

This section is empty.

Functions

func Accept

func Accept(fd int) (nfd int, sa syscall.Sockaddr, err error)

Accept call srt_accept

func AddLogFA

func AddLogFA(fa int)

AddLogFA call srt_addlogfa

func Bind

func Bind(fd int, sa syscall.Sockaddr) (err error)

Bind call srt_bind

func Cleanup

func Cleanup() (err error)

Cleanup call srt_cleanup

func ClearLastError

func ClearLastError()

ClearLastError call srt_clearlasterror

func Close

func Close(fd int) (err error)

Close call srt_close

func Connect

func Connect(fd int, sa syscall.Sockaddr) (err error)

Connect call srt_connect

func EpollAddUsock

func EpollAddUsock(epfd int, fd int, events int) (err error)

EpollAddUsock call srt_epoll_add_usock

func EpollCreate

func EpollCreate() (epfd int, err error)

EpollCreate call srt_epoll_create

func EpollRemoveUsock

func EpollRemoveUsock(epfd int, fd int) (err error)

EpollRemoveUsock call srt_epoll_remove_usock

func EpollSet added in v0.2.0

func EpollSet(epfd int, flags int) (oflags int, err error)

EpollSet call srt_epoll_set

func EpollUpdateUsock

func EpollUpdateUsock(epfd int, fd int, events int) (err error)

EpollUpdateUsock call srt_epoll_update_usock

func EpollUwait added in v0.2.0

func EpollUwait(epfd int, fdsSet *SrtEpollEvent, fdsSize int, msTimeOut int64) (n int)

EpollUwait call srt_epoll_uwait

func EpollWait

func EpollWait(epfd int, rfds *SrtSocket, rfdslen *int, wfds *SrtSocket, wfdslen *int, timeout int64) (n int)

EpollWait call srt_epoll_wait

func GetEventsFromEpollEvent added in v0.2.0

func GetEventsFromEpollEvent(fds *SrtEpollEvent) int

GetEventsFromEpollEvent return events from SrtEpollEvent

func GetStats added in v0.2.0

func GetStats(fd int, clear bool) map[string]interface{}

func Getpeername

func Getpeername(fd int) (sa syscall.Sockaddr, err error)

Getpeername call srt_getpeername

func GetsockflagInt added in v0.2.0

func GetsockflagInt(fd, opt int) (value int, err error)

GetsockflagInt call srt_getsockflag

func GetsockflagString added in v0.2.0

func GetsockflagString(fd, opt int) (string, error)

GetsockflagString returns the string value of the socket flag for the socket associated with a fd

func Getsockname

func Getsockname(fd int) (sa syscall.Sockaddr, err error)

Getsockname call srt_getsockname

func GetsockoptInt

func GetsockoptInt(fd, level, opt int) (value int, err error)

GetsockoptInt call srt_getsockopt

func GetsockoptString

func GetsockoptString(fd, level, opt int) (string, error)

GetsockoptString returns the string value of the socket option opt for the socket associated with fd at the given socket level.

func Listen

func Listen(s int, n int) (err error)

Listen call srt_listen

func Read

func Read(fd int, p []byte) (n int, err error)

Read call srt_recv

func Sendfile

func Sendfile(outfd int, r io.Reader, offset *int64, count int) (written int, err error)

func SetLogFlags

func SetLogFlags(flags int)

SetLogFlags call srt_setlogflags

func SetLogLevel

func SetLogLevel(level int)

SetLogLevel call srt_setloglevel

func SetNonblock

func SetNonblock(fd int, nonblocking bool) (err error)

SetNonblock set non-blocking mode

func SetsockflagBool added in v0.2.0

func SetsockflagBool(fd, opt int, value bool) (err error)

SetsockflagBool call srt_setsockopt

func SetsockflagByte added in v0.2.0

func SetsockflagByte(fd, opt int, value byte) (err error)

SetsockflagByte call srt_setsockopt

func SetsockflagInt added in v0.2.0

func SetsockflagInt(fd, opt int, value int) (err error)

SetsockflagInt call srt_setsockopt

func SetsockflagInt64 added in v0.2.0

func SetsockflagInt64(fd, opt int, value int64) (err error)

SetsockflagInt64 call srt_setsockopt

func SetsockflagString added in v0.2.0

func SetsockflagString(fd, opt int, s string) (err error)

SetsockflagString call srt_setsockopt

func SetsockoptBool

func SetsockoptBool(fd, level, opt int, value bool) (err error)

SetsockoptBool call srt_setsockopt

func SetsockoptByte

func SetsockoptByte(fd, level, opt int, value byte) (err error)

SetsockoptByte call srt_setsockopt

func SetsockoptInt

func SetsockoptInt(fd, level, opt int, value int) (err error)

SetsockoptInt call srt_setsockopt

func SetsockoptInt64

func SetsockoptInt64(fd, level, opt int, value int64) (err error)

SetsockoptInt64 call srt_setsockopt

func SetsockoptString

func SetsockoptString(fd, level, opt int, s string) (err error)

SetsockoptString call srt_setsockopt

func Socket

func Socket(domain, typ, proto int) (fd int, err error)

Socket call srt_socket

func Startup

func Startup() (err error)

Startup call srt_startup

func Write

func Write(fd int, p []byte) (n int, err error)

Write call srt_send

Types

type Errno

type Errno int

An Errno is an number describing an error condition.

func (Errno) Error

func (e Errno) Error() string

func (Errno) Temporary

func (e Errno) Temporary() bool

Temporary return if it is temprary error

func (Errno) Timeout

func (e Errno) Timeout() bool

Timeout return if it is timeout error

type SrtEpollEvent added in v0.2.0

type SrtEpollEvent C.SRT_EPOLL_EVENT

SrtEpollEvent represent SRT C API SRT_EPOLL_EVENT structure

type SrtSocket

type SrtSocket C.SRTSOCKET

SrtSocket represents SRT C API SRTSOCKET type

func GetFdFromEpollEvent added in v0.2.0

func GetFdFromEpollEvent(fds *SrtEpollEvent) SrtSocket

GetFdFromEpollEvent return fd from SrtEpollEvent

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL