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:
@@ -27,6 +27,7 @@
|
|||||||
|
|
||||||
#include "talk/media/base/videoframefactory.h"
|
#include "talk/media/base/videoframefactory.h"
|
||||||
|
|
||||||
|
#include <algorithm>
|
||||||
#include "talk/media/base/videocapturer.h"
|
#include "talk/media/base/videocapturer.h"
|
||||||
|
|
||||||
namespace cricket {
|
namespace cricket {
|
||||||
@@ -46,6 +47,13 @@ VideoFrame* VideoFrameFactory::CreateAliasedFrame(
|
|||||||
return cropped_input_frame.release();
|
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
|
// 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.
|
// still in use by others, or its size is not same as the expected.
|
||||||
if (!output_frame_ || !output_frame_->IsExclusive() ||
|
if (!output_frame_ || !output_frame_->IsExclusive() ||
|
||||||
|
|||||||
Reference in New Issue
Block a user