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

Side by Side Diff: media/base/demuxer_perftest.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 | « content/renderer/render_frame_impl.cc ('k') | media/base/media_log.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 <stddef.h> 5 #include <stddef.h>
6 #include <stdint.h> 6 #include <stdint.h>
7 #include <memory> 7 #include <memory>
8 8
9 #include "base/at_exit.h" 9 #include "base/at_exit.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 index = i; 171 index = i;
172 } 172 }
173 } 173 }
174 CHECK_GE(index, 0) << "Couldn't find a stream to read"; 174 CHECK_GE(index, 0) << "Couldn't find a stream to read";
175 return index; 175 return index;
176 } 176 }
177 177
178 static void RunDemuxerBenchmark(const std::string& filename) { 178 static void RunDemuxerBenchmark(const std::string& filename) {
179 base::FilePath file_path(GetTestDataFilePath(filename)); 179 base::FilePath file_path(GetTestDataFilePath(filename));
180 base::TimeDelta total_time; 180 base::TimeDelta total_time;
181 MediaLog media_log_;
181 for (int i = 0; i < kBenchmarkIterations; ++i) { 182 for (int i = 0; i < kBenchmarkIterations; ++i) {
182 // Setup. 183 // Setup.
183 base::test::ScopedTaskScheduler scoped_task_scheduler; 184 base::test::ScopedTaskScheduler scoped_task_scheduler;
184 DemuxerHostImpl demuxer_host; 185 DemuxerHostImpl demuxer_host;
185 FileDataSource data_source; 186 FileDataSource data_source;
186 ASSERT_TRUE(data_source.Initialize(file_path)); 187 ASSERT_TRUE(data_source.Initialize(file_path));
187 188
188 Demuxer::EncryptedMediaInitDataCB encrypted_media_init_data_cb = 189 Demuxer::EncryptedMediaInitDataCB encrypted_media_init_data_cb =
189 base::Bind(&OnEncryptedMediaInitData); 190 base::Bind(&OnEncryptedMediaInitData);
190 Demuxer::MediaTracksUpdatedCB tracks_updated_cb = 191 Demuxer::MediaTracksUpdatedCB tracks_updated_cb =
191 base::Bind(&OnMediaTracksUpdated); 192 base::Bind(&OnMediaTracksUpdated);
192 FFmpegDemuxer demuxer(base::ThreadTaskRunnerHandle::Get(), &data_source, 193 FFmpegDemuxer demuxer(base::ThreadTaskRunnerHandle::Get(), &data_source,
193 encrypted_media_init_data_cb, tracks_updated_cb, 194 encrypted_media_init_data_cb, tracks_updated_cb,
194 new MediaLog()); 195 &media_log_);
195 196
196 { 197 {
197 base::RunLoop run_loop; 198 base::RunLoop run_loop;
198 demuxer.Initialize( 199 demuxer.Initialize(
199 &demuxer_host, 200 &demuxer_host,
200 base::Bind(&QuitLoopWithStatus, run_loop.QuitClosure()), false); 201 base::Bind(&QuitLoopWithStatus, run_loop.QuitClosure()), false);
201 run_loop.Run(); 202 run_loop.Run();
202 } 203 }
203 204
204 StreamReader stream_reader(&demuxer, false); 205 StreamReader stream_reader(&demuxer, false);
(...skipping 26 matching lines...) Expand all
231 #if BUILDFLAG(USE_PROPRIETARY_CODECS) 232 #if BUILDFLAG(USE_PROPRIETARY_CODECS)
232 RunDemuxerBenchmark("bear-1280x720.mp4"); 233 RunDemuxerBenchmark("bear-1280x720.mp4");
233 RunDemuxerBenchmark("sfx.mp3"); 234 RunDemuxerBenchmark("sfx.mp3");
234 #endif 235 #endif
235 #if BUILDFLAG(USE_PROPRIETARY_CODECS) && defined(OS_CHROMEOS) 236 #if BUILDFLAG(USE_PROPRIETARY_CODECS) && defined(OS_CHROMEOS)
236 RunDemuxerBenchmark("bear.avi"); 237 RunDemuxerBenchmark("bear.avi");
237 #endif 238 #endif
238 } 239 }
239 240
240 } // namespace media 241 } // namespace media
OLDNEW
« no previous file with comments | « content/renderer/render_frame_impl.cc ('k') | media/base/media_log.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698