Documentation ¶
Overview ¶
Package base contains the primitives of the RTSP protocol.
Index ¶
- Variables
- func PathSplitQuery(pathAndQuery string) (string, string)
- func ReadInterleavedFrameOrRequest(frame *InterleavedFrame, req *Request, br *bufio.Reader) (interface{}, error)
- func ReadInterleavedFrameOrResponse(frame *InterleavedFrame, res *Response, br *bufio.Reader) (interface{}, error)
- type Header
- type HeaderValue
- type InterleavedFrame
- type Method
- type Request
- type Response
- type StatusCode
- type URL
Constants ¶
This section is empty.
Variables ¶
var StatusMessages = statusMessages
StatusMessages contains the status messages associated with each status code.
Functions ¶
func PathSplitQuery ¶
PathSplitQuery splits a path from a query.
func ReadInterleavedFrameOrRequest ¶
func ReadInterleavedFrameOrRequest(frame *InterleavedFrame, req *Request, br *bufio.Reader) (interface{}, error)
ReadInterleavedFrameOrRequest reads an InterleavedFrame or a Response.
func ReadInterleavedFrameOrResponse ¶
func ReadInterleavedFrameOrResponse(frame *InterleavedFrame, res *Response, br *bufio.Reader) (interface{}, error)
ReadInterleavedFrameOrResponse reads an InterleavedFrame or a Response.
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) Read ¶
func (f *InterleavedFrame) Read(br *bufio.Reader) error
Read reads an interleaved frame.
func (InterleavedFrame) Write ¶
func (f InterleavedFrame) Write(bb *bytes.Buffer)
Write writes an InterleavedFrame into a buffered writer.
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" )
standard 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) ReadIgnoreFrames ¶
ReadIgnoreFrames reads a request and ignores any interleaved frame sent before the 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) ReadIgnoreFrames ¶
ReadIgnoreFrames reads a response and ignores any interleaved frame sent before the 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 )
standard 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) RTSPPathAndQuery ¶
RTSPPathAndQuery returns the path and query of a RTSP URL.