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 19 matching lines...) Expand all Loading... |
30 #include "webrtc/call.h" | 30 #include "webrtc/call.h" |
31 #include "webrtc/video_frame.h" | 31 #include "webrtc/video_frame.h" |
32 #include "webrtc/video_receive_stream.h" | 32 #include "webrtc/video_receive_stream.h" |
33 #include "webrtc/video_send_stream.h" | 33 #include "webrtc/video_send_stream.h" |
34 | 34 |
35 namespace cricket { | 35 namespace cricket { |
36 class FakeAudioSendStream final : public webrtc::AudioSendStream { | 36 class FakeAudioSendStream final : public webrtc::AudioSendStream { |
37 public: | 37 public: |
38 struct TelephoneEvent { | 38 struct TelephoneEvent { |
39 int payload_type = -1; | 39 int payload_type = -1; |
| 40 int payload_frequency = -1; |
40 int event_code = 0; | 41 int event_code = 0; |
41 int duration_ms = 0; | 42 int duration_ms = 0; |
42 }; | 43 }; |
43 | 44 |
44 explicit FakeAudioSendStream(const webrtc::AudioSendStream::Config& config); | 45 explicit FakeAudioSendStream(const webrtc::AudioSendStream::Config& config); |
45 | 46 |
46 const webrtc::AudioSendStream::Config& GetConfig() const; | 47 const webrtc::AudioSendStream::Config& GetConfig() const; |
47 void SetStats(const webrtc::AudioSendStream::Stats& stats); | 48 void SetStats(const webrtc::AudioSendStream::Stats& stats); |
48 TelephoneEvent GetLatestTelephoneEvent() const; | 49 TelephoneEvent GetLatestTelephoneEvent() const; |
49 bool IsSending() const { return sending_; } | 50 bool IsSending() const { return sending_; } |
50 bool muted() const { return muted_; } | 51 bool muted() const { return muted_; } |
51 | 52 |
52 private: | 53 private: |
53 // webrtc::AudioSendStream implementation. | 54 // webrtc::AudioSendStream implementation. |
54 void Start() override { sending_ = true; } | 55 void Start() override { sending_ = true; } |
55 void Stop() override { sending_ = false; } | 56 void Stop() override { sending_ = false; } |
56 | 57 |
57 bool SendTelephoneEvent(int payload_type, int event, | 58 bool SendTelephoneEvent(int payload_type, int payload_frequency, int event, |
58 int duration_ms) override; | 59 int duration_ms) override; |
59 void SetMuted(bool muted) override; | 60 void SetMuted(bool muted) override; |
60 webrtc::AudioSendStream::Stats GetStats() const override; | 61 webrtc::AudioSendStream::Stats GetStats() const override; |
61 | 62 |
62 TelephoneEvent latest_telephone_event_; | 63 TelephoneEvent latest_telephone_event_; |
63 webrtc::AudioSendStream::Config config_; | 64 webrtc::AudioSendStream::Config config_; |
64 webrtc::AudioSendStream::Stats stats_; | 65 webrtc::AudioSendStream::Stats stats_; |
65 bool sending_ = false; | 66 bool sending_ = false; |
66 bool muted_ = false; | 67 bool muted_ = false; |
67 }; | 68 }; |
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
274 std::vector<FakeAudioSendStream*> audio_send_streams_; | 275 std::vector<FakeAudioSendStream*> audio_send_streams_; |
275 std::vector<FakeVideoReceiveStream*> video_receive_streams_; | 276 std::vector<FakeVideoReceiveStream*> video_receive_streams_; |
276 std::vector<FakeAudioReceiveStream*> audio_receive_streams_; | 277 std::vector<FakeAudioReceiveStream*> audio_receive_streams_; |
277 | 278 |
278 int num_created_send_streams_; | 279 int num_created_send_streams_; |
279 int num_created_receive_streams_; | 280 int num_created_receive_streams_; |
280 }; | 281 }; |
281 | 282 |
282 } // namespace cricket | 283 } // namespace cricket |
283 #endif // WEBRTC_MEDIA_ENGINE_FAKEWEBRTCCALL_H_ | 284 #endif // WEBRTC_MEDIA_ENGINE_FAKEWEBRTCCALL_H_ |
OLD | NEW |