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

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

Issue 686283002: Vaapi VEA: always generate IDR when keyframe is requested. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update unittest. Created 6 years, 1 month 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 | « content/common/gpu/media/vaapi_video_encode_accelerator.cc ('k') | 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 "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
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
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 }
OLDNEW
« no previous file with comments | « content/common/gpu/media/vaapi_video_encode_accelerator.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698