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 |
11 #ifndef WEBRTC_MEDIA_ENGINE_FAKEWEBRTCVOICEENGINE_H_ | 11 #ifndef WEBRTC_MEDIA_ENGINE_FAKEWEBRTCVOICEENGINE_H_ |
12 #define WEBRTC_MEDIA_ENGINE_FAKEWEBRTCVOICEENGINE_H_ | 12 #define WEBRTC_MEDIA_ENGINE_FAKEWEBRTCVOICEENGINE_H_ |
13 | 13 |
14 #include <list> | 14 #include <list> |
15 #include <map> | 15 #include <map> |
16 #include <vector> | 16 #include <vector> |
17 | 17 |
18 #include "webrtc/base/basictypes.h" | 18 #include "webrtc/base/basictypes.h" |
19 #include "webrtc/base/checks.h" | 19 #include "webrtc/base/checks.h" |
20 #include "webrtc/base/gunit.h" | |
21 #include "webrtc/base/stringutils.h" | 20 #include "webrtc/base/stringutils.h" |
22 #include "webrtc/config.h" | 21 #include "webrtc/config.h" |
23 #include "webrtc/media/base/codec.h" | 22 #include "webrtc/media/base/codec.h" |
24 #include "webrtc/media/base/rtputils.h" | 23 #include "webrtc/media/base/rtputils.h" |
25 #include "webrtc/media/engine/fakewebrtccommon.h" | |
26 #include "webrtc/media/engine/webrtcvoe.h" | 24 #include "webrtc/media/engine/webrtcvoe.h" |
27 #include "webrtc/modules/audio_coding/acm2/rent_a_codec.h" | 25 #include "webrtc/modules/audio_coding/acm2/rent_a_codec.h" |
28 #include "webrtc/modules/audio_processing/include/audio_processing.h" | 26 #include "webrtc/modules/audio_processing/include/audio_processing.h" |
29 | 27 |
30 namespace cricket { | 28 namespace cricket { |
31 | 29 |
32 static const int kOpusBandwidthNb = 4000; | 30 static const int kOpusBandwidthNb = 4000; |
33 static const int kOpusBandwidthMb = 6000; | 31 static const int kOpusBandwidthMb = 6000; |
34 static const int kOpusBandwidthWb = 8000; | 32 static const int kOpusBandwidthWb = 8000; |
35 static const int kOpusBandwidthSwb = 12000; | 33 static const int kOpusBandwidthSwb = 12000; |
36 static const int kOpusBandwidthFb = 20000; | 34 static const int kOpusBandwidthFb = 20000; |
37 | 35 |
38 #define WEBRTC_CHECK_CHANNEL(channel) \ | 36 #define WEBRTC_CHECK_CHANNEL(channel) \ |
39 if (channels_.find(channel) == channels_.end()) return -1; | 37 if (channels_.find(channel) == channels_.end()) return -1; |
40 | 38 |
| 39 #define WEBRTC_STUB(method, args) \ |
| 40 int method args override { return 0; } |
| 41 |
| 42 #define WEBRTC_STUB_CONST(method, args) \ |
| 43 int method args const override { return 0; } |
| 44 |
| 45 #define WEBRTC_BOOL_STUB(method, args) \ |
| 46 bool method args override { return true; } |
| 47 |
| 48 #define WEBRTC_BOOL_STUB_CONST(method, args) \ |
| 49 bool method args const override { return true; } |
| 50 |
| 51 #define WEBRTC_VOID_STUB(method, args) \ |
| 52 void method args override {} |
| 53 |
| 54 #define WEBRTC_FUNC(method, args) int method args override |
| 55 |
| 56 #define WEBRTC_VOID_FUNC(method, args) void method args override |
| 57 |
41 class FakeAudioProcessing : public webrtc::AudioProcessing { | 58 class FakeAudioProcessing : public webrtc::AudioProcessing { |
42 public: | 59 public: |
43 FakeAudioProcessing() : experimental_ns_enabled_(false) {} | 60 FakeAudioProcessing() : experimental_ns_enabled_(false) {} |
44 | 61 |
45 WEBRTC_STUB(Initialize, ()) | 62 WEBRTC_STUB(Initialize, ()) |
46 WEBRTC_STUB(Initialize, ( | 63 WEBRTC_STUB(Initialize, ( |
47 int input_sample_rate_hz, | 64 int input_sample_rate_hz, |
48 int output_sample_rate_hz, | 65 int output_sample_rate_hz, |
49 int reverse_sample_rate_hz, | 66 int reverse_sample_rate_hz, |
50 webrtc::AudioProcessing::ChannelLayout input_layout, | 67 webrtc::AudioProcessing::ChannelLayout input_layout, |
(...skipping 508 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
559 webrtc::AecmModes aecm_mode_ = webrtc::kAecmSpeakerphone; | 576 webrtc::AecmModes aecm_mode_ = webrtc::kAecmSpeakerphone; |
560 webrtc::NsModes ns_mode_ = webrtc::kNsDefault; | 577 webrtc::NsModes ns_mode_ = webrtc::kNsDefault; |
561 webrtc::AgcModes agc_mode_ = webrtc::kAgcDefault; | 578 webrtc::AgcModes agc_mode_ = webrtc::kAgcDefault; |
562 webrtc::AgcConfig agc_config_; | 579 webrtc::AgcConfig agc_config_; |
563 FakeAudioProcessing audio_processing_; | 580 FakeAudioProcessing audio_processing_; |
564 }; | 581 }; |
565 | 582 |
566 } // namespace cricket | 583 } // namespace cricket |
567 | 584 |
568 #endif // WEBRTC_MEDIA_ENGINE_FAKEWEBRTCVOICEENGINE_H_ | 585 #endif // WEBRTC_MEDIA_ENGINE_FAKEWEBRTCVOICEENGINE_H_ |
OLD | NEW |