OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2004 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2004 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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 private: | 67 private: |
68 T* ptr; | 68 T* ptr; |
69 }; | 69 }; |
70 | 70 |
71 // Utility class for aggregating the various WebRTC interface. | 71 // Utility class for aggregating the various WebRTC interface. |
72 // Fake implementations can also be injected for testing. | 72 // Fake implementations can also be injected for testing. |
73 class VoEWrapper { | 73 class VoEWrapper { |
74 public: | 74 public: |
75 VoEWrapper() | 75 VoEWrapper() |
76 : engine_(webrtc::VoiceEngine::Create()), processing_(engine_), | 76 : engine_(webrtc::VoiceEngine::Create()), processing_(engine_), |
77 base_(engine_), codec_(engine_), | 77 base_(engine_), codec_(engine_), hw_(engine_), rtp_(engine_), |
78 hw_(engine_), network_(engine_), | 78 volume_(engine_) { |
79 rtp_(engine_), volume_(engine_) { | |
80 } | 79 } |
81 VoEWrapper(webrtc::VoEAudioProcessing* processing, | 80 VoEWrapper(webrtc::VoEAudioProcessing* processing, |
82 webrtc::VoEBase* base, | 81 webrtc::VoEBase* base, |
83 webrtc::VoECodec* codec, | 82 webrtc::VoECodec* codec, |
84 webrtc::VoEHardware* hw, | 83 webrtc::VoEHardware* hw, |
85 webrtc::VoENetwork* network, | |
86 webrtc::VoERTP_RTCP* rtp, | 84 webrtc::VoERTP_RTCP* rtp, |
87 webrtc::VoEVolumeControl* volume) | 85 webrtc::VoEVolumeControl* volume) |
88 : engine_(NULL), | 86 : engine_(NULL), |
89 processing_(processing), | 87 processing_(processing), |
90 base_(base), | 88 base_(base), |
91 codec_(codec), | 89 codec_(codec), |
92 hw_(hw), | 90 hw_(hw), |
93 network_(network), | |
94 rtp_(rtp), | 91 rtp_(rtp), |
95 volume_(volume) { | 92 volume_(volume) { |
96 } | 93 } |
97 ~VoEWrapper() {} | 94 ~VoEWrapper() {} |
98 webrtc::VoiceEngine* engine() const { return engine_.get(); } | 95 webrtc::VoiceEngine* engine() const { return engine_.get(); } |
99 webrtc::VoEAudioProcessing* processing() const { return processing_.get(); } | 96 webrtc::VoEAudioProcessing* processing() const { return processing_.get(); } |
100 webrtc::VoEBase* base() const { return base_.get(); } | 97 webrtc::VoEBase* base() const { return base_.get(); } |
101 webrtc::VoECodec* codec() const { return codec_.get(); } | 98 webrtc::VoECodec* codec() const { return codec_.get(); } |
102 webrtc::VoEHardware* hw() const { return hw_.get(); } | 99 webrtc::VoEHardware* hw() const { return hw_.get(); } |
103 webrtc::VoENetwork* network() const { return network_.get(); } | |
104 webrtc::VoERTP_RTCP* rtp() const { return rtp_.get(); } | 100 webrtc::VoERTP_RTCP* rtp() const { return rtp_.get(); } |
105 webrtc::VoEVolumeControl* volume() const { return volume_.get(); } | 101 webrtc::VoEVolumeControl* volume() const { return volume_.get(); } |
106 int error() { return base_->LastError(); } | 102 int error() { return base_->LastError(); } |
107 | 103 |
108 private: | 104 private: |
109 scoped_voe_engine engine_; | 105 scoped_voe_engine engine_; |
110 scoped_voe_ptr<webrtc::VoEAudioProcessing> processing_; | 106 scoped_voe_ptr<webrtc::VoEAudioProcessing> processing_; |
111 scoped_voe_ptr<webrtc::VoEBase> base_; | 107 scoped_voe_ptr<webrtc::VoEBase> base_; |
112 scoped_voe_ptr<webrtc::VoECodec> codec_; | 108 scoped_voe_ptr<webrtc::VoECodec> codec_; |
113 scoped_voe_ptr<webrtc::VoEHardware> hw_; | 109 scoped_voe_ptr<webrtc::VoEHardware> hw_; |
114 scoped_voe_ptr<webrtc::VoENetwork> network_; | |
115 scoped_voe_ptr<webrtc::VoERTP_RTCP> rtp_; | 110 scoped_voe_ptr<webrtc::VoERTP_RTCP> rtp_; |
116 scoped_voe_ptr<webrtc::VoEVolumeControl> volume_; | 111 scoped_voe_ptr<webrtc::VoEVolumeControl> volume_; |
117 }; | 112 }; |
118 } // namespace cricket | 113 } // namespace cricket |
119 | 114 |
120 #endif // WEBRTC_MEDIA_ENGINE_WEBRTCVOE_H_ | 115 #endif // WEBRTC_MEDIA_ENGINE_WEBRTCVOE_H_ |
OLD | NEW |