| Index: media/gpu/v4l2_video_decode_accelerator.cc
|
| diff --git a/content/common/gpu/media/v4l2_video_decode_accelerator.cc b/media/gpu/v4l2_video_decode_accelerator.cc
|
| similarity index 94%
|
| rename from content/common/gpu/media/v4l2_video_decode_accelerator.cc
|
| rename to media/gpu/v4l2_video_decode_accelerator.cc
|
| index 596c0273a025bcbc7e5d017bfc494d44172afdb1..1f5932837e79a628a7cfd2d17947b37eaef34660 100644
|
| --- a/content/common/gpu/media/v4l2_video_decode_accelerator.cc
|
| +++ b/media/gpu/v4l2_video_decode_accelerator.cc
|
| @@ -2,7 +2,7 @@
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| -#include "content/common/gpu/media/v4l2_video_decode_accelerator.h"
|
| +#include "media/gpu/v4l2_video_decode_accelerator.h"
|
|
|
| #include <dlfcn.h>
|
| #include <errno.h>
|
| @@ -21,10 +21,10 @@
|
| #include "base/thread_task_runner_handle.h"
|
| #include "base/trace_event/trace_event.h"
|
| #include "build/build_config.h"
|
| -#include "content/common/gpu/media/shared_memory_region.h"
|
| #include "media/base/bind_to_current_loop.h"
|
| #include "media/base/media_switches.h"
|
| #include "media/filters/h264_parser.h"
|
| +#include "media/gpu/shared_memory_region.h"
|
| #include "ui/gfx/geometry/rect.h"
|
| #include "ui/gl/gl_context.h"
|
| #include "ui/gl/scoped_binders.h"
|
| @@ -35,13 +35,13 @@
|
| SetErrorState(x); \
|
| } while (0)
|
|
|
| -#define IOCTL_OR_ERROR_RETURN_VALUE(type, arg, value, type_str) \
|
| - do { \
|
| - if (device_->Ioctl(type, arg) != 0) { \
|
| - PLOG(ERROR) << __func__ << "(): ioctl() failed: " << type_str; \
|
| - NOTIFY_ERROR(PLATFORM_FAILURE); \
|
| - return value; \
|
| - } \
|
| +#define IOCTL_OR_ERROR_RETURN_VALUE(type, arg, value, type_str) \
|
| + do { \
|
| + if (device_->Ioctl(type, arg) != 0) { \
|
| + PLOG(ERROR) << __func__ << "(): ioctl() failed: " << type_str; \
|
| + NOTIFY_ERROR(PLATFORM_FAILURE); \
|
| + return value; \
|
| + } \
|
| } while (0)
|
|
|
| #define IOCTL_OR_ERROR_RETURN(type, arg) \
|
| @@ -50,13 +50,13 @@
|
| #define IOCTL_OR_ERROR_RETURN_FALSE(type, arg) \
|
| IOCTL_OR_ERROR_RETURN_VALUE(type, arg, false, #type)
|
|
|
| -#define IOCTL_OR_LOG_ERROR(type, arg) \
|
| - do { \
|
| - if (device_->Ioctl(type, arg) != 0) \
|
| - PLOG(ERROR) << __func__ << "(): ioctl() failed: " << #type; \
|
| +#define IOCTL_OR_LOG_ERROR(type, arg) \
|
| + do { \
|
| + if (device_->Ioctl(type, arg) != 0) \
|
| + PLOG(ERROR) << __func__ << "(): ioctl() failed: " << #type; \
|
| } while (0)
|
|
|
| -namespace content {
|
| +namespace media {
|
|
|
| // static
|
| const uint32_t V4L2VideoDecodeAccelerator::supported_input_fourccs_[] = {
|
| @@ -110,11 +110,9 @@ V4L2VideoDecodeAccelerator::BitstreamBufferRef::~BitstreamBufferRef() {
|
| }
|
| }
|
|
|
| -V4L2VideoDecodeAccelerator::EGLSyncKHRRef::EGLSyncKHRRef(
|
| - EGLDisplay egl_display, EGLSyncKHR egl_sync)
|
| - : egl_display(egl_display),
|
| - egl_sync(egl_sync) {
|
| -}
|
| +V4L2VideoDecodeAccelerator::EGLSyncKHRRef::EGLSyncKHRRef(EGLDisplay egl_display,
|
| + EGLSyncKHR egl_sync)
|
| + : egl_display(egl_display), egl_sync(egl_sync) {}
|
|
|
| V4L2VideoDecodeAccelerator::EGLSyncKHRRef::~EGLSyncKHRRef() {
|
| // We don't check for eglDestroySyncKHR failures, because if we get here
|
| @@ -125,23 +123,16 @@ V4L2VideoDecodeAccelerator::EGLSyncKHRRef::~EGLSyncKHRRef() {
|
| }
|
|
|
| V4L2VideoDecodeAccelerator::InputRecord::InputRecord()
|
| - : at_device(false),
|
| - address(NULL),
|
| - length(0),
|
| - bytes_used(0),
|
| - input_id(-1) {
|
| -}
|
| + : at_device(false), address(NULL), length(0), bytes_used(0), input_id(-1) {}
|
|
|
| -V4L2VideoDecodeAccelerator::InputRecord::~InputRecord() {
|
| -}
|
| +V4L2VideoDecodeAccelerator::InputRecord::~InputRecord() {}
|
|
|
| V4L2VideoDecodeAccelerator::OutputRecord::OutputRecord()
|
| : state(kFree),
|
| egl_image(EGL_NO_IMAGE_KHR),
|
| egl_sync(EGL_NO_SYNC_KHR),
|
| picture_id(-1),
|
| - cleared(false) {
|
| -}
|
| + cleared(false) {}
|
|
|
| V4L2VideoDecodeAccelerator::OutputRecord::~OutputRecord() {}
|
|
|
| @@ -267,7 +258,8 @@ bool V4L2VideoDecodeAccelerator::Initialize(const Config& config,
|
| IOCTL_OR_ERROR_RETURN_FALSE(VIDIOC_QUERYCAP, &caps);
|
| if ((caps.capabilities & kCapsRequired) != kCapsRequired) {
|
| LOG(ERROR) << "Initialize(): ioctl() failed: VIDIOC_QUERYCAP"
|
| - ", caps check failed: 0x" << std::hex << caps.capabilities;
|
| + ", caps check failed: 0x"
|
| + << std::hex << caps.capabilities;
|
| return false;
|
| }
|
|
|
| @@ -297,10 +289,9 @@ bool V4L2VideoDecodeAccelerator::Initialize(const Config& config,
|
|
|
| // StartDevicePoll will NOTIFY_ERROR on failure, so IgnoreResult is fine here.
|
| decoder_thread_.message_loop()->PostTask(
|
| - FROM_HERE,
|
| - base::Bind(
|
| - base::IgnoreResult(&V4L2VideoDecodeAccelerator::StartDevicePoll),
|
| - base::Unretained(this)));
|
| + FROM_HERE, base::Bind(base::IgnoreResult(
|
| + &V4L2VideoDecodeAccelerator::StartDevicePoll),
|
| + base::Unretained(this)));
|
|
|
| return true;
|
| }
|
| @@ -320,9 +311,9 @@ void V4L2VideoDecodeAccelerator::Decode(
|
| }
|
|
|
| // DecodeTask() will take care of running a DecodeBufferTask().
|
| - decoder_thread_.message_loop()->PostTask(FROM_HERE, base::Bind(
|
| - &V4L2VideoDecodeAccelerator::DecodeTask, base::Unretained(this),
|
| - bitstream_buffer));
|
| + decoder_thread_.message_loop()->PostTask(
|
| + FROM_HERE, base::Bind(&V4L2VideoDecodeAccelerator::DecodeTask,
|
| + base::Unretained(this), bitstream_buffer));
|
| }
|
|
|
| void V4L2VideoDecodeAccelerator::AssignPictureBuffers(
|
| @@ -335,8 +326,8 @@ void V4L2VideoDecodeAccelerator::AssignPictureBuffers(
|
|
|
| if (buffers.size() < req_buffer_count) {
|
| LOG(ERROR) << "AssignPictureBuffers(): Failed to provide requested picture"
|
| - " buffers. (Got " << buffers.size()
|
| - << ", requested " << req_buffer_count << ")";
|
| + " buffers. (Got "
|
| + << buffers.size() << ", requested " << req_buffer_count << ")";
|
| NOTIFY_ERROR(INVALID_ARGUMENT);
|
| return;
|
| }
|
| @@ -356,8 +347,8 @@ void V4L2VideoDecodeAccelerator::AssignPictureBuffers(
|
| // Allocate the output buffers.
|
| struct v4l2_requestbuffers reqbufs;
|
| memset(&reqbufs, 0, sizeof(reqbufs));
|
| - reqbufs.count = buffers.size();
|
| - reqbufs.type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE;
|
| + reqbufs.count = buffers.size();
|
| + reqbufs.type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE;
|
| reqbufs.memory = V4L2_MEMORY_MMAP;
|
| IOCTL_OR_ERROR_RETURN(VIDIOC_REQBUFS, &reqbufs);
|
|
|
| @@ -475,23 +466,26 @@ void V4L2VideoDecodeAccelerator::ReusePictureBuffer(int32_t picture_buffer_id) {
|
|
|
| std::unique_ptr<EGLSyncKHRRef> egl_sync_ref(
|
| new EGLSyncKHRRef(egl_display_, egl_sync));
|
| - decoder_thread_.message_loop()->PostTask(FROM_HERE, base::Bind(
|
| - &V4L2VideoDecodeAccelerator::ReusePictureBufferTask,
|
| - base::Unretained(this), picture_buffer_id, base::Passed(&egl_sync_ref)));
|
| + decoder_thread_.message_loop()->PostTask(
|
| + FROM_HERE, base::Bind(&V4L2VideoDecodeAccelerator::ReusePictureBufferTask,
|
| + base::Unretained(this), picture_buffer_id,
|
| + base::Passed(&egl_sync_ref)));
|
| }
|
|
|
| void V4L2VideoDecodeAccelerator::Flush() {
|
| DVLOG(3) << "Flush()";
|
| DCHECK(child_task_runner_->BelongsToCurrentThread());
|
| - decoder_thread_.message_loop()->PostTask(FROM_HERE, base::Bind(
|
| - &V4L2VideoDecodeAccelerator::FlushTask, base::Unretained(this)));
|
| + decoder_thread_.message_loop()->PostTask(
|
| + FROM_HERE, base::Bind(&V4L2VideoDecodeAccelerator::FlushTask,
|
| + base::Unretained(this)));
|
| }
|
|
|
| void V4L2VideoDecodeAccelerator::Reset() {
|
| DVLOG(3) << "Reset()";
|
| DCHECK(child_task_runner_->BelongsToCurrentThread());
|
| - decoder_thread_.message_loop()->PostTask(FROM_HERE, base::Bind(
|
| - &V4L2VideoDecodeAccelerator::ResetTask, base::Unretained(this)));
|
| + decoder_thread_.message_loop()->PostTask(
|
| + FROM_HERE, base::Bind(&V4L2VideoDecodeAccelerator::ResetTask,
|
| + base::Unretained(this)));
|
| }
|
|
|
| void V4L2VideoDecodeAccelerator::Destroy() {
|
| @@ -504,8 +498,9 @@ void V4L2VideoDecodeAccelerator::Destroy() {
|
|
|
| // If the decoder thread is running, destroy using posted task.
|
| if (decoder_thread_.IsRunning()) {
|
| - decoder_thread_.message_loop()->PostTask(FROM_HERE, base::Bind(
|
| - &V4L2VideoDecodeAccelerator::DestroyTask, base::Unretained(this)));
|
| + decoder_thread_.message_loop()->PostTask(
|
| + FROM_HERE, base::Bind(&V4L2VideoDecodeAccelerator::DestroyTask,
|
| + base::Unretained(this)));
|
| pictures_assigned_.Signal();
|
| // DestroyTask() will cause the decoder_thread_ to flush all tasks.
|
| decoder_thread_.Stop();
|
| @@ -797,14 +792,15 @@ void V4L2VideoDecodeAccelerator::ScheduleDecodeBufferTaskIfNeeded() {
|
| buffers_to_decode++;
|
| if (decoder_decode_buffer_tasks_scheduled_ < buffers_to_decode) {
|
| decoder_decode_buffer_tasks_scheduled_++;
|
| - decoder_thread_.message_loop()->PostTask(FROM_HERE, base::Bind(
|
| - &V4L2VideoDecodeAccelerator::DecodeBufferTask,
|
| - base::Unretained(this)));
|
| + decoder_thread_.message_loop()->PostTask(
|
| + FROM_HERE, base::Bind(&V4L2VideoDecodeAccelerator::DecodeBufferTask,
|
| + base::Unretained(this)));
|
| }
|
| }
|
|
|
| -bool V4L2VideoDecodeAccelerator::DecodeBufferInitial(
|
| - const void* data, size_t size, size_t* endpos) {
|
| +bool V4L2VideoDecodeAccelerator::DecodeBufferInitial(const void* data,
|
| + size_t size,
|
| + size_t* endpos) {
|
| DVLOG(3) << "DecodeBufferInitial(): data=" << data << ", size=" << size;
|
| DCHECK_EQ(decoder_thread_.message_loop(), base::MessageLoop::current());
|
| DCHECK_NE(decoder_state_, kUninitialized);
|
| @@ -853,8 +849,8 @@ bool V4L2VideoDecodeAccelerator::DecodeBufferInitial(
|
| return true;
|
| }
|
|
|
| -bool V4L2VideoDecodeAccelerator::DecodeBufferContinue(
|
| - const void* data, size_t size) {
|
| +bool V4L2VideoDecodeAccelerator::DecodeBufferContinue(const void* data,
|
| + size_t size) {
|
| DVLOG(3) << "DecodeBufferContinue(): data=" << data << ", size=" << size;
|
| DCHECK_EQ(decoder_thread_.message_loop(), base::MessageLoop::current());
|
| DCHECK_EQ(decoder_state_, kDecoding);
|
| @@ -865,8 +861,8 @@ bool V4L2VideoDecodeAccelerator::DecodeBufferContinue(
|
| (decoder_partial_frame_pending_ || FlushInputFrame()));
|
| }
|
|
|
| -bool V4L2VideoDecodeAccelerator::AppendToInputFrame(
|
| - const void* data, size_t size) {
|
| +bool V4L2VideoDecodeAccelerator::AppendToInputFrame(const void* data,
|
| + size_t size) {
|
| DVLOG(3) << "AppendToInputFrame()";
|
| DCHECK_EQ(decoder_thread_.message_loop(), base::MessageLoop::current());
|
| DCHECK_NE(decoder_state_, kUninitialized);
|
| @@ -916,8 +912,7 @@ bool V4L2VideoDecodeAccelerator::AppendToInputFrame(
|
| }
|
|
|
| // Copy in to the buffer.
|
| - InputRecord& input_record =
|
| - input_buffer_map_[decoder_current_input_buffer_];
|
| + InputRecord& input_record = input_buffer_map_[decoder_current_input_buffer_];
|
| if (size > input_record.length - input_record.bytes_used) {
|
| LOG(ERROR) << "AppendToInputFrame(): over-size frame, erroring";
|
| NOTIFY_ERROR(UNREADABLE_INPUT);
|
| @@ -941,8 +936,7 @@ bool V4L2VideoDecodeAccelerator::FlushInputFrame() {
|
| if (decoder_current_input_buffer_ == -1)
|
| return true;
|
|
|
| - InputRecord& input_record =
|
| - input_buffer_map_[decoder_current_input_buffer_];
|
| + InputRecord& input_record = input_buffer_map_[decoder_current_input_buffer_];
|
| DCHECK_NE(input_record.input_id, -1);
|
| DCHECK(input_record.input_id != kFlushBufferId ||
|
| input_record.bytes_used == 0);
|
| @@ -1013,10 +1007,8 @@ void V4L2VideoDecodeAccelerator::ServiceDeviceTask(bool event_pending) {
|
| DCHECK(device_poll_thread_.message_loop());
|
| // Queue the DevicePollTask() now.
|
| device_poll_thread_.message_loop()->PostTask(
|
| - FROM_HERE,
|
| - base::Bind(&V4L2VideoDecodeAccelerator::DevicePollTask,
|
| - base::Unretained(this),
|
| - poll_device));
|
| + FROM_HERE, base::Bind(&V4L2VideoDecodeAccelerator::DevicePollTask,
|
| + base::Unretained(this), poll_device));
|
|
|
| DVLOG(1) << "ServiceDeviceTask(): buffer counts: DEC["
|
| << decoder_input_queue_.size() << "->"
|
| @@ -1123,7 +1115,7 @@ void V4L2VideoDecodeAccelerator::Dequeue() {
|
| struct v4l2_plane planes[1];
|
| memset(&dqbuf, 0, sizeof(dqbuf));
|
| memset(planes, 0, sizeof(planes));
|
| - dqbuf.type = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE;
|
| + dqbuf.type = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE;
|
| dqbuf.memory = V4L2_MEMORY_MMAP;
|
| dqbuf.m.planes = planes;
|
| dqbuf.length = 1;
|
| @@ -1154,7 +1146,7 @@ void V4L2VideoDecodeAccelerator::Dequeue() {
|
| new v4l2_plane[output_planes_count_]);
|
| memset(&dqbuf, 0, sizeof(dqbuf));
|
| memset(planes.get(), 0, sizeof(struct v4l2_plane) * output_planes_count_);
|
| - dqbuf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE;
|
| + dqbuf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE;
|
| dqbuf.memory = V4L2_MEMORY_MMAP;
|
| dqbuf.m.planes = planes.get();
|
| dqbuf.length = output_planes_count_;
|
| @@ -1231,19 +1223,19 @@ bool V4L2VideoDecodeAccelerator::EnqueueInputRecord() {
|
| struct v4l2_plane qbuf_plane;
|
| memset(&qbuf, 0, sizeof(qbuf));
|
| memset(&qbuf_plane, 0, sizeof(qbuf_plane));
|
| - qbuf.index = buffer;
|
| - qbuf.type = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE;
|
| - qbuf.timestamp.tv_sec = input_record.input_id;
|
| - qbuf.memory = V4L2_MEMORY_MMAP;
|
| - qbuf.m.planes = &qbuf_plane;
|
| + qbuf.index = buffer;
|
| + qbuf.type = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE;
|
| + qbuf.timestamp.tv_sec = input_record.input_id;
|
| + qbuf.memory = V4L2_MEMORY_MMAP;
|
| + qbuf.m.planes = &qbuf_plane;
|
| qbuf.m.planes[0].bytesused = input_record.bytes_used;
|
| - qbuf.length = 1;
|
| + qbuf.length = 1;
|
| IOCTL_OR_ERROR_RETURN_FALSE(VIDIOC_QBUF, &qbuf);
|
| input_ready_queue_.pop();
|
| input_record.at_device = true;
|
| input_buffer_queued_count_++;
|
| DVLOG(3) << "EnqueueInputRecord(): enqueued input_id="
|
| - << input_record.input_id << " size=" << input_record.bytes_used;
|
| + << input_record.input_id << " size=" << input_record.bytes_used;
|
| return true;
|
| }
|
|
|
| @@ -1279,11 +1271,11 @@ bool V4L2VideoDecodeAccelerator::EnqueueOutputRecord() {
|
| std::unique_ptr<struct v4l2_plane[]> qbuf_planes(
|
| new v4l2_plane[output_planes_count_]);
|
| memset(&qbuf, 0, sizeof(qbuf));
|
| - memset(
|
| - qbuf_planes.get(), 0, sizeof(struct v4l2_plane) * output_planes_count_);
|
| - qbuf.index = buffer;
|
| - qbuf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE;
|
| - qbuf.memory = V4L2_MEMORY_MMAP;
|
| + memset(qbuf_planes.get(), 0,
|
| + sizeof(struct v4l2_plane) * output_planes_count_);
|
| + qbuf.index = buffer;
|
| + qbuf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE;
|
| + qbuf.memory = V4L2_MEMORY_MMAP;
|
| qbuf.m.planes = qbuf_planes.get();
|
| qbuf.length = output_planes_count_;
|
| IOCTL_OR_ERROR_RETURN_FALSE(VIDIOC_QBUF, &qbuf);
|
| @@ -1479,8 +1471,9 @@ void V4L2VideoDecodeAccelerator::ResetTask() {
|
| // jobs will early-out in the kResetting state.
|
| decoder_state_ = kResetting;
|
| SendPictureReady(); // Send all pending PictureReady.
|
| - decoder_thread_.message_loop()->PostTask(FROM_HERE, base::Bind(
|
| - &V4L2VideoDecodeAccelerator::ResetDoneTask, base::Unretained(this)));
|
| + decoder_thread_.message_loop()->PostTask(
|
| + FROM_HERE, base::Bind(&V4L2VideoDecodeAccelerator::ResetDoneTask,
|
| + base::Unretained(this)));
|
| }
|
|
|
| void V4L2VideoDecodeAccelerator::ResetDoneTask() {
|
| @@ -1554,10 +1547,9 @@ bool V4L2VideoDecodeAccelerator::StartDevicePoll() {
|
| NOTIFY_ERROR(PLATFORM_FAILURE);
|
| return false;
|
| }
|
| - device_poll_thread_.message_loop()->PostTask(FROM_HERE, base::Bind(
|
| - &V4L2VideoDecodeAccelerator::DevicePollTask,
|
| - base::Unretained(this),
|
| - 0));
|
| + device_poll_thread_.message_loop()->PostTask(
|
| + FROM_HERE, base::Bind(&V4L2VideoDecodeAccelerator::DevicePollTask,
|
| + base::Unretained(this), 0));
|
|
|
| return true;
|
| }
|
| @@ -1715,9 +1707,9 @@ void V4L2VideoDecodeAccelerator::DevicePollTask(bool poll_device) {
|
|
|
| // All processing should happen on ServiceDeviceTask(), since we shouldn't
|
| // touch decoder state from this thread.
|
| - decoder_thread_.message_loop()->PostTask(FROM_HERE, base::Bind(
|
| - &V4L2VideoDecodeAccelerator::ServiceDeviceTask,
|
| - base::Unretained(this), event_pending));
|
| + decoder_thread_.message_loop()->PostTask(
|
| + FROM_HERE, base::Bind(&V4L2VideoDecodeAccelerator::ServiceDeviceTask,
|
| + base::Unretained(this), event_pending));
|
| }
|
|
|
| void V4L2VideoDecodeAccelerator::NotifyError(Error error) {
|
| @@ -1741,9 +1733,9 @@ void V4L2VideoDecodeAccelerator::SetErrorState(Error error) {
|
| // decoder thread isn't running.
|
| if (decoder_thread_.message_loop() != NULL &&
|
| decoder_thread_.message_loop() != base::MessageLoop::current()) {
|
| - decoder_thread_.message_loop()->PostTask(FROM_HERE, base::Bind(
|
| - &V4L2VideoDecodeAccelerator::SetErrorState,
|
| - base::Unretained(this), error));
|
| + decoder_thread_.message_loop()->PostTask(
|
| + FROM_HERE, base::Bind(&V4L2VideoDecodeAccelerator::SetErrorState,
|
| + base::Unretained(this), error));
|
| return;
|
| }
|
|
|
| @@ -1861,8 +1853,8 @@ bool V4L2VideoDecodeAccelerator::CreateInputBuffers() {
|
|
|
| struct v4l2_requestbuffers reqbufs;
|
| memset(&reqbufs, 0, sizeof(reqbufs));
|
| - reqbufs.count = kInputBufferCount;
|
| - reqbufs.type = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE;
|
| + reqbufs.count = kInputBufferCount;
|
| + reqbufs.type = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE;
|
| reqbufs.memory = V4L2_MEMORY_MMAP;
|
| IOCTL_OR_ERROR_RETURN_FALSE(VIDIOC_REQBUFS, &reqbufs);
|
| input_buffer_map_.resize(reqbufs.count);
|
| @@ -1874,17 +1866,15 @@ bool V4L2VideoDecodeAccelerator::CreateInputBuffers() {
|
| struct v4l2_buffer buffer;
|
| memset(&buffer, 0, sizeof(buffer));
|
| memset(planes, 0, sizeof(planes));
|
| - buffer.index = i;
|
| - buffer.type = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE;
|
| - buffer.memory = V4L2_MEMORY_MMAP;
|
| + buffer.index = i;
|
| + buffer.type = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE;
|
| + buffer.memory = V4L2_MEMORY_MMAP;
|
| buffer.m.planes = planes;
|
| - buffer.length = 1;
|
| + buffer.length = 1;
|
| IOCTL_OR_ERROR_RETURN_FALSE(VIDIOC_QUERYBUF, &buffer);
|
| - void* address = device_->Mmap(NULL,
|
| - buffer.m.planes[0].length,
|
| - PROT_READ | PROT_WRITE,
|
| - MAP_SHARED,
|
| - buffer.m.planes[0].m.mem_offset);
|
| + void* address =
|
| + device_->Mmap(NULL, buffer.m.planes[0].length, PROT_READ | PROT_WRITE,
|
| + MAP_SHARED, buffer.m.planes[0].m.mem_offset);
|
| if (address == MAP_FAILED) {
|
| PLOG(ERROR) << "CreateInputBuffers(): mmap() failed";
|
| return false;
|
| @@ -2158,9 +2148,9 @@ void V4L2VideoDecodeAccelerator::ResolutionChangeDestroyBuffers() {
|
| }
|
|
|
| // Finish resolution change on decoder thread.
|
| - decoder_thread_.message_loop()->PostTask(FROM_HERE, base::Bind(
|
| - &V4L2VideoDecodeAccelerator::FinishResolutionChange,
|
| - base::Unretained(this)));
|
| + decoder_thread_.message_loop()->PostTask(
|
| + FROM_HERE, base::Bind(&V4L2VideoDecodeAccelerator::FinishResolutionChange,
|
| + base::Unretained(this)));
|
| }
|
|
|
| void V4L2VideoDecodeAccelerator::SendPictureReady() {
|
| @@ -2258,4 +2248,4 @@ void V4L2VideoDecodeAccelerator::ImageProcessorError() {
|
| NOTIFY_ERROR(PLATFORM_FAILURE);
|
| }
|
|
|
| -} // namespace content
|
| +} // namespace media
|
|
|