Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
|
wuchengli
2016/07/11 05:30:08
For change description:
s/Add back timestamp test/
| |
| 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 #include <inttypes.h> | 5 #include <inttypes.h> |
| 6 #include <stddef.h> | 6 #include <stddef.h> |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <memory> | 10 #include <memory> |
| 11 #include <queue> | 11 #include <queue> |
| (...skipping 773 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 785 class VEAClient : public VideoEncodeAccelerator::Client { | 785 class VEAClient : public VideoEncodeAccelerator::Client { |
| 786 public: | 786 public: |
| 787 VEAClient(TestStream* test_stream, | 787 VEAClient(TestStream* test_stream, |
| 788 ClientStateNotification<ClientState>* note, | 788 ClientStateNotification<ClientState>* note, |
| 789 bool save_to_file, | 789 bool save_to_file, |
| 790 unsigned int keyframe_period, | 790 unsigned int keyframe_period, |
| 791 bool force_bitrate, | 791 bool force_bitrate, |
| 792 bool test_perf, | 792 bool test_perf, |
| 793 bool mid_stream_bitrate_switch, | 793 bool mid_stream_bitrate_switch, |
| 794 bool mid_stream_framerate_switch, | 794 bool mid_stream_framerate_switch, |
| 795 bool verify_output); | 795 bool verify_output, |
| 796 bool verify_output_timestamp); | |
| 796 ~VEAClient() override; | 797 ~VEAClient() override; |
| 797 void CreateEncoder(); | 798 void CreateEncoder(); |
| 798 void DestroyEncoder(); | 799 void DestroyEncoder(); |
| 799 | 800 |
| 800 // VideoDecodeAccelerator::Client implementation. | 801 // VideoDecodeAccelerator::Client implementation. |
| 801 void RequireBitstreamBuffers(unsigned int input_count, | 802 void RequireBitstreamBuffers(unsigned int input_count, |
| 802 const gfx::Size& input_coded_size, | 803 const gfx::Size& input_coded_size, |
| 803 size_t output_buffer_size) override; | 804 size_t output_buffer_size) override; |
| 804 void BitstreamBufferReady(int32_t bitstream_buffer_id, | 805 void BitstreamBufferReady(int32_t bitstream_buffer_id, |
| 805 size_t payload_size, | 806 size_t payload_size, |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 949 // Byte size of the encoded stream (for bitrate calculation) since last | 950 // Byte size of the encoded stream (for bitrate calculation) since last |
| 950 // time we checked bitrate. | 951 // time we checked bitrate. |
| 951 size_t encoded_stream_size_since_last_check_; | 952 size_t encoded_stream_size_since_last_check_; |
| 952 | 953 |
| 953 // If true, verify performance at the end of the test. | 954 // If true, verify performance at the end of the test. |
| 954 bool test_perf_; | 955 bool test_perf_; |
| 955 | 956 |
| 956 // Check the output frame quality of the encoder. | 957 // Check the output frame quality of the encoder. |
| 957 bool verify_output_; | 958 bool verify_output_; |
| 958 | 959 |
| 960 // Check whether the output timestamps match input timestamps. | |
| 961 bool verify_output_timestamp_; | |
| 962 | |
| 959 // Used to perform codec-specific sanity checks on the stream. | 963 // Used to perform codec-specific sanity checks on the stream. |
| 960 std::unique_ptr<StreamValidator> stream_validator_; | 964 std::unique_ptr<StreamValidator> stream_validator_; |
| 961 | 965 |
| 962 // Used to validate the encoded frame quality. | 966 // Used to validate the encoded frame quality. |
| 963 std::unique_ptr<VideoFrameQualityValidator> quality_validator_; | 967 std::unique_ptr<VideoFrameQualityValidator> quality_validator_; |
| 964 | 968 |
| 965 // The time when the first frame is submitted for encode. | 969 // The time when the first frame is submitted for encode. |
| 966 base::TimeTicks first_frame_start_time_; | 970 base::TimeTicks first_frame_start_time_; |
| 967 | 971 |
| 968 // The time when the last encoded frame is ready. | 972 // The time when the last encoded frame is ready. |
| 969 base::TimeTicks last_frame_ready_time_; | 973 base::TimeTicks last_frame_ready_time_; |
| 970 | 974 |
| 971 // All methods of this class should be run on the same thread. | 975 // All methods of this class should be run on the same thread. |
| 972 base::ThreadChecker thread_checker_; | 976 base::ThreadChecker thread_checker_; |
| 973 | 977 |
| 974 // Requested bitrate in bits per second. | 978 // Requested bitrate in bits per second. |
| 975 unsigned int requested_bitrate_; | 979 unsigned int requested_bitrate_; |
| 976 | 980 |
| 977 // Requested initial framerate. | 981 // Requested initial framerate. |
| 978 unsigned int requested_framerate_; | 982 unsigned int requested_framerate_; |
| 979 | 983 |
| 980 // Bitrate to switch to in the middle of the stream. | 984 // Bitrate to switch to in the middle of the stream. |
| 981 unsigned int requested_subsequent_bitrate_; | 985 unsigned int requested_subsequent_bitrate_; |
| 982 | 986 |
| 983 // Framerate to switch to in the middle of the stream. | 987 // Framerate to switch to in the middle of the stream. |
| 984 unsigned int requested_subsequent_framerate_; | 988 unsigned int requested_subsequent_framerate_; |
| 985 | 989 |
| 986 // The timer used to feed the encoder with the input frames. | 990 // The timer used to feed the encoder with the input frames. |
| 987 std::unique_ptr<base::RepeatingTimer> input_timer_; | 991 std::unique_ptr<base::RepeatingTimer> input_timer_; |
| 992 | |
| 993 // The timestamps for each frame in the order of CreateFrame() invocation. | |
| 994 std::queue<base::TimeDelta> frame_timestamps_; | |
| 988 }; | 995 }; |
| 989 | 996 |
| 990 VEAClient::VEAClient(TestStream* test_stream, | 997 VEAClient::VEAClient(TestStream* test_stream, |
| 991 ClientStateNotification<ClientState>* note, | 998 ClientStateNotification<ClientState>* note, |
| 992 bool save_to_file, | 999 bool save_to_file, |
| 993 unsigned int keyframe_period, | 1000 unsigned int keyframe_period, |
| 994 bool force_bitrate, | 1001 bool force_bitrate, |
| 995 bool test_perf, | 1002 bool test_perf, |
| 996 bool mid_stream_bitrate_switch, | 1003 bool mid_stream_bitrate_switch, |
| 997 bool mid_stream_framerate_switch, | 1004 bool mid_stream_framerate_switch, |
| 998 bool verify_output) | 1005 bool verify_output, |
| 1006 bool verify_output_timestamp) | |
| 999 : state_(CS_CREATED), | 1007 : state_(CS_CREATED), |
| 1000 test_stream_(test_stream), | 1008 test_stream_(test_stream), |
| 1001 note_(note), | 1009 note_(note), |
| 1002 next_input_id_(0), | 1010 next_input_id_(0), |
| 1003 next_output_buffer_id_(0), | 1011 next_output_buffer_id_(0), |
| 1004 pos_in_input_stream_(0), | 1012 pos_in_input_stream_(0), |
| 1005 num_required_input_buffers_(0), | 1013 num_required_input_buffers_(0), |
| 1006 output_buffer_size_(0), | 1014 output_buffer_size_(0), |
| 1007 num_frames_to_encode_(0), | 1015 num_frames_to_encode_(0), |
| 1008 num_encoded_frames_(0), | 1016 num_encoded_frames_(0), |
| 1009 num_frames_since_last_check_(0), | 1017 num_frames_since_last_check_(0), |
| 1010 seen_keyframe_in_this_buffer_(false), | 1018 seen_keyframe_in_this_buffer_(false), |
| 1011 save_to_file_(save_to_file), | 1019 save_to_file_(save_to_file), |
| 1012 keyframe_period_(keyframe_period), | 1020 keyframe_period_(keyframe_period), |
| 1013 num_keyframes_requested_(0), | 1021 num_keyframes_requested_(0), |
| 1014 next_keyframe_at_(0), | 1022 next_keyframe_at_(0), |
| 1015 force_bitrate_(force_bitrate), | 1023 force_bitrate_(force_bitrate), |
| 1016 current_requested_bitrate_(0), | 1024 current_requested_bitrate_(0), |
| 1017 current_framerate_(0), | 1025 current_framerate_(0), |
| 1018 encoded_stream_size_since_last_check_(0), | 1026 encoded_stream_size_since_last_check_(0), |
| 1019 test_perf_(test_perf), | 1027 test_perf_(test_perf), |
| 1020 verify_output_(verify_output), | 1028 verify_output_(verify_output), |
| 1029 verify_output_timestamp_(verify_output_timestamp), | |
| 1021 requested_bitrate_(0), | 1030 requested_bitrate_(0), |
| 1022 requested_framerate_(0), | 1031 requested_framerate_(0), |
| 1023 requested_subsequent_bitrate_(0), | 1032 requested_subsequent_bitrate_(0), |
| 1024 requested_subsequent_framerate_(0) { | 1033 requested_subsequent_framerate_(0) { |
| 1025 if (keyframe_period_) | 1034 if (keyframe_period_) |
| 1026 LOG_ASSERT(kMaxKeyframeDelay < keyframe_period_); | 1035 LOG_ASSERT(kMaxKeyframeDelay < keyframe_period_); |
| 1027 | 1036 |
| 1028 // Fake encoder produces an invalid stream, so skip validating it. | 1037 // Fake encoder produces an invalid stream, so skip validating it. |
| 1029 if (!g_fake_encoder) { | 1038 if (!g_fake_encoder) { |
| 1030 stream_validator_ = StreamValidator::Create( | 1039 stream_validator_ = StreamValidator::Create( |
| (...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1252 ASSERT_LE(payload_size, output_buffer_size_); | 1261 ASSERT_LE(payload_size, output_buffer_size_); |
| 1253 | 1262 |
| 1254 IdToSHM::iterator it = output_buffers_at_client_.find(bitstream_buffer_id); | 1263 IdToSHM::iterator it = output_buffers_at_client_.find(bitstream_buffer_id); |
| 1255 ASSERT_NE(it, output_buffers_at_client_.end()); | 1264 ASSERT_NE(it, output_buffers_at_client_.end()); |
| 1256 base::SharedMemory* shm = it->second; | 1265 base::SharedMemory* shm = it->second; |
| 1257 output_buffers_at_client_.erase(it); | 1266 output_buffers_at_client_.erase(it); |
| 1258 | 1267 |
| 1259 if (state_ == CS_FINISHED || state_ == CS_VALIDATED) | 1268 if (state_ == CS_FINISHED || state_ == CS_VALIDATED) |
| 1260 return; | 1269 return; |
| 1261 | 1270 |
| 1271 if (verify_output_timestamp_) { | |
| 1272 EXPECT_TRUE(!frame_timestamps_.empty()); | |
| 1273 | |
| 1274 // One input frame may be mapped to multiple output frames, so the current | |
| 1275 // timestamp should be equal to one of the top two elements in | |
| 1276 // frame_timestamps_. | |
| 1277 if (timestamp != frame_timestamps_.front()) { | |
|
wuchengli
2016/07/11 05:30:08
ASSERT abort the function when they fail. EXPECT d
shenghao1
2016/07/11 10:28:09
Done.
| |
| 1278 frame_timestamps_.pop(); | |
| 1279 EXPECT_EQ(timestamp, frame_timestamps_.front()); | |
|
wuchengli
2016/07/11 05:30:08
The first parameter is expected value and the seco
shenghao1
2016/07/11 10:28:09
Done.
| |
| 1280 } | |
| 1281 } | |
| 1282 | |
|
wuchengli
2016/07/11 05:30:08
Fail the test if the size of frame_timestamps_ is
shenghao1
2016/07/11 10:28:09
Done.
| |
| 1262 encoded_stream_size_since_last_check_ += payload_size; | 1283 encoded_stream_size_since_last_check_ += payload_size; |
| 1263 | 1284 |
| 1264 const uint8_t* stream_ptr = static_cast<const uint8_t*>(shm->memory()); | 1285 const uint8_t* stream_ptr = static_cast<const uint8_t*>(shm->memory()); |
| 1265 if (payload_size > 0) { | 1286 if (payload_size > 0) { |
| 1266 if (stream_validator_) { | 1287 if (stream_validator_) { |
| 1267 stream_validator_->ProcessStreamBuffer(stream_ptr, payload_size); | 1288 stream_validator_->ProcessStreamBuffer(stream_ptr, payload_size); |
| 1268 } else { | 1289 } else { |
| 1269 HandleEncodedFrame(key_frame); | 1290 HandleEncodedFrame(key_frame); |
| 1270 } | 1291 } |
| 1271 | 1292 |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1388 // we require for bitrate tests. | 1409 // we require for bitrate tests. |
| 1389 pos_in_input_stream_ = 0; | 1410 pos_in_input_stream_ = 0; |
| 1390 } | 1411 } |
| 1391 | 1412 |
| 1392 if (quality_validator_) | 1413 if (quality_validator_) |
| 1393 quality_validator_->AddOriginalFrame(CreateFrame(pos_in_input_stream_)); | 1414 quality_validator_->AddOriginalFrame(CreateFrame(pos_in_input_stream_)); |
| 1394 | 1415 |
| 1395 int32_t input_id; | 1416 int32_t input_id; |
| 1396 scoped_refptr<VideoFrame> video_frame = | 1417 scoped_refptr<VideoFrame> video_frame = |
| 1397 PrepareInputFrame(pos_in_input_stream_, &input_id); | 1418 PrepareInputFrame(pos_in_input_stream_, &input_id); |
| 1419 frame_timestamps_.push(video_frame->timestamp()); | |
| 1398 pos_in_input_stream_ += test_stream_->aligned_buffer_size; | 1420 pos_in_input_stream_ += test_stream_->aligned_buffer_size; |
| 1399 | 1421 |
| 1400 bool force_keyframe = false; | 1422 bool force_keyframe = false; |
| 1401 if (keyframe_period_ && input_id % keyframe_period_ == 0) { | 1423 if (keyframe_period_ && input_id % keyframe_period_ == 0) { |
| 1402 force_keyframe = true; | 1424 force_keyframe = true; |
| 1403 ++num_keyframes_requested_; | 1425 ++num_keyframes_requested_; |
| 1404 } | 1426 } |
| 1405 | 1427 |
| 1406 if (input_id == 0) { | 1428 if (input_id == 0) { |
| 1407 first_frame_start_time_ = base::TimeTicks::Now(); | 1429 first_frame_start_time_ = base::TimeTicks::Now(); |
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1580 // one input stream; otherwise, one encoder per input stream will be | 1602 // one input stream; otherwise, one encoder per input stream will be |
| 1581 // instantiated. | 1603 // instantiated. |
| 1582 // - If true, save output to file (provided an output filename was supplied). | 1604 // - If true, save output to file (provided an output filename was supplied). |
| 1583 // - Force a keyframe every n frames. | 1605 // - Force a keyframe every n frames. |
| 1584 // - Force bitrate; the actual required value is provided as a property | 1606 // - Force bitrate; the actual required value is provided as a property |
| 1585 // of the input stream, because it depends on stream type/resolution/etc. | 1607 // of the input stream, because it depends on stream type/resolution/etc. |
| 1586 // - If true, measure performance. | 1608 // - If true, measure performance. |
| 1587 // - If true, switch bitrate mid-stream. | 1609 // - If true, switch bitrate mid-stream. |
| 1588 // - If true, switch framerate mid-stream. | 1610 // - If true, switch framerate mid-stream. |
| 1589 // - If true, verify the output frames of encoder. | 1611 // - If true, verify the output frames of encoder. |
| 1612 // - If true, verify the timestamps of output frames. | |
| 1590 class VideoEncodeAcceleratorTest | 1613 class VideoEncodeAcceleratorTest |
| 1591 : public ::testing::TestWithParam< | 1614 : public ::testing::TestWithParam< |
| 1592 std::tuple<int, bool, int, bool, bool, bool, bool, bool>> {}; | 1615 std::tuple<int, bool, int, bool, bool, bool, bool, bool, bool>> {}; |
| 1593 | 1616 |
| 1594 TEST_P(VideoEncodeAcceleratorTest, TestSimpleEncode) { | 1617 TEST_P(VideoEncodeAcceleratorTest, TestSimpleEncode) { |
| 1595 size_t num_concurrent_encoders = std::get<0>(GetParam()); | 1618 size_t num_concurrent_encoders = std::get<0>(GetParam()); |
| 1596 const bool save_to_file = std::get<1>(GetParam()); | 1619 const bool save_to_file = std::get<1>(GetParam()); |
| 1597 const unsigned int keyframe_period = std::get<2>(GetParam()); | 1620 const unsigned int keyframe_period = std::get<2>(GetParam()); |
| 1598 const bool force_bitrate = std::get<3>(GetParam()); | 1621 const bool force_bitrate = std::get<3>(GetParam()); |
| 1599 const bool test_perf = std::get<4>(GetParam()); | 1622 const bool test_perf = std::get<4>(GetParam()); |
| 1600 const bool mid_stream_bitrate_switch = std::get<5>(GetParam()); | 1623 const bool mid_stream_bitrate_switch = std::get<5>(GetParam()); |
| 1601 const bool mid_stream_framerate_switch = std::get<6>(GetParam()); | 1624 const bool mid_stream_framerate_switch = std::get<6>(GetParam()); |
| 1602 const bool verify_output = | 1625 const bool verify_output = |
| 1603 std::get<7>(GetParam()) || g_env->verify_all_output(); | 1626 std::get<7>(GetParam()) || g_env->verify_all_output(); |
| 1627 const bool verify_output_timestamp = std::get<8>(GetParam()); | |
| 1604 | 1628 |
| 1605 ScopedVector<ClientStateNotification<ClientState>> notes; | 1629 ScopedVector<ClientStateNotification<ClientState>> notes; |
| 1606 ScopedVector<VEAClient> clients; | 1630 ScopedVector<VEAClient> clients; |
| 1607 base::Thread encoder_thread("EncoderThread"); | 1631 base::Thread encoder_thread("EncoderThread"); |
| 1608 ASSERT_TRUE(encoder_thread.Start()); | 1632 ASSERT_TRUE(encoder_thread.Start()); |
| 1609 | 1633 |
| 1610 if (g_env->test_streams_.size() > 1) | 1634 if (g_env->test_streams_.size() > 1) |
| 1611 num_concurrent_encoders = g_env->test_streams_.size(); | 1635 num_concurrent_encoders = g_env->test_streams_.size(); |
| 1612 | 1636 |
| 1613 // Create all encoders. | 1637 // Create all encoders. |
| 1614 for (size_t i = 0; i < num_concurrent_encoders; i++) { | 1638 for (size_t i = 0; i < num_concurrent_encoders; i++) { |
| 1615 size_t test_stream_index = i % g_env->test_streams_.size(); | 1639 size_t test_stream_index = i % g_env->test_streams_.size(); |
| 1616 // Disregard save_to_file if we didn't get an output filename. | 1640 // Disregard save_to_file if we didn't get an output filename. |
| 1617 bool encoder_save_to_file = | 1641 bool encoder_save_to_file = |
| 1618 (save_to_file && | 1642 (save_to_file && |
| 1619 !g_env->test_streams_[test_stream_index]->out_filename.empty()); | 1643 !g_env->test_streams_[test_stream_index]->out_filename.empty()); |
| 1620 | 1644 |
| 1621 notes.push_back(new ClientStateNotification<ClientState>()); | 1645 notes.push_back(new ClientStateNotification<ClientState>()); |
| 1622 clients.push_back(new VEAClient( | 1646 clients.push_back(new VEAClient( |
| 1623 g_env->test_streams_[test_stream_index], notes.back(), | 1647 g_env->test_streams_[test_stream_index], notes.back(), |
| 1624 encoder_save_to_file, keyframe_period, force_bitrate, test_perf, | 1648 encoder_save_to_file, keyframe_period, force_bitrate, test_perf, |
| 1625 mid_stream_bitrate_switch, mid_stream_framerate_switch, verify_output)); | 1649 mid_stream_bitrate_switch, mid_stream_framerate_switch, verify_output, |
| 1650 verify_output_timestamp)); | |
| 1626 | 1651 |
| 1627 encoder_thread.task_runner()->PostTask( | 1652 encoder_thread.task_runner()->PostTask( |
| 1628 FROM_HERE, base::Bind(&VEAClient::CreateEncoder, | 1653 FROM_HERE, base::Bind(&VEAClient::CreateEncoder, |
| 1629 base::Unretained(clients.back()))); | 1654 base::Unretained(clients.back()))); |
| 1630 } | 1655 } |
| 1631 | 1656 |
| 1632 // All encoders must pass through states in this order. | 1657 // All encoders must pass through states in this order. |
| 1633 enum ClientState state_transitions[] = { | 1658 enum ClientState state_transitions[] = { |
| 1634 CS_ENCODER_SET, CS_INITIALIZED, CS_ENCODING, CS_FINISHED, CS_VALIDATED}; | 1659 CS_ENCODER_SET, CS_INITIALIZED, CS_ENCODING, CS_FINISHED, CS_VALIDATED}; |
| 1635 | 1660 |
| (...skipping 18 matching lines...) Expand all Loading... | |
| 1654 | 1679 |
| 1655 // This ensures all tasks have finished. | 1680 // This ensures all tasks have finished. |
| 1656 encoder_thread.Stop(); | 1681 encoder_thread.Stop(); |
| 1657 } | 1682 } |
| 1658 | 1683 |
| 1659 #if !defined(OS_MACOSX) | 1684 #if !defined(OS_MACOSX) |
| 1660 INSTANTIATE_TEST_CASE_P( | 1685 INSTANTIATE_TEST_CASE_P( |
| 1661 SimpleEncode, | 1686 SimpleEncode, |
| 1662 VideoEncodeAcceleratorTest, | 1687 VideoEncodeAcceleratorTest, |
| 1663 ::testing::Values( | 1688 ::testing::Values( |
| 1664 std::make_tuple(1, true, 0, false, false, false, false, false), | 1689 std::make_tuple(1, true, 0, false, false, false, false, false, false), |
| 1665 std::make_tuple(1, true, 0, false, false, false, false, true))); | 1690 std::make_tuple(1, true, 0, false, false, false, false, true, false))); |
| 1666 | 1691 |
| 1667 INSTANTIATE_TEST_CASE_P( | 1692 INSTANTIATE_TEST_CASE_P( |
| 1668 EncoderPerf, | 1693 EncoderPerf, |
| 1669 VideoEncodeAcceleratorTest, | 1694 VideoEncodeAcceleratorTest, |
| 1670 ::testing::Values( | 1695 ::testing::Values( |
| 1671 std::make_tuple(1, false, 0, false, true, false, false, false))); | 1696 std::make_tuple(1, false, 0, false, true, false, false, false, false))); |
| 1672 | 1697 |
| 1673 INSTANTIATE_TEST_CASE_P( | 1698 INSTANTIATE_TEST_CASE_P(ForceKeyframes, |
| 1674 ForceKeyframes, | 1699 VideoEncodeAcceleratorTest, |
| 1675 VideoEncodeAcceleratorTest, | 1700 ::testing::Values(std::make_tuple(1, |
| 1676 ::testing::Values( | 1701 false, |
| 1677 std::make_tuple(1, false, 10, false, false, false, false, false))); | 1702 10, |
| 1703 false, | |
| 1704 false, | |
| 1705 false, | |
| 1706 false, | |
| 1707 false, | |
| 1708 false))); | |
| 1678 | 1709 |
| 1679 INSTANTIATE_TEST_CASE_P( | 1710 INSTANTIATE_TEST_CASE_P( |
| 1680 ForceBitrate, | 1711 ForceBitrate, |
| 1681 VideoEncodeAcceleratorTest, | 1712 VideoEncodeAcceleratorTest, |
| 1682 ::testing::Values( | 1713 ::testing::Values( |
| 1683 std::make_tuple(1, false, 0, true, false, false, false, false))); | 1714 std::make_tuple(1, false, 0, true, false, false, false, false, false))); |
| 1684 | 1715 |
| 1685 INSTANTIATE_TEST_CASE_P( | 1716 INSTANTIATE_TEST_CASE_P( |
| 1686 MidStreamParamSwitchBitrate, | 1717 MidStreamParamSwitchBitrate, |
| 1687 VideoEncodeAcceleratorTest, | 1718 VideoEncodeAcceleratorTest, |
| 1688 ::testing::Values( | 1719 ::testing::Values( |
| 1689 std::make_tuple(1, false, 0, true, false, true, false, false))); | 1720 std::make_tuple(1, false, 0, true, false, true, false, false, false))); |
| 1690 | 1721 |
| 1691 INSTANTIATE_TEST_CASE_P( | 1722 INSTANTIATE_TEST_CASE_P( |
| 1692 MidStreamParamSwitchFPS, | 1723 MidStreamParamSwitchFPS, |
| 1693 VideoEncodeAcceleratorTest, | 1724 VideoEncodeAcceleratorTest, |
| 1694 ::testing::Values( | 1725 ::testing::Values( |
| 1695 std::make_tuple(1, false, 0, true, false, false, true, false))); | 1726 std::make_tuple(1, false, 0, true, false, false, true, false, false))); |
| 1696 | 1727 |
| 1697 INSTANTIATE_TEST_CASE_P( | 1728 INSTANTIATE_TEST_CASE_P( |
| 1698 MultipleEncoders, | 1729 MultipleEncoders, |
| 1699 VideoEncodeAcceleratorTest, | 1730 VideoEncodeAcceleratorTest, |
| 1700 ::testing::Values( | 1731 ::testing::Values( |
| 1701 std::make_tuple(3, false, 0, false, false, false, false, false), | 1732 std::make_tuple(3, false, 0, false, false, false, false, false, false), |
| 1702 std::make_tuple(3, false, 0, true, false, false, true, false), | 1733 std::make_tuple(3, false, 0, true, false, false, true, false, false), |
| 1703 std::make_tuple(3, false, 0, true, false, true, false, false))); | 1734 std::make_tuple(3, false, 0, true, false, true, false, false, false))); |
| 1735 | |
| 1736 INSTANTIATE_TEST_CASE_P( | |
| 1737 VerifyTimestamp, | |
| 1738 VideoEncodeAcceleratorTest, | |
| 1739 ::testing::Values( | |
| 1740 std::make_tuple(1, true, 0, false, false, false, false, false, true))); | |
| 1741 | |
| 1704 #else | 1742 #else |
| 1705 INSTANTIATE_TEST_CASE_P( | 1743 INSTANTIATE_TEST_CASE_P( |
| 1706 SimpleEncode, | 1744 SimpleEncode, |
| 1707 VideoEncodeAcceleratorTest, | 1745 VideoEncodeAcceleratorTest, |
| 1708 ::testing::Values( | 1746 ::testing::Values( |
| 1709 std::make_tuple(1, true, 0, false, false, false, false, false), | 1747 std::make_tuple(1, true, 0, false, false, false, false, false, false), |
| 1710 std::make_tuple(1, true, 0, false, false, false, false, true))); | 1748 std::make_tuple(1, true, 0, false, false, false, false, true, false))); |
| 1711 | 1749 |
| 1712 INSTANTIATE_TEST_CASE_P( | 1750 INSTANTIATE_TEST_CASE_P( |
| 1713 EncoderPerf, | 1751 EncoderPerf, |
| 1714 VideoEncodeAcceleratorTest, | 1752 VideoEncodeAcceleratorTest, |
| 1715 ::testing::Values( | 1753 ::testing::Values( |
| 1716 std::make_tuple(1, false, 0, false, true, false, false, false))); | 1754 std::make_tuple(1, false, 0, false, true, false, false, false, false))); |
| 1717 | 1755 |
| 1718 INSTANTIATE_TEST_CASE_P( | 1756 INSTANTIATE_TEST_CASE_P(MultipleEncoders, |
| 1719 MultipleEncoders, | 1757 VideoEncodeAcceleratorTest, |
| 1720 VideoEncodeAcceleratorTest, | 1758 ::testing::Values(std::make_tuple(3, |
| 1721 ::testing::Values( | 1759 false, |
| 1722 std::make_tuple(3, false, 0, false, false, false, false, false))); | 1760 0, |
| 1761 false, | |
| 1762 false, | |
| 1763 false, | |
| 1764 false, | |
| 1765 false, | |
| 1766 false))); | |
| 1723 #endif | 1767 #endif |
| 1724 | 1768 |
| 1725 // TODO(posciak): more tests: | 1769 // TODO(posciak): more tests: |
| 1726 // - async FeedEncoderWithOutput | 1770 // - async FeedEncoderWithOutput |
| 1727 // - out-of-order return of outputs to encoder | 1771 // - out-of-order return of outputs to encoder |
| 1728 // - multiple encoders + decoders | 1772 // - multiple encoders + decoders |
| 1729 // - mid-stream encoder_->Destroy() | 1773 // - mid-stream encoder_->Destroy() |
| 1730 | 1774 |
| 1731 } // namespace | 1775 } // namespace |
| 1732 } // namespace media | 1776 } // namespace media |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1810 | 1854 |
| 1811 media::g_env = | 1855 media::g_env = |
| 1812 reinterpret_cast<media::VideoEncodeAcceleratorTestEnvironment*>( | 1856 reinterpret_cast<media::VideoEncodeAcceleratorTestEnvironment*>( |
| 1813 testing::AddGlobalTestEnvironment( | 1857 testing::AddGlobalTestEnvironment( |
| 1814 new media::VideoEncodeAcceleratorTestEnvironment( | 1858 new media::VideoEncodeAcceleratorTestEnvironment( |
| 1815 std::move(test_stream_data), log_path, run_at_fps, | 1859 std::move(test_stream_data), log_path, run_at_fps, |
| 1816 needs_encode_latency, verify_all_output))); | 1860 needs_encode_latency, verify_all_output))); |
| 1817 | 1861 |
| 1818 return RUN_ALL_TESTS(); | 1862 return RUN_ALL_TESTS(); |
| 1819 } | 1863 } |
| OLD | NEW |