gstrtp.rtpbuffer

Module for [RTPBuffer] class

class RTPBuffer

Types 1

The GstRTPBuffer helper functions makes it easy to parse and create regular #GstBuffer objects that contain RTP payloads. These buffers are typically of 'application/x-rtp' #GstCaps.

Fields
GstRTPBuffer _cInstance
Methods
void * _cPtr()
gst.buffer.Buffer buffer() @propertyGet `buffer` field. Returns: pointer to RTP buffer
void buffer(gst.buffer.Buffer propval) @propertySet `buffer` field. Params: propval = pointer to RTP buffer
uint state() @propertyGet `state` field. Returns: internal state
void state(uint propval) @propertySet `state` field. Params: propval = internal state
bool addExtensionOnebyteHeader(ubyte id, ubyte[] data)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 ...
bool addExtensionTwobytesHeader(ubyte appbits, ubyte id, ubyte[] data)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. I...
uint getCsrc(ubyte idx)Get the CSRC at index idx in buffer.
ubyte getCsrcCount()Get the CSRC count of the RTP packet in buffer. Returns: the CSRC count of buffer.
bool getExtension()Check if the extension bit is set on the RTP packet in buffer. Returns: TRUE if buffer has the extension bit set.
glib.bytes.Bytes getExtensionData(out ushort bits)Similar to gstrtpbuffergetextension_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 h...
bool getExtensionOnebyteHeader(ubyte id, uint nth, out ubyte[] data)Parses RFC 5285 style header extensions with a one byte header. It will return the nth extension with the requested id.
bool getExtensionTwobytesHeader(out ubyte appbits, ubyte id, uint nth, out ubyte[] data)Parses RFC 5285 style header extensions with a two bytes header. It will return the nth extension with the requested id.
uint getHeaderLen()Return the total length of the header in buffer. This include the length of the fixed header, the CSRC list and the extension header. Returns: The total length of the header in buffer.
bool getMarker()Check if the marker bit is set on the RTP packet in buffer. Returns: TRUE if buffer has the marker bit set.
uint getPacketLen()Return the total length of the packet in buffer. Returns: The total length of the packet in buffer.
bool getPadding()Check if the padding bit is set on the RTP packet in buffer. Returns: TRUE if buffer has the padding bit set.
gst.buffer.Buffer getPayloadBuffer()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. Returns: A new buffer with the data of the pa...
glib.bytes.Bytes getPayload()Similar to gstrtpbuffergetpayload, but more suitable for language bindings usage. The return value is a pointer to a #GBytes structure containing the payload data in rtp. Returns: A new #GBytes con...
uint getPayloadLen()Get the length of the payload of the RTP packet in buffer. Returns: The length of the payload in buffer.
gst.buffer.Buffer getPayloadSubbuffer(uint offset, uint len)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 ...
ubyte getPayloadType()Get the payload type of the RTP packet in buffer. Returns: The payload type.
ushort getSeq()Get the sequence number of the RTP packet in buffer. Returns: The sequence number in host order.
uint getSsrc()Get the SSRC of the RTP packet in buffer. Returns: the SSRC of buffer in host order.
uint getTimestamp()Get the timestamp of the RTP packet in buffer. Returns: The timestamp in host order.
ubyte getVersion()Get the version number of the RTP packet in buffer. Returns: The version of buffer.
void padTo(uint len)Set the amount of padding in the RTP packet in buffer to len. If len is 0, the padding is removed.
void removeExtensionData()Unsets the extension bit of the RTP buffer and removes the extension header and data.
void setCsrc(ubyte idx, uint csrc)Modify the CSRC at index idx in buffer to csrc.
void setExtension(bool extension)Set the extension bit on the RTP packet in buffer to extension.
bool setExtensionData(ushort bits, ushort length)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.
void setMarker(bool marker)Set the marker bit on the RTP packet in buffer to marker.
void setPacketLen(uint len)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.
void setPadding(bool padding)Set the padding bit on the RTP packet in buffer to padding.
void setPayloadType(ubyte payloadType)Set the payload type of the RTP packet in buffer to payload_type.
void setSeq(ushort seq)Set the sequence number of the RTP packet in buffer to seq.
void setSsrc(uint ssrc)Set the SSRC on the RTP packet in buffer to ssrc.
void setTimestamp(uint timestamp)Set the timestamp of the RTP packet in buffer to timestamp.
void setVersion(ubyte version_)Set the version of the RTP packet in buffer to version.
void unmap()Unmap rtp previously mapped with [gstrtp.rtpbuffer.RTPBuffer.map].
void allocateData(gst.buffer.Buffer buffer, uint payloadLen, ubyte padLen, ubyte csrcCount)Allocate enough data in buffer to hold an RTP packet with csrccount CSRCs, a payload length of payloadlen and padding of padlen. buffer must be writable and all previous memory in buffer will be fr...
uint calcHeaderLen(ubyte csrcCount)Calculate the header length of an RTP packet with csrc_count CSRC entries. An RTP packet can have at most 15 CSRC entries.
uint calcPacketLen(uint payloadLen, ubyte padLen, ubyte csrcCount)Calculate the total length of an RTP packet with a payload size of payloadlen, a padding of padlen and a csrc_count CSRC entries.
uint calcPayloadLen(uint packetLen, ubyte padLen, ubyte csrcCount)Calculate the length of the payload of an RTP packet with size packetlen, a padding of padlen and a csrc_count CSRC entries.
int compareSeqnum(ushort seqnum1, ushort seqnum2)Compare two sequence numbers, taking care of wraparounds. This function returns the difference between seqnum1 and seqnum2.
uint defaultClockRate(ubyte payloadType)Get the default clock-rate for the static payload type payload_type.
ulong extTimestamp(ref ulong exttimestamp, uint timestamp)Update the exttimestamp field with the extended timestamp of timestamp For the first call of the method, exttimestamp should point to a location with a value of -1.
bool getExtensionOnebyteHeaderFromBytes(glib.bytes.Bytes bytes, ushort bitPattern, ubyte id, uint nth, out ubyte[] data)Similar to gstrtpbuffergetextensiononebyteheader, but working on the #GBytes you get from gstrtpbuffergetextension_bytes. Parses RFC 5285 style header extensions with a one byte header. It will ret...
bool map(gst.buffer.Buffer buffer, gst.types.MapFlags flags, out gstrtp.rtpbuffer.RTPBuffer rtp)Map the contents of buffer into rtp.
gst.buffer.Buffer newAllocate(uint payloadLen, ubyte padLen, ubyte csrcCount)Allocate a new #GstBuffer with enough data to hold an RTP packet with csrccount CSRCs, a payload length of payloadlen and padding of pad_len. All other RTP header fields will be set to 0/FALSE.
gst.buffer.Buffer newAllocateLen(uint packetLen, ubyte padLen, ubyte csrcCount)Create a new #GstBuffer that can hold an RTP packet that is exactly packetlen long. The length of the payload depends on padlen and csrc_count and can be calculated with [gstrtp.rtpbuffer.RTPBuffer...
gst.buffer.Buffer newCopyData(ubyte[] data)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.
Constructors
this(void * ptr, Flag!"Take" take)