| 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 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 return false; | 146 return false; |
| 147 | 147 |
| 148 request_resources_cb_.Run(); | 148 request_resources_cb_.Run(); |
| 149 return true; | 149 return true; |
| 150 } | 150 } |
| 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 MediaCodecStatus VideoDecoderJob::UpdateOutputFormat() { |
| 157 if (!media_codec_bridge_) | 157 if (!media_codec_bridge_) |
| 158 return false; | 158 return MEDIA_CODEC_OK; |
| 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 // See b/18224769. The values reported from MediaCodecBridge::GetOutputFormat | 161 // See b/18224769. The values reported from MediaCodecBridge::GetOutputFormat |
| 162 // correspond to the actual video frame size, but this is not necessarily the | 162 // correspond to the actual video frame size, but this is not necessarily the |
| 163 // size that should be output. | 163 // size that should be output. |
| 164 output_width_ = config_width_; | 164 output_width_ = config_width_; |
| 165 output_height_ = config_height_; | 165 output_height_ = config_height_; |
| 166 return (output_width_ != prev_output_width) || | 166 if ((output_width_ != prev_output_width) || |
| 167 (output_height_ != prev_output_height); | 167 (output_height_ != prev_output_height)) |
| 168 return MEDIA_CODEC_OUTPUT_FORMAT_CHANGED; |
| 169 |
| 170 return MEDIA_CODEC_OK; |
| 168 } | 171 } |
| 169 | 172 |
| 170 bool VideoDecoderJob::IsProtectedSurfaceRequired() { | 173 bool VideoDecoderJob::IsProtectedSurfaceRequired() { |
| 171 return is_content_encrypted() && drm_bridge() && | 174 return is_content_encrypted() && drm_bridge() && |
| 172 drm_bridge()->IsProtectedSurfaceRequired(); | 175 drm_bridge()->IsProtectedSurfaceRequired(); |
| 173 } | 176 } |
| 174 | 177 |
| 175 } // namespace media | 178 } // namespace media |
| OLD | NEW |