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

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

Issue 1117423002: media: Let VideoFrame carry more than one native texture. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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) 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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 profile_ = profile; 84 profile_ = profile;
85 format_ = format; 85 format_ = format;
86 coded_size_ = coded_size; 86 coded_size_ = coded_size;
87 visible_rect_ = visible_rect; 87 visible_rect_ = visible_rect;
88 natural_size_ = natural_size; 88 natural_size_ = natural_size;
89 extra_data_.assign(extra_data, extra_data + extra_data_size); 89 extra_data_.assign(extra_data, extra_data + extra_data_size);
90 is_encrypted_ = is_encrypted; 90 is_encrypted_ = is_encrypted;
91 } 91 }
92 92
93 bool VideoDecoderConfig::IsValidConfig() const { 93 bool VideoDecoderConfig::IsValidConfig() const {
94 return codec_ != kUnknownVideoCodec && 94 return codec_ != kUnknownVideoCodec && natural_size_.width() > 0 &&
95 natural_size_.width() > 0 && 95 natural_size_.height() > 0 &&
96 natural_size_.height() > 0 && 96 VideoFrame::IsValidConfig(format_, VideoFrame::TEXTURE_NONE,
97 VideoFrame::IsValidConfig(format_, coded_size_, visible_rect_, 97 coded_size_, visible_rect_, natural_size_);
98 natural_size_);
99 } 98 }
100 99
101 bool VideoDecoderConfig::Matches(const VideoDecoderConfig& config) const { 100 bool VideoDecoderConfig::Matches(const VideoDecoderConfig& config) const {
102 return ((codec() == config.codec()) && 101 return ((codec() == config.codec()) &&
103 (format() == config.format()) && 102 (format() == config.format()) &&
104 (profile() == config.profile()) && 103 (profile() == config.profile()) &&
105 (coded_size() == config.coded_size()) && 104 (coded_size() == config.coded_size()) &&
106 (visible_rect() == config.visible_rect()) && 105 (visible_rect() == config.visible_rect()) &&
107 (natural_size() == config.natural_size()) && 106 (natural_size() == config.natural_size()) &&
108 (extra_data_size() == config.extra_data_size()) && 107 (extra_data_size() == config.extra_data_size()) &&
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 184
186 size_t VideoDecoderConfig::extra_data_size() const { 185 size_t VideoDecoderConfig::extra_data_size() const {
187 return extra_data_.size(); 186 return extra_data_.size();
188 } 187 }
189 188
190 bool VideoDecoderConfig::is_encrypted() const { 189 bool VideoDecoderConfig::is_encrypted() const {
191 return is_encrypted_; 190 return is_encrypted_;
192 } 191 }
193 192
194 } // namespace media 193 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698