The invention discloses a video flow control method to adjust the sending buffer data, video data is first sent into the send buffer, sending buffer in the video data in the data link is idle, removed from sending; secondly, each video data is fed into the sending buffer, statistical data and send buffer the growth rate of data; and then periodically according to the data rate, determine the need for flow control; finally, to flow control, according to the format of the video data, according to the amount of data to delete delete rules, reduce the amount of data. The invention can calculate the sending bandwidth more accurately, and send more data in the same time, so as to effectively improve the utilization rate of the bandwidth, reduce the accumulation amount in the sending process of the video data, and reduce the data transmission delay.
【技术实现步骤摘要】
一种调节发送缓冲数据量的视频流量控制方法
本专利技术涉及视频流量控制方法领域,尤其是一种调节发送缓冲数据量的视频流量控制方法。
技术介绍
计算机发送视频数据时,会出现数据量超出链路带宽能力的情况。为了使数据量与带宽匹配,发送端需要适当减小输出的数据量,即流量控制。流量控制首先需要知道数据链路的带宽。以往的带宽估计方法是每次发送数据时,计算从开始发送到完成发送的时间间隔,作为每次的发送用时。单位时间内,把每次发送的数据字节数和每次的发送用时累加,然后二者相除,得到当时的带宽。但是这种带宽估计方法在多线程情况下,有可能得到比实际带宽偏小的结果。原因在于计算发送用时的时候,由于线程切换,计入了多余的时间。多线程情况下,只有操作系统给线程分配了时间片,函数才会被调用。发送开始函数与发送完成函数的调用发生在不同线程之中。如果发生下面这种情况:数据已发送完成,但执行发送完成函数的线程由于没分配到时间片而在休眠,就会在发送用时当中计入线程的休眠时间。
技术实现思路
本专利技术的目的在于克服以上存在的技术问题,提供一种调节发送缓冲数据量的视频流量控制方法。为实现上述目的,本专利技术的 ...
【技术保护点】
一种调节发送缓冲数据量的视频流量控制方法,其特征在于,包括以下步骤:S1:将准备要发送的视频数据被送入发送缓冲区,发送缓冲区的视频数据在数据链路空闲时,被取出发送;S2::每次视频数据被送入到发送缓冲区时,统计发送缓冲区的数据量和数据增长速度;S3:然后再定期根据数据增长速度,判断是否需要进行流量控制;S4:需要流量控制时,根据视频数据格式,按删除规则删除适量数据,从而减少数据量。
【技术特征摘要】
1.一种调节发送缓冲数据量的视频流量控制方法,其特征在于,包括以下步骤:S1:将准备要发送的视频数据被送入发送缓冲区,发送缓冲区的视频数据在数据链路空闲时,被取出发送;S2::每次视频数据被送入到发送缓冲区时,统计发送缓冲区的数据量和数据增长速度;S3:然后再定期根据数据增长速度,判断是否需要进行流量控制;S4:需要流量控制时,根据视频数据格式,按删除规则删除适量数据,从而减少数据量。2.根据权利要求1所述的调节发送缓冲数据量的视频流量控制方法,其特征在于:所述步骤S1中的视频数据按数据包分包被送入发送缓冲区,一个或多个数据包属于一个视频帧;多个视频帧属于一个视频序列,视频序列和视频帧分别按顺序编号,发送缓冲区中的第一级为视频序列,按编号顺序排列;第二级为每个视频序列的视频帧,按帧编号顺序排列;第三级为每个视...
【专利技术属性】
技术研发人员:张洋,
申请(专利权)人:北京威速科技有限公司,
类型:发明
国别省市:北京,11
还没有人留言评论。发表了对其他浏览者有用的留言会获得科技券。