Index: content/common/gpu/media/android_video_decode_accelerator.cc |
diff --git a/content/common/gpu/media/android_video_decode_accelerator.cc b/content/common/gpu/media/android_video_decode_accelerator.cc |
index ac48abc3a60e65d9a22a3e735336f7360c61fd99..9a10fc625c4d9c2a54fba282e5950614fe685df6 100644 |
--- a/content/common/gpu/media/android_video_decode_accelerator.cc |
+++ b/content/common/gpu/media/android_video_decode_accelerator.cc |
@@ -48,7 +48,8 @@ AndroidVideoDecodeAccelerator::AndroidVideoDecodeAccelerator( |
media::VideoDecodeAccelerator::Client* client, |
const base::WeakPtr<gpu::gles2::GLES2Decoder> decoder, |
const base::Callback<bool(void)>& make_context_current) |
- : client_(client), |
+ : child_message_loop_(base::MessageLoop::current()), |
+ client_(client), |
make_context_current_(make_context_current), |
codec_(media::kCodecH264), |
state_(NO_ERROR), |
@@ -329,6 +330,15 @@ void AndroidVideoDecodeAccelerator::SendCurrentSurfaceToClient( |
void AndroidVideoDecodeAccelerator::Decode( |
const media::BitstreamBuffer& bitstream_buffer) { |
+ if (!child_message_loop_->BelongsToCurrentThread) { |
Ami GONE FROM CHROMIUM
2013/08/26 17:20:03
Can you add a TODO to make this safe from the IO t
piman
2013/08/27 04:01:20
You're missing the () to BelongsToCurrentThread().
wuchengli
2013/08/27 12:32:24
This part of change has been reverted.
wuchengli
2013/08/27 12:32:24
I added CanDecodeOnIOThread and this part of code
|
+ child_message_loop_->PostTask( |
+ FROM_HERE, |
+ base::Bind(&AndroidVideoDecodeAccelerator::Decode, |
+ base::AsWeakPtr(this), |
+ bitstream_buffer)); |
+ return; |
+ } |
+ |
DCHECK(thread_checker_.CalledOnValidThread()); |
if (bitstream_buffer.id() != -1 && bitstream_buffer.size() == 0) { |
base::MessageLoop::current()->PostTask(FROM_HERE, base::Bind( |