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

Unified Diff: webrtc/video/payload_router.cc

Issue 1613053003: Swap use of CriticalSectionWrapper for rtc::CriticalSection in webrtc/video. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Rebase? 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/video/payload_router.h ('k') | webrtc/video/receive_statistics_proxy.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/video/payload_router.cc
diff --git a/webrtc/video/payload_router.cc b/webrtc/video/payload_router.cc
index 177f2dd4e85853b9458c1a31d9520f4323d39ef8..72abdb8a44afc7ecee6e737d838ef4f2481fdc2d 100644
--- a/webrtc/video/payload_router.cc
+++ b/webrtc/video/payload_router.cc
@@ -13,13 +13,11 @@
#include "webrtc/base/checks.h"
#include "webrtc/modules/rtp_rtcp/include/rtp_rtcp.h"
#include "webrtc/modules/rtp_rtcp/include/rtp_rtcp_defines.h"
-#include "webrtc/system_wrappers/include/critical_section_wrapper.h"
namespace webrtc {
PayloadRouter::PayloadRouter()
- : crit_(CriticalSectionWrapper::CreateCriticalSection()),
- active_(false) {}
+ : active_(false) {}
PayloadRouter::~PayloadRouter() {}
@@ -30,7 +28,7 @@ size_t PayloadRouter::DefaultMaxPayloadLength() {
void PayloadRouter::SetSendingRtpModules(
const std::list<RtpRtcp*>& rtp_modules) {
- CriticalSectionScoped cs(crit_.get());
+ rtc::CritScope lock(&crit_);
rtp_modules_.clear();
rtp_modules_.reserve(rtp_modules.size());
for (auto* rtp_module : rtp_modules) {
@@ -39,12 +37,12 @@ void PayloadRouter::SetSendingRtpModules(
}
void PayloadRouter::set_active(bool active) {
- CriticalSectionScoped cs(crit_.get());
+ rtc::CritScope lock(&crit_);
active_ = active;
}
bool PayloadRouter::active() {
- CriticalSectionScoped cs(crit_.get());
+ rtc::CritScope lock(&crit_);
return active_ && !rtp_modules_.empty();
}
@@ -56,7 +54,7 @@ bool PayloadRouter::RoutePayload(FrameType frame_type,
size_t payload_length,
const RTPFragmentationHeader* fragmentation,
const RTPVideoHeader* rtp_video_hdr) {
- CriticalSectionScoped cs(crit_.get());
+ rtc::CritScope lock(&crit_);
if (!active_ || rtp_modules_.empty())
return false;
@@ -76,7 +74,7 @@ bool PayloadRouter::RoutePayload(FrameType frame_type,
void PayloadRouter::SetTargetSendBitrates(
const std::vector<uint32_t>& stream_bitrates) {
- CriticalSectionScoped cs(crit_.get());
+ rtc::CritScope lock(&crit_);
if (stream_bitrates.size() < rtp_modules_.size()) {
// There can be a size mis-match during codec reconfiguration.
return;
@@ -89,7 +87,7 @@ void PayloadRouter::SetTargetSendBitrates(
size_t PayloadRouter::MaxPayloadLength() const {
size_t min_payload_length = DefaultMaxPayloadLength();
- CriticalSectionScoped cs(crit_.get());
+ rtc::CritScope lock(&crit_);
for (auto* rtp_module : rtp_modules_) {
size_t module_payload_length = rtp_module->MaxDataPayloadLength();
if (module_payload_length < min_payload_length)
« no previous file with comments | « webrtc/video/payload_router.h ('k') | webrtc/video/receive_statistics_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698