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

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

Issue 465293002: rendering_helper - Wait for rendering before resetting the decoder. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address review comments Created 6 years, 4 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
Index: content/common/gpu/media/video_decode_accelerator_unittest.cc
diff --git a/content/common/gpu/media/video_decode_accelerator_unittest.cc b/content/common/gpu/media/video_decode_accelerator_unittest.cc
index 83a1234dda5663df2ad4ed9a4dd8546088f89c64..ee56a5df1605a84edc4bbe0c97e5999f71d32096 100644
--- a/content/common/gpu/media/video_decode_accelerator_unittest.cc
+++ b/content/common/gpu/media/video_decode_accelerator_unittest.cc
@@ -266,6 +266,8 @@ class GLRenderingVDAClient
// Delete the associated decoder helper.
void DeleteDecoder();
+ void ResetDecoder();
+
// Compute & return the first encoded bytes (including a start frame) to send
// to the decoder, starting at |start_pos| and returning one fragment. Skips
// to the first decodable position.
@@ -533,6 +535,13 @@ void GLRenderingVDAClient::NotifyEndOfBitstreamBuffer(
DecodeNextFragment();
}
+void GLRenderingVDAClient::ResetDecoder() {
+ if (decoder_deleted())
+ return;
+ decoder_->Reset();
+ SetState(CS_RESETTING);
+}
+
void GLRenderingVDAClient::NotifyFlushDone() {
if (decoder_deleted())
return;
@@ -540,10 +549,10 @@ void GLRenderingVDAClient::NotifyFlushDone() {
SetState(CS_FLUSHED);
--remaining_play_throughs_;
DCHECK_GE(remaining_play_throughs_, 0);
- if (decoder_deleted())
- return;
- decoder_->Reset();
- SetState(CS_RESETTING);
+
+ // Call Reset until rendering is completed.
+ rendering_helper_->Flush(
+ window_id_, base::Bind(&GLRenderingVDAClient::ResetDecoder, AsWeakPtr()));
}
void GLRenderingVDAClient::NotifyResetDone() {
« content/common/gpu/media/rendering_helper.h ('K') | « content/common/gpu/media/rendering_helper.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698