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

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

Issue 8786013: Replace media::Limits struct with media::limits namespace and update documentation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix logic Created 9 years 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 | Annotate | Revision Log
« no previous file with comments | « media/base/limits.h ('k') | media/filters/ffmpeg_demuxer.cc » ('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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 <cmath> 7 #include <cmath>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/metrics/histogram.h" 10 #include "base/metrics/histogram.h"
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 natural_size_.SetSize(width & ~1, height); 113 natural_size_.SetSize(width & ~1, height);
114 } 114 }
115 115
116 bool VideoDecoderConfig::IsValidConfig() const { 116 bool VideoDecoderConfig::IsValidConfig() const {
117 return codec_ != kUnknownVideoCodec && 117 return codec_ != kUnknownVideoCodec &&
118 format_ != VideoFrame::INVALID && 118 format_ != VideoFrame::INVALID &&
119 frame_rate_numerator_ > 0 && 119 frame_rate_numerator_ > 0 &&
120 frame_rate_denominator_ > 0 && 120 frame_rate_denominator_ > 0 &&
121 aspect_ratio_numerator_ > 0 && 121 aspect_ratio_numerator_ > 0 &&
122 aspect_ratio_denominator_ > 0 && 122 aspect_ratio_denominator_ > 0 &&
123 natural_size_.width() <= Limits::kMaxDimension && 123 natural_size_.width() <= limits::kMaxDimension &&
124 natural_size_.height() <= Limits::kMaxDimension && 124 natural_size_.height() <= limits::kMaxDimension &&
125 natural_size_.GetArea() <= Limits::kMaxCanvas; 125 natural_size_.GetArea() <= limits::kMaxCanvas;
126 } 126 }
127 127
128 VideoCodec VideoDecoderConfig::codec() const { 128 VideoCodec VideoDecoderConfig::codec() const {
129 return codec_; 129 return codec_;
130 } 130 }
131 131
132 VideoFrame::Format VideoDecoderConfig::format() const { 132 VideoFrame::Format VideoDecoderConfig::format() const {
133 return format_; 133 return format_;
134 } 134 }
135 135
(...skipping 27 matching lines...) Expand all
163 163
164 uint8* VideoDecoderConfig::extra_data() const { 164 uint8* VideoDecoderConfig::extra_data() const {
165 return extra_data_.get(); 165 return extra_data_.get();
166 } 166 }
167 167
168 size_t VideoDecoderConfig::extra_data_size() const { 168 size_t VideoDecoderConfig::extra_data_size() const {
169 return extra_data_size_; 169 return extra_data_size_;
170 } 170 }
171 171
172 } // namespace media 172 } // namespace media
OLDNEW
« no previous file with comments | « media/base/limits.h ('k') | media/filters/ffmpeg_demuxer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698