OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // demuxer_bench is a standalone benchmarking tool for FFmpegDemuxer. It | 5 // demuxer_bench is a standalone benchmarking tool for FFmpegDemuxer. It |
6 // simulates the reading requirements for playback by reading from the stream | 6 // simulates the reading requirements for playback by reading from the stream |
7 // that has the earliest timestamp. | 7 // that has the earliest timestamp. |
8 | 8 |
9 #include <iostream> | 9 #include <iostream> |
10 | 10 |
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
188 | 188 |
189 base::MessageLoop message_loop; | 189 base::MessageLoop message_loop; |
190 DemuxerHostImpl demuxer_host; | 190 DemuxerHostImpl demuxer_host; |
191 base::FilePath file_path(cmd_line->GetArgs()[0]); | 191 base::FilePath file_path(cmd_line->GetArgs()[0]); |
192 | 192 |
193 // Setup. | 193 // Setup. |
194 media::FileDataSource data_source; | 194 media::FileDataSource data_source; |
195 CHECK(data_source.Initialize(file_path)); | 195 CHECK(data_source.Initialize(file_path)); |
196 | 196 |
197 media::Demuxer::NeedKeyCB need_key_cb = base::Bind(&NeedKey); | 197 media::Demuxer::NeedKeyCB need_key_cb = base::Bind(&NeedKey); |
198 media::FFmpegAddTextTrackCB add_text_track_cb; | |
198 media::FFmpegDemuxer demuxer(message_loop.message_loop_proxy(), | 199 media::FFmpegDemuxer demuxer(message_loop.message_loop_proxy(), |
199 &data_source, | 200 &data_source, |
200 need_key_cb, | 201 need_key_cb, |
202 add_text_track_cb, | |
acolwell GONE FROM CHROMIUM
2013/10/08 15:45:24
nit: I don't believe this compiles. I think you ne
Matthew Heaney (Chromium)
2013/10/13 05:30:17
Done.
| |
201 new media::MediaLog()); | 203 new media::MediaLog()); |
202 | 204 |
203 demuxer.Initialize(&demuxer_host, base::Bind( | 205 demuxer.Initialize(&demuxer_host, base::Bind( |
204 &QuitLoopWithStatus, &message_loop)); | 206 &QuitLoopWithStatus, &message_loop)); |
205 message_loop.Run(); | 207 message_loop.Run(); |
206 | 208 |
207 StreamReader stream_reader( | 209 StreamReader stream_reader( |
208 &demuxer, cmd_line->HasSwitch(switches::kEnableBitstreamConverter)); | 210 &demuxer, cmd_line->HasSwitch(switches::kEnableBitstreamConverter)); |
209 | 211 |
210 // Benchmark. | 212 // Benchmark. |
(...skipping 20 matching lines...) Expand all Loading... | |
231 std::cout << ", " << stream_reader.counts()[i] << " packets" << std::endl; | 233 std::cout << ", " << stream_reader.counts()[i] << " packets" << std::endl; |
232 } | 234 } |
233 | 235 |
234 // Teardown. | 236 // Teardown. |
235 demuxer.Stop(base::Bind( | 237 demuxer.Stop(base::Bind( |
236 &QuitLoopWithStatus, &message_loop, media::PIPELINE_OK)); | 238 &QuitLoopWithStatus, &message_loop, media::PIPELINE_OK)); |
237 message_loop.Run(); | 239 message_loop.Run(); |
238 | 240 |
239 return 0; | 241 return 0; |
240 } | 242 } |
OLD | NEW |