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

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

Issue 8417019: Simplify VideoDecodeEngine interface by making everything synchronous. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix for CaptureVideoDecoder Created 9 years, 1 month 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/mock_filters.h ('k') | media/filters/ffmpeg_video_decoder.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) 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 "media/base/limits.h"
10 11
11 namespace media { 12 namespace media {
12 13
13 VideoDecoderConfig::VideoDecoderConfig() 14 VideoDecoderConfig::VideoDecoderConfig()
14 : codec_(kUnknownVideoCodec), 15 : codec_(kUnknownVideoCodec),
15 format_(VideoFrame::INVALID), 16 format_(VideoFrame::INVALID),
16 frame_rate_numerator_(0), 17 frame_rate_numerator_(0),
17 frame_rate_denominator_(0), 18 frame_rate_denominator_(0),
18 aspect_ratio_numerator_(0), 19 aspect_ratio_numerator_(0),
19 aspect_ratio_denominator_(0), 20 aspect_ratio_denominator_(0),
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 // expected by WebKit layout tests. 84 // expected by WebKit layout tests.
84 natural_size_.SetSize(width & ~1, height); 85 natural_size_.SetSize(width & ~1, height);
85 } 86 }
86 87
87 bool VideoDecoderConfig::IsValidConfig() const { 88 bool VideoDecoderConfig::IsValidConfig() const {
88 return codec_ != kUnknownVideoCodec && 89 return codec_ != kUnknownVideoCodec &&
89 format_ != VideoFrame::INVALID && 90 format_ != VideoFrame::INVALID &&
90 frame_rate_numerator_ > 0 && 91 frame_rate_numerator_ > 0 &&
91 frame_rate_denominator_ > 0 && 92 frame_rate_denominator_ > 0 &&
92 aspect_ratio_numerator_ > 0 && 93 aspect_ratio_numerator_ > 0 &&
93 aspect_ratio_denominator_ > 0; 94 aspect_ratio_denominator_ > 0 &&
95 natural_size_.width() <= Limits::kMaxDimension &&
96 natural_size_.height() <= Limits::kMaxDimension &&
97 natural_size_.GetArea() <= Limits::kMaxCanvas;
94 } 98 }
95 99
96 VideoCodec VideoDecoderConfig::codec() const { 100 VideoCodec VideoDecoderConfig::codec() const {
97 return codec_; 101 return codec_;
98 } 102 }
99 103
100 VideoFrame::Format VideoDecoderConfig::format() const { 104 VideoFrame::Format VideoDecoderConfig::format() const {
101 return format_; 105 return format_;
102 } 106 }
103 107
(...skipping 27 matching lines...) Expand all
131 135
132 uint8* VideoDecoderConfig::extra_data() const { 136 uint8* VideoDecoderConfig::extra_data() const {
133 return extra_data_.get(); 137 return extra_data_.get();
134 } 138 }
135 139
136 size_t VideoDecoderConfig::extra_data_size() const { 140 size_t VideoDecoderConfig::extra_data_size() const {
137 return extra_data_size_; 141 return extra_data_size_;
138 } 142 }
139 143
140 } // namespace media 144 } // namespace media
OLDNEW
« no previous file with comments | « media/base/mock_filters.h ('k') | media/filters/ffmpeg_video_decoder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698