/* The oRTP library is an RTP (Realtime Transport Protocol - rfc3550) stack. Copyright (C) 2001 Simon MORLAT simon.morlat@linphone.org This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /** * \file rtpsession.h * \brief The RtpSession api * * The RtpSession objects represent a RTP session: once it is configured with * local and remote network addresses and a payload type is given, it let you send * and recv a media stream. **/ #ifndef RTPSESSION_H #define RTPSESSION_H #include #include #include #include #include #include #include #include typedef enum { RTP_SESSION_RECVONLY, RTP_SESSION_SENDONLY, RTP_SESSION_SENDRECV } RtpSessionMode; /*! Jitter buffer parameters */ typedef struct _JBParameters{ int min_size; /**< in milliseconds*/ int nom_size; /**< idem */ int max_size; /**< idem */ bool_t adaptive; bool_t pad[3]; int max_packets; /**< max number of packets allowed to be queued in the jitter buffer */ } JBParameters; typedef struct _JitterControl { int count; int jitt_comp; /* the user jitt_comp in miliseconds*/ int jitt_comp_ts; /* the jitt_comp converted in rtp time (same unit as timestamp) */ int adapt_jitt_comp_ts; int64_t slide; int64_t prev_slide; float jitter; int olddiff; float inter_jitter; /* interarrival jitter as defined in the RFC */ int corrective_step; int corrective_slide; bool_t adaptive; bool_t enabled; } JitterControl; typedef struct _WaitPoint { ortp_mutex_t lock; ortp_cond_t cond; uint32_t time; bool_t wakeup; } WaitPoint; typedef struct _RtpTransport { void *data; ortp_socket_t (*t_getsocket)(struct _RtpTransport *t); int (*t_sendto)(struct _RtpTransport *t, mblk_t *msg , int flags, const struct sockaddr *to, socklen_t tolen); int (*t_recvfrom)(struct _RtpTransport *t, mblk_t *msg, int flags, struct sockaddr *from, socklen_t *fromlen); struct _RtpSession *session;//flags|=(flag) #define rtp_session_unset_flag(session,flag) (session)->flags&=~(flag) void rtp_session_uninit(RtpSession *session); #ifdef __cplusplus } #endif #endif