Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(99)

Side by Side Diff: webrtc/video/video_encoder_unittest.cc

Issue 1415693002: Remove VideoFrameType aliases for FrameType. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: rebase Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « webrtc/video/video_decoder_unittest.cc ('k') | webrtc/video_frame.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 void VideoEncoderSoftwareFallbackWrapperTest::EncodeFrame() { 103 void VideoEncoderSoftwareFallbackWrapperTest::EncodeFrame() {
104 frame_.CreateEmptyFrame(kWidth, kHeight, kWidth, (kWidth + 1) / 2, 104 frame_.CreateEmptyFrame(kWidth, kHeight, kWidth, (kWidth + 1) / 2,
105 (kWidth + 1) / 2); 105 (kWidth + 1) / 2);
106 memset(frame_.buffer(webrtc::kYPlane), 16, 106 memset(frame_.buffer(webrtc::kYPlane), 16,
107 frame_.allocated_size(webrtc::kYPlane)); 107 frame_.allocated_size(webrtc::kYPlane));
108 memset(frame_.buffer(webrtc::kUPlane), 128, 108 memset(frame_.buffer(webrtc::kUPlane), 128,
109 frame_.allocated_size(webrtc::kUPlane)); 109 frame_.allocated_size(webrtc::kUPlane));
110 memset(frame_.buffer(webrtc::kVPlane), 128, 110 memset(frame_.buffer(webrtc::kVPlane), 128,
111 frame_.allocated_size(webrtc::kVPlane)); 111 frame_.allocated_size(webrtc::kVPlane));
112 112
113 std::vector<FrameType> types(1, kKeyFrame); 113 std::vector<FrameType> types(1, kVideoFrameKey);
114 EXPECT_EQ(WEBRTC_VIDEO_CODEC_OK, 114 EXPECT_EQ(WEBRTC_VIDEO_CODEC_OK,
115 fallback_wrapper_.Encode(frame_, nullptr, &types)); 115 fallback_wrapper_.Encode(frame_, nullptr, &types));
116 } 116 }
117 117
118 void VideoEncoderSoftwareFallbackWrapperTest::UtilizeFallbackEncoder() { 118 void VideoEncoderSoftwareFallbackWrapperTest::UtilizeFallbackEncoder() {
119 fallback_wrapper_.RegisterEncodeCompleteCallback(&callback_); 119 fallback_wrapper_.RegisterEncodeCompleteCallback(&callback_);
120 EXPECT_EQ(&callback_, fake_encoder_.encode_complete_callback_); 120 EXPECT_EQ(&callback_, fake_encoder_.encode_complete_callback_);
121 121
122 // Register with failing fake encoder. Should succeed with VP8 fallback. 122 // Register with failing fake encoder. Should succeed with VP8 fallback.
123 codec_.codecType = kVideoCodecVP8; 123 codec_.codecType = kVideoCodecVP8;
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 TEST_F(VideoEncoderSoftwareFallbackWrapperTest, 198 TEST_F(VideoEncoderSoftwareFallbackWrapperTest,
199 CanRegisterCallbackWhileUsingFallbackEncoder) { 199 CanRegisterCallbackWhileUsingFallbackEncoder) {
200 UtilizeFallbackEncoder(); 200 UtilizeFallbackEncoder();
201 // Registering an encode-complete callback should still work when fallback 201 // Registering an encode-complete callback should still work when fallback
202 // encoder is being used. 202 // encoder is being used.
203 FakeEncodedImageCallback callback2; 203 FakeEncodedImageCallback callback2;
204 fallback_wrapper_.RegisterEncodeCompleteCallback(&callback2); 204 fallback_wrapper_.RegisterEncodeCompleteCallback(&callback2);
205 EXPECT_EQ(&callback2, fake_encoder_.encode_complete_callback_); 205 EXPECT_EQ(&callback2, fake_encoder_.encode_complete_callback_);
206 206
207 // Encoding a frame using the fallback should arrive at the new callback. 207 // Encoding a frame using the fallback should arrive at the new callback.
208 std::vector<FrameType> types(1, kKeyFrame); 208 std::vector<FrameType> types(1, kVideoFrameKey);
209 frame_.set_timestamp(frame_.timestamp() + 1000); 209 frame_.set_timestamp(frame_.timestamp() + 1000);
210 EXPECT_EQ(WEBRTC_VIDEO_CODEC_OK, 210 EXPECT_EQ(WEBRTC_VIDEO_CODEC_OK,
211 fallback_wrapper_.Encode(frame_, nullptr, &types)); 211 fallback_wrapper_.Encode(frame_, nullptr, &types));
212 212
213 EXPECT_EQ(WEBRTC_VIDEO_CODEC_OK, fallback_wrapper_.Release()); 213 EXPECT_EQ(WEBRTC_VIDEO_CODEC_OK, fallback_wrapper_.Release());
214 } 214 }
215 215
216 TEST_F(VideoEncoderSoftwareFallbackWrapperTest, 216 TEST_F(VideoEncoderSoftwareFallbackWrapperTest,
217 SetChannelParametersForwardedDuringFallback) { 217 SetChannelParametersForwardedDuringFallback) {
218 UtilizeFallbackEncoder(); 218 UtilizeFallbackEncoder();
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
253 253
254 TEST_F(VideoEncoderSoftwareFallbackWrapperTest, 254 TEST_F(VideoEncoderSoftwareFallbackWrapperTest,
255 SupportsNativeHandleNotForwardedDuringFallback) { 255 SupportsNativeHandleNotForwardedDuringFallback) {
256 UtilizeFallbackEncoder(); 256 UtilizeFallbackEncoder();
257 fallback_wrapper_.SupportsNativeHandle(); 257 fallback_wrapper_.SupportsNativeHandle();
258 EXPECT_EQ(0, fake_encoder_.supports_native_handle_count_); 258 EXPECT_EQ(0, fake_encoder_.supports_native_handle_count_);
259 EXPECT_EQ(WEBRTC_VIDEO_CODEC_OK, fallback_wrapper_.Release()); 259 EXPECT_EQ(WEBRTC_VIDEO_CODEC_OK, fallback_wrapper_.Release());
260 } 260 }
261 261
262 } // namespace webrtc 262 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/video/video_decoder_unittest.cc ('k') | webrtc/video_frame.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698