summaryrefslogtreecommitdiff
path: root/toxav/rtp.h
diff options
context:
space:
mode:
Diffstat (limited to 'toxav/rtp.h')
-rw-r--r--toxav/rtp.h80
1 files changed, 40 insertions, 40 deletions
diff --git a/toxav/rtp.h b/toxav/rtp.h
index acec8b0a..c2b68b01 100644
--- a/toxav/rtp.h
+++ b/toxav/rtp.h
@@ -1,5 +1,5 @@
1/** toxrtp.h 1/** toxrtp.h
2 * 2 *
3 * Copyright (C) 2013 Tox project All Rights Reserved. 3 * Copyright (C) 2013 Tox project All Rights Reserved.
4 * 4 *
5 * This file is part of Tox. 5 * This file is part of Tox.
@@ -17,7 +17,7 @@
17 * You should have received a copy of the GNU General Public License 17 * You should have received a copy of the GNU General Public License
18 * along with Tox. If not, see <http://www.gnu.org/licenses/>. 18 * along with Tox. If not, see <http://www.gnu.org/licenses/>.
19 * 19 *
20 * 20 *
21 * Report bugs/suggestions at #tox-dev @ freenode.net:6667 21 * Report bugs/suggestions at #tox-dev @ freenode.net:6667
22 */ 22 */
23 23
@@ -38,7 +38,7 @@
38 38
39/** 39/**
40 * @brief Standard rtp header 40 * @brief Standard rtp header
41 * 41 *
42 */ 42 */
43 43
44typedef struct _RTPHeader { 44typedef struct _RTPHeader {
@@ -47,7 +47,7 @@ typedef struct _RTPHeader {
47 uint16_t sequnum; /* Sequence Number */ 47 uint16_t sequnum; /* Sequence Number */
48 uint32_t timestamp; /* Timestamp */ 48 uint32_t timestamp; /* Timestamp */
49 uint32_t ssrc; /* SSRC */ 49 uint32_t ssrc; /* SSRC */
50 uint32_t* csrc; /* CSRC's table */ 50 uint32_t *csrc; /* CSRC's table */
51 uint32_t length; /* Length of the header in payload string. */ 51 uint32_t length; /* Length of the header in payload string. */
52 52
53} RTPHeader; 53} RTPHeader;
@@ -55,29 +55,29 @@ typedef struct _RTPHeader {
55 55
56/** 56/**
57 * @brief Standard rtp extension header. 57 * @brief Standard rtp extension header.
58 * 58 *
59 */ 59 */
60typedef struct _RTPExtHeader { 60typedef struct _RTPExtHeader {
61 uint16_t type; /* Extension profile */ 61 uint16_t type; /* Extension profile */
62 uint16_t length; /* Number of extensions */ 62 uint16_t length; /* Number of extensions */
63 uint32_t* table; /* Extension's table */ 63 uint32_t *table; /* Extension's table */
64 64
65} RTPExtHeader; 65} RTPExtHeader;
66 66
67 67
68/** 68/**
69 * @brief Standard rtp message. 69 * @brief Standard rtp message.
70 * 70 *
71 */ 71 */
72typedef struct _RTPMessage { 72typedef struct _RTPMessage {
73 RTPHeader* header; 73 RTPHeader *header;
74 RTPExtHeader* ext_header; 74 RTPExtHeader *ext_header;
75 75
76 uint8_t data[MAX_RTP_SIZE]; 76 uint8_t data[MAX_RTP_SIZE];
77 uint32_t length; 77 uint32_t length;
78 IP_Port from; 78 IP_Port from;
79 79
80 struct _RTPMessage* next; 80 struct _RTPMessage *next;
81} RTPMessage; 81} RTPMessage;
82 82
83 83
@@ -87,7 +87,7 @@ typedef struct _RTPMessage {
87 * the entire session. There are functions for manipulating 87 * the entire session. There are functions for manipulating
88 * the session so tend to use those instead of directly modifying 88 * the session so tend to use those instead of directly modifying
89 * session parameters. 89 * session parameters.
90 * 90 *
91 */ 91 */
92typedef struct _RTPSession { 92typedef struct _RTPSession {
93 uint8_t version; 93 uint8_t version;
@@ -100,14 +100,14 @@ typedef struct _RTPSession {
100 uint16_t rsequnum; /* Check when recving msg */ 100 uint16_t rsequnum; /* Check when recving msg */
101 uint32_t timestamp; 101 uint32_t timestamp;
102 uint32_t ssrc; 102 uint32_t ssrc;
103 uint32_t* csrc; 103 uint32_t *csrc;
104 104
105 /* If some additional data must be sent via message 105 /* If some additional data must be sent via message
106 * apply it here. Only by allocating this member you will be 106 * apply it here. Only by allocating this member you will be
107 * automatically placing it within a message. 107 * automatically placing it within a message.
108 */ 108 */
109 RTPExtHeader* ext_header; 109 RTPExtHeader *ext_header;
110 110
111 /* External header identifiers */ 111 /* External header identifiers */
112 int resolution; 112 int resolution;
113 int framerate; 113 int framerate;
@@ -117,15 +117,15 @@ typedef struct _RTPSession {
117 * call structure don't allocate or free 117 * call structure don't allocate or free
118 */ 118 */
119 119
120 const uint8_t* encrypt_key; 120 const uint8_t *encrypt_key;
121 const uint8_t* decrypt_key; 121 const uint8_t *decrypt_key;
122 uint8_t* encrypt_nonce; 122 uint8_t *encrypt_nonce;
123 uint8_t* decrypt_nonce; 123 uint8_t *decrypt_nonce;
124 124
125 uint8_t* nonce_cycle; 125 uint8_t *nonce_cycle;
126 126
127 RTPMessage* oldest_msg; 127 RTPMessage *oldest_msg;
128 RTPMessage* last_msg; /* tail */ 128 RTPMessage *last_msg; /* tail */
129 129
130 /* Msg prefix for core to know when recving */ 130 /* Msg prefix for core to know when recving */
131 uint8_t prefix; 131 uint8_t prefix;
@@ -138,28 +138,28 @@ typedef struct _RTPSession {
138 138
139/** 139/**
140 * @brief Release all messages held by session. 140 * @brief Release all messages held by session.
141 * 141 *
142 * @param session The session. 142 * @param session The session.
143 * @return int 143 * @return int
144 * @retval -1 Error occurred. 144 * @retval -1 Error occurred.
145 * @retval 0 Success. 145 * @retval 0 Success.
146 */ 146 */
147int rtp_release_session_recv ( RTPSession* session ); 147int rtp_release_session_recv ( RTPSession *session );
148 148
149 149
150/** 150/**
151 * @brief Get's oldest message in the list. 151 * @brief Get's oldest message in the list.
152 * 152 *
153 * @param session Where the list is. 153 * @param session Where the list is.
154 * @return RTPMessage* The message. You need to call rtp_msg_free() to free it. 154 * @return RTPMessage* The message. You need to call rtp_msg_free() to free it.
155 * @retval NULL No messages in the list, or no list. 155 * @retval NULL No messages in the list, or no list.
156 */ 156 */
157RTPMessage* rtp_recv_msg ( RTPSession* session ); 157RTPMessage *rtp_recv_msg ( RTPSession *session );
158 158
159 159
160/** 160/**
161 * @brief Sends msg to _RTPSession::dest 161 * @brief Sends msg to _RTPSession::dest
162 * 162 *
163 * @param session The session. 163 * @param session The session.
164 * @param msg The message 164 * @param msg The message
165 * @param messenger Tox* object. 165 * @param messenger Tox* object.
@@ -167,23 +167,23 @@ RTPMessage* rtp_recv_msg ( RTPSession* session );
167 * @retval -1 On error. 167 * @retval -1 On error.
168 * @retval 0 On success. 168 * @retval 0 On success.
169 */ 169 */
170int rtp_send_msg ( RTPSession* session, Messenger* messenger, const uint8_t* data, uint16_t length ); 170int rtp_send_msg ( RTPSession *session, Messenger *messenger, const uint8_t *data, uint16_t length );
171 171
172 172
173/** 173/**
174 * @brief Speaks for it self. 174 * @brief Speaks for it self.
175 * 175 *
176 * @param session The control session msg belongs to. It can be NULL. 176 * @param session The control session msg belongs to. It can be NULL.
177 * @param msg The message. 177 * @param msg The message.
178 * @return void 178 * @return void
179 */ 179 */
180void rtp_free_msg ( RTPSession* session, RTPMessage* msg ); 180void rtp_free_msg ( RTPSession *session, RTPMessage *msg );
181 181
182 182
183/** 183/**
184 * @brief Must be called before calling any other rtp function. It's used 184 * @brief Must be called before calling any other rtp function. It's used
185 * to initialize RTP control session. 185 * to initialize RTP control session.
186 * 186 *
187 * @param payload_type Type of payload used to send. You can use values in toxmsi.h::MSICallType 187 * @param payload_type Type of payload used to send. You can use values in toxmsi.h::MSICallType
188 * @param messenger Tox* object. 188 * @param messenger Tox* object.
189 * @param friend_num Friend id. 189 * @param friend_num Friend id.
@@ -194,25 +194,25 @@ void rtp_free_msg ( RTPSession* session, RTPMessage* msg );
194 * @return RTPSession* Created control session. 194 * @return RTPSession* Created control session.
195 * @retval NULL Error occurred. 195 * @retval NULL Error occurred.
196 */ 196 */
197RTPSession* rtp_init_session ( int payload_type, 197RTPSession *rtp_init_session ( int payload_type,
198 Messenger* messenger, 198 Messenger *messenger,
199 int friend_num, 199 int friend_num,
200 const uint8_t* encrypt_key, 200 const uint8_t *encrypt_key,
201 const uint8_t* decrypt_key, 201 const uint8_t *decrypt_key,
202 const uint8_t* encrypt_nonce, 202 const uint8_t *encrypt_nonce,
203 const uint8_t* decrypt_nonce ); 203 const uint8_t *decrypt_nonce );
204 204
205 205
206/** 206/**
207 * @brief Terminate the session. 207 * @brief Terminate the session.
208 * 208 *
209 * @param session The session. 209 * @param session The session.
210 * @param messenger The messenger who owns the session 210 * @param messenger The messenger who owns the session
211 * @return int 211 * @return int
212 * @retval -1 Error occurred. 212 * @retval -1 Error occurred.
213 * @retval 0 Success. 213 * @retval 0 Success.
214 */ 214 */
215int rtp_terminate_session ( RTPSession* session, Messenger* messenger ); 215int rtp_terminate_session ( RTPSession *session, Messenger *messenger );
216 216
217 217
218 218