libgpac
Documentation of the core library of GPAC
|
RTPStreamer object. More...
Data Structures | |
struct | GF_RTPStreamerConfig |
Typedefs | |
typedef struct __rtp_streamer | GF_RTPStreamer |
typedef void(* | gf_rtcp_rr_callback) (void *cbk, u32 ssrc, u32 rtt_ms, u64 jitter_rtp_ts, u32 loss_rate) |
Functions | |
GF_RTPStreamer * | gf_rtp_streamer_new (u32 streamType, u32 codecid, u32 timeScale, const char *ip_dest, u16 port, u32 MTU, u8 TTL, const char *ifce_addr, u32 flags, const u8 *dsi, u32 dsi_len, u32 PayloadType, u32 sample_rate, u32 nb_ch, Bool is_crypted, u32 IV_length, u32 KI_length, u32 MinSize, u32 MaxSize, u32 avgTS, u32 maxDTSDelta, u32 const_dur, u32 bandwidth, u32 max_ptime, u32 au_sn_len, Bool for_rtsp) |
RTP Streamer constructor with extended parameters. More... | |
GF_RTPStreamer * | gf_rtp_streamer_new_ex (const GF_RTPStreamerConfig *cfg, Bool for_rtsp) |
RTP Streamer constructor with extended parameters. More... | |
void | gf_rtp_streamer_del (GF_RTPStreamer *streamer) |
RTP file streamer destructor. More... | |
GF_Err | gf_rtp_streamer_append_sdp (GF_RTPStreamer *rtp, u16 ESID, const u8 *dsi, u32 dsi_len, char *KMS_URI, char **out_sdp_buffer) |
gets the SDP file More... | |
GF_Err | gf_rtp_streamer_append_sdp_extended (GF_RTPStreamer *rtp, u16 ESID, const u8 *dsi, u32 dsi_len, const u8 *dsi_enh, u32 dsi_enh_len, char *KMS_URI, u32 width, u32 height, u32 tw, u32 th, s32 tx, s32 ty, s16 tl, u32 nb_chan, Bool for_rtsp, char **out_sdp_buffer) |
gets the SDP file More... | |
GF_Err | gf_rtp_streamer_send_au (GF_RTPStreamer *rtp, u8 *data, u32 size, u64 cts, u64 dts, Bool is_rap) |
GF_Err | gf_rtp_streamer_send_au_with_sn (GF_RTPStreamer *rtp, u8 *data, u32 size, u64 cts, u64 dts, Bool is_rap, u32 inc_au_sn) |
GF_Err | gf_rtp_streamer_send_data (GF_RTPStreamer *streamer, u8 *data, u32 size, u32 fullsize, u64 cts, u64 dts, Bool is_rap, Bool au_start, Bool au_end, u32 au_sn, u32 duration, u32 sampleDescriptionIndex) |
char * | gf_rtp_streamer_format_sdp_header (char *app_name, char *ip_dest, char *session_name, char *iod64) |
void | gf_rtp_streamer_disable_auto_rtcp (GF_RTPStreamer *streamer) |
GF_Err | gf_rtp_streamer_send_bye (GF_RTPStreamer *streamer) |
GF_Err | gf_rtp_streamer_send_rtcp (GF_RTPStreamer *streamer, Bool force_ts, u32 rtp_ts, u32 force_ntp_type, u32 ntp_sec, u32 ntp_frac) |
u8 | gf_rtp_streamer_get_payload_type (GF_RTPStreamer *streamer) |
GF_Err | gf_rtp_streamer_init_rtsp (GF_RTPStreamer *streamer, u32 path_mtu, GF_RTSPTransport *tr, const char *ifce_addr) |
u16 | gf_rtp_streamer_get_next_rtp_sn (GF_RTPStreamer *streamer) |
GF_Err | gf_rtp_streamer_set_interleave_callbacks (GF_RTPStreamer *streamer, GF_Err(*RTP_TCPCallback)(void *cbk1, void *cbk2, Bool is_rtcp, u8 *pck, u32 pck_size), void *cbk1, void *cbk2) |
GF_Err | gf_rtp_streamer_read_rtcp (GF_RTPStreamer *streamer, gf_rtcp_rr_callback rtcp_cbk, void *udta) |
u32 | gf_rtp_streamer_get_ssrc (GF_RTPStreamer *streamer) |
u32 | gf_rtp_streamer_get_timescale (GF_RTPStreamer *streamer) |
u32 | gf_rtp_streamer_get_codecid (GF_RTPStreamer *streamer) |
This section documents the RTP streamer object of the GPAC framework.
struct GF_RTPStreamerConfig |
RTP streamer configuration
Data Fields | ||
---|---|---|
u32 | streamType | type of the stream (GF_STREAM_* as defined in <gpac/constants.h> |
u32 | codecid | codec ID for the stream (GF_CODEC_* as defined in <gpac/constants.h>) |
u32 | timeScale | unit to express timestamps of access units |
const char * | ip_dest | IP address of the destination. |
u16 | port | port number of the destination |
u32 | MTU | Maximum Transmission Unit size to use. |
u8 | TTL | Time To Leave. |
const char * | ifce_addr | IP of the local interface to use (may be NULL) |
u32 | flags | set of RTP flags passed to the streamer |
const u8 * | dsi | MPEG-4 Decoder Specific Info for the stream. |
u32 | dsi_len | length of the dsi parameter |
u32 | PayloadType | RTP payload type. |
u32 | sample_rate | audio sample rate |
u32 | nb_ch | number of channels in audio streams |
Bool | is_crypted | indicating if the stream is crypted |
u32 | IV_length | length of the Initialisation Vector used for ISMA encryption |
u32 | KI_length | length of the key index |
u32 | MinSize | minimum AU size, 0 if unknown |
u32 | MaxSize | |
u32 | avgTS | average TS delta in timeScale, 0 if unknown |
u32 | maxDTSDelta | maximum DTS delta in timeScale, 0 if unknown |
u32 | const_dur | constant duration in timeScale, 0 if unknown |
u32 | bandwidth | bandwidth, 0 if unknown |
u32 | max_ptime | maximum packet duration in timeScale, 0 if unknown |
u32 | au_sn_len | length of the MPEG-4 SL descriptor AU sequence number field, 0 if unknown |
const char * | netcap_id | ID of netcap configuration to use, may be null (see gpac -h netcap) |
typedef struct __rtp_streamer GF_RTPStreamer |
RTP streamer object
typedef void(* gf_rtcp_rr_callback) (void *cbk, u32 ssrc, u32 rtt_ms, u64 jitter_rtp_ts, u32 loss_rate) |
callback function for procesing RTCP receiver reports
cbk | user data passed to gf_rtp_streamer_read_rtcp |
ssrc | ssrc for this report, 0 if same as ssrc of channel |
rtt_ms | round-trip time estimate in ms |
jitter_rtp_ts | inter-arrival jitter in RTP channel timescale |
loss_rate | loss rate in per-thousands |
GF_RTPStreamer* gf_rtp_streamer_new | ( | u32 | streamType, |
u32 | codecid, | ||
u32 | timeScale, | ||
const char * | ip_dest, | ||
u16 | port, | ||
u32 | MTU, | ||
u8 | TTL, | ||
const char * | ifce_addr, | ||
u32 | flags, | ||
const u8 * | dsi, | ||
u32 | dsi_len, | ||
u32 | PayloadType, | ||
u32 | sample_rate, | ||
u32 | nb_ch, | ||
Bool | is_crypted, | ||
u32 | IV_length, | ||
u32 | KI_length, | ||
u32 | MinSize, | ||
u32 | MaxSize, | ||
u32 | avgTS, | ||
u32 | maxDTSDelta, | ||
u32 | const_dur, | ||
u32 | bandwidth, | ||
u32 | max_ptime, | ||
u32 | au_sn_len, | ||
Bool | for_rtsp | ||
) |
Constructs a new RTP file streamer
streamType | type of the stream (GF_STREAM_* as defined in <gpac/constants.h>) |
codecid | codec ID for the stream (GF_CODEC_* as defined in <gpac/constants.h>) |
timeScale | unit to express timestamps of access units |
ip_dest | IP address of the destination |
port | port number of the destination |
MTU | Maximum Transmission Unit size to use |
TTL | Time To Leave |
ifce_addr | IP of the local interface to use (may be NULL) |
flags | set of RTP flags passed to the streamer |
dsi | MPEG-4 Decoder Specific Info for the stream |
dsi_len | length of the dsi parameter |
PayloadType | RTP payload type |
sample_rate | audio sample rate |
nb_ch | number of channels in audio streams |
is_crypted | Boolean indicating if the stream is crypted |
IV_length | lenght of the Initialisation Vector used for encryption |
KI_length | length of the key index |
MinSize | minimum AU size, 0 if unknown |
MaxSize | maximum AU size, 0 if unknown |
avgTS | average TS delta in timeScale, 0 if unknown |
maxDTSDelta | maximum DTS delta in timeScale, 0 if unknown |
const_dur | constant duration in timeScale, 0 if unknown |
bandwidth | bandwidth, 0 if unknown |
max_ptime | maximum packet duration in timeScale, 0 if unknown |
au_sn_len | length of the MPEG-4 SL descriptor AU sequence number field, 0 if unknown |
for_rtsp | indicates this is an RTP channel in an RTSP session, RTP channel will not be created, use gf_rtp_streamer_init_rtsp |
GF_RTPStreamer* gf_rtp_streamer_new_ex | ( | const GF_RTPStreamerConfig * | cfg, |
Bool | for_rtsp | ||
) |
Constructs a new RTP file streamer
cfg | configuration of the streamer |
for_rtsp | indicates this is an RTP channel in an RTSP session, RTP channel will not be created, use gf_rtp_streamer_init_rtsp |
void gf_rtp_streamer_del | ( | GF_RTPStreamer * | streamer | ) |
Destructs an RTP file streamer
streamer | the target RTP streamer |
GF_Err gf_rtp_streamer_append_sdp | ( | GF_RTPStreamer * | rtp, |
u16 | ESID, | ||
const u8 * | dsi, | ||
u32 | dsi_len, | ||
char * | KMS_URI, | ||
char ** | out_sdp_buffer | ||
) |
Gets the SDP asscoiated with all media in the streaming session (only media parts are returned)
rtp | the target RTP streamer |
ESID | The MPEG-4 elementary stream id of the stream to process |
dsi | The decoder specific info data |
dsi_len | length of the decoder specific info data |
KMS_URI | URI of the Key Management System |
out_sdp_buffer | location to the SDP buffer to allocate and fill |
GF_Err gf_rtp_streamer_append_sdp_extended | ( | GF_RTPStreamer * | rtp, |
u16 | ESID, | ||
const u8 * | dsi, | ||
u32 | dsi_len, | ||
const u8 * | dsi_enh, | ||
u32 | dsi_enh_len, | ||
char * | KMS_URI, | ||
u32 | width, | ||
u32 | height, | ||
u32 | tw, | ||
u32 | th, | ||
s32 | tx, | ||
s32 | ty, | ||
s16 | tl, | ||
u32 | nb_chan, | ||
Bool | for_rtsp, | ||
char ** | out_sdp_buffer | ||
) |
Gets the SDP asscoiated with all media in the streaming session (only media parts are returned)
rtp | the target RTP streamer |
ESID | The MPEG-4 elementary stream id of the stream to process |
dsi | decoder specific info data |
dsi_len | length of the decoder specific info data |
dsi_enh | enhancement layer decoder specific info data |
dsi_enh_len | length of enhancement layer decoder specific info data |
KMS_URI | URI of the Key Management System |
width | video width |
height | video height |
tw | text window width |
th | text window height |
tx | text window horizontal offset |
ty | text window vertical offset |
tl | text window z-index |
nb_chan | number of audio channels, 0 if unknown |
for_rtsp | if GF_TRUE, produces the SDP for an RTSP describe (no port info) |
out_sdp_buffer | location to the SDP buffer to allocate and fill |
GF_Err gf_rtp_streamer_send_au | ( | GF_RTPStreamer * | rtp, |
u8 * | data, | ||
u32 | size, | ||
u64 | cts, | ||
u64 | dts, | ||
Bool | is_rap | ||
) |
sends a full Access Unit over RTP
rtp | the target RTP streamer |
data | AU payload |
size | AU payload size |
cts | composition timestamp in timeScale unit |
dts | decoding timestamp in timeScale unit |
is_rap | indicates if the AU is a random access |
GF_Err gf_rtp_streamer_send_au_with_sn | ( | GF_RTPStreamer * | rtp, |
u8 * | data, | ||
u32 | size, | ||
u64 | cts, | ||
u64 | dts, | ||
Bool | is_rap, | ||
u32 | inc_au_sn | ||
) |
sends a full Access Unit over RTP
rtp | the target RTP streamer |
data | AU payload |
size | AU payload size |
cts | composition timestamp in timeScale unit |
dts | decoding timestamp in timeScale unit |
is_rap | indicates if the AU is a random access |
inc_au_sn | increments the AU sequence number by the given value before packetizing (used for MPEG-4 systems carousel) |
GF_Err gf_rtp_streamer_send_data | ( | GF_RTPStreamer * | streamer, |
u8 * | data, | ||
u32 | size, | ||
u32 | fullsize, | ||
u64 | cts, | ||
u64 | dts, | ||
Bool | is_rap, | ||
Bool | au_start, | ||
Bool | au_end, | ||
u32 | au_sn, | ||
u32 | duration, | ||
u32 | sampleDescriptionIndex | ||
) |
sends a full or partial Access Unit over RTP
streamer | the target RTP streamer |
data | AU payload |
size | AU payload size |
fullsize | the size of the complete AU |
cts | composition timestamp in timeScale unit |
dts | decoding timestamp in timeScale unit |
is_rap | indicates if the AU is a random access |
au_start | indicates if this chunk is the start of the AU |
au_end | indicates if this chunk is the end of the AU |
au_sn | indicates the AU sequence number |
duration | indicates the AU duration |
sampleDescriptionIndex | indicates the ISOBMFF sampleDescriptionIndex for this AU (needed for 3GPP timed text) |
char* gf_rtp_streamer_format_sdp_header | ( | char * | app_name, |
char * | ip_dest, | ||
char * | session_name, | ||
char * | iod64 | ||
) |
formats a generic SDP header
app_name | application name, may be NULL |
ip_dest | destination IP address, shall NOT be NULL |
session_name | session name, may be NULL |
iod64 | base64 encoded MPEG-4 IOD, may be NULL |
void gf_rtp_streamer_disable_auto_rtcp | ( | GF_RTPStreamer * | streamer | ) |
disables RTCP keepalive
streamer | the target RTP streamer |
GF_Err gf_rtp_streamer_send_bye | ( | GF_RTPStreamer * | streamer | ) |
sends RTCP bye packet
streamer | the target RTP streamer |
GF_Err gf_rtp_streamer_send_rtcp | ( | GF_RTPStreamer * | streamer, |
Bool | force_ts, | ||
u32 | rtp_ts, | ||
u32 | force_ntp_type, | ||
u32 | ntp_sec, | ||
u32 | ntp_frac | ||
) |
sends RTCP server report
streamer | the target RTP streamer |
force_ts | if GF_TRUE, forces using the indicatet ts |
rtp_ts | the force RTP timestamp to use |
force_ntp_type | if 0, computes NTP while sending. If 1 or 2, uses ntp_sec and ntp_frac for report. If 2, forces sending reports right away |
ntp_sec | NTP seconds |
ntp_frac | NTP fractional part |
u8 gf_rtp_streamer_get_payload_type | ( | GF_RTPStreamer * | streamer | ) |
gets associated payload type
streamer | the target RTP streamer |
GF_Err gf_rtp_streamer_init_rtsp | ( | GF_RTPStreamer * | streamer, |
u32 | path_mtu, | ||
GF_RTSPTransport * | tr, | ||
const char * | ifce_addr | ||
) |
initializes the RTP channel for RTSP setup
streamer | the target RTP streamer |
path_mtu | MTU path size in bytes |
tr | the RTSP transport description |
ifce_addr | IP address of network interface to use |
u16 gf_rtp_streamer_get_next_rtp_sn | ( | GF_RTPStreamer * | streamer | ) |
gets the sequence number of the next RTP packet to be sent
streamer | the target RTP streamer |
GF_Err gf_rtp_streamer_set_interleave_callbacks | ( | GF_RTPStreamer * | streamer, |
GF_Err(*)(void *cbk1, void *cbk2, Bool is_rtcp, u8 *pck, u32 pck_size) | RTP_TCPCallback, | ||
void * | cbk1, | ||
void * | cbk2 | ||
) |
sets callback functions for RTP over RTSP sending
streamer | the target RTP streamer |
RTP_TCPCallback | the callback function |
cbk1 | first opaque data passed to callback function |
cbk2 | second opaque data passed to callback function |
GF_Err gf_rtp_streamer_read_rtcp | ( | GF_RTPStreamer * | streamer, |
gf_rtcp_rr_callback | rtcp_cbk, | ||
void * | udta | ||
) |
process rtcp reports if any
streamer | the target RTP streamer |
rtcp_cbk | callback function for RTCP reports |
udta | user data to use for callback function |
u32 gf_rtp_streamer_get_ssrc | ( | GF_RTPStreamer * | streamer | ) |
gets ssrc of this streamer
streamer | the target RTP streamer |
u32 gf_rtp_streamer_get_timescale | ( | GF_RTPStreamer * | streamer | ) |
gets rtp timescale of this streamer
streamer | the target RTP streamer |
u32 gf_rtp_streamer_get_codecid | ( | GF_RTPStreamer * | streamer | ) |
gets codecid of this streamer
streamer | the target RTP streamer |