Chromium Code Reviews| 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( |
| + 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(); |
|
tommi
2016/05/25 12:14:25
could we change the return value of CreateAliasedF
nisse-webrtc
2016/05/25 12:38:02
Not easily. There's still a VideoFrameFactory subc
|
| } |
| } // namespace cricket |