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 |
11 #include "webrtc/media/engine/videoencodersoftwarefallbackwrapper.h" | 11 #include "webrtc/media/engine/videoencodersoftwarefallbackwrapper.h" |
12 | 12 |
13 #include <utility> | 13 #include <utility> |
14 | 14 |
15 #include "webrtc/modules/video_coding/include/video_codec_interface.h" | 15 #include "webrtc/modules/video_coding/include/video_codec_interface.h" |
16 #include "webrtc/modules/video_coding/include/video_error_codes.h" | 16 #include "webrtc/modules/video_coding/include/video_error_codes.h" |
17 #include "webrtc/test/gtest.h" | 17 #include "webrtc/test/gtest.h" |
18 | 18 |
19 namespace webrtc { | 19 namespace webrtc { |
20 | 20 |
21 const int kWidth = 320; | 21 const int kWidth = 320; |
22 const int kHeight = 240; | 22 const int kHeight = 240; |
23 const size_t kMaxPayloadSize = 800; | 23 const size_t kMaxPayloadSize = 800; |
24 | 24 |
25 class VideoEncoderSoftwareFallbackWrapperTest : public ::testing::Test { | 25 class VideoEncoderSoftwareFallbackWrapperTest : public ::testing::Test { |
26 protected: | 26 protected: |
27 VideoEncoderSoftwareFallbackWrapperTest() | 27 VideoEncoderSoftwareFallbackWrapperTest() |
28 : fallback_wrapper_(kVideoCodecVP8, &fake_encoder_) {} | 28 : fallback_wrapper_(cricket::VideoCodec("VP8"), &fake_encoder_) {} |
29 | 29 |
30 class CountingFakeEncoder : public VideoEncoder { | 30 class CountingFakeEncoder : public VideoEncoder { |
31 public: | 31 public: |
32 int32_t InitEncode(const VideoCodec* codec_settings, | 32 int32_t InitEncode(const VideoCodec* codec_settings, |
33 int32_t number_of_cores, | 33 int32_t number_of_cores, |
34 size_t max_payload_size) override { | 34 size_t max_payload_size) override { |
35 ++init_encode_count_; | 35 ++init_encode_count_; |
36 return init_encode_return_code_; | 36 return init_encode_return_code_; |
37 } | 37 } |
38 int32_t Encode(const VideoFrame& frame, | 38 int32_t Encode(const VideoFrame& frame, |
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
286 | 286 |
287 TEST_F(VideoEncoderSoftwareFallbackWrapperTest, | 287 TEST_F(VideoEncoderSoftwareFallbackWrapperTest, |
288 ReportsFallbackImplementationName) { | 288 ReportsFallbackImplementationName) { |
289 UtilizeFallbackEncoder(); | 289 UtilizeFallbackEncoder(); |
290 // Hard coded expected value since libvpx is the software implementation name | 290 // Hard coded expected value since libvpx is the software implementation name |
291 // for VP8. Change accordingly if the underlying implementation does. | 291 // for VP8. Change accordingly if the underlying implementation does. |
292 CheckLastEncoderName("libvpx"); | 292 CheckLastEncoderName("libvpx"); |
293 } | 293 } |
294 | 294 |
295 } // namespace webrtc | 295 } // namespace webrtc |
OLD | NEW |