Chromium Code Reviews| 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 7ba3fe8d83e6ef8be99a1efb7b94f6d108a7a73a..5f582b053f51af9de5e0eda777927bd6bbcafe6e 100644 |
| --- a/media/gpu/video_encode_accelerator_unittest.cc |
| +++ b/media/gpu/video_encode_accelerator_unittest.cc |
| @@ -564,6 +564,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 seen_nonidr = false; |
| + |
| while (1) { |
| H264NALU nalu; |
| H264Parser::Result result; |
| @@ -585,8 +588,11 @@ void H264Validator::ProcessStreamBuffer(const uint8_t* stream, size_t size) { |
| // fallthrough |
|
wuchengli
2016/08/11 06:06:04
This is fallthough. If there's only one kIDRSlice
|
| case H264NALU::kNonIDRSlice: { |
| ASSERT_TRUE(seen_idr_); |
|
wuchengli
2016/08/12 15:12:24
Please add some comments to explain the assumption
emircan
2016/08/24 21:29:17
I am adding a comment about the assumption.
|
| - if (!frame_cb_.Run(keyframe)) |
| - return; |
| + if (!seen_nonidr) { |
| + seen_nonidr = true; |
| + if (!frame_cb_.Run(keyframe)) |
|
wuchengli
2016/08/11 06:06:04
If we only call frame_cb_ once, we should probably
emircan
2016/08/11 16:49:15
I thought of that case, but |seen_idr_| is only se
wuchengli
2016/08/12 15:12:25
Yes. You are right. I didn't see the assertion.
S
emircan
2016/08/24 21:29:17
I agree |frame_cb_called| sounds better. Done.
|
| + return; |
| + } |
| break; |
| } |
| @@ -1836,6 +1842,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, |