I420BufferPool: Replace SequencedTaskChecker with RaceChecker

SequencedTaskChecker does not work with the iOS dispatch queue. See bug
for more info.

BUG=webrtc:6367
R=perkj@webrtc.org

Review URL: https://codereview.webrtc.org/2341113005 .

Cr-Commit-Position: refs/heads/master@{#14272}
This commit is contained in:
Magnus Jedvert 2016-09-17 11:27:35 +02:00
parent b0c1b4e24d
commit 7fd92866c3
2 changed files with 4 additions and 7 deletions

View File

@ -15,18 +15,15 @@
namespace webrtc {
I420BufferPool::I420BufferPool(bool zero_initialize)
: zero_initialize_(zero_initialize) {
sequenced_checker_.Detach();
}
: zero_initialize_(zero_initialize) {}
void I420BufferPool::Release() {
sequenced_checker_.Detach();
buffers_.clear();
}
rtc::scoped_refptr<I420Buffer> I420BufferPool::CreateBuffer(int width,
int height) {
RTC_DCHECK(sequenced_checker_.CalledSequentially());
RTC_DCHECK_RUNS_SERIALIZED(&race_checker_);
// Release buffers with wrong resolution.
for (auto it = buffers_.begin(); it != buffers_.end();) {
if ((*it)->width() != width || (*it)->height() != height)

View File

@ -13,7 +13,7 @@
#include <list>
#include "webrtc/base/sequenced_task_checker.h"
#include "webrtc/base/race_checker.h"
#include "webrtc/common_video/include/video_frame_buffer.h"
namespace webrtc {
@ -40,7 +40,7 @@ class I420BufferPool {
// needed by the pool to check exclusive access.
using PooledI420Buffer = rtc::RefCountedObject<I420Buffer>;
rtc::SequencedTaskChecker sequenced_checker_;
rtc::RaceChecker race_checker_;
std::list<rtc::scoped_refptr<PooledI420Buffer>> buffers_;
// If true, newly allocated buffers are zero-initialized. Note that recycled
// buffers are not zero'd before reuse. This is required of buffers used by