diff options
author | irungentoo <irungentoo@gmail.com> | 2015-11-19 14:43:09 -0500 |
---|---|---|
committer | irungentoo <irungentoo@gmail.com> | 2015-11-19 14:43:09 -0500 |
commit | 74f2fa00c29590ef4584c7d932be8063a2d8d246 (patch) | |
tree | 00eee153147404595ae5978335406e21a305481f | |
parent | 9fc96fae6f970fe4c80ff0ceafb20ffe155419a3 (diff) | |
parent | edbfca5474b59b865e383e0dae934ba293d9dc7d (diff) |
Merge branch 'master' of https://github.com/helium-software/toxcore
-rw-r--r-- | toxav/Makefile.inc | 4 | ||||
-rw-r--r-- | toxav/bwcontroller.c (renamed from toxav/bwcontroler.c) | 30 | ||||
-rw-r--r-- | toxav/bwcontroller.h (renamed from toxav/bwcontroler.h) | 18 | ||||
-rw-r--r-- | toxav/rtp.c | 4 | ||||
-rw-r--r-- | toxav/rtp.h | 6 | ||||
-rw-r--r-- | toxav/toxav.c | 6 |
6 files changed, 34 insertions, 34 deletions
diff --git a/toxav/Makefile.inc b/toxav/Makefile.inc index 083f862f..377588d9 100644 --- a/toxav/Makefile.inc +++ b/toxav/Makefile.inc | |||
@@ -14,8 +14,8 @@ libtoxav_la_SOURCES = ../toxav/rtp.h \ | |||
14 | ../toxav/audio.c \ | 14 | ../toxav/audio.c \ |
15 | ../toxav/video.h \ | 15 | ../toxav/video.h \ |
16 | ../toxav/video.c \ | 16 | ../toxav/video.c \ |
17 | ../toxav/bwcontroler.h \ | 17 | ../toxav/bwcontroller.h \ |
18 | ../toxav/bwcontroler.c \ | 18 | ../toxav/bwcontroller.c \ |
19 | ../toxav/toxav.h \ | 19 | ../toxav/toxav.h \ |
20 | ../toxav/toxav.c \ | 20 | ../toxav/toxav.c \ |
21 | ../toxav/toxav_old.c | 21 | ../toxav/toxav_old.c |
diff --git a/toxav/bwcontroler.c b/toxav/bwcontroller.c index 9dd15c93..1725e193 100644 --- a/toxav/bwcontroler.c +++ b/toxav/bwcontroller.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /** bwcontroler.c | 1 | /** bwcontroller.c |
2 | * | 2 | * |
3 | * Copyright (C) 2013-2015 Tox project All Rights Reserved. | 3 | * Copyright (C) 2013-2015 Tox project All Rights Reserved. |
4 | * | 4 | * |
@@ -24,7 +24,7 @@ | |||
24 | #endif /* HAVE_CONFIG_H */ | 24 | #endif /* HAVE_CONFIG_H */ |
25 | 25 | ||
26 | #include <assert.h> | 26 | #include <assert.h> |
27 | #include "bwcontroler.h" | 27 | #include "bwcontroller.h" |
28 | #include "../toxcore/logger.h" | 28 | #include "../toxcore/logger.h" |
29 | #include "../toxcore/util.h" | 29 | #include "../toxcore/util.h" |
30 | 30 | ||
@@ -37,8 +37,8 @@ | |||
37 | * | 37 | * |
38 | */ | 38 | */ |
39 | 39 | ||
40 | struct BWControler_s { | 40 | struct BWController_s { |
41 | void (*mcb) (BWControler *, uint32_t, float, void *); | 41 | void (*mcb) (BWController *, uint32_t, float, void *); |
42 | void *mcb_data; | 42 | void *mcb_data; |
43 | 43 | ||
44 | Messenger *m; | 44 | Messenger *m; |
@@ -60,13 +60,13 @@ struct BWControler_s { | |||
60 | }; | 60 | }; |
61 | 61 | ||
62 | int bwc_handle_data(Messenger *m, uint32_t friendnumber, const uint8_t *data, uint16_t length, void *object); | 62 | int bwc_handle_data(Messenger *m, uint32_t friendnumber, const uint8_t *data, uint16_t length, void *object); |
63 | void send_update(BWControler *bwc); | 63 | void send_update(BWController *bwc); |
64 | 64 | ||
65 | BWControler *bwc_new(Messenger *m, uint32_t friendnumber, | 65 | BWController *bwc_new(Messenger *m, uint32_t friendnumber, |
66 | void (*mcb) (BWControler *, uint32_t, float, void *), | 66 | void (*mcb) (BWController *, uint32_t, float, void *), |
67 | void *udata) | 67 | void *udata) |
68 | { | 68 | { |
69 | BWControler *retu = calloc(sizeof(struct BWControler_s), 1); | 69 | BWController *retu = calloc(sizeof(struct BWController_s), 1); |
70 | 70 | ||
71 | retu->mcb = mcb; | 71 | retu->mcb = mcb; |
72 | retu->mcb_data = udata; | 72 | retu->mcb_data = udata; |
@@ -85,7 +85,7 @@ BWControler *bwc_new(Messenger *m, uint32_t friendnumber, | |||
85 | 85 | ||
86 | return retu; | 86 | return retu; |
87 | } | 87 | } |
88 | void bwc_kill(BWControler *bwc) | 88 | void bwc_kill(BWController *bwc) |
89 | { | 89 | { |
90 | if (!bwc) | 90 | if (!bwc) |
91 | return; | 91 | return; |
@@ -95,7 +95,7 @@ void bwc_kill(BWControler *bwc) | |||
95 | rb_kill(bwc->rcvpkt.rb); | 95 | rb_kill(bwc->rcvpkt.rb); |
96 | free(bwc); | 96 | free(bwc); |
97 | } | 97 | } |
98 | void bwc_feed_avg(BWControler *bwc, uint32_t bytes) | 98 | void bwc_feed_avg(BWController *bwc, uint32_t bytes) |
99 | { | 99 | { |
100 | uint32_t *p; | 100 | uint32_t *p; |
101 | 101 | ||
@@ -104,7 +104,7 @@ void bwc_feed_avg(BWControler *bwc, uint32_t bytes) | |||
104 | 104 | ||
105 | *p = bytes; | 105 | *p = bytes; |
106 | } | 106 | } |
107 | void bwc_add_lost(BWControler *bwc, uint32_t bytes) | 107 | void bwc_add_lost(BWController *bwc, uint32_t bytes) |
108 | { | 108 | { |
109 | if (!bwc) | 109 | if (!bwc) |
110 | return; | 110 | return; |
@@ -129,7 +129,7 @@ void bwc_add_lost(BWControler *bwc, uint32_t bytes) | |||
129 | bwc->cycle.lost += bytes; | 129 | bwc->cycle.lost += bytes; |
130 | send_update(bwc); | 130 | send_update(bwc); |
131 | } | 131 | } |
132 | void bwc_add_recv(BWControler *bwc, uint32_t bytes) | 132 | void bwc_add_recv(BWController *bwc, uint32_t bytes) |
133 | { | 133 | { |
134 | if (!bwc || !bytes) | 134 | if (!bwc || !bytes) |
135 | return; | 135 | return; |
@@ -144,7 +144,7 @@ struct BWCMessage { | |||
144 | uint32_t recv; | 144 | uint32_t recv; |
145 | }; | 145 | }; |
146 | 146 | ||
147 | void send_update(BWControler *bwc) | 147 | void send_update(BWController *bwc) |
148 | { | 148 | { |
149 | if (current_time_monotonic() - bwc->cycle.lfu > BWC_REFRESH_INTERVAL_MS) { | 149 | if (current_time_monotonic() - bwc->cycle.lfu > BWC_REFRESH_INTERVAL_MS) { |
150 | 150 | ||
@@ -171,7 +171,7 @@ void send_update(BWControler *bwc) | |||
171 | bwc->cycle.lsu = current_time_monotonic(); | 171 | bwc->cycle.lsu = current_time_monotonic(); |
172 | } | 172 | } |
173 | } | 173 | } |
174 | int on_update (BWControler *bwc, struct BWCMessage *msg) | 174 | int on_update (BWController *bwc, struct BWCMessage *msg) |
175 | { | 175 | { |
176 | LOGGER_DEBUG ("%p Got update from peer", bwc); | 176 | LOGGER_DEBUG ("%p Got update from peer", bwc); |
177 | 177 | ||
diff --git a/toxav/bwcontroler.h b/toxav/bwcontroller.h index 53b07d38..5e7ae9df 100644 --- a/toxav/bwcontroler.h +++ b/toxav/bwcontroller.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /** bwcontroler.h | 1 | /** bwcontroller.h |
2 | * | 2 | * |
3 | * Copyright (C) 2013-2015 Tox project All Rights Reserved. | 3 | * Copyright (C) 2013-2015 Tox project All Rights Reserved. |
4 | * | 4 | * |
@@ -23,15 +23,15 @@ | |||
23 | #define BWCONROLER_H | 23 | #define BWCONROLER_H |
24 | #include "../toxcore/Messenger.h" | 24 | #include "../toxcore/Messenger.h" |
25 | 25 | ||
26 | typedef struct BWControler_s BWControler; | 26 | typedef struct BWController_s BWController; |
27 | 27 | ||
28 | BWControler *bwc_new(Messenger *m, uint32_t friendnumber, | 28 | BWController *bwc_new(Messenger *m, uint32_t friendnumber, |
29 | void (*mcb) (BWControler *, uint32_t, float, void *), | 29 | void (*mcb) (BWController *, uint32_t, float, void *), |
30 | void *udata); | 30 | void *udata); |
31 | void bwc_kill(BWControler *bwc); | 31 | void bwc_kill(BWController *bwc); |
32 | 32 | ||
33 | void bwc_feed_avg(BWControler *bwc, uint32_t bytes); | 33 | void bwc_feed_avg(BWController *bwc, uint32_t bytes); |
34 | void bwc_add_lost(BWControler *bwc, uint32_t bytes); | 34 | void bwc_add_lost(BWController *bwc, uint32_t bytes); |
35 | void bwc_add_recv(BWControler *bwc, uint32_t bytes); | 35 | void bwc_add_recv(BWController *bwc, uint32_t bytes); |
36 | 36 | ||
37 | #endif /* BWCONROLER_H */ | 37 | #endif /* BWCONROLER_H */ |
diff --git a/toxav/rtp.c b/toxav/rtp.c index 44114fff..3752d72f 100644 --- a/toxav/rtp.c +++ b/toxav/rtp.c | |||
@@ -24,7 +24,7 @@ | |||
24 | #endif /* HAVE_CONFIG_H */ | 24 | #endif /* HAVE_CONFIG_H */ |
25 | 25 | ||
26 | #include "rtp.h" | 26 | #include "rtp.h" |
27 | #include "bwcontroler.h" | 27 | #include "bwcontroller.h" |
28 | #include "../toxcore/logger.h" | 28 | #include "../toxcore/logger.h" |
29 | #include "../toxcore/util.h" | 29 | #include "../toxcore/util.h" |
30 | #include "../toxcore/Messenger.h" | 30 | #include "../toxcore/Messenger.h" |
@@ -37,7 +37,7 @@ int handle_rtp_packet (Messenger *m, uint32_t friendnumber, const uint8_t *data, | |||
37 | 37 | ||
38 | 38 | ||
39 | RTPSession *rtp_new (int payload_type, Messenger *m, uint32_t friendnumber, | 39 | RTPSession *rtp_new (int payload_type, Messenger *m, uint32_t friendnumber, |
40 | BWControler *bwc, void *cs, | 40 | BWController *bwc, void *cs, |
41 | int (*mcb) (void *, struct RTPMessage *)) | 41 | int (*mcb) (void *, struct RTPMessage *)) |
42 | { | 42 | { |
43 | assert(mcb); | 43 | assert(mcb); |
diff --git a/toxav/rtp.h b/toxav/rtp.h index 0393ac27..7daa6fd7 100644 --- a/toxav/rtp.h +++ b/toxav/rtp.h | |||
@@ -22,7 +22,7 @@ | |||
22 | #ifndef RTP_H | 22 | #ifndef RTP_H |
23 | #define RTP_H | 23 | #define RTP_H |
24 | 24 | ||
25 | #include "bwcontroler.h" | 25 | #include "bwcontroller.h" |
26 | #include "../toxcore/Messenger.h" | 26 | #include "../toxcore/Messenger.h" |
27 | #include "stdbool.h" | 27 | #include "stdbool.h" |
28 | 28 | ||
@@ -92,14 +92,14 @@ typedef struct { | |||
92 | Messenger *m; | 92 | Messenger *m; |
93 | uint32_t friend_number; | 93 | uint32_t friend_number; |
94 | 94 | ||
95 | BWControler *bwc; | 95 | BWController *bwc; |
96 | void *cs; | 96 | void *cs; |
97 | int (*mcb) (void *, struct RTPMessage *msg); | 97 | int (*mcb) (void *, struct RTPMessage *msg); |
98 | } RTPSession; | 98 | } RTPSession; |
99 | 99 | ||
100 | 100 | ||
101 | RTPSession *rtp_new (int payload_type, Messenger *m, uint32_t friend_num, | 101 | RTPSession *rtp_new (int payload_type, Messenger *m, uint32_t friend_num, |
102 | BWControler *bwc, void *cs, | 102 | BWController *bwc, void *cs, |
103 | int (*mcb) (void *, struct RTPMessage *)); | 103 | int (*mcb) (void *, struct RTPMessage *)); |
104 | void rtp_kill (RTPSession *session); | 104 | void rtp_kill (RTPSession *session); |
105 | int rtp_allow_receiving (RTPSession *session); | 105 | int rtp_allow_receiving (RTPSession *session); |
diff --git a/toxav/toxav.c b/toxav/toxav.c index aaeb6f2d..3d4004cf 100644 --- a/toxav/toxav.c +++ b/toxav/toxav.c | |||
@@ -45,7 +45,7 @@ typedef struct ToxAVCall_s { | |||
45 | pthread_mutex_t mutex_video[1]; | 45 | pthread_mutex_t mutex_video[1]; |
46 | PAIR(RTPSession *, VCSession *) video; | 46 | PAIR(RTPSession *, VCSession *) video; |
47 | 47 | ||
48 | BWControler *bwc; | 48 | BWController *bwc; |
49 | 49 | ||
50 | bool active; | 50 | bool active; |
51 | MSICall *msi_call; | 51 | MSICall *msi_call; |
@@ -87,7 +87,7 @@ struct ToxAV { | |||
87 | uint32_t interval; /** Calculated interval */ | 87 | uint32_t interval; /** Calculated interval */ |
88 | }; | 88 | }; |
89 | 89 | ||
90 | void callback_bwc (BWControler *bwc, uint32_t friend_number, float loss, void *user_data); | 90 | void callback_bwc (BWController *bwc, uint32_t friend_number, float loss, void *user_data); |
91 | 91 | ||
92 | int callback_invite(void *toxav_inst, MSICall *call); | 92 | int callback_invite(void *toxav_inst, MSICall *call); |
93 | int callback_start(void *toxav_inst, MSICall *call); | 93 | int callback_start(void *toxav_inst, MSICall *call); |
@@ -857,7 +857,7 @@ void toxav_callback_video_receive_frame(ToxAV *av, toxav_video_receive_frame_cb | |||
857 | * :: Internal | 857 | * :: Internal |
858 | * | 858 | * |
859 | ******************************************************************************/ | 859 | ******************************************************************************/ |
860 | void callback_bwc(BWControler *bwc, uint32_t friend_number, float loss, void *user_data) | 860 | void callback_bwc(BWController *bwc, uint32_t friend_number, float loss, void *user_data) |
861 | { | 861 | { |
862 | /* Callback which is called when the internal measure mechanism reported packet loss. | 862 | /* Callback which is called when the internal measure mechanism reported packet loss. |
863 | * We report suggested lowered bitrate to an app. If app is sending both audio and video, | 863 | * We report suggested lowered bitrate to an app. If app is sending both audio and video, |