00001 /* 00002 * Copyright 2008-2010 Arsen Chaloyan 00003 * 00004 * Licensed under the Apache License, Version 2.0 (the "License"); 00005 * you may not use this file except in compliance with the License. 00006 * You may obtain a copy of the License at 00007 * 00008 * http://www.apache.org/licenses/LICENSE-2.0 00009 * 00010 * Unless required by applicable law or agreed to in writing, software 00011 * distributed under the License is distributed on an "AS IS" BASIS, 00012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00013 * See the License for the specific language governing permissions and 00014 * limitations under the License. 00015 * 00016 * $Id: mpf_rtp_header.h 1474 2010-02-07 20:51:47Z achaloyan $ 00017 */ 00018 00019 #ifndef MPF_RTP_HEADER_H 00020 #define MPF_RTP_HEADER_H 00021 00022 /** 00023 * @file mpf_rtp_header.h 00024 * @brief RTP Header Definition 00025 */ 00026 00027 #include "mpf.h" 00028 00029 APT_BEGIN_EXTERN_C 00030 00031 /** Protocol version */ 00032 #define RTP_VERSION 2 00033 00034 /** RTP header declaration */ 00035 typedef struct rtp_header_t rtp_header_t; 00036 /** RTP extension header declaration */ 00037 typedef struct rtp_extension_header_t rtp_extension_header_t; 00038 00039 00040 /** RTP header */ 00041 struct rtp_header_t { 00042 #if (APR_IS_BIGENDIAN == 1) 00043 /** protocol version */ 00044 apr_uint32_t version: 2; 00045 /** padding flag */ 00046 apr_uint32_t padding: 1; 00047 /** header extension flag */ 00048 apr_uint32_t extension: 1; 00049 /** CSRC count */ 00050 apr_uint32_t count: 4; 00051 /** marker bit */ 00052 apr_uint32_t marker: 1; 00053 /** payload type */ 00054 apr_uint32_t type: 7; 00055 #else 00056 /** CSRC count */ 00057 apr_uint32_t count: 4; 00058 /** header extension flag */ 00059 apr_uint32_t extension: 1; 00060 /** padding flag */ 00061 apr_uint32_t padding: 1; 00062 /** protocol version */ 00063 apr_uint32_t version: 2; 00064 /** payload type */ 00065 apr_uint32_t type: 7; 00066 /** marker bit */ 00067 apr_uint32_t marker: 1; 00068 #endif 00069 00070 /** sequence number */ 00071 apr_uint32_t sequence: 16; 00072 /** timestamp */ 00073 apr_uint32_t timestamp; 00074 /** synchronization source */ 00075 apr_uint32_t ssrc; 00076 }; 00077 00078 /** RTP extension header */ 00079 struct rtp_extension_header_t { 00080 /** profile */ 00081 apr_uint16_t profile; 00082 /** length */ 00083 apr_uint16_t length; 00084 }; 00085 00086 APT_END_EXTERN_C 00087 00088 #endif /* MPF_RTP_HEADER_H */