Index: content/common/gpu/media/v4l2_video_decode_accelerator.cc |
diff --git a/content/common/gpu/media/v4l2_video_decode_accelerator.cc b/content/common/gpu/media/v4l2_video_decode_accelerator.cc |
index 243fee58d2e4fcfccdb336c68fbc8ae54a066352..f3fcaa1f92af6492bb0418f4610f3e0e9815e7be 100644 |
--- a/content/common/gpu/media/v4l2_video_decode_accelerator.cc |
+++ b/content/common/gpu/media/v4l2_video_decode_accelerator.cc |
@@ -127,7 +127,7 @@ V4L2VideoDecodeAccelerator::EGLSyncKHRRef::~EGLSyncKHRRef() { |
V4L2VideoDecodeAccelerator::InputRecord::InputRecord() |
: at_device(false), |
- address(NULL), |
+ address(nullptr), |
length(0), |
bytes_used(0), |
input_id(-1) { |
@@ -395,7 +395,7 @@ void V4L2VideoDecodeAccelerator::ReusePictureBuffer(int32 picture_buffer_id) { |
} |
EGLSyncKHR egl_sync = |
- eglCreateSyncKHR(egl_display_, EGL_SYNC_FENCE_KHR, NULL); |
+ eglCreateSyncKHR(egl_display_, EGL_SYNC_FENCE_KHR, nullptr); |
if (egl_sync == EGL_NO_SYNC_KHR) { |
LOG(ERROR) << "ReusePictureBuffer(): eglCreateSyncKHR() failed"; |
NOTIFY_ERROR(PLATFORM_FAILURE); |
@@ -508,7 +508,7 @@ void V4L2VideoDecodeAccelerator::DecodeBufferTask() { |
return; |
} |
- if (decoder_current_bitstream_buffer_ == NULL) { |
+ if (decoder_current_bitstream_buffer_ == nullptr) { |
if (decoder_input_queue_.empty()) { |
// We're waiting for a new buffer -- exit without scheduling a new task. |
return; |
@@ -526,7 +526,7 @@ void V4L2VideoDecodeAccelerator::DecodeBufferTask() { |
<< decoder_current_bitstream_buffer_->input_id |
<< ", addr=" << (decoder_current_bitstream_buffer_->shm ? |
decoder_current_bitstream_buffer_->shm->memory() : |
- NULL) |
+ nullptr) |
<< ", size=" << decoder_current_bitstream_buffer_->size; |
} |
bool schedule_task = false; |
@@ -540,7 +540,7 @@ void V4L2VideoDecodeAccelerator::DecodeBufferTask() { |
} else { |
// This is a buffer of zero size, queued to flush the pipe. Flush. |
DCHECK_EQ(decoder_current_bitstream_buffer_->shm.get(), |
- static_cast<base::SharedMemory*>(NULL)); |
+ static_cast<base::SharedMemory*>(nullptr)); |
// Enqueue a buffer guaranteed to be empty. To do that, we flush the |
// current input, enqueue no data to the next frame, then flush that down. |
schedule_task = true; |
@@ -549,7 +549,8 @@ void V4L2VideoDecodeAccelerator::DecodeBufferTask() { |
kFlushBufferId) |
schedule_task = FlushInputFrame(); |
- if (schedule_task && AppendToInputFrame(NULL, 0) && FlushInputFrame()) { |
+ if (schedule_task && AppendToInputFrame(nullptr, 0) && |
+ FlushInputFrame()) { |
DVLOG(2) << "DecodeBufferTask(): enqueued flush buffer"; |
decoder_partial_frame_pending_ = false; |
schedule_task = true; |
@@ -702,7 +703,7 @@ void V4L2VideoDecodeAccelerator::ScheduleDecodeBufferTaskIfNeeded() { |
// If we're behind on tasks, schedule another one. |
int buffers_to_decode = decoder_input_queue_.size(); |
- if (decoder_current_bitstream_buffer_ != NULL) |
+ if (decoder_current_bitstream_buffer_ != nullptr) |
buffers_to_decode++; |
if (decoder_decode_buffer_tasks_scheduled_ < buffers_to_decode) { |
decoder_decode_buffer_tasks_scheduled_++; |
@@ -787,7 +788,7 @@ bool V4L2VideoDecodeAccelerator::AppendToInputFrame( |
DCHECK_NE(decoder_state_, kUninitialized); |
DCHECK_NE(decoder_state_, kResetting); |
DCHECK_NE(decoder_state_, kError); |
- // This routine can handle data == NULL and size == 0, which occurs when |
+ // This routine can handle data == nullptr and size == 0, which occurs when |
// we queue an empty buffer for the purposes of flushing the pipe. |
// Flush if we're too big |
@@ -818,11 +819,11 @@ bool V4L2VideoDecodeAccelerator::AppendToInputFrame( |
input_buffer_map_[decoder_current_input_buffer_]; |
DCHECK_EQ(input_record.bytes_used, 0); |
DCHECK_EQ(input_record.input_id, -1); |
- DCHECK(decoder_current_bitstream_buffer_ != NULL); |
+ DCHECK(decoder_current_bitstream_buffer_ != nullptr); |
input_record.input_id = decoder_current_bitstream_buffer_->input_id; |
} |
- DCHECK(data != NULL || size == 0); |
+ DCHECK(data != nullptr || size == 0); |
if (size == 0) { |
// If we asked for an empty buffer, return now. We return only after |
// getting the next input buffer, since we might actually want an empty |
@@ -1258,7 +1259,7 @@ void V4L2VideoDecodeAccelerator::FlushTask() { |
// Queue up an empty buffer -- this triggers the flush. |
decoder_input_queue_.push( |
linked_ptr<BitstreamBufferRef>(new BitstreamBufferRef( |
- io_client_, io_message_loop_proxy_, NULL, 0, kFlushBufferId))); |
+ io_client_, io_message_loop_proxy_, nullptr, 0, kFlushBufferId))); |
decoder_flushing_ = true; |
SendPictureReady(); // Send all pending PictureReady. |
@@ -1609,7 +1610,7 @@ void V4L2VideoDecodeAccelerator::SetDecoderState(State state) { |
// We can touch decoder_state_ only if this is the decoder thread or the |
// decoder thread isn't running. |
- if (decoder_thread_.message_loop() != NULL && |
+ if (decoder_thread_.message_loop() != nullptr && |
decoder_thread_.message_loop() != base::MessageLoop::current()) { |
decoder_thread_.message_loop()->PostTask(FROM_HERE, base::Bind( |
&V4L2VideoDecodeAccelerator::SetDecoderState, |
@@ -1702,7 +1703,7 @@ bool V4L2VideoDecodeAccelerator::CreateInputBuffers() { |
buffer.m.planes = planes; |
buffer.length = 1; |
IOCTL_OR_ERROR_RETURN_FALSE(VIDIOC_QUERYBUF, &buffer); |
- void* address = device_->Mmap(NULL, |
+ void* address = device_->Mmap(nullptr, |
buffer.m.planes[0].length, |
PROT_READ | PROT_WRITE, |
MAP_SHARED, |
@@ -1780,7 +1781,7 @@ void V4L2VideoDecodeAccelerator::DestroyInputBuffers() { |
DCHECK(!input_streamon_); |
for (size_t i = 0; i < input_buffer_map_.size(); ++i) { |
- if (input_buffer_map_[i].address != NULL) { |
+ if (input_buffer_map_[i].address != nullptr) { |
device_->Munmap(input_buffer_map_[i].address, |
input_buffer_map_[i].length); |
} |