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

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

Issue 2815303006: Convert MediaLog from being ref counted to owned by WebMediaPlayer. (Closed)
Patch Set: Rebase. Created 3 years, 8 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
« no previous file with comments | « media/formats/webm/webm_video_client.cc ('k') | media/mojo/services/interface_factory_impl.h » ('j') | 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 <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 712 matching lines...) Expand 10 before | Expand all | Expand 10 after
723 723
724 private: 724 private:
725 void InitializeCB(bool success); 725 void InitializeCB(bool success);
726 void DecodeDone(DecodeStatus status); 726 void DecodeDone(DecodeStatus status);
727 void FlushDone(DecodeStatus status); 727 void FlushDone(DecodeStatus status);
728 void VerifyOutputFrame(const scoped_refptr<VideoFrame>& output_frame); 728 void VerifyOutputFrame(const scoped_refptr<VideoFrame>& output_frame);
729 void Decode(); 729 void Decode();
730 730
731 enum State { UNINITIALIZED, INITIALIZED, DECODING, DECODER_ERROR }; 731 enum State { UNINITIALIZED, INITIALIZED, DECODING, DECODER_ERROR };
732 732
733 MediaLog media_log_;
733 const VideoCodecProfile profile_; 734 const VideoCodecProfile profile_;
734 std::unique_ptr<FFmpegVideoDecoder> decoder_; 735 std::unique_ptr<FFmpegVideoDecoder> decoder_;
735 VideoDecoder::DecodeCB decode_cb_; 736 VideoDecoder::DecodeCB decode_cb_;
736 // Decode callback of an EOS buffer. 737 // Decode callback of an EOS buffer.
737 VideoDecoder::DecodeCB eos_decode_cb_; 738 VideoDecoder::DecodeCB eos_decode_cb_;
738 // Callback of Flush(). Called after all frames are decoded. 739 // Callback of Flush(). Called after all frames are decoded.
739 const base::Closure flush_complete_cb_; 740 const base::Closure flush_complete_cb_;
740 const base::Closure decode_error_cb_; 741 const base::Closure decode_error_cb_;
741 State decoder_state_; 742 State decoder_state_;
742 std::queue<scoped_refptr<VideoFrame>> original_frames_; 743 std::queue<scoped_refptr<VideoFrame>> original_frames_;
743 std::queue<scoped_refptr<DecoderBuffer>> decode_buffers_; 744 std::queue<scoped_refptr<DecoderBuffer>> decode_buffers_;
744 base::ThreadChecker thread_checker_; 745 base::ThreadChecker thread_checker_;
745 }; 746 };
746 747
747 VideoFrameQualityValidator::VideoFrameQualityValidator( 748 VideoFrameQualityValidator::VideoFrameQualityValidator(
748 const VideoCodecProfile profile, 749 const VideoCodecProfile profile,
749 const base::Closure& flush_complete_cb, 750 const base::Closure& flush_complete_cb,
750 const base::Closure& decode_error_cb) 751 const base::Closure& decode_error_cb)
751 : profile_(profile), 752 : profile_(profile),
752 decoder_(new FFmpegVideoDecoder(make_scoped_refptr(new MediaLog()))), 753 decoder_(new FFmpegVideoDecoder(&media_log_)),
753 decode_cb_( 754 decode_cb_(
754 base::Bind(&VideoFrameQualityValidator::DecodeDone, AsWeakPtr())), 755 base::Bind(&VideoFrameQualityValidator::DecodeDone, AsWeakPtr())),
755 eos_decode_cb_( 756 eos_decode_cb_(
756 base::Bind(&VideoFrameQualityValidator::FlushDone, AsWeakPtr())), 757 base::Bind(&VideoFrameQualityValidator::FlushDone, AsWeakPtr())),
757 flush_complete_cb_(flush_complete_cb), 758 flush_complete_cb_(flush_complete_cb),
758 decode_error_cb_(decode_error_cb), 759 decode_error_cb_(decode_error_cb),
759 decoder_state_(UNINITIALIZED) { 760 decoder_state_(UNINITIALIZED) {
760 // Allow decoding of individual NALU. Entire frames are required by default. 761 // Allow decoding of individual NALU. Entire frames are required by default.
761 decoder_->set_decode_nalus(true); 762 decoder_->set_decode_nalus(true);
762 } 763 }
(...skipping 1614 matching lines...) Expand 10 before | Expand all | Expand 10 after
2377 2378
2378 media::g_env = 2379 media::g_env =
2379 reinterpret_cast<media::VideoEncodeAcceleratorTestEnvironment*>( 2380 reinterpret_cast<media::VideoEncodeAcceleratorTestEnvironment*>(
2380 testing::AddGlobalTestEnvironment( 2381 testing::AddGlobalTestEnvironment(
2381 new media::VideoEncodeAcceleratorTestEnvironment( 2382 new media::VideoEncodeAcceleratorTestEnvironment(
2382 std::move(test_stream_data), log_path, run_at_fps, 2383 std::move(test_stream_data), log_path, run_at_fps,
2383 needs_encode_latency, verify_all_output))); 2384 needs_encode_latency, verify_all_output)));
2384 2385
2385 return RUN_ALL_TESTS(); 2386 return RUN_ALL_TESTS();
2386 } 2387 }
OLDNEW
« no previous file with comments | « media/formats/webm/webm_video_client.cc ('k') | media/mojo/services/interface_factory_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698