effect
This class inherits from the VideoSourceInterface<webrtc::VideoFrame> template class and can handle webrtc::VideoFrame
class VideoSourceBase : public VideoSourceInterface<webrtc::VideoFrame>
important member variables
struct SinkPair {
SinkPair(VideoSinkInterface<webrtc::VideoFrame>* sink, VideoSinkWants wants)
: sink(sink), wants(wants) {}
VideoSinkInterface<webrtc::VideoFrame>* sink;//消费者
VideoSinkWants wants;//视频帧属性来源
};
std::vector<SinkPair> sinks_;//数据流消费者
important interface
SinkPair* FindSinkPair(const VideoSinkInterface<webrtc::VideoFrame>* sink);
Used to find out whether the current incoming sink is already in the data consumer column of the vector
VideoSourceBase::SinkPair* VideoSourceBase::FindSinkPair(
const VideoSinkInterface<webrtc::VideoFrame>* sink) {
auto sink_pair_it = absl::