~ubuntu-branches/ubuntu/quantal/linphone/quantal

« back to all changes in this revision

Viewing changes to oRTP/src/rtcp.h

  • Committer: Bazaar Package Importer
  • Author(s): Samuel Mimram
  • Date: 2004-06-30 13:58:16 UTC
  • Revision ID: james.westby@ubuntu.com-20040630135816-wwx75gdlodkqbabb
Tags: upstream-0.12.2
ImportĀ upstreamĀ versionĀ 0.12.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
  The oRTP library is an RTP (Realtime Transport Protocol - rfc1889) stack.
 
3
  Copyright (C) 2001  Simon MORLAT simon.morlat@linphone.org
 
4
 
 
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.
 
9
 
 
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.
 
14
 
 
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
 
18
*/
 
19
 
 
20
 
 
21
#ifndef RTCP_H
 
22
#define RTCP_H
 
23
 
 
24
#include "rtpport.h"
 
25
 
 
26
 
 
27
#ifdef RTCP
 
28
 
 
29
#define RTCP_COMMON_HEADER_SIZE 4
 
30
#define RTCP_SENDER_INFO_SIZE 20
 
31
#define RTCP_REPORT_BLOCK_SIZE 24
 
32
#define RTCP_SDES_MAX_STRING_SIZE 255
 
33
#define RTCP_SDES_ITEM_HEADER_SIZE 2
 
34
 
 
35
 
 
36
 
 
37
typedef enum {
 
38
    RTCP_SR     = 200,
 
39
    RTCP_RR     = 201,
 
40
    RTCP_SDES   = 202,
 
41
    RTCP_BYE    = 203,
 
42
    RTCP_APP    = 204
 
43
} rtcp_type_t;
 
44
 
 
45
typedef enum {
 
46
    RTCP_SDES_END               = 0,
 
47
    RTCP_SDES_CNAME     = 1,
 
48
    RTCP_SDES_NAME      = 2,
 
49
    RTCP_SDES_EMAIL     = 3,
 
50
    RTCP_SDES_PHONE     = 4,
 
51
    RTCP_SDES_LOC               = 5,
 
52
    RTCP_SDES_TOOL      = 6,
 
53
    RTCP_SDES_NOTE      = 7,
 
54
    RTCP_SDES_PRIV              = 8,
 
55
    RTCP_SDES_MAX               = 9
 
56
} rtcp_sdes_type_t;
 
57
 
 
58
typedef struct rtcp_common_header
 
59
{
 
60
#ifdef WORDS_BIGENDIAN
 
61
        guint16 version:2;
 
62
        guint16 padbit:1;
 
63
        guint16 rc:5;
 
64
        guint16 packet_type:8;
 
65
#else
 
66
        guint16 rc:5;
 
67
        guint16 padbit:1;
 
68
        guint16 version:2;
 
69
                guint16 packet_type:8;
 
70
#endif
 
71
        guint16 length:16;
 
72
                guint32 ssrc;
 
73
} rtcp_common_header_t;
 
74
 
 
75
 
 
76
typedef struct sender_info
 
77
{
 
78
        guint32 ntp_timestamp_msw;
 
79
        guint32 ntp_timestamp_lsw;
 
80
        guint32 rtp_timestamp;
 
81
        guint32 senders_packet_count;
 
82
        guint32 senders_octet_count;
 
83
} sender_info_t;
 
84
 
 
85
typedef struct report_block
 
86
{
 
87
        guint32 ssrc;
 
88
        guint32 fraction_lost:8;
 
89
        guint32 cum_num_packet_lost:24; /*cumulative number of packet lost*/
 
90
        guint32 ext_high_seq_num_rec; /*extended highest sequence number received */
 
91
        guint32 interarrival_jitter;
 
92
        guint32 lsr; /*last SR */
 
93
        guint32 delay_snc_last_sr; /*delay since last sr*/
 
94
} report_block_t;
 
95
 
 
96
typedef struct chunk_item
 
97
{
 
98
        guint32 csrc;
 
99
        GByteArray *sdes_items;
 
100
} chunk_item_t;
 
101
 
 
102
typedef struct sdes_item
 
103
{
 
104
        guint8 item_type;
 
105
    guint8 len;
 
106
        gchar content[1];       
 
107
} sdes_item_t;
 
108
 
 
109
 
 
110
typedef struct rtcp_bye_reason
 
111
{
 
112
    guint8 len;
 
113
        gchar content[1];
 
114
} rtcp_bye_t;
 
115
 
 
116
 
 
117
#endif
 
118
 
 
119
#endif