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

Side by Side Diff: media/filters/decoder_stream.cc

Issue 547913002: MediaLog: Log selected audio/video decoder name. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase only Created 6 years, 3 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "media/filters/decoder_stream.h" 5 #include "media/filters/decoder_stream.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/callback_helpers.h" 8 #include "base/callback_helpers.h"
9 #include "base/debug/trace_event.h" 9 #include "base/debug/trace_event.h"
10 #include "base/location.h" 10 #include "base/location.h"
(...skipping 24 matching lines...) Expand all
35 35
36 template <> 36 template <>
37 const char* GetTraceString<DemuxerStream::AUDIO>() { 37 const char* GetTraceString<DemuxerStream::AUDIO>() {
38 return "DecoderStream<AUDIO>::Decode"; 38 return "DecoderStream<AUDIO>::Decode";
39 } 39 }
40 40
41 template <DemuxerStream::Type StreamType> 41 template <DemuxerStream::Type StreamType>
42 DecoderStream<StreamType>::DecoderStream( 42 DecoderStream<StreamType>::DecoderStream(
43 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner, 43 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner,
44 ScopedVector<Decoder> decoders, 44 ScopedVector<Decoder> decoders,
45 const SetDecryptorReadyCB& set_decryptor_ready_cb) 45 const SetDecryptorReadyCB& set_decryptor_ready_cb,
46 const LogCB& log_cb)
46 : task_runner_(task_runner), 47 : task_runner_(task_runner),
48 log_cb_(log_cb),
47 state_(STATE_UNINITIALIZED), 49 state_(STATE_UNINITIALIZED),
48 stream_(NULL), 50 stream_(NULL),
49 low_delay_(false), 51 low_delay_(false),
50 decoder_selector_( 52 decoder_selector_(
51 new DecoderSelector<StreamType>(task_runner, 53 new DecoderSelector<StreamType>(task_runner,
52 decoders.Pass(), 54 decoders.Pass(),
53 set_decryptor_ready_cb)), 55 set_decryptor_ready_cb)),
54 active_splice_(false), 56 active_splice_(false),
55 decoding_eos_(false), 57 decoding_eos_(false),
56 pending_decode_requests_(0), 58 pending_decode_requests_(0),
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
229 if (!selected_decoder) { 231 if (!selected_decoder) {
230 state_ = STATE_UNINITIALIZED; 232 state_ = STATE_UNINITIALIZED;
231 base::ResetAndReturn(&init_cb_).Run(false); 233 base::ResetAndReturn(&init_cb_).Run(false);
232 return; 234 return;
233 } 235 }
234 236
235 state_ = STATE_NORMAL; 237 state_ = STATE_NORMAL;
236 decoder_ = selected_decoder.Pass(); 238 decoder_ = selected_decoder.Pass();
237 decrypting_demuxer_stream_ = decrypting_demuxer_stream.Pass(); 239 decrypting_demuxer_stream_ = decrypting_demuxer_stream.Pass();
238 240
241 if (decrypting_demuxer_stream_)
242 MEDIA_LOG(log_cb_) << "DecryptingDemuxerStream selected";
243 MEDIA_LOG(log_cb_) << decoder_->GetDisplayName() << " selected";
xhwang 2014/09/08 17:31:21 In chrome://media-internals, you'll see something
244
239 if (StreamTraits::NeedsBitstreamConversion(decoder_.get())) 245 if (StreamTraits::NeedsBitstreamConversion(decoder_.get()))
240 stream_->EnableBitstreamConverter(); 246 stream_->EnableBitstreamConverter();
241 base::ResetAndReturn(&init_cb_).Run(true); 247 base::ResetAndReturn(&init_cb_).Run(true);
242 } 248 }
243 249
244 template <DemuxerStream::Type StreamType> 250 template <DemuxerStream::Type StreamType>
245 void DecoderStream<StreamType>::SatisfyRead( 251 void DecoderStream<StreamType>::SatisfyRead(
246 Status status, 252 Status status,
247 const scoped_refptr<Output>& output) { 253 const scoped_refptr<Output>& output) {
248 DCHECK(!read_cb_.is_null()); 254 DCHECK(!read_cb_.is_null());
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after
541 } 547 }
542 548
543 // The resetting process will be continued in OnDecoderReinitialized(). 549 // The resetting process will be continued in OnDecoderReinitialized().
544 ReinitializeDecoder(); 550 ReinitializeDecoder();
545 } 551 }
546 552
547 template class DecoderStream<DemuxerStream::VIDEO>; 553 template class DecoderStream<DemuxerStream::VIDEO>;
548 template class DecoderStream<DemuxerStream::AUDIO>; 554 template class DecoderStream<DemuxerStream::AUDIO>;
549 555
550 } // namespace media 556 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698