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

Side by Side Diff: media/gpu/video_encode_accelerator_unittest.cc

Issue 2104883005: VEA unit test: Add timestamp test (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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
« no previous file with comments | « no previous file | 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 #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>
(...skipping 742 matching lines...) Expand 10 before | Expand all | Expand 10 after
753 class VEAClient : public VideoEncodeAccelerator::Client { 753 class VEAClient : public VideoEncodeAccelerator::Client {
754 public: 754 public:
755 VEAClient(TestStream* test_stream, 755 VEAClient(TestStream* test_stream,
756 ClientStateNotification<ClientState>* note, 756 ClientStateNotification<ClientState>* note,
757 bool save_to_file, 757 bool save_to_file,
758 unsigned int keyframe_period, 758 unsigned int keyframe_period,
759 bool force_bitrate, 759 bool force_bitrate,
760 bool test_perf, 760 bool test_perf,
761 bool mid_stream_bitrate_switch, 761 bool mid_stream_bitrate_switch,
762 bool mid_stream_framerate_switch, 762 bool mid_stream_framerate_switch,
763 bool verify_output); 763 bool verify_output,
764 bool verify_output_timestamp);
764 ~VEAClient() override; 765 ~VEAClient() override;
765 void CreateEncoder(); 766 void CreateEncoder();
766 void DestroyEncoder(); 767 void DestroyEncoder();
767 768
768 // VideoDecodeAccelerator::Client implementation. 769 // VideoDecodeAccelerator::Client implementation.
769 void RequireBitstreamBuffers(unsigned int input_count, 770 void RequireBitstreamBuffers(unsigned int input_count,
770 const gfx::Size& input_coded_size, 771 const gfx::Size& input_coded_size,
771 size_t output_buffer_size) override; 772 size_t output_buffer_size) override;
772 void BitstreamBufferReady(int32_t bitstream_buffer_id, 773 void BitstreamBufferReady(int32_t bitstream_buffer_id,
773 size_t payload_size, 774 size_t payload_size,
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
917 // Byte size of the encoded stream (for bitrate calculation) since last 918 // Byte size of the encoded stream (for bitrate calculation) since last
918 // time we checked bitrate. 919 // time we checked bitrate.
919 size_t encoded_stream_size_since_last_check_; 920 size_t encoded_stream_size_since_last_check_;
920 921
921 // If true, verify performance at the end of the test. 922 // If true, verify performance at the end of the test.
922 bool test_perf_; 923 bool test_perf_;
923 924
924 // Check the output frame quality of the encoder. 925 // Check the output frame quality of the encoder.
925 bool verify_output_; 926 bool verify_output_;
926 927
928 // Check whether the output timestamps match input timestamps.
929 bool verify_output_timestamp_;
930
927 // Used to perform codec-specific sanity checks on the stream. 931 // Used to perform codec-specific sanity checks on the stream.
928 std::unique_ptr<StreamValidator> stream_validator_; 932 std::unique_ptr<StreamValidator> stream_validator_;
929 933
930 // Used to validate the encoded frame quality. 934 // Used to validate the encoded frame quality.
931 std::unique_ptr<VideoFrameQualityValidator> quality_validator_; 935 std::unique_ptr<VideoFrameQualityValidator> quality_validator_;
932 936
933 // The time when the first frame is submitted for encode. 937 // The time when the first frame is submitted for encode.
934 base::TimeTicks first_frame_start_time_; 938 base::TimeTicks first_frame_start_time_;
935 939
936 // The time when the last encoded frame is ready. 940 // The time when the last encoded frame is ready.
937 base::TimeTicks last_frame_ready_time_; 941 base::TimeTicks last_frame_ready_time_;
938 942
939 // All methods of this class should be run on the same thread. 943 // All methods of this class should be run on the same thread.
940 base::ThreadChecker thread_checker_; 944 base::ThreadChecker thread_checker_;
941 945
942 // Requested bitrate in bits per second. 946 // Requested bitrate in bits per second.
943 unsigned int requested_bitrate_; 947 unsigned int requested_bitrate_;
944 948
945 // Requested initial framerate. 949 // Requested initial framerate.
946 unsigned int requested_framerate_; 950 unsigned int requested_framerate_;
947 951
948 // Bitrate to switch to in the middle of the stream. 952 // Bitrate to switch to in the middle of the stream.
949 unsigned int requested_subsequent_bitrate_; 953 unsigned int requested_subsequent_bitrate_;
950 954
951 // Framerate to switch to in the middle of the stream. 955 // Framerate to switch to in the middle of the stream.
952 unsigned int requested_subsequent_framerate_; 956 unsigned int requested_subsequent_framerate_;
953 957
954 // The timer used to feed the encoder with the input frames. 958 // The timer used to feed the encoder with the input frames.
955 std::unique_ptr<base::RepeatingTimer> input_timer_; 959 std::unique_ptr<base::RepeatingTimer> input_timer_;
960
961 // The timestamps for each frame in the order of CreateFrame() invocation.
962 std::queue<base::TimeDelta> frame_timestamps_;
956 }; 963 };
957 964
958 VEAClient::VEAClient(TestStream* test_stream, 965 VEAClient::VEAClient(TestStream* test_stream,
959 ClientStateNotification<ClientState>* note, 966 ClientStateNotification<ClientState>* note,
960 bool save_to_file, 967 bool save_to_file,
961 unsigned int keyframe_period, 968 unsigned int keyframe_period,
962 bool force_bitrate, 969 bool force_bitrate,
963 bool test_perf, 970 bool test_perf,
964 bool mid_stream_bitrate_switch, 971 bool mid_stream_bitrate_switch,
965 bool mid_stream_framerate_switch, 972 bool mid_stream_framerate_switch,
966 bool verify_output) 973 bool verify_output,
974 bool verify_output_timestamp)
967 : state_(CS_CREATED), 975 : state_(CS_CREATED),
968 test_stream_(test_stream), 976 test_stream_(test_stream),
969 note_(note), 977 note_(note),
970 next_input_id_(0), 978 next_input_id_(0),
971 next_output_buffer_id_(0), 979 next_output_buffer_id_(0),
972 pos_in_input_stream_(0), 980 pos_in_input_stream_(0),
973 num_required_input_buffers_(0), 981 num_required_input_buffers_(0),
974 output_buffer_size_(0), 982 output_buffer_size_(0),
975 num_frames_to_encode_(0), 983 num_frames_to_encode_(0),
976 num_encoded_frames_(0), 984 num_encoded_frames_(0),
977 num_frames_since_last_check_(0), 985 num_frames_since_last_check_(0),
978 seen_keyframe_in_this_buffer_(false), 986 seen_keyframe_in_this_buffer_(false),
979 save_to_file_(save_to_file), 987 save_to_file_(save_to_file),
980 keyframe_period_(keyframe_period), 988 keyframe_period_(keyframe_period),
981 num_keyframes_requested_(0), 989 num_keyframes_requested_(0),
982 next_keyframe_at_(0), 990 next_keyframe_at_(0),
983 force_bitrate_(force_bitrate), 991 force_bitrate_(force_bitrate),
984 current_requested_bitrate_(0), 992 current_requested_bitrate_(0),
985 current_framerate_(0), 993 current_framerate_(0),
986 encoded_stream_size_since_last_check_(0), 994 encoded_stream_size_since_last_check_(0),
987 test_perf_(test_perf), 995 test_perf_(test_perf),
988 verify_output_(verify_output), 996 verify_output_(verify_output),
997 verify_output_timestamp_(verify_output_timestamp),
989 requested_bitrate_(0), 998 requested_bitrate_(0),
990 requested_framerate_(0), 999 requested_framerate_(0),
991 requested_subsequent_bitrate_(0), 1000 requested_subsequent_bitrate_(0),
992 requested_subsequent_framerate_(0) { 1001 requested_subsequent_framerate_(0) {
993 if (keyframe_period_) 1002 if (keyframe_period_)
994 LOG_ASSERT(kMaxKeyframeDelay < keyframe_period_); 1003 LOG_ASSERT(kMaxKeyframeDelay < keyframe_period_);
995 1004
996 // Fake encoder produces an invalid stream, so skip validating it. 1005 // Fake encoder produces an invalid stream, so skip validating it.
997 if (!g_fake_encoder) { 1006 if (!g_fake_encoder) {
998 stream_validator_ = StreamValidator::Create( 1007 stream_validator_ = StreamValidator::Create(
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
1220 ASSERT_LE(payload_size, output_buffer_size_); 1229 ASSERT_LE(payload_size, output_buffer_size_);
1221 1230
1222 IdToSHM::iterator it = output_buffers_at_client_.find(bitstream_buffer_id); 1231 IdToSHM::iterator it = output_buffers_at_client_.find(bitstream_buffer_id);
1223 ASSERT_NE(it, output_buffers_at_client_.end()); 1232 ASSERT_NE(it, output_buffers_at_client_.end());
1224 base::SharedMemory* shm = it->second; 1233 base::SharedMemory* shm = it->second;
1225 output_buffers_at_client_.erase(it); 1234 output_buffers_at_client_.erase(it);
1226 1235
1227 if (state_ == CS_FINISHED || state_ == CS_VALIDATED) 1236 if (state_ == CS_FINISHED || state_ == CS_VALIDATED)
1228 return; 1237 return;
1229 1238
1239 if (verify_output_timestamp_) {
1240 CHECK(!frame_timestamps_.empty());
henryhsu 2016/07/07 07:44:58 s/CHECK/EXPECT_TRUE/
shenghao1 2016/07/07 09:49:50 Done.
1241
1242 // One input frame may be mapped to multiple output frames, so the current
1243 // timestamp should be equal to one of the top two elements in
1244 // frame_timestamps_.
1245 if (timestamp != frame_timestamps_.front()) {
1246 frame_timestamps_.pop();
1247 CHECK_EQ(timestamp, frame_timestamps_.front());
henryhsu 2016/07/07 07:44:58 s/CHECK_EQ/EXPECT_EQ/ to fail this test case and r
shenghao1 2016/07/07 09:49:50 Done.
1248 }
1249 }
1250
1230 encoded_stream_size_since_last_check_ += payload_size; 1251 encoded_stream_size_since_last_check_ += payload_size;
1231 1252
1232 const uint8_t* stream_ptr = static_cast<const uint8_t*>(shm->memory()); 1253 const uint8_t* stream_ptr = static_cast<const uint8_t*>(shm->memory());
1233 if (payload_size > 0) { 1254 if (payload_size > 0) {
1234 if (stream_validator_) { 1255 if (stream_validator_) {
1235 stream_validator_->ProcessStreamBuffer(stream_ptr, payload_size); 1256 stream_validator_->ProcessStreamBuffer(stream_ptr, payload_size);
1236 } else { 1257 } else {
1237 HandleEncodedFrame(key_frame); 1258 HandleEncodedFrame(key_frame);
1238 } 1259 }
1239 1260
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
1356 // we require for bitrate tests. 1377 // we require for bitrate tests.
1357 pos_in_input_stream_ = 0; 1378 pos_in_input_stream_ = 0;
1358 } 1379 }
1359 1380
1360 if (quality_validator_) 1381 if (quality_validator_)
1361 quality_validator_->AddOriginalFrame(CreateFrame(pos_in_input_stream_)); 1382 quality_validator_->AddOriginalFrame(CreateFrame(pos_in_input_stream_));
1362 1383
1363 int32_t input_id; 1384 int32_t input_id;
1364 scoped_refptr<VideoFrame> video_frame = 1385 scoped_refptr<VideoFrame> video_frame =
1365 PrepareInputFrame(pos_in_input_stream_, &input_id); 1386 PrepareInputFrame(pos_in_input_stream_, &input_id);
1387 frame_timestamps_.push(video_frame->timestamp());
1366 pos_in_input_stream_ += test_stream_->aligned_buffer_size; 1388 pos_in_input_stream_ += test_stream_->aligned_buffer_size;
1367 1389
1368 bool force_keyframe = false; 1390 bool force_keyframe = false;
1369 if (keyframe_period_ && input_id % keyframe_period_ == 0) { 1391 if (keyframe_period_ && input_id % keyframe_period_ == 0) {
1370 force_keyframe = true; 1392 force_keyframe = true;
1371 ++num_keyframes_requested_; 1393 ++num_keyframes_requested_;
1372 } 1394 }
1373 1395
1374 if (input_id == 0) { 1396 if (input_id == 0) {
1375 first_frame_start_time_ = base::TimeTicks::Now(); 1397 first_frame_start_time_ = base::TimeTicks::Now();
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
1547 // - Number of concurrent encoders. The value takes effect when there is only 1569 // - Number of concurrent encoders. The value takes effect when there is only
1548 // one input stream; otherwise, one encoder per input stream will be 1570 // one input stream; otherwise, one encoder per input stream will be
1549 // instantiated. 1571 // instantiated.
1550 // - If true, save output to file (provided an output filename was supplied). 1572 // - If true, save output to file (provided an output filename was supplied).
1551 // - Force a keyframe every n frames. 1573 // - Force a keyframe every n frames.
1552 // - Force bitrate; the actual required value is provided as a property 1574 // - Force bitrate; the actual required value is provided as a property
1553 // of the input stream, because it depends on stream type/resolution/etc. 1575 // of the input stream, because it depends on stream type/resolution/etc.
1554 // - If true, measure performance. 1576 // - If true, measure performance.
1555 // - If true, switch bitrate mid-stream. 1577 // - If true, switch bitrate mid-stream.
1556 // - If true, switch framerate mid-stream. 1578 // - If true, switch framerate mid-stream.
1557 // - If true, verify the output frames of encoder. 1579 // - If true, verify the output frames of encoder.
henryhsu 2016/07/07 07:44:58 Add comment for the new parameter
shenghao1 2016/07/07 09:49:50 Done.
1558 class VideoEncodeAcceleratorTest 1580 class VideoEncodeAcceleratorTest
1559 : public ::testing::TestWithParam< 1581 : public ::testing::TestWithParam<
1560 std::tuple<int, bool, int, bool, bool, bool, bool, bool>> {}; 1582 std::tuple<int, bool, int, bool, bool, bool, bool, bool, bool>> {};
1561 1583
1562 TEST_P(VideoEncodeAcceleratorTest, TestSimpleEncode) { 1584 TEST_P(VideoEncodeAcceleratorTest, TestSimpleEncode) {
1563 size_t num_concurrent_encoders = std::get<0>(GetParam()); 1585 size_t num_concurrent_encoders = std::get<0>(GetParam());
1564 const bool save_to_file = std::get<1>(GetParam()); 1586 const bool save_to_file = std::get<1>(GetParam());
1565 const unsigned int keyframe_period = std::get<2>(GetParam()); 1587 const unsigned int keyframe_period = std::get<2>(GetParam());
1566 const bool force_bitrate = std::get<3>(GetParam()); 1588 const bool force_bitrate = std::get<3>(GetParam());
1567 const bool test_perf = std::get<4>(GetParam()); 1589 const bool test_perf = std::get<4>(GetParam());
1568 const bool mid_stream_bitrate_switch = std::get<5>(GetParam()); 1590 const bool mid_stream_bitrate_switch = std::get<5>(GetParam());
1569 const bool mid_stream_framerate_switch = std::get<6>(GetParam()); 1591 const bool mid_stream_framerate_switch = std::get<6>(GetParam());
1570 const bool verify_output = 1592 const bool verify_output =
1571 std::get<7>(GetParam()) || g_env->verify_all_output(); 1593 std::get<7>(GetParam()) || g_env->verify_all_output();
1594 const bool verify_output_timestamp = std::get<8>(GetParam());
1572 1595
1573 ScopedVector<ClientStateNotification<ClientState>> notes; 1596 ScopedVector<ClientStateNotification<ClientState>> notes;
1574 ScopedVector<VEAClient> clients; 1597 ScopedVector<VEAClient> clients;
1575 base::Thread encoder_thread("EncoderThread"); 1598 base::Thread encoder_thread("EncoderThread");
1576 ASSERT_TRUE(encoder_thread.Start()); 1599 ASSERT_TRUE(encoder_thread.Start());
1577 1600
1578 if (g_env->test_streams_.size() > 1) 1601 if (g_env->test_streams_.size() > 1)
1579 num_concurrent_encoders = g_env->test_streams_.size(); 1602 num_concurrent_encoders = g_env->test_streams_.size();
1580 1603
1581 // Create all encoders. 1604 // Create all encoders.
1582 for (size_t i = 0; i < num_concurrent_encoders; i++) { 1605 for (size_t i = 0; i < num_concurrent_encoders; i++) {
1583 size_t test_stream_index = i % g_env->test_streams_.size(); 1606 size_t test_stream_index = i % g_env->test_streams_.size();
1584 // Disregard save_to_file if we didn't get an output filename. 1607 // Disregard save_to_file if we didn't get an output filename.
1585 bool encoder_save_to_file = 1608 bool encoder_save_to_file =
1586 (save_to_file && 1609 (save_to_file &&
1587 !g_env->test_streams_[test_stream_index]->out_filename.empty()); 1610 !g_env->test_streams_[test_stream_index]->out_filename.empty());
1588 1611
1589 notes.push_back(new ClientStateNotification<ClientState>()); 1612 notes.push_back(new ClientStateNotification<ClientState>());
1590 clients.push_back(new VEAClient( 1613 clients.push_back(new VEAClient(
1591 g_env->test_streams_[test_stream_index], notes.back(), 1614 g_env->test_streams_[test_stream_index], notes.back(),
1592 encoder_save_to_file, keyframe_period, force_bitrate, test_perf, 1615 encoder_save_to_file, keyframe_period, force_bitrate, test_perf,
1593 mid_stream_bitrate_switch, mid_stream_framerate_switch, verify_output)); 1616 mid_stream_bitrate_switch, mid_stream_framerate_switch, verify_output,
1617 verify_output_timestamp));
1594 1618
1595 encoder_thread.task_runner()->PostTask( 1619 encoder_thread.task_runner()->PostTask(
1596 FROM_HERE, base::Bind(&VEAClient::CreateEncoder, 1620 FROM_HERE, base::Bind(&VEAClient::CreateEncoder,
1597 base::Unretained(clients.back()))); 1621 base::Unretained(clients.back())));
1598 } 1622 }
1599 1623
1600 // All encoders must pass through states in this order. 1624 // All encoders must pass through states in this order.
1601 enum ClientState state_transitions[] = { 1625 enum ClientState state_transitions[] = {
1602 CS_ENCODER_SET, CS_INITIALIZED, CS_ENCODING, CS_FINISHED, CS_VALIDATED}; 1626 CS_ENCODER_SET, CS_INITIALIZED, CS_ENCODING, CS_FINISHED, CS_VALIDATED};
1603 1627
(...skipping 18 matching lines...) Expand all
1622 1646
1623 // This ensures all tasks have finished. 1647 // This ensures all tasks have finished.
1624 encoder_thread.Stop(); 1648 encoder_thread.Stop();
1625 } 1649 }
1626 1650
1627 #if !defined(OS_MACOSX) 1651 #if !defined(OS_MACOSX)
1628 INSTANTIATE_TEST_CASE_P( 1652 INSTANTIATE_TEST_CASE_P(
1629 SimpleEncode, 1653 SimpleEncode,
1630 VideoEncodeAcceleratorTest, 1654 VideoEncodeAcceleratorTest,
1631 ::testing::Values( 1655 ::testing::Values(
1632 std::make_tuple(1, true, 0, false, false, false, false, false), 1656 std::make_tuple(1, true, 0, false, false, false, false, false, false),
1633 std::make_tuple(1, true, 0, false, false, false, false, true))); 1657 std::make_tuple(1, true, 0, false, false, false, false, true, false)));
1634 1658
1635 INSTANTIATE_TEST_CASE_P( 1659 INSTANTIATE_TEST_CASE_P(
1636 EncoderPerf, 1660 EncoderPerf,
1637 VideoEncodeAcceleratorTest, 1661 VideoEncodeAcceleratorTest,
1638 ::testing::Values( 1662 ::testing::Values(
1639 std::make_tuple(1, false, 0, false, true, false, false, false))); 1663 std::make_tuple(1, false, 0, false, true, false, false, false, false)));
1640 1664
1641 INSTANTIATE_TEST_CASE_P( 1665 INSTANTIATE_TEST_CASE_P(ForceKeyframes,
henryhsu 2016/07/07 07:44:58 Is this generated by "git cl format"?
shenghao1 2016/07/07 09:49:50 yes
1642 ForceKeyframes, 1666 VideoEncodeAcceleratorTest,
1643 VideoEncodeAcceleratorTest, 1667 ::testing::Values(std::make_tuple(1,
1644 ::testing::Values( 1668 false,
1645 std::make_tuple(1, false, 10, false, false, false, false, false))); 1669 10,
1670 false,
1671 false,
1672 false,
1673 false,
1674 false,
1675 false)));
1646 1676
1647 INSTANTIATE_TEST_CASE_P( 1677 INSTANTIATE_TEST_CASE_P(
1648 ForceBitrate, 1678 ForceBitrate,
1649 VideoEncodeAcceleratorTest, 1679 VideoEncodeAcceleratorTest,
1650 ::testing::Values( 1680 ::testing::Values(
1651 std::make_tuple(1, false, 0, true, false, false, false, false))); 1681 std::make_tuple(1, false, 0, true, false, false, false, false, false)));
1652 1682
1653 INSTANTIATE_TEST_CASE_P( 1683 INSTANTIATE_TEST_CASE_P(
1654 MidStreamParamSwitchBitrate, 1684 MidStreamParamSwitchBitrate,
1655 VideoEncodeAcceleratorTest, 1685 VideoEncodeAcceleratorTest,
1656 ::testing::Values( 1686 ::testing::Values(
1657 std::make_tuple(1, false, 0, true, false, true, false, false))); 1687 std::make_tuple(1, false, 0, true, false, true, false, false, false)));
1658 1688
1659 INSTANTIATE_TEST_CASE_P( 1689 INSTANTIATE_TEST_CASE_P(
1660 MidStreamParamSwitchFPS, 1690 MidStreamParamSwitchFPS,
1661 VideoEncodeAcceleratorTest, 1691 VideoEncodeAcceleratorTest,
1662 ::testing::Values( 1692 ::testing::Values(
1663 std::make_tuple(1, false, 0, true, false, false, true, false))); 1693 std::make_tuple(1, false, 0, true, false, false, true, false, false)));
1664 1694
1665 INSTANTIATE_TEST_CASE_P( 1695 INSTANTIATE_TEST_CASE_P(
1666 MultipleEncoders, 1696 MultipleEncoders,
1667 VideoEncodeAcceleratorTest, 1697 VideoEncodeAcceleratorTest,
1668 ::testing::Values( 1698 ::testing::Values(
1669 std::make_tuple(3, false, 0, false, false, false, false, false), 1699 std::make_tuple(3, false, 0, false, false, false, false, false, false),
1670 std::make_tuple(3, false, 0, true, false, false, true, false), 1700 std::make_tuple(3, false, 0, true, false, false, true, false, false),
1671 std::make_tuple(3, false, 0, true, false, true, false, false))); 1701 std::make_tuple(3, false, 0, true, false, true, false, false, false)));
1702
1703 INSTANTIATE_TEST_CASE_P(
1704 VerifyTimestamp,
1705 VideoEncodeAcceleratorTest,
1706 ::testing::Values(
1707 std::make_tuple(1, true, 0, false, false, false, false, false, true)));
1708
1672 #else 1709 #else
1673 INSTANTIATE_TEST_CASE_P( 1710 INSTANTIATE_TEST_CASE_P(
1674 SimpleEncode, 1711 SimpleEncode,
1675 VideoEncodeAcceleratorTest, 1712 VideoEncodeAcceleratorTest,
1676 ::testing::Values( 1713 ::testing::Values(
1677 std::make_tuple(1, true, 0, false, false, false, false, false), 1714 std::make_tuple(1, true, 0, false, false, false, false, false, false),
1678 std::make_tuple(1, true, 0, false, false, false, false, true))); 1715 std::make_tuple(1, true, 0, false, false, false, false, true, false)));
1679 1716
1680 INSTANTIATE_TEST_CASE_P( 1717 INSTANTIATE_TEST_CASE_P(
1681 EncoderPerf, 1718 EncoderPerf,
1682 VideoEncodeAcceleratorTest, 1719 VideoEncodeAcceleratorTest,
1683 ::testing::Values( 1720 ::testing::Values(
1684 std::make_tuple(1, false, 0, false, true, false, false, false))); 1721 std::make_tuple(1, false, 0, false, true, false, false, false, false)));
1685 1722
1686 INSTANTIATE_TEST_CASE_P( 1723 INSTANTIATE_TEST_CASE_P(MultipleEncoders,
1687 MultipleEncoders, 1724 VideoEncodeAcceleratorTest,
1688 VideoEncodeAcceleratorTest, 1725 ::testing::Values(std::make_tuple(3,
1689 ::testing::Values( 1726 false,
1690 std::make_tuple(3, false, 0, false, false, false, false, false))); 1727 0,
1728 false,
1729 false,
1730 false,
1731 false,
1732 false,
1733 false)));
1691 #endif 1734 #endif
1692 1735
1693 // TODO(posciak): more tests: 1736 // TODO(posciak): more tests:
1694 // - async FeedEncoderWithOutput 1737 // - async FeedEncoderWithOutput
1695 // - out-of-order return of outputs to encoder 1738 // - out-of-order return of outputs to encoder
1696 // - multiple encoders + decoders 1739 // - multiple encoders + decoders
1697 // - mid-stream encoder_->Destroy() 1740 // - mid-stream encoder_->Destroy()
1698 1741
1699 } // namespace 1742 } // namespace
1700 } // namespace media 1743 } // namespace media
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
1778 1821
1779 media::g_env = 1822 media::g_env =
1780 reinterpret_cast<media::VideoEncodeAcceleratorTestEnvironment*>( 1823 reinterpret_cast<media::VideoEncodeAcceleratorTestEnvironment*>(
1781 testing::AddGlobalTestEnvironment( 1824 testing::AddGlobalTestEnvironment(
1782 new media::VideoEncodeAcceleratorTestEnvironment( 1825 new media::VideoEncodeAcceleratorTestEnvironment(
1783 std::move(test_stream_data), log_path, run_at_fps, 1826 std::move(test_stream_data), log_path, run_at_fps,
1784 needs_encode_latency, verify_all_output))); 1827 needs_encode_latency, verify_all_output)));
1785 1828
1786 return RUN_ALL_TESTS(); 1829 return RUN_ALL_TESTS();
1787 } 1830 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698