Changeset 199
- Timestamp:
- Feb 19, 2006 3:35:54 PM (19 years ago)
- Location:
- pjproject/trunk/pjmedia
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjmedia/include/pjmedia/rtp.h
r188 r199 71 71 72 72 73 74 /** 75 * RTP packet header. 76 */ 73 77 #pragma pack(1) 74 75 /**76 * RTP packet header.77 */78 78 struct pjmedia_rtp_hdr 79 79 { 80 80 #if defined(PJ_IS_BIG_ENDIAN) && (PJ_IS_BIG_ENDIAN!=0) 81 int v:2; /**< packet type/version */82 int p:1; /**< padding flag */83 int x:1; /**< extension flag */84 int cc:4; /**< CSRC count */85 int m:1; /**< marker bit */86 int pt:7; /**< payload type */81 pj_uint16_t v:2; /**< packet type/version */ 82 pj_uint16_t p:1; /**< padding flag */ 83 pj_uint16_t x:1; /**< extension flag */ 84 pj_uint16_t cc:4; /**< CSRC count */ 85 pj_uint16_t m:1; /**< marker bit */ 86 pj_uint16_t pt:7; /**< payload type */ 87 87 #else 88 int cc:4; /**< CSRC count */89 int x:1; /**< header extension flag */90 int p:1; /**< padding flag */91 int v:2; /**< packet type/version */92 int pt:7; /**< payload type */93 int m:1; /**< marker bit */88 pj_uint16_t cc:4; /**< CSRC count */ 89 pj_uint16_t x:1; /**< header extension flag */ 90 pj_uint16_t p:1; /**< padding flag */ 91 pj_uint16_t v:2; /**< packet type/version */ 92 pj_uint16_t pt:7; /**< payload type */ 93 pj_uint16_t m:1; /**< marker bit */ 94 94 #endif 95 pj_uint16_t seq; /**< sequence number */ 96 pj_uint32_t ts; /**< timestamp */ 97 pj_uint32_t ssrc; /**< synchronization source */ 98 }; 99 95 pj_uint16_t seq; /**< sequence number */ 96 pj_uint32_t ts; /**< timestamp */ 97 pj_uint32_t ssrc; /**< synchronization source */ 98 }; 100 99 #pragma pack() 101 100 -
pjproject/trunk/pjmedia/src/pjmedia/rtp.c
r188 r199 44 44 /* Check RTP header packing. */ 45 45 if (sizeof(struct pjmedia_rtp_hdr) != 12) { 46 unsigned sz = sizeof(struct pjmedia_rtp_hdr); 46 47 pj_assert(!"Wrong RTP header packing!"); 47 48 return PJMEDIA_RTP_EINPACK; -
pjproject/trunk/pjmedia/src/pjmedia/sdp.c
r188 r199 1149 1149 /* Verify payload type. */ 1150 1150 for (j=0; j<m->desc.fmt_count; ++j) { 1151 unsigned pt = pj_strtoul(&m->desc.fmt[j]); 1152 1153 /* Payload type is between 0 and 127. */ 1154 CHECK( pt <= 127, PJMEDIA_SDP_EINPT); 1155 1156 /* If port is not zero, then for each dynamic payload type, an 1157 * rtpmap attribute must be specified. 1151 1152 /* Arrgh noo!! Payload type can be non-numeric!! 1153 * RTC based programs sends "null" for instant messaging! 1158 1154 */ 1159 if (m->desc.port != 0 && pt >= 96) { 1160 const pjmedia_sdp_attr *a; 1161 1162 a = pjmedia_sdp_media_find_attr(m,&STR_RTPMAP,&m->desc.fmt[j]); 1163 CHECK( a != NULL, PJMEDIA_SDP_EMISSINGRTPMAP); 1155 if (pj_isdigit(*m->desc.fmt[j].ptr)) { 1156 unsigned pt = pj_strtoul(&m->desc.fmt[j]); 1157 1158 /* Payload type is between 0 and 127. 1159 */ 1160 CHECK( pt <= 127, PJMEDIA_SDP_EINPT); 1161 1162 /* If port is not zero, then for each dynamic payload type, an 1163 * rtpmap attribute must be specified. 1164 */ 1165 if (m->desc.port != 0 && pt >= 96) { 1166 const pjmedia_sdp_attr *a; 1167 1168 a = pjmedia_sdp_media_find_attr(m, &STR_RTPMAP, 1169 &m->desc.fmt[j]); 1170 CHECK( a != NULL, PJMEDIA_SDP_EMISSINGRTPMAP); 1171 } 1164 1172 } 1165 1173 }
Note: See TracChangeset
for help on using the changeset viewer.