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

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: 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
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_CUSTOM_COUNTS("Media.AVDA.NumAVDAInstances",
rkaplow 2016/07/29 20:31:58 This would be better by using the ENUM macro, like
watk 2016/08/01 18:09:52 Good to know. Done.
198 thread_avda_instances_.size(), 1, 20, 20);
197 return true; 199 return true;
198 } 200 }
199 201
200 // |avda_instance| will no longer need the construction thread. Stop the 202 // |avda_instance| will no longer need the construction thread. Stop the
201 // thread if this is the last instance. 203 // thread if this is the last instance.
202 void StopThread(AndroidVideoDecodeAccelerator* avda_instance) { 204 void StopThread(AndroidVideoDecodeAccelerator* avda_instance) {
203 DCHECK(thread_checker_.CalledOnValidThread()); 205 DCHECK(thread_checker_.CalledOnValidThread());
204 206
205 thread_avda_instances_.erase(avda_instance); 207 thread_avda_instances_.erase(avda_instance);
206 if (!thread_avda_instances_.empty()) 208 if (!thread_avda_instances_.empty())
(...skipping 1565 matching lines...) Expand 10 before | Expand all | Expand 10 after
1772 1774
1773 bool AndroidVideoDecodeAccelerator::IsMediaCodecSoftwareDecodingForbidden() 1775 bool AndroidVideoDecodeAccelerator::IsMediaCodecSoftwareDecodingForbidden()
1774 const { 1776 const {
1775 // Prevent MediaCodec from using its internal software decoders when we have 1777 // Prevent MediaCodec from using its internal software decoders when we have
1776 // more secure and up to date versions in the renderer process. 1778 // more secure and up to date versions in the renderer process.
1777 return !config_.is_encrypted && (codec_config_->codec_ == media::kCodecVP8 || 1779 return !config_.is_encrypted && (codec_config_->codec_ == media::kCodecVP8 ||
1778 codec_config_->codec_ == media::kCodecVP9); 1780 codec_config_->codec_ == media::kCodecVP9);
1779 } 1781 }
1780 1782
1781 } // namespace media 1783 } // namespace media
OLDNEW
« no previous file with comments | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | tools/metrics/histograms/histograms.xml » ('J')

Powered by Google App Engine
This is Rietveld 408576698