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

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

Issue 1861483004: Ensure that the open gl context is current in the DXVA decoder while processing configuration chang… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add code to make the gl context current in DismissStaleBuffer and DeferredDismissStaleBuffer Created 4 years, 8 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 | « 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_win.cc
diff --git a/content/common/gpu/media/dxva_video_decode_accelerator_win.cc b/content/common/gpu/media/dxva_video_decode_accelerator_win.cc
index c15d7db9971a69226dc80ced3b608f63d4c5475c..fb6e38132279481da687c98c18e0538e85819872 100644
--- a/content/common/gpu/media/dxva_video_decode_accelerator_win.cc
+++ b/content/common/gpu/media/dxva_video_decode_accelerator_win.cc
@@ -2003,6 +2003,9 @@ void DXVAVideoDecodeAccelerator::Invalidate() {
if (GetState() == kUninitialized)
return;
+ // Best effort to make the GL context current.
+ make_context_current_.Run();
+
decoder_thread_.Stop();
weak_this_factory_.InvalidateWeakPtrs();
output_picture_buffers_.clear();
@@ -2294,6 +2297,9 @@ void DXVAVideoDecodeAccelerator::HandleResolutionChanged(int width,
}
void DXVAVideoDecodeAccelerator::DismissStaleBuffers(bool force) {
+ RETURN_AND_NOTIFY_ON_FAILURE(make_context_current_.Run(),
+ "Failed to make context current", PLATFORM_FAILURE, );
+
OutputBuffers::iterator index;
for (index = output_picture_buffers_.begin();
@@ -2314,6 +2320,9 @@ void DXVAVideoDecodeAccelerator::DismissStaleBuffers(bool force) {
void DXVAVideoDecodeAccelerator::DeferredDismissStaleBuffer(
int32_t picture_buffer_id) {
+ RETURN_AND_NOTIFY_ON_FAILURE(make_context_current_.Run(),
+ "Failed to make context current", PLATFORM_FAILURE, );
+
OutputBuffers::iterator it = stale_output_picture_buffers_.find(
picture_buffer_id);
DCHECK(it != stale_output_picture_buffers_.end());
@@ -2832,6 +2841,7 @@ HRESULT DXVAVideoDecodeAccelerator::CheckConfigChanged(
void DXVAVideoDecodeAccelerator::ConfigChanged(
const Config& config) {
DCHECK(main_thread_task_runner_->BelongsToCurrentThread());
+
SetState(kConfigChange);
DismissStaleBuffers(true);
Invalidate();
« 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