OLD | NEW |
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, 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 542 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
553 | 553 |
554 // VideoDecodeAccelerator::Client implementation. | 554 // VideoDecodeAccelerator::Client implementation. |
555 // The heart of the Client. | 555 // The heart of the Client. |
556 virtual void ProvidePictureBuffers( | 556 virtual void ProvidePictureBuffers( |
557 uint32 requested_num_of_buffers, | 557 uint32 requested_num_of_buffers, |
558 const gfx::Size& dimensions); | 558 const gfx::Size& dimensions); |
559 virtual void DismissPictureBuffer(int32 picture_buffer_id); | 559 virtual void DismissPictureBuffer(int32 picture_buffer_id); |
560 virtual void PictureReady(const media::Picture& picture); | 560 virtual void PictureReady(const media::Picture& picture); |
561 // Simple state changes. | 561 // Simple state changes. |
562 virtual void NotifyInitializeDone(); | 562 virtual void NotifyInitializeDone(); |
563 virtual void NotifyEndOfStream(); | |
564 virtual void NotifyEndOfBitstreamBuffer(int32 bitstream_buffer_id); | 563 virtual void NotifyEndOfBitstreamBuffer(int32 bitstream_buffer_id); |
565 virtual void NotifyFlushDone(); | 564 virtual void NotifyFlushDone(); |
566 virtual void NotifyResetDone(); | 565 virtual void NotifyResetDone(); |
567 virtual void NotifyError(VideoDecodeAccelerator::Error error); | 566 virtual void NotifyError(VideoDecodeAccelerator::Error error); |
568 | 567 |
569 // Simple getters for inspecting the state of the Client. | 568 // Simple getters for inspecting the state of the Client. |
570 ClientState state() { return state_; } | 569 ClientState state() { return state_; } |
571 int num_done_bitstream_buffers() { return num_done_bitstream_buffers_; } | 570 int num_done_bitstream_buffers() { return num_done_bitstream_buffers_; } |
572 int num_decoded_frames() { return num_decoded_frames_; } | 571 int num_decoded_frames() { return num_decoded_frames_; } |
573 EGLDisplay egl_display() { return rendering_helper_->egl_display(); } | 572 EGLDisplay egl_display() { return rendering_helper_->egl_display(); } |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
739 decoder_->ReusePictureBuffer(picture.picture_buffer_id()); | 738 decoder_->ReusePictureBuffer(picture.picture_buffer_id()); |
740 } | 739 } |
741 | 740 |
742 void EglRenderingVDAClient::NotifyInitializeDone() { | 741 void EglRenderingVDAClient::NotifyInitializeDone() { |
743 SetState(CS_INITIALIZED); | 742 SetState(CS_INITIALIZED); |
744 initialize_done_ticks_ = base::TimeTicks::Now(); | 743 initialize_done_ticks_ = base::TimeTicks::Now(); |
745 for (int i = 0; i < num_in_flight_decodes_; ++i) | 744 for (int i = 0; i < num_in_flight_decodes_; ++i) |
746 DecodeNextNALUs(); | 745 DecodeNextNALUs(); |
747 } | 746 } |
748 | 747 |
749 void EglRenderingVDAClient::NotifyEndOfStream() { | |
750 SetState(CS_DONE); | |
751 } | |
752 | |
753 void EglRenderingVDAClient::NotifyEndOfBitstreamBuffer( | 748 void EglRenderingVDAClient::NotifyEndOfBitstreamBuffer( |
754 int32 bitstream_buffer_id) { | 749 int32 bitstream_buffer_id) { |
755 ++num_done_bitstream_buffers_; | 750 ++num_done_bitstream_buffers_; |
756 --outstanding_decodes_; | 751 --outstanding_decodes_; |
757 DecodeNextNALUs(); | 752 DecodeNextNALUs(); |
758 } | 753 } |
759 | 754 |
760 void EglRenderingVDAClient::NotifyFlushDone() { | 755 void EglRenderingVDAClient::NotifyFlushDone() { |
761 if (decoder_deleted()) | 756 if (decoder_deleted()) |
762 return; | 757 return; |
(...skipping 392 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1155 } | 1150 } |
1156 LOG(FATAL) << "Unexpected switch: " << it->first << ":" << it->second; | 1151 LOG(FATAL) << "Unexpected switch: " << it->first << ":" << it->second; |
1157 } | 1152 } |
1158 #if defined(OS_WIN) | 1153 #if defined(OS_WIN) |
1159 base::ShadowingAtExitManager at_exit_manager; | 1154 base::ShadowingAtExitManager at_exit_manager; |
1160 gfx::InitializeGLBindings(gfx::kGLImplementationEGLGLES2); | 1155 gfx::InitializeGLBindings(gfx::kGLImplementationEGLGLES2); |
1161 DXVAVideoDecodeAccelerator::PreSandboxInitialization(); | 1156 DXVAVideoDecodeAccelerator::PreSandboxInitialization(); |
1162 #endif // OS_WIN | 1157 #endif // OS_WIN |
1163 return RUN_ALL_TESTS(); | 1158 return RUN_ALL_TESTS(); |
1164 } | 1159 } |
OLD | NEW |