Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(47)

Unified Diff: webrtc/modules/rtp_rtcp/source/ssrc_database.h

Issue 1623543002: Refactor RtpSender and SSRCDatabase a bit. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Update comment and remove the one from ssrc_database.cc Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/modules/rtp_rtcp/source/rtp_sender.cc ('k') | webrtc/modules/rtp_rtcp/source/ssrc_database.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/modules/rtp_rtcp/source/ssrc_database.h
diff --git a/webrtc/modules/rtp_rtcp/source/ssrc_database.h b/webrtc/modules/rtp_rtcp/source/ssrc_database.h
index 7a3133638d7eb20e5e7cefb58e5f9fca027d0ae6..2f6357aec061022a3b5328a11168b4bac79ee93b 100644
--- a/webrtc/modules/rtp_rtcp/source/ssrc_database.h
+++ b/webrtc/modules/rtp_rtcp/source/ssrc_database.h
@@ -13,14 +13,21 @@
#include <set>
+#include "webrtc/base/criticalsection.h"
#include "webrtc/base/random.h"
-#include "webrtc/base/scoped_ptr.h"
+#include "webrtc/base/thread_annotations.h"
#include "webrtc/system_wrappers/include/static_instance.h"
#include "webrtc/typedefs.h"
namespace webrtc {
-class CriticalSectionWrapper;
+// TODO(tommi, holmer): Look into whether we can eliminate locking in this
+// class or the class itself completely once voice engine doesn't rely on it.
+// At the moment voe_auto_test requires locking, but it's not clear if that's
+// an issue with the test code or if it reflects real world usage or if that's
+// the best design performance wise.
+// If we do decide to keep the class, we should at least get rid of using
+// StaticInstance.
class SSRCDatabase {
public:
static SSRCDatabase* GetSSRCDatabase();
@@ -32,19 +39,23 @@ class SSRCDatabase {
protected:
SSRCDatabase();
- virtual ~SSRCDatabase();
+ ~SSRCDatabase();
static SSRCDatabase* CreateInstance() { return new SSRCDatabase(); }
- private:
// Friend function to allow the SSRC destructor to be accessed from the
// template class.
friend SSRCDatabase* GetStaticInstance<SSRCDatabase>(
CountOperation count_operation);
- rtc::scoped_ptr<CriticalSectionWrapper> crit_;
+ private:
+ rtc::CriticalSection crit_;
Random random_ GUARDED_BY(crit_);
std::set<uint32_t> ssrcs_ GUARDED_BY(crit_);
+ // TODO(tommi): Use a thread checker to ensure the object is created and
+ // deleted on the same thread. At the moment this isn't possible due to
+ // voe::ChannelOwner in voice engine. To reproduce, run:
+ // voe_auto_test --automated --gtest_filter=*MixManyChannelsForStressOpus
};
} // namespace webrtc
« no previous file with comments | « webrtc/modules/rtp_rtcp/source/rtp_sender.cc ('k') | webrtc/modules/rtp_rtcp/source/ssrc_database.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698