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

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

Issue 9186022: Remove VideoDecodeAccelerator::Client::NotifyEndOfStream / PPP_VideoDecoder_Dev::EndOfStream (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 11 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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, and GLES2. 7 // - RenderingHelper is charged with interacting with X11, EGL, and GLES2.
8 // - ClientState is an enum for the state of the decode client used by the test. 8 // - ClientState is an enum for the state of the decode client used by the test.
9 // - ClientStateNotification is a barrier abstraction that allows the test code 9 // - ClientStateNotification is a barrier abstraction that allows the test code
10 // to be written sequentially and wait for the decode client to see certain 10 // to be written sequentially and wait for the decode client to see certain
(...skipping 538 matching lines...) Expand 10 before | Expand all | Expand 10 after
549 549
550 // VideoDecodeAccelerator::Client implementation. 550 // VideoDecodeAccelerator::Client implementation.
551 // The heart of the Client. 551 // The heart of the Client.
552 virtual void ProvidePictureBuffers( 552 virtual void ProvidePictureBuffers(
553 uint32 requested_num_of_buffers, 553 uint32 requested_num_of_buffers,
554 const gfx::Size& dimensions); 554 const gfx::Size& dimensions);
555 virtual void DismissPictureBuffer(int32 picture_buffer_id); 555 virtual void DismissPictureBuffer(int32 picture_buffer_id);
556 virtual void PictureReady(const media::Picture& picture); 556 virtual void PictureReady(const media::Picture& picture);
557 // Simple state changes. 557 // Simple state changes.
558 virtual void NotifyInitializeDone(); 558 virtual void NotifyInitializeDone();
559 virtual void NotifyEndOfStream();
560 virtual void NotifyEndOfBitstreamBuffer(int32 bitstream_buffer_id); 559 virtual void NotifyEndOfBitstreamBuffer(int32 bitstream_buffer_id);
561 virtual void NotifyFlushDone(); 560 virtual void NotifyFlushDone();
562 virtual void NotifyResetDone(); 561 virtual void NotifyResetDone();
563 virtual void NotifyError(VideoDecodeAccelerator::Error error); 562 virtual void NotifyError(VideoDecodeAccelerator::Error error);
564 563
565 // Simple getters for inspecting the state of the Client. 564 // Simple getters for inspecting the state of the Client.
566 ClientState state() { return state_; } 565 ClientState state() { return state_; }
567 int num_done_bitstream_buffers() { return num_done_bitstream_buffers_; } 566 int num_done_bitstream_buffers() { return num_done_bitstream_buffers_; }
568 int num_decoded_frames() { return num_decoded_frames_; } 567 int num_decoded_frames() { return num_decoded_frames_; }
569 EGLDisplay egl_display() { return rendering_helper_->egl_display(); } 568 EGLDisplay egl_display() { return rendering_helper_->egl_display(); }
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
727 decoder_->ReusePictureBuffer(picture.picture_buffer_id()); 726 decoder_->ReusePictureBuffer(picture.picture_buffer_id());
728 } 727 }
729 728
730 void EglRenderingVDAClient::NotifyInitializeDone() { 729 void EglRenderingVDAClient::NotifyInitializeDone() {
731 SetState(CS_INITIALIZED); 730 SetState(CS_INITIALIZED);
732 initialize_done_ticks_ = base::TimeTicks::Now(); 731 initialize_done_ticks_ = base::TimeTicks::Now();
733 for (int i = 0; i < num_in_flight_decodes_; ++i) 732 for (int i = 0; i < num_in_flight_decodes_; ++i)
734 DecodeNextNALUs(); 733 DecodeNextNALUs();
735 } 734 }
736 735
737 void EglRenderingVDAClient::NotifyEndOfStream() {
738 SetState(CS_DONE);
739 }
740
741 void EglRenderingVDAClient::NotifyEndOfBitstreamBuffer( 736 void EglRenderingVDAClient::NotifyEndOfBitstreamBuffer(
742 int32 bitstream_buffer_id) { 737 int32 bitstream_buffer_id) {
743 ++num_done_bitstream_buffers_; 738 ++num_done_bitstream_buffers_;
744 --outstanding_decodes_; 739 --outstanding_decodes_;
745 DecodeNextNALUs(); 740 DecodeNextNALUs();
746 } 741 }
747 742
748 void EglRenderingVDAClient::NotifyFlushDone() { 743 void EglRenderingVDAClient::NotifyFlushDone() {
749 if (decoder_deleted()) 744 if (decoder_deleted())
750 return; 745 return;
(...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after
1110 } 1105 }
1111 LOG(FATAL) << "Unexpected switch: " << it->first << ":" << it->second; 1106 LOG(FATAL) << "Unexpected switch: " << it->first << ":" << it->second;
1112 } 1107 }
1113 #if defined(OS_WIN) 1108 #if defined(OS_WIN)
1114 base::ShadowingAtExitManager at_exit_manager; 1109 base::ShadowingAtExitManager at_exit_manager;
1115 gfx::InitializeGLBindings(gfx::kGLImplementationEGLGLES2); 1110 gfx::InitializeGLBindings(gfx::kGLImplementationEGLGLES2);
1116 DXVAVideoDecodeAccelerator::PreSandboxInitialization(); 1111 DXVAVideoDecodeAccelerator::PreSandboxInitialization();
1117 #endif // OS_WIN 1112 #endif // OS_WIN
1118 return RUN_ALL_TESTS(); 1113 return RUN_ALL_TESTS();
1119 } 1114 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698