OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/android/video_decoder_job.h" | 5 #include "media/base/android/video_decoder_job.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/lazy_instance.h" | 8 #include "base/lazy_instance.h" |
9 #include "base/threading/thread.h" | 9 #include "base/threading/thread.h" |
10 #include "media/base/android/media_codec_bridge.h" | 10 #include "media/base/android/media_codec_bridge.h" |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 | 151 |
152 void VideoDecoderJob::CurrentDataConsumed(bool is_config_change) { | 152 void VideoDecoderJob::CurrentDataConsumed(bool is_config_change) { |
153 next_video_data_is_iframe_ = is_config_change; | 153 next_video_data_is_iframe_ = is_config_change; |
154 } | 154 } |
155 | 155 |
156 bool VideoDecoderJob::UpdateOutputFormat() { | 156 bool VideoDecoderJob::UpdateOutputFormat() { |
157 if (!media_codec_bridge_) | 157 if (!media_codec_bridge_) |
158 return false; | 158 return false; |
159 int prev_output_width = output_width_; | 159 int prev_output_width = output_width_; |
160 int prev_output_height = output_height_; | 160 int prev_output_height = output_height_; |
161 media_codec_bridge_->GetOutputFormat(&output_width_, &output_height_); | 161 // See b/18224769. The values reported from MediaCodecBridge::GetOutputFormat |
| 162 // correspond to the actual video frame size, but this is not necessarily the |
| 163 // size that should be output. |
| 164 output_width_ = config_width_; |
| 165 output_height_ = config_height_; |
162 return (output_width_ != prev_output_width) || | 166 return (output_width_ != prev_output_width) || |
163 (output_height_ != prev_output_height); | 167 (output_height_ != prev_output_height); |
164 } | 168 } |
165 | 169 |
166 bool VideoDecoderJob::IsProtectedSurfaceRequired() { | 170 bool VideoDecoderJob::IsProtectedSurfaceRequired() { |
167 return is_content_encrypted() && drm_bridge() && | 171 return is_content_encrypted() && drm_bridge() && |
168 drm_bridge()->IsProtectedSurfaceRequired(); | 172 drm_bridge()->IsProtectedSurfaceRequired(); |
169 } | 173 } |
170 | 174 |
171 } // namespace media | 175 } // namespace media |
OLD | NEW |