Make the FakeWebRtcVideoCaptureModule class initialize frame data.

Needed to avoid DrMemory warnings, if the frame is passed to libyuv
AVX assembly functions.

BUG=libyuv:377

Review-Url: https://codereview.webrtc.org/1985693002
Cr-Commit-Position: refs/heads/master@{#12765}
This commit is contained in:
nisse 2016-05-16 23:51:04 -07:00 committed by Commit bot
parent 9359274071
commit 744494f451

View File

@ -87,11 +87,16 @@ class FakeWebRtcVideoCaptureModule : public webrtc::VideoCaptureModule {
void SendFrame(int w, int h) {
if (!running_) return;
webrtc::VideoFrame sample;
// Setting stride based on width.
sample.CreateEmptyFrame(w, h, w, (w + 1) / 2, (w + 1) / 2);
rtc::scoped_refptr<webrtc::I420Buffer> buffer =
new rtc::RefCountedObject<webrtc::I420Buffer>(w, h);
// Initialize memory to satisfy DrMemory tests. See
// https://bugs.chromium.org/p/libyuv/issues/detail?id=377
buffer->InitializeData();
if (callback_) {
callback_->OnIncomingCapturedFrame(id_, sample);
callback_->OnIncomingCapturedFrame(
id_,
webrtc::VideoFrame(buffer, 0, 0, webrtc::kVideoRotation_0));
}
}