gstrtsp

package
v0.0.0-...-ccbbe8a Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2023 License: MPL-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const RTSP_DEFAULT_PORT = 554

RTSP_DEFAULT_PORT: default RTSP port to connect to.

Variables

View Source
var (
	GTypeRTSPAuthMethod  = coreglib.Type(C.gst_rtsp_auth_method_get_type())
	GTypeRTSPFamily      = coreglib.Type(C.gst_rtsp_family_get_type())
	GTypeRTSPHeaderField = coreglib.Type(C.gst_rtsp_header_field_get_type())
	GTypeRTSPResult      = coreglib.Type(C.gst_rtsp_result_get_type())
	GTypeRTSPState       = coreglib.Type(C.gst_rtsp_state_get_type())
	GTypeRTSPStatusCode  = coreglib.Type(C.gst_rtsp_status_code_get_type())
	GTypeRTSPVersion     = coreglib.Type(C.gst_rtsp_version_get_type())
	GTypeRTSPEvent       = coreglib.Type(C.gst_rtsp_event_get_type())
	GTypeRTSPMethod      = coreglib.Type(C.gst_rtsp_method_get_type())
)

GType values.

View Source
var (
	GTypeRTSPMsgType = coreglib.Type(C.gst_rtsp_msg_type_get_type())
	GTypeRTSPMessage = coreglib.Type(C.gst_rtsp_msg_get_type())
)

GType values.

View Source
var (
	GTypeRTSPAuthCredential = coreglib.Type(C.gst_rtsp_auth_credential_get_type())
	GTypeRTSPAuthParam      = coreglib.Type(C.gst_rtsp_auth_param_get_type())
)

GType values.

View Source
var (
	GTypeRTSPRangeUnit = coreglib.Type(C.gst_rtsp_range_unit_get_type())
	GTypeRTSPTimeType  = coreglib.Type(C.gst_rtsp_time_type_get_type())
)

GType values.

View Source
var (
	GTypeRTSPLowerTrans = coreglib.Type(C.gst_rtsp_lower_trans_get_type())
	GTypeRTSPProfile    = coreglib.Type(C.gst_rtsp_profile_get_type())
	GTypeRTSPTransMode  = coreglib.Type(C.gst_rtsp_trans_mode_get_type())
)

GType values.

View Source
var (
	GTypeRTSPExtension = coreglib.Type(C.gst_rtsp_extension_get_type())
)

GType values.

View Source
var (
	GTypeRTSPURL = coreglib.Type(C.gst_rtsp_url_get_type())
)

GType values.

Functions

func NewRtspMessage

func NewRtspMessage() (*RTSPMessage, RTSPResult)

NewRtspMessage: create a new initialized RTSPMessage. Free with gst_rtsp_message_free().

The function returns the following values:

  • msg: location for the new RTSPMessage.
  • rtspResult: RTSPResult.

func RTSPMethodAsText

func RTSPMethodAsText(method RTSPMethod) string

RTSPMethodAsText: convert method to a string.

The function takes the following parameters:

  • method: RTSPMethod.

The function returns the following values:

  • utf8: string representation of method.

func RTSPRangeConvertUnits

func RTSPRangeConvertUnits(_range *RTSPTimeRange, unit RTSPRangeUnit) bool

RTSPRangeConvertUnits converts the range in-place between different types of units. Ranges containing the special value T_RTSP_TIME_NOW can not be converted as these are only valid for T_RTSP_RANGE_NPT.

The function takes the following parameters:

  • range: RTSPTimeRange.
  • unit to convert the range into.

The function returns the following values:

  • ok: TRUE if the range could be converted.

func RTSPRangeGetTimes

func RTSPRangeGetTimes(_range *RTSPTimeRange) (min, max gst.ClockTime, ok bool)

RTSPRangeGetTimes: retrieve the minimum and maximum values from range converted to ClockTime in min and max.

A value of GST_CLOCK_TIME_NONE will be used to signal T_RTSP_TIME_NOW and T_RTSP_TIME_END for min and max respectively.

UTC times will be converted to nanoseconds since 1900.

The function takes the following parameters:

  • range: RTSPTimeRange.

The function returns the following values:

  • min: result minimum ClockTime.
  • max: result maximum ClockTime.
  • ok: TRUE on success.

func RTSPRangeParse

func RTSPRangeParse(rangestr string) (*RTSPTimeRange, RTSPResult)

RTSPRangeParse: parse rangestr to a RTSPTimeRange.

The function takes the following parameters:

  • rangestr: range string to parse.

The function returns the following values:

  • _range: location to hold the RTSPTimeRange result.
  • rtspResult on success.

func RTSPRangeToString

func RTSPRangeToString(_range *RTSPTimeRange) string

RTSPRangeToString: convert range into a string representation.

The function takes the following parameters:

  • range: RTSPTimeRange.

The function returns the following values:

  • utf8: string representation of range. g_free() after usage.

func RTSPURLParse

func RTSPURLParse(urlstr string) (*RTSPURL, RTSPResult)

RTSPURLParse: parse the RTSP urlstr into a newly allocated RTSPUrl. Free after usage with gst_rtsp_url_free().

The function takes the following parameters:

  • urlstr: url string to parse.

The function returns the following values:

  • url: location to hold the result.
  • rtspResult: RTSPResult.

func RTSPVersionAsText

func RTSPVersionAsText(version RTSPVersion) string

RTSPVersionAsText: convert version to a string.

The function takes the following parameters:

  • version: RTSPVersion.

The function returns the following values:

  • utf8: string representation of version.

func RtspGenerateDigestAuthResponse

func RtspGenerateDigestAuthResponse(algorithm, method, realm, username, password, uri, nonce string) string

RtspGenerateDigestAuthResponse calculates the digest auth response from the values given by the server and the username and password. See RFC2069 for details.

Currently only supported algorithm "md5".

The function takes the following parameters:

  • algorithm (optional): hash algorithm to use, or NULL for MD5.
  • method: request method, e.g. PLAY.
  • realm: realm.
  • username: username.
  • password: password.
  • uri: original request URI.
  • nonce: nonce.

The function returns the following values:

  • utf8: authentication response or NULL if unsupported.

func RtspGenerateDigestAuthResponseFromMD5

func RtspGenerateDigestAuthResponseFromMD5(algorithm, method, md5, uri, nonce string) string

RtspGenerateDigestAuthResponseFromMD5 calculates the digest auth response from the values given by the server and the md5sum. See RFC2069 for details.

This function is useful when the passwords are not stored in clear text, but instead in the same format as the .htdigest file.

Currently only supported algorithm "md5".

The function takes the following parameters:

  • algorithm (optional): hash algorithm to use, or NULL for MD5.
  • method: request method, e.g. PLAY.
  • md5 sum of username:realm:password.
  • uri: original request URI.
  • nonce: nonce.

The function returns the following values:

  • utf8: authentication response or NULL if unsupported.

func RtspHeaderAllowMultiple

func RtspHeaderAllowMultiple(field RTSPHeaderField) bool

RtspHeaderAllowMultiple: check whether field may appear multiple times in a message.

The function takes the following parameters:

  • field: RTSPHeaderField.

The function returns the following values:

  • ok: TRUE if multiple headers are allowed.

func RtspHeaderAsText

func RtspHeaderAsText(field RTSPHeaderField) string

RtspHeaderAsText: convert field to a string.

The function takes the following parameters:

  • field: RTSPHeaderField.

The function returns the following values:

  • utf8: string representation of field.

func RtspMessageNewData

func RtspMessageNewData(channel byte) (*RTSPMessage, RTSPResult)

RtspMessageNewData: create a new data RTSPMessage with channel and store the result message in msg. Free with gst_rtsp_message_free().

The function takes the following parameters:

  • channel: channel.

The function returns the following values:

  • msg: location for the new RTSPMessage.
  • rtspResult: RTSPResult.

func RtspMessageNewRequest

func RtspMessageNewRequest(method RTSPMethod, uri string) (*RTSPMessage, RTSPResult)

RtspMessageNewRequest: create a new RTSPMessage with method and uri and store the result request message in msg. Free with gst_rtsp_message_free().

The function takes the following parameters:

  • method: request method to use.
  • uri of the request.

The function returns the following values:

  • msg: location for the new RTSPMessage.
  • rtspResult: RTSPResult.

func RtspMessageNewResponse

func RtspMessageNewResponse(code RTSPStatusCode, reason string, request *RTSPMessage) (*RTSPMessage, RTSPResult)

RtspMessageNewResponse: create a new response RTSPMessage with code and reason and store the result message in msg. Free with gst_rtsp_message_free().

When reason is NULL, the default reason for code will be used.

When request is not NULL, the relevant headers will be copied to the new response message.

The function takes the following parameters:

  • code status code.
  • reason (optional) status reason or NULL.
  • request (optional) that triggered the response or NULL.

The function returns the following values:

  • msg: location for the new RTSPMessage.
  • rtspResult: RTSPResult.

func RtspOptionsAsText

func RtspOptionsAsText(options RTSPMethod) string

RtspOptionsAsText: convert options to a string.

The function takes the following parameters:

  • options: one or more RTSPMethod.

The function returns the following values:

  • utf8: new string of options. g_free() after usage.

func RtspStatusAsText

func RtspStatusAsText(code RTSPStatusCode) string

RtspStatusAsText: convert code to a string.

The function takes the following parameters:

  • code: RTSPStatusCode.

The function returns the following values:

  • utf8: string representation of code.

func RtspStrresult

func RtspStrresult(result RTSPResult) string

RtspStrresult: convert result in a human readable string.

The function takes the following parameters:

  • result: RTSPResult.

The function returns the following values:

  • utf8: newly allocated string. g_free() after usage.

Types

type RTSPAuthCredential

type RTSPAuthCredential struct {
	// contains filtered or unexported fields
}

RTSPAuthCredential: RTSP Authentication credentials

An instance of this type is always passed by reference.

func (*RTSPAuthCredential) Authorization

func (r *RTSPAuthCredential) Authorization() string

Authorization: authorization for the basic schem.

func (*RTSPAuthCredential) Params

func (r *RTSPAuthCredential) Params() *RTSPAuthParam

Params: NULL-terminated array of RTSPAuthParam.

func (*RTSPAuthCredential) Scheme

func (r *RTSPAuthCredential) Scheme() RTSPAuthMethod

Scheme: RTSPAuthMethod.

type RTSPAuthMethod

type RTSPAuthMethod C.gint

RTSPAuthMethod: authentication methods, ordered by strength.

const (
	// RtspAuthNone: no authentication.
	RtspAuthNone RTSPAuthMethod = iota
	// RtspAuthBasic: basic authentication.
	RtspAuthBasic
	// RtspAuthDigest: digest authentication.
	RtspAuthDigest
)

func (RTSPAuthMethod) String

func (r RTSPAuthMethod) String() string

String returns the name in string for RTSPAuthMethod.

type RTSPAuthParam

type RTSPAuthParam struct {
	// contains filtered or unexported fields
}

RTSPAuthParam: RTSP Authentication parameter

An instance of this type is always passed by reference.

func (*RTSPAuthParam) Copy

func (param *RTSPAuthParam) Copy() *RTSPAuthParam

The function returns the following values:

func (*RTSPAuthParam) Name

func (r *RTSPAuthParam) Name() string

Name: name of the parameter.

func (*RTSPAuthParam) Value

func (r *RTSPAuthParam) Value() string

Value: value of the parameter.

type RTSPConnectionAcceptCertificateFunc

type RTSPConnectionAcceptCertificateFunc func(conn gio.TLSConnectioner, peerCert gio.TLSCertificater, errors gio.TLSCertificateFlags) (ok bool)

type RTSPEvent

type RTSPEvent C.guint

RTSPEvent: possible events for the connection.

const (
	// RtspEvRead: connection is readable.
	RtspEvRead RTSPEvent = 0b1
	// RtspEvWrite: connection is writable.
	RtspEvWrite RTSPEvent = 0b10
)

func (RTSPEvent) Has

func (r RTSPEvent) Has(other RTSPEvent) bool

Has returns true if r contains other.

func (RTSPEvent) String

func (r RTSPEvent) String() string

String returns the names in string for RTSPEvent.

type RTSPExtension

type RTSPExtension struct {
	*coreglib.Object
	// contains filtered or unexported fields
}

RTSPExtension: this interface is implemented e.g. by the Windows Media Streaming RTSP exentension (rtspwms) and the RealMedia RTSP extension (rtspreal).

RTSPExtension wraps an interface. This means the user can get the underlying type by calling Cast().

func (*RTSPExtension) AfterSend

func (ext *RTSPExtension) AfterSend(req, resp *RTSPMessage) RTSPResult

The function takes the following parameters:

  • req
  • resp

The function returns the following values:

func (*RTSPExtension) BeforeSend

func (ext *RTSPExtension) BeforeSend(req *RTSPMessage) RTSPResult

The function takes the following parameters:

The function returns the following values:

func (*RTSPExtension) ConfigureStream

func (ext *RTSPExtension) ConfigureStream(caps *gst.Caps) bool

The function takes the following parameters:

The function returns the following values:

func (*RTSPExtension) ConnectSend

func (ext *RTSPExtension) ConnectSend(f func(object, p0 unsafe.Pointer) (rtspResult RTSPResult)) coreglib.SignalHandle

func (*RTSPExtension) DetectServer

func (ext *RTSPExtension) DetectServer(resp *RTSPMessage) bool

The function takes the following parameters:

The function returns the following values:

func (*RTSPExtension) ReceiveRequest

func (ext *RTSPExtension) ReceiveRequest(req *RTSPMessage) RTSPResult

The function takes the following parameters:

The function returns the following values:

func (*RTSPExtension) Send

func (ext *RTSPExtension) Send(req, resp *RTSPMessage) RTSPResult

The function takes the following parameters:

  • req
  • resp

The function returns the following values:

func (*RTSPExtension) StreamSelect

func (ext *RTSPExtension) StreamSelect(url *RTSPURL) RTSPResult

The function takes the following parameters:

The function returns the following values:

type RTSPExtensionInterface

type RTSPExtensionInterface struct {
	// contains filtered or unexported fields
}

RTSPExtensionInterface: interface representing RTSP extensions.

An instance of this type is always passed by reference.

type RTSPExtensioner

type RTSPExtensioner interface {
	coreglib.Objector

	AfterSend(req, resp *RTSPMessage) RTSPResult
	BeforeSend(req *RTSPMessage) RTSPResult
	ConfigureStream(caps *gst.Caps) bool
	DetectServer(resp *RTSPMessage) bool
	ReceiveRequest(req *RTSPMessage) RTSPResult
	Send(req, resp *RTSPMessage) RTSPResult
	StreamSelect(url *RTSPURL) RTSPResult

	ConnectSend(func(object, p0 unsafe.Pointer) (rtspResult RTSPResult)) coreglib.SignalHandle
}

RTSPExtensioner describes RTSPExtension's interface methods.

type RTSPFamily

type RTSPFamily C.gint

RTSPFamily: possible network families.

const (
	// RtspFamNone: unknown network family.
	RtspFamNone RTSPFamily = iota
	// RtspFamInet: internet.
	RtspFamInet
	// RtspFamInet6: internet V6.
	RtspFamInet6
)

func (RTSPFamily) String

func (r RTSPFamily) String() string

String returns the name in string for RTSPFamily.

type RTSPHeaderField

type RTSPHeaderField C.gint

RTSPHeaderField: enumeration of rtsp header fields.

const (
	RtspHdrInvalid RTSPHeaderField = iota
	RtspHdrAccept
	RtspHdrAcceptEncoding
	RtspHdrAcceptLanguage
	RtspHdrAllow
	RtspHdrAuthorization
	RtspHdrBandwidth
	RtspHdrBlocksize
	RtspHdrCacheControl
	RtspHdrConference
	RtspHdrConnection
	RtspHdrContentBase
	RtspHdrContentEncoding
	RtspHdrContentLanguage
	RtspHdrContentLength
	RtspHdrContentLocation
	RtspHdrContentType
	RtspHdrCseq
	RtspHdrDate
	RtspHdrExpires
	RtspHdrFrom
	RtspHdrIfModifiedSince
	RtspHdrLastModified
	RtspHdrProxyAuthenticate
	RtspHdrProxyRequire
	RtspHdrPublic
	RtspHdrRange
	RtspHdrReferer
	RtspHdrRequire
	RtspHdrRetryAfter
	RtspHdrRtpInfo
	RtspHdrScale
	RtspHdrSession
	RtspHdrServer
	RtspHdrSpeed
	RtspHdrTransport
	RtspHdrUnsupported
	RtspHdrUserAgent
	RtspHdrVia
	RtspHdrWwwAuthenticate
	RtspHdrClientChallenge
	RtspHdrRealChallenge1
	RtspHdrRealChallenge2
	RtspHdrRealChallenge3
	RtspHdrSubscribe
	RtspHdrAlert
	RtspHdrClientID
	RtspHdrCompanyID
	RtspHdrGUID
	RtspHdrRegionData
	RtspHdrMaxAsmWidth
	RtspHdrLanguage
	RtspHdrPlayerStartTime
	RtspHdrLocation
	RtspHdrETag
	RtspHdrIfMatch
	RtspHdrAcceptCharset
	RtspHdrSupported
	RtspHdrVary
	RtspHdrXAccelerateStreaming
	RtspHdrXAcceptAuthent
	RtspHdrXAcceptProxyAuthent
	RtspHdrXBroadcastID
	RtspHdrXBurstStreaming
	RtspHdrXNotice
	RtspHdrXPlayerLagTime
	RtspHdrXPlaylist
	RtspHdrXPlaylistChangeNotice
	RtspHdrXPlaylistGenID
	RtspHdrXPlaylistSeekID
	RtspHdrXProxyClientAgent
	RtspHdrXProxyClientVerb
	RtspHdrXRecedingPlaylistchange
	RtspHdrXRtpInfo
	RtspHdrXStartupprofile
	RtspHdrTimestamp
	RtspHdrAuthenticationInfo
	RtspHdrHost
	RtspHdrPragma
	RtspHdrXServerIPAddress
	RtspHdrXSessioncookie
	RtspHdrRtcpInterval
	RtspHdrKeymgmt
	RtspHdrPipelinedRequests
	RtspHdrMediaProperties
	RtspHdrSeekStyle
	RtspHdrAcceptRanges
	RtspHdrFrames
	RtspHdrRateControl
	RtspHdrLast
)

func RtspFindHeaderField

func RtspFindHeaderField(header string) RTSPHeaderField

RtspFindHeaderField: convert header to a RTSPHeaderField.

The function takes the following parameters:

  • header string.

The function returns the following values:

  • rtspHeaderField for header or T_RTSP_HDR_INVALID if the header field is unknown.

func (RTSPHeaderField) String

func (r RTSPHeaderField) String() string

String returns the name in string for RTSPHeaderField.

type RTSPLowerTrans

type RTSPLowerTrans C.guint

RTSPLowerTrans: different transport methods.

const (
	// RtspLowerTransUnknown: invalid transport flag.
	RtspLowerTransUnknown RTSPLowerTrans = 0b0
	// RtspLowerTransUDP: stream data over UDP.
	RtspLowerTransUDP RTSPLowerTrans = 0b1
	// RtspLowerTransUDPMcast: stream data over UDP multicast.
	RtspLowerTransUDPMcast RTSPLowerTrans = 0b10
	// RtspLowerTransTCP: stream data over TCP.
	RtspLowerTransTCP RTSPLowerTrans = 0b100
	// RtspLowerTransHTTP: stream data tunneled over HTTP.
	RtspLowerTransHTTP RTSPLowerTrans = 0b10000
	// RtspLowerTransTLS: encrypt TCP and HTTP with TLS.
	RtspLowerTransTLS RTSPLowerTrans = 0b100000
)

func (RTSPLowerTrans) Has

func (r RTSPLowerTrans) Has(other RTSPLowerTrans) bool

Has returns true if r contains other.

func (RTSPLowerTrans) String

func (r RTSPLowerTrans) String() string

String returns the names in string for RTSPLowerTrans.

type RTSPMessage

type RTSPMessage struct {
	// contains filtered or unexported fields
}

RTSPMessage provides methods for creating and parsing request, response and data messages.

An instance of this type is always passed by reference.

func (*RTSPMessage) AddHeader

func (msg *RTSPMessage) AddHeader(field RTSPHeaderField, value string) RTSPResult

AddHeader: add a header with key field and value to msg. This function takes a copy of value.

The function takes the following parameters:

  • field: RTSPHeaderField.
  • value of the header.

The function returns the following values:

  • rtspResult: RTSPResult.

func (*RTSPMessage) AddHeaderByName

func (msg *RTSPMessage) AddHeaderByName(header string, value string) RTSPResult

AddHeaderByName: add a header with key header and value to msg. This function takes a copy of value.

The function takes the following parameters:

  • header string.
  • value of the header.

The function returns the following values:

  • rtspResult: RTSPResult.

func (*RTSPMessage) Body

func (msg *RTSPMessage) Body() ([]byte, RTSPResult)

Body: get the body of msg. data remains valid for as long as msg is valid and unchanged.

If the message body was set as a Buffer before this will cause the data to be copied and stored in the message. The Buffer will no longer be kept in the message.

The function returns the following values:

  • data: location for the data.
  • rtspResult: T_RTSP_OK.

func (*RTSPMessage) BodyBuffer

func (msg *RTSPMessage) BodyBuffer() (*gst.Buffer, RTSPResult)

BodyBuffer: get the body of msg. buffer remains valid for as long as msg is valid and unchanged.

If body data was set from raw memory instead of a Buffer this function will always return NULL. The caller can check if there is a body buffer by calling gst_rtsp_message_has_body_buffer().

The function returns the following values:

  • buffer: location for the buffer.
  • rtspResult: T_RTSP_OK.

func (*RTSPMessage) Copy

func (msg *RTSPMessage) Copy() (*RTSPMessage, RTSPResult)

Copy: allocate a new copy of msg and store the result in copy. The value in copy should be release with gst_rtsp_message_free function.

The function returns the following values:

  • copy: pointer to new RTSPMessage.
  • rtspResult: RTSPResult.

func (*RTSPMessage) Dump

func (msg *RTSPMessage) Dump() RTSPResult

Dump the contents of msg to stdout.

The function returns the following values:

  • rtspResult: T_RTSP_OK.

func (*RTSPMessage) HasBodyBuffer

func (msg *RTSPMessage) HasBodyBuffer() bool

HasBodyBuffer checks if msg has a body and the body is stored as Buffer.

The function returns the following values:

  • ok: TRUE if msg has a body and it's stored as Buffer, FALSE otherwise.

func (*RTSPMessage) Header

func (msg *RTSPMessage) Header(field RTSPHeaderField, indx int) (string, RTSPResult)

Header: get the indx header value with key field from msg. The result in value stays valid as long as it remains present in msg.

The function takes the following parameters:

  • field: RTSPHeaderField.
  • indx: index of the header.

The function returns the following values:

  • value: pointer to hold the result.
  • rtspResult when field was found, T_RTSP_ENOTIMPL if the key was not found.

func (*RTSPMessage) HeaderByName

func (msg *RTSPMessage) HeaderByName(header string, index int) (string, RTSPResult)

HeaderByName: get the index header value with key header from msg. The result in value stays valid as long as it remains present in msg.

The function takes the following parameters:

  • header: RTSPHeaderField.
  • index of the header.

The function returns the following values:

  • value: pointer to hold the result.
  • rtspResult when field was found, T_RTSP_ENOTIMPL if the key was not found.

func (*RTSPMessage) Init

func (msg *RTSPMessage) Init() RTSPResult

Init: initialize msg. This function is mostly used when msg is allocated on the stack. The reverse operation of this is gst_rtsp_message_unset().

The function returns the following values:

  • rtspResult: RTSPResult.

func (*RTSPMessage) InitData

func (msg *RTSPMessage) InitData(channel byte) RTSPResult

InitData: initialize a new data RTSPMessage for channel.

The function takes the following parameters:

  • channel: channel.

The function returns the following values:

  • rtspResult: RTSPResult.

func (*RTSPMessage) InitRequest

func (msg *RTSPMessage) InitRequest(method RTSPMethod, uri string) RTSPResult

InitRequest: initialize msg as a request message with method and uri. To clear msg again, use gst_rtsp_message_unset().

The function takes the following parameters:

  • method: request method to use.
  • uri of the request.

The function returns the following values:

  • rtspResult: RTSPResult.

func (*RTSPMessage) InitResponse

func (msg *RTSPMessage) InitResponse(code RTSPStatusCode, reason string, request *RTSPMessage) RTSPResult

InitResponse: initialize msg with code and reason.

When reason is NULL, the default reason for code will be used.

When request is not NULL, the relevant headers will be copied to the new response message.

The function takes the following parameters:

  • code status code.
  • reason (optional) status reason or NULL.
  • request (optional) that triggered the response or NULL.

The function returns the following values:

  • rtspResult: RTSPResult.

func (*RTSPMessage) ParseAuthCredentials

func (msg *RTSPMessage) ParseAuthCredentials(field RTSPHeaderField) []*RTSPAuthCredential

ParseAuthCredentials parses the credentials given in a WWW-Authenticate or Authorization header.

The function takes the following parameters:

  • field: RTSPHeaderField.

The function returns the following values:

  • rtspAuthCredentials: NULL-terminated array of GstRTSPAuthCredential or NULL.

func (*RTSPMessage) ParseData

func (msg *RTSPMessage) ParseData() (byte, RTSPResult)

ParseData: parse the data message msg and store the channel in channel.

The function returns the following values:

  • channel: location to hold the channel.
  • rtspResult: RTSPResult.

func (*RTSPMessage) ParseRequest

func (msg *RTSPMessage) ParseRequest() (RTSPMethod, string, RTSPVersion, RTSPResult)

ParseRequest: parse the request message msg and store the values method, uri and version. The result locations can be NULL if one is not interested in its value.

uri remains valid for as long as msg is valid and unchanged.

The function returns the following values:

  • method (optional): location to hold the method.
  • uri (optional): location to hold the uri.
  • version (optional): location to hold the version.
  • rtspResult: RTSPResult.

func (*RTSPMessage) ParseResponse

func (msg *RTSPMessage) ParseResponse() (RTSPStatusCode, string, RTSPVersion, RTSPResult)

ParseResponse: parse the response message msg and store the values code, reason and version. The result locations can be NULL if one is not interested in its value.

reason remains valid for as long as msg is valid and unchanged.

The function returns the following values:

  • code (optional): location to hold the status code.
  • reason (optional): location to hold the status reason.
  • version (optional): location to hold the version.
  • rtspResult: RTSPResult.

func (*RTSPMessage) RemoveHeader

func (msg *RTSPMessage) RemoveHeader(field RTSPHeaderField, indx int) RTSPResult

RemoveHeader: remove the indx header with key field from msg. If indx equals -1, all headers will be removed.

The function takes the following parameters:

  • field: RTSPHeaderField.
  • indx: index of the header.

The function returns the following values:

  • rtspResult: RTSPResult.

func (*RTSPMessage) RemoveHeaderByName

func (msg *RTSPMessage) RemoveHeaderByName(header string, index int) RTSPResult

RemoveHeaderByName: remove the index header with key header from msg. If index equals -1, all matching headers will be removed.

The function takes the following parameters:

  • header string.
  • index of the header.

The function returns the following values:

  • rtspResult: RTSPResult.

func (*RTSPMessage) SetBody

func (msg *RTSPMessage) SetBody(data []byte) RTSPResult

SetBody: set the body of msg to a copy of data. Any existing body or body buffer will be replaced by the new body.

The function takes the following parameters:

  • data: data.

The function returns the following values:

  • rtspResult: T_RTSP_OK.

func (*RTSPMessage) SetBodyBuffer

func (msg *RTSPMessage) SetBodyBuffer(buffer *gst.Buffer) RTSPResult

SetBodyBuffer: set the body of msg to buffer. Any existing body or body buffer will be replaced by the new body.

The function takes the following parameters:

  • buffer: Buffer.

The function returns the following values:

  • rtspResult: T_RTSP_OK.

func (*RTSPMessage) StealBody

func (msg *RTSPMessage) StealBody() ([]byte, RTSPResult)

StealBody: take the body of msg and store it in data and size. After this method, the body and size of msg will be set to NULL and 0 respectively.

The function returns the following values:

  • data: location for the data.
  • rtspResult: T_RTSP_OK.

func (*RTSPMessage) StealBodyBuffer

func (msg *RTSPMessage) StealBodyBuffer() (*gst.Buffer, RTSPResult)

StealBodyBuffer: take the body of msg and store it in buffer. After this method, the body and size of msg will be set to NULL and 0 respectively.

If body data was set from raw memory instead of a Buffer this function will always return NULL. The caller can check if there is a body buffer by calling gst_rtsp_message_has_body_buffer().

The function returns the following values:

  • buffer: location for the buffer.
  • rtspResult: T_RTSP_OK.

func (*RTSPMessage) TakeBody

func (msg *RTSPMessage) TakeBody(data []byte) RTSPResult

TakeBody: set the body of msg to data and size. This method takes ownership of data. Any existing body or body buffer will be replaced by the new body.

The function takes the following parameters:

  • data: data.

The function returns the following values:

  • rtspResult: T_RTSP_OK.

func (*RTSPMessage) TakeBodyBuffer

func (msg *RTSPMessage) TakeBodyBuffer(buffer *gst.Buffer) RTSPResult

TakeBodyBuffer: set the body of msg to buffer. This method takes ownership of buffer. Any existing body or body buffer will be replaced by the new body.

The function takes the following parameters:

  • buffer: Buffer.

The function returns the following values:

  • rtspResult: T_RTSP_OK.

func (*RTSPMessage) TakeHeader

func (msg *RTSPMessage) TakeHeader(field RTSPHeaderField, value string) RTSPResult

TakeHeader: add a header with key field and value to msg. This function takes ownership of value.

The function takes the following parameters:

  • field: RTSPHeaderField.
  • value of the header.

The function returns the following values:

  • rtspResult: RTSPResult.

func (*RTSPMessage) TakeHeaderByName

func (msg *RTSPMessage) TakeHeaderByName(header string, value string) RTSPResult

TakeHeaderByName: add a header with key header and value to msg. This function takes ownership of value, but not of header.

The function takes the following parameters:

  • header string.
  • value of the header.

The function returns the following values:

  • rtspResult: RTSPResult.

func (*RTSPMessage) Type

func (msg *RTSPMessage) Type() RTSPMsgType

Type: get the message type of msg.

The function returns the following values:

  • rtspMsgType: message type.

func (*RTSPMessage) Unset

func (msg *RTSPMessage) Unset() RTSPResult

Unset the contents of msg so that it becomes an uninitialized RTSPMessage again. This function is mostly used in combination with gst_rtsp_message_init_request(), gst_rtsp_message_init_response() and gst_rtsp_message_init_data() on stack allocated RTSPMessage structures.

The function returns the following values:

  • rtspResult: T_RTSP_OK.

type RTSPMethod

type RTSPMethod C.guint

RTSPMethod: different supported RTSP methods.

const (
	// RtspInvalid: invalid method.
	RtspInvalid RTSPMethod = 0b0
	// RtspDescribe: DESCRIBE method.
	RtspDescribe RTSPMethod = 0b1
	// RtspAnnounce: ANNOUNCE method.
	RtspAnnounce RTSPMethod = 0b10
	// RtspGetParameter: GET_PARAMETER method.
	RtspGetParameter RTSPMethod = 0b100
	// RtspOptions: OPTIONS method.
	RtspOptions RTSPMethod = 0b1000
	// RtspPause: PAUSE method.
	RtspPause RTSPMethod = 0b10000
	// RtspPlay: PLAY method.
	RtspPlay RTSPMethod = 0b100000
	// RtspRecord: RECORD method.
	RtspRecord RTSPMethod = 0b1000000
	// RtspRedirect: REDIRECT method.
	RtspRedirect RTSPMethod = 0b10000000
	// RtspSetup: SETUP method.
	RtspSetup RTSPMethod = 0b100000000
	// RtspSetParameter: SET_PARAMETER method.
	RtspSetParameter RTSPMethod = 0b1000000000
	// RtspTeardown: TEARDOWN method.
	RtspTeardown RTSPMethod = 0b10000000000
	// RtspGet: GET method (HTTP).
	RtspGet RTSPMethod = 0b100000000000
	// RtspPost: POST method (HTTP).
	RtspPost RTSPMethod = 0b1000000000000
)

func RtspFindMethod

func RtspFindMethod(method string) RTSPMethod

RtspFindMethod: convert method to a RTSPMethod.

The function takes the following parameters:

  • method: method.

The function returns the following values:

  • rtspMethod for method or T_RTSP_INVALID if the method is unknown.

func RtspOptionsFromText

func RtspOptionsFromText(options string) RTSPMethod

RtspOptionsFromText: convert the comma separated list options to a RTSPMethod bitwise or of methods. This functions is the reverse of gst_rtsp_options_as_text().

The function takes the following parameters:

  • options: comma separated list of options.

The function returns the following values:

  • rtspMethod: RTSPMethod.

func (RTSPMethod) Has

func (r RTSPMethod) Has(other RTSPMethod) bool

Has returns true if r contains other.

func (RTSPMethod) String

func (r RTSPMethod) String() string

String returns the names in string for RTSPMethod.

type RTSPMsgType

type RTSPMsgType C.gint

RTSPMsgType: type of a message.

const (
	// RtspMessageInvalid: invalid message type.
	RtspMessageInvalid RTSPMsgType = iota
	// RtspMessageRequest: RTSP request message.
	RtspMessageRequest
	// RtspMessageResponse: RTSP response message.
	RtspMessageResponse
	// RtspMessageHTTPRequest: HTTP request message.
	RtspMessageHTTPRequest
	// RtspMessageHTTPResponse: HTTP response message.
	RtspMessageHTTPResponse
	// RtspMessageData: data message.
	RtspMessageData
)

func (RTSPMsgType) String

func (r RTSPMsgType) String() string

String returns the name in string for RTSPMsgType.

type RTSPProfile

type RTSPProfile C.guint

RTSPProfile: transfer profile to use.

const (
	// RtspProfileUnknown: invalid profile.
	RtspProfileUnknown RTSPProfile = 0b0
	// RtspProfileAvp: audio/Visual profile (RFC 3551).
	RtspProfileAvp RTSPProfile = 0b1
	// RtspProfileSavp: secure Audio/Visual profile (RFC 3711).
	RtspProfileSavp RTSPProfile = 0b10
	// RtspProfileAvpf: audio/Visual profile with feedback (RFC 4585).
	RtspProfileAvpf RTSPProfile = 0b100
	// RtspProfileSavpf: secure Audio/Visual profile with feedback (RFC 5124).
	RtspProfileSavpf RTSPProfile = 0b1000
)

func (RTSPProfile) Has

func (r RTSPProfile) Has(other RTSPProfile) bool

Has returns true if r contains other.

func (RTSPProfile) String

func (r RTSPProfile) String() string

String returns the names in string for RTSPProfile.

type RTSPRange

type RTSPRange struct {
	// contains filtered or unexported fields
}

RTSPRange provides helper functions to deal with time ranges.

An instance of this type is always passed by reference.

func NewRTSPRange

func NewRTSPRange(min, max int) RTSPRange

NewRTSPRange creates a new RTSPRange instance from the given fields. Beware that this function allocates on the Go heap; be careful when using it!

func (*RTSPRange) Max

func (r *RTSPRange) Max() int

Max: maximum value of the range.

func (*RTSPRange) Min

func (r *RTSPRange) Min() int

Min: minimum value of the range.

func (*RTSPRange) SetMax

func (r *RTSPRange) SetMax(max int)

Max: maximum value of the range.

func (*RTSPRange) SetMin

func (r *RTSPRange) SetMin(min int)

Min: minimum value of the range.

type RTSPRangeUnit

type RTSPRangeUnit C.gint

RTSPRangeUnit: different possible time range units.

const (
	// RtspRangeSmpte: SMPTE timecode.
	RtspRangeSmpte RTSPRangeUnit = iota
	// RtspRangeSmpte30Drop: 29.97 frames per second.
	RtspRangeSmpte30Drop
	// RtspRangeSmpte25: 25 frames per second.
	RtspRangeSmpte25
	// RtspRangeNpt: normal play time.
	RtspRangeNpt
	// RtspRangeClock: absolute time expressed as ISO 8601 timestamps.
	RtspRangeClock
)

func (RTSPRangeUnit) String

func (r RTSPRangeUnit) String() string

String returns the name in string for RTSPRangeUnit.

type RTSPResult

type RTSPResult C.gint

RTSPResult: result codes from the RTSP functions.

const (
	// RtspOK: no error.
	RtspOK RTSPResult = 0
	// RtspError: some unspecified error occurred.
	RtspError RTSPResult = -1
	// RtspEinval: invalid arguments were provided to a function.
	RtspEinval RTSPResult = -2
	// RtspEintr: operation was canceled.
	RtspEintr RTSPResult = -3
	// RtspEnomem: no memory was available for the operation.
	RtspEnomem RTSPResult = -4
	// RtspEresolv: host resolve error occurred.
	RtspEresolv RTSPResult = -5
	// RtspEnotimpl: function not implemented.
	RtspEnotimpl RTSPResult = -6
	// RtspEsys: system error occurred, errno contains more details.
	RtspEsys RTSPResult = -7
	// RtspEparse: parsing error occurred.
	RtspEparse RTSPResult = -8
	// RtspEwsastart windows networking could not start.
	RtspEwsastart RTSPResult = -9
	// RtspEwsaversion windows networking stack has wrong version.
	RtspEwsaversion RTSPResult = -10
	// RtspEeof: end-of-file was reached.
	RtspEeof RTSPResult = -11
	// RtspEnet: network problem occurred, h_errno contains more details.
	RtspEnet RTSPResult = -12
	// RtspEnotip: host is not an IP host.
	RtspEnotip RTSPResult = -13
	// RtspEtimeout: timeout occurred.
	RtspEtimeout RTSPResult = -14
	// RtspEtget: tunnel GET request has been performed.
	RtspEtget RTSPResult = -15
	// RtspEtpost: tunnel POST request has been performed.
	RtspEtpost RTSPResult = -16
	// RtspElast: last error.
	RtspElast RTSPResult = -17
)

func RTSPTransportGetManager

func RTSPTransportGetManager(trans RTSPTransMode, option uint) (string, RTSPResult)

RTSPTransportGetManager: get the Element that can handle the buffers transported over trans.

It is possible that there are several managers available, use option to selected one.

manager will contain an element name or NULL when no manager is needed/available for trans.

The function takes the following parameters:

  • trans: RTSPTransMode.
  • option index.

The function returns the following values:

  • manager (optional): location to hold the result.
  • rtspResult: T_RTSP_OK.

func RTSPTransportParse

func RTSPTransportParse(str string, transport *RTSPTransport) RTSPResult

RTSPTransportParse: parse the RTSP transport string str into transport.

The function takes the following parameters:

  • str: transport string.
  • transport: RTSPTransport.

The function returns the following values:

  • rtspResult: RTSPResult.

func (RTSPResult) String

func (r RTSPResult) String() string

String returns the name in string for RTSPResult.

type RTSPState

type RTSPState C.gint

RTSPState: different RTSP states.

const (
	// RtspStateInvalid: invalid state.
	RtspStateInvalid RTSPState = iota
	// RtspStateInit: initializing.
	RtspStateInit
	// RtspStateReady: ready for operation.
	RtspStateReady
	// RtspStateSeeking: seeking in progress.
	RtspStateSeeking
	// RtspStatePlaying: playing.
	RtspStatePlaying
	// RtspStateRecording: recording.
	RtspStateRecording
)

func (RTSPState) String

func (r RTSPState) String() string

String returns the name in string for RTSPState.

type RTSPStatusCode

type RTSPStatusCode C.gint

RTSPStatusCode: enumeration of rtsp status codes.

const (
	RtspStsInvalid                        RTSPStatusCode = 0
	RtspStsContinue                       RTSPStatusCode = 100
	RtspStsOK                             RTSPStatusCode = 200
	RtspStsCreated                        RTSPStatusCode = 201
	RtspStsLowOnStorage                   RTSPStatusCode = 250
	RtspStsMultipleChoices                RTSPStatusCode = 300
	RtspStsMovedPermanently               RTSPStatusCode = 301
	RtspStsMoveTemporarily                RTSPStatusCode = 302
	RtspStsSeeOther                       RTSPStatusCode = 303
	RtspStsNotModified                    RTSPStatusCode = 304
	RtspStsUseProxy                       RTSPStatusCode = 305
	RtspStsBadRequest                     RTSPStatusCode = 400
	RtspStsUnauthorized                   RTSPStatusCode = 401
	RtspStsPaymentRequired                RTSPStatusCode = 402
	RtspStsForbidden                      RTSPStatusCode = 403
	RtspStsNotFound                       RTSPStatusCode = 404
	RtspStsMethodNotAllowed               RTSPStatusCode = 405
	RtspStsNotAcceptable                  RTSPStatusCode = 406
	RtspStsProxyAuthRequired              RTSPStatusCode = 407
	RtspStsRequestTimeout                 RTSPStatusCode = 408
	RtspStsGone                           RTSPStatusCode = 410
	RtspStsLengthRequired                 RTSPStatusCode = 411
	RtspStsPreconditionFailed             RTSPStatusCode = 412
	RtspStsRequestEntityTooLarge          RTSPStatusCode = 413
	RtspStsRequestURITooLarge             RTSPStatusCode = 414
	RtspStsUnsupportedMediaType           RTSPStatusCode = 415
	RtspStsParameterNotUnderstood         RTSPStatusCode = 451
	RtspStsConferenceNotFound             RTSPStatusCode = 452
	RtspStsNotEnoughBandwidth             RTSPStatusCode = 453
	RtspStsSessionNotFound                RTSPStatusCode = 454
	RtspStsMethodNotValidInThisState      RTSPStatusCode = 455
	RtspStsHeaderFieldNotValidForResource RTSPStatusCode = 456
	RtspStsInvalidRange                   RTSPStatusCode = 457
	RtspStsParameterIsReadonly            RTSPStatusCode = 458
	RtspStsAggregateOperationNotAllowed   RTSPStatusCode = 459
	RtspStsOnlyAggregateOperationAllowed  RTSPStatusCode = 460
	RtspStsUnsupportedTransport           RTSPStatusCode = 461
	RtspStsDestinationUnreachable         RTSPStatusCode = 462
	RtspStsKeyManagementFailure           RTSPStatusCode = 463
	RtspStsInternalServerError            RTSPStatusCode = 500
	RtspStsNotImplemented                 RTSPStatusCode = 501
	RtspStsBadGateway                     RTSPStatusCode = 502
	RtspStsServiceUnavailable             RTSPStatusCode = 503
	RtspStsGatewayTimeout                 RTSPStatusCode = 504
	RtspStsRtspVersionNotSupported        RTSPStatusCode = 505
	RtspStsOptionNotSupported             RTSPStatusCode = 551
)

func (RTSPStatusCode) String

func (r RTSPStatusCode) String() string

String returns the name in string for RTSPStatusCode.

type RTSPTime

type RTSPTime struct {
	// contains filtered or unexported fields
}

RTSPTime: time indication.

An instance of this type is always passed by reference.

func (*RTSPTime) Seconds

func (r *RTSPTime) Seconds() float64

Seconds seconds when type is GST_RTSP_TIME_SECONDS, GST_RTSP_TIME_UTC and GST_RTSP_TIME_FRAMES.

func (*RTSPTime) SetSeconds

func (r *RTSPTime) SetSeconds(seconds float64)

Seconds seconds when type is GST_RTSP_TIME_SECONDS, GST_RTSP_TIME_UTC and GST_RTSP_TIME_FRAMES.

func (*RTSPTime) Type

func (r *RTSPTime) Type() RTSPTimeType

Type: time of the time.

type RTSPTime2

type RTSPTime2 struct {
	// contains filtered or unexported fields
}

RTSPTime2: extra fields for a time indication.

An instance of this type is always passed by reference.

func NewRTSPTime2

func NewRTSPTime2(frames float64, year, month, day uint) RTSPTime2

NewRTSPTime2 creates a new RTSPTime2 instance from the given fields. Beware that this function allocates on the Go heap; be careful when using it!

func (*RTSPTime2) Day

func (r *RTSPTime2) Day() uint

Day: day when type is GST_RTSP_TIME_UTC.

func (*RTSPTime2) Frames

func (r *RTSPTime2) Frames() float64

Frames frames and subframes when type in GstRTSPTime is GST_RTSP_TIME_FRAMES.

func (*RTSPTime2) Month

func (r *RTSPTime2) Month() uint

Month: month when type is GST_RTSP_TIME_UTC.

func (*RTSPTime2) SetDay

func (r *RTSPTime2) SetDay(day uint)

Day: day when type is GST_RTSP_TIME_UTC.

func (*RTSPTime2) SetFrames

func (r *RTSPTime2) SetFrames(frames float64)

Frames frames and subframes when type in GstRTSPTime is GST_RTSP_TIME_FRAMES.

func (*RTSPTime2) SetMonth

func (r *RTSPTime2) SetMonth(month uint)

Month: month when type is GST_RTSP_TIME_UTC.

func (*RTSPTime2) SetYear

func (r *RTSPTime2) SetYear(year uint)

Year: year when type is GST_RTSP_TIME_UTC.

func (*RTSPTime2) Year

func (r *RTSPTime2) Year() uint

Year: year when type is GST_RTSP_TIME_UTC.

type RTSPTimeRange

type RTSPTimeRange struct {
	// contains filtered or unexported fields
}

RTSPTimeRange: time range.

An instance of this type is always passed by reference.

func (*RTSPTimeRange) Max

func (r *RTSPTimeRange) Max() *RTSPTime

Max: maximum interval.

func (*RTSPTimeRange) Max2

func (r *RTSPTimeRange) Max2() *RTSPTime2

Max2: extra fields in the maximum interval (Since: 1.2).

func (*RTSPTimeRange) Min

func (r *RTSPTimeRange) Min() *RTSPTime

Min: minimum interval.

func (*RTSPTimeRange) Min2

func (r *RTSPTimeRange) Min2() *RTSPTime2

Min2: extra fields in the minimum interval (Since: 1.2).

func (*RTSPTimeRange) Unit

func (r *RTSPTimeRange) Unit() RTSPRangeUnit

Unit: time units used.

type RTSPTimeType

type RTSPTimeType C.gint

RTSPTimeType: possible time types.

const (
	// RtspTimeSeconds: seconds.
	RtspTimeSeconds RTSPTimeType = iota
	// RtspTimeNow: now.
	RtspTimeNow
	// RtspTimeEnd: end.
	RtspTimeEnd
	// RtspTimeFrames frames and subframes.
	RtspTimeFrames
	// RtspTimeUTC: UTC time.
	RtspTimeUTC
)

func (RTSPTimeType) String

func (r RTSPTimeType) String() string

String returns the name in string for RTSPTimeType.

type RTSPTransMode

type RTSPTransMode C.guint

RTSPTransMode: transfer mode to use.

const (
	// RtspTransUnknown: invalid tansport mode.
	RtspTransUnknown RTSPTransMode = 0b0
	// RtspTransRtp: transfer RTP data.
	RtspTransRtp RTSPTransMode = 0b1
	// RtspTransRdt: transfer RDT (RealMedia) data.
	RtspTransRdt RTSPTransMode = 0b10
)

func (RTSPTransMode) Has

func (r RTSPTransMode) Has(other RTSPTransMode) bool

Has returns true if r contains other.

func (RTSPTransMode) String

func (r RTSPTransMode) String() string

String returns the names in string for RTSPTransMode.

type RTSPTransport

type RTSPTransport struct {
	// contains filtered or unexported fields
}

RTSPTransport provides helper functions to deal with RTSP transport strings.

An instance of this type is always passed by reference.

func (*RTSPTransport) Append

func (r *RTSPTransport) Append() bool

Append is append mode was selected.

func (*RTSPTransport) AsText

func (transport *RTSPTransport) AsText() string

AsText: convert transport into a string that can be used to signal the transport in an RTSP SETUP response.

The function returns the following values:

  • utf8: string describing the RTSP transport or NULL when the transport is invalid.

func (*RTSPTransport) ClientPort

func (r *RTSPTransport) ClientPort() *RTSPRange

ClientPort: client port pair for receiving data. For TCP based transports, applications can use this field to store the sender and receiver ports of the client.

func (*RTSPTransport) Destination

func (r *RTSPTransport) Destination() string

Destination: destination ip/hostname.

func (*RTSPTransport) Init

func (transport *RTSPTransport) Init() RTSPResult

Init: initialize transport so that it can be used.

The function returns the following values:

  • rtspResult: T_RTSP_OK.

func (*RTSPTransport) Interleaved

func (r *RTSPTransport) Interleaved() *RTSPRange

Interleaved: interleave range.

func (*RTSPTransport) Layers

func (r *RTSPTransport) Layers() uint

Layers: number of layers.

func (*RTSPTransport) LowerTransport

func (r *RTSPTransport) LowerTransport() RTSPLowerTrans

LowerTransport: lower transport.

func (*RTSPTransport) MediaType

func (transport *RTSPTransport) MediaType() (string, RTSPResult)

MediaType: get the media type of transport. This media type is typically used to generate Caps events.

The function returns the following values:

  • mediaType: media type of transport.
  • rtspResult: T_RTSP_OK.

func (*RTSPTransport) ModePlay

func (r *RTSPTransport) ModePlay() bool

ModePlay: if play mode was selected.

func (*RTSPTransport) ModeRecord

func (r *RTSPTransport) ModeRecord() bool

ModeRecord: if record mode was selected.

func (*RTSPTransport) Port

func (r *RTSPTransport) Port() *RTSPRange

Port: port pair for multicast sessions.

func (*RTSPTransport) Profile

func (r *RTSPTransport) Profile() RTSPProfile

Profile: tansport profile.

func (*RTSPTransport) ServerPort

func (r *RTSPTransport) ServerPort() *RTSPRange

ServerPort: server port pair for receiving data. For TCP based transports, applications can use this field to store the sender and receiver ports of the server.

func (*RTSPTransport) SetAppend

func (r *RTSPTransport) SetAppend(append bool)

Append is append mode was selected.

func (*RTSPTransport) SetLayers

func (r *RTSPTransport) SetLayers(layers uint)

Layers: number of layers.

func (*RTSPTransport) SetModePlay

func (r *RTSPTransport) SetModePlay(modePlay bool)

ModePlay: if play mode was selected.

func (*RTSPTransport) SetModeRecord

func (r *RTSPTransport) SetModeRecord(modeRecord bool)

ModeRecord: if record mode was selected.

func (*RTSPTransport) SetSsrc

func (r *RTSPTransport) SetSsrc(ssrc uint)

Ssrc: ssrc that the sender/receiver will use.

func (*RTSPTransport) SetTTL

func (r *RTSPTransport) SetTTL(ttl uint)

TTL: time to live for multicast UDP.

func (*RTSPTransport) Source

func (r *RTSPTransport) Source() string

Source: source ip/hostname.

func (*RTSPTransport) Ssrc

func (r *RTSPTransport) Ssrc() uint

Ssrc: ssrc that the sender/receiver will use.

func (*RTSPTransport) TTL

func (r *RTSPTransport) TTL() uint

TTL: time to live for multicast UDP.

func (*RTSPTransport) Trans

func (r *RTSPTransport) Trans() RTSPTransMode

Trans: transport mode.

type RTSPURL

type RTSPURL struct {
	// contains filtered or unexported fields
}

RTSPURL provides helper functions to handle RTSP urls.

An instance of this type is always passed by reference.

func (*RTSPURL) Abspath

func (r *RTSPURL) Abspath() string

Abspath: absolute path.

func (*RTSPURL) Copy

func (url *RTSPURL) Copy() *RTSPURL

Copy: make a copy of url.

The function returns the following values:

  • rtspUrl: copy of url. Free with gst_rtsp_url_free () after usage.

func (*RTSPURL) DecodePathComponents

func (url *RTSPURL) DecodePathComponents() []string

DecodePathComponents splits the path of url on '/' boundaries, decoding the resulting components,

The decoding performed by this routine is "URI decoding", as defined in RFC 3986, commonly known as percent-decoding. For example, a string "foo\2fbar" will decode to "foo/bar" -- the \2f being replaced by the corresponding byte with hex value 0x2f. Note that there is no guarantee that the resulting byte sequence is valid in any given encoding. As a special case, \00 is not unescaped to NUL, as that would prematurely terminate the string.

Also note that since paths usually start with a slash, the first component will usually be the empty string.

The function returns the following values:

  • utf8s: NULL-terminated array of URL components. Free with g_strfreev() when no longer needed.

func (*RTSPURL) Family

func (r *RTSPURL) Family() RTSPFamily

Family: family.

func (*RTSPURL) Host

func (r *RTSPURL) Host() string

Host: host.

func (*RTSPURL) Passwd

func (r *RTSPURL) Passwd() string

Passwd: password.

func (*RTSPURL) Port

func (url *RTSPURL) Port() (uint16, RTSPResult)

Port: get the port number of url.

The function returns the following values:

  • port: location to hold the port.
  • rtspResult: T_RTSP_OK.

func (*RTSPURL) Query

func (r *RTSPURL) Query() string

Query: additional query parameters.

func (*RTSPURL) RequestURI

func (url *RTSPURL) RequestURI() string

RequestURI: get a newly allocated string describing the request URI for url.

The function returns the following values:

  • utf8: string with the request URI. g_free() after usage.

func (*RTSPURL) RequestURIWithControl

func (url *RTSPURL) RequestURIWithControl(controlPath string) string

RequestURIWithControl: get a newly allocated string describing the request URI for url combined with the control path for control_path.

The function takes the following parameters:

  • controlPath: RTSP aggregate control path.

The function returns the following values:

  • utf8: string with the request URI combined with the control path. g_free() after usage.

func (*RTSPURL) SetPort

func (url *RTSPURL) SetPort(port uint16) RTSPResult

SetPort: set the port number in url to port.

The function takes the following parameters:

  • port: port.

The function returns the following values:

  • rtspResult: T_RTSP_OK.

func (*RTSPURL) Transports

func (r *RTSPURL) Transports() RTSPLowerTrans

Transports transports allowed.

func (*RTSPURL) User

func (r *RTSPURL) User() string

User: user.

type RTSPVersion

type RTSPVersion C.gint

RTSPVersion: supported RTSP versions.

const (
	// RtspVersionInvalid: unknown/invalid version.
	RtspVersionInvalid RTSPVersion = 0
	// RtspVersion10: version 1.0.
	RtspVersion10 RTSPVersion = 16
	// RtspVersion11: version 1.1.
	RtspVersion11 RTSPVersion = 17
	// RtspVersion20: version 2.0.
	RtspVersion20 RTSPVersion = 32
)

func (RTSPVersion) String

func (r RTSPVersion) String() string

String returns the name in string for RTSPVersion.

type RTSPWatchFuncs

type RTSPWatchFuncs struct {
	// contains filtered or unexported fields
}

RTSPWatchFuncs: callback functions from a RTSPWatch.

An instance of this type is always passed by reference.

Jump to

Keyboard shortcuts

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