| Index: content/common/gpu/media/v4l2_video_decode_accelerator.cc
|
| diff --git a/content/common/gpu/media/exynos_video_decode_accelerator.cc b/content/common/gpu/media/v4l2_video_decode_accelerator.cc
|
| similarity index 92%
|
| rename from content/common/gpu/media/exynos_video_decode_accelerator.cc
|
| rename to content/common/gpu/media/v4l2_video_decode_accelerator.cc
|
| index 95c875d61cba4e1af468debdbb248f8af72770ba..c6cbcdd594e4e77c16d912591c429f8d14435a26 100644
|
| --- a/content/common/gpu/media/exynos_video_decode_accelerator.cc
|
| +++ b/content/common/gpu/media/v4l2_video_decode_accelerator.cc
|
| @@ -18,8 +18,8 @@
|
| #include "base/message_loop/message_loop.h"
|
| #include "base/message_loop/message_loop_proxy.h"
|
| #include "base/posix/eintr_wrapper.h"
|
| -#include "content/common/gpu/media/exynos_video_decode_accelerator.h"
|
| #include "content/common/gpu/media/h264_parser.h"
|
| +#include "content/common/gpu/media/v4l2_video_decode_accelerator.h"
|
| #include "ui/gl/scoped_binders.h"
|
|
|
| namespace content {
|
| @@ -60,7 +60,7 @@ const char kExynosMfcDevice[] = "/dev/mfc-dec";
|
|
|
| } // anonymous namespace
|
|
|
| -struct ExynosVideoDecodeAccelerator::BitstreamBufferRef {
|
| +struct V4l2VideoDecodeAccelerator::BitstreamBufferRef {
|
| BitstreamBufferRef(
|
| base::WeakPtr<Client>& client,
|
| scoped_refptr<base::MessageLoopProxy>& client_message_loop_proxy,
|
| @@ -76,7 +76,7 @@ struct ExynosVideoDecodeAccelerator::BitstreamBufferRef {
|
| const int32 input_id;
|
| };
|
|
|
| -struct ExynosVideoDecodeAccelerator::PictureBufferArrayRef {
|
| +struct V4l2VideoDecodeAccelerator::PictureBufferArrayRef {
|
| PictureBufferArrayRef(EGLDisplay egl_display);
|
| ~PictureBufferArrayRef();
|
|
|
| @@ -91,21 +91,21 @@ struct ExynosVideoDecodeAccelerator::PictureBufferArrayRef {
|
| std::vector<PictureBufferRef> picture_buffers;
|
| };
|
|
|
| -struct ExynosVideoDecodeAccelerator::EGLSyncKHRRef {
|
| +struct V4l2VideoDecodeAccelerator::EGLSyncKHRRef {
|
| EGLSyncKHRRef(EGLDisplay egl_display, EGLSyncKHR egl_sync);
|
| ~EGLSyncKHRRef();
|
| EGLDisplay const egl_display;
|
| EGLSyncKHR egl_sync;
|
| };
|
|
|
| -struct ExynosVideoDecodeAccelerator::PictureRecord {
|
| +struct V4l2VideoDecodeAccelerator::PictureRecord {
|
| PictureRecord(bool cleared, const media::Picture& picture);
|
| ~PictureRecord();
|
| bool cleared; // Whether the texture is cleared and safe to render from.
|
| media::Picture picture; // The decoded picture.
|
| };
|
|
|
| -ExynosVideoDecodeAccelerator::BitstreamBufferRef::BitstreamBufferRef(
|
| +V4l2VideoDecodeAccelerator::BitstreamBufferRef::BitstreamBufferRef(
|
| base::WeakPtr<Client>& client,
|
| scoped_refptr<base::MessageLoopProxy>& client_message_loop_proxy,
|
| base::SharedMemory* shm, size_t size, int32 input_id)
|
| @@ -117,18 +117,18 @@ ExynosVideoDecodeAccelerator::BitstreamBufferRef::BitstreamBufferRef(
|
| input_id(input_id) {
|
| }
|
|
|
| -ExynosVideoDecodeAccelerator::BitstreamBufferRef::~BitstreamBufferRef() {
|
| +V4l2VideoDecodeAccelerator::BitstreamBufferRef::~BitstreamBufferRef() {
|
| if (input_id >= 0) {
|
| client_message_loop_proxy->PostTask(FROM_HERE, base::Bind(
|
| &Client::NotifyEndOfBitstreamBuffer, client, input_id));
|
| }
|
| }
|
|
|
| -ExynosVideoDecodeAccelerator::PictureBufferArrayRef::PictureBufferArrayRef(
|
| +V4l2VideoDecodeAccelerator::PictureBufferArrayRef::PictureBufferArrayRef(
|
| EGLDisplay egl_display)
|
| : egl_display(egl_display) {}
|
|
|
| -ExynosVideoDecodeAccelerator::PictureBufferArrayRef::~PictureBufferArrayRef() {
|
| +V4l2VideoDecodeAccelerator::PictureBufferArrayRef::~PictureBufferArrayRef() {
|
| for (size_t i = 0; i < picture_buffers.size(); ++i) {
|
| EGLImageKHR egl_image = picture_buffers[i].egl_image;
|
| if (egl_image != EGL_NO_IMAGE_KHR)
|
| @@ -136,18 +136,18 @@ ExynosVideoDecodeAccelerator::PictureBufferArrayRef::~PictureBufferArrayRef() {
|
| }
|
| }
|
|
|
| -ExynosVideoDecodeAccelerator::EGLSyncKHRRef::EGLSyncKHRRef(
|
| +V4l2VideoDecodeAccelerator::EGLSyncKHRRef::EGLSyncKHRRef(
|
| EGLDisplay egl_display, EGLSyncKHR egl_sync)
|
| : egl_display(egl_display),
|
| egl_sync(egl_sync) {
|
| }
|
|
|
| -ExynosVideoDecodeAccelerator::EGLSyncKHRRef::~EGLSyncKHRRef() {
|
| +V4l2VideoDecodeAccelerator::EGLSyncKHRRef::~EGLSyncKHRRef() {
|
| if (egl_sync != EGL_NO_SYNC_KHR)
|
| eglDestroySyncKHR(egl_display, egl_sync);
|
| }
|
|
|
| -ExynosVideoDecodeAccelerator::MfcInputRecord::MfcInputRecord()
|
| +V4l2VideoDecodeAccelerator::MfcInputRecord::MfcInputRecord()
|
| : at_device(false),
|
| address(NULL),
|
| length(0),
|
| @@ -155,10 +155,10 @@ ExynosVideoDecodeAccelerator::MfcInputRecord::MfcInputRecord()
|
| input_id(-1) {
|
| }
|
|
|
| -ExynosVideoDecodeAccelerator::MfcInputRecord::~MfcInputRecord() {
|
| +V4l2VideoDecodeAccelerator::MfcInputRecord::~MfcInputRecord() {
|
| }
|
|
|
| -ExynosVideoDecodeAccelerator::MfcOutputRecord::MfcOutputRecord()
|
| +V4l2VideoDecodeAccelerator::MfcOutputRecord::MfcOutputRecord()
|
| : at_device(false),
|
| at_client(false),
|
| egl_image(EGL_NO_IMAGE_KHR),
|
| @@ -169,16 +169,16 @@ ExynosVideoDecodeAccelerator::MfcOutputRecord::MfcOutputRecord()
|
| fds[i] = -1;
|
| }
|
|
|
| -ExynosVideoDecodeAccelerator::MfcOutputRecord::~MfcOutputRecord() {}
|
| +V4l2VideoDecodeAccelerator::MfcOutputRecord::~MfcOutputRecord() {}
|
|
|
| -ExynosVideoDecodeAccelerator::PictureRecord::PictureRecord(
|
| +V4l2VideoDecodeAccelerator::PictureRecord::PictureRecord(
|
| bool cleared,
|
| const media::Picture& picture)
|
| : cleared(cleared), picture(picture) {}
|
|
|
| -ExynosVideoDecodeAccelerator::PictureRecord::~PictureRecord() {}
|
| +V4l2VideoDecodeAccelerator::PictureRecord::~PictureRecord() {}
|
|
|
| -ExynosVideoDecodeAccelerator::ExynosVideoDecodeAccelerator(
|
| +V4l2VideoDecodeAccelerator::V4l2VideoDecodeAccelerator(
|
| EGLDisplay egl_display,
|
| Client* client,
|
| const base::WeakPtr<Client>& io_client,
|
| @@ -214,7 +214,7 @@ ExynosVideoDecodeAccelerator::ExynosVideoDecodeAccelerator(
|
| egl_display_(egl_display),
|
| video_profile_(media::VIDEO_CODEC_PROFILE_UNKNOWN) {}
|
|
|
| -ExynosVideoDecodeAccelerator::~ExynosVideoDecodeAccelerator() {
|
| +V4l2VideoDecodeAccelerator::~V4l2VideoDecodeAccelerator() {
|
| DCHECK(!decoder_thread_.IsRunning());
|
| DCHECK(!device_poll_thread_.IsRunning());
|
|
|
| @@ -235,7 +235,7 @@ ExynosVideoDecodeAccelerator::~ExynosVideoDecodeAccelerator() {
|
| DCHECK(mfc_output_buffer_map_.empty());
|
| }
|
|
|
| -bool ExynosVideoDecodeAccelerator::Initialize(
|
| +bool V4l2VideoDecodeAccelerator::Initialize(
|
| media::VideoCodecProfile profile) {
|
| DVLOG(3) << "Initialize()";
|
| DCHECK(child_message_loop_proxy_->BelongsToCurrentThread());
|
| @@ -348,7 +348,7 @@ bool ExynosVideoDecodeAccelerator::Initialize(
|
| return true;
|
| }
|
|
|
| -void ExynosVideoDecodeAccelerator::Decode(
|
| +void V4l2VideoDecodeAccelerator::Decode(
|
| const media::BitstreamBuffer& bitstream_buffer) {
|
| DVLOG(1) << "Decode(): input_id=" << bitstream_buffer.id()
|
| << ", size=" << bitstream_buffer.size();
|
| @@ -356,11 +356,11 @@ void ExynosVideoDecodeAccelerator::Decode(
|
|
|
| // DecodeTask() will take care of running a DecodeBufferTask().
|
| decoder_thread_.message_loop()->PostTask(FROM_HERE, base::Bind(
|
| - &ExynosVideoDecodeAccelerator::DecodeTask, base::Unretained(this),
|
| + &V4l2VideoDecodeAccelerator::DecodeTask, base::Unretained(this),
|
| bitstream_buffer));
|
| }
|
|
|
| -void ExynosVideoDecodeAccelerator::AssignPictureBuffers(
|
| +void V4l2VideoDecodeAccelerator::AssignPictureBuffers(
|
| const std::vector<media::PictureBuffer>& buffers) {
|
| DVLOG(3) << "AssignPictureBuffers(): buffer_count=" << buffers.size();
|
| DCHECK(child_message_loop_proxy_->BelongsToCurrentThread());
|
| @@ -415,12 +415,12 @@ void ExynosVideoDecodeAccelerator::AssignPictureBuffers(
|
| }
|
| decoder_thread_.message_loop()->PostTask(
|
| FROM_HERE,
|
| - base::Bind(&ExynosVideoDecodeAccelerator::AssignPictureBuffersTask,
|
| + base::Bind(&V4l2VideoDecodeAccelerator::AssignPictureBuffersTask,
|
| base::Unretained(this),
|
| base::Passed(&picture_buffers_ref)));
|
| }
|
|
|
| -void ExynosVideoDecodeAccelerator::ReusePictureBuffer(int32 picture_buffer_id) {
|
| +void V4l2VideoDecodeAccelerator::ReusePictureBuffer(int32 picture_buffer_id) {
|
| DVLOG(3) << "ReusePictureBuffer(): picture_buffer_id=" << picture_buffer_id;
|
| // Must be run on child thread, as we'll insert a sync in the EGL context.
|
| DCHECK(child_message_loop_proxy_->BelongsToCurrentThread());
|
| @@ -442,25 +442,25 @@ void ExynosVideoDecodeAccelerator::ReusePictureBuffer(int32 picture_buffer_id) {
|
| scoped_ptr<EGLSyncKHRRef> egl_sync_ref(new EGLSyncKHRRef(
|
| egl_display_, egl_sync));
|
| decoder_thread_.message_loop()->PostTask(FROM_HERE, base::Bind(
|
| - &ExynosVideoDecodeAccelerator::ReusePictureBufferTask,
|
| + &V4l2VideoDecodeAccelerator::ReusePictureBufferTask,
|
| base::Unretained(this), picture_buffer_id, base::Passed(&egl_sync_ref)));
|
| }
|
|
|
| -void ExynosVideoDecodeAccelerator::Flush() {
|
| +void V4l2VideoDecodeAccelerator::Flush() {
|
| DVLOG(3) << "Flush()";
|
| DCHECK(child_message_loop_proxy_->BelongsToCurrentThread());
|
| decoder_thread_.message_loop()->PostTask(FROM_HERE, base::Bind(
|
| - &ExynosVideoDecodeAccelerator::FlushTask, base::Unretained(this)));
|
| + &V4l2VideoDecodeAccelerator::FlushTask, base::Unretained(this)));
|
| }
|
|
|
| -void ExynosVideoDecodeAccelerator::Reset() {
|
| +void V4l2VideoDecodeAccelerator::Reset() {
|
| DVLOG(3) << "Reset()";
|
| DCHECK(child_message_loop_proxy_->BelongsToCurrentThread());
|
| decoder_thread_.message_loop()->PostTask(FROM_HERE, base::Bind(
|
| - &ExynosVideoDecodeAccelerator::ResetTask, base::Unretained(this)));
|
| + &V4l2VideoDecodeAccelerator::ResetTask, base::Unretained(this)));
|
| }
|
|
|
| -void ExynosVideoDecodeAccelerator::Destroy() {
|
| +void V4l2VideoDecodeAccelerator::Destroy() {
|
| DVLOG(3) << "Destroy()";
|
| DCHECK(child_message_loop_proxy_->BelongsToCurrentThread());
|
|
|
| @@ -470,7 +470,7 @@ void ExynosVideoDecodeAccelerator::Destroy() {
|
| // If the decoder thread is running, destroy using posted task.
|
| if (decoder_thread_.IsRunning()) {
|
| decoder_thread_.message_loop()->PostTask(FROM_HERE, base::Bind(
|
| - &ExynosVideoDecodeAccelerator::DestroyTask, base::Unretained(this)));
|
| + &V4l2VideoDecodeAccelerator::DestroyTask, base::Unretained(this)));
|
| // DestroyTask() will cause the decoder_thread_ to flush all tasks.
|
| decoder_thread_.Stop();
|
| } else {
|
| @@ -484,9 +484,9 @@ void ExynosVideoDecodeAccelerator::Destroy() {
|
| delete this;
|
| }
|
|
|
| -bool ExynosVideoDecodeAccelerator::CanDecodeOnIOThread() { return true; }
|
| +bool V4l2VideoDecodeAccelerator::CanDecodeOnIOThread() { return true; }
|
|
|
| -void ExynosVideoDecodeAccelerator::DecodeTask(
|
| +void V4l2VideoDecodeAccelerator::DecodeTask(
|
| const media::BitstreamBuffer& bitstream_buffer) {
|
| DVLOG(3) << "DecodeTask(): input_id=" << bitstream_buffer.id();
|
| DCHECK_EQ(decoder_thread_.message_loop(), base::MessageLoop::current());
|
| @@ -524,7 +524,7 @@ void ExynosVideoDecodeAccelerator::DecodeTask(
|
| DecodeBufferTask();
|
| }
|
|
|
| -void ExynosVideoDecodeAccelerator::DecodeBufferTask() {
|
| +void V4l2VideoDecodeAccelerator::DecodeBufferTask() {
|
| DVLOG(3) << "DecodeBufferTask()";
|
| DCHECK_EQ(decoder_thread_.message_loop(), base::MessageLoop::current());
|
| DCHECK_NE(decoder_state_, kUninitialized);
|
| @@ -645,7 +645,7 @@ void ExynosVideoDecodeAccelerator::DecodeBufferTask() {
|
| }
|
| }
|
|
|
| -bool ExynosVideoDecodeAccelerator::AdvanceFrameFragment(
|
| +bool V4l2VideoDecodeAccelerator::AdvanceFrameFragment(
|
| const uint8* data,
|
| size_t size,
|
| size_t* endpos) {
|
| @@ -725,7 +725,7 @@ bool ExynosVideoDecodeAccelerator::AdvanceFrameFragment(
|
| }
|
| }
|
|
|
| -void ExynosVideoDecodeAccelerator::ScheduleDecodeBufferTaskIfNeeded() {
|
| +void V4l2VideoDecodeAccelerator::ScheduleDecodeBufferTaskIfNeeded() {
|
| DCHECK_EQ(decoder_thread_.message_loop(), base::MessageLoop::current());
|
|
|
| // If we're behind on tasks, schedule another one.
|
| @@ -735,12 +735,12 @@ void ExynosVideoDecodeAccelerator::ScheduleDecodeBufferTaskIfNeeded() {
|
| if (decoder_decode_buffer_tasks_scheduled_ < buffers_to_decode) {
|
| decoder_decode_buffer_tasks_scheduled_++;
|
| decoder_thread_.message_loop()->PostTask(FROM_HERE, base::Bind(
|
| - &ExynosVideoDecodeAccelerator::DecodeBufferTask,
|
| + &V4l2VideoDecodeAccelerator::DecodeBufferTask,
|
| base::Unretained(this)));
|
| }
|
| }
|
|
|
| -bool ExynosVideoDecodeAccelerator::DecodeBufferInitial(
|
| +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());
|
| @@ -801,7 +801,7 @@ bool ExynosVideoDecodeAccelerator::DecodeBufferInitial(
|
| return true;
|
| }
|
|
|
| -bool ExynosVideoDecodeAccelerator::DecodeBufferContinue(
|
| +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());
|
| @@ -813,7 +813,7 @@ bool ExynosVideoDecodeAccelerator::DecodeBufferContinue(
|
| (decoder_partial_frame_pending_ || FlushInputFrame()));
|
| }
|
|
|
| -bool ExynosVideoDecodeAccelerator::AppendToInputFrame(
|
| +bool V4l2VideoDecodeAccelerator::AppendToInputFrame(
|
| const void* data, size_t size) {
|
| DVLOG(3) << "AppendToInputFrame()";
|
| DCHECK_EQ(decoder_thread_.message_loop(), base::MessageLoop::current());
|
| @@ -880,7 +880,7 @@ bool ExynosVideoDecodeAccelerator::AppendToInputFrame(
|
| return true;
|
| }
|
|
|
| -bool ExynosVideoDecodeAccelerator::FlushInputFrame() {
|
| +bool V4l2VideoDecodeAccelerator::FlushInputFrame() {
|
| DVLOG(3) << "FlushInputFrame()";
|
| DCHECK_EQ(decoder_thread_.message_loop(), base::MessageLoop::current());
|
| DCHECK_NE(decoder_state_, kUninitialized);
|
| @@ -918,7 +918,7 @@ bool ExynosVideoDecodeAccelerator::FlushInputFrame() {
|
| return (decoder_state_ != kError);
|
| }
|
|
|
| -void ExynosVideoDecodeAccelerator::AssignPictureBuffersTask(
|
| +void V4l2VideoDecodeAccelerator::AssignPictureBuffersTask(
|
| scoped_ptr<PictureBufferArrayRef> pic_buffers) {
|
| DVLOG(3) << "AssignPictureBuffersTask()";
|
| DCHECK_EQ(decoder_thread_.message_loop(), base::MessageLoop::current());
|
| @@ -958,7 +958,7 @@ void ExynosVideoDecodeAccelerator::AssignPictureBuffersTask(
|
| ResumeAfterResolutionChange();
|
| }
|
|
|
| -void ExynosVideoDecodeAccelerator::ServiceDeviceTask(bool mfc_event_pending) {
|
| +void V4l2VideoDecodeAccelerator::ServiceDeviceTask(bool mfc_event_pending) {
|
| DVLOG(3) << "ServiceDeviceTask()";
|
| DCHECK_EQ(decoder_thread_.message_loop(), base::MessageLoop::current());
|
| DCHECK_NE(decoder_state_, kUninitialized);
|
| @@ -1001,7 +1001,7 @@ void ExynosVideoDecodeAccelerator::ServiceDeviceTask(bool mfc_event_pending) {
|
| DCHECK(device_poll_thread_.message_loop());
|
| // Queue the DevicePollTask() now.
|
| device_poll_thread_.message_loop()->PostTask(FROM_HERE, base::Bind(
|
| - &ExynosVideoDecodeAccelerator::DevicePollTask,
|
| + &V4l2VideoDecodeAccelerator::DevicePollTask,
|
| base::Unretained(this),
|
| poll_fds));
|
|
|
| @@ -1020,7 +1020,7 @@ void ExynosVideoDecodeAccelerator::ServiceDeviceTask(bool mfc_event_pending) {
|
| StartResolutionChangeIfNeeded();
|
| }
|
|
|
| -void ExynosVideoDecodeAccelerator::EnqueueMfc() {
|
| +void V4l2VideoDecodeAccelerator::EnqueueMfc() {
|
| DVLOG(3) << "EnqueueMfc()";
|
| DCHECK_EQ(decoder_thread_.message_loop(), base::MessageLoop::current());
|
| DCHECK_NE(decoder_state_, kUninitialized);
|
| @@ -1065,7 +1065,7 @@ void ExynosVideoDecodeAccelerator::EnqueueMfc() {
|
| }
|
| }
|
|
|
| -void ExynosVideoDecodeAccelerator::DequeueMfcEvents() {
|
| +void V4l2VideoDecodeAccelerator::DequeueMfcEvents() {
|
| DCHECK_EQ(decoder_thread_.message_loop(), base::MessageLoop::current());
|
| DCHECK_NE(decoder_state_, kUninitialized);
|
| DVLOG(3) << "DequeueMfcEvents()";
|
| @@ -1085,7 +1085,7 @@ void ExynosVideoDecodeAccelerator::DequeueMfcEvents() {
|
| }
|
| }
|
|
|
| -void ExynosVideoDecodeAccelerator::DequeueMfc() {
|
| +void V4l2VideoDecodeAccelerator::DequeueMfc() {
|
| DVLOG(3) << "DequeueMfc()";
|
| DCHECK_EQ(decoder_thread_.message_loop(), base::MessageLoop::current());
|
| DCHECK_NE(decoder_state_, kUninitialized);
|
| @@ -1168,7 +1168,7 @@ void ExynosVideoDecodeAccelerator::DequeueMfc() {
|
| NotifyFlushDoneIfNeeded();
|
| }
|
|
|
| -bool ExynosVideoDecodeAccelerator::EnqueueMfcInputRecord() {
|
| +bool V4l2VideoDecodeAccelerator::EnqueueMfcInputRecord() {
|
| DVLOG(3) << "EnqueueMfcInputRecord()";
|
| DCHECK(!mfc_input_ready_queue_.empty());
|
|
|
| @@ -1196,7 +1196,7 @@ bool ExynosVideoDecodeAccelerator::EnqueueMfcInputRecord() {
|
| return true;
|
| }
|
|
|
| -bool ExynosVideoDecodeAccelerator::EnqueueMfcOutputRecord() {
|
| +bool V4l2VideoDecodeAccelerator::EnqueueMfcOutputRecord() {
|
| DVLOG(3) << "EnqueueMfcOutputRecord()";
|
| DCHECK(!mfc_free_output_buffers_.empty());
|
|
|
| @@ -1234,7 +1234,7 @@ bool ExynosVideoDecodeAccelerator::EnqueueMfcOutputRecord() {
|
| return true;
|
| }
|
|
|
| -void ExynosVideoDecodeAccelerator::ReusePictureBufferTask(
|
| +void V4l2VideoDecodeAccelerator::ReusePictureBufferTask(
|
| int32 picture_buffer_id, scoped_ptr<EGLSyncKHRRef> egl_sync_ref) {
|
| DVLOG(3) << "ReusePictureBufferTask(): picture_buffer_id="
|
| << picture_buffer_id;
|
| @@ -1281,7 +1281,7 @@ void ExynosVideoDecodeAccelerator::ReusePictureBufferTask(
|
| EnqueueMfc();
|
| }
|
|
|
| -void ExynosVideoDecodeAccelerator::FlushTask() {
|
| +void V4l2VideoDecodeAccelerator::FlushTask() {
|
| DVLOG(3) << "FlushTask()";
|
| DCHECK_EQ(decoder_thread_.message_loop(), base::MessageLoop::current());
|
| TRACE_EVENT0("Video Decoder", "EVDA::FlushTask");
|
| @@ -1311,7 +1311,7 @@ void ExynosVideoDecodeAccelerator::FlushTask() {
|
| ScheduleDecodeBufferTaskIfNeeded();
|
| }
|
|
|
| -void ExynosVideoDecodeAccelerator::NotifyFlushDoneIfNeeded() {
|
| +void V4l2VideoDecodeAccelerator::NotifyFlushDoneIfNeeded() {
|
| if (!decoder_flushing_)
|
| return;
|
|
|
| @@ -1355,7 +1355,7 @@ void ExynosVideoDecodeAccelerator::NotifyFlushDoneIfNeeded() {
|
| ScheduleDecodeBufferTaskIfNeeded();
|
| }
|
|
|
| -void ExynosVideoDecodeAccelerator::ResetTask() {
|
| +void V4l2VideoDecodeAccelerator::ResetTask() {
|
| DVLOG(3) << "ResetTask()";
|
| DCHECK_EQ(decoder_thread_.message_loop(), base::MessageLoop::current());
|
| TRACE_EVENT0("Video Decoder", "EVDA::ResetTask");
|
| @@ -1396,10 +1396,10 @@ void ExynosVideoDecodeAccelerator::ResetTask() {
|
| decoder_state_ = kResetting;
|
| SendPictureReady(); // Send all pending PictureReady.
|
| decoder_thread_.message_loop()->PostTask(FROM_HERE, base::Bind(
|
| - &ExynosVideoDecodeAccelerator::ResetDoneTask, base::Unretained(this)));
|
| + &V4l2VideoDecodeAccelerator::ResetDoneTask, base::Unretained(this)));
|
| }
|
|
|
| -void ExynosVideoDecodeAccelerator::ResetDoneTask() {
|
| +void V4l2VideoDecodeAccelerator::ResetDoneTask() {
|
| DVLOG(3) << "ResetDoneTask()";
|
| DCHECK_EQ(decoder_thread_.message_loop(), base::MessageLoop::current());
|
| TRACE_EVENT0("Video Decoder", "EVDA::ResetDoneTask");
|
| @@ -1433,7 +1433,7 @@ void ExynosVideoDecodeAccelerator::ResetDoneTask() {
|
| ScheduleDecodeBufferTaskIfNeeded();
|
| }
|
|
|
| -void ExynosVideoDecodeAccelerator::DestroyTask() {
|
| +void V4l2VideoDecodeAccelerator::DestroyTask() {
|
| DVLOG(3) << "DestroyTask()";
|
| TRACE_EVENT0("Video Decoder", "EVDA::DestroyTask");
|
|
|
| @@ -1454,7 +1454,7 @@ void ExynosVideoDecodeAccelerator::DestroyTask() {
|
| decoder_state_ = kError;
|
| }
|
|
|
| -bool ExynosVideoDecodeAccelerator::StartDevicePoll() {
|
| +bool V4l2VideoDecodeAccelerator::StartDevicePoll() {
|
| DVLOG(3) << "StartDevicePoll()";
|
| DCHECK_EQ(decoder_thread_.message_loop(), base::MessageLoop::current());
|
| DCHECK(!device_poll_thread_.IsRunning());
|
| @@ -1466,14 +1466,14 @@ bool ExynosVideoDecodeAccelerator::StartDevicePoll() {
|
| return false;
|
| }
|
| device_poll_thread_.message_loop()->PostTask(FROM_HERE, base::Bind(
|
| - &ExynosVideoDecodeAccelerator::DevicePollTask,
|
| + &V4l2VideoDecodeAccelerator::DevicePollTask,
|
| base::Unretained(this),
|
| 0));
|
|
|
| return true;
|
| }
|
|
|
| -bool ExynosVideoDecodeAccelerator::StopDevicePoll(bool keep_mfc_input_state) {
|
| +bool V4l2VideoDecodeAccelerator::StopDevicePoll(bool keep_mfc_input_state) {
|
| DVLOG(3) << "StopDevicePoll()";
|
| if (decoder_thread_.IsRunning())
|
| DCHECK_EQ(decoder_thread_.message_loop(), base::MessageLoop::current());
|
| @@ -1530,7 +1530,7 @@ bool ExynosVideoDecodeAccelerator::StopDevicePoll(bool keep_mfc_input_state) {
|
| return true;
|
| }
|
|
|
| -bool ExynosVideoDecodeAccelerator::SetDevicePollInterrupt() {
|
| +bool V4l2VideoDecodeAccelerator::SetDevicePollInterrupt() {
|
| DVLOG(3) << "SetDevicePollInterrupt()";
|
| DCHECK_EQ(decoder_thread_.message_loop(), base::MessageLoop::current());
|
|
|
| @@ -1543,7 +1543,7 @@ bool ExynosVideoDecodeAccelerator::SetDevicePollInterrupt() {
|
| return true;
|
| }
|
|
|
| -bool ExynosVideoDecodeAccelerator::ClearDevicePollInterrupt() {
|
| +bool V4l2VideoDecodeAccelerator::ClearDevicePollInterrupt() {
|
| DVLOG(3) << "ClearDevicePollInterrupt()";
|
| DCHECK_EQ(decoder_thread_.message_loop(), base::MessageLoop::current());
|
|
|
| @@ -1561,7 +1561,7 @@ bool ExynosVideoDecodeAccelerator::ClearDevicePollInterrupt() {
|
| return true;
|
| }
|
|
|
| -void ExynosVideoDecodeAccelerator::StartResolutionChangeIfNeeded() {
|
| +void V4l2VideoDecodeAccelerator::StartResolutionChangeIfNeeded() {
|
| DCHECK_EQ(decoder_thread_.message_loop(), base::MessageLoop::current());
|
| DCHECK_EQ(decoder_state_, kDecoding);
|
|
|
| @@ -1581,11 +1581,11 @@ void ExynosVideoDecodeAccelerator::StartResolutionChangeIfNeeded() {
|
| // Post a task to clean up buffers on child thread. This will also ensure
|
| // that we won't accept ReusePictureBuffer() anymore after that.
|
| child_message_loop_proxy_->PostTask(FROM_HERE, base::Bind(
|
| - &ExynosVideoDecodeAccelerator::ResolutionChangeDestroyBuffers,
|
| + &V4l2VideoDecodeAccelerator::ResolutionChangeDestroyBuffers,
|
| weak_this_));
|
| }
|
|
|
| -void ExynosVideoDecodeAccelerator::FinishResolutionChange() {
|
| +void V4l2VideoDecodeAccelerator::FinishResolutionChange() {
|
| DCHECK_EQ(decoder_thread_.message_loop(), base::MessageLoop::current());
|
| DVLOG(3) << "FinishResolutionChange()";
|
|
|
| @@ -1613,7 +1613,7 @@ void ExynosVideoDecodeAccelerator::FinishResolutionChange() {
|
| // AssignPictureBuffers() before we can resume.
|
| }
|
|
|
| -void ExynosVideoDecodeAccelerator::ResumeAfterResolutionChange() {
|
| +void V4l2VideoDecodeAccelerator::ResumeAfterResolutionChange() {
|
| DCHECK_EQ(decoder_thread_.message_loop(), base::MessageLoop::current());
|
| DVLOG(3) << "ResumeAfterResolutionChange()";
|
|
|
| @@ -1632,7 +1632,7 @@ void ExynosVideoDecodeAccelerator::ResumeAfterResolutionChange() {
|
| ScheduleDecodeBufferTaskIfNeeded();
|
| }
|
|
|
| -void ExynosVideoDecodeAccelerator::DevicePollTask(unsigned int poll_fds) {
|
| +void V4l2VideoDecodeAccelerator::DevicePollTask(unsigned int poll_fds) {
|
| DVLOG(3) << "DevicePollTask()";
|
| DCHECK_EQ(device_poll_thread_.message_loop(), base::MessageLoop::current());
|
| TRACE_EVENT0("Video Decoder", "EVDA::DevicePollTask");
|
| @@ -1671,16 +1671,16 @@ void ExynosVideoDecodeAccelerator::DevicePollTask(unsigned int poll_fds) {
|
| // 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(
|
| - &ExynosVideoDecodeAccelerator::ServiceDeviceTask,
|
| + &V4l2VideoDecodeAccelerator::ServiceDeviceTask,
|
| base::Unretained(this), mfc_event_pending));
|
| }
|
|
|
| -void ExynosVideoDecodeAccelerator::NotifyError(Error error) {
|
| +void V4l2VideoDecodeAccelerator::NotifyError(Error error) {
|
| DVLOG(2) << "NotifyError()";
|
|
|
| if (!child_message_loop_proxy_->BelongsToCurrentThread()) {
|
| child_message_loop_proxy_->PostTask(FROM_HERE, base::Bind(
|
| - &ExynosVideoDecodeAccelerator::NotifyError, weak_this_, error));
|
| + &V4l2VideoDecodeAccelerator::NotifyError, weak_this_, error));
|
| return;
|
| }
|
|
|
| @@ -1690,7 +1690,7 @@ void ExynosVideoDecodeAccelerator::NotifyError(Error error) {
|
| }
|
| }
|
|
|
| -void ExynosVideoDecodeAccelerator::SetDecoderState(State state) {
|
| +void V4l2VideoDecodeAccelerator::SetDecoderState(State state) {
|
| DVLOG(3) << "SetDecoderState(): state=" << state;
|
|
|
| // We can touch decoder_state_ only if this is the decoder thread or the
|
| @@ -1698,14 +1698,14 @@ void ExynosVideoDecodeAccelerator::SetDecoderState(State state) {
|
| if (decoder_thread_.message_loop() != NULL &&
|
| decoder_thread_.message_loop() != base::MessageLoop::current()) {
|
| decoder_thread_.message_loop()->PostTask(FROM_HERE, base::Bind(
|
| - &ExynosVideoDecodeAccelerator::SetDecoderState,
|
| + &V4l2VideoDecodeAccelerator::SetDecoderState,
|
| base::Unretained(this), state));
|
| } else {
|
| decoder_state_ = state;
|
| }
|
| }
|
|
|
| -bool ExynosVideoDecodeAccelerator::GetFormatInfo(struct v4l2_format* format,
|
| +bool V4l2VideoDecodeAccelerator::GetFormatInfo(struct v4l2_format* format,
|
| bool* again) {
|
| DCHECK_EQ(decoder_thread_.message_loop(), base::MessageLoop::current());
|
|
|
| @@ -1727,7 +1727,7 @@ bool ExynosVideoDecodeAccelerator::GetFormatInfo(struct v4l2_format* format,
|
| return true;
|
| }
|
|
|
| -bool ExynosVideoDecodeAccelerator::CreateBuffersForFormat(
|
| +bool V4l2VideoDecodeAccelerator::CreateBuffersForFormat(
|
| const struct v4l2_format& format) {
|
| DCHECK_EQ(decoder_thread_.message_loop(), base::MessageLoop::current());
|
| CHECK_EQ(format.fmt.pix_mp.num_planes, 2);
|
| @@ -1744,7 +1744,7 @@ bool ExynosVideoDecodeAccelerator::CreateBuffersForFormat(
|
| return true;
|
| }
|
|
|
| -bool ExynosVideoDecodeAccelerator::CreateMfcInputBuffers() {
|
| +bool V4l2VideoDecodeAccelerator::CreateMfcInputBuffers() {
|
| DVLOG(3) << "CreateMfcInputBuffers()";
|
| // We always run this as we prepare to initialize.
|
| DCHECK_EQ(decoder_state_, kUninitialized);
|
| @@ -1805,7 +1805,7 @@ bool ExynosVideoDecodeAccelerator::CreateMfcInputBuffers() {
|
| return true;
|
| }
|
|
|
| -bool ExynosVideoDecodeAccelerator::CreateMfcOutputBuffers() {
|
| +bool V4l2VideoDecodeAccelerator::CreateMfcOutputBuffers() {
|
| DVLOG(3) << "CreateMfcOutputBuffers()";
|
| DCHECK(decoder_state_ == kInitialized ||
|
| decoder_state_ == kChangingResolution);
|
| @@ -1860,7 +1860,7 @@ bool ExynosVideoDecodeAccelerator::CreateMfcOutputBuffers() {
|
| return true;
|
| }
|
|
|
| -void ExynosVideoDecodeAccelerator::DestroyMfcInputBuffers() {
|
| +void V4l2VideoDecodeAccelerator::DestroyMfcInputBuffers() {
|
| DVLOG(3) << "DestroyMfcInputBuffers()";
|
| DCHECK(child_message_loop_proxy_->BelongsToCurrentThread());
|
| DCHECK(!mfc_input_streamon_);
|
| @@ -1884,7 +1884,7 @@ void ExynosVideoDecodeAccelerator::DestroyMfcInputBuffers() {
|
| mfc_free_input_buffers_.clear();
|
| }
|
|
|
| -void ExynosVideoDecodeAccelerator::DestroyMfcOutputBuffers() {
|
| +void V4l2VideoDecodeAccelerator::DestroyMfcOutputBuffers() {
|
| DVLOG(3) << "DestroyMfcOutputBuffers()";
|
| DCHECK(child_message_loop_proxy_->BelongsToCurrentThread());
|
| DCHECK(!mfc_output_streamon_);
|
| @@ -1932,7 +1932,7 @@ void ExynosVideoDecodeAccelerator::DestroyMfcOutputBuffers() {
|
| mfc_free_output_buffers_.pop();
|
| }
|
|
|
| -void ExynosVideoDecodeAccelerator::ResolutionChangeDestroyBuffers() {
|
| +void V4l2VideoDecodeAccelerator::ResolutionChangeDestroyBuffers() {
|
| DCHECK(child_message_loop_proxy_->BelongsToCurrentThread());
|
| DVLOG(3) << "ResolutionChangeDestroyBuffers()";
|
|
|
| @@ -1940,11 +1940,11 @@ void ExynosVideoDecodeAccelerator::ResolutionChangeDestroyBuffers() {
|
|
|
| // Finish resolution change on decoder thread.
|
| decoder_thread_.message_loop()->PostTask(FROM_HERE, base::Bind(
|
| - &ExynosVideoDecodeAccelerator::FinishResolutionChange,
|
| + &V4l2VideoDecodeAccelerator::FinishResolutionChange,
|
| base::Unretained(this)));
|
| }
|
|
|
| -void ExynosVideoDecodeAccelerator::SendPictureReady() {
|
| +void V4l2VideoDecodeAccelerator::SendPictureReady() {
|
| DVLOG(3) << "SendPictureReady()";
|
| DCHECK_EQ(decoder_thread_.message_loop(), base::MessageLoop::current());
|
| bool resetting_or_flushing =
|
| @@ -1973,7 +1973,7 @@ void ExynosVideoDecodeAccelerator::SendPictureReady() {
|
| base::Bind(&Client::PictureReady, client_, picture),
|
| // Unretained is safe. If Client::PictureReady gets to run, |this| is
|
| // alive. Destroy() will wait the decode thread to finish.
|
| - base::Bind(&ExynosVideoDecodeAccelerator::PictureCleared,
|
| + base::Bind(&V4l2VideoDecodeAccelerator::PictureCleared,
|
| base::Unretained(this)));
|
| picture_clearing_count_++;
|
| pending_picture_ready_.pop();
|
| @@ -1986,7 +1986,7 @@ void ExynosVideoDecodeAccelerator::SendPictureReady() {
|
| }
|
| }
|
|
|
| -void ExynosVideoDecodeAccelerator::PictureCleared() {
|
| +void V4l2VideoDecodeAccelerator::PictureCleared() {
|
| DVLOG(3) << "PictureCleared(). clearing count=" << picture_clearing_count_;
|
| DCHECK_EQ(decoder_thread_.message_loop(), base::MessageLoop::current());
|
| DCHECK_GT(picture_clearing_count_, 0);
|
|
|