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

Unified Diff: media/filters/gpu_video_decoder.cc

Issue 10948051: Workaround for DXVA incorrectly claiming to be done with Decode() too soon. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 3 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
« no previous file with comments | « 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 e0d3191d1b2d8d0be1e661d975a8ca4039053c34..00f5f368acf8b5785d249483abcb9f0752f11eea 100644
--- a/media/filters/gpu_video_decoder.cc
+++ b/media/filters/gpu_video_decoder.cc
@@ -220,6 +220,17 @@ void GpuVideoDecoder::Read(const ReadCB& read_cb) {
}
}
+bool GpuVideoDecoder::CanMoreDecodeWorkBeDone() {
+#if defined(OS_WIN)
+ // TODO(ananta): the DXVA decoder stymies our attempt to pipeline Decode()s by
+ // claiming to be done with previous work way too quickly. Until this is
+ // resolved we don't pipeline work. http://crbug.com/150925
+ return bitstream_buffers_in_decoder_.empty() && !pending_read_cb_.is_null();
+#else
+ return bitstream_buffers_in_decoder_.size() < kMaxInFlightDecodes;
+#endif
+}
+
void GpuVideoDecoder::RequestBufferDecode(
DemuxerStream::Status status,
const scoped_refptr<DecoderBuffer>& buffer) {
@@ -276,7 +287,7 @@ void GpuVideoDecoder::RequestBufferDecode(
vda_loop_proxy_->PostTask(FROM_HERE, base::Bind(
&VideoDecodeAccelerator::Decode, weak_vda_, bitstream_buffer));
- if (bitstream_buffers_in_decoder_.size() < kMaxInFlightDecodes)
+ if (CanMoreDecodeWorkBeDone())
EnsureDemuxOrDecode();
}
@@ -476,7 +487,7 @@ void GpuVideoDecoder::NotifyEndOfBitstreamBuffer(int32 id) {
bitstream_buffers_in_decoder_.erase(it);
if (pending_reset_cb_.is_null() && state_ != kDrainingDecoder &&
- bitstream_buffers_in_decoder_.size() < kMaxInFlightDecodes) {
+ CanMoreDecodeWorkBeDone()) {
EnsureDemuxOrDecode();
}
}
« no previous file with comments | « media/filters/gpu_video_decoder.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698