| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_media_codec_decoder.h" | 5 #include "media/base/android/video_media_codec_decoder.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 203 DCHECK(media_task_runner_->BelongsToCurrentThread()); | 203 DCHECK(media_task_runner_->BelongsToCurrentThread()); |
| 204 | 204 |
| 205 start_pts_ = last_seen_pts_ = kNoTimestamp(); | 205 start_pts_ = last_seen_pts_ = kNoTimestamp(); |
| 206 } | 206 } |
| 207 | 207 |
| 208 void VideoMediaCodecDecoder::OnOutputFormatChanged() { | 208 void VideoMediaCodecDecoder::OnOutputFormatChanged() { |
| 209 DCHECK(decoder_thread_.task_runner()->BelongsToCurrentThread()); | 209 DCHECK(decoder_thread_.task_runner()->BelongsToCurrentThread()); |
| 210 | 210 |
| 211 gfx::Size prev_size = video_size_; | 211 gfx::Size prev_size = video_size_; |
| 212 | 212 |
| 213 // See b/18224769. The values reported from MediaCodecBridge::GetOutputFormat | 213 // See b/18224769. The values reported from MediaCodecBridge::GetOutputSize |
| 214 // correspond to the actual video frame size, but this is not necessarily the | 214 // correspond to the actual video frame size, but this is not necessarily the |
| 215 // size that should be output. | 215 // size that should be output. |
| 216 video_size_ = configs_.video_size; | 216 video_size_ = configs_.video_size; |
| 217 if (video_size_ != prev_size) { | 217 if (video_size_ != prev_size) { |
| 218 media_task_runner_->PostTask( | 218 media_task_runner_->PostTask( |
| 219 FROM_HERE, base::Bind(video_size_changed_cb_, video_size_)); | 219 FROM_HERE, base::Bind(video_size_changed_cb_, video_size_)); |
| 220 } | 220 } |
| 221 } | 221 } |
| 222 | 222 |
| 223 void VideoMediaCodecDecoder::Render(int buffer_index, | 223 void VideoMediaCodecDecoder::Render(int buffer_index, |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 347 | 347 |
| 348 // |update_current_time_cb_| might be null if there is audio stream. | 348 // |update_current_time_cb_| might be null if there is audio stream. |
| 349 // Do not update current time for stand-alone EOS frames. | 349 // Do not update current time for stand-alone EOS frames. |
| 350 if (!update_current_time_cb_.is_null() && update_time) { | 350 if (!update_current_time_cb_.is_null() && update_time) { |
| 351 media_task_runner_->PostTask( | 351 media_task_runner_->PostTask( |
| 352 FROM_HERE, base::Bind(update_current_time_cb_, pts, pts, false)); | 352 FROM_HERE, base::Bind(update_current_time_cb_, pts, pts, false)); |
| 353 } | 353 } |
| 354 } | 354 } |
| 355 | 355 |
| 356 } // namespace media | 356 } // namespace media |
| OLD | NEW |