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

Unified Diff: media/gpu/dxva_picture_buffer_win.cc

Issue 2128663003: Correctly handle reusing reset picture buffers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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/gpu/dxva_picture_buffer_win.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/gpu/dxva_picture_buffer_win.cc
diff --git a/media/gpu/dxva_picture_buffer_win.cc b/media/gpu/dxva_picture_buffer_win.cc
index 146efb02f178e40c43a8d0ad59be24c8e5c706d9..ff4d4ad19fc44dac599799800f09c6130f749793 100644
--- a/media/gpu/dxva_picture_buffer_win.cc
+++ b/media/gpu/dxva_picture_buffer_win.cc
@@ -534,6 +534,9 @@ bool EGLStreamCopyPictureBuffer::CopyOutputSampleDataToPictureBuffer(
decoder->CopyTexture(dx11_texture, decoder_copy_texture_.get(),
dx11_keyed_mutex_, keyed_mutex_value_, id(),
input_buffer_id);
+ // The texture copy will acquire the current keyed mutex value and release
+ // with the value + 1.
+ keyed_mutex_value_++;
return true;
}
@@ -546,7 +549,6 @@ bool EGLStreamCopyPictureBuffer::CopySurfaceComplete(
dx11_decoding_texture_.Release();
- keyed_mutex_value_++;
HRESULT hr =
egl_keyed_mutex_->AcquireSync(keyed_mutex_value_, kAcquireSyncWaitMs);
RETURN_ON_FAILURE(hr == S_OK, "Could not acquire sync mutex", false);
@@ -563,6 +565,7 @@ bool EGLStreamCopyPictureBuffer::CopySurfaceComplete(
RETURN_ON_FAILURE(result, "Could not post stream", false);
result = eglStreamConsumerAcquireKHR(egl_display, stream_);
RETURN_ON_FAILURE(result, "Could not post acquire stream", false);
+ frame_in_consumer_ = true;
return true;
}
@@ -570,8 +573,11 @@ bool EGLStreamCopyPictureBuffer::CopySurfaceComplete(
bool EGLStreamCopyPictureBuffer::ReusePictureBuffer() {
EGLDisplay egl_display = gl::GLSurfaceEGL::GetHardwareDisplay();
- HRESULT hr = egl_keyed_mutex_->ReleaseSync(++keyed_mutex_value_);
- RETURN_ON_FAILURE(hr == S_OK, "Could not release sync mutex", false);
+ if (frame_in_consumer_) {
+ HRESULT hr = egl_keyed_mutex_->ReleaseSync(++keyed_mutex_value_);
+ RETURN_ON_FAILURE(hr == S_OK, "Could not release sync mutex", false);
+ }
+ frame_in_consumer_ = false;
if (stream_) {
EGLBoolean result = eglStreamConsumerReleaseKHR(egl_display, stream_);
« no previous file with comments | « media/gpu/dxva_picture_buffer_win.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698