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

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

Issue 2626023003: Use GetProfileName() for logging VideoCodecProfile strings. (Closed)
Patch Set: Don't use GetProfileName() for H.264 VideoCodecProfile. Created 3 years, 11 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 unified diff | Download patch
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 <inttypes.h> 5 #include <inttypes.h>
6 #include <stddef.h> 6 #include <stddef.h>
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <memory> 10 #include <memory>
(...skipping 682 matching lines...) Expand 10 before | Expand all | Expand 10 after
693 std::unique_ptr<StreamValidator> StreamValidator::Create( 693 std::unique_ptr<StreamValidator> StreamValidator::Create(
694 VideoCodecProfile profile, 694 VideoCodecProfile profile,
695 const FrameFoundCallback& frame_cb) { 695 const FrameFoundCallback& frame_cb) {
696 std::unique_ptr<StreamValidator> validator; 696 std::unique_ptr<StreamValidator> validator;
697 697
698 if (IsH264(profile)) { 698 if (IsH264(profile)) {
699 validator.reset(new H264Validator(frame_cb)); 699 validator.reset(new H264Validator(frame_cb));
700 } else if (IsVP8(profile)) { 700 } else if (IsVP8(profile)) {
701 validator.reset(new VP8Validator(frame_cb)); 701 validator.reset(new VP8Validator(frame_cb));
702 } else { 702 } else {
703 LOG(FATAL) << "Unsupported profile: " << profile; 703 LOG(FATAL) << "Unsupported profile: " << GetProfileName(profile);
704 } 704 }
705 705
706 return validator; 706 return validator;
707 } 707 }
708 708
709 class VideoFrameQualityValidator { 709 class VideoFrameQualityValidator {
710 public: 710 public:
711 VideoFrameQualityValidator(const VideoCodecProfile profile, 711 VideoFrameQualityValidator(const VideoCodecProfile profile,
712 const base::Closure& flush_complete_cb, 712 const base::Closure& flush_complete_cb,
713 const base::Closure& decode_error_cb); 713 const base::Closure& decode_error_cb);
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
766 VideoDecoderConfig config; 766 VideoDecoderConfig config;
767 if (IsVP8(profile_)) 767 if (IsVP8(profile_))
768 config.Initialize(kCodecVP8, VP8PROFILE_ANY, kInputFormat, 768 config.Initialize(kCodecVP8, VP8PROFILE_ANY, kInputFormat,
769 COLOR_SPACE_UNSPECIFIED, coded_size, visible_size, 769 COLOR_SPACE_UNSPECIFIED, coded_size, visible_size,
770 natural_size, EmptyExtraData(), Unencrypted()); 770 natural_size, EmptyExtraData(), Unencrypted());
771 else if (IsH264(profile_)) 771 else if (IsH264(profile_))
772 config.Initialize(kCodecH264, H264PROFILE_MAIN, kInputFormat, 772 config.Initialize(kCodecH264, H264PROFILE_MAIN, kInputFormat,
773 COLOR_SPACE_UNSPECIFIED, coded_size, visible_size, 773 COLOR_SPACE_UNSPECIFIED, coded_size, visible_size,
774 natural_size, EmptyExtraData(), Unencrypted()); 774 natural_size, EmptyExtraData(), Unencrypted());
775 else 775 else
776 LOG_ASSERT(0) << "Invalid profile " << profile_; 776 LOG_ASSERT(0) << "Invalid profile " << GetProfileName(profile_);
777 777
778 decoder_->Initialize( 778 decoder_->Initialize(
779 config, false, nullptr, 779 config, false, nullptr,
780 base::Bind(&VideoFrameQualityValidator::InitializeCB, 780 base::Bind(&VideoFrameQualityValidator::InitializeCB,
781 base::Unretained(this)), 781 base::Unretained(this)),
782 base::Bind(&VideoFrameQualityValidator::VerifyOutputFrame, 782 base::Bind(&VideoFrameQualityValidator::VerifyOutputFrame,
783 base::Unretained(this))); 783 base::Unretained(this)));
784 } 784 }
785 785
786 void VideoFrameQualityValidator::InitializeCB(bool success) { 786 void VideoFrameQualityValidator::InitializeCB(bool success) {
(...skipping 1544 matching lines...) Expand 10 before | Expand all | Expand 10 after
2331 2331
2332 media::g_env = 2332 media::g_env =
2333 reinterpret_cast<media::VideoEncodeAcceleratorTestEnvironment*>( 2333 reinterpret_cast<media::VideoEncodeAcceleratorTestEnvironment*>(
2334 testing::AddGlobalTestEnvironment( 2334 testing::AddGlobalTestEnvironment(
2335 new media::VideoEncodeAcceleratorTestEnvironment( 2335 new media::VideoEncodeAcceleratorTestEnvironment(
2336 std::move(test_stream_data), log_path, run_at_fps, 2336 std::move(test_stream_data), log_path, run_at_fps,
2337 needs_encode_latency, verify_all_output))); 2337 needs_encode_latency, verify_all_output)));
2338 2338
2339 return RUN_ALL_TESTS(); 2339 return RUN_ALL_TESTS();
2340 } 2340 }
OLDNEW
« no previous file with comments | « media/gpu/video_decode_accelerator_unittest.cc ('k') | media/gpu/vt_video_encode_accelerator_mac.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698