OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2013 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 #include <algorithm> // max | 10 #include <algorithm> // max |
(...skipping 1234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1245 size_t maxPayloadSize) override { | 1245 size_t maxPayloadSize) override { |
1246 rtc::CritScope lock(&crit_); | 1246 rtc::CritScope lock(&crit_); |
1247 EXPECT_FALSE(initialized_); | 1247 EXPECT_FALSE(initialized_); |
1248 initialized_ = true; | 1248 initialized_ = true; |
1249 released_ = false; | 1249 released_ = false; |
1250 return 0; | 1250 return 0; |
1251 } | 1251 } |
1252 | 1252 |
1253 int32_t Encode(const VideoFrame& inputImage, | 1253 int32_t Encode(const VideoFrame& inputImage, |
1254 const CodecSpecificInfo* codecSpecificInfo, | 1254 const CodecSpecificInfo* codecSpecificInfo, |
1255 const std::vector<VideoFrameType>* frame_types) override { | 1255 const std::vector<FrameType>* frame_types) override { |
1256 EXPECT_TRUE(IsReadyForEncode()); | 1256 EXPECT_TRUE(IsReadyForEncode()); |
1257 | 1257 |
1258 observation_complete_->Set(); | 1258 observation_complete_->Set(); |
1259 return 0; | 1259 return 0; |
1260 } | 1260 } |
1261 | 1261 |
1262 int32_t RegisterEncodeCompleteCallback( | 1262 int32_t RegisterEncodeCompleteCallback( |
1263 EncodedImageCallback* callback) override { | 1263 EncodedImageCallback* callback) override { |
1264 rtc::CritScope lock(&crit_); | 1264 rtc::CritScope lock(&crit_); |
1265 EXPECT_TRUE(initialized_); | 1265 EXPECT_TRUE(initialized_); |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1444 | 1444 |
1445 encoder_settings_.frameDroppingOn = true; | 1445 encoder_settings_.frameDroppingOn = true; |
1446 stream_->ReconfigureVideoEncoder(encoder_config_); | 1446 stream_->ReconfigureVideoEncoder(encoder_config_); |
1447 EXPECT_EQ(2u, num_initializations_) | 1447 EXPECT_EQ(2u, num_initializations_) |
1448 << "ReconfigureVideoEncoder did not reinitialize the encoder with " | 1448 << "ReconfigureVideoEncoder did not reinitialize the encoder with " |
1449 "new encoder settings."; | 1449 "new encoder settings."; |
1450 } | 1450 } |
1451 | 1451 |
1452 int32_t Encode(const VideoFrame& input_image, | 1452 int32_t Encode(const VideoFrame& input_image, |
1453 const CodecSpecificInfo* codec_specific_info, | 1453 const CodecSpecificInfo* codec_specific_info, |
1454 const std::vector<VideoFrameType>* frame_types) override { | 1454 const std::vector<FrameType>* frame_types) override { |
1455 // Silently skip the encode, FakeEncoder::Encode doesn't produce VP8. | 1455 // Silently skip the encode, FakeEncoder::Encode doesn't produce VP8. |
1456 return 0; | 1456 return 0; |
1457 } | 1457 } |
1458 | 1458 |
1459 T encoder_settings_; | 1459 T encoder_settings_; |
1460 const VideoCodecType video_codec_type_; | 1460 const VideoCodecType video_codec_type_; |
1461 const char* const codec_name_; | 1461 const char* const codec_name_; |
1462 size_t num_initializations_; | 1462 size_t num_initializations_; |
1463 VideoSendStream* stream_; | 1463 VideoSendStream* stream_; |
1464 VideoEncoderConfig encoder_config_; | 1464 VideoEncoderConfig encoder_config_; |
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1735 class ScreencastTargetBitrateTest : public test::SendTest, | 1735 class ScreencastTargetBitrateTest : public test::SendTest, |
1736 public test::FakeEncoder { | 1736 public test::FakeEncoder { |
1737 public: | 1737 public: |
1738 ScreencastTargetBitrateTest() | 1738 ScreencastTargetBitrateTest() |
1739 : SendTest(kDefaultTimeoutMs), | 1739 : SendTest(kDefaultTimeoutMs), |
1740 test::FakeEncoder(Clock::GetRealTimeClock()) {} | 1740 test::FakeEncoder(Clock::GetRealTimeClock()) {} |
1741 | 1741 |
1742 private: | 1742 private: |
1743 int32_t Encode(const VideoFrame& input_image, | 1743 int32_t Encode(const VideoFrame& input_image, |
1744 const CodecSpecificInfo* codecSpecificInfo, | 1744 const CodecSpecificInfo* codecSpecificInfo, |
1745 const std::vector<VideoFrameType>* frame_types) override { | 1745 const std::vector<FrameType>* frame_types) override { |
1746 CodecSpecificInfo specifics; | 1746 CodecSpecificInfo specifics; |
1747 memset(&specifics, 0, sizeof(specifics)); | 1747 memset(&specifics, 0, sizeof(specifics)); |
1748 specifics.codecType = kVideoCodecGeneric; | 1748 specifics.codecType = kVideoCodecGeneric; |
1749 | 1749 |
1750 uint8_t buffer[16] = {0}; | 1750 uint8_t buffer[16] = {0}; |
1751 EncodedImage encoded(buffer, sizeof(buffer), sizeof(buffer)); | 1751 EncodedImage encoded(buffer, sizeof(buffer), sizeof(buffer)); |
1752 encoded._timeStamp = input_image.timestamp(); | 1752 encoded._timeStamp = input_image.timestamp(); |
1753 encoded.capture_time_ms_ = input_image.render_time_ms(); | 1753 encoded.capture_time_ms_ = input_image.render_time_ms(); |
1754 | 1754 |
1755 for (size_t i = 0; i < kNumStreams; ++i) { | 1755 for (size_t i = 0; i < kNumStreams; ++i) { |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1896 EXPECT_TRUE(vp9videoHeader->flexible_mode); | 1896 EXPECT_TRUE(vp9videoHeader->flexible_mode); |
1897 observation_complete_->Set(); | 1897 observation_complete_->Set(); |
1898 } | 1898 } |
1899 | 1899 |
1900 } test; | 1900 } test; |
1901 | 1901 |
1902 RunBaseTest(&test); | 1902 RunBaseTest(&test); |
1903 } | 1903 } |
1904 | 1904 |
1905 } // namespace webrtc | 1905 } // namespace webrtc |
OLD | NEW |