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

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

Issue 1321423004: vda_unittest: Fix Flush() is not called when decoding is slow. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 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 | « AUTHORS ('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/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 0c64f37f3bb5e7a9c014d730dcb2dcd1636cfa2a..ee04bc13ea723ff3e08328262d1ff60c0d2d1ba1 100644
--- a/content/common/gpu/media/video_decode_accelerator_unittest.cc
+++ b/content/common/gpu/media/video_decode_accelerator_unittest.cc
@@ -729,8 +729,15 @@ void GLRenderingVDAClient::NotifyEndOfBitstreamBuffer(
// VaapiVideoDecodeAccelerator::FinishReset()).
++num_done_bitstream_buffers_;
--outstanding_decodes_;
- if (decode_calls_per_second_ == 0)
+
+ // Flush decoder after all BitstreamBuffers are processed.
+ if (encoded_data_next_pos_to_decode_ == encoded_data_.size() &&
+ outstanding_decodes_ == 0) {
wuchengli 2015/09/04 03:26:06 No need to call DecodeNextFragment if reaching the
Pawel Osciak 2015/09/04 06:04:40 Do we need to check outstanding_decodes_? I think
Owen Lin 2015/09/04 07:15:43 Done.
Owen Lin 2015/09/04 07:15:44 This is what I thought. (So I issue the Flush once
+ decoder_->Flush();
+ SetState(CS_FLUSHING);
+ } else if (decode_calls_per_second_ == 0) {
DecodeNextFragment();
+ }
}
void GLRenderingVDAClient::NotifyFlushDone() {
@@ -922,13 +929,8 @@ static bool FragmentHasConfigInfo(const uint8* data, size_t size,
void GLRenderingVDAClient::DecodeNextFragment() {
if (decoder_deleted())
return;
- if (encoded_data_next_pos_to_decode_ == encoded_data_.size()) {
- if (outstanding_decodes_ == 0) {
- decoder_->Flush();
- SetState(CS_FLUSHING);
- }
+ if (encoded_data_next_pos_to_decode_ == encoded_data_.size())
return;
- }
size_t end_pos;
std::string next_fragment_bytes;
if (encoded_data_next_pos_to_decode_ == 0) {
« no previous file with comments | « AUTHORS ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698