| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |