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

Side by Side Diff: content/common/gpu/media/video_decode_accelerator_unittest.cc

Issue 791573002: fix video_decode_accelerator_unittest issue when decode speed is slow (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix video_decode_accelerator_unittest issue when decode speed is slow Created 6 years 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 unified diff | Download patch
« AUTHORS ('K') | « AUTHORS ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 // 4 //
5 // The bulk of this file is support code; sorry about that. Here's an overview 5 // The bulk of this file is support code; sorry about that. Here's an overview
6 // to hopefully help readers of this code: 6 // to hopefully help readers of this code:
7 // - RenderingHelper is charged with interacting with X11/{EGL/GLES2,GLX/GL} or 7 // - RenderingHelper is charged with interacting with X11/{EGL/GLES2,GLX/GL} or
8 // Win/EGL. 8 // Win/EGL.
9 // - ClientState is an enum for the state of the decode client used by the test. 9 // - ClientState is an enum for the state of the decode client used by the test.
10 // - ClientStateNotification is a barrier abstraction that allows the test code 10 // - ClientStateNotification is a barrier abstraction that allows the test code
(...skipping 528 matching lines...) Expand 10 before | Expand all | Expand 10 after
539 } 539 }
540 540
541 void GLRenderingVDAClient::NotifyEndOfBitstreamBuffer( 541 void GLRenderingVDAClient::NotifyEndOfBitstreamBuffer(
542 int32 bitstream_buffer_id) { 542 int32 bitstream_buffer_id) {
543 // TODO(fischman): this test currently relies on this notification to make 543 // TODO(fischman): this test currently relies on this notification to make
544 // forward progress during a Reset(). But the VDA::Reset() API doesn't 544 // forward progress during a Reset(). But the VDA::Reset() API doesn't
545 // guarantee this, so stop relying on it (and remove the notifications from 545 // guarantee this, so stop relying on it (and remove the notifications from
546 // VaapiVideoDecodeAccelerator::FinishReset()). 546 // VaapiVideoDecodeAccelerator::FinishReset()).
547 ++num_done_bitstream_buffers_; 547 ++num_done_bitstream_buffers_;
548 --outstanding_decodes_; 548 --outstanding_decodes_;
549 if (decode_calls_per_second_ == 0) 549 if (decode_calls_per_second_ == 0 ||
550 // when decoding speed is slow, some BitstreamBuffer may be released
Owen Lin 2015/01/08 06:26:08 s/when/When/ s/speed//
551 // after DecodeNextFragment process to the end; which means
552 // outstanding_decodes_ is not zero at that time.
Owen Lin 2015/01/08 06:26:08 |outstanding_decodes_|
553 // we need trigger DecodeNextFragment another time to flush decode.
Owen Lin 2015/01/08 06:26:08 In order to flush the decoder, we need trigger Dec
554 (encoded_data_next_pos_to_decode_ == encoded_data_.size() &&
555 outstanding_decodes_ == 0))
550 DecodeNextFragment(); 556 DecodeNextFragment();
Owen Lin 2015/01/08 06:26:08 How could you prevent to flush the decoder twice ?
551 } 557 }
552 558
553 void GLRenderingVDAClient::NotifyFlushDone() { 559 void GLRenderingVDAClient::NotifyFlushDone() {
554 if (decoder_deleted()) 560 if (decoder_deleted())
555 return; 561 return;
556 562
557 SetState(CS_FLUSHED); 563 SetState(CS_FLUSHED);
558 --remaining_play_throughs_; 564 --remaining_play_throughs_;
559 DCHECK_GE(remaining_play_throughs_, 0); 565 DCHECK_GE(remaining_play_throughs_, 0);
560 if (decoder_deleted()) 566 if (decoder_deleted())
(...skipping 878 matching lines...) Expand 10 before | Expand all | Expand 10 after
1439 if (it->first == "v" || it->first == "vmodule") 1445 if (it->first == "v" || it->first == "vmodule")
1440 continue; 1446 continue;
1441 LOG(FATAL) << "Unexpected switch: " << it->first << ":" << it->second; 1447 LOG(FATAL) << "Unexpected switch: " << it->first << ":" << it->second;
1442 } 1448 }
1443 1449
1444 base::ShadowingAtExitManager at_exit_manager; 1450 base::ShadowingAtExitManager at_exit_manager;
1445 content::RenderingHelper::InitializeOneOff(); 1451 content::RenderingHelper::InitializeOneOff();
1446 1452
1447 return RUN_ALL_TESTS(); 1453 return RUN_ALL_TESTS();
1448 } 1454 }
OLDNEW
« AUTHORS ('K') | « AUTHORS ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698