Amazon Kinesis Webrtc C SDK
RtpPacket.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  __RtpPacketHeader
 
struct  __Payloads
 
struct  __RtpPacket
 

Macros

#define MIN_HEADER_LENGTH   12
 
#define VERSION_SHIFT   6
 
#define VERSION_MASK   0x3
 
#define PADDING_SHIFT   5
 
#define PADDING_MASK   0x1
 
#define EXTENSION_SHIFT   4
 
#define EXTENSION_MASK   0x1
 
#define CSRC_COUNT_MASK   0xF
 
#define MARKER_SHIFT   7
 
#define MARKER_MASK   0x1
 
#define PAYLOAD_TYPE_MASK   0x7F
 
#define SEQ_NUMBER_OFFSET   2
 
#define TIMESTAMP_OFFSET   4
 
#define SSRC_OFFSET   8
 
#define CSRC_OFFSET   12
 
#define CSRC_LENGTH   4
 
#define RTP_HEADER_LEN(pRtpPacket)    (12 + (pRtpPacket)->header.csrcCount * CSRC_LENGTH + ((pRtpPacket)->header.extension ? 4 + (pRtpPacket)->header.extensionLength : 0))
 
#define RTP_GET_RAW_PACKET_SIZE(pRtpPacket)   (RTP_HEADER_LEN(pRtpPacket) + ((pRtpPacket)->payloadLength))
 
#define GET_UINT16_SEQ_NUM(seqIndex)   ((UINT16) ((seqIndex) % (MAX_UINT16 + 1)))
 
#define TWCC_EXT_PROFILE   0xBEDE
 
#define TWCC_PAYLOAD(extId, sequenceNum)   htonl((((extId) & 0xfu) << 28u) | (1u << 24u) | ((UINT32) (sequenceNum) << 8u))
 
#define TWCC_SEQNUM(extPayload)   ((UINT16) getUnalignedInt16BigEndian(extPayload + 1))
 

Typedefs

typedef STATUS(* DepayRtpPayloadFunc) (PBYTE, UINT32, PBYTE, PUINT32, PBOOL)
 
typedef struct __RtpPacketHeader RtpPacketHeader
 
typedef RtpPacketHeaderPRtpPacketHeader
 
typedef struct __Payloads PayloadArray
 
typedef PayloadArrayPPayloadArray
 
typedef struct __RtpPacket RtpPacket
 
typedef RtpPacketPRtpPacket
 

Functions

STATUS createRtpPacket (UINT8, BOOL, BOOL, UINT8, BOOL, UINT8, UINT16, UINT32, UINT32, PUINT32, UINT16, UINT32, PBYTE, PBYTE, UINT32, PRtpPacket *)
 
STATUS setRtpPacket (UINT8, BOOL, BOOL, UINT8, BOOL, UINT8, UINT16, UINT32, UINT32, PUINT32, UINT16, UINT32, PBYTE, PBYTE, UINT32, PRtpPacket)
 
STATUS freeRtpPacket (PRtpPacket *)
 
STATUS createRtpPacketFromBytes (PBYTE, UINT32, PRtpPacket *)
 
STATUS constructRetransmitRtpPacketFromBytes (PBYTE, UINT32, UINT16, UINT8, UINT32, PRtpPacket *)
 
STATUS setRtpPacketFromBytes (PBYTE, UINT32, PRtpPacket)
 
STATUS createBytesFromRtpPacket (PRtpPacket, PBYTE, PUINT32)
 
STATUS setBytesFromRtpPacket (PRtpPacket, PBYTE, UINT32)
 
STATUS constructRtpPackets (PPayloadArray, UINT8, UINT16, UINT32, UINT32, PRtpPacket, UINT32)
 

Macro Definition Documentation

◆ CSRC_COUNT_MASK

#define CSRC_COUNT_MASK   0xF

◆ CSRC_LENGTH

#define CSRC_LENGTH   4

◆ CSRC_OFFSET

#define CSRC_OFFSET   12

◆ EXTENSION_MASK

#define EXTENSION_MASK   0x1

◆ EXTENSION_SHIFT

#define EXTENSION_SHIFT   4

◆ GET_UINT16_SEQ_NUM

#define GET_UINT16_SEQ_NUM (   seqIndex)    ((UINT16) ((seqIndex) % (MAX_UINT16 + 1)))

◆ MARKER_MASK

#define MARKER_MASK   0x1

◆ MARKER_SHIFT

#define MARKER_SHIFT   7

◆ MIN_HEADER_LENGTH

#define MIN_HEADER_LENGTH   12

◆ PADDING_MASK

#define PADDING_MASK   0x1

◆ PADDING_SHIFT

#define PADDING_SHIFT   5

◆ PAYLOAD_TYPE_MASK

#define PAYLOAD_TYPE_MASK   0x7F

◆ RTP_GET_RAW_PACKET_SIZE

#define RTP_GET_RAW_PACKET_SIZE (   pRtpPacket)    (RTP_HEADER_LEN(pRtpPacket) + ((pRtpPacket)->payloadLength))

◆ RTP_HEADER_LEN

#define RTP_HEADER_LEN (   pRtpPacket)     (12 + (pRtpPacket)->header.csrcCount * CSRC_LENGTH + ((pRtpPacket)->header.extension ? 4 + (pRtpPacket)->header.extensionLength : 0))

◆ SEQ_NUMBER_OFFSET

#define SEQ_NUMBER_OFFSET   2

◆ SSRC_OFFSET

#define SSRC_OFFSET   8

◆ TIMESTAMP_OFFSET

#define TIMESTAMP_OFFSET   4

◆ TWCC_EXT_PROFILE

#define TWCC_EXT_PROFILE   0xBEDE

◆ TWCC_PAYLOAD

#define TWCC_PAYLOAD (   extId,
  sequenceNum 
)    htonl((((extId) & 0xfu) << 28u) | (1u << 24u) | ((UINT32) (sequenceNum) << 8u))

◆ TWCC_SEQNUM

#define TWCC_SEQNUM (   extPayload)    ((UINT16) getUnalignedInt16BigEndian(extPayload + 1))

◆ VERSION_MASK

#define VERSION_MASK   0x3

◆ VERSION_SHIFT

#define VERSION_SHIFT   6

Typedef Documentation

◆ DepayRtpPayloadFunc

typedef STATUS(* DepayRtpPayloadFunc) (PBYTE, UINT32, PBYTE, PUINT32, PBOOL)

◆ PayloadArray

typedef struct __Payloads PayloadArray

◆ PPayloadArray

◆ PRtpPacket

◆ PRtpPacketHeader

◆ RtpPacket

typedef struct __RtpPacket RtpPacket

◆ RtpPacketHeader

Function Documentation

◆ constructRetransmitRtpPacketFromBytes()

STATUS constructRetransmitRtpPacketFromBytes ( PBYTE  rawPacket,
UINT32  packetLength,
UINT16  sequenceNum,
UINT8  payloadType,
UINT32  ssrc,
PRtpPacket ppRtpPacket 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ constructRtpPackets()

STATUS constructRtpPackets ( PPayloadArray  pPayloadArray,
UINT8  payloadType,
UINT16  startSequenceNumber,
UINT32  timestamp,
UINT32  ssrc,
PRtpPacket  pPackets,
UINT32  packetCount 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ createBytesFromRtpPacket()

STATUS createBytesFromRtpPacket ( PRtpPacket  pRtpPacket,
PBYTE  pRawPacket,
PUINT32  pPacketLength 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ createRtpPacket()

STATUS createRtpPacket ( UINT8  version,
BOOL  padding,
BOOL  extension,
UINT8  csrcCount,
BOOL  marker,
UINT8  payloadType,
UINT16  sequenceNumber,
UINT32  timestamp,
UINT32  ssrc,
PUINT32  csrcArray,
UINT16  extensionProfile,
UINT32  extensionLength,
PBYTE  extensionPayload,
PBYTE  payload,
UINT32  payloadLength,
PRtpPacket ppRtpPacket 
)
Here is the call graph for this function:

◆ createRtpPacketFromBytes()

STATUS createRtpPacketFromBytes ( PBYTE  rawPacket,
UINT32  packetLength,
PRtpPacket ppRtpPacket 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ freeRtpPacket()

STATUS freeRtpPacket ( PRtpPacket ppRtpPacket)
Here is the caller graph for this function:

◆ setBytesFromRtpPacket()

STATUS setBytesFromRtpPacket ( PRtpPacket  pRtpPacket,
PBYTE  pRawPacket,
UINT32  packetLength 
)
Here is the caller graph for this function:

◆ setRtpPacket()

STATUS setRtpPacket ( UINT8  version,
BOOL  padding,
BOOL  extension,
UINT8  csrcCount,
BOOL  marker,
UINT8  payloadType,
UINT16  sequenceNumber,
UINT32  timestamp,
UINT32  ssrc,
PUINT32  csrcArray,
UINT16  extensionProfile,
UINT32  extensionLength,
PBYTE  extensionPayload,
PBYTE  payload,
UINT32  payloadLength,
PRtpPacket  pRtpPacket 
)
Here is the caller graph for this function:

◆ setRtpPacketFromBytes()

STATUS setRtpPacketFromBytes ( PBYTE  rawPacket,
UINT32  packetLength,
PRtpPacket  pRtpPacket 
)
Here is the call graph for this function:
Here is the caller graph for this function: