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

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: Fix test failure - forgot to set current_encode_job_->keyframe. 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 367 matching lines...) Expand 10 before | Expand all | Expand 10 after
378 378
379 ASSERT_EQ(media::H264Parser::kOk, result); 379 ASSERT_EQ(media::H264Parser::kOk, result);
380 380
381 bool keyframe = false; 381 bool keyframe = false;
382 382
383 switch (nalu.nal_unit_type) { 383 switch (nalu.nal_unit_type) {
384 case media::H264NALU::kIDRSlice: 384 case media::H264NALU::kIDRSlice:
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 keyframe = true;
388 // fallthrough 389 // fallthrough
389 case media::H264NALU::kNonIDRSlice: { 390 case media::H264NALU::kNonIDRSlice: {
390 ASSERT_TRUE(seen_idr_); 391 ASSERT_TRUE(seen_idr_);
391
392 media::H264SliceHeader shdr;
393 ASSERT_EQ(media::H264Parser::kOk,
394 h264_parser_.ParseSliceHeader(nalu, &shdr));
395 keyframe = shdr.IsISlice() || shdr.IsSISlice();
396
397 if (!frame_cb_.Run(keyframe)) 392 if (!frame_cb_.Run(keyframe))
398 return; 393 return;
399 break; 394 break;
400 } 395 }
401 396
402 case media::H264NALU::kSPS: { 397 case media::H264NALU::kSPS: {
403 int sps_id; 398 int sps_id;
404 ASSERT_EQ(media::H264Parser::kOk, h264_parser_.ParseSPS(&sps_id)); 399 ASSERT_EQ(media::H264Parser::kOk, h264_parser_.ParseSPS(&sps_id));
405 seen_sps_ = true; 400 seen_sps_ = true;
406 break; 401 break;
(...skipping 796 matching lines...) Expand 10 before | Expand all | Expand 10 after
1203 } 1198 }
1204 1199
1205 content::g_env = 1200 content::g_env =
1206 reinterpret_cast<content::VideoEncodeAcceleratorTestEnvironment*>( 1201 reinterpret_cast<content::VideoEncodeAcceleratorTestEnvironment*>(
1207 testing::AddGlobalTestEnvironment( 1202 testing::AddGlobalTestEnvironment(
1208 new content::VideoEncodeAcceleratorTestEnvironment( 1203 new content::VideoEncodeAcceleratorTestEnvironment(
1209 test_stream_data.Pass()))); 1204 test_stream_data.Pass())));
1210 1205
1211 return RUN_ALL_TESTS(); 1206 return RUN_ALL_TESTS();
1212 } 1207 }
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