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() nothrow
gst.buffer.Buffer buffer() @property nothrowGet `buffer` field. Returns: pointer to RTP buffer
void buffer(gst.buffer.Buffer propval) @property nothrowSet `buffer` field. Params: propval = pointer to RTP buffer
uint state() @property nothrowGet `state` field. Returns: internal state
void state(uint propval) @property nothrowSet `state` field. Params: propval = internal state
bool addExtensionOnebyteHeader(ubyte id, ubyte[] data) nothrowAdds 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) nothrowAdds 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) nothrowGet the CSRC at index idx in buffer.
ubyte getCsrcCount() nothrowGet the CSRC count of the RTP packet in buffer. Returns: the CSRC count of buffer.
bool getExtension() nothrowCheck 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) nothrowSimilar 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 extensi...
bool getExtensionOnebyteHeader(ubyte id, uint nth, out ubyte[] data) nothrowParses 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) nothrowParses RFC 5285 style header extensions with a two bytes header. It will return the nth extension with the requested id.
uint getHeaderLen() nothrowReturn 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() nothrowCheck if the marker bit is set on the RTP packet in buffer. Returns: TRUE if buffer has the marker bit set.
uint getPacketLen() nothrowReturn the total length of the packet in buffer. Returns: The total length of the packet in buffer.
bool getPadding() nothrowCheck 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() nothrowCreate 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() nothrowSimilar 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. Returns: A new #GBytes...
uint getPayloadLen() nothrowGet 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) nothrowCreate 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() nothrowGet the payload type of the RTP packet in buffer. Returns: The payload type.
ushort getSeq() nothrowGet the sequence number of the RTP packet in buffer. Returns: The sequence number in host order.
uint getSsrc() nothrowGet the SSRC of the RTP packet in buffer. Returns: the SSRC of buffer in host order.
uint getTimestamp() nothrowGet the timestamp of the RTP packet in buffer. Returns: The timestamp in host order.
ubyte getVersion() nothrowGet the version number of the RTP packet in buffer. Returns: The version of buffer.
void padTo(uint len) nothrowSet the amount of padding in the RTP packet in buffer to len. If len is 0, the padding is removed.
void removeExtensionData() nothrowUnsets the extension bit of the RTP buffer and removes the extension header and data.
void setCsrc(ubyte idx, uint csrc) nothrowModify the CSRC at index idx in buffer to csrc.
void setExtension(bool extension) nothrowSet the extension bit on the RTP packet in buffer to extension.
bool setExtensionData(ushort bits, ushort length) nothrowSet 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) nothrowSet the marker bit on the RTP packet in buffer to marker.
void setPacketLen(uint len) nothrowSet 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) nothrowSet the padding bit on the RTP packet in buffer to padding.
void setPayloadType(ubyte payloadType) nothrowSet the payload type of the RTP packet in buffer to payload_type.
void setSeq(ushort seq) nothrowSet the sequence number of the RTP packet in buffer to seq.
void setSsrc(uint ssrc) nothrowSet the SSRC on the RTP packet in buffer to ssrc.
void setTimestamp(uint timestamp) nothrowSet the timestamp of the RTP packet in buffer to timestamp.
void setVersion(ubyte version_) nothrowSet the version of the RTP packet in buffer to version.
void unmap() nothrowUnmap rtp previously mapped with [gstrtp.rtpbuffer.RTPBuffer.map].
void allocateData(gst.buffer.Buffer buffer, uint payloadLen, ubyte padLen, ubyte csrcCount) static nothrowAllocate 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...
uint calcHeaderLen(ubyte csrcCount) static nothrowCalculate 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) static nothrowCalculate 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.
uint calcPayloadLen(uint packetLen, ubyte padLen, ubyte csrcCount) static nothrowCalculate the length of the payload of an RTP packet with size packet_len, a padding of pad_len and a csrc_count CSRC entries.
int compareSeqnum(ushort seqnum1, ushort seqnum2) static nothrowCompare two sequence numbers, taking care of wraparounds. This function returns the difference between seqnum1 and seqnum2.
uint defaultClockRate(ubyte payloadType) static nothrowGet the default clock-rate for the static payload type payload_type.
ulong extTimestamp(ref ulong exttimestamp, uint timestamp) static nothrowUpdate 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) static nothrowSimilar 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. I...
bool map(gst.buffer.Buffer buffer, gst.types.MapFlags flags, out gstrtp.rtpbuffer.RTPBuffer rtp) static nothrowMap the contents of buffer into rtp.
gst.buffer.Buffer newAllocate(uint payloadLen, ubyte padLen, ubyte csrcCount) static nothrowAllocate a new #GstBuffer 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.
gst.buffer.Buffer newAllocateLen(uint packetLen, ubyte padLen, ubyte csrcCount) static nothrowCreate a new #GstBuffer 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 [gstrtp.rtpbuffer.RTPBuff...
gst.buffer.Buffer newCopyData(ubyte[] data) static nothrowCreate 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)