Documentation ¶
Overview ¶
Package base contains the primitives of the RTSP protocol.
Index ¶
Constants ¶
const (
// InterleavedFrameMagicByte is the first byte of an interleaved frame.
InterleavedFrameMagicByte = 0x24
)
Variables ¶
var StatusMessages = statusMessages
StatusMessages contains the status messages associated with each status code.
Functions ¶
func PathSplitQuery ¶
PathSplitQuery splits a path from a query.
Types ¶
type Header ¶
type Header map[string]HeaderValue
Header is a RTSP reader, present in both Requests and Responses.
type InterleavedFrame ¶
InterleavedFrame is an interleaved frame, and allows to transfer binary data within RTSP/TCP connections. It is used to send and receive RTP and RTCP packets with TCP.
func (InterleavedFrame) Marshal ¶
func (f InterleavedFrame) Marshal() ([]byte, error)
Marshal writes an InterleavedFrame.
func (InterleavedFrame) MarshalSize ¶
func (f InterleavedFrame) MarshalSize() int
MarshalSize returns the size of an InterleavedFrame.
type Method ¶
type Method string
Method is the method of a RTSP request.
const ( Announce Method = "ANNOUNCE" Describe Method = "DESCRIBE" GetParameter Method = "GET_PARAMETER" Options Method = "OPTIONS" Pause Method = "PAUSE" Play Method = "PLAY" Record Method = "RECORD" Setup Method = "SETUP" SetParameter Method = "SET_PARAMETER" Teardown Method = "TEARDOWN" )
methods.
type Request ¶
type Request struct { // request method Method Method // request url URL *URL // map of header values Header Header // optional body Body []byte }
Request is a RTSP request.
func (Request) MarshalSize ¶
MarshalSize returns the size of a Request.
type Response ¶
type Response struct { // numeric status code StatusCode StatusCode // status message StatusMessage string // map of header values Header Header // optional body Body []byte }
Response is a RTSP response.
func (Response) MarshalSize ¶
MarshalSize returns the size of a Response.
type StatusCode ¶
type StatusCode int
StatusCode is the status code of a RTSP response.
const ( StatusContinue StatusCode = 100 StatusOK StatusCode = 200 StatusMovedPermanently StatusCode = 301 StatusFound StatusCode = 302 StatusSeeOther StatusCode = 303 StatusNotModified StatusCode = 304 StatusUseProxy StatusCode = 305 StatusBadRequest StatusCode = 400 StatusPaymentRequired StatusCode = 402 StatusForbidden StatusCode = 403 StatusNotFound StatusCode = 404 StatusMethodNotAllowed StatusCode = 405 StatusNotAcceptable StatusCode = 406 StatusProxyAuthRequired StatusCode = 407 StatusRequestTimeout StatusCode = 408 StatusGone StatusCode = 410 StatusPreconditionFailed StatusCode = 412 StatusRequestEntityTooLarge StatusCode = 413 StatusRequestURITooLong StatusCode = 414 StatusUnsupportedMediaType StatusCode = 415 StatusParameterNotUnderstood StatusCode = 451 StatusNotEnoughBandwidth StatusCode = 453 StatusSessionNotFound StatusCode = 454 StatusMethodNotValidInThisState StatusCode = 455 StatusHeaderFieldNotValidForResource StatusCode = 456 StatusInvalidRange StatusCode = 457 StatusParameterIsReadOnly StatusCode = 458 StatusAggregateOperationNotAllowed StatusCode = 459 StatusOnlyAggregateOperationAllowed StatusCode = 460 StatusUnsupportedTransport StatusCode = 461 StatusDestinationUnreachable StatusCode = 462 StatusDestinationProhibited StatusCode = 463 StatusDataTransportNotReadyYet StatusCode = 464 StatusNotificationReasonUnknown StatusCode = 465 StatusKeyManagementError StatusCode = 466 StatusConnectionAuthorizationRequired StatusCode = 470 StatusConnectionCredentialsNotAccepted StatusCode = 471 StatusFailureToEstablishSecureConnection StatusCode = 472 StatusInternalServerError StatusCode = 500 StatusNotImplemented StatusCode = 501 StatusBadGateway StatusCode = 502 StatusGatewayTimeout StatusCode = 504 StatusRTSPVersionNotSupported StatusCode = 505 StatusOptionNotSupported StatusCode = 551 )
status codes.
type URL ¶
URL is a RTSP URL. This is basically an HTTP URL with some additional functions to handle control attributes.
func (*URL) CloneWithoutCredentials ¶
CloneWithoutCredentials clones a URL without its credentials.
func (*URL) Hostname ¶
Hostname returns u.Host, stripping any valid port number if present.
If the result is enclosed in square brackets, as literal IPv6 addresses are, the square brackets are removed from the result.
func (*URL) Port ¶
Port returns the port part of u.Host, without the leading colon.
If u.Host doesn't contain a valid numeric port, Port returns an empty string.
func (*URL) RTSPPathAndQuery ¶
RTSPPathAndQuery returns the path and query of a RTSP URL.