diff options
author | xhe <xw897002528@gmail.com> | 2018-01-28 19:14:04 +0800 |
---|---|---|
committer | iphydf <iphydf@users.noreply.github.com> | 2018-01-28 13:21:57 +0000 |
commit | 651ef3adb6299e66745cc1d1b57feb29fd17090a (patch) | |
tree | c211507a788558db661859a0cc9fdbc81c4c656a /testing | |
parent | b9350bc459fee755c2e3bd566173860115bef640 (diff) |
Make audio/video bit rates "properties"
follow TokTok#731. This commit
completely removed all things in namespace bit_rate, and deprecated
functions are to be added back in another commit. set_xxx() is treadted
as a property of namespace audio&video, same as bit_rate change event.
toxav_basic_test is fixed, either.
Diffstat (limited to 'testing')
-rw-r--r-- | testing/av_test.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/testing/av_test.c b/testing/av_test.c index 71836a52..ce982e32 100644 --- a/testing/av_test.c +++ b/testing/av_test.c | |||
@@ -210,11 +210,15 @@ static void t_toxav_receive_audio_frame_cb(ToxAV *av, uint32_t friend_number, | |||
210 | free(rb_write(cc->arb, f)); | 210 | free(rb_write(cc->arb, f)); |
211 | pthread_mutex_unlock(cc->arb_mutex); | 211 | pthread_mutex_unlock(cc->arb_mutex); |
212 | } | 212 | } |
213 | static void t_toxav_bit_rate_status_cb(ToxAV *av, uint32_t friend_number, | 213 | static void t_toxav_audio_bit_rate_cb(ToxAV *av, uint32_t friend_number, |
214 | uint32_t audio_bit_rate, uint32_t video_bit_rate, | 214 | uint32_t audio_bit_rate, void *user_data) |
215 | void *user_data) | ||
216 | { | 215 | { |
217 | printf("Suggested bit rates: audio: %d video: %d\n", audio_bit_rate, video_bit_rate); | 216 | printf("Suggested bit rate: audio: %d\n", audio_bit_rate); |
217 | } | ||
218 | static void t_toxav_video_bit_rate_cb(ToxAV *av, uint32_t friend_number, | ||
219 | uint32_t video_bit_rate, void *user_data) | ||
220 | { | ||
221 | printf("Suggested bit rate: video: %d\n", video_bit_rate); | ||
218 | } | 222 | } |
219 | static void t_accept_friend_request_cb(Tox *m, const uint8_t *public_key, const uint8_t *data, size_t length, | 223 | static void t_accept_friend_request_cb(Tox *m, const uint8_t *public_key, const uint8_t *data, size_t length, |
220 | void *userdata) | 224 | void *userdata) |
@@ -302,14 +306,16 @@ static void initialize_tox(Tox **bootstrap, ToxAV **AliceAV, CallControl *AliceC | |||
302 | /* Alice */ | 306 | /* Alice */ |
303 | toxav_callback_call(*AliceAV, t_toxav_call_cb, AliceCC); | 307 | toxav_callback_call(*AliceAV, t_toxav_call_cb, AliceCC); |
304 | toxav_callback_call_state(*AliceAV, t_toxav_call_state_cb, AliceCC); | 308 | toxav_callback_call_state(*AliceAV, t_toxav_call_state_cb, AliceCC); |
305 | toxav_callback_bit_rate_status(*AliceAV, t_toxav_bit_rate_status_cb, AliceCC); | 309 | toxav_callback_audio_bit_rate(*AliceAV, t_toxav_audio_bit_rate_cb, AliceCC); |
310 | toxav_callback_video_bit_rate(*AliceAV, t_toxav_video_bit_rate_cb, AliceCC); | ||
306 | toxav_callback_video_receive_frame(*AliceAV, t_toxav_receive_video_frame_cb, AliceCC); | 311 | toxav_callback_video_receive_frame(*AliceAV, t_toxav_receive_video_frame_cb, AliceCC); |
307 | toxav_callback_audio_receive_frame(*AliceAV, t_toxav_receive_audio_frame_cb, AliceCC); | 312 | toxav_callback_audio_receive_frame(*AliceAV, t_toxav_receive_audio_frame_cb, AliceCC); |
308 | 313 | ||
309 | /* Bob */ | 314 | /* Bob */ |
310 | toxav_callback_call(*BobAV, t_toxav_call_cb, BobCC); | 315 | toxav_callback_call(*BobAV, t_toxav_call_cb, BobCC); |
311 | toxav_callback_call_state(*BobAV, t_toxav_call_state_cb, BobCC); | 316 | toxav_callback_call_state(*BobAV, t_toxav_call_state_cb, BobCC); |
312 | toxav_callback_bit_rate_status(*BobAV, t_toxav_bit_rate_status_cb, BobCC); | 317 | toxav_callback_audio_bit_rate(*BobAV, t_toxav_audio_bit_rate_cb, BobCC); |
318 | toxav_callback_video_bit_rate(*BobAV, t_toxav_video_bit_rate_cb, BobCC); | ||
313 | toxav_callback_video_receive_frame(*BobAV, t_toxav_receive_video_frame_cb, BobCC); | 319 | toxav_callback_video_receive_frame(*BobAV, t_toxav_receive_video_frame_cb, BobCC); |
314 | toxav_callback_audio_receive_frame(*BobAV, t_toxav_receive_audio_frame_cb, BobCC); | 320 | toxav_callback_audio_receive_frame(*BobAV, t_toxav_receive_audio_frame_cb, BobCC); |
315 | 321 | ||