两个关键点
Main_wnd中的OnFrame(...)获取视频帧
void MainWnd::VideoRenderer::OnFrame(const webrtc::VideoFrame& video_frame) {
{
AutoLock<VideoRenderer> lock(this);
rtc::scoped_refptr<webrtc::I420BufferInterface> buffer(
video_frame.video_frame_buffer()->ToI420());
if (video_frame.rotation() != webrtc::kVideoRotation_0) {
buffer = webrtc::I420Buffer::Rotate(*buffer, video_frame.rotation());
}
SetSize(buffer->width(), buffer->height());
//YUV格式转RGB
RTC_DCHECK(image_.get() != NULL);
libyuv::I420ToARGB(buffer->DataY(), buffer->StrideY(), buffer->DataU(),
buffer->StrideU(), buffer->DataV(), buffer-&