| 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 13 matching lines...) Expand all Loading... |
| 24 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF | 24 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF |
| 25 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 25 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 26 */ | 26 */ |
| 27 | 27 |
| 28 #include "talk/session/media/channel.h" | 28 #include "talk/session/media/channel.h" |
| 29 | 29 |
| 30 #include "talk/media/base/constants.h" | 30 #include "talk/media/base/constants.h" |
| 31 #include "talk/media/base/rtputils.h" | 31 #include "talk/media/base/rtputils.h" |
| 32 #include "webrtc/p2p/base/transportchannel.h" | 32 #include "webrtc/p2p/base/transportchannel.h" |
| 33 #include "talk/session/media/channelmanager.h" | 33 #include "talk/session/media/channelmanager.h" |
| 34 #include "talk/session/media/typingmonitor.h" | |
| 35 #include "webrtc/base/bind.h" | 34 #include "webrtc/base/bind.h" |
| 36 #include "webrtc/base/buffer.h" | 35 #include "webrtc/base/buffer.h" |
| 37 #include "webrtc/base/byteorder.h" | 36 #include "webrtc/base/byteorder.h" |
| 38 #include "webrtc/base/common.h" | 37 #include "webrtc/base/common.h" |
| 39 #include "webrtc/base/dscp.h" | 38 #include "webrtc/base/dscp.h" |
| 40 #include "webrtc/base/logging.h" | 39 #include "webrtc/base/logging.h" |
| 41 | 40 |
| 42 namespace cricket { | 41 namespace cricket { |
| 43 | 42 |
| 44 using rtc::Bind; | 43 using rtc::Bind; |
| (...skipping 1332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1377 if (audio_monitor_) { | 1376 if (audio_monitor_) { |
| 1378 audio_monitor_->Stop(); | 1377 audio_monitor_->Stop(); |
| 1379 audio_monitor_.reset(); | 1378 audio_monitor_.reset(); |
| 1380 } | 1379 } |
| 1381 } | 1380 } |
| 1382 | 1381 |
| 1383 bool VoiceChannel::IsAudioMonitorRunning() const { | 1382 bool VoiceChannel::IsAudioMonitorRunning() const { |
| 1384 return (audio_monitor_.get() != NULL); | 1383 return (audio_monitor_.get() != NULL); |
| 1385 } | 1384 } |
| 1386 | 1385 |
| 1387 void VoiceChannel::StartTypingMonitor(const TypingMonitorOptions& settings) { | |
| 1388 typing_monitor_.reset(new TypingMonitor(this, worker_thread(), settings)); | |
| 1389 SignalAutoMuted.repeat(typing_monitor_->SignalMuted); | |
| 1390 } | |
| 1391 | |
| 1392 void VoiceChannel::StopTypingMonitor() { | |
| 1393 typing_monitor_.reset(); | |
| 1394 } | |
| 1395 | |
| 1396 bool VoiceChannel::IsTypingMonitorRunning() const { | |
| 1397 return typing_monitor_; | |
| 1398 } | |
| 1399 | |
| 1400 bool VoiceChannel::MuteStream_w(uint32 ssrc, bool mute) { | |
| 1401 bool ret = BaseChannel::MuteStream_w(ssrc, mute); | |
| 1402 if (typing_monitor_ && mute) | |
| 1403 typing_monitor_->OnChannelMuted(); | |
| 1404 return ret; | |
| 1405 } | |
| 1406 | |
| 1407 int VoiceChannel::GetInputLevel_w() { | 1386 int VoiceChannel::GetInputLevel_w() { |
| 1408 return media_engine_->GetInputLevel(); | 1387 return media_engine_->GetInputLevel(); |
| 1409 } | 1388 } |
| 1410 | 1389 |
| 1411 int VoiceChannel::GetOutputLevel_w() { | 1390 int VoiceChannel::GetOutputLevel_w() { |
| 1412 return media_channel()->GetOutputLevel(); | 1391 return media_channel()->GetOutputLevel(); |
| 1413 } | 1392 } |
| 1414 | 1393 |
| 1415 void VoiceChannel::GetActiveStreams_w(AudioInfo::StreamList* actives) { | 1394 void VoiceChannel::GetActiveStreams_w(AudioInfo::StreamList* actives) { |
| 1416 media_channel()->GetActiveStreams(actives); | 1395 media_channel()->GetActiveStreams(actives); |
| (...skipping 1011 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2428 return (data_channel_type_ == DCT_RTP); | 2407 return (data_channel_type_ == DCT_RTP); |
| 2429 } | 2408 } |
| 2430 | 2409 |
| 2431 void DataChannel::OnStreamClosedRemotely(uint32 sid) { | 2410 void DataChannel::OnStreamClosedRemotely(uint32 sid) { |
| 2432 rtc::TypedMessageData<uint32>* message = | 2411 rtc::TypedMessageData<uint32>* message = |
| 2433 new rtc::TypedMessageData<uint32>(sid); | 2412 new rtc::TypedMessageData<uint32>(sid); |
| 2434 signaling_thread()->Post(this, MSG_STREAMCLOSEDREMOTELY, message); | 2413 signaling_thread()->Post(this, MSG_STREAMCLOSEDREMOTELY, message); |
| 2435 } | 2414 } |
| 2436 | 2415 |
| 2437 } // namespace cricket | 2416 } // namespace cricket |
| OLD | NEW |