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

Unified Diff: webrtc/media/base/videoframefactory.cc

Issue 2009193002: Delete IsMutable and IsExclusive methods. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Delete redundant RefCountedObject wrapping. 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 | « webrtc/media/base/videoframefactory.h ('k') | webrtc/media/engine/webrtcvideoframe.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/media/base/videoframefactory.cc
diff --git a/webrtc/media/base/videoframefactory.cc b/webrtc/media/base/videoframefactory.cc
index 23925bda56abefb096d71250f0531878478fc532..0a7dfc22d494a674c70899e425dc7ce1d55acc43 100644
--- a/webrtc/media/base/videoframefactory.cc
+++ b/webrtc/media/base/videoframefactory.cc
@@ -39,23 +39,13 @@ VideoFrame* VideoFrameFactory::CreateAliasedFrame(
std::swap(output_width, output_height);
}
- // Create and stretch the output frame if it has not been created yet, is
- // still in use by others, or its size is not same as the expected.
- if (!output_frame_ || !output_frame_->IsExclusive() ||
- output_frame_->width() != output_width ||
- output_frame_->height() != output_height) {
- output_frame_.reset(
- cropped_input_frame->Stretch(output_width, output_height, true, true));
- if (!output_frame_) {
- LOG(LS_WARNING) << "Failed to stretch frame to " << output_width << "x"
- << output_height;
- return NULL;
- }
- } else {
- cropped_input_frame->StretchToFrame(output_frame_.get(), true, true);
- output_frame_->SetTimeStamp(cropped_input_frame->GetTimeStamp());
- }
- return output_frame_->Copy();
+ std::unique_ptr<VideoFrame> output_frame(new WebRtcVideoFrame(
+ pool_.CreateBuffer(output_width, output_height),
+ cropped_input_frame->rotation(),
+ cropped_input_frame->timestamp_us()));
+
+ cropped_input_frame->StretchToFrame(output_frame.get(), true, true);
+ return output_frame.release();
}
} // namespace cricket
« no previous file with comments | « webrtc/media/base/videoframefactory.h ('k') | webrtc/media/engine/webrtcvideoframe.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698