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

Side by Side Diff: media/gpu/android_video_decode_accelerator.cc

Issue 2195443002: Add a histogram: Media.AVDA.NumAVDAInstances (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use ENUM & add units Created 4 years, 4 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
« no previous file with comments | « no previous file | tools/metrics/histograms/histograms.xml » ('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) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 "media/gpu/android_video_decode_accelerator.h" 5 #include "media/gpu/android_video_decode_accelerator.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <memory> 9 #include <memory>
10 10
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
187 // the thread might already be started even if there are no avda instances. 187 // the thread might already be started even if there are no avda instances.
188 // Plus, sometimes we just fail to start the thread. 188 // Plus, sometimes we just fail to start the thread.
189 if (!construction_thread_.IsRunning()) { 189 if (!construction_thread_.IsRunning()) {
190 if (!construction_thread_.Start()) { 190 if (!construction_thread_.Start()) {
191 LOG(ERROR) << "Failed to start construction thread."; 191 LOG(ERROR) << "Failed to start construction thread.";
192 return false; 192 return false;
193 } 193 }
194 } 194 }
195 195
196 thread_avda_instances_.insert(avda_instance); 196 thread_avda_instances_.insert(avda_instance);
197 UMA_HISTOGRAM_ENUMERATION("Media.AVDA.NumAVDAInstances",
198 thread_avda_instances_.size(),
199 31); // PRESUBMIT_IGNORE_UMA_MAX
197 return true; 200 return true;
198 } 201 }
199 202
200 // |avda_instance| will no longer need the construction thread. Stop the 203 // |avda_instance| will no longer need the construction thread. Stop the
201 // thread if this is the last instance. 204 // thread if this is the last instance.
202 void StopThread(AndroidVideoDecodeAccelerator* avda_instance) { 205 void StopThread(AndroidVideoDecodeAccelerator* avda_instance) {
203 DCHECK(thread_checker_.CalledOnValidThread()); 206 DCHECK(thread_checker_.CalledOnValidThread());
204 207
205 thread_avda_instances_.erase(avda_instance); 208 thread_avda_instances_.erase(avda_instance);
206 if (!thread_avda_instances_.empty()) 209 if (!thread_avda_instances_.empty())
(...skipping 1565 matching lines...) Expand 10 before | Expand all | Expand 10 after
1772 1775
1773 bool AndroidVideoDecodeAccelerator::IsMediaCodecSoftwareDecodingForbidden() 1776 bool AndroidVideoDecodeAccelerator::IsMediaCodecSoftwareDecodingForbidden()
1774 const { 1777 const {
1775 // Prevent MediaCodec from using its internal software decoders when we have 1778 // Prevent MediaCodec from using its internal software decoders when we have
1776 // more secure and up to date versions in the renderer process. 1779 // more secure and up to date versions in the renderer process.
1777 return !config_.is_encrypted && (codec_config_->codec_ == media::kCodecVP8 || 1780 return !config_.is_encrypted && (codec_config_->codec_ == media::kCodecVP8 ||
1778 codec_config_->codec_ == media::kCodecVP9); 1781 codec_config_->codec_ == media::kCodecVP9);
1779 } 1782 }
1780 1783
1781 } // namespace media 1784 } // namespace media
OLDNEW
« no previous file with comments | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698