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

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: 7da5b6ec 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 49373bdb1a6765f71c075c2699d7a71d84ceb450..2f2e880b5c25c6a67aca0a0c90b22ddb5a766e67 100644
--- a/content/common/gpu/media/v4l2_video_decode_accelerator.cc
+++ b/content/common/gpu/media/v4l2_video_decode_accelerator.cc
@@ -158,7 +158,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),
@@ -183,7 +182,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());
@@ -288,14 +290,13 @@ bool V4L2VideoDecodeAccelerator::Initialize(media::VideoCodecProfile profile,
}
// StartDevicePoll will NOTIFY_ERROR on failure, so IgnoreResult is fine here.
- decoder_thread_.message_loop()->PostTask(FROM_HERE, base::Bind(
- base::IgnoreResult(&V4L2VideoDecodeAccelerator::StartDevicePoll),
- base::Unretained(this)));
+ decoder_thread_.message_loop()->PostTask(
+ FROM_HERE,
+ base::Bind(
+ base::IgnoreResult(&V4L2VideoDecodeAccelerator::StartDevicePoll),
+ base::Unretained(this)));
SetDecoderState(kInitialized);
-
- child_message_loop_proxy_->PostTask(FROM_HERE, base::Bind(
- &Client::NotifyInitializeDone, client_));
return true;
}
@@ -416,6 +417,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()) {
« no previous file with comments | « content/common/gpu/media/v4l2_video_decode_accelerator.h ('k') | content/common/gpu/media/vaapi_video_decode_accelerator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698