OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
11 #include "webrtc/modules/rtp_rtcp/source/ssrc_database.h" | 11 #include "webrtc/modules/rtp_rtcp/source/ssrc_database.h" |
12 | 12 #include "webrtc/base/timeutils.h" |
13 #include "webrtc/base/checks.h" | 13 #include "webrtc/base/checks.h" |
14 #include "webrtc/system_wrappers/include/tick_util.h" | |
15 | 14 |
16 namespace webrtc { | 15 namespace webrtc { |
17 | 16 |
18 SSRCDatabase* SSRCDatabase::GetSSRCDatabase() { | 17 SSRCDatabase* SSRCDatabase::GetSSRCDatabase() { |
19 return GetStaticInstance<SSRCDatabase>(kAddRef); | 18 return GetStaticInstance<SSRCDatabase>(kAddRef); |
20 } | 19 } |
21 | 20 |
22 void SSRCDatabase::ReturnSSRCDatabase() { | 21 void SSRCDatabase::ReturnSSRCDatabase() { |
23 GetStaticInstance<SSRCDatabase>(kRelease); | 22 GetStaticInstance<SSRCDatabase>(kRelease); |
24 } | 23 } |
(...skipping 13 matching lines...) Expand all Loading... |
38 void SSRCDatabase::RegisterSSRC(uint32_t ssrc) { | 37 void SSRCDatabase::RegisterSSRC(uint32_t ssrc) { |
39 rtc::CritScope lock(&crit_); | 38 rtc::CritScope lock(&crit_); |
40 ssrcs_.insert(ssrc); | 39 ssrcs_.insert(ssrc); |
41 } | 40 } |
42 | 41 |
43 void SSRCDatabase::ReturnSSRC(uint32_t ssrc) { | 42 void SSRCDatabase::ReturnSSRC(uint32_t ssrc) { |
44 rtc::CritScope lock(&crit_); | 43 rtc::CritScope lock(&crit_); |
45 ssrcs_.erase(ssrc); | 44 ssrcs_.erase(ssrc); |
46 } | 45 } |
47 | 46 |
48 SSRCDatabase::SSRCDatabase() : random_(TickTime::Now().Ticks()) {} | 47 SSRCDatabase::SSRCDatabase() : random_(rtc::TimeMicros()) {} |
49 | 48 |
50 SSRCDatabase::~SSRCDatabase() {} | 49 SSRCDatabase::~SSRCDatabase() {} |
51 | 50 |
52 } // namespace webrtc | 51 } // namespace webrtc |
OLD | NEW |