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 28 matching lines...) Expand all Loading... |
39 int event_code = 0; | 39 int event_code = 0; |
40 int duration_ms = 0; | 40 int duration_ms = 0; |
41 }; | 41 }; |
42 | 42 |
43 explicit FakeAudioSendStream(const webrtc::AudioSendStream::Config& config); | 43 explicit FakeAudioSendStream(const webrtc::AudioSendStream::Config& config); |
44 | 44 |
45 const webrtc::AudioSendStream::Config& GetConfig() const; | 45 const webrtc::AudioSendStream::Config& GetConfig() const; |
46 void SetStats(const webrtc::AudioSendStream::Stats& stats); | 46 void SetStats(const webrtc::AudioSendStream::Stats& stats); |
47 TelephoneEvent GetLatestTelephoneEvent() const; | 47 TelephoneEvent GetLatestTelephoneEvent() const; |
48 bool IsSending() const { return sending_; } | 48 bool IsSending() const { return sending_; } |
| 49 bool muted() const { return muted_; } |
49 | 50 |
50 private: | 51 private: |
51 // webrtc::AudioSendStream implementation. | 52 // webrtc::AudioSendStream implementation. |
52 void Start() override { sending_ = true; } | 53 void Start() override { sending_ = true; } |
53 void Stop() override { sending_ = false; } | 54 void Stop() override { sending_ = false; } |
54 | 55 |
55 bool SendTelephoneEvent(int payload_type, int event, | 56 bool SendTelephoneEvent(int payload_type, int event, |
56 int duration_ms) override; | 57 int duration_ms) override; |
| 58 void SetMuted(bool muted) override; |
57 webrtc::AudioSendStream::Stats GetStats() const override; | 59 webrtc::AudioSendStream::Stats GetStats() const override; |
58 | 60 |
59 TelephoneEvent latest_telephone_event_; | 61 TelephoneEvent latest_telephone_event_; |
60 webrtc::AudioSendStream::Config config_; | 62 webrtc::AudioSendStream::Config config_; |
61 webrtc::AudioSendStream::Stats stats_; | 63 webrtc::AudioSendStream::Stats stats_; |
62 bool sending_ = false; | 64 bool sending_ = false; |
| 65 bool muted_ = false; |
63 }; | 66 }; |
64 | 67 |
65 class FakeAudioReceiveStream final : public webrtc::AudioReceiveStream { | 68 class FakeAudioReceiveStream final : public webrtc::AudioReceiveStream { |
66 public: | 69 public: |
67 explicit FakeAudioReceiveStream( | 70 explicit FakeAudioReceiveStream( |
68 const webrtc::AudioReceiveStream::Config& config); | 71 const webrtc::AudioReceiveStream::Config& config); |
69 | 72 |
70 const webrtc::AudioReceiveStream::Config& GetConfig() const; | 73 const webrtc::AudioReceiveStream::Config& GetConfig() const; |
71 void SetStats(const webrtc::AudioReceiveStream::Stats& stats); | 74 void SetStats(const webrtc::AudioReceiveStream::Stats& stats); |
72 int received_packets() const { return received_packets_; } | 75 int received_packets() const { return received_packets_; } |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
227 std::vector<FakeAudioSendStream*> audio_send_streams_; | 230 std::vector<FakeAudioSendStream*> audio_send_streams_; |
228 std::vector<FakeVideoReceiveStream*> video_receive_streams_; | 231 std::vector<FakeVideoReceiveStream*> video_receive_streams_; |
229 std::vector<FakeAudioReceiveStream*> audio_receive_streams_; | 232 std::vector<FakeAudioReceiveStream*> audio_receive_streams_; |
230 | 233 |
231 int num_created_send_streams_; | 234 int num_created_send_streams_; |
232 int num_created_receive_streams_; | 235 int num_created_receive_streams_; |
233 }; | 236 }; |
234 | 237 |
235 } // namespace cricket | 238 } // namespace cricket |
236 #endif // TALK_MEDIA_WEBRTC_WEBRTCVIDEOENGINE2_UNITTEST_H_ | 239 #endif // TALK_MEDIA_WEBRTC_WEBRTCVIDEOENGINE2_UNITTEST_H_ |
OLD | NEW |