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

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

Issue 185403020: Make VEA client of command buffer; move sync. IPC to VDA/VEA::Initialize() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 56683e7a Rebase. Created 6 years, 9 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/v4l2_video_decode_accelerator.cc
diff --git a/content/common/gpu/media/v4l2_video_decode_accelerator.cc b/content/common/gpu/media/v4l2_video_decode_accelerator.cc
index 68baaa85c845c91dda916e544ddd9e15e27431a3..61aa7dfc0b73ea03dbeea0fca2afad757e769142 100644
--- a/content/common/gpu/media/v4l2_video_decode_accelerator.cc
+++ b/content/common/gpu/media/v4l2_video_decode_accelerator.cc
@@ -160,7 +160,6 @@ V4L2VideoDecodeAccelerator::V4L2VideoDecodeAccelerator(
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)),
io_client_(io_client),
decoder_thread_("V4L2DecoderThread"),
decoder_state_(kUninitialized),
@@ -184,7 +183,10 @@ V4L2VideoDecodeAccelerator::V4L2VideoDecodeAccelerator(
device_poll_thread_("V4L2DevicePollThread"),
make_context_current_(make_context_current),
egl_display_(egl_display),
- video_profile_(media::VIDEO_CODEC_PROFILE_UNKNOWN) {}
+ video_profile_(media::VIDEO_CODEC_PROFILE_UNKNOWN),
+ weak_this_factory_(this) {
+ weak_this_ = weak_this_factory_.GetWeakPtr();
+}
V4L2VideoDecodeAccelerator::~V4L2VideoDecodeAccelerator() {
DCHECK(!decoder_thread_.IsRunning());
@@ -289,9 +291,6 @@ bool V4L2VideoDecodeAccelerator::Initialize(media::VideoCodecProfile profile,
}
SetDecoderState(kInitialized);
-
- child_message_loop_proxy_->PostTask(FROM_HERE, base::Bind(
- &Client::NotifyInitializeDone, client_));
return true;
}
@@ -428,6 +427,7 @@ void V4L2VideoDecodeAccelerator::Destroy() {
// We're destroying; cancel all callbacks.
client_ptr_factory_.reset();
+ weak_this_factory_.InvalidateWeakPtrs();
// If the decoder thread is running, destroy using posted task.
if (decoder_thread_.IsRunning()) {

Powered by Google App Engine
This is Rietveld 408576698