oRTP  0.24.0
rtptimer.h
1 /*
2  The oRTP library is an RTP (Realtime Transport Protocol - rfc3550) stack.
3  Copyright (C) 2001 Simon MORLAT simon.morlat@linphone.org
4 
5  This library is free software; you can redistribute it and/or
6  modify it under the terms of the GNU Lesser General Public
7  License as published by the Free Software Foundation; either
8  version 2.1 of the License, or (at your option) any later version.
9 
10  This library is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  Lesser General Public License for more details.
14 
15  You should have received a copy of the GNU Lesser General Public
16  License along with this library; if not, write to the Free Software
17  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 */
19 
20 #ifndef RTPTIMER_H
21 #define RTPTIMER_H
22 
23 #if !defined(_WIN32) && !defined(_WIN32_WCE)
24 #include <sys/time.h>
25 #else
26 #include <time.h>
27 #include "winsock2.h"
28 #endif
29 
30 #include <ortp/port.h>
31 
32 
33 typedef void (*RtpTimerFunc)(void);
34 
35 struct _RtpTimer
36 {
37  int state;
38 #define RTP_TIMER_RUNNING 1
39 #define RTP_TIMER_STOPPED 0
40  RtpTimerFunc timer_init;
41  RtpTimerFunc timer_do;
42  RtpTimerFunc timer_uninit;
43  struct timeval interval;
44 };
45 
46 typedef struct _RtpTimer RtpTimer;
47 
48 void rtp_timer_set_interval(RtpTimer *timer, struct timeval *interval);
49 
50 extern RtpTimer posix_timer;
51 
52 #endif
Definition: rtptimer.h:35