Chromium Code Reviews| 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 bool VideoDecoderJob::UpdateOutputFormat( |
| 157 const base::Closure& config_changed_cb) { | |
| 157 if (!media_codec_bridge_) | 158 if (!media_codec_bridge_) |
| 158 return false; | 159 return true; |
| 159 int prev_output_width = output_width_; | 160 int prev_output_width = output_width_; |
| 160 int prev_output_height = output_height_; | 161 int prev_output_height = output_height_; |
| 161 // See b/18224769. The values reported from MediaCodecBridge::GetOutputFormat | 162 // See b/18224769. The values reported from MediaCodecBridge::GetOutputFormat |
| 162 // correspond to the actual video frame size, but this is not necessarily the | 163 // correspond to the actual video frame size, but this is not necessarily the |
| 163 // size that should be output. | 164 // size that should be output. |
| 164 output_width_ = config_width_; | 165 output_width_ = config_width_; |
| 165 output_height_ = config_height_; | 166 output_height_ = config_height_; |
| 166 return (output_width_ != prev_output_width) || | 167 if ((output_width_ != prev_output_width) || |
| 167 (output_height_ != prev_output_height); | 168 (output_height_ != prev_output_height)) |
| 169 config_changed_cb.Run(); | |
|
qinmin
2015/01/21 02:04:13
nit: {} required for if statement that spans multi
kjoswiak
2015/01/21 03:21:18
Done.
| |
| 170 | |
| 171 return true; | |
| 168 } | 172 } |
| 169 | 173 |
| 170 bool VideoDecoderJob::IsProtectedSurfaceRequired() { | 174 bool VideoDecoderJob::IsProtectedSurfaceRequired() { |
| 171 return is_content_encrypted() && drm_bridge() && | 175 return is_content_encrypted() && drm_bridge() && |
| 172 drm_bridge()->IsProtectedSurfaceRequired(); | 176 drm_bridge()->IsProtectedSurfaceRequired(); |
| 173 } | 177 } |
| 174 | 178 |
| 175 } // namespace media | 179 } // namespace media |
| OLD | NEW |