当前位置:网站首页>webrtc代码解读二:音视频播放同步过程
webrtc代码解读二:音视频播放同步过程
2022-08-04 05:32:00 【睏哥RTC】
在rtp包来是获取当前时间戳到本地变量:
Channel::OnRtpPacket -> Channel::UpdatePlayoutTimestamp -> AudioCodingModuleImpl::PlayoutTimestamp -> AcmReceiver::GetPlayoutTimestamp -> NetEqImpl::GetPlayoutTimestamp
从成员变量读取播放时间戳:
VideoReceiveStream::OnFrame -> RtpStreamsSynchronizer::GetStreamSyncOffsetInMs -> AudioReceiveStream::GetPlayoutTimestamp -> ChannelProxy::GetPlayoutTimestamp -> Channel::GetPlayoutTimestamp 获取 playout_timestamp_rtp_
void VideoReceiveStream::OnFrame(const VideoFrame& video_frame) {
int64_t sync_offset_ms;
double estimated_freq_khz;
// TODO(tommi): GetStreamSyncOffsetInMs grabs three locks. One inside the
// function itself, another in GetChannel() and a third in
// GetPlayoutTimestamp. Seems excessive. Anyhow, I'm assuming the function
// succeeds most of the time, which leads to grabbing a fourth lock.
if (rtp_stream_sync_.GetStreamSyncOffsetInMs(video_frame.timestamp(),
video_frame.render_time_ms(),
&sync_offset_ms,
&estimated_freq_khz)) {
// TODO(tommi): OnSyncOffsetUpdated grabs a lock.
stats_proxy_.OnSyncOffsetUpdated(sync_offset_ms, estimated_freq_khz);
}
// config_.renderer must never be null if we're getting this callback.
config_.renderer->OnFrame(video_frame);
// TODO(tommi): OnRenderFrame grabs a lock too.
stats_proxy_.OnRenderedFrame(video_frame);
}
边栏推荐
- Install Minikube Cluster in AWS-EC2
- Vmmem 进程(WSL2)消耗内存巨大
- 集合---ArrayList的底层
- Question 1000: Input two integers a and b, calculate the sum of a+b, this question is multiple sets of test data
- Thunderbolt turns off automatic updates
- Rules.make-适合在编辑模式下看
- arm学习-1-开发板
- IDEA创建Servlet步骤
- Machine Learning - Processing of Text Labels for Classification Problems (Feature Engineering)
- IEEE802.X协议族
猜你喜欢

LeetCode_Nov_3rd_Week

C语言对文件的操作(完整版)

基于asp.net的法律援助平台的设计与实现(附项目链接)

2022在 Go (Golang) 中使用微服务的系统课程

2020-03-27

Cut the hit pro subtitles export of essays

第二章 STA相关概念

The second official example analysis of the MOOSE platform - about creating a Kernel and solving the convection-diffusion equation

arm-2-基础阶段

Chapter One Introduction
随机推荐
Install Minikube Cluster in AWS-EC2
指针的运算【C语言】
[daily office][ssh]cheatsheet
A code example of the PCL method in the domain of DG (Domain Generalization)
Object. RequireNonNull method
arm交叉编译
结构体传参-C语言
Object.requireNonNull 方法说明
Question 1000: Input two integers a and b, calculate the sum of a+b, this question is multiple sets of test data
[开发杂项][VS Code]remote-ssd retry failed
LeetCode_Dec_3rd_Week
bind()系统调用的用处
"A minute" Copy siege lion log 】 【 run MindSpore LeNet model
彻底删除MySQL教程
Deep Learning Theory - Overfitting, Underfitting, Regularization, Optimizers
基于asp.net的法律援助平台的设计与实现(附项目链接)
IEEE802.X protocol suite
枚举和联合(自定义类型)-C语言
动态内存管理-C语言
No matching function for call to 'RCTBridgeModuleNameForClass'