live
rtcp_from_spec.h
Go to the documentation of this file.
1/**********
2This library is free software; you can redistribute it and/or modify it under
3the terms of the GNU Lesser General Public License as published by the
4Free Software Foundation; either version 3 of the License, or (at your
5option) any later version. (See <http://www.gnu.org/copyleft/lesser.html>.)
6
7This library is distributed in the hope that it will be useful, but WITHOUT
8ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
9FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
10more details.
11
12You should have received a copy of the GNU Lesser General Public License
13along with this library; if not, write to the Free Software Foundation, Inc.,
1451 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
15**********/
16/*
17 * "liveMedia"
18 * Copyright (c) 1996-2024, Live Networks, Inc. All rights reserved
19 *
20 * RTCP code taken directly from the most recent RTP specification: RFC 3550
21 * C header
22 */
23
24#ifndef _RTCP_FROM_SPEC_H
25#define _RTCP_FROM_SPEC_H
26
27#include <stdlib.h>
28
29/* Definitions of _ANSI_ARGS and EXTERN that will work in either
30 C or C++ code:
31 */
32#undef _ANSI_ARGS_
33#if ((defined(__STDC__) || defined(SABER)) && !defined(NO_PROTOTYPE)) || defined(__cplusplus) || defined(USE_PROTOTYPE)
34# define _ANSI_ARGS_(x) x
35#else
36# define _ANSI_ARGS_(x) ()
37#endif
38#ifdef __cplusplus
39# define EXTERN extern "C"
40#else
41# define EXTERN extern
42#endif
43
44/* The code from the spec assumes a type "event"; make this a void*: */
45typedef void* event;
46
47#define EVENT_UNKNOWN 0
48#define EVENT_REPORT 1
49#define EVENT_BYE 2
50
51/* The code from the spec assumes a type "time_tp"; make this a double: */
52typedef double time_tp;
53
54/* The code from the spec assumes a type "packet"; make this a void*: */
55typedef void* packet;
56
57#define PACKET_UNKNOWN_TYPE 0
58#define PACKET_RTP 1
59#define PACKET_RTCP_REPORT 2
60#define PACKET_BYE 3
61#define PACKET_RTCP_APP 4
62
63/* The code from the spec calls drand48(), but we have drand30() instead */
64#define drand48 drand30
65
66/* The code calls "exit()", but we don't want to exit, so make it a noop: */
67#define exit(n) do {} while (0)
68
69#ifndef FALSE
70#define FALSE 0
71#endif
72#ifndef TRUE
73#define TRUE 1
74#endif
75
76/* EXPORTS: */
77
78EXTERN void OnExpire _ANSI_ARGS_((event, int, int, double, int, double*, int*, time_tp, time_tp*, int*));
79
80EXTERN void OnReceive _ANSI_ARGS_((packet, event, int*, int*, int*, double*, double*, double, double));
81
82/* IMPORTS: */
83
84EXTERN void Schedule _ANSI_ARGS_((double,event));
85EXTERN void Reschedule _ANSI_ARGS_((double,event));
86EXTERN void SendRTCPReport _ANSI_ARGS_((event));
87EXTERN void SendBYEPacket _ANSI_ARGS_((event));
88EXTERN int TypeOfEvent _ANSI_ARGS_((event));
89EXTERN int SentPacketSize _ANSI_ARGS_((event));
90EXTERN int PacketType _ANSI_ARGS_((packet));
91EXTERN int ReceivedPacketSize _ANSI_ARGS_((packet));
92EXTERN int NewMember _ANSI_ARGS_((packet));
93EXTERN int NewSender _ANSI_ARGS_((packet));
94EXTERN void AddMember _ANSI_ARGS_((packet));
95EXTERN void AddSender _ANSI_ARGS_((packet));
96EXTERN void RemoveMember _ANSI_ARGS_((packet));
97EXTERN void RemoveSender _ANSI_ARGS_((packet));
98EXTERN double drand30 _ANSI_ARGS_((void));
99
100#endif
double time_tp
#define EXTERN
void * event
#define _ANSI_ARGS_(x)
void * packet