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..6918061b3715f7f3ba6235d80171a2a182b69bfd 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( |
@@ -610,12 +601,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) { |
Ami GONE FROM CHROMIUM
2013/08/27 17:10:33
This is problematic: bitstream_buffer may go out o
Pawel Osciak
2013/08/28 08:36:49
Probably. Or create BBR in Decode and only Map() h
wuchengli
2013/08/28 13:18:21
This should be OK. callback.h says "By default Bin
wuchengli
2013/08/28 13:18:21
I agree with Antoine that we should make IO thread
|
+ 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 |