| 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/media_codec_decoder.h" | 5 #include "media/base/android/media_codec_decoder.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "base/callback_helpers.h" | 9 #include "base/callback_helpers.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 | 111 |
| 112 #ifndef NDEBUG | 112 #ifndef NDEBUG |
| 113 // We check and reset |verify_next_frame_is_key_| on Decoder thread. | 113 // We check and reset |verify_next_frame_is_key_| on Decoder thread. |
| 114 // We have just DCHECKed that decoder thread is not running. | 114 // We have just DCHECKed that decoder thread is not running. |
| 115 | 115 |
| 116 // For video the first frame after flush must be key frame. | 116 // For video the first frame after flush must be key frame. |
| 117 verify_next_frame_is_key_ = true; | 117 verify_next_frame_is_key_ = true; |
| 118 #endif | 118 #endif |
| 119 | 119 |
| 120 if (media_codec_bridge_) { | 120 if (media_codec_bridge_) { |
| 121 // MediaCodecBridge::Reset() performs MediaCodecBridge.flush() | 121 MediaCodecStatus flush_status = media_codec_bridge_->Flush(); |
| 122 MediaCodecStatus flush_status = media_codec_bridge_->Reset(); | |
| 123 if (flush_status != MEDIA_CODEC_OK) { | 122 if (flush_status != MEDIA_CODEC_OK) { |
| 124 DVLOG(0) << class_name() << "::" << __FUNCTION__ | 123 DVLOG(0) << class_name() << "::" << __FUNCTION__ |
| 125 << "MediaCodecBridge::Reset() failed"; | 124 << "MediaCodecBridge::Flush() failed"; |
| 126 media_task_runner_->PostTask(FROM_HERE, internal_error_cb_); | 125 media_task_runner_->PostTask(FROM_HERE, internal_error_cb_); |
| 127 } | 126 } |
| 128 } | 127 } |
| 129 } | 128 } |
| 130 | 129 |
| 131 void MediaCodecDecoder::ReleaseMediaCodec() { | 130 void MediaCodecDecoder::ReleaseMediaCodec() { |
| 132 DCHECK(media_task_runner_->BelongsToCurrentThread()); | 131 DCHECK(media_task_runner_->BelongsToCurrentThread()); |
| 133 | 132 |
| 134 DVLOG(1) << class_name() << "::" << __FUNCTION__; | 133 DVLOG(1) << class_name() << "::" << __FUNCTION__; |
| 135 | 134 |
| (...skipping 865 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1001 RETURN_STRING(kStopping); | 1000 RETURN_STRING(kStopping); |
| 1002 RETURN_STRING(kInEmergencyStop); | 1001 RETURN_STRING(kInEmergencyStop); |
| 1003 RETURN_STRING(kError); | 1002 RETURN_STRING(kError); |
| 1004 } | 1003 } |
| 1005 return nullptr; // crash early | 1004 return nullptr; // crash early |
| 1006 } | 1005 } |
| 1007 | 1006 |
| 1008 #undef RETURN_STRING | 1007 #undef RETURN_STRING |
| 1009 | 1008 |
| 1010 } // namespace media | 1009 } // namespace media |
| OLD | NEW |