summaryrefslogtreecommitdiff
path: root/toxrtp/toxrtp.h
diff options
context:
space:
mode:
Diffstat (limited to 'toxrtp/toxrtp.h')
-rw-r--r--toxrtp/toxrtp.h66
1 files changed, 33 insertions, 33 deletions
diff --git a/toxrtp/toxrtp.h b/toxrtp/toxrtp.h
index f6270c11..44717835 100644
--- a/toxrtp/toxrtp.h
+++ b/toxrtp/toxrtp.h
@@ -31,7 +31,7 @@
31#define RTP_VERSION 2 31#define RTP_VERSION 2
32#include <inttypes.h> 32#include <inttypes.h>
33#include "../toxcore/tox.h" 33#include "../toxcore/tox.h"
34 34#include <pthread.h>
35/* Extension header flags */ 35/* Extension header flags */
36#define RTP_EXT_TYPE_RESOLUTION 0x01 36#define RTP_EXT_TYPE_RESOLUTION 0x01
37#define RTP_EXT_TYPE_FRAMERATE 0x02 37#define RTP_EXT_TYPE_FRAMERATE 0x02
@@ -72,7 +72,7 @@ typedef struct rtp_session_s {
72 uint32_t _time_elapsed; 72 uint32_t _time_elapsed;
73 uint32_t _current_timestamp; 73 uint32_t _current_timestamp;
74 uint32_t _ssrc; 74 uint32_t _ssrc;
75 uint32_t* _csrc; 75 uint32_t *_csrc;
76 76
77 77
78 /* If some additional data must be sent via message 78 /* If some additional data must be sent via message
@@ -80,7 +80,7 @@ typedef struct rtp_session_s {
80 * automatically placing it within a message. 80 * automatically placing it within a message.
81 */ 81 */
82 82
83 struct rtp_ext_header_s* _ext_header; 83 struct rtp_ext_header_s *_ext_header;
84 /* External header identifiers */ 84 /* External header identifiers */
85 int _exthdr_resolution; 85 int _exthdr_resolution;
86 int _exthdr_framerate; 86 int _exthdr_framerate;
@@ -95,16 +95,16 @@ typedef struct rtp_session_s {
95 95
96 uint64_t _packet_loss; 96 uint64_t _packet_loss;
97 97
98 const char* _last_error; 98 const char *_last_error;
99 99
100 struct rtp_dest_list_s* _dest_list; 100 struct rtp_dest_list_s *_dest_list;
101 struct rtp_dest_list_s* _last_user; /* a tail for faster appending */ 101 struct rtp_dest_list_s *_last_user; /* a tail for faster appending */
102 102
103 struct rtp_msg_s* _oldest_msg; 103 struct rtp_msg_s *_oldest_msg;
104 struct rtp_msg_s* _last_msg; /* tail */ 104 struct rtp_msg_s *_last_msg; /* tail */
105 105
106 uint16_t _prefix_length; 106 uint16_t _prefix_length;
107 uint8_t* _prefix; 107 uint8_t *_prefix;
108 108
109 /* Specifies multiple session use. 109 /* Specifies multiple session use.
110 * When using one session it uses default value ( -1 ) 110 * When using one session it uses default value ( -1 )
@@ -125,35 +125,35 @@ typedef struct rtp_session_s {
125 */ 125 */
126 126
127 127
128void rtp_free_msg ( rtp_session_t* _session, struct rtp_msg_s* _msg ); 128void rtp_free_msg ( rtp_session_t *_session, struct rtp_msg_s *_msg );
129int rtp_release_session_recv ( rtp_session_t* _session ); 129int rtp_release_session_recv ( rtp_session_t *_session );
130 130
131/* Functions handling receiving */ 131/* Functions handling receiving */
132struct rtp_msg_s* rtp_recv_msg ( rtp_session_t* _session ); 132struct rtp_msg_s *rtp_recv_msg ( rtp_session_t *_session );
133void rtp_store_msg ( rtp_session_t* _session, struct rtp_msg_s* _msg ); 133void rtp_store_msg ( rtp_session_t *_session, struct rtp_msg_s *_msg );
134 134
135/* 135/*
136 * rtp_msg_parse() stores headers separately from the payload data 136 * rtp_msg_parse() stores headers separately from the payload data
137 * and so the _length variable is set accordingly 137 * and so the _length variable is set accordingly
138 */ 138 */
139struct rtp_msg_s* rtp_msg_parse ( rtp_session_t* _session, const uint8_t* _data, uint32_t _length ); 139struct rtp_msg_s *rtp_msg_parse ( rtp_session_t *_session, const uint8_t *_data, uint32_t _length );
140 140
141int rtp_check_late_message (rtp_session_t* _session, struct rtp_msg_s* _msg); 141int rtp_check_late_message (rtp_session_t *_session, struct rtp_msg_s *_msg);
142void rtp_register_msg ( rtp_session_t* _session, struct rtp_msg_s* ); 142void rtp_register_msg ( rtp_session_t *_session, struct rtp_msg_s * );
143 143
144/* Functions handling sending */ 144/* Functions handling sending */
145int rtp_send_msg ( rtp_session_t* _session, struct rtp_msg_s* _msg, void* _core_handler ); 145int rtp_send_msg ( rtp_session_t *_session, struct rtp_msg_s *_msg, void *_core_handler );
146 146
147/* 147/*
148 * rtp_msg_new() stores headers and payload data in one container ( _data ) 148 * rtp_msg_new() stores headers and payload data in one container ( _data )
149 * and the _length is set accordingly. Returned message is used for sending only 149 * and the _length is set accordingly. Returned message is used for sending only
150 * so there is not much use of the headers there 150 * so there is not much use of the headers there
151 */ 151 */
152struct rtp_msg_s* rtp_msg_new ( rtp_session_t* _session, const uint8_t* _data, uint32_t _length ); 152struct rtp_msg_s *rtp_msg_new ( rtp_session_t *_session, const uint8_t *_data, uint32_t _length );
153 153
154 154
155/* Convenient functions for creating a header */ 155/* Convenient functions for creating a header */
156struct rtp_header_s* rtp_build_header ( rtp_session_t* _session ); 156struct rtp_header_s *rtp_build_header ( rtp_session_t *_session );
157 157
158/* Functions handling session control */ 158/* Functions handling session control */
159 159
@@ -163,26 +163,26 @@ struct rtp_header_s* rtp_build_header ( rtp_session_t* _session );
163/* Session initiation and termination. 163/* Session initiation and termination.
164 * Set _multi_session to -1 if not using multiple sessions 164 * Set _multi_session to -1 if not using multiple sessions
165 */ 165 */
166rtp_session_t* rtp_init_session ( int _max_users, int _multi_session ); 166rtp_session_t *rtp_init_session ( int _max_users, int _multi_session );
167int rtp_terminate_session ( rtp_session_t* _session ); 167int rtp_terminate_session ( rtp_session_t *_session );
168 168
169/* Adding receiver */ 169/* Adding receiver */
170int rtp_add_receiver ( rtp_session_t* _session, tox_IP_Port* _dest ); 170int rtp_add_receiver ( rtp_session_t *_session, tox_IP_Port *_dest );
171 171
172/* Convenient functions for marking the resolution */ 172/* Convenient functions for marking the resolution */
173int rtp_add_resolution_marking ( rtp_session_t* _session, uint16_t _width, uint16_t _height ); 173int rtp_add_resolution_marking ( rtp_session_t *_session, uint16_t _width, uint16_t _height );
174int rtp_remove_resolution_marking ( rtp_session_t* _session ); 174int rtp_remove_resolution_marking ( rtp_session_t *_session );
175uint16_t rtp_get_resolution_marking_height ( struct rtp_ext_header_s* _header, uint32_t _position ); 175uint16_t rtp_get_resolution_marking_height ( struct rtp_ext_header_s *_header, uint32_t _position );
176uint16_t rtp_get_resolution_marking_width ( struct rtp_ext_header_s* _header, uint32_t _position ); 176uint16_t rtp_get_resolution_marking_width ( struct rtp_ext_header_s *_header, uint32_t _position );
177 177
178int rtp_add_framerate_marking ( rtp_session_t* _session, uint32_t _value ); 178int rtp_add_framerate_marking ( rtp_session_t *_session, uint32_t _value );
179int rtp_remove_framerate_marking ( rtp_session_t* _session ); 179int rtp_remove_framerate_marking ( rtp_session_t *_session );
180uint32_t rtp_get_framerate_marking ( struct rtp_ext_header_s* _header ); 180uint32_t rtp_get_framerate_marking ( struct rtp_ext_header_s *_header );
181/* Convenient functions for marking the payload */ 181/* Convenient functions for marking the payload */
182void rtp_set_payload_type ( rtp_session_t* _session, uint8_t _payload_value ); 182void rtp_set_payload_type ( rtp_session_t *_session, uint8_t _payload_value );
183uint32_t rtp_get_payload_type ( rtp_session_t* _session ); 183uint32_t rtp_get_payload_type ( rtp_session_t *_session );
184 184
185/* When using RTP in core be sure to set prefix when sending via rtp_send_msg */ 185/* When using RTP in core be sure to set prefix when sending via rtp_send_msg */
186int rtp_set_prefix ( rtp_session_t* _session, uint8_t* _prefix, uint16_t _prefix_length ); 186int rtp_set_prefix ( rtp_session_t *_session, uint8_t *_prefix, uint16_t _prefix_length );
187 187
188#endif /* _RTP__IMPL_H_ */ 188#endif /* _RTP__IMPL_H_ */