剑痴乎

  • Home
  • Category
    • A/V
    • WebRTC
    • Beauty of Programming
    • Linux
    • Windows
    • Moments of Life
    • Campus Life
  • Reference
    • API Reference
    • Utilities
    • AV Test
    • Doc
  • Message Board
  • About
JCHub
Code as My Sword, Lost in Obsession
WebRTC

WebRTC研究:应用受限区域探测器-AlrDetector

在WebRTC GCC(Google Congestion Control)中,有一个叫做AlrDetector(应用受限区域探测器,Application limited region detector)的模块。该模块利用某段时间值,以及这段时间发送的字节数判断当前输出网络流量是否受限。这些限制主要跟应用程序本身输出网络流量的能力有关,例如编码器性能,不能编码出设置的目标码率。下面举个简单例子说明下。 假设我们经过带宽预测后,获取到一个目标码流target_bitrate_bps,此时我们程序需要按照该码率大小进行数据发送,但是一切都不是那么完美,例如编码器。编码器由于各种问题,编码出的数据码率低于target_bitrate_bps,使得数据发送码率低于要求,带宽利用率不足,发送码率占最大预算码率值比例低于某个值的话Alr(Application limited region)就会被触发了,恢复到某个值以上,Alr会停止。 下面说下AlrDetector的工作流程。 1)首先是在构造函数初始化相关参数配置,相关参数如下: [crayon-69bea0eba5dbd128687315/] IntervalBudget::can_build_up_underuse_初始化为true。IntervalBudget根据输入的评估码率,计算当前还能发送多少数据。 2)设置带宽预测得到的码率: [crayon-69bea0eba5dc4686798372/] 3)发送数据时调用: [crayon-69bea0eba5dc6508829816/] 通过IntervalBudget::budget_ratio与start_budget_level_ratio以及stop_budget_level_ratio对比,设置AlrDetector的状态。 [crayon-69bea0eba5dc7658360651/] IntervalBudget::budget_ratio表示剩余要发送的数据占最大预算发送数据max_bytes_in_budget_的比例,定义如下: [crayon-69bea0eba5dc9805791072/] max_bytes_in_budget_按500ms时间窗口计算得到: [crayon-69bea0eba5dca811199834/] 可知如果IntervalBudget::budget_ratio大于start_budget_level_ratio,即剩余数据还有很多,发送码率低了,带宽没充分利用,Alr触发了,小于stop_budget_level_ratio时,alr_started_time_ms_重置,Alr停止。 4)通过获取AlrDetector::alr_started_time_ms_判断当前Alr是否触发,调用函数如下: [crayon-69bea0eba5dcb657510594/]

2019年11月4日 8comments 5511hotness 4likes Jeff Read all
Copyright Statement

Unauthorized reproduction or plagiarism in any form is strictly prohibited. For reprint requests, please contact via email.

Recent Comments
Mirzoemele Published at 2 months ago(01 01202613104 06 06pm26) Double blind randomised controlled trial of two to...
PedarPhago Published at 7 months ago(08 08202583109 12 12pm25) Association between selective serotonin reuptake i...
EsielTooft Published at 8 months ago(07 07202573112 29 29am25) International scientific apply guidelines for the ...
dongxuh Published at 8 months ago(07 07202573103 27 27pm25) 真心不错的博客,有机会能一起分享
南南 Published at 8 months ago(07 07202573103 15 15pm25) 写的超棒!

COPYRIGHT © 2026 jianchihu.net. ALL RIGHTS RESERVED.

Theme Kratos Made By Seaton Jiang