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

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

Issue 847223002: Add a histogram for video decoder fallback. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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"
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698