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 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
172 void SetTypingDetectionParameters(int time_window, | 172 void SetTypingDetectionParameters(int time_window, |
173 int cost_per_typing, | 173 int cost_per_typing, |
174 int reporting_threshold, | 174 int reporting_threshold, |
175 int penalty_decay, | 175 int penalty_decay, |
176 int type_event_delay) override; | 176 int type_event_delay) override; |
177 bool SetOutputVolume(uint32_t ssrc, double volume) override; | 177 bool SetOutputVolume(uint32_t ssrc, double volume) override; |
178 | 178 |
179 bool CanInsertDtmf() override; | 179 bool CanInsertDtmf() override; |
180 bool InsertDtmf(uint32_t ssrc, int event, int duration) override; | 180 bool InsertDtmf(uint32_t ssrc, int event, int duration) override; |
181 | 181 |
182 void OnPacketReceived(rtc::CopyOnWriteBuffer* packet, | 182 void OnPacketReceived(rtc::Buffer* packet, |
183 const rtc::PacketTime& packet_time) override; | 183 const rtc::PacketTime& packet_time) override; |
184 void OnRtcpReceived(rtc::CopyOnWriteBuffer* packet, | 184 void OnRtcpReceived(rtc::Buffer* packet, |
185 const rtc::PacketTime& packet_time) override; | 185 const rtc::PacketTime& packet_time) override; |
186 void OnReadyToSend(bool ready) override {} | 186 void OnReadyToSend(bool ready) override {} |
187 bool GetStats(VoiceMediaInfo* info) override; | 187 bool GetStats(VoiceMediaInfo* info) override; |
188 | 188 |
189 void SetRawAudioSink( | 189 void SetRawAudioSink( |
190 uint32_t ssrc, | 190 uint32_t ssrc, |
191 std::unique_ptr<webrtc::AudioSinkInterface> sink) override; | 191 std::unique_ptr<webrtc::AudioSinkInterface> sink) override; |
192 | 192 |
193 // implements Transport interface | 193 // implements Transport interface |
194 bool SendRtp(const uint8_t* data, | 194 bool SendRtp(const uint8_t* data, |
195 size_t len, | 195 size_t len, |
196 const webrtc::PacketOptions& options) override { | 196 const webrtc::PacketOptions& options) override { |
197 rtc::CopyOnWriteBuffer packet(data, len, kMaxRtpPacketLen); | 197 rtc::Buffer packet(reinterpret_cast<const uint8_t*>(data), len, |
| 198 kMaxRtpPacketLen); |
198 rtc::PacketOptions rtc_options; | 199 rtc::PacketOptions rtc_options; |
199 rtc_options.packet_id = options.packet_id; | 200 rtc_options.packet_id = options.packet_id; |
200 return VoiceMediaChannel::SendPacket(&packet, rtc_options); | 201 return VoiceMediaChannel::SendPacket(&packet, rtc_options); |
201 } | 202 } |
202 | 203 |
203 bool SendRtcp(const uint8_t* data, size_t len) override { | 204 bool SendRtcp(const uint8_t* data, size_t len) override { |
204 rtc::CopyOnWriteBuffer packet(data, len, kMaxRtpPacketLen); | 205 rtc::Buffer packet(reinterpret_cast<const uint8_t*>(data), len, |
| 206 kMaxRtpPacketLen); |
205 return VoiceMediaChannel::SendRtcp(&packet, rtc::PacketOptions()); | 207 return VoiceMediaChannel::SendRtcp(&packet, rtc::PacketOptions()); |
206 } | 208 } |
207 | 209 |
208 int GetReceiveChannelId(uint32_t ssrc) const; | 210 int GetReceiveChannelId(uint32_t ssrc) const; |
209 int GetSendChannelId(uint32_t ssrc) const; | 211 int GetSendChannelId(uint32_t ssrc) const; |
210 | 212 |
211 private: | 213 private: |
212 bool SetOptions(const AudioOptions& options); | 214 bool SetOptions(const AudioOptions& options); |
213 bool SetRecvCodecs(const std::vector<AudioCodec>& codecs); | 215 bool SetRecvCodecs(const std::vector<AudioCodec>& codecs); |
214 bool SetSendCodecs(const std::vector<AudioCodec>& codecs); | 216 bool SetSendCodecs(const std::vector<AudioCodec>& codecs); |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
282 int cng_payload_type = -1; | 284 int cng_payload_type = -1; |
283 int cng_plfreq = -1; | 285 int cng_plfreq = -1; |
284 webrtc::CodecInst codec_inst; | 286 webrtc::CodecInst codec_inst; |
285 } send_codec_spec_; | 287 } send_codec_spec_; |
286 | 288 |
287 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(WebRtcVoiceMediaChannel); | 289 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(WebRtcVoiceMediaChannel); |
288 }; | 290 }; |
289 } // namespace cricket | 291 } // namespace cricket |
290 | 292 |
291 #endif // WEBRTC_MEDIA_ENGINE_WEBRTCVOICEENGINE_H_ | 293 #endif // WEBRTC_MEDIA_ENGINE_WEBRTCVOICEENGINE_H_ |
OLD | NEW |