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

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

Issue 1406903002: Expose codec implementation names in stats. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: fix rebase Created 5 years 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_encoder.cc ('k') | webrtc/video/vie_channel.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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 return WEBRTC_VIDEO_CODEC_OK; 60 return WEBRTC_VIDEO_CODEC_OK;
61 } 61 }
62 62
63 void OnDroppedFrame() override { ++on_dropped_frame_count_; } 63 void OnDroppedFrame() override { ++on_dropped_frame_count_; }
64 64
65 bool SupportsNativeHandle() const override { 65 bool SupportsNativeHandle() const override {
66 ++supports_native_handle_count_; 66 ++supports_native_handle_count_;
67 return false; 67 return false;
68 } 68 }
69 69
70 const char* ImplementationName() const override {
71 return "fake-encoder";
72 }
73
70 int init_encode_count_ = 0; 74 int init_encode_count_ = 0;
71 int32_t init_encode_return_code_ = WEBRTC_VIDEO_CODEC_OK; 75 int32_t init_encode_return_code_ = WEBRTC_VIDEO_CODEC_OK;
72 int32_t encode_return_code_ = WEBRTC_VIDEO_CODEC_OK; 76 int32_t encode_return_code_ = WEBRTC_VIDEO_CODEC_OK;
73 int encode_count_ = 0; 77 int encode_count_ = 0;
74 EncodedImageCallback* encode_complete_callback_ = nullptr; 78 EncodedImageCallback* encode_complete_callback_ = nullptr;
75 int release_count_ = 0; 79 int release_count_ = 0;
76 int set_channel_parameters_count_ = 0; 80 int set_channel_parameters_count_ = 0;
77 int set_rates_count_ = 0; 81 int set_rates_count_ = 0;
78 int on_dropped_frame_count_ = 0; 82 int on_dropped_frame_count_ = 0;
79 mutable int supports_native_handle_count_ = 0; 83 mutable int supports_native_handle_count_ = 0;
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
252 } 256 }
253 257
254 TEST_F(VideoEncoderSoftwareFallbackWrapperTest, 258 TEST_F(VideoEncoderSoftwareFallbackWrapperTest,
255 SupportsNativeHandleNotForwardedDuringFallback) { 259 SupportsNativeHandleNotForwardedDuringFallback) {
256 UtilizeFallbackEncoder(); 260 UtilizeFallbackEncoder();
257 fallback_wrapper_.SupportsNativeHandle(); 261 fallback_wrapper_.SupportsNativeHandle();
258 EXPECT_EQ(0, fake_encoder_.supports_native_handle_count_); 262 EXPECT_EQ(0, fake_encoder_.supports_native_handle_count_);
259 EXPECT_EQ(WEBRTC_VIDEO_CODEC_OK, fallback_wrapper_.Release()); 263 EXPECT_EQ(WEBRTC_VIDEO_CODEC_OK, fallback_wrapper_.Release());
260 } 264 }
261 265
266 TEST_F(VideoEncoderSoftwareFallbackWrapperTest,
267 ReportsFallbackImplementationName) {
268 UtilizeFallbackEncoder();
269 // Hard coded expected value since libvpx is the software implementation name
270 // for VP8. Change accordingly if the underlying implementation does.
271 EXPECT_STREQ("libvpx (fallback from: fake-encoder)",
272 fallback_wrapper_.ImplementationName());
273 }
274
262 } // namespace webrtc 275 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/video/video_encoder.cc ('k') | webrtc/video/vie_channel.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698