Remove VideoRotationMode to VideoRotation.

With this change, there is only one copy of rotation enum.

BUG=4145
R=mflodman@webrtc.org

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

Cr-Commit-Position: refs/heads/master@{#8654}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8654 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
guoweis@webrtc.org
2015-03-09 17:07:31 +00:00
parent 600587d5ac
commit 59140d6a5a
19 changed files with 92 additions and 151 deletions

View File

@ -23,9 +23,8 @@ TEST_F(VideoProcessingModuleTest, BrightnessDetection)
while (fread(video_buffer.get(), 1, frame_length_, source_file_) ==
frame_length_)
{
EXPECT_EQ(0, ConvertToI420(kI420, video_buffer.get(), 0, 0,
width_, height_,
0, kRotateNone, &video_frame_));
EXPECT_EQ(0, ConvertToI420(kI420, video_buffer.get(), 0, 0, width_,
height_, 0, kVideoRotation_0, &video_frame_));
frameNum++;
VideoProcessingModule::FrameStats stats;
ASSERT_EQ(0, vpm_->GetFrameStats(&stats, video_frame_));
@ -51,9 +50,8 @@ TEST_F(VideoProcessingModuleTest, BrightnessDetection)
frame_length_ &&
frameNum < 300)
{
EXPECT_EQ(0, ConvertToI420(kI420, video_buffer.get(), 0, 0,
width_, height_,
0, kRotateNone, &video_frame_));
EXPECT_EQ(0, ConvertToI420(kI420, video_buffer.get(), 0, 0, width_,
height_, 0, kVideoRotation_0, &video_frame_));
frameNum++;
uint8_t* frame = video_frame_.buffer(kYPlane);
@ -91,9 +89,8 @@ TEST_F(VideoProcessingModuleTest, BrightnessDetection)
while (fread(video_buffer.get(), 1, frame_length_, source_file_) ==
frame_length_ && frameNum < 300)
{
EXPECT_EQ(0, ConvertToI420(kI420, video_buffer.get(), 0, 0,
width_, height_,
0, kRotateNone, &video_frame_));
EXPECT_EQ(0, ConvertToI420(kI420, video_buffer.get(), 0, 0, width_,
height_, 0, kVideoRotation_0, &video_frame_));
frameNum++;
uint8_t* y_plane = video_frame_.buffer(kYPlane);

View File

@ -44,9 +44,8 @@ TEST_F(VideoProcessingModuleTest, ColorEnhancement)
frame_length_)
{
// Using ConvertToI420 to add stride to the image.
EXPECT_EQ(0, ConvertToI420(kI420, video_buffer.get(), 0, 0,
width_, height_,
0, kRotateNone, &video_frame_));
EXPECT_EQ(0, ConvertToI420(kI420, video_buffer.get(), 0, 0, width_,
height_, 0, kVideoRotation_0, &video_frame_));
frameNum++;
t0 = TickTime::Now();
ASSERT_EQ(0, VideoProcessingModule::ColorEnhancement(&video_frame_));
@ -91,14 +90,13 @@ TEST_F(VideoProcessingModuleTest, ColorEnhancement)
frame_length_)
{
// Using ConvertToI420 to add stride to the image.
EXPECT_EQ(0, ConvertToI420(kI420, video_buffer.get(), 0, 0,
width_, height_,
0, kRotateNone, &video_frame_));
EXPECT_EQ(0, ConvertToI420(kI420, video_buffer.get(), 0, 0, width_,
height_, 0, kVideoRotation_0, &video_frame_));
ASSERT_EQ(frame_length_, fread(ref_buffer.get(), 1, frame_length_,
refFile));
EXPECT_EQ(0, ConvertToI420(kI420, ref_buffer.get(), 0, 0,
width_, height_,
0, kRotateNone, &refVideoFrame));
EXPECT_EQ(
0, ConvertToI420(kI420, ref_buffer.get(), 0, 0, width_, height_, 0,
kVideoRotation_0, &refVideoFrame));
EXPECT_EQ(0, memcmp(video_frame_.buffer(kYPlane),
refVideoFrame.buffer(kYPlane),
size_y_));
@ -123,9 +121,8 @@ TEST_F(VideoProcessingModuleTest, ColorEnhancement)
I420VideoFrame testVideoFrame;
testVideoFrame.CreateEmptyFrame(width_, height_,
width_, half_width_, half_width_);
EXPECT_EQ(0, ConvertToI420(kI420, testFrame.get(), 0, 0,
width_, height_, 0, kRotateNone,
&testVideoFrame));
EXPECT_EQ(0, ConvertToI420(kI420, testFrame.get(), 0, 0, width_, height_, 0,
kVideoRotation_0, &testVideoFrame));
ASSERT_EQ(0, VideoProcessingModule::ColorEnhancement(&testVideoFrame));

View File

@ -27,9 +27,8 @@ TEST_F(VideoProcessingModuleTest, ContentAnalysis) {
while (fread(video_buffer.get(), 1, frame_length_, source_file_)
== frame_length_) {
// Using ConvertToI420 to add stride to the image.
EXPECT_EQ(0, ConvertToI420(kI420, video_buffer.get(), 0, 0,
width_, height_,
0, kRotateNone, &video_frame_));
EXPECT_EQ(0, ConvertToI420(kI420, video_buffer.get(), 0, 0, width_, height_,
0, kVideoRotation_0, &video_frame_));
_cM_c = ca__c.ComputeContentMetrics(video_frame_);
_cM_SSE = ca__sse.ComputeContentMetrics(video_frame_);

View File

@ -56,9 +56,9 @@ TEST_F(VideoProcessingModuleTest, Deflickering)
frame_length_)
{
frameNum++;
EXPECT_EQ(0, ConvertToI420(kI420, video_buffer.get(), 0, 0,
width_, height_,
0, kRotateNone, &video_frame_));
EXPECT_EQ(
0, ConvertToI420(kI420, video_buffer.get(), 0, 0, width_,
height_, 0, kVideoRotation_0, &video_frame_));
video_frame_.set_timestamp(timeStamp);
t0 = TickTime::Now();

View File

@ -106,9 +106,8 @@ TEST_F(VideoProcessingModuleTest, HandleBadStats) {
rtc::scoped_ptr<uint8_t[]> video_buffer(new uint8_t[frame_length_]);
ASSERT_EQ(frame_length_, fread(video_buffer.get(), 1, frame_length_,
source_file_));
EXPECT_EQ(0, ConvertToI420(kI420, video_buffer.get(), 0, 0,
width_, height_,
0, kRotateNone, &video_frame_));
EXPECT_EQ(0, ConvertToI420(kI420, video_buffer.get(), 0, 0, width_, height_,
0, kVideoRotation_0, &video_frame_));
EXPECT_EQ(-1, vpm_->Deflickering(&video_frame_, &stats));
@ -142,9 +141,8 @@ TEST_F(VideoProcessingModuleTest, IdenticalResultsAfterReset) {
rtc::scoped_ptr<uint8_t[]> video_buffer(new uint8_t[frame_length_]);
ASSERT_EQ(frame_length_, fread(video_buffer.get(), 1, frame_length_,
source_file_));
EXPECT_EQ(0, ConvertToI420(kI420, video_buffer.get(), 0, 0,
width_, height_,
0, kRotateNone, &video_frame_));
EXPECT_EQ(0, ConvertToI420(kI420, video_buffer.get(), 0, 0, width_, height_,
0, kVideoRotation_0, &video_frame_));
ASSERT_EQ(0, vpm_->GetFrameStats(&stats, video_frame_));
ASSERT_EQ(0, video_frame2.CopyFrame(video_frame_));
ASSERT_EQ(0, vpm_->Deflickering(&video_frame_, &stats));
@ -156,9 +154,8 @@ TEST_F(VideoProcessingModuleTest, IdenticalResultsAfterReset) {
ASSERT_EQ(frame_length_, fread(video_buffer.get(), 1, frame_length_,
source_file_));
EXPECT_EQ(0, ConvertToI420(kI420, video_buffer.get(), 0, 0,
width_, height_,
0, kRotateNone, &video_frame_));
EXPECT_EQ(0, ConvertToI420(kI420, video_buffer.get(), 0, 0, width_, height_,
0, kVideoRotation_0, &video_frame_));
ASSERT_EQ(0, vpm_->GetFrameStats(&stats, video_frame_));
video_frame2.CopyFrame(video_frame_);
ASSERT_EQ(0, vpm_->BrightnessDetection(video_frame_, stats));
@ -172,9 +169,8 @@ TEST_F(VideoProcessingModuleTest, FrameStats) {
rtc::scoped_ptr<uint8_t[]> video_buffer(new uint8_t[frame_length_]);
ASSERT_EQ(frame_length_, fread(video_buffer.get(), 1, frame_length_,
source_file_));
EXPECT_EQ(0, ConvertToI420(kI420, video_buffer.get(), 0, 0,
width_, height_,
0, kRotateNone, &video_frame_));
EXPECT_EQ(0, ConvertToI420(kI420, video_buffer.get(), 0, 0, width_, height_,
0, kVideoRotation_0, &video_frame_));
EXPECT_FALSE(vpm_->ValidFrameStats(stats));
EXPECT_EQ(0, vpm_->GetFrameStats(&stats, video_frame_));
@ -233,9 +229,8 @@ TEST_F(VideoProcessingModuleTest, Resampler) {
ASSERT_EQ(frame_length_, fread(video_buffer.get(), 1, frame_length_,
source_file_));
// Using ConvertToI420 to add stride to the image.
EXPECT_EQ(0, ConvertToI420(kI420, video_buffer.get(), 0, 0,
width_, height_,
0, kRotateNone, &video_frame_));
EXPECT_EQ(0, ConvertToI420(kI420, video_buffer.get(), 0, 0, width_, height_,
0, kVideoRotation_0, &video_frame_));
// Cropped source frame that will contain the expected visible region.
I420VideoFrame cropped_source_frame;
cropped_source_frame.CopyFrame(video_frame_);
@ -337,7 +332,7 @@ void CropFrame(const uint8_t* source_data,
(cropped_width + 1) / 2);
EXPECT_EQ(0,
ConvertToI420(kI420, source_data, offset_x, offset_y, source_width,
source_height, 0, kRotateNone, cropped_frame));
source_height, 0, kVideoRotation_0, cropped_frame));
}
void TestSize(const I420VideoFrame& source_frame,