Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(584)

Unified Diff: webrtc/media/engine/fakewebrtcvideocapturemodule.h

Issue 1985693002: Make the FakeWebRtcVideoCaptureModule class initialize frame data. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/media/engine/fakewebrtcvideocapturemodule.h
diff --git a/webrtc/media/engine/fakewebrtcvideocapturemodule.h b/webrtc/media/engine/fakewebrtcvideocapturemodule.h
index 3202502e6c512b041a863ae367011389d86987dc..2bc715b1e1fc630557508d4838a620e98a85b3d0 100644
--- a/webrtc/media/engine/fakewebrtcvideocapturemodule.h
+++ b/webrtc/media/engine/fakewebrtcvideocapturemodule.h
@@ -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));
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698