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

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

Issue 1817353002: Fix input frames being dropped when the h.264 DXVA decoder detects a configuration change. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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 | « content/common/gpu/media/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: 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 a744f486d4a7728c7d019256aba0df65b199dca1..8557bcc104720759a35669599dec95f608173999 100644
--- a/content/common/gpu/media/dxva_video_decode_accelerator_win.cc
+++ b/content/common/gpu/media/dxva_video_decode_accelerator_win.cc
@@ -1823,7 +1823,10 @@ void DXVAVideoDecodeAccelerator::Invalidate() {
output_picture_buffers_.clear();
stale_output_picture_buffers_.clear();
pending_output_samples_.clear();
- pending_input_buffers_.clear();
+ // We want to continue processing pending input after detecting a config
+ // change.
+ if (GetState() != kConfigChange)
+ pending_input_buffers_.clear();
decoder_.Release();
pictures_requested_ = false;
@@ -2002,12 +2005,12 @@ void DXVAVideoDecodeAccelerator::DecodeInternal(
PLATFORM_FAILURE,);
if (config_changed) {
+ pending_input_buffers_.push_back(sample);
main_thread_task_runner_->PostTask(
FROM_HERE,
base::Bind(&DXVAVideoDecodeAccelerator::ConfigChanged,
weak_this_factory_.GetWeakPtr(),
- config_,
- sample));
+ config_));
return;
}
@@ -2642,16 +2645,16 @@ HRESULT DXVAVideoDecodeAccelerator::CheckConfigChanged(
}
void DXVAVideoDecodeAccelerator::ConfigChanged(
- const Config& config,
- const base::win::ScopedComPtr<IMFSample>& input_sample) {
+ const Config& config) {
DCHECK(main_thread_task_runner_->BelongsToCurrentThread());
+ SetState(kConfigChange);
DismissStaleBuffers(true);
Invalidate();
Initialize(config_, client_);
decoder_thread_task_runner_->PostTask(
FROM_HERE,
- base::Bind(&DXVAVideoDecodeAccelerator::DecodeInternal,
- base::Unretained(this), input_sample));
+ base::Bind(&DXVAVideoDecodeAccelerator::DecodePendingInputBuffers,
+ base::Unretained(this)));
}
} // namespace content
« no previous file with comments | « content/common/gpu/media/dxva_video_decode_accelerator_win.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698