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

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

Issue 2089773002: Add EncodedImageCallback::OnEncodedImage(). (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: . Created 4 years, 4 months 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/payload_router_unittest.cc ('k') | webrtc/video/video_receive_stream.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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 EncodedImageCallback* encode_complete_callback_ = nullptr; 78 EncodedImageCallback* encode_complete_callback_ = nullptr;
79 int release_count_ = 0; 79 int release_count_ = 0;
80 int set_channel_parameters_count_ = 0; 80 int set_channel_parameters_count_ = 0;
81 int set_rates_count_ = 0; 81 int set_rates_count_ = 0;
82 int on_dropped_frame_count_ = 0; 82 int on_dropped_frame_count_ = 0;
83 mutable int supports_native_handle_count_ = 0; 83 mutable int supports_native_handle_count_ = 0;
84 }; 84 };
85 85
86 class FakeEncodedImageCallback : public EncodedImageCallback { 86 class FakeEncodedImageCallback : public EncodedImageCallback {
87 public: 87 public:
88 int32_t Encoded(const EncodedImage& encoded_image, 88 Result OnEncodedImage(
89 const CodecSpecificInfo* codec_specific_info, 89 const EncodedImage& encoded_image,
90 const RTPFragmentationHeader* fragmentation) override { 90 const CodecSpecificInfo* codec_specific_info,
91 return ++callback_count_; 91 const RTPFragmentationHeader* fragmentation) override {
92 ++callback_count_;
93 return Result(Result::OK, callback_count_);
92 } 94 }
93 int callback_count_ = 0; 95 int callback_count_ = 0;
94 }; 96 };
95 97
96 void UtilizeFallbackEncoder(); 98 void UtilizeFallbackEncoder();
97 void FallbackFromEncodeRequest(); 99 void FallbackFromEncodeRequest();
98 void EncodeFrame(); 100 void EncodeFrame();
99 101
100 FakeEncodedImageCallback callback_; 102 FakeEncodedImageCallback callback_;
101 CountingFakeEncoder fake_encoder_; 103 CountingFakeEncoder fake_encoder_;
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
266 TEST_F(VideoEncoderSoftwareFallbackWrapperTest, 268 TEST_F(VideoEncoderSoftwareFallbackWrapperTest,
267 ReportsFallbackImplementationName) { 269 ReportsFallbackImplementationName) {
268 UtilizeFallbackEncoder(); 270 UtilizeFallbackEncoder();
269 // Hard coded expected value since libvpx is the software implementation name 271 // Hard coded expected value since libvpx is the software implementation name
270 // for VP8. Change accordingly if the underlying implementation does. 272 // for VP8. Change accordingly if the underlying implementation does.
271 EXPECT_STREQ("libvpx (fallback from: fake-encoder)", 273 EXPECT_STREQ("libvpx (fallback from: fake-encoder)",
272 fallback_wrapper_.ImplementationName()); 274 fallback_wrapper_.ImplementationName());
273 } 275 }
274 276
275 } // namespace webrtc 277 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/video/payload_router_unittest.cc ('k') | webrtc/video/video_receive_stream.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698