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

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

Issue 292183011: Make DefaultDeleter for Video{De|En}codeAccelerator (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: out-of-line DefaultDeleter::operator() Created 6 years, 6 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 | Annotate | Revision Log
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/file_util.h" 8 #include "base/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 566 matching lines...) Expand 10 before | Expand all | Expand 10 after
577 577
578 SetStreamParameters(test_stream_.requested_bitrate, 578 SetStreamParameters(test_stream_.requested_bitrate,
579 test_stream_.requested_framerate); 579 test_stream_.requested_framerate);
580 SetState(CS_INITIALIZED); 580 SetState(CS_INITIALIZED);
581 } 581 }
582 582
583 void VEAClient::DestroyEncoder() { 583 void VEAClient::DestroyEncoder() {
584 DCHECK(thread_checker_.CalledOnValidThread()); 584 DCHECK(thread_checker_.CalledOnValidThread());
585 if (!has_encoder()) 585 if (!has_encoder())
586 return; 586 return;
587 encoder_.release()->Destroy(); 587 encoder_.reset();
588 } 588 }
589 589
590 double VEAClient::frames_per_second() { 590 double VEAClient::frames_per_second() {
591 base::TimeDelta duration = last_frame_ready_time_ - encode_start_time_; 591 base::TimeDelta duration = last_frame_ready_time_ - encode_start_time_;
592 return num_encoded_frames_ / duration.InSecondsF(); 592 return num_encoded_frames_ / duration.InSecondsF();
593 } 593 }
594 594
595 void VEAClient::RequireBitstreamBuffers(unsigned int input_count, 595 void VEAClient::RequireBitstreamBuffers(unsigned int input_count,
596 const gfx::Size& input_coded_size, 596 const gfx::Size& input_coded_size,
597 size_t output_size) { 597 size_t output_size) {
(...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after
1018 test_stream_data->assign(it->second.c_str()); 1018 test_stream_data->assign(it->second.c_str());
1019 continue; 1019 continue;
1020 } 1020 }
1021 if (it->first == "v" || it->first == "vmodule") 1021 if (it->first == "v" || it->first == "vmodule")
1022 continue; 1022 continue;
1023 LOG(FATAL) << "Unexpected switch: " << it->first << ":" << it->second; 1023 LOG(FATAL) << "Unexpected switch: " << it->first << ":" << it->second;
1024 } 1024 }
1025 1025
1026 return RUN_ALL_TESTS(); 1026 return RUN_ALL_TESTS();
1027 } 1027 }
OLDNEW
« no previous file with comments | « content/common/gpu/media/video_decode_accelerator_unittest.cc ('k') | content/renderer/media/rtc_video_encoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698