OLD | NEW |
1 /* | 1 /* |
2 * libjingle | 2 * libjingle |
3 * Copyright 2004 Google Inc. | 3 * Copyright 2004 Google Inc. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions are met: | 6 * modification, are permitted provided that the following conditions are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright notice, | 8 * 1. Redistributions of source code must retain the above copyright notice, |
9 * this list of conditions and the following disclaimer. | 9 * this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright notice, | 10 * 2. Redistributions in binary form must reproduce the above copyright notice, |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 void SetTraceOptions(const std::string& options); | 120 void SetTraceOptions(const std::string& options); |
121 // Every option that is "set" will be applied. Every option not "set" will be | 121 // Every option that is "set" will be applied. Every option not "set" will be |
122 // ignored. This allows us to selectively turn on and off different options | 122 // ignored. This allows us to selectively turn on and off different options |
123 // easily at any time. | 123 // easily at any time. |
124 bool ApplyOptions(const AudioOptions& options); | 124 bool ApplyOptions(const AudioOptions& options); |
125 | 125 |
126 // webrtc::TraceCallback: | 126 // webrtc::TraceCallback: |
127 void Print(webrtc::TraceLevel level, const char* trace, int length) override; | 127 void Print(webrtc::TraceLevel level, const char* trace, int length) override; |
128 | 128 |
129 // webrtc::VoiceEngineObserver: | 129 // webrtc::VoiceEngineObserver: |
130 void CallbackOnError(int channel, int errCode) override; | 130 void CallbackOnError(int channel_id, int errCode) override; |
131 | 131 |
132 // Given the device type, name, and id, find device id. Return true and | 132 // Given the device type, name, and id, find device id. Return true and |
133 // set the output parameter rtc_id if successful. | 133 // set the output parameter rtc_id if successful. |
134 bool FindWebRtcAudioDeviceId( | 134 bool FindWebRtcAudioDeviceId( |
135 bool is_input, const std::string& dev_name, int dev_id, int* rtc_id); | 135 bool is_input, const std::string& dev_name, int dev_id, int* rtc_id); |
136 bool FindChannelAndSsrc(int channel_num, | |
137 WebRtcVoiceMediaChannel** channel, | |
138 uint32* ssrc) const; | |
139 | 136 |
140 void StartAecDump(const std::string& filename); | 137 void StartAecDump(const std::string& filename); |
141 void StopAecDump(); | 138 void StopAecDump(); |
142 int CreateVoiceChannel(VoEWrapper* voe); | 139 int CreateVoiceChannel(VoEWrapper* voe); |
143 | 140 |
144 static const int kDefaultLogSeverity = rtc::LS_WARNING; | 141 static const int kDefaultLogSeverity = rtc::LS_WARNING; |
145 | 142 |
146 // The primary instance of WebRtc VoiceEngine. | 143 // The primary instance of WebRtc VoiceEngine. |
147 rtc::scoped_ptr<VoEWrapper> voe_wrapper_; | 144 rtc::scoped_ptr<VoEWrapper> voe_wrapper_; |
148 rtc::scoped_ptr<VoETraceWrapper> tracing_; | 145 rtc::scoped_ptr<VoETraceWrapper> tracing_; |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
230 kMaxRtpPacketLen); | 227 kMaxRtpPacketLen); |
231 return VoiceMediaChannel::SendPacket(&packet); | 228 return VoiceMediaChannel::SendPacket(&packet); |
232 } | 229 } |
233 | 230 |
234 bool SendRtcp(const uint8_t* data, size_t len) override { | 231 bool SendRtcp(const uint8_t* data, size_t len) override { |
235 rtc::Buffer packet(reinterpret_cast<const uint8_t*>(data), len, | 232 rtc::Buffer packet(reinterpret_cast<const uint8_t*>(data), len, |
236 kMaxRtpPacketLen); | 233 kMaxRtpPacketLen); |
237 return VoiceMediaChannel::SendRtcp(&packet); | 234 return VoiceMediaChannel::SendRtcp(&packet); |
238 } | 235 } |
239 | 236 |
240 bool FindSsrc(int channel_num, uint32* ssrc); | 237 void OnError(int error); |
241 void OnError(uint32 ssrc, int error); | |
242 | 238 |
243 int GetReceiveChannelNum(uint32 ssrc) const; | 239 int GetReceiveChannelId(uint32 ssrc) const; |
244 int GetSendChannelNum(uint32 ssrc) const; | 240 int GetSendChannelId(uint32 ssrc) const; |
245 | 241 |
246 private: | 242 private: |
247 bool SetSendCodecs(const std::vector<AudioCodec>& codecs); | 243 bool SetSendCodecs(const std::vector<AudioCodec>& codecs); |
248 bool SetSendRtpHeaderExtensions( | 244 bool SetSendRtpHeaderExtensions( |
249 const std::vector<RtpHeaderExtension>& extensions); | 245 const std::vector<RtpHeaderExtension>& extensions); |
250 bool SetOptions(const AudioOptions& options); | 246 bool SetOptions(const AudioOptions& options); |
251 bool SetMaxSendBandwidth(int bps); | 247 bool SetMaxSendBandwidth(int bps); |
252 bool SetRecvCodecs(const std::vector<AudioCodec>& codecs); | 248 bool SetRecvCodecs(const std::vector<AudioCodec>& codecs); |
253 bool SetRecvRtpHeaderExtensions( | 249 bool SetRecvRtpHeaderExtensions( |
254 const std::vector<RtpHeaderExtension>& extensions); | 250 const std::vector<RtpHeaderExtension>& extensions); |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
346 std::vector<webrtc::RtpExtension> recv_rtp_extensions_; | 342 std::vector<webrtc::RtpExtension> recv_rtp_extensions_; |
347 | 343 |
348 // Do not lock this on the VoE media processor thread; potential for deadlock | 344 // Do not lock this on the VoE media processor thread; potential for deadlock |
349 // exists. | 345 // exists. |
350 mutable rtc::CriticalSection receive_channels_cs_; | 346 mutable rtc::CriticalSection receive_channels_cs_; |
351 }; | 347 }; |
352 | 348 |
353 } // namespace cricket | 349 } // namespace cricket |
354 | 350 |
355 #endif // TALK_MEDIA_WEBRTCVOICEENGINE_H_ | 351 #endif // TALK_MEDIA_WEBRTCVOICEENGINE_H_ |
OLD | NEW |