Archive


Category: Uncategorized

  • WebRTC 源码阅读笔记之 TrendlineEstimator

    Trendline 趋势线估算器所实现的接口称为 DelayIncreaseDetectorInterface, 意谓延迟增长检测器. 每一个反馈的 PacketResult 都会用来更新这个趋势线, 这个趋势线的斜率反应了网络延迟的变化, 可以从趋势线的斜率和自适应的阈值可能得出带宽的使用状况: kBwNormal: 带宽使用正常 kBwUnderusing: 带宽使用不足 kBwOverusing: 带宽使用过度 class TrendlineEstimator : public DelayIncreaseDetectorInterface { public: TrendlineEstimator(const WebRtcKeyValueConfig* key_value_config, NetworkStatePredictor* network_state_predictor); ~TrendlineEstimator() override; /* * 用新的采样来更新估算器, 这个 delta 是指包组中第一个包和最后一个包之间的发送时间,或接收时间差 * Update the estimator with a new sample. The deltas should represent deltas * between timestamp groups as defined by […]

  • What is CPaaS

    What is CPaaS CPaaS (Communications Platform as a Service) is a cloud-based, programmable multichannel communications platform that enables developers to customize and build on existing applications and software. CPaaS offers turnkey communications capabilities such as voice calls, SMS messaging, video conferencing, and more that programmers can add to their software without the need for additional […]

  • WebRTC Peer Connection Example – Server

    Overview 启动了一个 peerconnection server,也就是一个简单的 web server 用来在两个 client 之间交换信令,比如 SDP, ICE candidate 启动了两个 peerconnection client, 直接连接进行音频和视频媒体数据的传输 Windows peerconnection example peerconnection server server 比较简单,启动一个 HTTP server, 接受 client 的连接, 将接收的数据在 client 之间进行交换 两个 client 都连接到 server 上, 发送 HTTP 请求 /signin , server 把它作为一个成员(ChannelMember)加到内存中的成员列表中(PeerChannel.members) 这里有一个蹩脚的设计, 由于 server 提供的是 Http 服务,它不会主动发起请求到 client 总是等 client 来要数据(/wait),server 发现有消息缓存在内部队列(ChannelMember.queue_)中,它才把消息以 HTTP […]

  • WebRTC 源码阅读笔记之AcknowledgedBitrateEstimator

    AcknowledgedBitrateEstimatorInterface 确认的比特率估算器接口 class AcknowledgedBitrateEstimatorInterface { public: static std::unique_ptr<AcknowledgedBitrateEstimatorInterface> Create( const WebRtcKeyValueConfig* key_value_config); virtual ~AcknowledgedBitrateEstimatorInterface(); virtual void IncomingPacketFeedbackVector( const std::vector<PacketResult>& packet_feedback_vector) = 0; virtual absl::optional<DataRate> bitrate() const = 0; virtual absl::optional<DataRate> PeekRate() const = 0; virtual void SetAlr(bool in_alr) = 0; virtual void SetAlrEndedTime(Timestamp alr_ended_time) = 0; }; AcknowledgedBitrateEstimator 确认的比特率估算器 class AcknowledgedBitrateEstimator : public AcknowledgedBitrateEstimatorInterface { […]

  • WebRTC 源码阅读笔记之传输层反馈 TransportPacketsFeedback

    TransportPacketsFeedback 发送方将自己保存的包信息结合接收方反馈的接收消息 struct TransportPacketsFeedback { TransportPacketsFeedback(); TransportPacketsFeedback(const TransportPacketsFeedback& other); ~TransportPacketsFeedback(); //反馈的时间 Timestamp feedback_time = Timestamp::PlusInfinity(); //第一个没有响应的包的发送时间 Timestamp first_unacked_send_time = Timestamp::PlusInfinity(); //发送过的数据包大小 DataSize data_in_flight = DataSize::Zero(); //先前发送过的数据包大小 DataSize prior_in_flight = DataSize::Zero(); //反馈的数据包接收结果 std::vector<PacketResult> packet_feedbacks; // Arrival times for messages without send time information. std::vector<Timestamp> sendless_arrival_times; //将上述的反馈结果进行分类 std::vector<PacketResult> ReceivedWithSendInfo() const; std::vector<PacketResult> LostWithSendInfo() const; std::vector<PacketResult> PacketsWithFeedback() const; std::vector<PacketResult> […]

  • bandwidth probe and estimation

    1. 什么时候会触发探测 1)network available at startup 在启动时网络连通时 2)enable periodic alr probing 启用了定时 ALR 探测 3)large drop in estimated bandwidth 发现评估的带宽有大幅衰减 4) probing results indicate channel has greater capacity 探测结果揭示有更大的容量 2. 带宽探测的配置 These parameters configure the initial probes. First we send one or two probes of sizes p1 start_bitratebps and p2 start_bitratebps. Then whenever we get […]

  • 拥塞控制技术笔记二:Transport wide Congestion control

    Abstract 拥塞控制技术的笔记二: TWCC Authors Walter Fan  Category     learning note   Status WIP Updated 2022-2-12 概述 前面回顾拥塞控制的一些理论 拥塞控制技术笔记一: 理论篇, 接下来再回顾 WebRTC 中应用较广的 Google 提出来的 GCC(Google Congestion Control), 它有两个版本: GCC v1: 通过 RTP abs_send_time header 和 RTCP REMB message 扩展,基于丢包和延迟估算带宽占用和是否有拥塞,从而调整媒体流的发送速率,主要的估算和决策在接收方,采用了卡尔曼滤波 GCC v2: 通过 RTP transport wide cc sn header 和 RTCP transport feedback message 扩展,基于丢包和延迟估算带宽占用和是否有拥塞,从而调整媒体流的发送速率,主要的估算和决策在发送方,采用了线性回归和最小二乘法 下面来重点讲讲 GCC v2. 它首先定义了对 […]

  • GDI, OpenGL, WebGL and Direct3D

    The main APIs we used are: drawIimage renderText GDI The Graphics Device Interface (GDI) is a legacy component of Microsoft Windows responsible for representing graphical objects and transmitting them to output devices such as monitors and printers. Windows apps use Windows API to interact with GDI, for such tasks as drawing lines and curves, rendering […]

  • 写作力读书笔记一

    这本书是由高语罕写于1922 年,一百年之后,读起来仍有收获。 这位安徽老乡之前并未听说,网上搜索一下,竟然是这样一位高人。 第二章 如何从无到有写了一篇好文章 一 写什么:选题的七点建议 要部分的,不要全体的 微服务架构之道,不如 “微服务之道:度量驱动开发” 要具体的,不要抽象的 要是自己的经验或观察 或是自己的想象 或者自己对于所研究的学科的见解 要有吸引力 要简单明了 二 确定观点,摒弃五种偏见 point of view 作者的观察,易为师承所囿 作者的观察,易为主观见解与蔽 作者的观察,易为时代思想所囿 作者的观察,易为地方的见解所束缚 作者的观察,易为感情或客气所转移 誉之则升诸九天,毁之则堕诸必渊 爱之欲其生,恶之欲其死 三 取材:确立文章骨干 四 布局和起草 五 修饰与朗读 第三章 好文章的四要素 事实:宜写确切的事实 思想:宜有正确的思想 语言:宜用明白的语言 读者:我的文章是给谁看的 第四章 文章的戒律 戒虚伪, 戒夸大, 戒堆砌典故, 戒模仿, 戒轻薄

  • cmake 简明手册

    1. 概述 用 CMakeLists.txt 来描述构建依赖关系和构建目标, 用 cmake <options> <folder> 来生成 Makefile. 这个 <folder> 就是CMakeLists.txt 文件所在的目录. 可以通过命令行传入宏变量定义,例如 cmake -DABSL_BUILD_TESTING=ON -DABSL_USE_GOOGLETEST_HEAD=ON -DCMAKE_CXX_STANDARD=11 .. cmake –build . –target all 这个项目 https://github.com/abseil/abseil-cpp 中的 cmake 用法可作参考 2. 快速上手 cmake_minimum_required(VERSION 3.0.0) project(webrtc_primer VERSION 0.1.0) include(CTest) enable_testing() add_executable(webrtc_primer main.cpp) set(CPACK_PROJECT_NAME ${PROJECT_NAME}) set(CPACK_PROJECT_VERSION ${PROJECT_VERSION}) include(CPack) main.cpp #include <iostream> int main(int, char**) { std::cout […]