【WebRTC---源码篇】(二:二)视频源VideoSourceBase

作用

这个类继承自VideoSourceInterface<webrtc::VideoFrame>模板类,并且可以处理webrtc::VideoFrame

class VideoSourceBase : public VideoSourceInterface<webrtc::VideoFrame>
重要成员变量
struct SinkPair {
    SinkPair(VideoSinkInterface<webrtc::VideoFrame>* sink, VideoSinkWants wants)
        : sink(sink), wants(wants) {}
    VideoSinkInterface<webrtc::VideoFrame>* sink;//消费者
    VideoSinkWants wants;//视频帧属性来源
  };
std::vector<SinkPair> sinks_;//数据流消费者
重要接口

SinkPair* FindSinkPair(const VideoSinkInterface<webrtc::VideoFrame>* sink);

用于查找当前传入的sink是否已经在vector的数据消费者列中

VideoSourceBase::SinkPair* VideoSourceBase::FindSinkPair(
    const VideoSinkInterface<webrtc::VideoFrame>* sink) {
  auto sink_pair_it = absl::

猜你喜欢

转载自blog.csdn.net/qq_40179458/article/details/132584123