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

Unified Diff: media/gpu/dxva_video_decode_accelerator_win.cc

Issue 2923913003: Invalidate DXVA IMFTransform on Flush()
Patch Set: Created 3 years, 6 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_video_decode_accelerator_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_video_decode_accelerator_win.cc
diff --git a/media/gpu/dxva_video_decode_accelerator_win.cc b/media/gpu/dxva_video_decode_accelerator_win.cc
index 5b863cceae2c8b5b0b671779013dfe20134d8c75..93f0f08225aa8ce5f7be3a703c5edd5a10e66ecb 100644
--- a/media/gpu/dxva_video_decode_accelerator_win.cc
+++ b/media/gpu/dxva_video_decode_accelerator_win.cc
@@ -1195,7 +1195,7 @@ void DXVAVideoDecodeAccelerator::Reset() {
void DXVAVideoDecodeAccelerator::Destroy() {
DCHECK(main_thread_task_runner_->BelongsToCurrentThread());
- Invalidate();
+ Invalidate(false);
delete this;
}
@@ -2015,11 +2015,11 @@ void DXVAVideoDecodeAccelerator::StopOnError(
client_ = NULL;
if (GetState() != kUninitialized) {
- Invalidate();
+ Invalidate(false);
}
}
-void DXVAVideoDecodeAccelerator::Invalidate() {
+void DXVAVideoDecodeAccelerator::Invalidate(bool for_config_change) {
if (GetState() == kUninitialized)
return;
@@ -2038,7 +2038,7 @@ void DXVAVideoDecodeAccelerator::Invalidate() {
// output picture buffers may need to be recreated in case the video
// resolution changes. We already handle that in the
// HandleResolutionChanged() function.
- if (GetState() != kConfigChange) {
+ if (!for_config_change) {
output_picture_buffers_.clear();
stale_output_picture_buffers_.clear();
// We want to continue processing pending input after detecting a config
@@ -2111,6 +2111,8 @@ void DXVAVideoDecodeAccelerator::NotifyFlushDone() {
}
client_->NotifyFlushDone();
+ Invalidate(true);
+ Initialize(config_, client_);
}
}
@@ -3035,7 +3037,7 @@ void DXVAVideoDecodeAccelerator::ConfigChanged(const Config& config) {
DCHECK(main_thread_task_runner_->BelongsToCurrentThread());
SetState(kConfigChange);
- Invalidate();
+ Invalidate(true);
Initialize(config_, client_);
decoder_thread_task_runner_->PostTask(
FROM_HERE,
« no previous file with comments | « media/gpu/dxva_video_decode_accelerator_win.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698