Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(762)

Unified Diff: content/common/gpu/media/android_video_decode_accelerator.cc

Issue 23125014: Run VDA::Decode on GPU IO thread if VDA supports it. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use a separate MessageFilter for GVDA Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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(

Powered by Google App Engine
This is Rietveld 408576698