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

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

Issue 11369229: Don't wait endlessly for flushing the batched queries sent to the GPU driver during H/W decode (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 1 month 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/gpu/media/dxva_video_decode_accelerator.cc
===================================================================
--- content/common/gpu/media/dxva_video_decode_accelerator.cc (revision 167469)
+++ content/common/gpu/media/dxva_video_decode_accelerator.cc (working copy)
@@ -73,6 +73,10 @@
log << ", HRESULT: 0x" << std::hex << result, \
error_code, ret);
+// Maximum number of iterations we allow before aborting the attempt to flush
+// the batched queries to the driver.
+enum { kMaxiterationsForD3dFlush = 10 };
Ami GONE FROM CHROMIUM 2012/11/13 23:31:25 s/xi/xI/
ananta 2012/11/14 01:06:47 Done.
+
static IMFSample* CreateEmptySample() {
base::win::ScopedComPtr<IMFSample> sample;
HRESULT hr = MFCreateSample(sample.Receive());
@@ -396,11 +400,16 @@
// the texture. Flush it once here though.
hr = query_->Issue(D3DISSUE_END);
RETURN_ON_HR_FAILURE(hr, "Failed to issue END", false);
- do {
- hr = query_->GetData(NULL, 0, D3DGETDATA_FLUSH);
- if (hr == S_FALSE)
- Sleep(1); // Poor-man's Yield().
- } while (hr == S_FALSE);
+
+ // The loop below attempts to flush the batched queries to the driver. We
+ // don't want to loop endlessly waiting for the driver to return success.
+ // The current workaround is to allow a max of kMaxiterationsForD3dFlush
+ // iterations.
Ami GONE FROM CHROMIUM 2012/11/13 23:31:25 This comment is useless; it restates in English wh
ananta 2012/11/14 01:06:47 Rephrased. There is also some new code which addre
+ int iterations = 0;
+ while ((query_->GetData(NULL, 0, D3DGETDATA_FLUSH) == S_FALSE) &&
+ ++iterations < kMaxiterationsForD3dFlush) {
+ Sleep(1); // Poor-man's Yield().
+ }
eglBindTexImage(
static_cast<EGLDisplay*>(eglGetDisplay(EGL_DEFAULT_DISPLAY)),
decoding_surface_,
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698