Index: webrtc/media/base/videoframefactory.cc |
diff --git a/webrtc/media/base/videoframefactory.cc b/webrtc/media/base/videoframefactory.cc |
index 23925bda56abefb096d71250f0531878478fc532..0e8bc7a86b66c07c51db369579c9f81c6e43f345 100644 |
--- a/webrtc/media/base/videoframefactory.cc |
+++ b/webrtc/media/base/videoframefactory.cc |
@@ -39,23 +39,14 @@ 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( |
magjed_webrtc
2016/05/25 13:17:01
Why CreateWithBuffer? Why not just:
new WebRtcVide
nisse-webrtc
2016/05/25 13:39:47
My understanding is that this code is supposed to
magjed_webrtc
2016/05/25 14:56:07
It's not supposed to know anything about the type
nisse-webrtc
2016/05/26 07:44:42
I thought chrome might be picky. But it doesn't ma
|
+ cropped_input_frame->CreateWithBuffer( |
+ 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 |