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

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

Issue 2205623002: Use webrtc::VideoFrame timestamp in RTCVideoEncoder (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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
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 1557 matching lines...) Expand 10 before | Expand all | Expand 10 after
1568 FROM_HERE, base::TimeDelta::FromSeconds(1) / current_framerate_, 1568 FROM_HERE, base::TimeDelta::FromSeconds(1) / current_framerate_,
1569 base::Bind(&VEAClient::OnInputTimer, base::Unretained(this))); 1569 base::Bind(&VEAClient::OnInputTimer, base::Unretained(this)));
1570 } 1570 }
1571 } else if (num_encoded_frames_ == num_frames_to_encode_) { 1571 } else if (num_encoded_frames_ == num_frames_to_encode_) {
1572 LogPerf(); 1572 LogPerf();
1573 VerifyMinFPS(); 1573 VerifyMinFPS();
1574 VerifyStreamProperties(); 1574 VerifyStreamProperties();
1575 SetState(CS_FINISHED); 1575 SetState(CS_FINISHED);
1576 if (!quality_validator_) 1576 if (!quality_validator_)
1577 SetState(CS_VALIDATED); 1577 SetState(CS_VALIDATED);
1578 #if defined(OS_CHROMEOS)
pbos 2016/08/02 00:16:52 Can you comment on why this would/should only appl
emircan 2016/08/02 22:05:40 I removed ifdef and explained above.
1578 if (verify_output_timestamp_) { 1579 if (verify_output_timestamp_) {
1579 // There may be some timestamps left because we push extra frames to flush 1580 // There may be some timestamps left because we push extra frames to flush
1580 // encoder. 1581 // encoder.
1581 EXPECT_LE(frame_timestamps_.size(), 1582 EXPECT_LE(frame_timestamps_.size(),
1582 static_cast<size_t>(next_input_id_ - num_frames_to_encode_)); 1583 static_cast<size_t>(next_input_id_ - num_frames_to_encode_));
1583 } 1584 }
1585 #endif // defined(OS_CHROMEOS)
1584 return false; 1586 return false;
1585 } 1587 }
1586 1588
1587 return true; 1589 return true;
1588 } 1590 }
1589 1591
1590 void VEAClient::LogPerf() { 1592 void VEAClient::LogPerf() {
1591 g_env->LogToFile("Measured encoder FPS", 1593 g_env->LogToFile("Measured encoder FPS",
1592 base::StringPrintf("%.3f", frames_per_second())); 1594 base::StringPrintf("%.3f", frames_per_second()));
1593 1595
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after
1829 VideoEncodeAcceleratorTest, 1831 VideoEncodeAcceleratorTest,
1830 ::testing::Values(std::make_tuple(3, 1832 ::testing::Values(std::make_tuple(3,
1831 false, 1833 false,
1832 0, 1834 0,
1833 false, 1835 false,
1834 false, 1836 false,
1835 false, 1837 false,
1836 false, 1838 false,
1837 false, 1839 false,
1838 false))); 1840 false)));
1841
1842 #if defined(OS_MACOSX)
1843 INSTANTIATE_TEST_CASE_P(
1844 VerifyTimestamp,
1845 VideoEncodeAcceleratorTest,
1846 ::testing::Values(
1847 std::make_tuple(1, false, 0, false, false, false, false, false, true)));
1848 #endif // defined(OS_MACOSX)
1849
1839 #if defined(OS_WIN) 1850 #if defined(OS_WIN)
1840 INSTANTIATE_TEST_CASE_P( 1851 INSTANTIATE_TEST_CASE_P(
1841 ForceBitrate, 1852 ForceBitrate,
1842 VideoEncodeAcceleratorTest, 1853 VideoEncodeAcceleratorTest,
1843 ::testing::Values( 1854 ::testing::Values(
1844 std::make_tuple(1, false, 0, true, false, false, false, false, false))); 1855 std::make_tuple(1, false, 0, true, false, false, false, false, false)));
1845 #endif // defined(OS_WIN) 1856 #endif // defined(OS_WIN)
1846 1857
1847 #endif // defined(OS_CHROMEOS) 1858 #endif // defined(OS_CHROMEOS)
1848 1859
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
1934 1945
1935 media::g_env = 1946 media::g_env =
1936 reinterpret_cast<media::VideoEncodeAcceleratorTestEnvironment*>( 1947 reinterpret_cast<media::VideoEncodeAcceleratorTestEnvironment*>(
1937 testing::AddGlobalTestEnvironment( 1948 testing::AddGlobalTestEnvironment(
1938 new media::VideoEncodeAcceleratorTestEnvironment( 1949 new media::VideoEncodeAcceleratorTestEnvironment(
1939 std::move(test_stream_data), log_path, run_at_fps, 1950 std::move(test_stream_data), log_path, run_at_fps,
1940 needs_encode_latency, verify_all_output))); 1951 needs_encode_latency, verify_all_output)));
1941 1952
1942 return RUN_ALL_TESTS(); 1953 return RUN_ALL_TESTS();
1943 } 1954 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698