Documentation ¶
Index ¶
- Constants
- Variables
- func NewRTCPBuffer(mtu uint) *gst.Buffer
- func NewRTCPBufferCopyData(data []byte) *gst.Buffer
- func NewRTCPBufferTakeData(data []byte) *gst.Buffer
- func NewRTPBufferAllocate(payloadLen uint, padLen, csrcCount byte) *gst.Buffer
- func NewRTPBufferAllocateLen(packetLen uint, padLen, csrcCount byte) *gst.Buffer
- func NewRTPBufferCopyData(data []byte) *gst.Buffer
- func NewRTPBufferTakeData(data []byte) *gst.Buffer
- func RTCPBufferMap(buffer *gst.Buffer, flags gst.MapFlags, rtcp *RTCPBuffer) bool
- func RTCPBufferValidate(buffer *gst.Buffer) bool
- func RTCPBufferValidateData(data []byte) bool
- func RTCPBufferValidateDataReduced(data []byte) bool
- func RTCPBufferValidateReduced(buffer *gst.Buffer) bool
- func RTPBufferAllocateData(buffer *gst.Buffer, payloadLen uint, padLen, csrcCount byte)
- func RTPBufferCalcHeaderLen(csrcCount byte) uint
- func RTPBufferCalcPacketLen(payloadLen uint, padLen, csrcCount byte) uint
- func RTPBufferCalcPayloadLen(packetLen uint, padLen, csrcCount byte) uint
- func RTPBufferCompareSeqnum(seqnum1, seqnum2 uint16) int
- func RTPBufferDefaultClockRate(payloadType byte) uint32
- func RTPBufferGetExtensionOnebyteHeaderFromBytes(bytes *glib.Bytes, bitPattern uint16, id byte, nth uint) ([]byte, bool)
- func RTPSourceMetaGetInfo() *gst.MetaInfo
- func RtcpNtpToUnix(ntptime uint64) uint64
- func RtcpSdesTypeToName(typ RTCPSDESType) string
- func RtcpUnixToNtp(unixtime uint64) uint64
- func RtpGetHeaderExtensionList() []*gst.ElementFactory
- func RtpHdrextGetNtp56(data []byte) (uint64, bool)
- func RtpHdrextGetNtp64(data []byte) (uint64, bool)
- func RtpHdrextSetNtp56(data unsafe.Pointer, size uint, ntptime uint64) bool
- func RtpHdrextSetNtp64(data unsafe.Pointer, size uint, ntptime uint64) bool
- func RtpSourceMetaApiGetType() coreglib.Type
- type RTCPBuffer
- type RTCPFBType
- type RTCPPacket
- func (packet *RTCPPacket) AddProfileSpecificExt(data []byte) bool
- func (packet *RTCPPacket) AddRb(ssrc uint32, fractionlost byte, packetslost int32, exthighestseq uint32, ...) bool
- func (packet *RTCPPacket) AppGetData() *byte
- func (packet *RTCPPacket) AppGetDataLength() uint16
- func (packet *RTCPPacket) AppGetName() string
- func (packet *RTCPPacket) AppGetSsrc() uint32
- func (packet *RTCPPacket) AppGetSubtype() byte
- func (packet *RTCPPacket) AppSetDataLength(wordlen uint16) bool
- func (packet *RTCPPacket) AppSetName(name string)
- func (packet *RTCPPacket) AppSetSsrc(ssrc uint32)
- func (packet *RTCPPacket) AppSetSubtype(subtype byte)
- func (packet *RTCPPacket) ByeAddSsrc(ssrc uint32) bool
- func (packet *RTCPPacket) ByeAddSsrcs(ssrc []uint32) bool
- func (packet *RTCPPacket) ByeGetNthSsrc(nth uint) uint32
- func (packet *RTCPPacket) ByeGetReason() string
- func (packet *RTCPPacket) ByeGetReasonLen() byte
- func (packet *RTCPPacket) ByeGetSsrcCount() uint
- func (packet *RTCPPacket) ByeSetReason(reason string) bool
- func (packet *RTCPPacket) CopyProfileSpecificExt() ([]byte, bool)
- func (packet *RTCPPacket) Count() byte
- func (packet *RTCPPacket) FbGetFci() *byte
- func (packet *RTCPPacket) FbGetFciLength() uint16
- func (packet *RTCPPacket) FbGetMediaSsrc() uint32
- func (packet *RTCPPacket) FbGetSenderSsrc() uint32
- func (packet *RTCPPacket) FbGetType() RTCPFBType
- func (packet *RTCPPacket) FbSetFciLength(wordlen uint16) bool
- func (packet *RTCPPacket) FbSetMediaSsrc(ssrc uint32)
- func (packet *RTCPPacket) FbSetSenderSsrc(ssrc uint32)
- func (packet *RTCPPacket) FbSetType(typ RTCPFBType)
- func (packet *RTCPPacket) Length() uint16
- func (packet *RTCPPacket) MoveToNext() bool
- func (r *RTCPPacket) Offset() uint
- func (packet *RTCPPacket) Padding() bool
- func (packet *RTCPPacket) ProfileSpecificExt() ([]byte, bool)
- func (packet *RTCPPacket) ProfileSpecificExtLength() uint16
- func (packet *RTCPPacket) Rb(nth uint) (ssrc uint32, fractionlost byte, packetslost int32, exthighestseq uint32, ...)
- func (packet *RTCPPacket) RbCount() uint
- func (packet *RTCPPacket) Remove() bool
- func (packet *RTCPPacket) RrGetSsrc() uint32
- func (packet *RTCPPacket) RrSetSsrc(ssrc uint32)
- func (r *RTCPPacket) Rtcp() *RTCPBuffer
- func (packet *RTCPPacket) SdesAddEntry(typ RTCPSDESType, data []byte) bool
- func (packet *RTCPPacket) SdesAddItem(ssrc uint32) bool
- func (packet *RTCPPacket) SdesCopyEntry(typ *RTCPSDESType) ([]byte, bool)
- func (packet *RTCPPacket) SdesFirstEntry() bool
- func (packet *RTCPPacket) SdesFirstItem() bool
- func (packet *RTCPPacket) SdesGetEntry(typ *RTCPSDESType) ([]byte, bool)
- func (packet *RTCPPacket) SdesGetItemCount() uint
- func (packet *RTCPPacket) SdesGetSsrc() uint32
- func (packet *RTCPPacket) SdesNextEntry() bool
- func (packet *RTCPPacket) SdesNextItem() bool
- func (r *RTCPPacket) SetOffset(offset uint)
- func (packet *RTCPPacket) SetRb(nth uint, ssrc uint32, fractionlost byte, packetslost int32, ...)
- func (packet *RTCPPacket) SrGetSenderInfo() (ssrc uint32, ntptime uint64, rtptime uint32, packetCount uint32, ...)
- func (packet *RTCPPacket) SrSetSenderInfo(ssrc uint32, ntptime uint64, rtptime uint32, packetCount uint32, ...)
- func (packet *RTCPPacket) Type() RTCPType
- func (packet *RTCPPacket) XRFirstRb() bool
- func (packet *RTCPPacket) XRGetBlockLength() uint16
- func (packet *RTCPPacket) XRGetBlockType() RTCPXRType
- func (packet *RTCPPacket) XRGetDlrrBlock(nth uint, ssrc *uint32, lastRr *uint32, delay *uint32) bool
- func (packet *RTCPPacket) XRGetPrtBySeq(seq uint16, receiptTime *uint32) bool
- func (packet *RTCPPacket) XRGetPrtInfo(ssrc *uint32, thinning *byte, beginSeq *uint16, endSeq *uint16) bool
- func (packet *RTCPPacket) XRGetRLEInfo(ssrc *uint32, thinning *byte, beginSeq *uint16, endSeq *uint16, ...) bool
- func (packet *RTCPPacket) XRGetRLENthChunk(nth uint, chunk *uint16) bool
- func (packet *RTCPPacket) XRGetRrt(timestamp *uint64) bool
- func (packet *RTCPPacket) XRGetSsrc() uint32
- func (packet *RTCPPacket) XRGetSummaryInfo(ssrc *uint32, beginSeq *uint16, endSeq *uint16) bool
- func (packet *RTCPPacket) XRGetSummaryJitter(minJitter *uint32, maxJitter *uint32, meanJitter *uint32, devJitter *uint32) bool
- func (packet *RTCPPacket) XRGetSummaryPkt(lostPackets *uint32, dupPackets *uint32) bool
- func (packet *RTCPPacket) XRGetVoipBurstMetrics(burstDensity *byte, gapDensity *byte, burstDuration *uint16, ...) bool
- func (packet *RTCPPacket) XRGetVoipConfigurationParams(gmin *byte, rxConfig *byte) bool
- func (packet *RTCPPacket) XRGetVoipDelayMetrics(roundtripDelay *uint16, endSystemDelay *uint16) bool
- func (packet *RTCPPacket) XRGetVoipJitterBufferParams(jbNominal *uint16, jbMaximum *uint16, jbAbsMax *uint16) bool
- func (packet *RTCPPacket) XRGetVoipMetricsSsrc(ssrc *uint32) bool
- func (packet *RTCPPacket) XRGetVoipPacketMetrics(lossRate *byte, discardRate *byte) bool
- func (packet *RTCPPacket) XRGetVoipQualityMetrics(rFactor *byte, extRFactor *byte, mosLq *byte, mosCq *byte) bool
- func (packet *RTCPPacket) XRGetVoipSignalMetrics(signalLevel *byte, noiseLevel *byte, rerl *byte, gmin *byte) bool
- func (packet *RTCPPacket) XRNextRb() bool
- type RTCPSDESType
- type RTCPType
- type RTCPXRType
- type RTPBaseAudioPayload
- func (rtpbaseaudiopayload *RTPBaseAudioPayload) Adapter() *gstbase.Adapter
- func (baseaudiopayload *RTPBaseAudioPayload) Flush(payloadLen uint, timestamp gst.ClockTime) gst.FlowReturn
- func (baseaudiopayload *RTPBaseAudioPayload) Push(data []byte, timestamp gst.ClockTime) gst.FlowReturn
- func (rtpbaseaudiopayload *RTPBaseAudioPayload) SetFrameBased()
- func (rtpbaseaudiopayload *RTPBaseAudioPayload) SetFrameOptions(frameDuration, frameSize int)
- func (rtpbaseaudiopayload *RTPBaseAudioPayload) SetSampleBased()
- func (rtpbaseaudiopayload *RTPBaseAudioPayload) SetSampleOptions(sampleSize int)
- func (rtpbaseaudiopayload *RTPBaseAudioPayload) SetSamplebitsOptions(sampleSize int)
- type RTPBaseAudioPayloadClass
- type RTPBaseAudioPayloadOverrides
- type RTPBaseDepayload
- func (depayload *RTPBaseDepayload) ConnectAddExtension(f func(ext RTPHeaderExtensioner)) coreglib.SignalHandle
- func (depayload *RTPBaseDepayload) ConnectClearExtensions(f func()) coreglib.SignalHandle
- func (depayload *RTPBaseDepayload) ConnectRequestExtension(f func(extId uint, extUri string) (rtpHeaderExtension RTPHeaderExtensioner)) coreglib.SignalHandle
- func (depayload *RTPBaseDepayload) IsSourceInfoEnabled() bool
- func (filter *RTPBaseDepayload) Push(outBuf *gst.Buffer) gst.FlowReturn
- func (filter *RTPBaseDepayload) PushList(outList *gst.BufferList) gst.FlowReturn
- func (depayload *RTPBaseDepayload) SetSourceInfoEnabled(enable bool)
- type RTPBaseDepayloadClass
- type RTPBaseDepayloadOverrides
- type RTPBaseDepayloader
- type RTPBasePayload
- func (payload *RTPBasePayload) AllocateOutputBuffer(payloadLen uint, padLen, csrcCount byte) *gst.Buffer
- func (payload *RTPBasePayload) ConnectAddExtension(f func(ext RTPHeaderExtensioner)) coreglib.SignalHandle
- func (payload *RTPBasePayload) ConnectClearExtensions(f func()) coreglib.SignalHandle
- func (payload *RTPBasePayload) ConnectRequestExtension(f func(extId uint, extUri string) (rtpHeaderExtension RTPHeaderExtensioner)) coreglib.SignalHandle
- func (payload *RTPBasePayload) IsFilled(size uint, duration gst.ClockTime) bool
- func (payload *RTPBasePayload) IsSourceInfoEnabled() bool
- func (payload *RTPBasePayload) Push(buffer *gst.Buffer) gst.FlowReturn
- func (payload *RTPBasePayload) PushList(list *gst.BufferList) gst.FlowReturn
- func (payload *RTPBasePayload) SetOptions(media string, dynamic bool, encodingName string, clockRate uint32)
- func (payload *RTPBasePayload) SetOutcapsStructure(s *gst.Structure) bool
- func (payload *RTPBasePayload) SetSourceInfoEnabled(enable bool)
- func (payload *RTPBasePayload) SourceCount(buffer *gst.Buffer) uint
- type RTPBasePayloadClass
- type RTPBasePayloadOverrides
- type RTPBasePayloader
- type RTPBuffer
- func (rtp *RTPBuffer) AddExtensionOnebyteHeader(id byte, data []byte) bool
- func (rtp *RTPBuffer) AddExtensionTwobytesHeader(appbits byte, id byte, data []byte) bool
- func (r *RTPBuffer) Buffer() *gst.Buffer
- func (rtp *RTPBuffer) Csrc(idx byte) uint32
- func (rtp *RTPBuffer) CsrcCount() byte
- func (r *RTPBuffer) Data() [4]unsafe.Pointer
- func (rtp *RTPBuffer) Extension() bool
- func (rtp *RTPBuffer) ExtensionData() (uint16, *glib.Bytes)
- func (rtp *RTPBuffer) ExtensionOnebyteHeader(id byte, nth uint) ([]byte, bool)
- func (rtp *RTPBuffer) ExtensionTwobytesHeader(id byte, nth uint) (byte, []byte, bool)
- func (rtp *RTPBuffer) HeaderLen() uint
- func (r *RTPBuffer) Map() [4]gst.MapInfo
- func (rtp *RTPBuffer) Marker() bool
- func (rtp *RTPBuffer) PacketLen() uint
- func (rtp *RTPBuffer) PadTo(len uint)
- func (rtp *RTPBuffer) Padding() bool
- func (rtp *RTPBuffer) Payload() *glib.Bytes
- func (rtp *RTPBuffer) PayloadBuffer() *gst.Buffer
- func (rtp *RTPBuffer) PayloadLen() uint
- func (rtp *RTPBuffer) PayloadSubbuffer(offset uint, len uint) *gst.Buffer
- func (rtp *RTPBuffer) PayloadType() byte
- func (rtp *RTPBuffer) RemoveExtensionData()
- func (rtp *RTPBuffer) Seq() uint16
- func (rtp *RTPBuffer) SetCsrc(idx byte, csrc uint32)
- func (rtp *RTPBuffer) SetExtension(extension bool)
- func (rtp *RTPBuffer) SetExtensionData(bits uint16, length uint16) bool
- func (rtp *RTPBuffer) SetMarker(marker bool)
- func (rtp *RTPBuffer) SetPacketLen(len uint)
- func (rtp *RTPBuffer) SetPadding(padding bool)
- func (rtp *RTPBuffer) SetPayloadType(payloadType byte)
- func (rtp *RTPBuffer) SetSeq(seq uint16)
- func (rtp *RTPBuffer) SetSsrc(ssrc uint32)
- func (r *RTPBuffer) SetState(state uint)
- func (rtp *RTPBuffer) SetTimestamp(timestamp uint32)
- func (rtp *RTPBuffer) SetVersion(version byte)
- func (r *RTPBuffer) Size() [4]uint
- func (rtp *RTPBuffer) Ssrc() uint32
- func (r *RTPBuffer) State() uint
- func (rtp *RTPBuffer) Timestamp() uint32
- func (rtp *RTPBuffer) Unmap()
- func (rtp *RTPBuffer) Version() byte
- type RTPBufferFlags
- type RTPBufferMapFlags
- type RTPHeaderExtension
- func (ext *RTPHeaderExtension) Direction() RTPHeaderExtensionDirection
- func (ext *RTPHeaderExtension) ID() uint
- func (ext *RTPHeaderExtension) MaxSize(inputMeta *gst.Buffer) uint
- func (ext *RTPHeaderExtension) Read(readFlags RTPHeaderExtensionFlags, data []byte, buffer *gst.Buffer) bool
- func (ext *RTPHeaderExtension) SdpCapsFieldName() string
- func (ext *RTPHeaderExtension) SetAttributesFromCaps(caps *gst.Caps) bool
- func (ext *RTPHeaderExtension) SetCapsFromAttributes(caps *gst.Caps) bool
- func (ext *RTPHeaderExtension) SetCapsFromAttributesHelper(caps *gst.Caps, attributes string) bool
- func (ext *RTPHeaderExtension) SetDirection(direction RTPHeaderExtensionDirection)
- func (ext *RTPHeaderExtension) SetID(extId uint)
- func (ext *RTPHeaderExtension) SetNonRtpSinkCaps(caps *gst.Caps) bool
- func (ext *RTPHeaderExtension) SetWantsUpdateNonRtpSrcCaps(state bool)
- func (ext *RTPHeaderExtension) SupportedFlags() RTPHeaderExtensionFlags
- func (ext *RTPHeaderExtension) URI() string
- func (ext *RTPHeaderExtension) UpdateNonRtpSrcCaps(caps *gst.Caps) bool
- func (ext *RTPHeaderExtension) WantsUpdateNonRtpSrcCaps() bool
- func (ext *RTPHeaderExtension) Write(inputMeta *gst.Buffer, writeFlags RTPHeaderExtensionFlags, output *gst.Buffer, ...) int
- type RTPHeaderExtensionClass
- type RTPHeaderExtensionDirection
- type RTPHeaderExtensionFlags
- type RTPHeaderExtensionOverrides
- type RTPHeaderExtensioner
- type RTPPayload
- type RTPPayloadInfo
- func (r *RTPPayloadInfo) Bitrate() uint
- func (r *RTPPayloadInfo) ClockRate() uint
- func (r *RTPPayloadInfo) EncodingName() string
- func (r *RTPPayloadInfo) EncodingParameters() string
- func (r *RTPPayloadInfo) Media() string
- func (r *RTPPayloadInfo) PayloadType() byte
- func (r *RTPPayloadInfo) SetBitrate(bitrate uint)
- func (r *RTPPayloadInfo) SetClockRate(clockRate uint)
- func (r *RTPPayloadInfo) SetPayloadType(payloadType byte)
- type RTPProfile
- type RTPSourceMeta
- func (meta *RTPSourceMeta) AppendCsrc(csrc *uint32, csrcCount uint) bool
- func (r *RTPSourceMeta) Csrc() [15]uint32
- func (r *RTPSourceMeta) CsrcCount() uint
- func (r *RTPSourceMeta) Meta() *gst.Meta
- func (r *RTPSourceMeta) SetCsrcCount(csrcCount uint)
- func (meta *RTPSourceMeta) SetSsrc(ssrc *uint32) bool
- func (r *RTPSourceMeta) SetSsrcValid(ssrcValid bool)
- func (meta *RTPSourceMeta) SourceCount() uint
- func (r *RTPSourceMeta) Ssrc() uint32
- func (r *RTPSourceMeta) SsrcValid() bool
Constants ¶
const RTCP_MAX_BYE_SSRC_COUNT = 31
RTCP_MAX_BYE_SSRC_COUNT: maximum amount of SSRCs in a BYE packet.
const RTCP_MAX_RB_COUNT = 31
RTCP_MAX_RB_COUNT: maximum amount of Receiver report blocks in RR and SR messages.
const RTCP_MAX_SDES = 255
RTCP_MAX_SDES: maximum text length for an SDES item.
const RTCP_MAX_SDES_ITEM_COUNT = 31
RTCP_MAX_SDES_ITEM_COUNT: maximum amount of SDES items.
const RTCP_REDUCED_SIZE_VALID_MASK = 49400
RTCP_REDUCED_SIZE_VALID_MASK: mask for version and packet type pair allowing reduced size packets, basically it accepts other types than RR and SR.
const RTCP_VALID_MASK = 57598
RTCP_VALID_MASK: mask for version, padding bit and packet type pair.
const RTCP_VALID_VALUE = 200
RTCP_VALID_VALUE: valid value for the first two bytes of an RTCP packet after applying T_RTCP_VALID_MASK to them.
const RTCP_VERSION = 2
RTCP_VERSION: supported RTCP version 2.
const RTP_HDREXT_BASE = "urn:ietf:params:rtp-hdrext:"
const RTP_HDREXT_ELEMENT_CLASS = "Network/Extension/RTPHeader"
RTP_HDREXT_ELEMENT_CLASS: constant string used in element classification to signal that this element is a RTP header extension.
const RTP_HDREXT_NTP_56 = "ntp-56"
const RTP_HDREXT_NTP_56_SIZE = 7
const RTP_HDREXT_NTP_64 = "ntp-64"
const RTP_HDREXT_NTP_64_SIZE = 8
const RTP_HEADER_EXTENSION_URI_METADATA_KEY = "RTP-Header-Extension-URI"
const RTP_PAYLOAD_1016_STRING = "1"
const RTP_PAYLOAD_CELLB_STRING = "25"
const RTP_PAYLOAD_CN_STRING = "13"
const RTP_PAYLOAD_DVI4_11025_STRING = "16"
const RTP_PAYLOAD_DVI4_16000_STRING = "6"
const RTP_PAYLOAD_DVI4_22050_STRING = "17"
const RTP_PAYLOAD_DVI4_8000_STRING = "5"
const RTP_PAYLOAD_DYNAMIC_STRING = "[96, 127]"
const RTP_PAYLOAD_G721_STRING = "2"
const RTP_PAYLOAD_G722_STRING = "9"
const RTP_PAYLOAD_G723_53 = 17
const RTP_PAYLOAD_G723_53_STRING = "17"
const RTP_PAYLOAD_G723_63 = 16
const RTP_PAYLOAD_G723_63_STRING = "16"
const RTP_PAYLOAD_G723_STRING = "4"
const RTP_PAYLOAD_G728_STRING = "15"
const RTP_PAYLOAD_G729_STRING = "18"
const RTP_PAYLOAD_GSM_STRING = "3"
const RTP_PAYLOAD_H261_STRING = "31"
const RTP_PAYLOAD_H263_STRING = "34"
const RTP_PAYLOAD_JPEG_STRING = "26"
const RTP_PAYLOAD_L16_MONO_STRING = "11"
const RTP_PAYLOAD_L16_STEREO_STRING = "10"
const RTP_PAYLOAD_LPC_STRING = "7"
const RTP_PAYLOAD_MP2T_STRING = "33"
const RTP_PAYLOAD_MPA_STRING = "14"
const RTP_PAYLOAD_MPV_STRING = "32"
const RTP_PAYLOAD_NV_STRING = "28"
const RTP_PAYLOAD_PCMA_STRING = "8"
const RTP_PAYLOAD_PCMU_STRING = "0"
const RTP_PAYLOAD_QCELP_STRING = "12"
const RTP_PAYLOAD_TS41 = 19
const RTP_PAYLOAD_TS41_STRING = "19"
const RTP_PAYLOAD_TS48 = 18
const RTP_PAYLOAD_TS48_STRING = "18"
const RTP_SOURCE_META_MAX_CSRC_COUNT = 15
const RTP_VERSION = 2
RTP_VERSION: supported RTP version 2.
Variables ¶
var ( GTypeRTCPFBType = coreglib.Type(C.gst_rtcpfb_type_get_type()) GTypeRTCPSDESType = coreglib.Type(C.gst_rtcpsdes_type_get_type()) GTypeRTCPType = coreglib.Type(C.gst_rtcp_type_get_type()) )
GType values.
var ( GTypeRTPHeaderExtensionDirection = coreglib.Type(C.gst_rtp_header_extension_direction_get_type()) GTypeRTPHeaderExtensionFlags = coreglib.Type(C.gst_rtp_header_extension_flags_get_type()) GTypeRTPHeaderExtension = coreglib.Type(C.gst_rtp_header_extension_get_type()) )
GType values.
var (
GTypeRTCPXRType = coreglib.Type(C.gst_rtcpxr_type_get_type())
)
GType values.
var (
GTypeRTPBaseAudioPayload = coreglib.Type(C.gst_rtp_base_audio_payload_get_type())
)
GType values.
var (
GTypeRTPBaseDepayload = coreglib.Type(C.gst_rtp_base_depayload_get_type())
)
GType values.
var (
GTypeRTPBasePayload = coreglib.Type(C.gst_rtp_base_payload_get_type())
)
GType values.
var (
GTypeRTPBufferFlags = coreglib.Type(C.gst_rtp_buffer_flags_get_type())
)
GType values.
var (
GTypeRTPBufferMapFlags = coreglib.Type(C.gst_rtp_buffer_map_flags_get_type())
)
GType values.
var (
GTypeRTPPayload = coreglib.Type(C.gst_rtp_payload_get_type())
)
GType values.
var (
GTypeRTPProfile = coreglib.Type(C.gst_rtp_profile_get_type())
)
GType values.
Functions ¶
func NewRTCPBuffer ¶
NewRTCPBuffer: create a new buffer for constructing RTCP packets. The packet will have a maximum size of mtu.
The function takes the following parameters:
- mtu: maximum mtu size.
The function returns the following values:
- buffer: newly allocated buffer.
func NewRTCPBufferCopyData ¶
NewRTCPBufferCopyData: create a new buffer and set the data to a copy of len bytes of data and the size to len. The data will be freed when the buffer is freed.
The function takes the following parameters:
- data for the new buffer.
The function returns the following values:
- buffer: newly allocated buffer with a copy of data and of size len.
func NewRTCPBufferTakeData ¶
NewRTCPBufferTakeData: create a new buffer and set the data and size of the buffer to data and len respectively. data will be freed when the buffer is unreffed, so this function transfers ownership of data to the new buffer.
The function takes the following parameters:
- data for the new buffer.
The function returns the following values:
- buffer: newly allocated buffer with data and of size len.
func NewRTPBufferAllocate ¶
NewRTPBufferAllocate: allocate a new Buffer with enough data to hold an RTP packet with csrc_count CSRCs, a payload length of payload_len and padding of pad_len. All other RTP header fields will be set to 0/FALSE.
The function takes the following parameters:
- payloadLen: length of the payload.
- padLen: amount of padding.
- csrcCount: number of CSRC entries.
The function returns the following values:
- buffer: newly allocated buffer that can hold an RTP packet with given parameters.
func NewRTPBufferAllocateLen ¶
NewRTPBufferAllocateLen: create a new Buffer that can hold an RTP packet that is exactly packet_len long. The length of the payload depends on pad_len and csrc_count and can be calculated with gst_rtp_buffer_calc_payload_len(). All RTP header fields will be set to 0/FALSE.
The function takes the following parameters:
- packetLen: total length of the packet.
- padLen: amount of padding.
- csrcCount: number of CSRC entries.
The function returns the following values:
- buffer: newly allocated buffer that can hold an RTP packet of packet_len.
func NewRTPBufferCopyData ¶
NewRTPBufferCopyData: create a new buffer and set the data to a copy of len bytes of data and the size to len. The data will be freed when the buffer is freed.
The function takes the following parameters:
- data for the new buffer.
The function returns the following values:
- buffer: newly allocated buffer with a copy of data and of size len.
func NewRTPBufferTakeData ¶
NewRTPBufferTakeData: create a new buffer and set the data and size of the buffer to data and len respectively. data will be freed when the buffer is unreffed, so this function transfers ownership of data to the new buffer.
The function takes the following parameters:
- data: data for the new buffer.
The function returns the following values:
- buffer: newly allocated buffer with data and of size len.
func RTCPBufferMap ¶
RTCPBufferMap: open buffer for reading or writing, depending on flags. The resulting RTCP buffer state is stored in rtcp.
The function takes the following parameters:
- buffer with an RTCP packet.
- flags for the mapping.
- rtcp: resulting RTCPBuffer.
The function returns the following values:
func RTCPBufferValidate ¶
RTCPBufferValidate: check if the data pointed to by buffer is a valid RTCP packet using gst_rtcp_buffer_validate_data().
The function takes the following parameters:
- buffer to validate.
The function returns the following values:
- ok: TRUE if buffer is a valid RTCP packet.
func RTCPBufferValidateData ¶
RTCPBufferValidateData: check if the data and size point to the data of a valid compound, non-reduced size RTCP packet. Use this function to validate a packet before using the other functions in this module.
The function takes the following parameters:
- data to validate.
The function returns the following values:
- ok: TRUE if the data points to a valid RTCP packet.
func RTCPBufferValidateDataReduced ¶
RTCPBufferValidateDataReduced: check if the data and size point to the data of a valid RTCP packet. Use this function to validate a packet before using the other functions in this module.
This function is updated to support reduced size rtcp packets according to RFC 5506 and will validate full compound RTCP packets as well as reduced size RTCP packets.
The function takes the following parameters:
- data to validate.
The function returns the following values:
- ok: TRUE if the data points to a valid RTCP packet.
func RTCPBufferValidateReduced ¶
RTCPBufferValidateReduced: check if the data pointed to by buffer is a valid RTCP packet using gst_rtcp_buffer_validate_reduced().
The function takes the following parameters:
- buffer to validate.
The function returns the following values:
- ok: TRUE if buffer is a valid RTCP packet.
func RTPBufferAllocateData ¶
RTPBufferAllocateData: allocate enough data in buffer to hold an RTP packet with csrc_count CSRCs, a payload length of payload_len and padding of pad_len. buffer must be writable and all previous memory in buffer will be freed. If pad_len is >0, the padding bit will be set. All other RTP header fields will be set to 0/FALSE.
The function takes the following parameters:
- buffer: Buffer.
- payloadLen: length of the payload.
- padLen: amount of padding.
- csrcCount: number of CSRC entries.
func RTPBufferCalcHeaderLen ¶
RTPBufferCalcHeaderLen: calculate the header length of an RTP packet with csrc_count CSRC entries. An RTP packet can have at most 15 CSRC entries.
The function takes the following parameters:
- csrcCount: number of CSRC entries.
The function returns the following values:
- guint: length of an RTP header with csrc_count CSRC entries.
func RTPBufferCalcPacketLen ¶
RTPBufferCalcPacketLen: calculate the total length of an RTP packet with a payload size of payload_len, a padding of pad_len and a csrc_count CSRC entries.
The function takes the following parameters:
- payloadLen: length of the payload.
- padLen: amount of padding.
- csrcCount: number of CSRC entries.
The function returns the following values:
- guint: total length of an RTP header with given parameters.
func RTPBufferCalcPayloadLen ¶
RTPBufferCalcPayloadLen: calculate the length of the payload of an RTP packet with size packet_len, a padding of pad_len and a csrc_count CSRC entries.
The function takes the following parameters:
- packetLen: length of the total RTP packet.
- padLen: amount of padding.
- csrcCount: number of CSRC entries.
The function returns the following values:
- guint: length of the payload of an RTP packet with given parameters.
func RTPBufferCompareSeqnum ¶
RTPBufferCompareSeqnum: compare two sequence numbers, taking care of wraparounds. This function returns the difference between seqnum1 and seqnum2.
The function takes the following parameters:
- seqnum1: sequence number.
- seqnum2: sequence number.
The function returns the following values:
- gint: negative value if seqnum1 is bigger than seqnum2, 0 if they are equal or a positive value if seqnum1 is smaller than segnum2.
func RTPBufferDefaultClockRate ¶
RTPBufferDefaultClockRate: get the default clock-rate for the static payload type payload_type.
The function takes the following parameters:
- payloadType: static payload type.
The function returns the following values:
- guint32: default clock rate or -1 if the payload type is not static or the clock-rate is undefined.
func RTPBufferGetExtensionOnebyteHeaderFromBytes ¶
func RTPBufferGetExtensionOnebyteHeaderFromBytes(bytes *glib.Bytes, bitPattern uint16, id byte, nth uint) ([]byte, bool)
RTPBufferGetExtensionOnebyteHeaderFromBytes: similar to gst_rtp_buffer_get_extension_onebyte_header, but working on the #GBytes you get from gst_rtp_buffer_get_extension_bytes. Parses RFC 5285 style header extensions with a one byte header. It will return the nth extension with the requested id.
The function takes the following parameters:
- bytes: #GBytes.
- bitPattern: bit-pattern. Anything but 0xBEDE is rejected.
- id: ID of the header extension to be read (between 1 and 14).
- nth: read the nth extension packet with the requested ID.
The function returns the following values:
- data: location for data.
- ok: TRUE if bytes had the requested header extension.
func RTPSourceMetaGetInfo ¶
The function returns the following values:
func RtcpNtpToUnix ¶
RtcpNtpToUnix converts an NTP time to UNIX nanoseconds. ntptime can typically be the NTP time of an SR RTCP message and contains, in the upper 32 bits, the number of seconds since 1900 and, in the lower 32 bits, the fractional seconds. The resulting value will be the number of nanoseconds since 1970.
The function takes the following parameters:
- ntptime: NTP timestamp.
The function returns the following values:
- guint64: UNIX time for ntptime in nanoseconds.
func RtcpSdesTypeToName ¶
func RtcpSdesTypeToName(typ RTCPSDESType) string
RtcpSdesTypeToName converts type to the string equivalent. The string is typically used as a key in a Structure containing SDES items.
The function takes the following parameters:
- typ: RTCPSDESType.
The function returns the following values:
- utf8: string equivalent of type.
func RtcpUnixToNtp ¶
RtcpUnixToNtp converts a UNIX timestamp in nanoseconds to an NTP time. The caller should pass a value with nanoseconds since 1970. The NTP time will, in the upper 32 bits, contain the number of seconds since 1900 and, in the lower 32 bits, the fractional seconds. The resulting value can be used as an ntptime for constructing SR RTCP packets.
The function takes the following parameters:
- unixtime: UNIX timestamp in nanoseconds.
The function returns the following values:
- guint64: NTP time for unixtime.
func RtpGetHeaderExtensionList ¶
func RtpGetHeaderExtensionList() []*gst.ElementFactory
RtpGetHeaderExtensionList: retrieve all the factories of the currently registered RTP header extensions. Call gst_element_factory_create() with each factory to create the associated RTPHeaderExtension.
The function returns the following values:
- list of ElementFactory's. Use gst_plugin_feature_list_free() after use.
func RtpHdrextGetNtp56 ¶
RtpHdrextGetNtp56 reads the NTP time from the size NTP-56 extension bytes in data and store the result in ntptime.
The function takes the following parameters:
- data to read from.
The function returns the following values:
- ntptime: result NTP time.
- ok: TRUE on success.
func RtpHdrextGetNtp64 ¶
RtpHdrextGetNtp64 reads the NTP time from the size NTP-64 extension bytes in data and store the result in ntptime.
The function takes the following parameters:
- data to read from.
The function returns the following values:
- ntptime: result NTP time.
- ok: TRUE on success.
func RtpHdrextSetNtp56 ¶
RtpHdrextSetNtp56 writes the NTP time in ntptime to the format required for the NTP-56 header extension. data must hold at least T_RTP_HDREXT_NTP_56_SIZE bytes.
The function takes the following parameters:
- data (optional) to write to.
- size of data.
- ntptime: NTP time.
The function returns the following values:
- ok: TRUE on success.
func RtpHdrextSetNtp64 ¶
RtpHdrextSetNtp64 writes the NTP time in ntptime to the format required for the NTP-64 header extension. data must hold at least T_RTP_HDREXT_NTP_64_SIZE bytes.
The function takes the following parameters:
- data (optional) to write to.
- size of data.
- ntptime: NTP time.
The function returns the following values:
- ok: TRUE on success.
func RtpSourceMetaApiGetType ¶
The function returns the following values:
Types ¶
type RTCPBuffer ¶
type RTCPBuffer struct {
// contains filtered or unexported fields
}
RTCPBuffer: note: The API in this module is not yet declared stable.
The GstRTPCBuffer helper functions makes it easy to parse and create regular Buffer objects that contain compound RTCP packets. These buffers are typically of 'application/x-rtcp' Caps.
An RTCP buffer consists of 1 or more RTCPPacket structures that you can retrieve with gst_rtcp_buffer_get_first_packet(). RTCPPacket acts as a pointer into the RTCP buffer; you can move to the next packet with gst_rtcp_packet_move_to_next().
An instance of this type is always passed by reference.
func (*RTCPBuffer) AddPacket ¶
func (rtcp *RTCPBuffer) AddPacket(typ RTCPType, packet *RTCPPacket) bool
AddPacket: add a new packet of type to rtcp. packet will point to the newly created packet.
The function takes the following parameters:
- typ of the new packet.
- packet: pointer to new packet.
The function returns the following values:
- ok: TRUE if the packet could be created. This function returns FALSE if the max mtu is exceeded for the buffer.
func (*RTCPBuffer) Buffer ¶
func (r *RTCPBuffer) Buffer() *gst.Buffer
func (*RTCPBuffer) FirstPacket ¶
func (rtcp *RTCPBuffer) FirstPacket(packet *RTCPPacket) bool
FirstPacket: initialize a new RTCPPacket pointer that points to the first packet in rtcp.
The function takes the following parameters:
- packet: RTCPPacket.
The function returns the following values:
- ok: TRUE if the packet existed in rtcp.
func (*RTCPBuffer) Map ¶
func (r *RTCPBuffer) Map() *gst.MapInfo
func (*RTCPBuffer) PacketCount ¶
func (rtcp *RTCPBuffer) PacketCount() uint
PacketCount: get the number of RTCP packets in rtcp.
The function returns the following values:
- guint: number of RTCP packets in rtcp.
func (*RTCPBuffer) Unmap ¶
func (rtcp *RTCPBuffer) Unmap() bool
Unmap: finish rtcp after being constructed. This function is usually called after gst_rtcp_buffer_map() and after adding the RTCP items to the new buffer.
The function adjusts the size of rtcp with the total length of all the added packets.
The function returns the following values:
type RTCPFBType ¶
RTCPFBType: different types of feedback messages.
const ( // RtcpFbTypeInvalid: invalid type. RtcpFbTypeInvalid RTCPFBType = 0 // RtcpRtpfbTypeNack: generic NACK. RtcpRtpfbTypeNack RTCPFBType = 1 // RtcpRtpfbTypeTmmbr: temporary Maximum Media Stream Bit Rate Request. RtcpRtpfbTypeTmmbr RTCPFBType = 3 // RtcpRtpfbTypeTmmbn: temporary Maximum Media Stream Bit Rate Notification. RtcpRtpfbTypeTmmbn RTCPFBType = 4 // RtcpRtpfbTypeRtcpSrReq: request an SR packet for early synchronization. RtcpRtpfbTypeRtcpSrReq RTCPFBType = 5 RtcpRtpfbTypeTwcc RTCPFBType = 15 // RtcpPsfbTypePli: picture Loss Indication. RtcpPsfbTypePli RTCPFBType = 1 // RtcpPsfbTypeSli: slice Loss Indication. RtcpPsfbTypeSli RTCPFBType = 2 // RtcpPsfbTypeRpsi: reference Picture Selection Indication. RtcpPsfbTypeRpsi RTCPFBType = 3 // RtcpPsfbTypeAfb: application layer Feedback. RtcpPsfbTypeAfb RTCPFBType = 15 // RtcpPsfbTypeFir: full Intra Request Command. RtcpPsfbTypeFir RTCPFBType = 4 // RtcpPsfbTypeTstr: temporal-Spatial Trade-off Request. RtcpPsfbTypeTstr RTCPFBType = 5 // RtcpPsfbTypeTstn: temporal-Spatial Trade-off Notification. RtcpPsfbTypeTstn RTCPFBType = 6 // RtcpPsfbTypeVbcn: video Back Channel Message. RtcpPsfbTypeVbcn RTCPFBType = 7 )
func (RTCPFBType) String ¶
func (r RTCPFBType) String() string
String returns the name in string for RTCPFBType.
type RTCPPacket ¶
type RTCPPacket struct {
// contains filtered or unexported fields
}
RTCPPacket: data structure that points to a packet at offset in buffer. The size of the structure is made public to allow stack allocations.
An instance of this type is always passed by reference.
func (*RTCPPacket) AddProfileSpecificExt ¶
func (packet *RTCPPacket) AddProfileSpecificExt(data []byte) bool
AddProfileSpecificExt: add profile-specific extension data to packet. If packet already contains profile-specific extension data will be appended to the existing extension.
The function takes the following parameters:
- data: profile-specific data.
The function returns the following values:
- ok: TRUE if the profile specific extension data was added.
func (*RTCPPacket) AddRb ¶
func (packet *RTCPPacket) AddRb(ssrc uint32, fractionlost byte, packetslost int32, exthighestseq uint32, jitter uint32, lsr uint32, dlsr uint32) bool
AddRb: add a new report block to packet with the given values.
The function takes the following parameters:
- ssrc: data source being reported.
- fractionlost: fraction lost since last SR/RR.
- packetslost: cumululative number of packets lost.
- exthighestseq: extended last sequence number received.
- jitter: interarrival jitter.
- lsr: last SR packet from this source.
- dlsr: delay since last SR packet.
The function returns the following values:
- ok: TRUE if the packet was created. This function can return FALSE if the max MTU is exceeded or the number of report blocks is greater than T_RTCP_MAX_RB_COUNT.
func (*RTCPPacket) AppGetData ¶
func (packet *RTCPPacket) AppGetData() *byte
AppGetData: get the application-dependent data attached to a RTPFB or PSFB packet.
The function returns the following values:
- guint8: pointer to the data.
func (*RTCPPacket) AppGetDataLength ¶
func (packet *RTCPPacket) AppGetDataLength() uint16
AppGetDataLength: get the length of the application-dependent data attached to an APP packet.
The function returns the following values:
- guint16: length of data in 32-bit words.
func (*RTCPPacket) AppGetName ¶
func (packet *RTCPPacket) AppGetName() string
AppGetName: get the name field of the APP packet.
The function returns the following values:
- utf8: 4-byte name field, not zero-terminated.
func (*RTCPPacket) AppGetSsrc ¶
func (packet *RTCPPacket) AppGetSsrc() uint32
AppGetSsrc: get the SSRC/CSRC field of the APP packet.
The function returns the following values:
- guint32: SSRC/CSRC.
func (*RTCPPacket) AppGetSubtype ¶
func (packet *RTCPPacket) AppGetSubtype() byte
AppGetSubtype: get the subtype field of the APP packet.
The function returns the following values:
- guint8: subtype.
func (*RTCPPacket) AppSetDataLength ¶
func (packet *RTCPPacket) AppSetDataLength(wordlen uint16) bool
AppSetDataLength: set the length of the application-dependent data attached to an APP packet.
The function takes the following parameters:
- wordlen: length of the data in 32-bit words.
The function returns the following values:
- ok: TRUE if there was enough space in the packet to add this much data.
func (*RTCPPacket) AppSetName ¶
func (packet *RTCPPacket) AppSetName(name string)
AppSetName: set the name field of the APP packet.
The function takes the following parameters:
- name: 4-byte ASCII name.
func (*RTCPPacket) AppSetSsrc ¶
func (packet *RTCPPacket) AppSetSsrc(ssrc uint32)
AppSetSsrc: set the SSRC/CSRC field of the APP packet.
The function takes the following parameters:
- ssrc: SSRC/CSRC of the packet.
func (*RTCPPacket) AppSetSubtype ¶
func (packet *RTCPPacket) AppSetSubtype(subtype byte)
AppSetSubtype: set the subtype field of the APP packet.
The function takes the following parameters:
- subtype of the packet.
func (*RTCPPacket) ByeAddSsrc ¶
func (packet *RTCPPacket) ByeAddSsrc(ssrc uint32) bool
ByeAddSsrc: add ssrc to the BYE packet.
The function takes the following parameters:
- ssrc: SSRC to add.
The function returns the following values:
- ok: TRUE if the ssrc was added. This function can return FALSE if the max MTU is exceeded or the number of sources blocks is greater than T_RTCP_MAX_BYE_SSRC_COUNT.
func (*RTCPPacket) ByeAddSsrcs ¶
func (packet *RTCPPacket) ByeAddSsrcs(ssrc []uint32) bool
ByeAddSsrcs adds len SSRCs in ssrc to BYE packet.
The function takes the following parameters:
- ssrc: array of SSRCs to add.
The function returns the following values:
- ok: TRUE if the all the SSRCs were added. This function can return FALSE if the max MTU is exceeded or the number of sources blocks is greater than T_RTCP_MAX_BYE_SSRC_COUNT.
func (*RTCPPacket) ByeGetNthSsrc ¶
func (packet *RTCPPacket) ByeGetNthSsrc(nth uint) uint32
ByeGetNthSsrc: get the nth SSRC of the BYE packet.
The function takes the following parameters:
- nth SSRC to get.
The function returns the following values:
- guint32: nth SSRC of packet.
func (*RTCPPacket) ByeGetReason ¶
func (packet *RTCPPacket) ByeGetReason() string
ByeGetReason: get the reason in packet.
The function returns the following values:
- utf8: reason for the BYE packet or NULL if the packet did not contain a reason string. The string must be freed with g_free() after usage.
func (*RTCPPacket) ByeGetReasonLen ¶
func (packet *RTCPPacket) ByeGetReasonLen() byte
ByeGetReasonLen: get the length of the reason string.
The function returns the following values:
- guint8: length of the reason string or 0 when there is no reason string present.
func (*RTCPPacket) ByeGetSsrcCount ¶
func (packet *RTCPPacket) ByeGetSsrcCount() uint
ByeGetSsrcCount: get the number of SSRC fields in packet.
The function returns the following values:
- guint: number of SSRC fields in packet.
func (*RTCPPacket) ByeSetReason ¶
func (packet *RTCPPacket) ByeSetReason(reason string) bool
ByeSetReason: set the reason string to reason in packet.
The function takes the following parameters:
- reason string.
The function returns the following values:
- ok: TRUE if the string could be set.
func (*RTCPPacket) CopyProfileSpecificExt ¶
func (packet *RTCPPacket) CopyProfileSpecificExt() ([]byte, bool)
CopyProfileSpecificExt: profile-specific extension data is copied into a new allocated memory area data. This must be freed with g_free() after usage.
The function returns the following values:
- data: result profile-specific data.
- ok: TRUE if there was valid data.
func (*RTCPPacket) Count ¶
func (packet *RTCPPacket) Count() byte
Count: get the count field in packet.
The function returns the following values:
- guint8: count field in packet or -1 if packet does not point to a valid packet.
func (*RTCPPacket) FbGetFci ¶
func (packet *RTCPPacket) FbGetFci() *byte
FbGetFci: get the Feedback Control Information attached to a RTPFB or PSFB packet.
The function returns the following values:
- guint8: pointer to the FCI.
func (*RTCPPacket) FbGetFciLength ¶
func (packet *RTCPPacket) FbGetFciLength() uint16
FbGetFciLength: get the length of the Feedback Control Information attached to a RTPFB or PSFB packet.
The function returns the following values:
- guint16: length of the FCI in 32-bit words.
func (*RTCPPacket) FbGetMediaSsrc ¶
func (packet *RTCPPacket) FbGetMediaSsrc() uint32
FbGetMediaSsrc: get the media SSRC field of the RTPFB or PSFB packet.
The function returns the following values:
- guint32: media SSRC.
func (*RTCPPacket) FbGetSenderSsrc ¶
func (packet *RTCPPacket) FbGetSenderSsrc() uint32
FbGetSenderSsrc: get the sender SSRC field of the RTPFB or PSFB packet.
The function returns the following values:
- guint32: sender SSRC.
func (*RTCPPacket) FbGetType ¶
func (packet *RTCPPacket) FbGetType() RTCPFBType
FbGetType: get the feedback message type of the FB packet.
The function returns the following values:
- rtcpfbType: feedback message type.
func (*RTCPPacket) FbSetFciLength ¶
func (packet *RTCPPacket) FbSetFciLength(wordlen uint16) bool
FbSetFciLength: set the length of the Feedback Control Information attached to a RTPFB or PSFB packet.
The function takes the following parameters:
- wordlen: length of the FCI in 32-bit words.
The function returns the following values:
- ok: TRUE if there was enough space in the packet to add this much FCI.
func (*RTCPPacket) FbSetMediaSsrc ¶
func (packet *RTCPPacket) FbSetMediaSsrc(ssrc uint32)
FbSetMediaSsrc: set the media SSRC field of the RTPFB or PSFB packet.
The function takes the following parameters:
- ssrc: media SSRC.
func (*RTCPPacket) FbSetSenderSsrc ¶
func (packet *RTCPPacket) FbSetSenderSsrc(ssrc uint32)
FbSetSenderSsrc: set the sender SSRC field of the RTPFB or PSFB packet.
The function takes the following parameters:
- ssrc: sender SSRC.
func (*RTCPPacket) FbSetType ¶
func (packet *RTCPPacket) FbSetType(typ RTCPFBType)
FbSetType: set the feedback message type of the FB packet.
The function takes the following parameters:
- typ to set.
func (*RTCPPacket) Length ¶
func (packet *RTCPPacket) Length() uint16
Length: get the length field of packet. This is the length of the packet in 32-bit words minus one.
The function returns the following values:
- guint16: length field of packet.
func (*RTCPPacket) MoveToNext ¶
func (packet *RTCPPacket) MoveToNext() bool
MoveToNext: move the packet pointer packet to the next packet in the payload. Use gst_rtcp_buffer_get_first_packet() to initialize packet.
The function returns the following values:
- ok: TRUE if packet is pointing to a valid packet after calling this function.
func (*RTCPPacket) Offset ¶
func (r *RTCPPacket) Offset() uint
Offset: offset of packet in buffer data.
func (*RTCPPacket) Padding ¶
func (packet *RTCPPacket) Padding() bool
Padding: get the packet padding of the packet pointed to by packet.
The function returns the following values:
- ok: if the packet has the padding bit set.
func (*RTCPPacket) ProfileSpecificExt ¶
func (packet *RTCPPacket) ProfileSpecificExt() ([]byte, bool)
The function returns the following values:
- data: result profile-specific data.
- ok: TRUE if there was valid data.
func (*RTCPPacket) ProfileSpecificExtLength ¶
func (packet *RTCPPacket) ProfileSpecificExtLength() uint16
The function returns the following values:
- guint16: number of 32-bit words containing profile-specific extension data from packet.
func (*RTCPPacket) Rb ¶
func (packet *RTCPPacket) Rb(nth uint) (ssrc uint32, fractionlost byte, packetslost int32, exthighestseq uint32, jitter uint32, lsr uint32, dlsr uint32)
Rb: parse the values of the nth report block in packet and store the result in the values.
The function takes the following parameters:
- nth report block in packet.
The function returns the following values:
- ssrc: result for data source being reported.
- fractionlost: result for fraction lost since last SR/RR.
- packetslost: result for the cumululative number of packets lost.
- exthighestseq: result for the extended last sequence number received.
- jitter: result for the interarrival jitter.
- lsr: result for the last SR packet from this source.
- dlsr: result for the delay since last SR packet.
func (*RTCPPacket) RbCount ¶
func (packet *RTCPPacket) RbCount() uint
RbCount: get the number of report blocks in packet.
The function returns the following values:
- guint: number of report blocks in packet.
func (*RTCPPacket) Remove ¶
func (packet *RTCPPacket) Remove() bool
Remove removes the packet pointed to by packet and moves pointer to the next one.
The function returns the following values:
- ok: TRUE if packet is pointing to a valid packet after calling this function.
func (*RTCPPacket) RrGetSsrc ¶
func (packet *RTCPPacket) RrGetSsrc() uint32
RrGetSsrc: get the ssrc field of the RR packet.
The function returns the following values:
- guint32: ssrc.
func (*RTCPPacket) RrSetSsrc ¶
func (packet *RTCPPacket) RrSetSsrc(ssrc uint32)
RrSetSsrc: set the ssrc field of the RR packet.
The function takes the following parameters:
- ssrc: SSRC to set.
func (*RTCPPacket) SdesAddEntry ¶
func (packet *RTCPPacket) SdesAddEntry(typ RTCPSDESType, data []byte) bool
SdesAddEntry: add a new SDES entry to the current item in packet.
The function takes the following parameters:
- typ of the SDES entry.
- data: data.
The function returns the following values:
- ok: TRUE if the item could be added, FALSE if the MTU has been reached.
func (*RTCPPacket) SdesAddItem ¶
func (packet *RTCPPacket) SdesAddItem(ssrc uint32) bool
SdesAddItem: add a new SDES item for ssrc to packet.
The function takes the following parameters:
- ssrc: SSRC of the new item to add.
The function returns the following values:
- ok: TRUE if the item could be added, FALSE if the maximum amount of items has been exceeded for the SDES packet or the MTU has been reached.
func (*RTCPPacket) SdesCopyEntry ¶
func (packet *RTCPPacket) SdesCopyEntry(typ *RTCPSDESType) ([]byte, bool)
SdesCopyEntry: this function is like gst_rtcp_packet_sdes_get_entry() but it returns a null-terminated copy of the data instead. use g_free() after usage.
The function takes the following parameters:
- typ: result of the entry type.
The function returns the following values:
- data: result entry data.
- ok: TRUE if there was valid data.
func (*RTCPPacket) SdesFirstEntry ¶
func (packet *RTCPPacket) SdesFirstEntry() bool
SdesFirstEntry: move to the first SDES entry in the current item.
The function returns the following values:
- ok: TRUE if there was a first entry.
func (*RTCPPacket) SdesFirstItem ¶
func (packet *RTCPPacket) SdesFirstItem() bool
SdesFirstItem: move to the first SDES item in packet.
The function returns the following values:
- ok: TRUE if there was a first item.
func (*RTCPPacket) SdesGetEntry ¶
func (packet *RTCPPacket) SdesGetEntry(typ *RTCPSDESType) ([]byte, bool)
SdesGetEntry: get the data of the current SDES item entry. type (when not NULL) will contain the type of the entry. data (when not NULL) will point to len bytes.
When type refers to a text item, data will point to a UTF8 string. Note that this UTF8 string is NOT null-terminated. Use gst_rtcp_packet_sdes_copy_entry() to get a null-terminated copy of the entry.
The function takes the following parameters:
- typ: result of the entry type.
The function returns the following values:
- data: result entry data.
- ok: TRUE if there was valid data.
func (*RTCPPacket) SdesGetItemCount ¶
func (packet *RTCPPacket) SdesGetItemCount() uint
SdesGetItemCount: get the number of items in the SDES packet packet.
The function returns the following values:
- guint: number of items in packet.
func (*RTCPPacket) SdesGetSsrc ¶
func (packet *RTCPPacket) SdesGetSsrc() uint32
SdesGetSsrc: get the SSRC of the current SDES item.
The function returns the following values:
- guint32: SSRC of the current item.
func (*RTCPPacket) SdesNextEntry ¶
func (packet *RTCPPacket) SdesNextEntry() bool
SdesNextEntry: move to the next SDES entry in the current item.
The function returns the following values:
- ok: TRUE if there was a next entry.
func (*RTCPPacket) SdesNextItem ¶
func (packet *RTCPPacket) SdesNextItem() bool
SdesNextItem: move to the next SDES item in packet.
The function returns the following values:
- ok: TRUE if there was a next item.
func (*RTCPPacket) SetOffset ¶
func (r *RTCPPacket) SetOffset(offset uint)
Offset: offset of packet in buffer data.
func (*RTCPPacket) SetRb ¶
func (packet *RTCPPacket) SetRb(nth uint, ssrc uint32, fractionlost byte, packetslost int32, exthighestseq uint32, jitter uint32, lsr uint32, dlsr uint32)
SetRb: set the nth new report block in packet with the given values.
Note: Not implemented.
The function takes the following parameters:
- nth report block to set.
- ssrc: data source being reported.
- fractionlost: fraction lost since last SR/RR.
- packetslost: cumululative number of packets lost.
- exthighestseq: extended last sequence number received.
- jitter: interarrival jitter.
- lsr: last SR packet from this source.
- dlsr: delay since last SR packet.
func (*RTCPPacket) SrGetSenderInfo ¶
func (packet *RTCPPacket) SrGetSenderInfo() (ssrc uint32, ntptime uint64, rtptime uint32, packetCount uint32, octetCount uint32)
SrGetSenderInfo: parse the SR sender info and store the values.
The function returns the following values:
- ssrc: result SSRC.
- ntptime: result NTP time.
- rtptime: result RTP time.
- packetCount: result packet count.
- octetCount: result octet count.
func (*RTCPPacket) SrSetSenderInfo ¶
func (packet *RTCPPacket) SrSetSenderInfo(ssrc uint32, ntptime uint64, rtptime uint32, packetCount uint32, octetCount uint32)
SrSetSenderInfo: set the given values in the SR packet packet.
The function takes the following parameters:
- ssrc: SSRC.
- ntptime: NTP time.
- rtptime: RTP time.
- packetCount: packet count.
- octetCount: octet count.
func (*RTCPPacket) Type ¶
func (packet *RTCPPacket) Type() RTCPType
Type: get the packet type of the packet pointed to by packet.
The function returns the following values:
- rtcpType: packet type or GST_RTCP_TYPE_INVALID when packet is not pointing to a valid packet.
func (*RTCPPacket) XRFirstRb ¶
func (packet *RTCPPacket) XRFirstRb() bool
XRFirstRb: move to the first extended report block in XR packet.
The function returns the following values:
- ok: TRUE if there was a first extended report block.
func (*RTCPPacket) XRGetBlockLength ¶
func (packet *RTCPPacket) XRGetBlockLength() uint16
The function returns the following values:
- guint16: number of 32-bit words containing type-specific block data from packet.
func (*RTCPPacket) XRGetBlockType ¶
func (packet *RTCPPacket) XRGetBlockType() RTCPXRType
XRGetBlockType: get the extended report block type of the XR packet.
The function returns the following values:
- rtcpxrType: extended report block type.
func (*RTCPPacket) XRGetDlrrBlock ¶
func (packet *RTCPPacket) XRGetDlrrBlock(nth uint, ssrc *uint32, lastRr *uint32, delay *uint32) bool
XRGetDlrrBlock: parse the extended report block for DLRR report block type.
The function takes the following parameters:
- nth: index of sub-block to retrieve.
- ssrc: SSRC of the receiver.
- lastRr: last receiver reference timestamp of ssrc.
- delay since last_rr.
The function returns the following values:
- ok: TRUE if the report block is correctly parsed.
func (*RTCPPacket) XRGetPrtBySeq ¶
func (packet *RTCPPacket) XRGetPrtBySeq(seq uint16, receiptTime *uint32) bool
XRGetPrtBySeq: retrieve the packet receipt time of seq which ranges in [begin_seq, end_seq).
The function takes the following parameters:
- seq: sequence to retrieve the time.
- receiptTime: packet receipt time of seq.
The function returns the following values:
- ok: TRUE if the report block returns the receipt time correctly.
func (*RTCPPacket) XRGetPrtInfo ¶
func (packet *RTCPPacket) XRGetPrtInfo(ssrc *uint32, thinning *byte, beginSeq *uint16, endSeq *uint16) bool
XRGetPrtInfo: parse the Packet Recept Times Report Block from a XR packet.
The function takes the following parameters:
- ssrc: SSRC of the RTP data packet source being reported upon by this report block.
- thinning: amount of thinning performed on the sequence number space.
- beginSeq: first sequence number that this block reports on.
- endSeq: last sequence number that this block reports on plus one.
The function returns the following values:
- ok: TRUE if the report block is correctly parsed.
func (*RTCPPacket) XRGetRLEInfo ¶
func (packet *RTCPPacket) XRGetRLEInfo(ssrc *uint32, thinning *byte, beginSeq *uint16, endSeq *uint16, chunkCount *uint32) bool
XRGetRLEInfo: parse the extended report block for Loss RLE and Duplicated LRE block type.
The function takes the following parameters:
- ssrc: SSRC of the RTP data packet source being reported upon by this report block.
- thinning: amount of thinning performed on the sequence number space.
- beginSeq: first sequence number that this block reports on.
- endSeq: last sequence number that this block reports on plus one.
- chunkCount: number of chunks calculated by block length.
The function returns the following values:
- ok: TRUE if the report block is correctly parsed.
func (*RTCPPacket) XRGetRLENthChunk ¶
func (packet *RTCPPacket) XRGetRLENthChunk(nth uint, chunk *uint16) bool
XRGetRLENthChunk: retrieve actual chunk data.
The function takes the following parameters:
- nth: index of chunk to retrieve.
- chunk: nth chunk.
The function returns the following values:
- ok: TRUE if the report block returns chunk correctly.
func (*RTCPPacket) XRGetRrt ¶
func (packet *RTCPPacket) XRGetRrt(timestamp *uint64) bool
The function takes the following parameters:
- timestamp: NTP timestamp.
The function returns the following values:
- ok: TRUE if the report block returns the reference time correctly.
func (*RTCPPacket) XRGetSsrc ¶
func (packet *RTCPPacket) XRGetSsrc() uint32
XRGetSsrc: get the ssrc field of the XR packet.
The function returns the following values:
- guint32: ssrc.
func (*RTCPPacket) XRGetSummaryInfo ¶
func (packet *RTCPPacket) XRGetSummaryInfo(ssrc *uint32, beginSeq *uint16, endSeq *uint16) bool
XRGetSummaryInfo: extract a basic information from static summary report block of XR packet.
The function takes the following parameters:
- ssrc: SSRC of the source.
- beginSeq: first sequence number that this block reports on.
- endSeq: last sequence number that this block reports on plus one.
The function returns the following values:
- ok: TRUE if the report block is correctly parsed.
func (*RTCPPacket) XRGetSummaryJitter ¶
func (packet *RTCPPacket) XRGetSummaryJitter(minJitter *uint32, maxJitter *uint32, meanJitter *uint32, devJitter *uint32) bool
XRGetSummaryJitter: extract jitter information from the statistics summary. If the jitter flag in a block header is set as zero, all of jitters will be zero.
The function takes the following parameters:
- minJitter: minimum relative transit time between two sequences.
- maxJitter: maximum relative transit time between two sequences.
- meanJitter: mean relative transit time between two sequences.
- devJitter: standard deviation of the relative transit time between two sequences.
The function returns the following values:
- ok: TRUE if the report block is correctly parsed.
func (*RTCPPacket) XRGetSummaryPkt ¶
func (packet *RTCPPacket) XRGetSummaryPkt(lostPackets *uint32, dupPackets *uint32) bool
XRGetSummaryPkt: get the number of lost or duplicate packets. If the flag in a block header is set as zero, lost_packets or dup_packets will be zero.
The function takes the following parameters:
- lostPackets: number of lost packets between begin_seq and end_seq.
- dupPackets: number of duplicate packets between begin_seq and end_seq.
The function returns the following values:
- ok: TRUE if the report block is correctly parsed.
func (*RTCPPacket) XRGetVoipBurstMetrics ¶
func (packet *RTCPPacket) XRGetVoipBurstMetrics(burstDensity *byte, gapDensity *byte, burstDuration *uint16, gapDuration *uint16) bool
The function takes the following parameters:
- burstDensity: fraction of RTP data packets within burst periods.
- gapDensity: fraction of RTP data packets within inter-burst gaps.
- burstDuration: mean duration(ms) of the burst periods.
- gapDuration: mean duration(ms) of the gap periods.
The function returns the following values:
- ok: TRUE if the report block is correctly parsed.
func (*RTCPPacket) XRGetVoipConfigurationParams ¶
func (packet *RTCPPacket) XRGetVoipConfigurationParams(gmin *byte, rxConfig *byte) bool
The function takes the following parameters:
- gmin: gap threshold.
- rxConfig: receiver configuration byte.
The function returns the following values:
- ok: TRUE if the report block is correctly parsed.
func (*RTCPPacket) XRGetVoipDelayMetrics ¶
func (packet *RTCPPacket) XRGetVoipDelayMetrics(roundtripDelay *uint16, endSystemDelay *uint16) bool
The function takes the following parameters:
- roundtripDelay: most recently calculated round trip time between RTP interfaces(ms).
- endSystemDelay: most recently estimated end system delay(ms).
The function returns the following values:
- ok: TRUE if the report block is correctly parsed.
func (*RTCPPacket) XRGetVoipJitterBufferParams ¶
func (packet *RTCPPacket) XRGetVoipJitterBufferParams(jbNominal *uint16, jbMaximum *uint16, jbAbsMax *uint16) bool
The function takes the following parameters:
- jbNominal: current nominal jitter buffer delay(ms).
- jbMaximum: current maximum jitter buffer delay(ms).
- jbAbsMax: absolute maximum delay(ms).
The function returns the following values:
- ok: TRUE if the report block is correctly parsed.
func (*RTCPPacket) XRGetVoipMetricsSsrc ¶
func (packet *RTCPPacket) XRGetVoipMetricsSsrc(ssrc *uint32) bool
The function takes the following parameters:
- ssrc: SSRC of source.
The function returns the following values:
- ok: TRUE if the report block is correctly parsed.
func (*RTCPPacket) XRGetVoipPacketMetrics ¶
func (packet *RTCPPacket) XRGetVoipPacketMetrics(lossRate *byte, discardRate *byte) bool
The function takes the following parameters:
- lossRate: fraction of RTP data packets from the source lost.
- discardRate: fraction of RTP data packets from the source that have been discarded.
The function returns the following values:
- ok: TRUE if the report block is correctly parsed.
func (*RTCPPacket) XRGetVoipQualityMetrics ¶
func (packet *RTCPPacket) XRGetVoipQualityMetrics(rFactor *byte, extRFactor *byte, mosLq *byte, mosCq *byte) bool
The function takes the following parameters:
- rFactor: r factor is a voice quality metric describing the segment of the call.
- extRFactor: external R factor is a voice quality metric.
- mosLq: estimated mean opinion score for listening quality.
- mosCq: estimated mean opinion score for conversational quality.
The function returns the following values:
- ok: TRUE if the report block is correctly parsed.
func (*RTCPPacket) XRGetVoipSignalMetrics ¶
func (packet *RTCPPacket) XRGetVoipSignalMetrics(signalLevel *byte, noiseLevel *byte, rerl *byte, gmin *byte) bool
The function takes the following parameters:
- signalLevel: ratio of the signal level to a 0 dBm reference.
- noiseLevel: ratio of the silent period background noise level to a 0 dBm reference.
- rerl: residual echo return loss value.
- gmin: gap threshold.
The function returns the following values:
- ok: TRUE if the report block is correctly parsed.
func (*RTCPPacket) XRNextRb ¶
func (packet *RTCPPacket) XRNextRb() bool
XRNextRb: move to the next extended report block in XR packet.
The function returns the following values:
- ok: TRUE if there was a next extended report block.
type RTCPSDESType ¶
RTCPSDESType: different types of SDES content.
const ( // RtcpSdesInvalid: invalid SDES entry. RtcpSdesInvalid RTCPSDESType = -1 // RtcpSdesEnd: end of SDES list. RtcpSdesEnd RTCPSDESType = 0 // RtcpSdesCname: canonical name. RtcpSdesCname RTCPSDESType = 1 // RtcpSdesName: user name. RtcpSdesName RTCPSDESType = 2 // RtcpSdesEmail user's electronic mail address. RtcpSdesEmail RTCPSDESType = 3 // RtcpSdesPhone user's phone number. RtcpSdesPhone RTCPSDESType = 4 // RtcpSdesLoc: geographic user location. RtcpSdesLoc RTCPSDESType = 5 // RtcpSdesTool: name of application or tool. RtcpSdesTool RTCPSDESType = 6 // RtcpSdesNote: notice about the source. RtcpSdesNote RTCPSDESType = 7 // RtcpSdesPriv: private extensions. RtcpSdesPriv RTCPSDESType = 8 // RtcpSdesH323Caddr: h.323 callable address. RtcpSdesH323Caddr RTCPSDESType = 9 // RtcpSdesApsi: application Specific Identifier (RFC6776). RtcpSdesApsi RTCPSDESType = 10 // RtcpSdesRgrp: reporting Group Identifier (RFC8861). RtcpSdesRgrp RTCPSDESType = 11 // RtcpSdesRtpStreamID: rtpStreamId SDES item (RFC8852). RtcpSdesRtpStreamID RTCPSDESType = 12 // RtcpSdesRepairedRtpStreamID: repairedRtpStreamId SDES item (RFC8852). RtcpSdesRepairedRtpStreamID RTCPSDESType = 13 // RtcpSdesCcid: CLUE CaptId (RFC8849). RtcpSdesCcid RTCPSDESType = 14 // RtcpSdesMid: MID SDES item (RFC8843). RtcpSdesMid RTCPSDESType = 15 )
func RtcpSdesNameToType ¶
func RtcpSdesNameToType(name string) RTCPSDESType
RtcpSdesNameToType: convert name into a GstRTCPSDESType. name is typically a key in a Structure containing SDES items.
The function takes the following parameters:
- name: SDES name.
The function returns the following values:
- rtcpsdesType for name or T_RTCP_SDES_PRIV when name is a private sdes item.
func (RTCPSDESType) String ¶
func (r RTCPSDESType) String() string
String returns the name in string for RTCPSDESType.
type RTCPType ¶
RTCPType: different RTCP packet types.
const ( // RtcpTypeInvalid: invalid type. RtcpTypeInvalid RTCPType = 0 // RtcpTypeSr: sender report. RtcpTypeSr RTCPType = 200 // RtcpTypeRr: receiver report. RtcpTypeRr RTCPType = 201 // RtcpTypeSdes: source description. RtcpTypeSdes RTCPType = 202 // RtcpTypeBye: goodbye. RtcpTypeBye RTCPType = 203 // RtcpTypeApp: application defined. RtcpTypeApp RTCPType = 204 // RtcpTypeRtpfb: transport layer feedback. RtcpTypeRtpfb RTCPType = 205 // RtcpTypePsfb: payload-specific feedback. RtcpTypePsfb RTCPType = 206 // RtcpTypeXR: extended report. RtcpTypeXR RTCPType = 207 )
type RTCPXRType ¶
RTCPXRType types of RTCP Extended Reports, those are defined in RFC 3611 and other RFCs according to the IANA registry (https://www.iana.org/assignments/rtcp-xr-block-types/rtcp-xr-block-types.xhtml).
const ( // RtcpXRTypeInvalid: invalid XR Report Block. RtcpXRTypeInvalid RTCPXRType = -1 // RtcpXRTypeLrle loss RLE Report Block. RtcpXRTypeLrle RTCPXRType = 1 // RtcpXRTypeDrle: duplicate RLE Report Block. RtcpXRTypeDrle RTCPXRType = 2 // RtcpXRTypePrt: packet Receipt Times Report Block. RtcpXRTypePrt RTCPXRType = 3 // RtcpXRTypeRrt: receiver Reference Time Report Block. RtcpXRTypeRrt RTCPXRType = 4 // RtcpXRTypeDlrr: delay since the last Receiver Report. RtcpXRTypeDlrr RTCPXRType = 5 // RtcpXRTypeSsumm statistics Summary Report Block. RtcpXRTypeSsumm RTCPXRType = 6 // RtcpXRTypeVoipMetrics: voIP Metrics Report Block. RtcpXRTypeVoipMetrics RTCPXRType = 7 )
func (RTCPXRType) String ¶
func (r RTCPXRType) String() string
String returns the name in string for RTCPXRType.
type RTPBaseAudioPayload ¶
type RTPBaseAudioPayload struct { RTPBasePayload // contains filtered or unexported fields }
RTPBaseAudioPayload provides a base class for audio RTP payloaders for frame or sample based audio codecs (constant bitrate)
This class derives from GstRTPBasePayload. It can be used for payloading audio codecs. It will only work with constant bitrate codecs. It supports both frame based and sample based codecs. It takes care of packing up the audio data into RTP packets and filling up the headers accordingly. The payloading is done based on the maximum MTU (mtu) and the maximum time per packet (max-ptime). The general idea is to divide large data buffers into smaller RTP packets. The RTP packet size is the minimum of either the MTU, max-ptime (if set) or available data. The RTP packet size is always larger or equal to min-ptime (if set). If min-ptime is not set, any residual data is sent in a last RTP packet. In the case of frame based codecs, the resulting RTP packets always contain full frames.
Usage ¶
To use this base class, your child element needs to call either gst_rtp_base_audio_payload_set_frame_based() or gst_rtp_base_audio_payload_set_sample_based(). This is usually done in the element's _init() function. Then, the child element must call either gst_rtp_base_audio_payload_set_frame_options(), gst_rtp_base_audio_payload_set_sample_options() or gst_rtp_base_audio_payload_set_samplebits_options. Since GstRTPBaseAudioPayload derives from GstRTPBasePayload, the child element must set any variables or call/override any functions required by that base class. The child element does not need to override any other functions specific to GstRTPBaseAudioPayload.
func (*RTPBaseAudioPayload) Adapter ¶
func (rtpbaseaudiopayload *RTPBaseAudioPayload) Adapter() *gstbase.Adapter
Adapter gets the internal adapter used by the depayloader.
The function returns the following values:
- adapter: Adapter.
func (*RTPBaseAudioPayload) Flush ¶
func (baseaudiopayload *RTPBaseAudioPayload) Flush(payloadLen uint, timestamp gst.ClockTime) gst.FlowReturn
Flush: create an RTP buffer and store payload_len bytes of the adapter as the payload. Set the timestamp on the new buffer to timestamp before pushing the buffer downstream.
If payload_len is -1, all pending bytes will be flushed. If timestamp is -1, the timestamp will be calculated automatically.
The function takes the following parameters:
- payloadLen: length of payload.
- timestamp: ClockTime.
The function returns the following values:
- flowReturn: FlowReturn.
func (*RTPBaseAudioPayload) Push ¶
func (baseaudiopayload *RTPBaseAudioPayload) Push(data []byte, timestamp gst.ClockTime) gst.FlowReturn
Push: create an RTP buffer and store payload_len bytes of data as the payload. Set the timestamp on the new buffer to timestamp before pushing the buffer downstream.
The function takes the following parameters:
- data to set as payload.
- timestamp: ClockTime.
The function returns the following values:
- flowReturn: FlowReturn.
func (*RTPBaseAudioPayload) SetFrameBased ¶
func (rtpbaseaudiopayload *RTPBaseAudioPayload) SetFrameBased()
SetFrameBased tells RTPBaseAudioPayload that the child element is for a frame based audio codec.
func (*RTPBaseAudioPayload) SetFrameOptions ¶
func (rtpbaseaudiopayload *RTPBaseAudioPayload) SetFrameOptions(frameDuration, frameSize int)
SetFrameOptions sets the options for frame based audio codecs.
The function takes the following parameters:
- frameDuration: duraction of an audio frame in milliseconds.
- frameSize: size of an audio frame in bytes.
func (*RTPBaseAudioPayload) SetSampleBased ¶
func (rtpbaseaudiopayload *RTPBaseAudioPayload) SetSampleBased()
SetSampleBased tells RTPBaseAudioPayload that the child element is for a sample based audio codec.
func (*RTPBaseAudioPayload) SetSampleOptions ¶
func (rtpbaseaudiopayload *RTPBaseAudioPayload) SetSampleOptions(sampleSize int)
SetSampleOptions sets the options for sample based audio codecs.
The function takes the following parameters:
- sampleSize: size per sample in bytes.
func (*RTPBaseAudioPayload) SetSamplebitsOptions ¶
func (rtpbaseaudiopayload *RTPBaseAudioPayload) SetSamplebitsOptions(sampleSize int)
SetSamplebitsOptions sets the options for sample based audio codecs.
The function takes the following parameters:
- sampleSize: size per sample in bits.
type RTPBaseAudioPayloadClass ¶
type RTPBaseAudioPayloadClass struct {
// contains filtered or unexported fields
}
RTPBaseAudioPayloadClass: base class for audio RTP payloader.
An instance of this type is always passed by reference.
func (*RTPBaseAudioPayloadClass) ParentClass ¶
func (r *RTPBaseAudioPayloadClass) ParentClass() *RTPBasePayloadClass
ParentClass: parent class.
type RTPBaseAudioPayloadOverrides ¶
type RTPBaseAudioPayloadOverrides struct { }
RTPBaseAudioPayloadOverrides contains methods that are overridable.
type RTPBaseDepayload ¶
RTPBaseDepayload provides a base class for RTP depayloaders.
func BaseRTPBaseDepayload ¶
func BaseRTPBaseDepayload(obj RTPBaseDepayloader) *RTPBaseDepayload
BaseRTPBaseDepayload returns the underlying base object.
func (*RTPBaseDepayload) ConnectAddExtension ¶
func (depayload *RTPBaseDepayload) ConnectAddExtension(f func(ext RTPHeaderExtensioner)) coreglib.SignalHandle
ConnectAddExtension: add ext as an extension for reading part of an RTP header extension from incoming RTP packets.
func (*RTPBaseDepayload) ConnectClearExtensions ¶
func (depayload *RTPBaseDepayload) ConnectClearExtensions(f func()) coreglib.SignalHandle
ConnectClearExtensions: clear all RTP header extensions used by this depayloader.
func (*RTPBaseDepayload) ConnectRequestExtension ¶
func (depayload *RTPBaseDepayload) ConnectRequestExtension(f func(extId uint, extUri string) (rtpHeaderExtension RTPHeaderExtensioner)) coreglib.SignalHandle
ConnectRequestExtension: returned ext must be configured with the correct ext_id and with the necessary attributes as required by the extension implementation.
func (*RTPBaseDepayload) IsSourceInfoEnabled ¶
func (depayload *RTPBaseDepayload) IsSourceInfoEnabled() bool
IsSourceInfoEnabled queries whether RTPSourceMeta will be added to depayloaded buffers.
The function returns the following values:
- ok: TRUE if source-info is enabled.
func (*RTPBaseDepayload) Push ¶
func (filter *RTPBaseDepayload) Push(outBuf *gst.Buffer) gst.FlowReturn
Push out_buf to the peer of filter. This function takes ownership of out_buf.
This function will by default apply the last incoming timestamp on the outgoing buffer when it didn't have a timestamp already.
The function takes the following parameters:
- outBuf: Buffer.
The function returns the following values:
- flowReturn: FlowReturn.
func (*RTPBaseDepayload) PushList ¶
func (filter *RTPBaseDepayload) PushList(outList *gst.BufferList) gst.FlowReturn
PushList: push out_list to the peer of filter. This function takes ownership of out_list.
The function takes the following parameters:
- outList: BufferList.
The function returns the following values:
- flowReturn: FlowReturn.
func (*RTPBaseDepayload) SetSourceInfoEnabled ¶
func (depayload *RTPBaseDepayload) SetSourceInfoEnabled(enable bool)
SetSourceInfoEnabled: enable or disable adding RTPSourceMeta to depayloaded buffers.
The function takes the following parameters:
- enable: whether to add meta about RTP sources to buffer.
type RTPBaseDepayloadClass ¶
type RTPBaseDepayloadClass struct {
// contains filtered or unexported fields
}
RTPBaseDepayloadClass: base class for RTP depayloaders.
An instance of this type is always passed by reference.
func (*RTPBaseDepayloadClass) ParentClass ¶
func (r *RTPBaseDepayloadClass) ParentClass() *gst.ElementClass
ParentClass: parent class.
type RTPBaseDepayloadOverrides ¶
type RTPBaseDepayloadOverrides struct { // The function takes the following parameters: // // The function returns the following values: // HandleEvent func(event *gst.Event) bool // The function takes the following parameters: // // The function returns the following values: // PacketLost func(event *gst.Event) bool // The function takes the following parameters: // // The function returns the following values: // Process func(in *gst.Buffer) *gst.Buffer // The function takes the following parameters: // // The function returns the following values: // ProcessRtpPacket func(rtpBuffer *RTPBuffer) *gst.Buffer // The function takes the following parameters: // // The function returns the following values: // SetCaps func(caps *gst.Caps) bool }
RTPBaseDepayloadOverrides contains methods that are overridable.
type RTPBaseDepayloader ¶
RTPBaseDepayloader describes types inherited from class RTPBaseDepayload.
To get the original type, the caller must assert this to an interface or another type.
type RTPBasePayload ¶
RTPBasePayload provides a base class for RTP payloaders.
func BaseRTPBasePayload ¶
func BaseRTPBasePayload(obj RTPBasePayloader) *RTPBasePayload
BaseRTPBasePayload returns the underlying base object.
func (*RTPBasePayload) AllocateOutputBuffer ¶
func (payload *RTPBasePayload) AllocateOutputBuffer(payloadLen uint, padLen, csrcCount byte) *gst.Buffer
AllocateOutputBuffer: allocate a new Buffer with enough data to hold an RTP packet with minimum csrc_count CSRCs, a payload length of payload_len and padding of pad_len. If payload has RTPBasePayload:source-info TRUE additional CSRCs may be allocated and filled with RTP source information.
The function takes the following parameters:
- payloadLen: length of the payload.
- padLen: amount of padding.
- csrcCount: minimum number of CSRC entries.
The function returns the following values:
- buffer: newly allocated buffer that can hold an RTP packet with given parameters.
func (*RTPBasePayload) ConnectAddExtension ¶
func (payload *RTPBasePayload) ConnectAddExtension(f func(ext RTPHeaderExtensioner)) coreglib.SignalHandle
ConnectAddExtension: add ext as an extension for writing part of an RTP header extension onto outgoing RTP packets.
func (*RTPBasePayload) ConnectClearExtensions ¶
func (payload *RTPBasePayload) ConnectClearExtensions(f func()) coreglib.SignalHandle
ConnectClearExtensions: clear all RTP header extensions used by this payloader.
func (*RTPBasePayload) ConnectRequestExtension ¶
func (payload *RTPBasePayload) ConnectRequestExtension(f func(extId uint, extUri string) (rtpHeaderExtension RTPHeaderExtensioner)) coreglib.SignalHandle
ConnectRequestExtension: returned ext must be configured with the correct ext_id and with the necessary attributes as required by the extension implementation.
func (*RTPBasePayload) IsFilled ¶
func (payload *RTPBasePayload) IsFilled(size uint, duration gst.ClockTime) bool
IsFilled: check if the packet with size and duration would exceed the configured maximum size.
The function takes the following parameters:
- size of the packet.
- duration of the packet.
The function returns the following values:
- ok: TRUE if the packet of size and duration would exceed the configured MTU or max_ptime.
func (*RTPBasePayload) IsSourceInfoEnabled ¶
func (payload *RTPBasePayload) IsSourceInfoEnabled() bool
IsSourceInfoEnabled queries whether the payloader will add contributing sources (CSRCs) to the RTP header from RTPSourceMeta.
The function returns the following values:
- ok: TRUE if source-info is enabled.
func (*RTPBasePayload) Push ¶
func (payload *RTPBasePayload) Push(buffer *gst.Buffer) gst.FlowReturn
Push buffer to the peer element of the payloader. The SSRC, payload type, seqnum and timestamp of the RTP buffer will be updated first.
This function takes ownership of buffer.
The function takes the following parameters:
- buffer: Buffer.
The function returns the following values:
- flowReturn: FlowReturn.
func (*RTPBasePayload) PushList ¶
func (payload *RTPBasePayload) PushList(list *gst.BufferList) gst.FlowReturn
PushList: push list to the peer element of the payloader. The SSRC, payload type, seqnum and timestamp of the RTP buffer will be updated first.
This function takes ownership of list.
The function takes the following parameters:
- list: BufferList.
The function returns the following values:
- flowReturn: FlowReturn.
func (*RTPBasePayload) SetOptions ¶
func (payload *RTPBasePayload) SetOptions(media string, dynamic bool, encodingName string, clockRate uint32)
SetOptions: set the rtp options of the payloader. These options will be set in the caps of the payloader. Subclasses must call this method before calling gst_rtp_base_payload_push() or gst_rtp_base_payload_set_outcaps().
The function takes the following parameters:
- media type (typically "audio" or "video").
- dynamic: if the payload type is dynamic.
- encodingName: encoding name.
- clockRate: clock rate of the media.
func (*RTPBasePayload) SetOutcapsStructure ¶
func (payload *RTPBasePayload) SetOutcapsStructure(s *gst.Structure) bool
SetOutcapsStructure: configure the output caps with the optional fields.
The function takes the following parameters:
- s (optional) with the caps fields.
The function returns the following values:
- ok: TRUE if the caps could be set.
func (*RTPBasePayload) SetSourceInfoEnabled ¶
func (payload *RTPBasePayload) SetSourceInfoEnabled(enable bool)
SetSourceInfoEnabled: enable or disable adding contributing sources to RTP packets from RTPSourceMeta.
The function takes the following parameters:
- enable: whether to add contributing sources to RTP packets.
func (*RTPBasePayload) SourceCount ¶
func (payload *RTPBasePayload) SourceCount(buffer *gst.Buffer) uint
SourceCount: count the total number of RTP sources found in the meta of buffer, which will be automically added by gst_rtp_base_payload_allocate_output_buffer(). If RTPBasePayload:source-info is FALSE the count will be 0.
The function takes the following parameters:
- buffer typically the buffer to payload.
The function returns the following values:
- guint: number of sources.
type RTPBasePayloadClass ¶
type RTPBasePayloadClass struct {
// contains filtered or unexported fields
}
RTPBasePayloadClass: base class for audio RTP payloader.
An instance of this type is always passed by reference.
func (*RTPBasePayloadClass) ParentClass ¶
func (r *RTPBasePayloadClass) ParentClass() *gst.ElementClass
ParentClass: parent class.
type RTPBasePayloadOverrides ¶
type RTPBasePayloadOverrides struct { // The function takes the following parameters: // // - pad // - filter // // The function returns the following values: // Caps func(pad *gst.Pad, filter *gst.Caps) *gst.Caps // The function takes the following parameters: // // The function returns the following values: // HandleBuffer func(buffer *gst.Buffer) gst.FlowReturn // The function takes the following parameters: // // - pad // - query // // The function returns the following values: // Query func(pad *gst.Pad, query *gst.Query) bool // The function takes the following parameters: // // The function returns the following values: // SetCaps func(caps *gst.Caps) bool // The function takes the following parameters: // // The function returns the following values: // SinkEvent func(event *gst.Event) bool // The function takes the following parameters: // // The function returns the following values: // SrcEvent func(event *gst.Event) bool }
RTPBasePayloadOverrides contains methods that are overridable.
type RTPBasePayloader ¶
RTPBasePayloader describes types inherited from class RTPBasePayload.
To get the original type, the caller must assert this to an interface or another type.
type RTPBuffer ¶
type RTPBuffer struct {
// contains filtered or unexported fields
}
RTPBuffer helper functions makes it easy to parse and create regular Buffer objects that contain RTP payloads. These buffers are typically of 'application/x-rtp' Caps.
An instance of this type is always passed by reference.
func RTPBufferMap ¶
RTPBufferMap: map the contents of buffer into rtp.
The function takes the following parameters:
- buffer: Buffer.
- flags: MapFlags.
The function returns the following values:
- rtp: RTPBuffer.
- ok: TRUE if buffer could be mapped.
func (*RTPBuffer) AddExtensionOnebyteHeader ¶
AddExtensionOnebyteHeader adds a RFC 5285 header extension with a one byte header to the end of the RTP header. If there is already a RFC 5285 header extension with a one byte header, the new extension will be appended. It will not work if there is already a header extension that does not follow the mechanism described in RFC 5285 or if there is a header extension with a two bytes header as described in RFC 5285. In that case, use gst_rtp_buffer_add_extension_twobytes_header().
The function takes the following parameters:
- id: ID of the header extension (between 1 and 14).
- data: location for data.
The function returns the following values:
- ok: TRUE if header extension could be added.
func (*RTPBuffer) AddExtensionTwobytesHeader ¶
AddExtensionTwobytesHeader adds a RFC 5285 header extension with a two bytes header to the end of the RTP header. If there is already a RFC 5285 header extension with a two bytes header, the new extension will be appended. It will not work if there is already a header extension that does not follow the mechanism described in RFC 5285 or if there is a header extension with a one byte header as described in RFC 5285. In that case, use gst_rtp_buffer_add_extension_onebyte_header().
The function takes the following parameters:
- appbits: application specific bits.
- id: ID of the header extension.
- data: location for data.
The function returns the following values:
- ok: TRUE if header extension could be added.
func (*RTPBuffer) Csrc ¶
Csrc: get the CSRC at index idx in buffer.
The function takes the following parameters:
- idx: index of the CSRC to get.
The function returns the following values:
- guint32: CSRC at index idx in host order.
func (*RTPBuffer) CsrcCount ¶
CsrcCount: get the CSRC count of the RTP packet in buffer.
The function returns the following values:
- guint8: CSRC count of buffer.
func (*RTPBuffer) Extension ¶
Extension: check if the extension bit is set on the RTP packet in buffer.
The function returns the following values:
- ok: TRUE if buffer has the extension bit set.
func (*RTPBuffer) ExtensionData ¶
ExtensionData: similar to gst_rtp_buffer_get_extension_data, but more suitable for language bindings usage. bits will contain the extension 16 bits of custom data and the extension data (not including the extension header) is placed in a new #GBytes structure.
If rtp did not contain an extension, this function will return NULL, with bits unchanged. If there is an extension header but no extension data then an empty #GBytes will be returned.
The function returns the following values:
- bits: location for header bits.
- bytes: new #GBytes if an extension header was present and NULL otherwise.
func (*RTPBuffer) ExtensionOnebyteHeader ¶
ExtensionOnebyteHeader parses RFC 5285 style header extensions with a one byte header. It will return the nth extension with the requested id.
The function takes the following parameters:
- id: ID of the header extension to be read (between 1 and 14).
- nth: read the nth extension packet with the requested ID.
The function returns the following values:
- data (optional): location for data.
- ok: TRUE if buffer had the requested header extension.
func (*RTPBuffer) ExtensionTwobytesHeader ¶
ExtensionTwobytesHeader parses RFC 5285 style header extensions with a two bytes header. It will return the nth extension with the requested id.
The function takes the following parameters:
- id: ID of the header extension to be read (between 1 and 14).
- nth: read the nth extension packet with the requested ID.
The function returns the following values:
- appbits (optional): application specific bits.
- data (optional): location for data.
- ok: TRUE if buffer had the requested header extension.
func (*RTPBuffer) HeaderLen ¶
HeaderLen: return the total length of the header in buffer. This include the length of the fixed header, the CSRC list and the extension header.
The function returns the following values:
- guint: total length of the header in buffer.
func (*RTPBuffer) Marker ¶
Marker: check if the marker bit is set on the RTP packet in buffer.
The function returns the following values:
- ok: TRUE if buffer has the marker bit set.
func (*RTPBuffer) PacketLen ¶
PacketLen: return the total length of the packet in buffer.
The function returns the following values:
- guint: total length of the packet in buffer.
func (*RTPBuffer) PadTo ¶
PadTo: set the amount of padding in the RTP packet in buffer to len. If len is 0, the padding is removed.
NOTE: This function does not work correctly.
The function takes the following parameters:
- len: new amount of padding.
func (*RTPBuffer) Padding ¶
Padding: check if the padding bit is set on the RTP packet in buffer.
The function returns the following values:
- ok: TRUE if buffer has the padding bit set.
func (*RTPBuffer) Payload ¶
func (rtp *RTPBuffer) Payload() *glib.Bytes
Payload: similar to gst_rtp_buffer_get_payload, but more suitable for language bindings usage. The return value is a pointer to a #GBytes structure containing the payload data in rtp.
The function returns the following values:
- bytes: new #GBytes containing the payload data in rtp.
func (*RTPBuffer) PayloadBuffer ¶
PayloadBuffer: create a buffer of the payload of the RTP packet in buffer. This function will internally create a subbuffer of buffer so that a memcpy can be avoided.
The function returns the following values:
- buffer: new buffer with the data of the payload.
func (*RTPBuffer) PayloadLen ¶
PayloadLen: get the length of the payload of the RTP packet in buffer.
The function returns the following values:
- guint: length of the payload in buffer.
func (*RTPBuffer) PayloadSubbuffer ¶
PayloadSubbuffer: create a subbuffer of the payload of the RTP packet in buffer. offset bytes are skipped in the payload and the subbuffer will be of size len. If len is -1 the total payload starting from offset is subbuffered.
The function takes the following parameters:
- offset in the payload.
- len: length in the payload.
The function returns the following values:
- buffer: new buffer with the specified data of the payload.
func (*RTPBuffer) PayloadType ¶
PayloadType: get the payload type of the RTP packet in buffer.
The function returns the following values:
- guint8: payload type.
func (*RTPBuffer) RemoveExtensionData ¶
func (rtp *RTPBuffer) RemoveExtensionData()
RemoveExtensionData unsets the extension bit of the RTP buffer and removes the extension header and data.
If the RTP buffer has no header extension data, the action has no effect. The RTP buffer must be mapped READWRITE only once and the underlying GstBuffer must be writable.
func (*RTPBuffer) Seq ¶
Seq: get the sequence number of the RTP packet in buffer.
The function returns the following values:
- guint16: sequence number in host order.
func (*RTPBuffer) SetCsrc ¶
SetCsrc: modify the CSRC at index idx in buffer to csrc.
The function takes the following parameters:
- idx: CSRC index to set.
- csrc: CSRC in host order to set at idx.
func (*RTPBuffer) SetExtension ¶
SetExtension: set the extension bit on the RTP packet in buffer to extension.
The function takes the following parameters:
- extension: new extension.
func (*RTPBuffer) SetExtensionData ¶
SetExtensionData: set the extension bit of the rtp buffer and fill in the bits and length of the extension header. If the existing extension data is not large enough, it will be made larger.
Will also shorten the extension data from 1.20.
The function takes the following parameters:
- bits specific for the extension.
- length that counts the number of 32-bit words in the extension, excluding the extension header ( therefore zero is a valid length).
The function returns the following values:
- ok: true if done.
func (*RTPBuffer) SetMarker ¶
SetMarker: set the marker bit on the RTP packet in buffer to marker.
The function takes the following parameters:
- marker: new marker.
func (*RTPBuffer) SetPacketLen ¶
SetPacketLen: set the total rtp size to len. The data in the buffer will be made larger if needed. Any padding will be removed from the packet.
The function takes the following parameters:
- len: new packet length.
func (*RTPBuffer) SetPadding ¶
SetPadding: set the padding bit on the RTP packet in buffer to padding.
The function takes the following parameters:
- padding: new padding.
func (*RTPBuffer) SetPayloadType ¶
SetPayloadType: set the payload type of the RTP packet in buffer to payload_type.
The function takes the following parameters:
- payloadType: new type.
func (*RTPBuffer) SetSeq ¶
SetSeq: set the sequence number of the RTP packet in buffer to seq.
The function takes the following parameters:
- seq: new sequence number.
func (*RTPBuffer) SetSsrc ¶
SetSsrc: set the SSRC on the RTP packet in buffer to ssrc.
The function takes the following parameters:
- ssrc: new SSRC.
func (*RTPBuffer) SetTimestamp ¶
SetTimestamp: set the timestamp of the RTP packet in buffer to timestamp.
The function takes the following parameters:
- timestamp: new timestamp.
func (*RTPBuffer) SetVersion ¶
SetVersion: set the version of the RTP packet in buffer to version.
The function takes the following parameters:
- version: new version.
func (*RTPBuffer) Ssrc ¶
Ssrc: get the SSRC of the RTP packet in buffer.
The function returns the following values:
- guint32: SSRC of buffer in host order.
func (*RTPBuffer) Timestamp ¶
Timestamp: get the timestamp of the RTP packet in buffer.
The function returns the following values:
- guint32: timestamp in host order.
type RTPBufferFlags ¶
RTPBufferFlags: additional RTP buffer flags. These flags can potentially be used on any buffers carrying RTP packets.
Note that these are only valid for Caps of type: application/x-rtp (x-rtcp). They can conflict with other extended buffer flags.
const ( // RtpBufferFlagRetransmission was once wrapped in a retransmitted packet as // specified by RFC 4588. RtpBufferFlagRetransmission RTPBufferFlags = 0b100000000000000000000 // RtpBufferFlagRedundant: packet represents redundant RTP packet. The flag // is used in gstrtpstorage to be able to hold the packetback and use it // only for recovery from packet loss. Since: 1.14. RtpBufferFlagRedundant RTPBufferFlags = 0b1000000000000000000000 // RtpBufferFlagLast: offset to define more flags. RtpBufferFlagLast RTPBufferFlags = 0b10000000000000000000000000000 )
func (RTPBufferFlags) Has ¶
func (r RTPBufferFlags) Has(other RTPBufferFlags) bool
Has returns true if r contains other.
func (RTPBufferFlags) String ¶
func (r RTPBufferFlags) String() string
String returns the names in string for RTPBufferFlags.
type RTPBufferMapFlags ¶
RTPBufferMapFlags: additional mapping flags for gst_rtp_buffer_map().
const ( // RtpBufferMapFlagSkipPadding: skip mapping and validation of RTP padding // and RTP pad count when present. Useful for buffers where the padding may // be encrypted. RtpBufferMapFlagSkipPadding RTPBufferMapFlags = 0b10000000000000000 // RtpBufferMapFlagLast: offset to define more flags. RtpBufferMapFlagLast RTPBufferMapFlags = 0b1000000000000000000000000 )
func (RTPBufferMapFlags) Has ¶
func (r RTPBufferMapFlags) Has(other RTPBufferMapFlags) bool
Has returns true if r contains other.
func (RTPBufferMapFlags) String ¶
func (r RTPBufferMapFlags) String() string
String returns the names in string for RTPBufferMapFlags.
type RTPHeaderExtension ¶
RTPHeaderExtension: instance struct for a RTP Audio/Video header extension.
func BaseRTPHeaderExtension ¶
func BaseRTPHeaderExtension(obj RTPHeaderExtensioner) *RTPHeaderExtension
BaseRTPHeaderExtension returns the underlying base object.
func (*RTPHeaderExtension) Direction ¶
func (ext *RTPHeaderExtension) Direction() RTPHeaderExtensionDirection
Direction: retrieve the direction.
The function returns the following values:
- rtpHeaderExtensionDirection: direction.
func (*RTPHeaderExtension) ID ¶
func (ext *RTPHeaderExtension) ID() uint
The function returns the following values:
- guint: RTP extension id configured on ext.
func (*RTPHeaderExtension) MaxSize ¶
func (ext *RTPHeaderExtension) MaxSize(inputMeta *gst.Buffer) uint
MaxSize: this is used to know how much data a certain header extension will need for both allocating the resulting data, and deciding how much payload data can be generated.
Implementations should return as accurate a value as is possible using the information given in the input buffer.
The function takes the following parameters:
- inputMeta: Buffer.
The function returns the following values:
- gsize: maximum size of the data written by this extension.
func (*RTPHeaderExtension) Read ¶
func (ext *RTPHeaderExtension) Read(readFlags RTPHeaderExtensionFlags, data []byte, buffer *gst.Buffer) bool
Read the RTP header extension from data.
The function takes the following parameters:
- readFlags for how the extension should be written.
- data: location to read the rtp header extension from.
- buffer to modify if necessary.
The function returns the following values:
- ok: whether the extension could be read from data.
func (*RTPHeaderExtension) SdpCapsFieldName ¶
func (ext *RTPHeaderExtension) SdpCapsFieldName() string
The function returns the following values:
- utf8 field name used in SDP-like Caps for this ext configuration.
func (*RTPHeaderExtension) SetAttributesFromCaps ¶
func (ext *RTPHeaderExtension) SetAttributesFromCaps(caps *gst.Caps) bool
SetAttributesFromCaps: gst_rtp_header_extension_set_id() must have been called with a valid extension id that is contained in these caps.
The only current known caps format is based on the SDP standard as produced by gst_sdp_media_attributes_to_caps().
The function takes the following parameters:
- caps to configure this extension with.
The function returns the following values:
- ok: whether the caps could be successfully set on ext.
func (*RTPHeaderExtension) SetCapsFromAttributes ¶
func (ext *RTPHeaderExtension) SetCapsFromAttributes(caps *gst.Caps) bool
SetCapsFromAttributes: gst_rtp_header_extension_set_id() must have been called with a valid extension id that is contained in these caps.
The only current known caps format is based on the SDP standard as produced by gst_sdp_media_attributes_to_caps().
The function takes the following parameters:
- caps: writable Caps to modify.
The function returns the following values:
- ok: whether the configured attributes on ext can successfully be set on caps.
func (*RTPHeaderExtension) SetCapsFromAttributesHelper ¶
func (ext *RTPHeaderExtension) SetCapsFromAttributesHelper(caps *gst.Caps, attributes string) bool
SetCapsFromAttributesHelper: helper implementation for GstRTPExtensionClass::set_caps_from_attributes that sets the ext uri on caps with the specified extension id as required for sdp Caps.
Requires that the extension does not have any attributes or direction advertised in caps.
The function takes the following parameters:
- caps to write fields into.
- attributes
The function returns the following values:
- ok: whether the ext attributes could be set on caps.
func (*RTPHeaderExtension) SetDirection ¶
func (ext *RTPHeaderExtension) SetDirection(direction RTPHeaderExtensionDirection)
SetDirection: set the direction that this header extension should be used in. If T_RTP_HEADER_EXTENSION_DIRECTION_INHERITED is included, the direction will not be included in the caps (as it shouldn't be in the extmap line in the SDP).
The function takes the following parameters:
- direction: direction.
func (*RTPHeaderExtension) SetID ¶
func (ext *RTPHeaderExtension) SetID(extId uint)
SetID sets the RTP extension id on ext.
The function takes the following parameters:
- extId: id of this extension.
func (*RTPHeaderExtension) SetNonRtpSinkCaps ¶
func (ext *RTPHeaderExtension) SetNonRtpSinkCaps(caps *gst.Caps) bool
SetNonRtpSinkCaps passes RTP payloader's sink (i.e. not payloaded) caps to the header extension.
The function takes the following parameters:
- caps: sink Caps.
The function returns the following values:
- ok: whether caps could be read successfully.
func (*RTPHeaderExtension) SetWantsUpdateNonRtpSrcCaps ¶
func (ext *RTPHeaderExtension) SetWantsUpdateNonRtpSrcCaps(state bool)
SetWantsUpdateNonRtpSrcCaps: call this function in a subclass from RTPHeaderExtensionClass::read to tell the depayloader whether the data just parsed from RTP packet require updating its src (non-RTP) caps. If state is TRUE, RTPBaseDepayload will eventually invoke gst_rtp_header_extension_update_non_rtp_src_caps() to have the caps update applied. Applying the update also flips the internal "wants update" flag back to FALSE.
The function takes the following parameters:
- state: TRUE if caps update is needed.
func (*RTPHeaderExtension) SupportedFlags ¶
func (ext *RTPHeaderExtension) SupportedFlags() RTPHeaderExtensionFlags
The function returns the following values:
- rtpHeaderExtensionFlags flags supported by this instance of ext.
func (*RTPHeaderExtension) URI ¶
func (ext *RTPHeaderExtension) URI() string
The function returns the following values:
- utf8: RTP extension URI for this object.
func (*RTPHeaderExtension) UpdateNonRtpSrcCaps ¶
func (ext *RTPHeaderExtension) UpdateNonRtpSrcCaps(caps *gst.Caps) bool
UpdateNonRtpSrcCaps updates depayloader src caps based on the information received in RTP header. caps must be writable as this function may modify them.
The function takes the following parameters:
- caps: src Caps to modify.
The function returns the following values:
- ok: whether caps were modified successfully.
func (*RTPHeaderExtension) WantsUpdateNonRtpSrcCaps ¶
func (ext *RTPHeaderExtension) WantsUpdateNonRtpSrcCaps() bool
WantsUpdateNonRtpSrcCaps: call this function after gst_rtp_header_extension_read() to check if the depayloader's src caps need updating with data received in the last RTP packet.
The function returns the following values:
- ok: whether ext wants to update depayloader's src caps.
func (*RTPHeaderExtension) Write ¶
func (ext *RTPHeaderExtension) Write(inputMeta *gst.Buffer, writeFlags RTPHeaderExtensionFlags, output *gst.Buffer, data []byte) int
Write writes the RTP header extension to data using information available from the input_meta. data will be sized to be at least the value returned from gst_rtp_header_extension_get_max_size().
The function takes the following parameters:
- inputMeta: input Buffer to read information from if necessary.
- writeFlags for how the extension should be written.
- output RTP Buffer.
- data: location to write the rtp header extension into.
The function returns the following values:
- gssize: size of the data written, < 0 on failure.
type RTPHeaderExtensionClass ¶
type RTPHeaderExtensionClass struct {
// contains filtered or unexported fields
}
RTPHeaderExtensionClass: base class for RTP Header extensions.
An instance of this type is always passed by reference.
func (*RTPHeaderExtensionClass) ParentClass ¶
func (r *RTPHeaderExtensionClass) ParentClass() *gst.ElementClass
ParentClass: parent class.
func (*RTPHeaderExtensionClass) SetURI ¶
func (klass *RTPHeaderExtensionClass) SetURI(uri string)
SetURI: set the URI for this RTP header extension implementation.
The function takes the following parameters:
- uri: RTP Header extension uri for klass.
type RTPHeaderExtensionDirection ¶
RTPHeaderExtensionDirection: direction to which to apply the RTP Header Extension.
const ( // RtpHeaderExtensionDirectionInactive: neither send nor receive RTP Header // Extensions. RtpHeaderExtensionDirectionInactive RTPHeaderExtensionDirection = 0b0 // RtpHeaderExtensionDirectionSendonly: only send RTP Header Extensions // GST_RTP_HEADER_EXTENSION_DIRECTION_RECVONLY: Only receive RTP Header // Extensions. RtpHeaderExtensionDirectionSendonly RTPHeaderExtensionDirection = 0b1 RtpHeaderExtensionDirectionRecvonly RTPHeaderExtensionDirection = 0b10 // RtpHeaderExtensionDirectionSendrecv: send and receive RTP Header // Extensions ext. RtpHeaderExtensionDirectionSendrecv RTPHeaderExtensionDirection = 0b11 // RtpHeaderExtensionDirectionInherited: RTP header extension direction is // inherited from the stream. RtpHeaderExtensionDirectionInherited RTPHeaderExtensionDirection = 0b100 )
func (RTPHeaderExtensionDirection) Has ¶
func (r RTPHeaderExtensionDirection) Has(other RTPHeaderExtensionDirection) bool
Has returns true if r contains other.
func (RTPHeaderExtensionDirection) String ¶
func (r RTPHeaderExtensionDirection) String() string
String returns the names in string for RTPHeaderExtensionDirection.
type RTPHeaderExtensionFlags ¶
RTPHeaderExtensionFlags flags that apply to a RTP Audio/Video header extension.
const ( // RtpHeaderExtensionOneByte: one byte rtp extension header. 1-16 data bytes // per extension with a maximum of 14 extension ids in total. RtpHeaderExtensionOneByte RTPHeaderExtensionFlags = 0b1 // RtpHeaderExtensionTwoByte: two byte rtp extension header. 256 data bytes // per extension with a maximum of 255 (or 256 including appbits) extensions // in total. RtpHeaderExtensionTwoByte RTPHeaderExtensionFlags = 0b10 )
func (RTPHeaderExtensionFlags) Has ¶
func (r RTPHeaderExtensionFlags) Has(other RTPHeaderExtensionFlags) bool
Has returns true if r contains other.
func (RTPHeaderExtensionFlags) String ¶
func (r RTPHeaderExtensionFlags) String() string
String returns the names in string for RTPHeaderExtensionFlags.
type RTPHeaderExtensionOverrides ¶
type RTPHeaderExtensionOverrides struct { // MaxSize: this is used to know how much data a certain header extension // will need for both allocating the resulting data, and deciding how much // payload data can be generated. // // Implementations should return as accurate a value as is possible using // the information given in the input buffer. // // The function takes the following parameters: // // - inputMeta: Buffer. // // The function returns the following values: // // - gsize: maximum size of the data written by this extension. // MaxSize func(inputMeta *gst.Buffer) uint // The function returns the following values: // // - rtpHeaderExtensionFlags flags supported by this instance of ext. // SupportedFlags func() RTPHeaderExtensionFlags // Read the RTP header extension from data. // // The function takes the following parameters: // // - readFlags for how the extension should be written. // - data: location to read the rtp header extension from. // - buffer to modify if necessary. // // The function returns the following values: // // - ok: whether the extension could be read from data. // Read func(readFlags RTPHeaderExtensionFlags, data []byte, buffer *gst.Buffer) bool // The function takes the following parameters: // // - direction // - attributes // // The function returns the following values: // SetAttributes func(direction RTPHeaderExtensionDirection, attributes string) bool // SetCapsFromAttributes: gst_rtp_header_extension_set_id() must have been // called with a valid extension id that is contained in these caps. // // The only current known caps format is based on the SDP standard as // produced by gst_sdp_media_attributes_to_caps(). // // The function takes the following parameters: // // - caps: writable Caps to modify. // // The function returns the following values: // // - ok: whether the configured attributes on ext can successfully be set // on caps. // SetCapsFromAttributes func(caps *gst.Caps) bool // SetNonRtpSinkCaps passes RTP payloader's sink (i.e. not payloaded) caps // to the header extension. // // The function takes the following parameters: // // - caps: sink Caps. // // The function returns the following values: // // - ok: whether caps could be read successfully. // SetNonRtpSinkCaps func(caps *gst.Caps) bool // UpdateNonRtpSrcCaps updates depayloader src caps based on the information // received in RTP header. caps must be writable as this function may modify // them. // // The function takes the following parameters: // // - caps: src Caps to modify. // // The function returns the following values: // // - ok: whether caps were modified successfully. // UpdateNonRtpSrcCaps func(caps *gst.Caps) bool // Write writes the RTP header extension to data using information available // from the input_meta. data will be sized to be at least the value returned // from gst_rtp_header_extension_get_max_size(). // // The function takes the following parameters: // // - inputMeta: input Buffer to read information from if necessary. // - writeFlags for how the extension should be written. // - output RTP Buffer. // - data: location to write the rtp header extension into. // // The function returns the following values: // // - gssize: size of the data written, < 0 on failure. // Write func(inputMeta *gst.Buffer, writeFlags RTPHeaderExtensionFlags, output *gst.Buffer, data []byte) int }
RTPHeaderExtensionOverrides contains methods that are overridable.
type RTPHeaderExtensioner ¶
type RTPHeaderExtensioner interface { coreglib.Objector // contains filtered or unexported methods }
RTPHeaderExtensioner describes types inherited from class RTPHeaderExtension.
To get the original type, the caller must assert this to an interface or another type.
func RTPHeaderExtensionCreateFromURI ¶
func RTPHeaderExtensionCreateFromURI(uri string) RTPHeaderExtensioner
The function takes the following parameters:
- uri: rtp header extension URI to search for.
The function returns the following values:
- rtpHeaderExtension (optional) for uri or NULL.
type RTPPayload ¶
RTPPayload: standard predefined fixed payload types.
The official list is at: http://www.iana.org/assignments/rtp-parameters
Audio: reserved: 19 unassigned: 20-23,
Video: unassigned: 24, 27, 29, 30, 35-71, 77-95 Reserved for RTCP conflict avoidance: 72-76.
const ( // RtpPayloadPcmu: ITU-T G.711. mu-law audio (RFC 3551). RtpPayloadPcmu RTPPayload = 0 // RtpPayload1016: RFC 3551 says reserved. RtpPayload1016 RTPPayload = 1 // RtpPayloadG721: RFC 3551 says reserved. RtpPayloadG721 RTPPayload = 2 // RtpPayloadGsm: GSM audio. RtpPayloadGsm RTPPayload = 3 // RtpPayloadG723: ITU G.723.1 audio. RtpPayloadG723 RTPPayload = 4 // RtpPayloadDvi48000: IMA ADPCM wave type (RFC 3551). RtpPayloadDvi48000 RTPPayload = 5 // RtpPayloadDvi416000: IMA ADPCM wave type (RFC 3551). RtpPayloadDvi416000 RTPPayload = 6 // RtpPayloadLpc: experimental linear predictive encoding. RtpPayloadLpc RTPPayload = 7 // RtpPayloadPcma: ITU-T G.711 A-law audio (RFC 3551). RtpPayloadPcma RTPPayload = 8 // RtpPayloadG722: ITU-T G.722 (RFC 3551). RtpPayloadG722 RTPPayload = 9 // RtpPayloadL16Stereo: stereo PCM. RtpPayloadL16Stereo RTPPayload = 10 // RtpPayloadL16Mono: mono PCM. RtpPayloadL16Mono RTPPayload = 11 // RtpPayloadQcelp: EIA & TIA standard IS-733. RtpPayloadQcelp RTPPayload = 12 // RtpPayloadCn: comfort Noise (RFC 3389). RtpPayloadCn RTPPayload = 13 // RtpPayloadMpa: audio MPEG 1-3. RtpPayloadMpa RTPPayload = 14 // RtpPayloadG728: ITU-T G.728 Speech coder (RFC 3551). RtpPayloadG728 RTPPayload = 15 // RtpPayloadDvi411025: IMA ADPCM wave type (RFC 3551). RtpPayloadDvi411025 RTPPayload = 16 // RtpPayloadDvi422050: IMA ADPCM wave type (RFC 3551). RtpPayloadDvi422050 RTPPayload = 17 // RtpPayloadG729: ITU-T G.729 Speech coder (RFC 3551). RtpPayloadG729 RTPPayload = 18 // RtpPayloadCellb: see RFC 2029. RtpPayloadCellb RTPPayload = 25 // RtpPayloadJPEG: ISO Standards 10918-1 and 10918-2 (RFC 2435). RtpPayloadJPEG RTPPayload = 26 // RtpPayloadNv: nv encoding by Ron Frederick. RtpPayloadNv RTPPayload = 28 // RtpPayloadH261: ITU-T Recommendation H.261 (RFC 2032). RtpPayloadH261 RTPPayload = 31 // RtpPayloadMpv: video MPEG 1 & 2 (RFC 2250). RtpPayloadMpv RTPPayload = 32 // RtpPayloadMp2T: MPEG-2 transport stream (RFC 2250). RtpPayloadMp2T RTPPayload = 33 // RtpPayloadH263: video H263 (RFC 2190). RtpPayloadH263 RTPPayload = 34 )
func (RTPPayload) String ¶
func (r RTPPayload) String() string
String returns the name in string for RTPPayload.
type RTPPayloadInfo ¶
type RTPPayloadInfo struct {
// contains filtered or unexported fields
}
RTPPayloadInfo: structure holding default payload type information.
An instance of this type is always passed by reference.
func RTPPayloadInfoForName ¶
func RTPPayloadInfoForName(media, encodingName string) *RTPPayloadInfo
RTPPayloadInfoForName: get the RTPPayloadInfo for media and encoding_name. This function is mostly used to get the default clock-rate and bandwidth for dynamic payload types specified with media and encoding name.
The search for encoding_name will be performed in a case insensitive way.
The function takes the following parameters:
- media to find.
- encodingName: encoding name to find.
The function returns the following values:
- rtpPayloadInfo or NULL when no info could be found.
func RTPPayloadInfoForPt ¶
func RTPPayloadInfoForPt(payloadType byte) *RTPPayloadInfo
RTPPayloadInfoForPt: get the RTPPayloadInfo for payload_type. This function is mostly used to get the default clock-rate and bandwidth for static payload types specified with payload_type.
The function takes the following parameters:
- payloadType: payload_type to find.
The function returns the following values:
- rtpPayloadInfo or NULL when no info could be found.
func (*RTPPayloadInfo) Bitrate ¶
func (r *RTPPayloadInfo) Bitrate() uint
Bitrate: bitrate of the media. 0 = unknown/variable.
func (*RTPPayloadInfo) ClockRate ¶
func (r *RTPPayloadInfo) ClockRate() uint
ClockRate: default clock rate, 0 = unknown/variable.
func (*RTPPayloadInfo) EncodingName ¶
func (r *RTPPayloadInfo) EncodingName() string
EncodingName: encoding name of pt.
func (*RTPPayloadInfo) EncodingParameters ¶
func (r *RTPPayloadInfo) EncodingParameters() string
EncodingParameters: encoding parameters. For audio this is the number of channels. NULL = not applicable.
func (*RTPPayloadInfo) Media ¶
func (r *RTPPayloadInfo) Media() string
Media: media type(s), usually "audio", "video", "application", "text", "message".
func (*RTPPayloadInfo) PayloadType ¶
func (r *RTPPayloadInfo) PayloadType() byte
PayloadType: payload type, -1 means dynamic.
func (*RTPPayloadInfo) SetBitrate ¶
func (r *RTPPayloadInfo) SetBitrate(bitrate uint)
Bitrate: bitrate of the media. 0 = unknown/variable.
func (*RTPPayloadInfo) SetClockRate ¶
func (r *RTPPayloadInfo) SetClockRate(clockRate uint)
ClockRate: default clock rate, 0 = unknown/variable.
func (*RTPPayloadInfo) SetPayloadType ¶
func (r *RTPPayloadInfo) SetPayloadType(payloadType byte)
PayloadType: payload type, -1 means dynamic.
type RTPProfile ¶
RTPProfile: transfer profile to use.
const ( // RtpProfileUnknown: invalid profile. RtpProfileUnknown RTPProfile = iota // RtpProfileAvp: audio/Visual profile (RFC 3551). RtpProfileAvp // RtpProfileSavp: secure Audio/Visual profile (RFC 3711). RtpProfileSavp // RtpProfileAvpf: audio/Visual profile with feedback (RFC 4585). RtpProfileAvpf // RtpProfileSavpf: secure Audio/Visual profile with feedback (RFC 5124). RtpProfileSavpf )
func (RTPProfile) String ¶
func (r RTPProfile) String() string
String returns the name in string for RTPProfile.
type RTPSourceMeta ¶
type RTPSourceMeta struct {
// contains filtered or unexported fields
}
RTPSourceMeta: meta describing the source(s) of the buffer.
An instance of this type is always passed by reference.
func BufferAddRtpSourceMeta ¶
func BufferAddRtpSourceMeta(buffer *gst.Buffer, ssrc, csrc *uint32, csrcCount uint) *RTPSourceMeta
BufferAddRtpSourceMeta attaches RTP source information to buffer.
The function takes the following parameters:
- buffer: Buffer.
- ssrc (optional): pointer to the SSRC.
- csrc (optional): pointer to the CSRCs.
- csrcCount: number of elements in csrc.
The function returns the following values:
- rtpSourceMeta on buffer.
func BufferGetRtpSourceMeta ¶
func BufferGetRtpSourceMeta(buffer *gst.Buffer) *RTPSourceMeta
BufferGetRtpSourceMeta: find the RTPSourceMeta on buffer.
The function takes the following parameters:
- buffer: Buffer.
The function returns the following values:
- rtpSourceMeta or NULL when there is no such metadata on buffer.
func (*RTPSourceMeta) AppendCsrc ¶
func (meta *RTPSourceMeta) AppendCsrc(csrc *uint32, csrcCount uint) bool
AppendCsrc appends csrc to the list of contributing sources in meta.
The function takes the following parameters:
- csrc csrcs to append.
- csrcCount: number of elements in csrc.
The function returns the following values:
- ok: TRUE if all elements in csrc was added, FALSE otherwise.
func (*RTPSourceMeta) CsrcCount ¶
func (r *RTPSourceMeta) CsrcCount() uint
CsrcCount: number of elements in csrc.
func (*RTPSourceMeta) SetCsrcCount ¶
func (r *RTPSourceMeta) SetCsrcCount(csrcCount uint)
CsrcCount: number of elements in csrc.
func (*RTPSourceMeta) SetSsrc ¶
func (meta *RTPSourceMeta) SetSsrc(ssrc *uint32) bool
SetSsrc sets ssrc in meta. If ssrc is NULL the ssrc of meta will be unset.
The function takes the following parameters:
- ssrc (optional): pointer to the SSRC.
The function returns the following values:
- ok: TRUE on success, FALSE otherwise.
func (*RTPSourceMeta) SetSsrcValid ¶
func (r *RTPSourceMeta) SetSsrcValid(ssrcValid bool)
SsrcValid: whether ssrc is set and valid.
func (*RTPSourceMeta) SourceCount ¶
func (meta *RTPSourceMeta) SourceCount() uint
SourceCount: count the total number of RTP sources found in meta, both SSRC and CSRC.
The function returns the following values:
- guint: number of RTP sources.
func (*RTPSourceMeta) SsrcValid ¶
func (r *RTPSourceMeta) SsrcValid() bool
SsrcValid: whether ssrc is set and valid.
Source Files ¶
- gstrtcpbuffer.go
- gstrtcpbuffer_1_16.go
- gstrtcpbuffer_1_6.go
- gstrtp.go
- gstrtp_export.go
- gstrtpbaseaudiopayload.go
- gstrtpbasedepayload.go
- gstrtpbasedepayload_export.go
- gstrtpbasepayload.go
- gstrtpbasepayload_export.go
- gstrtpbuffer.go
- gstrtpbuffer_1_10.go
- gstrtpbuffer_1_18.go
- gstrtpbuffer_1_6_1.go
- gstrtpdefs_1_6.go
- gstrtphdrext.go
- gstrtphdrext_1_20.go
- gstrtpmeta.go
- gstrtpmeta_1_16.go
- gstrtppayloads.go