| Index: content/common/gpu/media/exynos_video_decode_accelerator.cc
|
| diff --git a/content/common/gpu/media/exynos_video_decode_accelerator.cc b/content/common/gpu/media/exynos_video_decode_accelerator.cc
|
| index 677df9c350470545a468614d8b3e08f8b7fe94bd..e643969d8e6d6cd2e6ae3e1ab4565afc4d6b2bc5 100644
|
| --- a/content/common/gpu/media/exynos_video_decode_accelerator.cc
|
| +++ b/content/common/gpu/media/exynos_video_decode_accelerator.cc
|
| @@ -205,8 +205,10 @@ ExynosVideoDecodeAccelerator::ExynosVideoDecodeAccelerator(
|
| EGLDisplay egl_display,
|
| EGLContext egl_context,
|
| Client* client,
|
| - const base::Callback<bool(void)>& make_context_current)
|
| + const base::Callback<bool(void)>& make_context_current,
|
| + const scoped_refptr<base::MessageLoopProxy>& io_message_loop_proxy)
|
| : child_message_loop_proxy_(base::MessageLoopProxy::current()),
|
| + io_message_loop_proxy_(io_message_loop_proxy),
|
| weak_this_(base::AsWeakPtr(this)),
|
| client_ptr_factory_(client),
|
| client_(client_ptr_factory_.GetWeakPtr()),
|
| @@ -415,23 +417,12 @@ void ExynosVideoDecodeAccelerator::Decode(
|
| const media::BitstreamBuffer& bitstream_buffer) {
|
| DVLOG(1) << "Decode(): input_id=" << bitstream_buffer.id()
|
| << ", size=" << bitstream_buffer.size();
|
| - DCHECK(child_message_loop_proxy_->BelongsToCurrentThread());
|
| -
|
| - scoped_ptr<BitstreamBufferRef> bitstream_record(new BitstreamBufferRef(
|
| - client_, child_message_loop_proxy_,
|
| - new base::SharedMemory(bitstream_buffer.handle(), true),
|
| - bitstream_buffer.size(), bitstream_buffer.id()));
|
| - if (!bitstream_record->shm->Map(bitstream_buffer.size())) {
|
| - DLOG(ERROR) << "Decode(): could not map bitstream_buffer";
|
| - NOTIFY_ERROR(UNREADABLE_INPUT);
|
| - return;
|
| - }
|
| - DVLOG(3) << "Decode(): mapped to addr=" << bitstream_record->shm->memory();
|
| + DCHECK(io_message_loop_proxy_->BelongsToCurrentThread());
|
|
|
| // DecodeTask() will take care of running a DecodeBufferTask().
|
| decoder_thread_.message_loop()->PostTask(FROM_HERE, base::Bind(
|
| &ExynosVideoDecodeAccelerator::DecodeTask, base::Unretained(this),
|
| - base::Passed(&bitstream_record)));
|
| + bitstream_buffer));
|
| }
|
|
|
| void ExynosVideoDecodeAccelerator::AssignPictureBuffers(
|
| @@ -576,6 +567,8 @@ void ExynosVideoDecodeAccelerator::Destroy() {
|
| delete this;
|
| }
|
|
|
| +bool ExynosVideoDecodeAccelerator::CanDecodeOnIOThread() { return true; }
|
| +
|
| // static
|
| void ExynosVideoDecodeAccelerator::PreSandboxInitialization() {
|
| DVLOG(3) << "PreSandboxInitialization()";
|
| @@ -610,12 +603,23 @@ bool ExynosVideoDecodeAccelerator::PostSandboxInitialization() {
|
| }
|
|
|
| void ExynosVideoDecodeAccelerator::DecodeTask(
|
| - scoped_ptr<BitstreamBufferRef> bitstream_record) {
|
| - DVLOG(3) << "DecodeTask(): input_id=" << bitstream_record->input_id;
|
| + const media::BitstreamBuffer& bitstream_buffer) {
|
| + DVLOG(3) << "DecodeTask(): input_id=" << bitstream_buffer.id();
|
| DCHECK_EQ(decoder_thread_.message_loop(), base::MessageLoop::current());
|
| DCHECK_NE(decoder_state_, kUninitialized);
|
| TRACE_EVENT1("Video Decoder", "EVDA::DecodeTask", "input_id",
|
| - bitstream_record->input_id);
|
| + bitstream_buffer.id());
|
| +
|
| + scoped_ptr<BitstreamBufferRef> bitstream_record(new BitstreamBufferRef(
|
| + client_, child_message_loop_proxy_,
|
| + new base::SharedMemory(bitstream_buffer.handle(), true),
|
| + bitstream_buffer.size(), bitstream_buffer.id()));
|
| + if (!bitstream_record->shm->Map(bitstream_buffer.size())) {
|
| + DLOG(ERROR) << "Decode(): could not map bitstream_buffer";
|
| + NOTIFY_ERROR(UNREADABLE_INPUT);
|
| + return;
|
| + }
|
| + DVLOG(3) << "Decode(): mapped to addr=" << bitstream_record->shm->memory();
|
|
|
| if (decoder_state_ == kResetting || decoder_flushing_) {
|
| // In the case that we're resetting or flushing, we need to delay decoding
|
|
|