【WebRTC---源码篇】(二:三)视频消费者VideoSinkInterfacee

作用:这是一个视频消费的基类,所有需要使用视频帧数据的类都需要继承它

cpp 复制代码
namespace rtc {
//VideoSinkInterface是WebRTC中用于接收和处理视频帧数据的接口类。
//通过实现该接口,可以实现自定义的视频数据处理逻辑。
template <typename VideoFrameT>
class VideoSinkInterface {
 public:
  virtual ~VideoSinkInterface() = default;

  virtual void OnFrame(const VideoFrameT& frame) = 0;

  // Should be called by the source when it discards the frame due to rate
  // limiting.
  virtual void OnDiscardedFrame() {}
};

}  // namespace rtc

看看哪些类继承了它

class Renderer : public rtc::VideoSinkInterface<VideoFrame>

class VideoRtcpAndSyncObserver : public test::RtpRtcpObserver,

public rtc::VideoSinkInterface<VideoFrame>

相关推荐
许彰午2 小时前
# 政务远程帮办:WebRTC视频通话+录屏录音+手工拼WAV实录
音视频·webrtc·政务
coder阿龙20 小时前
基于PeerJS实现网页WebRTC屏幕分享
webrtc
RTC老炮2 天前
带宽估计算法(gcc++)架构设计及优化
网络·算法·webrtc
木斯佳2 天前
前端八股文面经大全:字节AIDP前端一面(2026-04-13)·面经深度解析
前端·音视频·webrtc·断点续传
不吃鱼的猫7485 天前
【音视频流媒体进阶:从网络到 WebRTC】第04篇-流媒体场景下的网络优化
网络·音视频·webrtc
不吃鱼的猫7485 天前
【音视频流媒体进阶:从网络到 WebRTC】第02篇-I/O 多路复用:从 select 到 epoll
网络·音视频·webrtc
不吃鱼的猫7485 天前
【音视频流媒体进阶:从网络到 WebRTC】第03篇-Reactor 模式与事件驱动网络框架
网络·音视频·webrtc
不吃鱼的猫7485 天前
【音视频流媒体进阶:从网络到 WebRTC】第01篇-Socket 编程基础:TCP 与 UDP 的选择
网络·音视频·webrtc
不吃鱼的猫7486 天前
Janus WebRTC Gateway -- 从零搭建完整指南
gateway·webrtc
RTC老炮7 天前
WebRTC PCC (Performance-oriented Congestion Control) 算法精解
网络·算法·webrtc