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

Unified Diff: webrtc/test/frame_generator.cc

Issue 2378003002: Delete webrtc::VideoFrame::CreateEmptyFrame. (Closed)
Patch Set: Added size_t/int cast, needed for windows 64-bit builds. Created 4 years, 3 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 | « webrtc/test/fake_decoder.cc ('k') | webrtc/video/overuse_frame_detector_unittest.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 2f911d80249a0aa24f46625fc269337d81f80ba7..b607a4d3bf0f48dafa34c61b8a70e4407c886997 100644
--- a/webrtc/test/frame_generator.cc
+++ b/webrtc/test/frame_generator.cc
@@ -146,6 +146,8 @@ class ScrollingImageFrameGenerator : public FrameGenerator {
scroll_time_(scroll_time_ms),
pause_time_(pause_time_ms),
num_frames_(files.size()),
+ target_width_(static_cast<int>(target_width)),
+ target_height_(static_cast<int>(target_height)),
current_frame_num_(num_frames_ - 1),
current_source_frame_(nullptr),
file_generator_(files, source_width, source_height, 1) {
@@ -156,11 +158,6 @@ class ScrollingImageFrameGenerator : public FrameGenerator {
RTC_DCHECK_GE(scroll_time_ms, 0);
RTC_DCHECK_GE(pause_time_ms, 0);
RTC_DCHECK_GT(scroll_time_ms + pause_time_ms, 0);
- current_frame_.CreateEmptyFrame(static_cast<int>(target_width),
- static_cast<int>(target_height),
- static_cast<int>(target_width),
- static_cast<int>((target_width + 1) / 2),
- static_cast<int>((target_width + 1) / 2));
}
virtual ~ScrollingImageFrameGenerator() {}
@@ -194,12 +191,10 @@ class ScrollingImageFrameGenerator : public FrameGenerator {
}
void CropSourceToScrolledImage(double scroll_factor) {
- const int kTargetWidth = current_frame_.width();
- const int kTargetHeight = current_frame_.height();
- int scroll_margin_x = current_source_frame_->width() - kTargetWidth;
+ int scroll_margin_x = current_source_frame_->width() - target_width_;
int pixels_scrolled_x =
static_cast<int>(scroll_margin_x * scroll_factor + 0.5);
- int scroll_margin_y = current_source_frame_->height() - kTargetHeight;
+ int scroll_margin_y = current_source_frame_->height() - target_height_;
int pixels_scrolled_y =
static_cast<int>(scroll_margin_y * scroll_factor + 0.5);
@@ -217,7 +212,7 @@ class ScrollingImageFrameGenerator : public FrameGenerator {
&current_source_frame_->video_frame_buffer()->DataY()[offset_y],
&current_source_frame_->video_frame_buffer()->DataU()[offset_u],
&current_source_frame_->video_frame_buffer()->DataV()[offset_v],
- kTargetWidth, kTargetHeight,
+ target_width_, target_height_,
current_source_frame_->video_frame_buffer()->StrideY(),
current_source_frame_->video_frame_buffer()->StrideU(),
current_source_frame_->video_frame_buffer()->StrideV(),
@@ -229,6 +224,9 @@ class ScrollingImageFrameGenerator : public FrameGenerator {
const int64_t scroll_time_;
const int64_t pause_time_;
const size_t num_frames_;
+ const int target_width_;
+ const int target_height_;
+
size_t current_frame_num_;
VideoFrame* current_source_frame_;
VideoFrame current_frame_;
« no previous file with comments | « webrtc/test/fake_decoder.cc ('k') | webrtc/video/overuse_frame_detector_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698