Commit 6e5244ce authored by Hirokazu Honda's avatar Hirokazu Honda Committed by Commit Bot

media: VdaVideoDecoder: Don't call Flush() in Reinitialization

VideoDecoder client, before it calls VD::Initialize, decodes EOS buffer
(i.e. VDA::Flush()) first and waits until the EOS buffer is decoed (i.e.
VDA::NotifyFlushDone()). Therefore, VdaVideoDecoder doesn't have to call
VDA::Flush() in the beginning of reinitialization. This removes the unnnecessary
VDA::Flush() call.

Bug: 929565
Test: no video corruption on some issued sites on grunt and eve
Change-Id: I4e842996896378f0d6f03fc5942833944e3afcaf
Reviewed-on: https://chromium-review.googlesource.com/c/1487758Reviewed-by: default avatarDan Sanders <sandersd@chromium.org>
Commit-Queue: Hirokazu Honda <hiroh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#635777}
parent 6645c375
......@@ -282,7 +282,8 @@ void VdaVideoDecoder::Initialize(const VideoDecoderConfig& config,
if (reinitializing) {
if (is_profile_change) {
MEDIA_LOG(INFO, media_log_) << "Reinitialize VideoDecodeAccelerator";
MEDIA_LOG(INFO, media_log_) << "Reinitializing video decode accelerator "
<< "for profile change";
gpu_task_runner_->PostTask(
FROM_HERE, base::BindOnce(&VdaVideoDecoder::ReinitializeOnGpuThread,
gpu_weak_this_));
......@@ -307,7 +308,10 @@ void VdaVideoDecoder::ReinitializeOnGpuThread() {
DCHECK(!reinitializing_);
reinitializing_ = true;
vda_->Flush();
gpu_weak_vda_factory_ = nullptr;
vda_ = nullptr;
vda_initialized_ = false;
InitializeOnGpuThread();
}
void VdaVideoDecoder::InitializeOnGpuThread() {
......@@ -660,17 +664,6 @@ void VdaVideoDecoder::NotifyFlushDone() {
DCHECK(gpu_task_runner_->BelongsToCurrentThread());
DCHECK(vda_initialized_);
if (reinitializing_) {
// If reinitializing, this Flush() is requested by VdaVideoDecoder in
// ReinitializeOnGpuThread(), not MojoVideoDecoder. We should not invoke
// NotifyFlushDoneOnParentThread.
gpu_weak_vda_factory_ = nullptr;
vda_ = nullptr;
vda_initialized_ = false;
InitializeOnGpuThread();
return;
}
parent_task_runner_->PostTask(
FROM_HERE, base::BindOnce(&VdaVideoDecoder::NotifyFlushDoneOnParentThread,
parent_weak_this_));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment