当前位置:网站首页>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);
}
边栏推荐
- Amazon Cloud Technology Build On 2022 - AIot Season 2 IoT Special Experiment Experience
- IDEA中创建web项目实现步骤
- tmux概念和使用
- CAS无锁队列的实现
- Thunderbolt turns off automatic updates
- MySQL索引
- 结构体传参-C语言
- Design and implementation of legal aid platform based on asp.net (with project link)
- MNIST Handwritten Digit Recognition - Building a Perceptron from Zero for Two-Classification
- LeetCode_Dec_3rd_Week
猜你喜欢
随机推荐
Install Minikube Cluster in AWS-EC2
The usefulness of bind() system call
CAS无锁队列的实现
LeetCode_Dec_3rd_Week
Fabric v1.1 环境搭建
Pytest common plug-in
文件编辑器
MySQL批量修改时间字段
C语言无符号整型运算
Rules.make-适合在编辑模式下看
集合---ArrayList的底层
【c语言】整数的二进制表现形式是什么?
LeetCode_22_Apr_4th_Week
淘宝分布式文件系统存储引擎(一)
The second official example analysis of the MOOSE platform - about creating a Kernel and solving the convection-diffusion equation
【C语言】数组名是什么
strlen 转义字符
arm学习-1-开发板
Copy Siege Lion's Annual "Battle" | Review 2020
counting cycle









