blob: 501574d330162bc735a8d1d7e1a25b083e10727d [file] [log] [blame]
chcunningham9812dd82015-10-20 01:42:091// Copyright 2015 The Chromium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#include "media/base/media_util.h"
6
Dan Sanders96732f52018-11-07 00:53:467#include "base/metrics/histogram_macros.h"
John Rummell25a00c72018-03-20 18:01:308#include "media/base/encryption_pattern.h"
9
chcunningham9812dd82015-10-20 01:42:0910namespace media {
11
Dan Sanders96732f52018-11-07 00:53:4612namespace {
13
14// Reported to UMA server. Do not renumber or reuse values.
15enum class MediaVideoHeight {
16 k360_OrLower,
17 k480,
18 k720,
19 k1080,
20 k1440,
21 k2160_OrHigher,
22 kMaxValue = k2160_OrHigher,
23};
24
25MediaVideoHeight GetMediaVideoHeight(int height) {
26 if (height <= 400)
27 return MediaVideoHeight::k360_OrLower;
28 if (height <= 600)
29 return MediaVideoHeight::k480;
30 if (height <= 900)
31 return MediaVideoHeight::k720;
32 if (height <= 1260)
33 return MediaVideoHeight::k1080;
34 if (height <= 1800)
35 return MediaVideoHeight::k1440;
36 return MediaVideoHeight::k2160_OrHigher;
37}
38
39} // namespace
40
chcunningham9812dd82015-10-20 01:42:0941std::vector<uint8_t> EmptyExtraData() {
42 return std::vector<uint8_t>();
43}
44
dougsteed8d5275f2016-03-12 00:04:3045EncryptionScheme Unencrypted() {
46 return EncryptionScheme();
47}
48
49EncryptionScheme AesCtrEncryptionScheme() {
50 return EncryptionScheme(EncryptionScheme::CIPHER_MODE_AES_CTR,
John Rummell25a00c72018-03-20 18:01:3051 EncryptionPattern());
dougsteed8d5275f2016-03-12 00:04:3052}
53
Dan Sanders96732f52018-11-07 00:53:4654void ReportPepperVideoDecoderOutputPictureCountHW(int height) {
55 UMA_HISTOGRAM_ENUMERATION("Media.PepperVideoDecoderOutputPictureCount.HW",
56 GetMediaVideoHeight(height));
57}
58
59void ReportPepperVideoDecoderOutputPictureCountSW(int height) {
60 UMA_HISTOGRAM_ENUMERATION("Media.PepperVideoDecoderOutputPictureCount.SW",
61 GetMediaVideoHeight(height));
62}
63
chcunningham9812dd82015-10-20 01:42:0964} // namespace media