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

Unified 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: Rebase. 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/renderer/media/gpu/rtc_video_encoder.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/gpu/video_encode_accelerator_unittest.cc
diff --git a/media/gpu/video_encode_accelerator_unittest.cc b/media/gpu/video_encode_accelerator_unittest.cc
index ae28ea813655d2e695445076b0b73379b4221862..07a8b1caa3bf8f7f926ef842b5026c7660e14ce4 100644
--- a/media/gpu/video_encode_accelerator_unittest.cc
+++ b/media/gpu/video_encode_accelerator_unittest.cc
@@ -570,6 +570,9 @@ class H264Validator : public StreamValidator {
void H264Validator::ProcessStreamBuffer(const uint8_t* stream, size_t size) {
h264_parser_.SetStream(stream, static_cast<off_t>(size));
+ // Run |frame_cb_| for only first nalu.
+ bool frame_cb_called = false;
+
while (1) {
H264NALU nalu;
H264Parser::Result result;
@@ -590,10 +593,14 @@ void H264Validator::ProcessStreamBuffer(const uint8_t* stream, size_t size) {
keyframe = true;
// fallthrough
case H264NALU::kNonIDRSlice: {
+ // Stream may contain at most one frame.
Pawel Osciak 2016/08/26 02:00:45 If we require that, I think we should ASSERT on it
ASSERT_TRUE(seen_idr_);
seen_sps_ = seen_pps_ = false;
- if (!frame_cb_.Run(keyframe))
- return;
+ if (!frame_cb_called) {
+ frame_cb_called = true;
+ if (!frame_cb_.Run(keyframe))
+ return;
+ }
break;
}
@@ -1843,6 +1850,15 @@ INSTANTIATE_TEST_CASE_P(MultipleEncoders,
false,
false,
false)));
+
+#if defined(OS_MACOSX)
+INSTANTIATE_TEST_CASE_P(
+ VerifyTimestamp,
+ VideoEncodeAcceleratorTest,
+ ::testing::Values(
+ std::make_tuple(1, false, 0, false, false, false, false, false, true)));
+#endif // defined(OS_MACOSX)
+
#if defined(OS_WIN)
INSTANTIATE_TEST_CASE_P(
ForceBitrate,
« no previous file with comments | « content/renderer/media/gpu/rtc_video_encoder.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698