| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "remoting/codec/video_encoder_vpx.h" | 5 #include "remoting/codec/video_encoder_vpx.h" |
| 6 | 6 |
| 7 #include <limits> | 7 #include <limits> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 | 155 |
| 156 scoped_ptr<VideoEncoderVpx> encoder(VideoEncoderVpx::CreateForVP8()); | 156 scoped_ptr<VideoEncoderVpx> encoder(VideoEncoderVpx::CreateForVP8()); |
| 157 | 157 |
| 158 scoped_ptr<webrtc::DesktopFrame> frame(CreateTestFrame(frame_size)); | 158 scoped_ptr<webrtc::DesktopFrame> frame(CreateTestFrame(frame_size)); |
| 159 frame->set_dpi(webrtc::DesktopVector(96, 97)); | 159 frame->set_dpi(webrtc::DesktopVector(96, 97)); |
| 160 scoped_ptr<VideoPacket> packet = encoder->Encode(*frame); | 160 scoped_ptr<VideoPacket> packet = encoder->Encode(*frame); |
| 161 EXPECT_EQ(packet->format().x_dpi(), 96); | 161 EXPECT_EQ(packet->format().x_dpi(), 96); |
| 162 EXPECT_EQ(packet->format().y_dpi(), 97); | 162 EXPECT_EQ(packet->format().y_dpi(), 97); |
| 163 } | 163 } |
| 164 | 164 |
| 165 TEST(VideoEncoderVerbatimTest, Vp8EncodeUnchangedFrame) { | 165 TEST(VideoEncoderVpxTest, Vp8EncodeUnchangedFrame) { |
| 166 scoped_ptr<VideoEncoderVpx> encoder(VideoEncoderVpx::CreateForVP8()); | 166 scoped_ptr<VideoEncoderVpx> encoder(VideoEncoderVpx::CreateForVP8()); |
| 167 TestVideoEncoderEmptyFrames(encoder.get(), 0); | 167 TestVideoEncoderEmptyFrames(encoder.get(), 0); |
| 168 } | 168 } |
| 169 | 169 |
| 170 TEST(VideoEncoderVerbatimTest, Vp9LosslessUnchangedFrame) { | 170 TEST(VideoEncoderVpxTest, Vp9LosslessUnchangedFrame) { |
| 171 scoped_ptr<VideoEncoderVpx> encoder(VideoEncoderVpx::CreateForVP9()); | 171 scoped_ptr<VideoEncoderVpx> encoder(VideoEncoderVpx::CreateForVP9()); |
| 172 encoder->SetLosslessEncode(true); | 172 encoder->SetLosslessEncode(true); |
| 173 TestVideoEncoderEmptyFrames(encoder.get(), 0); | 173 TestVideoEncoderEmptyFrames(encoder.get(), 0); |
| 174 } | 174 } |
| 175 | 175 |
| 176 TEST(VideoEncoderVerbatimTest, Vp9LossyUnchangedFrame) { | 176 TEST(VideoEncoderVpxTest, Vp9LossyUnchangedFrame) { |
| 177 scoped_ptr<VideoEncoderVpx> encoder(VideoEncoderVpx::CreateForVP9()); | 177 scoped_ptr<VideoEncoderVpx> encoder(VideoEncoderVpx::CreateForVP9()); |
| 178 encoder->SetLosslessEncode(false); | 178 encoder->SetLosslessEncode(false); |
| 179 TestVideoEncoderEmptyFrames(encoder.get(), 2); | 179 TestVideoEncoderEmptyFrames(encoder.get(), 11); |
| 180 } | 180 } |
| 181 | 181 |
| 182 } // namespace remoting | 182 } // namespace remoting |
| OLD | NEW |