| 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 <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 return STATUS_FAILURE; | 144 return STATUS_FAILURE; |
| 145 | 145 |
| 146 return STATUS_SUCCESS; | 146 return STATUS_SUCCESS; |
| 147 } | 147 } |
| 148 | 148 |
| 149 bool VideoDecoderJob::UpdateOutputFormat() { | 149 bool VideoDecoderJob::UpdateOutputFormat() { |
| 150 if (!media_codec_bridge_) | 150 if (!media_codec_bridge_) |
| 151 return false; | 151 return false; |
| 152 int prev_output_width = output_width_; | 152 int prev_output_width = output_width_; |
| 153 int prev_output_height = output_height_; | 153 int prev_output_height = output_height_; |
| 154 // See b/18224769. The values reported from MediaCodecBridge::GetOutputFormat | 154 // See b/18224769. The values reported from MediaCodecBridge::GetOutputSize |
| 155 // correspond to the actual video frame size, but this is not necessarily the | 155 // correspond to the actual video frame size, but this is not necessarily the |
| 156 // size that should be output. | 156 // size that should be output. |
| 157 output_width_ = config_width_; | 157 output_width_ = config_width_; |
| 158 output_height_ = config_height_; | 158 output_height_ = config_height_; |
| 159 return (output_width_ != prev_output_width) || | 159 return (output_width_ != prev_output_width) || |
| 160 (output_height_ != prev_output_height); | 160 (output_height_ != prev_output_height); |
| 161 } | 161 } |
| 162 | 162 |
| 163 bool VideoDecoderJob::IsProtectedSurfaceRequired() { | 163 bool VideoDecoderJob::IsProtectedSurfaceRequired() { |
| 164 return is_content_encrypted() && drm_bridge() && | 164 return is_content_encrypted() && drm_bridge() && |
| 165 drm_bridge()->IsProtectedSurfaceRequired(); | 165 drm_bridge()->IsProtectedSurfaceRequired(); |
| 166 } | 166 } |
| 167 | 167 |
| 168 } // namespace media | 168 } // namespace media |
| OLD | NEW |