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 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
295 bool SetRecvRtpHeaderExtensions( | 295 bool SetRecvRtpHeaderExtensions( |
296 const std::vector<RtpHeaderExtension>& extensions) override; | 296 const std::vector<RtpHeaderExtension>& extensions) override; |
297 bool SetSendRtpHeaderExtensions( | 297 bool SetSendRtpHeaderExtensions( |
298 const std::vector<RtpHeaderExtension>& extensions) override; | 298 const std::vector<RtpHeaderExtension>& extensions) override; |
299 bool SetPlayout(bool playout) override; | 299 bool SetPlayout(bool playout) override; |
300 bool PausePlayout(); | 300 bool PausePlayout(); |
301 bool ResumePlayout(); | 301 bool ResumePlayout(); |
302 bool SetSend(SendFlags send) override; | 302 bool SetSend(SendFlags send) override; |
303 bool PauseSend(); | 303 bool PauseSend(); |
304 bool ResumeSend(); | 304 bool ResumeSend(); |
| 305 bool SetAudioSend(uint32 ssrc, bool mute, const AudioOptions* options, |
| 306 AudioRenderer* renderer) override; |
305 bool AddSendStream(const StreamParams& sp) override; | 307 bool AddSendStream(const StreamParams& sp) override; |
306 bool RemoveSendStream(uint32 ssrc) override; | 308 bool RemoveSendStream(uint32 ssrc) override; |
307 bool AddRecvStream(const StreamParams& sp) override; | 309 bool AddRecvStream(const StreamParams& sp) override; |
308 bool RemoveRecvStream(uint32 ssrc) override; | 310 bool RemoveRecvStream(uint32 ssrc) override; |
309 bool SetRemoteRenderer(uint32 ssrc, AudioRenderer* renderer) override; | 311 bool SetRemoteRenderer(uint32 ssrc, AudioRenderer* renderer) override; |
310 bool SetLocalRenderer(uint32 ssrc, AudioRenderer* renderer) override; | |
311 bool GetActiveStreams(AudioInfo::StreamList* actives) override; | 312 bool GetActiveStreams(AudioInfo::StreamList* actives) override; |
312 int GetOutputLevel() override; | 313 int GetOutputLevel() override; |
313 int GetTimeSinceLastTyping() override; | 314 int GetTimeSinceLastTyping() override; |
314 void SetTypingDetectionParameters(int time_window, | 315 void SetTypingDetectionParameters(int time_window, |
315 int cost_per_typing, | 316 int cost_per_typing, |
316 int reporting_threshold, | 317 int reporting_threshold, |
317 int penalty_decay, | 318 int penalty_decay, |
318 int type_event_delay) override; | 319 int type_event_delay) override; |
319 bool SetOutputScaling(uint32 ssrc, double left, double right) override; | 320 bool SetOutputScaling(uint32 ssrc, double left, double right) override; |
320 | 321 |
321 bool SetRingbackTone(const char* buf, int len) override; | 322 bool SetRingbackTone(const char* buf, int len) override; |
322 bool PlayRingbackTone(uint32 ssrc, bool play, bool loop) override; | 323 bool PlayRingbackTone(uint32 ssrc, bool play, bool loop) override; |
323 bool CanInsertDtmf() override; | 324 bool CanInsertDtmf() override; |
324 bool InsertDtmf(uint32 ssrc, int event, int duration, int flags) override; | 325 bool InsertDtmf(uint32 ssrc, int event, int duration, int flags) override; |
325 | 326 |
326 void OnPacketReceived(rtc::Buffer* packet, | 327 void OnPacketReceived(rtc::Buffer* packet, |
327 const rtc::PacketTime& packet_time) override; | 328 const rtc::PacketTime& packet_time) override; |
328 void OnRtcpReceived(rtc::Buffer* packet, | 329 void OnRtcpReceived(rtc::Buffer* packet, |
329 const rtc::PacketTime& packet_time) override; | 330 const rtc::PacketTime& packet_time) override; |
330 void OnReadyToSend(bool ready) override {} | 331 void OnReadyToSend(bool ready) override {} |
331 bool MuteStream(uint32 ssrc, bool on) override; | |
332 bool SetMaxSendBandwidth(int bps) override; | 332 bool SetMaxSendBandwidth(int bps) override; |
333 bool GetStats(VoiceMediaInfo* info) override; | 333 bool GetStats(VoiceMediaInfo* info) override; |
334 // Gets last reported error from WebRtc voice engine. This should be only | 334 // Gets last reported error from WebRtc voice engine. This should be only |
335 // called in response a failure. | 335 // called in response a failure. |
336 void GetLastMediaError(uint32* ssrc, | 336 void GetLastMediaError(uint32* ssrc, |
337 VoiceMediaChannel::Error* error) override; | 337 VoiceMediaChannel::Error* error) override; |
338 | 338 |
339 // implements Transport interface | 339 // implements Transport interface |
340 int SendPacket(int channel, const void* data, size_t len) override { | 340 int SendPacket(int channel, const void* data, size_t len) override { |
341 rtc::Buffer packet(reinterpret_cast<const uint8_t*>(data), len, | 341 rtc::Buffer packet(reinterpret_cast<const uint8_t*>(data), len, |
(...skipping 10 matching lines...) Expand all Loading... |
352 bool FindSsrc(int channel_num, uint32* ssrc); | 352 bool FindSsrc(int channel_num, uint32* ssrc); |
353 void OnError(uint32 ssrc, int error); | 353 void OnError(uint32 ssrc, int error); |
354 | 354 |
355 bool sending() const { return send_ != SEND_NOTHING; } | 355 bool sending() const { return send_ != SEND_NOTHING; } |
356 int GetReceiveChannelNum(uint32 ssrc) const; | 356 int GetReceiveChannelNum(uint32 ssrc) const; |
357 int GetSendChannelNum(uint32 ssrc) const; | 357 int GetSendChannelNum(uint32 ssrc) const; |
358 | 358 |
359 void SetCall(webrtc::Call* call); | 359 void SetCall(webrtc::Call* call); |
360 | 360 |
361 private: | 361 private: |
| 362 bool SetLocalRenderer(uint32 ssrc, AudioRenderer* renderer); |
| 363 bool MuteStream(uint32 ssrc, bool mute); |
362 WebRtcVoiceEngine* engine() { return engine_; } | 364 WebRtcVoiceEngine* engine() { return engine_; } |
363 int GetLastEngineError() { return engine()->GetLastEngineError(); } | 365 int GetLastEngineError() { return engine()->GetLastEngineError(); } |
364 int GetOutputLevel(int channel); | 366 int GetOutputLevel(int channel); |
365 bool GetRedSendCodec(const AudioCodec& red_codec, | 367 bool GetRedSendCodec(const AudioCodec& red_codec, |
366 const std::vector<AudioCodec>& all_codecs, | 368 const std::vector<AudioCodec>& all_codecs, |
367 webrtc::CodecInst* send_codec); | 369 webrtc::CodecInst* send_codec); |
368 bool EnableRtcp(int channel); | 370 bool EnableRtcp(int channel); |
369 bool ResetRecvCodecs(int channel); | 371 bool ResetRecvCodecs(int channel); |
370 bool SetPlayout(int channel, bool playout); | 372 bool SetPlayout(int channel, bool playout); |
371 static uint32 ParseSsrc(const void* data, size_t len, bool rtcp); | 373 static uint32 ParseSsrc(const void* data, size_t len, bool rtcp); |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
451 std::vector<webrtc::RtpExtension> recv_rtp_extensions_; | 453 std::vector<webrtc::RtpExtension> recv_rtp_extensions_; |
452 | 454 |
453 // Do not lock this on the VoE media processor thread; potential for deadlock | 455 // Do not lock this on the VoE media processor thread; potential for deadlock |
454 // exists. | 456 // exists. |
455 mutable rtc::CriticalSection receive_channels_cs_; | 457 mutable rtc::CriticalSection receive_channels_cs_; |
456 }; | 458 }; |
457 | 459 |
458 } // namespace cricket | 460 } // namespace cricket |
459 | 461 |
460 #endif // TALK_MEDIA_WEBRTCVOICEENGINE_H_ | 462 #endif // TALK_MEDIA_WEBRTCVOICEENGINE_H_ |
OLD | NEW |