OLD | NEW |
1 /* | 1 /* |
2 * libjingle | 2 * libjingle |
3 * Copyright 2005 Google Inc. | 3 * Copyright 2005 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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 : worker_thread_(worker_thread), | 43 : worker_thread_(worker_thread), |
44 monitor_thread_(monitor_thread), monitoring_(false), rate_(0) { | 44 monitor_thread_(monitor_thread), monitoring_(false), rate_(0) { |
45 } | 45 } |
46 | 46 |
47 MediaMonitor::~MediaMonitor() { | 47 MediaMonitor::~MediaMonitor() { |
48 monitoring_ = false; | 48 monitoring_ = false; |
49 monitor_thread_->Clear(this); | 49 monitor_thread_->Clear(this); |
50 worker_thread_->Clear(this); | 50 worker_thread_->Clear(this); |
51 } | 51 } |
52 | 52 |
53 void MediaMonitor::Start(uint32 milliseconds) { | 53 void MediaMonitor::Start(uint32_t milliseconds) { |
54 rate_ = milliseconds; | 54 rate_ = milliseconds; |
55 if (rate_ < 100) | 55 if (rate_ < 100) |
56 rate_ = 100; | 56 rate_ = 100; |
57 worker_thread_->Post(this, MSG_MONITOR_START); | 57 worker_thread_->Post(this, MSG_MONITOR_START); |
58 } | 58 } |
59 | 59 |
60 void MediaMonitor::Stop() { | 60 void MediaMonitor::Stop() { |
61 worker_thread_->Post(this, MSG_MONITOR_STOP); | 61 worker_thread_->Post(this, MSG_MONITOR_STOP); |
62 rate_ = 0; | 62 rate_ = 0; |
63 } | 63 } |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 ASSERT(rtc::Thread::Current() == worker_thread_); | 99 ASSERT(rtc::Thread::Current() == worker_thread_); |
100 | 100 |
101 GetStats(); | 101 GetStats(); |
102 | 102 |
103 // Signal the monitoring thread, start another poll timer | 103 // Signal the monitoring thread, start another poll timer |
104 monitor_thread_->Post(this, MSG_MONITOR_SIGNAL); | 104 monitor_thread_->Post(this, MSG_MONITOR_SIGNAL); |
105 worker_thread_->PostDelayed(rate_, this, MSG_MONITOR_POLL); | 105 worker_thread_->PostDelayed(rate_, this, MSG_MONITOR_POLL); |
106 } | 106 } |
107 | 107 |
108 } | 108 } |
OLD | NEW |