Index: webrtc/media/engine/webrtcvideoengine2_unittest.cc |
diff --git a/webrtc/media/engine/webrtcvideoengine2_unittest.cc b/webrtc/media/engine/webrtcvideoengine2_unittest.cc |
index b9c6604d5208b8fdb04e6d6fc2e8c2e8daa6490c..c81fd88d8d9026648682378a94effd37b1b9be51 100644 |
--- a/webrtc/media/engine/webrtcvideoengine2_unittest.cc |
+++ b/webrtc/media/engine/webrtcvideoengine2_unittest.cc |
@@ -66,17 +66,13 @@ |
cricket::kRtcpFbParamCcm, cricket::kRtcpFbCcmParamFir))); |
} |
-static void CreateBlackFrame(webrtc::VideoFrame* video_frame, |
- int width, |
- int height) { |
- video_frame->CreateEmptyFrame( |
- width, height, width, (width + 1) / 2, (width + 1) / 2); |
- memset(video_frame->video_frame_buffer()->MutableDataY(), 16, |
- video_frame->allocated_size(webrtc::kYPlane)); |
- memset(video_frame->video_frame_buffer()->MutableDataU(), 128, |
- video_frame->allocated_size(webrtc::kUPlane)); |
- memset(video_frame->video_frame_buffer()->MutableDataV(), 128, |
- video_frame->allocated_size(webrtc::kVPlane)); |
+static rtc::scoped_refptr<webrtc::VideoFrameBuffer> CreateBlackFrameBuffer( |
+ int width, |
+ int height) { |
+ rtc::scoped_refptr<webrtc::I420Buffer> buffer = |
+ webrtc::I420Buffer::Create(width, height); |
+ buffer->SetToBlack(); |
+ return buffer; |
} |
void VerifySendStreamHasRtxTypes(const webrtc::VideoSendStream::Config& config, |
@@ -2204,9 +2200,9 @@ |
cricket::FakeVideoRenderer renderer; |
EXPECT_TRUE(channel_->SetSink(last_ssrc_, &renderer)); |
- webrtc::VideoFrame video_frame; |
- CreateBlackFrame(&video_frame, 4, 4); |
- video_frame.set_timestamp(kInitialTimestamp); |
+ webrtc::VideoFrame video_frame(CreateBlackFrameBuffer(4, 4), |
+ kInitialTimestamp, 0, |
+ webrtc::kVideoRotation_0); |
// Initial NTP time is not available on the first frame, but should still be |
// able to be estimated. |
stream->InjectFrame(video_frame); |