00001 // Copyright (C) 2001-2005 Federico Montesino Pouzols <fedemp@altern.org>. 00002 // 00003 // This program is free software; you can redistribute it and/or modify 00004 // it under the terms of the GNU General Public License as published by 00005 // the Free Software Foundation; either version 2 of the License, or 00006 // (at your option) any later version. 00007 // 00008 // This program is distributed in the hope that it will be useful, 00009 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00010 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00011 // GNU General Public License for more details. 00012 // 00013 // You should have received a copy of the GNU General Public License 00014 // along with this program; if not, write to the Free Software 00015 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 00016 // 00017 // As a special exception, you may use this file as part of a free software 00018 // library without restriction. Specifically, if other files instantiate 00019 // templates or use macros or inline functions from this file, or you compile 00020 // this file and link it with other files to produce an executable, this 00021 // file does not by itself cause the resulting executable to be covered by 00022 // the GNU General Public License. This exception does not however 00023 // invalidate any other reasons why the executable file might be covered by 00024 // the GNU General Public License. 00025 // 00026 // This exception applies only to the code released under the name GNU 00027 // ccRTP. If you copy code from other releases into a copy of GNU 00028 // ccRTP, as the General Public License permits, the exception does 00029 // not apply to the code that you add in this way. To avoid misleading 00030 // anyone as to the status of such modified files, you must delete 00031 // this exception notice from them. 00032 // 00033 // If you write modifications of your own for GNU ccRTP, it is your choice 00034 // whether to permit this exception to apply to your modifications. 00035 // If you do not wish that, delete this exception notice. 00036 // 00037 00038 #ifndef CCXX_RTP_BASE_H_ 00039 #define CCXX_RTP_BASE_H_ 00040 00041 #ifndef CCXX_SOCKET_H_ 00042 #include <cc++/config.h> 00043 #include <cc++/socket.h> 00044 #endif 00045 00046 #ifdef CCXX_NAMESPACES 00047 namespace ost { 00048 #endif 00049 00057 00058 const uint8 CCRTP_VERSION = 2; 00059 00061 typedef uint32 microtimeout_t; 00062 00064 typedef uint32 nanotimeout_t; 00065 00073 __EXPORT timeval 00074 microtimeout2Timeval(microtimeout_t to); 00075 00083 inline microtimeout_t 00084 timeval2microtimeout(const timeval& t) 00085 { return ((t.tv_sec * 1000000ul) + t.tv_usec); } 00086 00095 inline microtimeout_t 00096 timevalDiff2microtimeout(const timeval& t1, const timeval& t2) 00097 { 00098 return ((t1.tv_sec - t2.tv_sec) * 1000000ul) + 00099 (t1.tv_usec - t2.tv_usec); 00100 } 00101 00103 const tpport_t DefaultRTPDataPort = 5004; 00104 00106 const tpport_t DefaultRTCPPort = 5005; 00107 00108 #ifndef HAVE_GETTIMEOFDAY 00109 #ifdef WIN32 00110 __EXPORT int 00111 gettimeofday(struct timeval *tv_, void *tz_); 00112 #endif 00113 #endif 00114 00115 #ifdef CCXX_NAMESPACES 00116 } 00117 #endif 00118 00119 #endif // ndef CCXX_RTP_BASE_H_ 00120