00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #ifndef _RTP_HIGHLEVEL_H
00011 #define _RTP_HIGHLEVEL_H
00012
00013
00014
00015 typedef void* rtp_opaque_t;
00016
00017 #ifdef WIN32
00018 typedef SOCKET socktype;
00019 #endif
00020
00021 #ifdef __unix
00022 #define SOCKTYPE_DEFINED
00023 typedef int socktype;
00024 #endif
00025
00026
00027
00028
00029 rtperror RTPCreate(context *the_context);
00030
00031 rtperror RTPDestroy(context cid);
00032
00033
00034 rtperror RTPOpenConnection(context cid);
00035
00036 rtperror RTPCloseConnection(context cid, char *reason);
00037
00038
00039 rtperror RTPSend(context cid, int32 tsinc, int8 marker,
00040 int16 pti, int8 *payload, int len);
00041
00042 rtperror RTPSendVector(context cid, int32 tsinc, int8 marker,
00043 int16 pti, struct iovec *payload, int vec_count);
00044
00045 rtperror RTPReceive(context cid, socktype socket,
00046 char *rtp_pkt_stream, int *len);
00047
00048
00049 rtperror RTPSessionAddSendAddr(context cid, char *addr, u_int16 port, u_int8 ttl);
00050 rtperror RTPSessionRemoveSendAddr(context cid, char *addr, u_int16 port, u_int8 ttl);
00051
00052 rtperror RTPSessionSetReceiveAddr(context cid, char *addr, u_int16 port);
00053 rtperror RTPSessionGetReceiveAddr(context cid, char *addr, u_int16 *port);
00054
00055
00056
00057 rtperror RTPSessionRemoveFromContributorList(context cid, u_int32 ssrc,
00058 char *reason);
00059
00060 rtperror RTPSessionGetRTPSocket(context cid, socktype *value);
00061 rtperror RTPSessionGetRTCPSocket(context cid, socktype *value);
00062
00063 rtperror RTPExecute(context cid, rtp_opaque_t opaque);
00064
00065 rtperror RTPSetChangedMemberAddressCallBack(context cid,
00066 void (*f)(context, person, char*, char*, int));
00067 rtperror RTPSetSendErrorCallBack(context cid,
00068 void (*f)(context, char *, u_int16, u_int8));
00069
00070
00071 rtperror RTPMostRecentAddr(context cid, char *addr, char *port);
00072
00073
00074 rtperror RTPMemberInfoGetRTPAddr(context cid, person p,
00075 char *addr, char *port);
00076 rtperror RTPMemberInfoGetRTCPAddr(context cid, person p,
00077 char *addr, char *port);
00078
00079
00080
00081
00082 void RTPSchedule(context cid, rtp_opaque_t opaque, struct timeval *tp);
00083
00084
00085
00086
00087 rtperror RTPSessionSetEncryption(context cid, encryption_t value);
00088 rtperror RTPSessionGetEncryption(context cid, encryption_t *value);
00089 rtperror RTPSessionSetEncryptionFuncs(context cid,
00090 void (*init)(context, void*),
00091 void (*encrypt)(context, char*, int, void*),
00092 void (*decrypt)(context, char*, int, void*));
00093
00094
00095 #endif