| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2010 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2010 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 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 188 class FakeWebRtcVideoEncoderFactory : public WebRtcVideoEncoderFactory { | 188 class FakeWebRtcVideoEncoderFactory : public WebRtcVideoEncoderFactory { |
| 189 public: | 189 public: |
| 190 FakeWebRtcVideoEncoderFactory() | 190 FakeWebRtcVideoEncoderFactory() |
| 191 : created_video_encoder_event_(false, false), | 191 : created_video_encoder_event_(false, false), |
| 192 num_created_encoders_(0), | 192 num_created_encoders_(0), |
| 193 encoders_have_internal_sources_(false) {} | 193 encoders_have_internal_sources_(false) {} |
| 194 | 194 |
| 195 webrtc::VideoEncoder* CreateVideoEncoder( | 195 webrtc::VideoEncoder* CreateVideoEncoder( |
| 196 const cricket::VideoCodec& codec) override { | 196 const cricket::VideoCodec& codec) override { |
| 197 rtc::CritScope lock(&crit_); | 197 rtc::CritScope lock(&crit_); |
| 198 if (!IsCodecSupported(codecs_, codec)) | 198 if (!FindMatchingCodec(codecs_, codec)) |
| 199 return nullptr; | 199 return nullptr; |
| 200 FakeWebRtcVideoEncoder* encoder = new FakeWebRtcVideoEncoder(); | 200 FakeWebRtcVideoEncoder* encoder = new FakeWebRtcVideoEncoder(); |
| 201 encoders_.push_back(encoder); | 201 encoders_.push_back(encoder); |
| 202 num_created_encoders_++; | 202 num_created_encoders_++; |
| 203 created_video_encoder_event_.Set(); | 203 created_video_encoder_event_.Set(); |
| 204 return encoder; | 204 return encoder; |
| 205 } | 205 } |
| 206 | 206 |
| 207 bool WaitForCreatedVideoEncoders(int num_encoders) { | 207 bool WaitForCreatedVideoEncoders(int num_encoders) { |
| 208 while (created_video_encoder_event_.Wait(kEventTimeoutMs)) { | 208 while (created_video_encoder_event_.Wait(kEventTimeoutMs)) { |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 256 rtc::Event created_video_encoder_event_; | 256 rtc::Event created_video_encoder_event_; |
| 257 std::vector<cricket::VideoCodec> codecs_; | 257 std::vector<cricket::VideoCodec> codecs_; |
| 258 std::vector<FakeWebRtcVideoEncoder*> encoders_ GUARDED_BY(crit_); | 258 std::vector<FakeWebRtcVideoEncoder*> encoders_ GUARDED_BY(crit_); |
| 259 int num_created_encoders_ GUARDED_BY(crit_); | 259 int num_created_encoders_ GUARDED_BY(crit_); |
| 260 bool encoders_have_internal_sources_; | 260 bool encoders_have_internal_sources_; |
| 261 }; | 261 }; |
| 262 | 262 |
| 263 } // namespace cricket | 263 } // namespace cricket |
| 264 | 264 |
| 265 #endif // WEBRTC_MEDIA_ENGINE_FAKEWEBRTCVIDEOENGINE_H_ | 265 #endif // WEBRTC_MEDIA_ENGINE_FAKEWEBRTCVIDEOENGINE_H_ |
| OLD | NEW |