FMLiveSwitchRtpPacketHeader Class Reference

An RTP packet header. More...

Instance Methods

(int) - calculateHeaderLength
 Calculates the length of the header. More...
 
(FMLiveSwitchRtpPacketHeader *) - clone
 Clones this instance. More...
 
(int) - contributingSourceCount
 Gets the number of contributing sources. More...
 
(NSMutableArray *) - contributingSources
 Gets the contributing sources. More...
 
(bool) - extension
 Gets if there is an extension. More...
 
(NSObject< FMLiveSwitchIRtpHeaderExtension > *) - headerExtension
 Gets the header extension. More...
 
(NSString *) - id
 Gets the Id of the Rtp Packet Header. More...
 
(instancetype) - init
 Creates a new instance of the FMLiveSwitchRtpPacketHeader class. More...
 
(bool) - marker
 Gets if the marker bit is set. More...
 
(bool) - padding
 Gets if the packet has padding. More...
 
(int) - paddingLength
 Gets the number of bytes of padding. More...
 
(int) - payloadType
 Gets the payload type. More...
 
(int) - sequenceNumber
 Gets the sequence number. More...
 
(void) - setContributingSourceCount:
 Sets the number of contributing sources. More...
 
(void) - setContributingSources:
 Sets the contributing sources. More...
 
(void) - setHeaderExtension:
 Sets the header extension. More...
 
(void) - setMarker:
 Sets if the marker bit is set. More...
 
(void) - setPadding:
 Sets if the packet has padding. More...
 
(void) - setPayloadType:
 Sets the payload type. More...
 
(void) - setSequenceNumber:
 Sets the sequence number. More...
 
(void) - setSynchronizationSource:
 Sets the synchronization source. More...
 
(void) - setTimestamp:
 Sets the timestamp. More...
 
(void) - setVersion:
 Sets the version of the packet. More...
 
(long long) - synchronizationSource
 Gets the synchronization source. More...
 
(long long) - timestamp
 Gets the timestamp. More...
 
(int) - version
 Gets the version of the packet. More...
 
(void) - writeToWithBuffer:offset:
 Writes this header to a buffer starting at the offset. More...
 

Class Methods

(int) + fixedHeaderLength
 Gets the length of the fixed header. More...
 
(FMLiveSwitchRtpPacketHeader *) + readFromWithBuffer:
 Reads a header from a buffer. More...
 
(FMLiveSwitchRtpPacketHeader *) + rtpPacketHeader
 Creates a new instance of the FMLiveSwitchRtpPacketHeader class. More...
 

Detailed Description

An RTP packet header.

Method Documentation

◆ calculateHeaderLength

- (int) calculateHeaderLength

Calculates the length of the header.

At least 12 bytes.

◆ clone

Clones this instance.

◆ contributingSourceCount

- (int) contributingSourceCount

Gets the number of contributing sources.

◆ contributingSources

- (NSMutableArray*) contributingSources

Gets the contributing sources.

◆ extension

- (bool) extension

Gets if there is an extension.

◆ fixedHeaderLength

+ (int) fixedHeaderLength

Gets the length of the fixed header.

◆ headerExtension

Gets the header extension.

◆ id

- (NSString*) id

Gets the Id of the Rtp Packet Header.

◆ init

- (instancetype) init

Creates a new instance of the FMLiveSwitchRtpPacketHeader class.

◆ marker

- (bool) marker

Gets if the marker bit is set.

◆ padding

- (bool) padding

Gets if the packet has padding.

◆ paddingLength

- (int) paddingLength

Gets the number of bytes of padding.

◆ payloadType

- (int) payloadType

Gets the payload type.

◆ readFromWithBuffer:

+ (FMLiveSwitchRtpPacketHeader*) readFromWithBuffer: (FMLiveSwitchDataBuffer *)  buffer

Reads a header from a buffer.

If padding exists, also calculates the padding length.

Parameters
bufferThe source buffer

◆ rtpPacketHeader

+ (FMLiveSwitchRtpPacketHeader*) rtpPacketHeader

Creates a new instance of the FMLiveSwitchRtpPacketHeader class.

◆ sequenceNumber

- (int) sequenceNumber

Gets the sequence number.

◆ setContributingSourceCount:

- (void) setContributingSourceCount: (int)  value

Sets the number of contributing sources.

◆ setContributingSources:

- (void) setContributingSources: (NSMutableArray *)  value

Sets the contributing sources.

◆ setHeaderExtension:

- (void) setHeaderExtension: (NSObject< FMLiveSwitchIRtpHeaderExtension > *)  value

Sets the header extension.

◆ setMarker:

- (void) setMarker: (bool)  value

Sets if the marker bit is set.

◆ setPadding:

- (void) setPadding: (bool)  value

Sets if the packet has padding.

◆ setPayloadType:

- (void) setPayloadType: (int)  value

Sets the payload type.

◆ setSequenceNumber:

- (void) setSequenceNumber: (int)  value

Sets the sequence number.

◆ setSynchronizationSource:

- (void) setSynchronizationSource: (long long)  value

Sets the synchronization source.

◆ setTimestamp:

- (void) setTimestamp: (long long)  value

Sets the timestamp.

◆ setVersion:

- (void) setVersion: (int)  value

Sets the version of the packet.

Should be 2.

◆ synchronizationSource

- (long long) synchronizationSource

Gets the synchronization source.

◆ timestamp

- (long long) timestamp

Gets the timestamp.

◆ version

- (int) version

Gets the version of the packet.

Should be 2.

◆ writeToWithBuffer:offset:

- (void) writeToWithBuffer: (FMLiveSwitchDataBuffer *)  buffer
offset: (int)  offset 

Writes this header to a buffer starting at the offset.

Parameters
bufferThe target buffer.
offsetThe starting offset.