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

Side by Side Diff: media/base/video_decoder_config.cc

Issue 1154153003: Relanding 1143663007: VideoFrame: Separate Pixel Format from Storage Type. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added NV12 support in CrOS Created 5 years, 6 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 | « media/base/mac/video_frame_mac_unittests.cc ('k') | media/base/video_frame.h » ('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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/base/video_decoder_config.h" 5 #include "media/base/video_decoder_config.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/metrics/histogram.h" 8 #include "base/metrics/histogram.h"
9 9
10 namespace media { 10 namespace media {
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 UMA_HISTOGRAM_ENUMERATION("Media.VideoCodec", codec, kVideoCodecMax + 1); 71 UMA_HISTOGRAM_ENUMERATION("Media.VideoCodec", codec, kVideoCodecMax + 1);
72 // Drop UNKNOWN because U_H_E() uses one bucket for all values less than 1. 72 // Drop UNKNOWN because U_H_E() uses one bucket for all values less than 1.
73 if (profile >= 0) { 73 if (profile >= 0) {
74 UMA_HISTOGRAM_ENUMERATION("Media.VideoCodecProfile", profile, 74 UMA_HISTOGRAM_ENUMERATION("Media.VideoCodecProfile", profile,
75 VIDEO_CODEC_PROFILE_MAX + 1); 75 VIDEO_CODEC_PROFILE_MAX + 1);
76 } 76 }
77 UMA_HISTOGRAM_COUNTS_10000("Media.VideoCodedWidth", coded_size.width()); 77 UMA_HISTOGRAM_COUNTS_10000("Media.VideoCodedWidth", coded_size.width());
78 UmaHistogramAspectRatio("Media.VideoCodedAspectRatio", coded_size); 78 UmaHistogramAspectRatio("Media.VideoCodedAspectRatio", coded_size);
79 UMA_HISTOGRAM_COUNTS_10000("Media.VideoVisibleWidth", visible_rect.width()); 79 UMA_HISTOGRAM_COUNTS_10000("Media.VideoVisibleWidth", visible_rect.width());
80 UmaHistogramAspectRatio("Media.VideoVisibleAspectRatio", visible_rect); 80 UmaHistogramAspectRatio("Media.VideoVisibleAspectRatio", visible_rect);
81 UMA_HISTOGRAM_ENUMERATION("Media.VideoFormat", format, 81 UMA_HISTOGRAM_ENUMERATION("Media.VideoFramePixelFormat", format,
82 VideoFrame::FORMAT_MAX + 1); 82 VideoFrame::FORMAT_MAX + 1);
83 UMA_HISTOGRAM_ENUMERATION("Media.VideoFrameColorSpace", color_space, 83 UMA_HISTOGRAM_ENUMERATION("Media.VideoFrameColorSpace", color_space,
84 VideoFrame::COLOR_SPACE_MAX + 1); 84 VideoFrame::COLOR_SPACE_MAX + 1);
85 } 85 }
86 86
87 codec_ = codec; 87 codec_ = codec;
88 profile_ = profile; 88 profile_ = profile;
89 format_ = format; 89 format_ = format;
90 coded_size_ = coded_size; 90 coded_size_ = coded_size;
91 visible_rect_ = visible_rect; 91 visible_rect_ = visible_rect;
92 natural_size_ = natural_size; 92 natural_size_ = natural_size;
93 extra_data_.assign(extra_data, extra_data + extra_data_size); 93 extra_data_.assign(extra_data, extra_data + extra_data_size);
94 is_encrypted_ = is_encrypted; 94 is_encrypted_ = is_encrypted;
95 } 95 }
96 96
97 bool VideoDecoderConfig::IsValidConfig() const { 97 bool VideoDecoderConfig::IsValidConfig() const {
98 return codec_ != kUnknownVideoCodec && 98 return codec_ != kUnknownVideoCodec &&
99 natural_size_.width() > 0 && 99 natural_size_.width() > 0 &&
100 natural_size_.height() > 0 && 100 natural_size_.height() > 0 &&
101 VideoFrame::IsValidConfig(format_, coded_size_, visible_rect_, 101 VideoFrame::IsValidConfig(format_, VideoFrame::STORAGE_UNKNOWN,
102 natural_size_); 102 coded_size_, visible_rect_, natural_size_);
103 } 103 }
104 104
105 bool VideoDecoderConfig::Matches(const VideoDecoderConfig& config) const { 105 bool VideoDecoderConfig::Matches(const VideoDecoderConfig& config) const {
106 return ((codec() == config.codec()) && 106 return ((codec() == config.codec()) &&
107 (format() == config.format()) && 107 (format() == config.format()) &&
108 (profile() == config.profile()) && 108 (profile() == config.profile()) &&
109 (coded_size() == config.coded_size()) && 109 (coded_size() == config.coded_size()) &&
110 (visible_rect() == config.visible_rect()) && 110 (visible_rect() == config.visible_rect()) &&
111 (natural_size() == config.natural_size()) && 111 (natural_size() == config.natural_size()) &&
112 (extra_data_size() == config.extra_data_size()) && 112 (extra_data_size() == config.extra_data_size()) &&
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 189
190 size_t VideoDecoderConfig::extra_data_size() const { 190 size_t VideoDecoderConfig::extra_data_size() const {
191 return extra_data_.size(); 191 return extra_data_.size();
192 } 192 }
193 193
194 bool VideoDecoderConfig::is_encrypted() const { 194 bool VideoDecoderConfig::is_encrypted() const {
195 return is_encrypted_; 195 return is_encrypted_;
196 } 196 }
197 197
198 } // namespace media 198 } // namespace media
OLDNEW
« no previous file with comments | « media/base/mac/video_frame_mac_unittests.cc ('k') | media/base/video_frame.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698