|
ROHC compression/decompression library
|
ROHC compression context for the RTP profile. More...

Functions | |
| int | rtp_code_static_rtp_part (struct c_context *context, const unsigned char *next_header, unsigned char *dest, int counter) |
| Build the static part of the UDP/RTP headers. | |
| int | rtp_code_dynamic_rtp_part (struct c_context *context, const unsigned char *next_header, unsigned char *dest, int counter) |
| Build the dynamic part of the UDP/RTP headers. | |
| int | rtp_changed_rtp_dynamic (struct c_context *context, const struct udphdr *udp) |
| Check if the dynamic part of the UDP/RTP headers changed. | |
| int | c_rtp_create (struct c_context *context, const struct ip_packet ip) |
| Create a new RTP context and initialize it thanks to the given IP/UDP/RTP packet. | |
| void | c_rtp_destroy (struct c_context *context) |
| Destroy the RTP context. | |
| int | c_rtp_check_context (struct c_context *context, struct ip_packet ip) |
| Check if the IP/UDP/RTP packet belongs to the context. | |
| int | c_rtp_encode (struct c_context *context, const struct ip_packet ip, int packet_size, unsigned char *dest, int dest_size, int *payload_offset) |
| Encode an IP/UDP/RTP packet according to a pattern decided by several different factors. | |
| void | rtp_decide_state (struct c_context *context) |
| Decide the state that should be used for the next packet compressed with the ROHC RTP profile. | |
Variables | |
| int | rtp_ports [] = { RTP_PORTS, 0 } |
| List of UDP ports which are associated with RTP streams. | |
| struct c_profile | c_rtp_profile |
| Define the compression part of the RTP profile as described in the RFC 3095. | |
ROHC compression context for the RTP profile.
| int c_rtp_check_context | ( | struct c_context * | context, |
| struct ip_packet | ip | ||
| ) |
Check if the IP/UDP/RTP packet belongs to the context.
Conditions are:
All the context but the last one are done by the c_udp_check_context() function.
This function is one of the functions that must exist in one profile for the framework to work.
| context | The compression context |
| ip | The IP/UDP/RTP packet to check |
References c_udp_check_context(), ip_get_inner_packet(), ip_get_next_layer(), ip_get_protocol(), sc_rtp_context::old_rtp, rohc_debugf, c_context::specific, c_generic_context::specific, and rtphdr::ssrc.
| int c_rtp_create | ( | struct c_context * | context, |
| const struct ip_packet | ip | ||
| ) |
Create a new RTP context and initialize it thanks to the given IP/UDP/RTP packet.
This function is one of the functions that must exist in one profile for the framework to work.
| context | The compression context |
| ip | The IP/UDP/RTP packet given to initialize the new context |
References c_create_sc(), c_create_wlsb(), c_generic_create(), c_generic_destroy(), C_WINDOW_WIDTH, c_generic_context::code_dynamic_part, c_generic_context::code_static_part, c_generic_context::code_UO_packet_head, c_generic_context::code_UO_packet_tail, c_generic_context::compute_crc_dynamic, c_generic_context::compute_crc_static, c_generic_context::decide_state, c_generic_context::init_at_IR, ip_get_inner_packet(), ip_get_next_layer(), ip_get_protocol(), rtp_tmp_variables::m_set, c_generic_context::next_header_len, c_generic_context::next_header_proto, rtp_tmp_variables::nr_ts_bits, sc_rtp_context::old_rtp, sc_rtp_context::old_udp, rohc_debugf, rtp_code_dynamic_rtp_part(), rtp_code_static_rtp_part(), rtp_compute_crc_dynamic(), rtp_compute_crc_static(), rtp_decide_state(), sc_rtp_context::rtp_pt_change_count, rtp_tmp_variables::rtp_pt_changed, rtp_tmp_variables::send_rtp_dynamic, c_context::specific, c_generic_context::specific, rtp_tmp_variables::timestamp, sc_rtp_context::tmp_variables, sc_rtp_context::ts_sc, rtp_tmp_variables::ts_send, sc_rtp_context::ts_window, sc_rtp_context::udp_checksum_change_count, and udp_code_UO_packet_tail().
| void c_rtp_destroy | ( | struct c_context * | context | ) |
Destroy the RTP context.
This function is one of the functions that must exist in one profile for the framework to work.
| context | The RTP compression context to destroy |
References c_destroy_sc(), c_generic_destroy(), c_context::specific, c_generic_context::specific, and sc_rtp_context::ts_sc.
| int c_rtp_encode | ( | struct c_context * | context, |
| const struct ip_packet | ip, | ||
| int | packet_size, | ||
| unsigned char * | dest, | ||
| int | dest_size, | ||
| int * | payload_offset | ||
| ) |
Encode an IP/UDP/RTP packet according to a pattern decided by several different factors.
| context | The compression context |
| ip | The IP packet to encode |
| packet_size | The length of the IP packet to encode |
| dest | The rohc-packet-under-build buffer |
| dest_size | The length of the rohc-packet-under-build buffer |
| payload_offset | The offset for the payload in the IP packet |
References c_generic_encode(), ip_get_inner_packet(), ip_get_next_layer(), ip_get_protocol(), sc_rtp_context::old_rtp, sc_rtp_context::old_udp, PACKET_IR, PACKET_IR_DYN, generic_tmp_variables::packet_type, rohc_debugf, rtp_changed_rtp_dynamic(), rtp_tmp_variables::send_rtp_dynamic, c_context::specific, c_generic_context::specific, rtp_tmp_variables::timestamp, rtphdr::timestamp, sc_rtp_context::tmp_variables, and c_generic_context::tmp_variables.
| int rtp_changed_rtp_dynamic | ( | struct c_context * | context, |
| const struct udphdr * | udp | ||
| ) |
Check if the dynamic part of the UDP/RTP headers changed.
| context | The compression context |
| udp | The UDP/RTP headers |
References rtphdr::cc, rtphdr::m, rtp_tmp_variables::m_set, MAX_IR_COUNT, sc_rtp_context::old_rtp, sc_rtp_context::old_udp, rtphdr::pt, rohc_debugf, sc_rtp_context::rtp_pt_change_count, rtp_tmp_variables::rtp_pt_changed, c_context::specific, c_generic_context::specific, rtphdr::ssrc, rtphdr::timestamp, rtp_tmp_variables::timestamp, sc_rtp_context::tmp_variables, and sc_rtp_context::udp_checksum_change_count.
Referenced by c_rtp_encode().
| int rtp_code_dynamic_rtp_part | ( | struct c_context * | context, |
| const unsigned char * | next_header, | ||
| unsigned char * | dest, | ||
| int | counter | ||
| ) |
Build the dynamic part of the UDP/RTP headers.
Dynamic part of UDP header (5.7.7.5):
+---+---+---+---+---+---+---+---+
1 / Checksum / 2 octets
+---+---+---+---+---+---+---+---+
Dynamic part of RTP header (5.7.7.6):
+---+---+---+---+---+---+---+---+
2 | V=2 | P | RX| CC | (RX is NOT the RTP X bit)
+---+---+---+---+---+---+---+---+
3 | M | PT |
+---+---+---+---+---+---+---+---+
4 / RTP Sequence Number / 2 octets
+---+---+---+---+---+---+---+---+
5 / RTP Timestamp (absolute) / 4 octets
+---+---+---+---+---+---+---+---+
6 / Generic CSRC list / variable length
+---+---+---+---+---+---+---+---+
7 : Reserved | X | Mode |TIS|TSS: if RX = 1
+---+---+---+---+---+---+---+---+
8 : TS_Stride : 1-4 octets, if TSS = 1
+---+---+---+---+---+---+---+---+
9 : Time_Stride : 1-4 octets, if TIS = 1
+---+---+---+---+---+---+---+---+
Parts 6 & 9 are not supported yet. The TIS flag in part 7 is not supported.
| context | The compression context |
| next_header | The UDP/RTP headers |
| dest | The rohc-packet-under-build buffer |
| counter | The current position in the rohc-packet-under-build buffer |
References c_bytesSdvl(), c_encodeSdvl(), rtphdr::cc, rtphdr::extension, get_ts_stride(), INIT_STRIDE, INIT_TS, is_ts_constant(), rtphdr::m, c_context::mode, PACKET_IR, generic_tmp_variables::packet_type, rtphdr::padding, rtphdr::pt, rohc_debugf, ROHC_TRUE, sc_rtp_context::rtp_pt_change_count, SEND_SCALED, rtphdr::sn, c_context::specific, c_generic_context::specific, ts_sc_comp::state, rtphdr::timestamp, c_generic_context::tmp_variables, sc_rtp_context::ts_sc, sc_rtp_context::udp_checksum_change_count, and rtphdr::version.
Referenced by c_rtp_create().
| int rtp_code_static_rtp_part | ( | struct c_context * | context, |
| const unsigned char * | next_header, | ||
| unsigned char * | dest, | ||
| int | counter | ||
| ) |
Build the static part of the UDP/RTP headers.
Static part of UDP header (5.7.7.5):
+---+---+---+---+---+---+---+---+
1 / Source Port / 2 octets
+---+---+---+---+---+---+---+---+
2 / Destination Port / 2 octets
+---+---+---+---+---+---+---+---+
Static part of RTP header (5.7.7.6):
+---+---+---+---+---+---+---+---+
3 / SSRC / 4 octets
+---+---+---+---+---+---+---+---+
Parts 1 & 2 are done by the udp_code_static_udp_part() function. Part 3 is done by this function.
| context | The compression context |
| next_header | The UDP/RTP headers |
| dest | The rohc-packet-under-build buffer |
| counter | The current position in the rohc-packet-under-build buffer |
References rohc_debugf, rtphdr::ssrc, and udp_code_static_udp_part().
Referenced by c_rtp_create().
| void rtp_decide_state | ( | struct c_context * | context | ) |
Decide the state that should be used for the next packet compressed with the ROHC RTP profile.
The three states are:
| context | The compression context |
References change_state(), decide_state(), FO, INIT_STRIDE, INIT_TS, IR, is_ts_constant(), MAX_IR_COUNT, rohc_debugf, rtp_tmp_variables::send_rtp_dynamic, c_context::specific, c_generic_context::specific, ts_sc_comp::state, c_context::state, sc_rtp_context::tmp_variables, sc_rtp_context::ts_sc, and sc_rtp_context::udp_checksum_change_count.
Referenced by c_rtp_create().
| struct c_profile c_rtp_profile |
{
IPPROTO_UDP,
rtp_ports,
ROHC_PROFILE_RTP,
"alpha",
"RTP / Compressor",
c_rtp_create,
c_rtp_destroy,
c_rtp_check_context,
c_rtp_encode,
c_generic_feedback,
}
Define the compression part of the RTP profile as described in the RFC 3095.
1.7.6.1