RTP (Real-Time Transfer Protocol)
The RTP library provides functions for creating and manipulation RTP packets.
Functionality
- Create RTP packets of any length
- Create and extract RTP headers
More details in nw_rtp_pkg
Example use
Include the libraries:
library nw_util;
context nw_util.nw_util_context;
library nw_rtp;
Assume the variable v_payload contains the RTP payload. The variables are defined:
variable v_header : t_rtp_header;
variable v_rtp_pkt : t_slv_arr(0 to 1500)(7 downto 0);
variable v_len : natural;
First setup the header, then calculate the total RTP packet length before creating the packet.
v_header := C_DEFAULT_RTP_HEADER;
v_header.cc := x"0010";
v_header.csrc(0) := x"10005678";
v_header.csrc(1) := x"1000abcd";
v_header.payload_type := "0100011";
v_len := f_rtp_create_pkt_len(v_header, v_payload);
v_rtp_pkt(0 to v_len - 1) := f_rtp_create_pkt(v_header, v_payload);
The variable v_rtp_pkt is an 8-bit array. This can of course be rearranged to any word width with f_repack .
v_rtp_pkt_64 := f_repack(v_rtp_pkt, 64, C_MSB_FIRST);
See further examples in the test bench nw_rtp_tb.vhd.