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

Unified Diff: media/filters/gpu_video_decoder.cc

Issue 9639005: HW video decode support for --enable-threaded-compositing (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: CR response. Created 8 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
« content/renderer/render_view_impl.cc ('K') | « media/filters/gpu_video_decoder.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/filters/gpu_video_decoder.cc
diff --git a/media/filters/gpu_video_decoder.cc b/media/filters/gpu_video_decoder.cc
index 0a015c7921f347b28c99c58c9473aa2d27a276fa..606362080787832c267fa96e505f71a317ee8649 100644
--- a/media/filters/gpu_video_decoder.cc
+++ b/media/filters/gpu_video_decoder.cc
@@ -42,9 +42,10 @@ GpuVideoDecoder::BufferTimeData::~BufferTimeData() {}
GpuVideoDecoder::GpuVideoDecoder(
MessageLoop* message_loop,
+ MessageLoop* vda_loop,
const scoped_refptr<Factories>& factories)
: gvd_loop_proxy_(message_loop->message_loop_proxy()),
- render_loop_proxy_(base::MessageLoopProxy::current()),
+ vda_loop_proxy_(vda_loop->message_loop_proxy()),
factories_(factories),
state_(kNormal),
demuxer_read_in_progress_(false),
@@ -81,7 +82,7 @@ void GpuVideoDecoder::Stop(const base::Closure& callback) {
callback.Run();
return;
}
- render_loop_proxy_->PostTask(FROM_HERE, base::Bind(
+ vda_loop_proxy_->PostTask(FROM_HERE, base::Bind(
&VideoDecodeAccelerator::Destroy, vda_));
vda_ = NULL;
callback.Run();
@@ -136,7 +137,7 @@ void GpuVideoDecoder::Flush(const base::Closure& callback) {
pending_reset_cb_ = callback;
}
- render_loop_proxy_->PostTask(FROM_HERE, base::Bind(
+ vda_loop_proxy_->PostTask(FROM_HERE, base::Bind(
&VideoDecodeAccelerator::Reset, vda_));
}
@@ -244,7 +245,7 @@ void GpuVideoDecoder::RequestBufferDecode(const scoped_refptr<Buffer>& buffer) {
if (buffer->IsEndOfStream()) {
if (state_ == kNormal) {
state_ = kDrainingDecoder;
- render_loop_proxy_->PostTask(FROM_HERE, base::Bind(
+ vda_loop_proxy_->PostTask(FROM_HERE, base::Bind(
&VideoDecodeAccelerator::Flush, vda_));
}
return;
@@ -260,7 +261,7 @@ void GpuVideoDecoder::RequestBufferDecode(const scoped_refptr<Buffer>& buffer) {
DCHECK(inserted);
RecordBufferTimeData(bitstream_buffer, *buffer);
- render_loop_proxy_->PostTask(FROM_HERE, base::Bind(
+ vda_loop_proxy_->PostTask(FROM_HERE, base::Bind(
&VideoDecodeAccelerator::Decode, vda_, bitstream_buffer));
}
@@ -345,7 +346,7 @@ void GpuVideoDecoder::ProvidePictureBuffers(uint32 count,
picture_buffers.back().id(), picture_buffers.back())).second;
DCHECK(inserted);
}
- render_loop_proxy_->PostTask(FROM_HERE, base::Bind(
+ vda_loop_proxy_->PostTask(FROM_HERE, base::Bind(
&VideoDecodeAccelerator::AssignPictureBuffers, vda_, picture_buffers));
}
@@ -426,7 +427,7 @@ void GpuVideoDecoder::ReusePictureBuffer(int64 picture_buffer_id) {
}
if (!vda_)
return;
- render_loop_proxy_->PostTask(FROM_HERE, base::Bind(
+ vda_loop_proxy_->PostTask(FROM_HERE, base::Bind(
&VideoDecodeAccelerator::ReusePictureBuffer, vda_, picture_buffer_id));
}
@@ -530,6 +531,8 @@ void GpuVideoDecoder::NotifyError(media::VideoDecodeAccelerator::Error error) {
&GpuVideoDecoder::NotifyError, this, error));
return;
}
+ if (!vda_)
+ return;
vda_ = NULL;
DLOG(ERROR) << "VDA Error: " << error;
if (host())
« content/renderer/render_view_impl.cc ('K') | « media/filters/gpu_video_decoder.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698