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

Unified Diff: webrtc/test/frame_generator.cc

Issue 2541863002: Delete VideoFrame default constructor, and IsZeroSize method. (Closed)
Patch Set: Initialize pixel data in VideoBroadcasterTest.OnFrame test. Created 4 years 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 | « webrtc/sdk/objc/Framework/Classes/h264_video_toolbox_encoder.mm ('k') | webrtc/video/video_quality_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/test/frame_generator.cc
diff --git a/webrtc/test/frame_generator.cc b/webrtc/test/frame_generator.cc
index 94abcd124211b4793c98afe57369c23ec03bb448..6ba06cf9725ae7d0a92dcb4378b638868f9f93fc 100644
--- a/webrtc/test/frame_generator.cc
+++ b/webrtc/test/frame_generator.cc
@@ -188,7 +188,7 @@ class ScrollingImageFrameGenerator : public FrameGenerator {
}
CropSourceToScrolledImage(scroll_factor);
- return &current_frame_;
+ return current_frame_ ? &*current_frame_ : nullptr;
}
void UpdateSourceFrame(size_t frame_num) {
@@ -219,14 +219,14 @@ class ScrollingImageFrameGenerator : public FrameGenerator {
rtc::scoped_refptr<VideoFrameBuffer> frame_buffer(
current_source_frame_->video_frame_buffer());
- current_frame_ = webrtc::VideoFrame(
+ current_frame_ = rtc::Optional<webrtc::VideoFrame>(webrtc::VideoFrame(
new rtc::RefCountedObject<webrtc::WrappedI420Buffer>(
target_width_, target_height_,
&frame_buffer->DataY()[offset_y], frame_buffer->StrideY(),
&frame_buffer->DataU()[offset_u], frame_buffer->StrideU(),
&frame_buffer->DataV()[offset_v], frame_buffer->StrideV(),
KeepRefUntilDone(frame_buffer)),
- kVideoRotation_0, 0);
+ kVideoRotation_0, 0));
}
Clock* const clock_;
@@ -239,7 +239,7 @@ class ScrollingImageFrameGenerator : public FrameGenerator {
size_t current_frame_num_;
VideoFrame* current_source_frame_;
- VideoFrame current_frame_;
+ rtc::Optional<VideoFrame> current_frame_;
YuvFileGenerator file_generator_;
};
« no previous file with comments | « webrtc/sdk/objc/Framework/Classes/h264_video_toolbox_encoder.mm ('k') | webrtc/video/video_quality_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698