00001 /* 00002 * Copyright 2007,2008 CNES 00003 * Copyright 2010,2011,2012,2013 Didier Barvaux 00004 * Copyright 2007,2008 Thales Alenia Space 00005 * Copyright 2007,2009,2010 Viveris Technologies 00006 * 00007 * This library is free software; you can redistribute it and/or 00008 * modify it under the terms of the GNU Lesser General Public 00009 * License as published by the Free Software Foundation; either 00010 * version 2.1 of the License, or (at your option) any later version. 00011 * 00012 * This library is distributed in the hope that it will be useful, 00013 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00015 * Lesser General Public License for more details. 00016 * 00017 * You should have received a copy of the GNU Lesser General Public 00018 * License along with this library; if not, write to the Free Software 00019 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 00020 */ 00021 00022 /** 00023 * @file c_rtp.h 00024 * @brief ROHC compression context for the RTP profile. 00025 * @author David Moreau from TAS 00026 * @author Didier Barvaux <didier.barvaux@toulouse.viveris.com> 00027 */ 00028 00029 #ifndef ROHC_COMP_RTP_H 00030 #define ROHC_COMP_RTP_H 00031 00032 #include "rohc_comp_rfc3095.h" 00033 #include "schemes/comp_scaled_rtp_ts.h" 00034 #include "protocols/udp.h" 00035 #include "protocols/rtp.h" 00036 00037 00038 /** 00039 * @brief Define the RTP and UDP specific temporary variables in the profile 00040 * compression context. 00041 * 00042 * This object must be used by the RTP-specific decompression context 00043 * sc_rtp_context. 00044 * 00045 * @see sc_rtp_context 00046 */ 00047 struct rtp_tmp_vars 00048 { 00049 /// The number of UDP/RTP fields that changed in the UDP/RTP headers 00050 int send_rtp_dynamic; 00051 00052 /// The number of bits needed to encode ts_send 00053 size_t nr_ts_bits_less_equal_than_2; 00054 size_t nr_ts_bits_more_than_2; 00055 00056 /// The number of bits of TS to place in the extension 3 header 00057 size_t nr_ts_bits_ext3; 00058 00059 /// The TS field to send (ts_scaled or ts) 00060 uint32_t ts_send; 00061 00062 /// Whether the Marker (M) bit is set in the RTP header or not 00063 bool is_marker_bit_set; 00064 00065 /** Whether the Padding (P) bit changed or not */ 00066 bool padding_bit_changed; 00067 00068 /// Whether the eXtension (X) bit changed or not 00069 bool extension_bit_changed; 00070 00071 /// Whether the Payload Type (PT) field changed or not 00072 int rtp_pt_changed; 00073 }; 00074 00075 00076 /** 00077 * @brief Define the RTP part of the profile decompression context. 00078 * 00079 * This object must be used with the generic part of the decompression 00080 * context rohc_comp_rfc3095_ctxt. 00081 * 00082 * @warning The 2 first fields MUST stay at the beginning of the structure 00083 * to be compatible with \ref sc_udp_context 00084 * 00085 * @see rohc_comp_rfc3095_ctxt 00086 */ 00087 struct sc_rtp_context 00088 { 00089 /// @brief The number of times the UDP checksum field was added to the 00090 /// compressed header 00091 size_t udp_checksum_change_count; 00092 00093 /// The previous UDP header 00094 struct udphdr old_udp; 00095 00096 /// @brief The number of times the RTP Version field was added to 00097 /// the compressed header 00098 size_t rtp_version_change_count; 00099 00100 /// @brief The number of times the RTP Payload Type (PT) field was added to 00101 /// the compressed header 00102 size_t rtp_pt_change_count; 00103 00104 /// @brief The number of times the RTP Padding (P) bit was added to 00105 /// the compressed header 00106 size_t rtp_padding_change_count; 00107 00108 /// @brief The number of times the RTP eXtension (X) bit was added to 00109 /// the compressed header 00110 size_t rtp_extension_change_count; 00111 00112 /// The previous RTP header 00113 struct rtphdr old_rtp; 00114 00115 /// @brief RTP-specific temporary variables that are used during one single 00116 /// compression of packet 00117 struct rtp_tmp_vars tmp; 00118 00119 /// Scaled RTP Time Stamp 00120 int tss; 00121 00122 /// Whether the Time Stride field is present or not 00123 int tis; 00124 00125 /// Structure to encode the TS field 00126 struct ts_sc_comp ts_sc; 00127 }; 00128 00129 00130 /* 00131 * Function prototypes. 00132 */ 00133 00134 /* no public function */ 00135 00136 #endif 00137
1.6.1