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

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 issue in video unit test that Flush/Reset is not reached 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
« no previous file with comments | « 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 decode speed is slow, a BitstreamBuffer is released after the
Alexei Svitkine (slow) 2014/12/09 14:27:35 Nit: Comments should be full sentences.
551 // EOS-DecodeNextFragment(),
552 // trigger DecodeNextFragment again (it will flush decode)
553 || (encoded_data_next_pos_to_decode_ == encoded_data_.size()
Alexei Svitkine (slow) 2014/12/09 14:27:36 Nit: When wrapping, operators (e.g. || and &&) sho
554 && outstanding_decodes_ == 0))
550 DecodeNextFragment(); 555 DecodeNextFragment();
551 } 556 }
552 557
553 void GLRenderingVDAClient::NotifyFlushDone() { 558 void GLRenderingVDAClient::NotifyFlushDone() {
554 if (decoder_deleted()) 559 if (decoder_deleted())
555 return; 560 return;
556 561
557 SetState(CS_FLUSHED); 562 SetState(CS_FLUSHED);
558 --remaining_play_throughs_; 563 --remaining_play_throughs_;
559 DCHECK_GE(remaining_play_throughs_, 0); 564 DCHECK_GE(remaining_play_throughs_, 0);
(...skipping 879 matching lines...) Expand 10 before | Expand all | Expand 10 after
1439 if (it->first == "v" || it->first == "vmodule") 1444 if (it->first == "v" || it->first == "vmodule")
1440 continue; 1445 continue;
1441 LOG(FATAL) << "Unexpected switch: " << it->first << ":" << it->second; 1446 LOG(FATAL) << "Unexpected switch: " << it->first << ":" << it->second;
1442 } 1447 }
1443 1448
1444 base::ShadowingAtExitManager at_exit_manager; 1449 base::ShadowingAtExitManager at_exit_manager;
1445 content::RenderingHelper::InitializeOneOff(); 1450 content::RenderingHelper::InitializeOneOff();
1446 1451
1447 return RUN_ALL_TESTS(); 1452 return RUN_ALL_TESTS();
1448 } 1453 }
OLDNEW
« no previous file with comments | « AUTHORS ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698