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 92% |
rename from content/common/gpu/media/v4l2_video_decode_accelerator.cc |
rename to media/gpu/v4l2_video_decode_accelerator.cc |
index 51104159ecc5e8059c98e9ef70c1508d4c8c0f7e..364709c22ce618982255b84bc28f842991accf93 100644 |
--- a/content/common/gpu/media/v4l2_video_decode_accelerator.cc |
+++ b/media/gpu/v4l2_video_decode_accelerator.cc |
@@ -20,10 +20,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 "content/common/gpu/media/v4l2_video_decode_accelerator.h" |
#include "media/base/media_switches.h" |
#include "media/filters/h264_parser.h" |
+#include "media/gpu/shared_memory_region.h" |
+#include "media/gpu/v4l2_video_decode_accelerator.h" |
#include "ui/gfx/geometry/rect.h" |
#include "ui/gl/gl_context.h" |
#include "ui/gl/scoped_binders.h" |
@@ -34,13 +34,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) \ |
@@ -49,13 +49,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_[] = { |
@@ -109,11 +109,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 |
@@ -124,15 +122,9 @@ 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() |
: at_device(false), |
@@ -140,8 +132,7 @@ V4L2VideoDecodeAccelerator::OutputRecord::OutputRecord() |
egl_image(EGL_NO_IMAGE_KHR), |
egl_sync(EGL_NO_SYNC_KHR), |
picture_id(-1), |
- cleared(false) { |
-} |
+ cleared(false) {} |
V4L2VideoDecodeAccelerator::OutputRecord::~OutputRecord() {} |
@@ -260,7 +251,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; |
} |
@@ -290,10 +282,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; |
} |
@@ -313,9 +304,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( |
@@ -328,8 +319,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; |
} |
@@ -349,8 +340,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); |
@@ -421,23 +412,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() { |
@@ -450,8 +444,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(); |
@@ -734,14 +729,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); |
@@ -790,8 +786,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); |
@@ -802,8 +798,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); |
@@ -853,8 +849,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); |
@@ -878,8 +873,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); |
@@ -950,21 +944,16 @@ 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() << "->" |
- << input_ready_queue_.size() << "] => DEVICE[" |
- << free_input_buffers_.size() << "+" |
- << input_buffer_queued_count_ << "/" |
- << input_buffer_map_.size() << "->" |
- << free_output_buffers_.size() << "+" |
- << output_buffer_queued_count_ << "/" |
- << output_buffer_map_.size() << "] => VDA[" |
- << decoder_frames_at_client_ << "]"; |
+ << decoder_input_queue_.size() << "->" << input_ready_queue_.size() |
+ << "] => DEVICE[" << free_input_buffers_.size() << "+" |
+ << input_buffer_queued_count_ << "/" << input_buffer_map_.size() |
+ << "->" << free_output_buffers_.size() << "+" |
+ << output_buffer_queued_count_ << "/" << output_buffer_map_.size() |
+ << "] => VDA[" << decoder_frames_at_client_ << "]"; |
ScheduleDecodeBufferTaskIfNeeded(); |
if (resolution_change_pending) |
@@ -1059,7 +1048,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; |
@@ -1090,7 +1079,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_; |
@@ -1144,19 +1133,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; |
} |
@@ -1193,11 +1182,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); |
@@ -1386,8 +1375,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() { |
@@ -1461,10 +1451,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; |
} |
@@ -1624,9 +1613,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) { |
@@ -1650,9 +1639,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; |
} |
@@ -1705,8 +1694,8 @@ bool V4L2VideoDecodeAccelerator::CreateBuffersForFormat( |
coded_size_.SetSize(format.fmt.pix_mp.width, format.fmt.pix_mp.height); |
visible_size_ = visible_size; |
DVLOG(3) << "CreateBuffersForFormat(): new resolution: " |
- << coded_size_.ToString() << ", visible size: " |
- << visible_size_.ToString(); |
+ << coded_size_.ToString() |
+ << ", visible size: " << visible_size_.ToString(); |
return CreateOutputBuffers(); |
} |
@@ -1756,8 +1745,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); |
@@ -1769,17 +1758,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; |
@@ -1993,9 +1980,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() { |
@@ -2049,4 +2036,4 @@ void V4L2VideoDecodeAccelerator::PictureCleared() { |
SendPictureReady(); |
} |
-} // namespace content |
+} // namespace media |