Make sure VideoFrameFactory handles rotated frames when scaling.

BUG=4366
R=magjed@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/41079004

Cr-Commit-Position: refs/heads/master@{#8570}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8570 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
perkj@webrtc.org 2015-03-03 10:48:15 +00:00
parent 9e5f941ff1
commit be00e3c198

View File

@ -27,6 +27,7 @@
#include "talk/media/base/videoframefactory.h"
#include <algorithm>
#include "talk/media/base/videocapturer.h"
namespace cricket {
@ -46,6 +47,13 @@ VideoFrame* VideoFrameFactory::CreateAliasedFrame(
return cropped_input_frame.release();
}
// If the frame is rotated, we need to switch the width and height.
if (apply_rotation_ &&
(input_frame->GetRotation() == webrtc::kVideoRotation_90 ||
input_frame->GetRotation() == webrtc::kVideoRotation_270)) {
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() ||