| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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/gpu/android_video_decode_accelerator.h" | 5 #include "media/gpu/android_video_decode_accelerator.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 | 10 |
| (...skipping 1258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1269 bitstreams_notified_in_advance_.clear(); | 1269 bitstreams_notified_in_advance_.clear(); |
| 1270 | 1270 |
| 1271 // Any error that is waiting to post can be ignored. | 1271 // Any error that is waiting to post can be ignored. |
| 1272 error_sequence_token_++; | 1272 error_sequence_token_++; |
| 1273 | 1273 |
| 1274 DCHECK(strategy_); | 1274 DCHECK(strategy_); |
| 1275 strategy_->ReleaseCodecBuffers(output_picture_buffers_); | 1275 strategy_->ReleaseCodecBuffers(output_picture_buffers_); |
| 1276 | 1276 |
| 1277 // Some VP8 files require complete MediaCodec drain before we can call | 1277 // Some VP8 files require complete MediaCodec drain before we can call |
| 1278 // MediaCodec.flush() or MediaCodec.reset(). http://crbug.com/598963. | 1278 // MediaCodec.flush() or MediaCodec.reset(). http://crbug.com/598963. |
| 1279 if (media_codec_ && codec_config_->codec_ == media::kCodecVP8) { | 1279 if (media_codec_ && codec_config_->codec_ == media::kCodecVP8 && |
| 1280 !bitstream_buffers_in_decoder_.empty()) { |
| 1280 // Postpone ResetCodecState() after the drain. | 1281 // Postpone ResetCodecState() after the drain. |
| 1281 StartCodecDrain(DRAIN_FOR_RESET); | 1282 StartCodecDrain(DRAIN_FOR_RESET); |
| 1282 } else { | 1283 } else { |
| 1283 ResetCodecState(media::BindToCurrentLoop( | 1284 ResetCodecState(media::BindToCurrentLoop( |
| 1284 base::Bind(&AndroidVideoDecodeAccelerator::NotifyResetDone, | 1285 base::Bind(&AndroidVideoDecodeAccelerator::NotifyResetDone, |
| 1285 weak_this_factory_.GetWeakPtr()))); | 1286 weak_this_factory_.GetWeakPtr()))); |
| 1286 } | 1287 } |
| 1287 } | 1288 } |
| 1288 | 1289 |
| 1289 void AndroidVideoDecodeAccelerator::Destroy() { | 1290 void AndroidVideoDecodeAccelerator::Destroy() { |
| (...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1659 if (media::MediaCodecUtil::IsSurfaceViewOutputSupported()) { | 1660 if (media::MediaCodecUtil::IsSurfaceViewOutputSupported()) { |
| 1660 capabilities.flags |= media::VideoDecodeAccelerator::Capabilities:: | 1661 capabilities.flags |= media::VideoDecodeAccelerator::Capabilities:: |
| 1661 SUPPORTS_EXTERNAL_OUTPUT_SURFACE; | 1662 SUPPORTS_EXTERNAL_OUTPUT_SURFACE; |
| 1662 } | 1663 } |
| 1663 } | 1664 } |
| 1664 | 1665 |
| 1665 return capabilities; | 1666 return capabilities; |
| 1666 } | 1667 } |
| 1667 | 1668 |
| 1668 } // namespace media | 1669 } // namespace media |
| OLD | NEW |