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

Side by Side Diff: media/base/demuxer_perftest.cc

Issue 23702007: Render inband text tracks in the media pipeline (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: fix compile errors 11/21 #6 Created 7 years, 1 month 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/base/demuxer.h ('k') | media/base/demuxer_stream.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 "base/at_exit.h" 5 #include "base/at_exit.h"
6 #include "base/bind.h" 6 #include "base/bind.h"
7 #include "base/message_loop/message_loop.h" 7 #include "base/message_loop/message_loop.h"
8 #include "base/strings/string_number_conversions.h" 8 #include "base/strings/string_number_conversions.h"
9 #include "base/time/time.h" 9 #include "base/time/time.h"
10 #include "media/base/media.h" 10 #include "media/base/media.h"
(...skipping 15 matching lines...) Expand all
26 26
27 // DataSourceHost implementation. 27 // DataSourceHost implementation.
28 virtual void SetTotalBytes(int64 total_bytes) OVERRIDE {} 28 virtual void SetTotalBytes(int64 total_bytes) OVERRIDE {}
29 virtual void AddBufferedByteRange(int64 start, int64 end) OVERRIDE {} 29 virtual void AddBufferedByteRange(int64 start, int64 end) OVERRIDE {}
30 virtual void AddBufferedTimeRange(base::TimeDelta start, 30 virtual void AddBufferedTimeRange(base::TimeDelta start,
31 base::TimeDelta end) OVERRIDE {} 31 base::TimeDelta end) OVERRIDE {}
32 32
33 // DemuxerHost implementation. 33 // DemuxerHost implementation.
34 virtual void SetDuration(base::TimeDelta duration) OVERRIDE {} 34 virtual void SetDuration(base::TimeDelta duration) OVERRIDE {}
35 virtual void OnDemuxerError(media::PipelineStatus error) OVERRIDE {} 35 virtual void OnDemuxerError(media::PipelineStatus error) OVERRIDE {}
36 virtual void AddTextStream(media::DemuxerStream* text_stream,
37 const media::TextTrackConfig& config) OVERRIDE {}
38 virtual void RemoveTextStream(media::DemuxerStream* text_stream) OVERRIDE {}
36 39
37 private: 40 private:
38 DISALLOW_COPY_AND_ASSIGN(DemuxerHostImpl); 41 DISALLOW_COPY_AND_ASSIGN(DemuxerHostImpl);
39 }; 42 };
40 43
41 static void QuitLoopWithStatus(base::MessageLoop* message_loop, 44 static void QuitLoopWithStatus(base::MessageLoop* message_loop,
42 media::PipelineStatus status) { 45 media::PipelineStatus status) {
43 CHECK_EQ(status, media::PIPELINE_OK); 46 CHECK_EQ(status, media::PIPELINE_OK);
44 message_loop->PostTask(FROM_HERE, base::MessageLoop::QuitWhenIdleClosure()); 47 message_loop->PostTask(FROM_HERE, base::MessageLoop::QuitWhenIdleClosure());
45 } 48 }
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 DemuxerHostImpl demuxer_host; 178 DemuxerHostImpl demuxer_host;
176 FileDataSource data_source; 179 FileDataSource data_source;
177 ASSERT_TRUE(data_source.Initialize(file_path)); 180 ASSERT_TRUE(data_source.Initialize(file_path));
178 181
179 Demuxer::NeedKeyCB need_key_cb = base::Bind(&NeedKey); 182 Demuxer::NeedKeyCB need_key_cb = base::Bind(&NeedKey);
180 FFmpegDemuxer demuxer(message_loop.message_loop_proxy(), 183 FFmpegDemuxer demuxer(message_loop.message_loop_proxy(),
181 &data_source, 184 &data_source,
182 need_key_cb, 185 need_key_cb,
183 new MediaLog()); 186 new MediaLog());
184 187
185 demuxer.Initialize(&demuxer_host, base::Bind( 188 demuxer.Initialize(&demuxer_host,
186 &QuitLoopWithStatus, &message_loop)); 189 base::Bind(&QuitLoopWithStatus, &message_loop),
190 false);
187 message_loop.Run(); 191 message_loop.Run();
188 StreamReader stream_reader(&demuxer, false); 192 StreamReader stream_reader(&demuxer, false);
189 193
190 // Benchmark. 194 // Benchmark.
191 base::TimeTicks start = base::TimeTicks::HighResNow(); 195 base::TimeTicks start = base::TimeTicks::HighResNow();
192 while (!stream_reader.IsDone()) { 196 while (!stream_reader.IsDone()) {
193 stream_reader.Read(); 197 stream_reader.Read();
194 } 198 }
195 base::TimeTicks end = base::TimeTicks::HighResNow(); 199 base::TimeTicks end = base::TimeTicks::HighResNow();
196 total_time += (end - start).InSecondsF(); 200 total_time += (end - start).InSecondsF();
(...skipping 20 matching lines...) Expand all
217 #endif 221 #endif
218 #if defined(OS_CHROMEOS) 222 #if defined(OS_CHROMEOS)
219 RunDemuxerBenchmark("bear.flac"); 223 RunDemuxerBenchmark("bear.flac");
220 #endif 224 #endif
221 #if defined(USE_PROPRIETARY_CODECS) && defined(OS_CHROMEOS) 225 #if defined(USE_PROPRIETARY_CODECS) && defined(OS_CHROMEOS)
222 RunDemuxerBenchmark("bear.avi"); 226 RunDemuxerBenchmark("bear.avi");
223 #endif 227 #endif
224 } 228 }
225 229
226 } // namespace media 230 } // namespace media
OLDNEW
« no previous file with comments | « media/base/demuxer.h ('k') | media/base/demuxer_stream.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698