Reland of Change VideoCapture_apply_rotation default to false (patchset #1 id:1 of https://codereview.webrtc.org/1807673008/ )

Reason for revert:
Relanding because this doesn't actually break the bot. The issue the caused the test to crash on the bot should be fixed by: https://codereview.webrtc.org/1815733002/

Original issue's description:
> Revert of Change VideoCapture_apply_rotation default to false (patchset #4 id:80001 of https://codereview.webrtc.org/1779883004/ )
>
> Reason for revert:
> Seems to break on linux ubsan
>
> https://build.chromium.org/p/client.webrtc/builders/Linux%20UBSan/builds/247
>
> Original issue's description:
> > Change VideoCapture_apply_rotation default to false
> >
> > BUG=webrtc:5621
> > R=pthatcher@webrtc.org
> >
> > Committed: https://crrev.com/6919457319b0088ed8b68db30f68a03966d67121
> > Cr-Commit-Position: refs/heads/master@{#12052}
>
> TBR=pthatcher@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:5621
>
> Committed: https://crrev.com/223b982785573323aa399de4f2e551cadbaace8d
> Cr-Commit-Position: refs/heads/master@{#12053}

TBR=pthatcher@webrtc.org,perkj@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:5621

Review URL: https://codereview.webrtc.org/1809943006

Cr-Commit-Position: refs/heads/master@{#12054}
This commit is contained in:
deadbeef 2016-03-18 11:38:26 -07:00 committed by Commit bot
parent 223b982785
commit f5629ad44f
7 changed files with 14 additions and 19 deletions

View File

@ -58,7 +58,7 @@ TEST(VideoBroadcasterTest, OnFrame) {
TEST(VideoBroadcasterTest, AppliesRotationIfAnySinkWantsRotationApplied) {
VideoBroadcaster broadcaster;
EXPECT_TRUE(broadcaster.wants().rotation_applied);
EXPECT_FALSE(broadcaster.wants().rotation_applied);
FakeVideoRenderer sink1;
VideoSinkWants wants1;

View File

@ -60,7 +60,7 @@ bool CapturedFrame::GetDataSize(uint32_t* size) const {
/////////////////////////////////////////////////////////////////////
// Implementation of class VideoCapturer
/////////////////////////////////////////////////////////////////////
VideoCapturer::VideoCapturer() : apply_rotation_(true) {
VideoCapturer::VideoCapturer() : apply_rotation_(false) {
thread_checker_.DetachFromThread();
Construct();
}

View File

@ -116,6 +116,10 @@ TEST_F(VideoCapturerTest, TestRotationAppliedBySource) {
cricket::FOURCC_I420));
capturer_->ResetSupportedFormats(formats);
rtc::VideoSinkWants wants;
// |capturer_| should compensate rotation.
wants.rotation_applied = true;
capturer_->AddOrUpdateSink(&renderer_, wants);
// capturer_ should compensate rotation as default.
EXPECT_EQ(cricket::CS_RUNNING,
@ -154,7 +158,7 @@ TEST_F(VideoCapturerTest, TestRotationAppliedBySource) {
EXPECT_EQ(webrtc::kVideoRotation_0, renderer_.rotation());
}
TEST_F(VideoCapturerTest, TestRotationAppliedBySink) {
TEST_F(VideoCapturerTest, TestRotationAppliedBySinkByDefault) {
int kWidth = 800;
int kHeight = 400;
@ -164,10 +168,6 @@ TEST_F(VideoCapturerTest, TestRotationAppliedBySink) {
cricket::FOURCC_I420));
capturer_->ResetSupportedFormats(formats);
rtc::VideoSinkWants wants;
// capturer_ should not compensate rotation.
wants.rotation_applied = false;
capturer_->AddOrUpdateSink(&renderer_, wants);
EXPECT_EQ(cricket::CS_RUNNING,
capturer_->Start(cricket::VideoFormat(

View File

@ -24,7 +24,7 @@ class VideoFrame;
// depending on the subclass of VideoFrameFactory.
class VideoFrameFactory {
public:
VideoFrameFactory() : apply_rotation_(true) {}
VideoFrameFactory() : apply_rotation_(false) {}
virtual ~VideoFrameFactory() {}
// The returned frame aliases the aliased_frame if the input color

View File

@ -20,8 +20,8 @@ namespace rtc {
// should have when it is delivered to a certain sink.
struct VideoSinkWants {
// Tells the source whether the sink wants frames with rotation applied.
// By default, the rotation is applied by the source.
bool rotation_applied = true;
// By default, any rotation must be applied by the sink.
bool rotation_applied = false;
// Tells the source that the sink only wants black frames.
bool black_frames = false;

View File

@ -112,14 +112,9 @@ class TestVideoCaptureCallback : public VideoCaptureDataCallback {
EXPECT_TRUE(height == capability_.height || height == capability_.width);
EXPECT_TRUE(width == capability_.width || width == capability_.height);
#else
if (rotate_frame_ == webrtc::kVideoRotation_90 ||
rotate_frame_ == webrtc::kVideoRotation_270) {
EXPECT_EQ(width, capability_.height);
EXPECT_EQ(height, capability_.width);
} else {
EXPECT_EQ(height, capability_.height);
EXPECT_EQ(width, capability_.width);
}
EXPECT_EQ(height, capability_.height);
EXPECT_EQ(width, capability_.width);
EXPECT_EQ(rotate_frame_, videoFrame.rotation());
#endif
// RenderTimstamp should be the time now.
EXPECT_TRUE(

View File

@ -155,7 +155,7 @@ VideoCaptureImpl::VideoCaptureImpl(const int32_t id)
_captureCallBack(NULL),
_lastProcessFrameCount(TickTime::Now()),
_rotateFrame(kVideoRotation_0),
apply_rotation_(true) {
apply_rotation_(false) {
_requestedCapability.width = kDefaultWidth;
_requestedCapability.height = kDefaultHeight;
_requestedCapability.maxFPS = 30;