2 The oRTP library is an RTP (Realtime Transport Protocol - rfc3550) stack.
3 Copyright (C) 2001 Simon MORLAT simon.morlat@linphone.org
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.
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.
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
23 #include "ortp/rtpsession.h"
24 #include "ortp/sessionset.h"
28 struct _RtpScheduler {
30 RtpSession *list; /* list of scheduled sessions*/
31 SessionSet all_sessions; /* mask of scheduled sessions */
32 int all_max; /* the highest pos in the all mask */
33 SessionSet r_sessions; /* mask of sessions that have a recv event */
35 SessionSet w_sessions; /* mask of sessions that have a send event */
37 SessionSet e_sessions; /* mask of session that have error event */
39 int max_sessions; /* the number of position in the masks */
40 /* GMutex *unblock_select_mutex; */
41 ortp_cond_t unblock_select_cond;
45 struct _RtpTimer *timer;
46 uint32_t time_; /*number of miliseconds elapsed since the start of the thread */
47 uint32_t timer_inc; /* the timer increment in milisec */
50 typedef struct _RtpScheduler RtpScheduler;
52 RtpScheduler * rtp_scheduler_new(void);
53 void rtp_scheduler_set_timer(RtpScheduler *sched,RtpTimer *timer);
54 void rtp_scheduler_start(RtpScheduler *sched);
55 void rtp_scheduler_stop(RtpScheduler *sched);
56 void rtp_scheduler_destroy(RtpScheduler *sched);
58 void rtp_scheduler_add_session(RtpScheduler *sched, RtpSession *session);
59 void rtp_scheduler_remove_session(RtpScheduler *sched, RtpSession *session);
61 void * rtp_scheduler_schedule(void * sched);
63 #define rtp_scheduler_lock(sched) ortp_mutex_lock(&(sched)->lock)
64 #define rtp_scheduler_unlock(sched) ortp_mutex_unlock(&(sched)->lock)
66 /* void rtp_scheduler_add_set(RtpScheduler *sched, SessionSet *set); */
68 RtpScheduler * ortp_get_scheduler(void);