#include "talk/session/media/typingmonitor.h"
-#include "talk/base/logging.h"
-#include "talk/base/thread.h"
#include "talk/session/media/channel.h"
+#include "webrtc/base/logging.h"
+#include "webrtc/base/thread.h"
namespace cricket {
TypingMonitor::TypingMonitor(VoiceChannel* channel,
- talk_base::Thread* worker_thread,
+ rtc::Thread* worker_thread,
const TypingMonitorOptions& settings)
: channel_(channel),
worker_thread_(worker_thread),
TypingMonitor::~TypingMonitor() {
// Shortcut any pending unmutes.
if (has_pending_unmute_) {
- talk_base::MessageList messages;
+ rtc::MessageList messages;
worker_thread_->Clear(this, 0, &messages);
ASSERT(messages.size() == 1);
channel_->MuteStream(0, false);
channel_->MuteStream(0, true);
SignalMuted(channel_, true);
has_pending_unmute_ = true;
- muted_at_ = talk_base::Time();
+ muted_at_ = rtc::Time();
worker_thread_->PostDelayed(mute_period_, this, 0);
LOG(LS_INFO) << "Muting for at least " << mute_period_ << "ms.";
*/
void TypingMonitor::OnChannelMuted() {
if (has_pending_unmute_) {
- talk_base::MessageList removed;
+ rtc::MessageList removed;
worker_thread_->Clear(this, 0, &removed);
ASSERT(removed.size() == 1);
has_pending_unmute_ = false;
* elapse since they finished and try to unmute again. Should be called on the
* worker thread.
*/
-void TypingMonitor::OnMessage(talk_base::Message* msg) {
+void TypingMonitor::OnMessage(rtc::Message* msg) {
if (!channel_->IsStreamMuted(0) || !has_pending_unmute_) return;
int silence_period = channel_->media_channel()->GetTimeSinceLastTyping();
int expiry_time = mute_period_ - silence_period;
if (silence_period < 0 || expiry_time < 50) {
LOG(LS_INFO) << "Mute timeout hit, last typing " << silence_period
- << "ms ago, unmuting after " << talk_base::TimeSince(muted_at_)
+ << "ms ago, unmuting after " << rtc::TimeSince(muted_at_)
<< "ms total.";
has_pending_unmute_ = false;
channel_->MuteStream(0, false);
} else {
LOG(LS_INFO) << "Mute timeout hit, last typing " << silence_period
<< "ms ago, check again in " << expiry_time << "ms.";
- talk_base::Thread::Current()->PostDelayed(expiry_time, this, 0);
+ rtc::Thread::Current()->PostDelayed(expiry_time, this, 0);
}
}