OLD | NEW |
---|---|
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 "base/at_exit.h" | 5 #include "base/at_exit.h" |
6 #include "base/bind.h" | 6 #include "base/bind.h" |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/files/file_util.h" | 8 #include "base/files/file_util.h" |
9 #include "base/files/memory_mapped_file.h" | 9 #include "base/files/memory_mapped_file.h" |
10 #include "base/memory/scoped_vector.h" | 10 #include "base/memory/scoped_vector.h" |
(...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
385 ASSERT_TRUE(seen_sps_); | 385 ASSERT_TRUE(seen_sps_); |
386 ASSERT_TRUE(seen_pps_); | 386 ASSERT_TRUE(seen_pps_); |
387 seen_idr_ = true; | 387 seen_idr_ = true; |
388 // fallthrough | 388 // fallthrough |
389 case media::H264NALU::kNonIDRSlice: { | 389 case media::H264NALU::kNonIDRSlice: { |
390 ASSERT_TRUE(seen_idr_); | 390 ASSERT_TRUE(seen_idr_); |
391 | 391 |
392 media::H264SliceHeader shdr; | 392 media::H264SliceHeader shdr; |
393 ASSERT_EQ(media::H264Parser::kOk, | 393 ASSERT_EQ(media::H264Parser::kOk, |
394 h264_parser_.ParseSliceHeader(nalu, &shdr)); | 394 h264_parser_.ParseSliceHeader(nalu, &shdr)); |
395 keyframe = shdr.IsISlice() || shdr.IsSISlice(); | 395 |
396 if (nalu.nal_unit_type == media::H264NALU::kIDRSlice) { | |
397 ASSERT_TRUE(shdr.IsISlice() || shdr.IsSISlice()); | |
398 keyframe = true; | |
Pawel Osciak
2014/10/30 01:38:33
Please instead move keyframe = true to the case ab
hshi1
2014/10/30 03:48:25
Done.
| |
399 } | |
396 | 400 |
397 if (!frame_cb_.Run(keyframe)) | 401 if (!frame_cb_.Run(keyframe)) |
398 return; | 402 return; |
399 break; | 403 break; |
400 } | 404 } |
401 | 405 |
402 case media::H264NALU::kSPS: { | 406 case media::H264NALU::kSPS: { |
403 int sps_id; | 407 int sps_id; |
404 ASSERT_EQ(media::H264Parser::kOk, h264_parser_.ParseSPS(&sps_id)); | 408 ASSERT_EQ(media::H264Parser::kOk, h264_parser_.ParseSPS(&sps_id)); |
405 seen_sps_ = true; | 409 seen_sps_ = true; |
(...skipping 797 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1203 } | 1207 } |
1204 | 1208 |
1205 content::g_env = | 1209 content::g_env = |
1206 reinterpret_cast<content::VideoEncodeAcceleratorTestEnvironment*>( | 1210 reinterpret_cast<content::VideoEncodeAcceleratorTestEnvironment*>( |
1207 testing::AddGlobalTestEnvironment( | 1211 testing::AddGlobalTestEnvironment( |
1208 new content::VideoEncodeAcceleratorTestEnvironment( | 1212 new content::VideoEncodeAcceleratorTestEnvironment( |
1209 test_stream_data.Pass()))); | 1213 test_stream_data.Pass()))); |
1210 | 1214 |
1211 return RUN_ALL_TESTS(); | 1215 return RUN_ALL_TESTS(); |
1212 } | 1216 } |
OLD | NEW |