OLD | NEW |
---|---|
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" |
11 #include "base/logging.h" | 11 #include "base/logging.h" |
12 #include "base/metrics/histogram_macros.h" | |
12 #include "base/single_thread_task_runner.h" | 13 #include "base/single_thread_task_runner.h" |
13 #include "media/base/audio_decoder.h" | 14 #include "media/base/audio_decoder.h" |
14 #include "media/base/bind_to_current_loop.h" | 15 #include "media/base/bind_to_current_loop.h" |
15 #include "media/base/decoder_buffer.h" | 16 #include "media/base/decoder_buffer.h" |
16 #include "media/base/demuxer_stream.h" | 17 #include "media/base/demuxer_stream.h" |
17 #include "media/base/video_decoder.h" | 18 #include "media/base/video_decoder.h" |
18 #include "media/filters/decrypting_demuxer_stream.h" | 19 #include "media/filters/decrypting_demuxer_stream.h" |
19 | 20 |
20 namespace media { | 21 namespace media { |
21 | 22 |
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
250 return; | 251 return; |
251 } | 252 } |
252 | 253 |
253 const std::string stream_type = DecoderStreamTraits<StreamType>::ToString(); | 254 const std::string stream_type = DecoderStreamTraits<StreamType>::ToString(); |
254 media_log_->SetBooleanProperty((stream_type + "_dds").c_str(), | 255 media_log_->SetBooleanProperty((stream_type + "_dds").c_str(), |
255 decrypting_demuxer_stream_); | 256 decrypting_demuxer_stream_); |
256 media_log_->SetStringProperty((stream_type + "_decoder").c_str(), | 257 media_log_->SetStringProperty((stream_type + "_decoder").c_str(), |
257 decoder_->GetDisplayName()); | 258 decoder_->GetDisplayName()); |
258 | 259 |
259 if (state_ == STATE_REINITIALIZING_DECODER) { | 260 if (state_ == STATE_REINITIALIZING_DECODER) { |
261 // Fall back succeeded. | |
262 if (GetStreamType() == DemuxerStream::VIDEO) | |
DaleCurtis
2015/01/13 19:20:50
Why the get StreamType() method? Does StreamType =
| |
263 UMA_HISTOGRAM_BOOLEAN("Media.VideoDecoderFallback", true); | |
260 CompleteDecoderReinitialization(true); | 264 CompleteDecoderReinitialization(true); |
261 return; | 265 return; |
262 } | 266 } |
263 | 267 |
264 // Initialization succeeded. | 268 // Initialization succeeded. |
269 if (GetStreamType() == DemuxerStream::VIDEO) | |
270 UMA_HISTOGRAM_BOOLEAN("Media.VideoDecoderFallback", false); | |
265 state_ = STATE_NORMAL; | 271 state_ = STATE_NORMAL; |
266 if (StreamTraits::NeedsBitstreamConversion(decoder_.get())) | 272 if (StreamTraits::NeedsBitstreamConversion(decoder_.get())) |
267 stream_->EnableBitstreamConverter(); | 273 stream_->EnableBitstreamConverter(); |
268 base::ResetAndReturn(&init_cb_).Run(true); | 274 base::ResetAndReturn(&init_cb_).Run(true); |
269 } | 275 } |
270 | 276 |
271 template <DemuxerStream::Type StreamType> | 277 template <DemuxerStream::Type StreamType> |
272 void DecoderStream<StreamType>::SatisfyRead( | 278 void DecoderStream<StreamType>::SatisfyRead( |
273 Status status, | 279 Status status, |
274 const scoped_refptr<Output>& output) { | 280 const scoped_refptr<Output>& output) { |
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
582 } | 588 } |
583 | 589 |
584 // The resetting process will be continued in OnDecoderReinitialized(). | 590 // The resetting process will be continued in OnDecoderReinitialized(). |
585 ReinitializeDecoder(); | 591 ReinitializeDecoder(); |
586 } | 592 } |
587 | 593 |
588 template class DecoderStream<DemuxerStream::VIDEO>; | 594 template class DecoderStream<DemuxerStream::VIDEO>; |
589 template class DecoderStream<DemuxerStream::AUDIO>; | 595 template class DecoderStream<DemuxerStream::AUDIO>; |
590 | 596 |
591 } // namespace media | 597 } // namespace media |
OLD | NEW |