diff options
author | mannol <eniz_vukovic@hotmail.com> | 2015-04-29 01:01:25 +0200 |
---|---|---|
committer | mannol <eniz_vukovic@hotmail.com> | 2015-04-29 01:01:25 +0200 |
commit | 9bba7a0434d0967d5dd76b8afc7783ea2edad0cf (patch) | |
tree | 6486c250acb38429a63a62e54cd1e4bcb0a029ee /toxav/msi.h | |
parent | e4a020333d76bc30172f54f2545677f01bdd54b6 (diff) |
Done
Diffstat (limited to 'toxav/msi.h')
-rw-r--r-- | toxav/msi.h | 24 |
1 files changed, 7 insertions, 17 deletions
diff --git a/toxav/msi.h b/toxav/msi.h index 457d3148..4836ae89 100644 --- a/toxav/msi.h +++ b/toxav/msi.h | |||
@@ -89,7 +89,7 @@ typedef struct MSICall_s { | |||
89 | uint8_t peer_capabilities; /* Peer capabilities */ | 89 | uint8_t peer_capabilities; /* Peer capabilities */ |
90 | uint8_t self_capabilities; /* Self capabilities */ | 90 | uint8_t self_capabilities; /* Self capabilities */ |
91 | uint16_t peer_vfpsz; /* Video frame piece size */ | 91 | uint16_t peer_vfpsz; /* Video frame piece size */ |
92 | uint32_t friend_id; /* Index of this call in MSISession */ | 92 | uint32_t friend_number; /* Index of this call in MSISession */ |
93 | MSIError error; /* Last error */ | 93 | MSIError error; /* Last error */ |
94 | 94 | ||
95 | void* av_call; /* Pointer to av call handler */ | 95 | void* av_call; /* Pointer to av call handler */ |
@@ -100,12 +100,11 @@ typedef struct MSICall_s { | |||
100 | 100 | ||
101 | 101 | ||
102 | /** | 102 | /** |
103 | * Msi callback type. 'agent' is a pointer to ToxAv. | ||
104 | * Expected return on success is 0, if any other number is | 103 | * Expected return on success is 0, if any other number is |
105 | * returned the call is considered errored and will be handled | 104 | * returned the call is considered errored and will be handled |
106 | * as such which means it will be terminated without any notice. | 105 | * as such which means it will be terminated without any notice. |
107 | */ | 106 | */ |
108 | typedef int ( *MSICallbackType ) ( void *agent, MSICall* call); | 107 | typedef int msi_action_cb ( void *av, MSICall* call); |
109 | 108 | ||
110 | /** | 109 | /** |
111 | * Control session struct. Please do not modify outside msi.c | 110 | * Control session struct. Please do not modify outside msi.c |
@@ -119,43 +118,34 @@ typedef struct MSISession_s { | |||
119 | void *av; | 118 | void *av; |
120 | Messenger *messenger; | 119 | Messenger *messenger; |
121 | 120 | ||
122 | /* The mutex controls async access from control | ||
123 | * thread(s) and core thread. | ||
124 | */ | ||
125 | pthread_mutex_t mutex[1]; | 121 | pthread_mutex_t mutex[1]; |
126 | MSICallbackType callbacks[7]; | 122 | msi_action_cb* callbacks[7]; |
127 | } MSISession; | 123 | } MSISession; |
128 | 124 | ||
129 | /** | 125 | /** |
130 | * Start the control session. | 126 | * Start the control session. |
131 | */ | 127 | */ |
132 | MSISession *msi_new ( Messenger *messenger ); | 128 | MSISession *msi_new ( Messenger *m ); |
133 | |||
134 | /** | 129 | /** |
135 | * Terminate control session. NOTE: all calls will be freed | 130 | * Terminate control session. NOTE: all calls will be freed |
136 | */ | 131 | */ |
137 | int msi_kill ( MSISession *session ); | 132 | int msi_kill ( MSISession *session ); |
138 | |||
139 | /** | 133 | /** |
140 | * Callback setter. | 134 | * Callback setter. |
141 | */ | 135 | */ |
142 | void msi_register_callback(MSISession *session, MSICallbackType callback, MSICallbackID id); | 136 | void msi_register_callback(MSISession *session, msi_action_cb* callback, MSICallbackID id); |
143 | |||
144 | /** | 137 | /** |
145 | * Send invite request to friend_id. | 138 | * Send invite request to friend_number. |
146 | */ | 139 | */ |
147 | int msi_invite ( MSISession* session, MSICall** call, uint32_t friend_id, uint8_t capabilities ); | 140 | int msi_invite ( MSISession* session, MSICall** call, uint32_t friend_number, uint8_t capabilities ); |
148 | |||
149 | /** | 141 | /** |
150 | * Hangup call. NOTE: 'call' will be freed | 142 | * Hangup call. NOTE: 'call' will be freed |
151 | */ | 143 | */ |
152 | int msi_hangup ( MSICall* call ); | 144 | int msi_hangup ( MSICall* call ); |
153 | |||
154 | /** | 145 | /** |
155 | * Answer call request. | 146 | * Answer call request. |
156 | */ | 147 | */ |
157 | int msi_answer ( MSICall* call, uint8_t capabilities ); | 148 | int msi_answer ( MSICall* call, uint8_t capabilities ); |
158 | |||
159 | /** | 149 | /** |
160 | * Change capabilities of the call. | 150 | * Change capabilities of the call. |
161 | */ | 151 | */ |