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

Side by Side Diff: media/tools/demuxer_bench/demuxer_bench.cc

Issue 16297002: Update media/ to use scoped_refptr<T>::get() rather than implicit "operator T*" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 7 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
« no previous file with comments | « media/filters/vpx_video_decoder.cc ('k') | media/tools/player_x11/player_x11.cc » ('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 (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 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 return true; 136 return true;
137 } 137 }
138 138
139 void StreamReader::OnReadDone( 139 void StreamReader::OnReadDone(
140 base::MessageLoop* message_loop, 140 base::MessageLoop* message_loop,
141 bool* end_of_stream, 141 bool* end_of_stream,
142 base::TimeDelta* timestamp, 142 base::TimeDelta* timestamp,
143 media::DemuxerStream::Status status, 143 media::DemuxerStream::Status status,
144 const scoped_refptr<media::DecoderBuffer>& buffer) { 144 const scoped_refptr<media::DecoderBuffer>& buffer) {
145 CHECK_EQ(status, media::DemuxerStream::kOk); 145 CHECK_EQ(status, media::DemuxerStream::kOk);
146 CHECK(buffer); 146 CHECK(buffer.get());
147 *end_of_stream = buffer->IsEndOfStream(); 147 *end_of_stream = buffer->IsEndOfStream();
148 *timestamp = *end_of_stream ? media::kNoTimestamp() : buffer->GetTimestamp(); 148 *timestamp = *end_of_stream ? media::kNoTimestamp() : buffer->GetTimestamp();
149 message_loop->PostTask(FROM_HERE, base::MessageLoop::QuitWhenIdleClosure()); 149 message_loop->PostTask(FROM_HERE, base::MessageLoop::QuitWhenIdleClosure());
150 } 150 }
151 151
152 int StreamReader::GetNextStreamIndexToRead() { 152 int StreamReader::GetNextStreamIndexToRead() {
153 int index = -1; 153 int index = -1;
154 for (int i = 0; i < number_of_streams(); ++i) { 154 for (int i = 0; i < number_of_streams(); ++i) {
155 // Ignore streams at EOS. 155 // Ignore streams at EOS.
156 if (end_of_stream_[i]) 156 if (end_of_stream_[i])
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
228 std::cout << ", " << stream_reader.counts()[i] << " packets" << std::endl; 228 std::cout << ", " << stream_reader.counts()[i] << " packets" << std::endl;
229 } 229 }
230 230
231 // Teardown. 231 // Teardown.
232 demuxer.Stop(base::Bind( 232 demuxer.Stop(base::Bind(
233 &QuitLoopWithStatus, &message_loop, media::PIPELINE_OK)); 233 &QuitLoopWithStatus, &message_loop, media::PIPELINE_OK));
234 message_loop.Run(); 234 message_loop.Run();
235 235
236 return 0; 236 return 0;
237 } 237 }
OLDNEW
« no previous file with comments | « media/filters/vpx_video_decoder.cc ('k') | media/tools/player_x11/player_x11.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698