WARNING: The online documentation has moved to https://docs.pjsip.org.

Visit the new documentation at https://docs.pjsip.org:

BLOG | DOCUMENTATION | GITHUB

Home --> Documentations --> PJMEDIA Reference

h264_packetizer.h File Reference

Packetizes H.264 bitstream into RTP payload and vice versa. More...

Data Structures

struct  pjmedia_h264_packetizer_cfg
 

Typedefs

typedef struct pjmedia_h264_packetizer pjmedia_h264_packetizer
 

Enumerations

enum  pjmedia_h264_packetizer_mode {
  PJMEDIA_H264_PACKETIZER_MODE_SINGLE_NAL ,
  PJMEDIA_H264_PACKETIZER_MODE_NON_INTERLEAVED ,
  PJMEDIA_H264_PACKETIZER_MODE_INTERLEAVED
}
 

Functions

pj_status_t pjmedia_h264_packetizer_create (pj_pool_t *pool, const pjmedia_h264_packetizer_cfg *cfg, pjmedia_h264_packetizer **p_pktz)
 
pj_status_t pjmedia_h264_packetize (pjmedia_h264_packetizer *pktz, pj_uint8_t *bits, pj_size_t bits_len, unsigned *bits_pos, const pj_uint8_t **payload, pj_size_t *payload_len)
 
pj_status_t pjmedia_h264_unpacketize (pjmedia_h264_packetizer *pktz, const pj_uint8_t *payload, pj_size_t payload_len, pj_uint8_t *bits, pj_size_t bits_len, unsigned *bits_pos)
 

Typedef Documentation

◆ pjmedia_h264_packetizer

Opaque declaration for H.264 packetizer.

Enumeration Type Documentation

◆ pjmedia_h264_packetizer_mode

Enumeration of H.264 packetization modes.

Enumerator
PJMEDIA_H264_PACKETIZER_MODE_SINGLE_NAL 

Single NAL unit packetization mode will only generate payloads containing a complete single NAL unit packet. As H.264 NAL unit size can be very large, this mode is usually not applicable for network environments with MTU size limitation.

PJMEDIA_H264_PACKETIZER_MODE_NON_INTERLEAVED 

Non-interleaved packetization mode will generate payloads with the following possible formats:

  • single NAL unit packets,
  • NAL units aggregation STAP-A packets,
  • fragmented NAL unit FU-A packets.
PJMEDIA_H264_PACKETIZER_MODE_INTERLEAVED 

Interleaved packetization mode will generate payloads with the following possible formats:

  • single NAL unit packets,
  • NAL units aggregation STAP-A & STAP-B packets,
  • fragmented NAL unit FU-A & FU-B packets. This packetization mode is currently unsupported.

Function Documentation

◆ pjmedia_h264_packetizer_create()

pj_status_t pjmedia_h264_packetizer_create ( pj_pool_t pool,
const pjmedia_h264_packetizer_cfg cfg,
pjmedia_h264_packetizer **  p_pktz 
)

Create H.264 packetizer.

Parameters
poolThe memory pool.
cfgPacketizer settings, if NULL, default setting will be used.
p_pktzPointer to receive the packetizer.
Returns
PJ_SUCCESS on success.

◆ pjmedia_h264_packetize()

pj_status_t pjmedia_h264_packetize ( pjmedia_h264_packetizer pktz,
pj_uint8_t bits,
pj_size_t  bits_len,
unsigned *  bits_pos,
const pj_uint8_t **  payload,
pj_size_t payload_len 
)

Generate an RTP payload from a H.264 picture bitstream. Note that this function will apply in-place processing, so the bitstream may be modified during the packetization.

Parameters
pktzThe packetizer.
bitsThe picture bitstream to be packetized.
bits_lenThe length of the bitstream.
bits_posThe bitstream offset to be packetized.
payloadThe output payload.
payload_lenThe output payload length.
Returns
PJ_SUCCESS on success.

◆ pjmedia_h264_unpacketize()

pj_status_t pjmedia_h264_unpacketize ( pjmedia_h264_packetizer pktz,
const pj_uint8_t payload,
pj_size_t  payload_len,
pj_uint8_t bits,
pj_size_t  bits_len,
unsigned *  bits_pos 
)

Append an RTP payload to an H.264 picture bitstream. Note that in case of noticing packet lost, application should keep calling this function with payload pointer set to NULL, as the packetizer need to update its internal state.

Parameters
pktzThe packetizer.
payloadThe payload to be unpacketized.
payload_lenThe payload length.
bitsThe bitstream buffer.
bits_lenThe bitstream buffer size.
bits_posThe bitstream offset to put the unpacketized payload in the bitstream, upon return, this will be updated to the latest offset as a result of the unpacketized payload.
Returns
PJ_SUCCESS on success.

References PJ_END_DECL.

 


PJMEDIA small footprint Open Source media stack
Copyright (C) 2006-2008 Teluu Inc.