OLD | NEW |
---|---|
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 592 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
603 // Populate the shared memory buffer w/ the NALU, duplicate its handle, and | 603 // Populate the shared memory buffer w/ the NALU, duplicate its handle, and |
604 // hand it off to the decoder. | 604 // hand it off to the decoder. |
605 base::SharedMemory shm; | 605 base::SharedMemory shm; |
606 CHECK(shm.CreateAndMapAnonymous(end_pos - start_pos)) | 606 CHECK(shm.CreateAndMapAnonymous(end_pos - start_pos)) |
607 << start_pos << ", " << end_pos; | 607 << start_pos << ", " << end_pos; |
608 memcpy(shm.memory(), encoded_data_->data() + start_pos, end_pos - start_pos); | 608 memcpy(shm.memory(), encoded_data_->data() + start_pos, end_pos - start_pos); |
609 base::SharedMemoryHandle dup_handle; | 609 base::SharedMemoryHandle dup_handle; |
610 CHECK(shm.ShareToProcess(base::Process::Current().handle(), &dup_handle)); | 610 CHECK(shm.ShareToProcess(base::Process::Current().handle(), &dup_handle)); |
611 media::BitstreamBuffer bitstream_buffer( | 611 media::BitstreamBuffer bitstream_buffer( |
612 next_bitstream_buffer_id_++, dup_handle, end_pos - start_pos); | 612 next_bitstream_buffer_id_++, dup_handle, end_pos - start_pos); |
613 CHECK(decoder_->Decode(bitstream_buffer)); | 613 decoder_->Decode(bitstream_buffer); |
scherkus (not reviewing)
2011/06/27 22:54:47
lol
| |
614 encoded_data_next_pos_to_decode_ = end_pos; | 614 encoded_data_next_pos_to_decode_ = end_pos; |
615 } | 615 } |
616 | 616 |
617 double EglRenderingVDAClient::frames_per_second() { | 617 double EglRenderingVDAClient::frames_per_second() { |
618 base::TimeDelta delta = last_frame_delivered_ticks_ - initialize_done_ticks_; | 618 base::TimeDelta delta = last_frame_delivered_ticks_ - initialize_done_ticks_; |
619 CHECK_GT(delta.InSecondsF(), 0); | 619 CHECK_GT(delta.InSecondsF(), 0); |
620 return num_decoded_frames_ / delta.InSecondsF(); | 620 return num_decoded_frames_ / delta.InSecondsF(); |
621 } | 621 } |
622 | 622 |
623 // Test parameters: | 623 // Test parameters: |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
746 std::make_pair(15, 1))); | 746 std::make_pair(15, 1))); |
747 | 747 |
748 // TODO(fischman, vrk): add more tests! In particular: | 748 // TODO(fischman, vrk): add more tests! In particular: |
749 // - Test life-cycle: Seek/Stop/Pause/Play/RePlay for a single decoder. | 749 // - Test life-cycle: Seek/Stop/Pause/Play/RePlay for a single decoder. |
750 // - Test for memory leaks (valgrind) | 750 // - Test for memory leaks (valgrind) |
751 // - Test alternate configurations | 751 // - Test alternate configurations |
752 // - Test failure conditions. | 752 // - Test failure conditions. |
753 // - Test frame size changes mid-stream | 753 // - Test frame size changes mid-stream |
754 | 754 |
755 } // namespace | 755 } // namespace |
OLD | NEW |