OLD | NEW |
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 Loading... |
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 Result OnEncodedImage( | 88 int32_t Encoded(const EncodedImage& encoded_image, |
89 const EncodedImage& encoded_image, | 89 const CodecSpecificInfo* codec_specific_info, |
90 const CodecSpecificInfo* codec_specific_info, | 90 const RTPFragmentationHeader* fragmentation) override { |
91 const RTPFragmentationHeader* fragmentation) override { | 91 return ++callback_count_; |
92 ++callback_count_; | |
93 return Result(Result::OK, callback_count_); | |
94 } | 92 } |
95 int callback_count_ = 0; | 93 int callback_count_ = 0; |
96 }; | 94 }; |
97 | 95 |
98 void UtilizeFallbackEncoder(); | 96 void UtilizeFallbackEncoder(); |
99 void FallbackFromEncodeRequest(); | 97 void FallbackFromEncodeRequest(); |
100 void EncodeFrame(); | 98 void EncodeFrame(); |
101 | 99 |
102 FakeEncodedImageCallback callback_; | 100 FakeEncodedImageCallback callback_; |
103 CountingFakeEncoder fake_encoder_; | 101 CountingFakeEncoder fake_encoder_; |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
268 TEST_F(VideoEncoderSoftwareFallbackWrapperTest, | 266 TEST_F(VideoEncoderSoftwareFallbackWrapperTest, |
269 ReportsFallbackImplementationName) { | 267 ReportsFallbackImplementationName) { |
270 UtilizeFallbackEncoder(); | 268 UtilizeFallbackEncoder(); |
271 // Hard coded expected value since libvpx is the software implementation name | 269 // Hard coded expected value since libvpx is the software implementation name |
272 // for VP8. Change accordingly if the underlying implementation does. | 270 // for VP8. Change accordingly if the underlying implementation does. |
273 EXPECT_STREQ("libvpx (fallback from: fake-encoder)", | 271 EXPECT_STREQ("libvpx (fallback from: fake-encoder)", |
274 fallback_wrapper_.ImplementationName()); | 272 fallback_wrapper_.ImplementationName()); |
275 } | 273 } |
276 | 274 |
277 } // namespace webrtc | 275 } // namespace webrtc |
OLD | NEW |