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